From 1a7629ea3b2e60228fd0f43185a0b664fc7f99ab Mon Sep 17 00:00:00 2001 From: Stevie Strickland Date: Fri, 13 Jun 2008 09:59:43 -0400 Subject: [PATCH] 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^.. --- collects/typed-scheme/private/constraints.ss | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/collects/typed-scheme/private/constraints.ss b/collects/typed-scheme/private/constraints.ss index f5308b0637..ac00ca1b1d 100644 --- a/collects/typed-scheme/private/constraints.ss +++ b/collects/typed-scheme/private/constraints.ss @@ -25,9 +25,6 @@ ;; X a var (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 ;; - functional maps from vars to c's ;; - dmaps (see dmap.ss) @@ -36,14 +33,18 @@ ;; don't want to rule them out too early (define-struct cset (maps) #:prefab) +;; Widest constraint possible +(define (no-constraint v) + (make-c (Un) v Univ)) + (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))))) #; (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) (match cs