Pretty sure clist is going the way of the dodo, so I want this to
break for now if we use it. Also abstracting out the way you say "Here's a variable with no constraints," though this might not end up being used anywhere else anyway, so I'll not export it yet from constraints^..
This commit is contained in:
parent
34315ea7b3
commit
1a7629ea3b
|
@ -25,9 +25,6 @@
|
||||||
;; X a var
|
;; X a var
|
||||||
(define-struct c (S X T) #:prefab)
|
(define-struct c (S X T) #:prefab)
|
||||||
|
|
||||||
;; Struct containing a list of cs
|
|
||||||
(define-struct clist (cs) #:prefab)
|
|
||||||
|
|
||||||
;; maps is a list of pairs of
|
;; maps is a list of pairs of
|
||||||
;; - functional maps from vars to c's
|
;; - functional maps from vars to c's
|
||||||
;; - dmaps (see dmap.ss)
|
;; - dmaps (see dmap.ss)
|
||||||
|
@ -36,14 +33,18 @@
|
||||||
;; don't want to rule them out too early
|
;; don't want to rule them out too early
|
||||||
(define-struct cset (maps) #:prefab)
|
(define-struct cset (maps) #:prefab)
|
||||||
|
|
||||||
|
;; Widest constraint possible
|
||||||
|
(define (no-constraint v)
|
||||||
|
(make-c (Un) v Univ))
|
||||||
|
|
||||||
(define (empty-cset X)
|
(define (empty-cset X)
|
||||||
(make-cset (list (cons (for/hash ([x X]) (values x (make-c (Un) x Univ)))
|
(make-cset (list (cons (for/hash ([x X]) (values x (no-constraint x)))
|
||||||
(make-immutable-hash null)))))
|
(make-immutable-hash null)))))
|
||||||
|
|
||||||
|
|
||||||
#;
|
#;
|
||||||
(define (lookup cset var)
|
(define (lookup cset var)
|
||||||
(hash-ref (cset-map cset) var (make-c (Un) var Univ)))
|
(hash-ref (cset-map cset) var (no-constraint var)))
|
||||||
|
|
||||||
(define (insert cs var S T)
|
(define (insert cs var S T)
|
||||||
(match cs
|
(match cs
|
||||||
|
|
Loading…
Reference in New Issue
Block a user