Fix implied-atomic to work on -top and -bot.
This commit is contained in:
parent
f7536ebfbd
commit
9e2787c0cf
|
@ -36,9 +36,10 @@
|
||||||
|
|
||||||
;; is f1 implied by f2?
|
;; is f1 implied by f2?
|
||||||
(define (implied-atomic? f1 f2)
|
(define (implied-atomic? f1 f2)
|
||||||
(if (filter-equal? f1 f2)
|
|
||||||
#t
|
|
||||||
(match* (f1 f2)
|
(match* (f1 f2)
|
||||||
|
[(f f) #t]
|
||||||
|
[((Top:) _) #t]
|
||||||
|
[(_ (Bot:)) #t]
|
||||||
[((OrFilter: fs) f2)
|
[((OrFilter: fs) f2)
|
||||||
(memf (lambda (f) (filter-equal? f f2)) fs)]
|
(memf (lambda (f) (filter-equal? f f2)) fs)]
|
||||||
[((TypeFilter: t1 p1 i1)
|
[((TypeFilter: t1 p1 i1)
|
||||||
|
@ -49,7 +50,7 @@
|
||||||
(NotTypeFilter: t1 p1 i1))
|
(NotTypeFilter: t1 p1 i1))
|
||||||
(and (name-ref=? i1 i2)
|
(and (name-ref=? i1 i2)
|
||||||
(subtype t2 t1))]
|
(subtype t2 t1))]
|
||||||
[(_ _) #f])))
|
[(_ _) #f]))
|
||||||
|
|
||||||
(define (hash-name-ref i)
|
(define (hash-name-ref i)
|
||||||
(if (identifier? i) (hash-id i) i))
|
(if (identifier? i) (hash-id i) i))
|
||||||
|
|
|
@ -39,8 +39,14 @@
|
||||||
-top -top)
|
-top -top)
|
||||||
(check implied-atomic?
|
(check implied-atomic?
|
||||||
-bot -bot)
|
-bot -bot)
|
||||||
|
(check implied-atomic?
|
||||||
|
-top -bot)
|
||||||
(check not-implied-atomic?
|
(check not-implied-atomic?
|
||||||
-bot -top)
|
-bot -top)
|
||||||
|
(check implied-atomic?
|
||||||
|
-top (-filter -Symbol 0))
|
||||||
|
(check implied-atomic?
|
||||||
|
(-filter -Symbol 0) -bot)
|
||||||
(check implied-atomic?
|
(check implied-atomic?
|
||||||
(-filter (Un -String -Symbol) 0)
|
(-filter (Un -String -Symbol) 0)
|
||||||
(-filter -Symbol 0))
|
(-filter -Symbol 0))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user