macro-stepper: simplified partition code
original commit: e9a8e92585e029410245f30c218ce8cbebe15fb3
This commit is contained in:
parent
fc8ab37c3f
commit
ddc9d3e953
|
@ -83,22 +83,16 @@
|
|||
;; simplified : hash[(listof nat) => nat]
|
||||
(define simplified (make-hash))
|
||||
|
||||
;; unsimplified : hash[(listof nat) => nat]
|
||||
(define unsimplified (make-hash))
|
||||
|
||||
;; next-number : nat
|
||||
(define next-number 0)
|
||||
|
||||
(define/public (get-partition stx)
|
||||
(let ([umarks (get-marks stx)])
|
||||
(or (hash-ref unsimplified umarks #f)
|
||||
(let ([smarks (simplify-marks umarks)])
|
||||
(or (hash-ref simplified smarks #f)
|
||||
(let ([marks (simplify-marks (get-marks stx))])
|
||||
(or (hash-ref simplified marks #f)
|
||||
(let ([n next-number])
|
||||
(hash-set! simplified smarks n)
|
||||
(hash-set! unsimplified umarks n)
|
||||
(hash-set! simplified marks n)
|
||||
(set! next-number (add1 n))
|
||||
n))))))
|
||||
n))))
|
||||
|
||||
(define/public (same-partition? a b)
|
||||
(= (get-partition a) (get-partition b)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user