Last active
August 29, 2015 14:16
-
-
Save pnwamk/1ea1de2fb0673dc309a5 to your computer and use it in GitHub Desktop.
contradictory change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; contradictory: Filter/c Filter/c -> boolean? | |
;; Returns true if the AND of the two filters is equivalent to Bot | |
;; OLD contradictory? definition | |
(define (contradictory? f1 f2) | |
(match* (f1 f2) | |
[((TypeFilter: t1 p) (NotTypeFilter: t2 p)) | |
(subtype t1 t2)] | |
[((NotTypeFilter: t2 p) (TypeFilter: t1 p)) | |
(subtype t1 t2)] | |
[((Bot:) _) #t] | |
[(_ (Bot:)) #t] | |
[(_ _) #f])) | |
;; New contradictory? definition | |
(define (contradictory? f1 f2) | |
(match* (f1 f2) | |
[((TypeFilter: t1 p) (NotTypeFilter: t2 p)) | |
(subtype t1 t2)] | |
[((NotTypeFilter: t2 p) (TypeFilter: t1 p)) | |
(subtype t1 t2)] | |
[((TypeFilter: t1 p) (TypeFilter: t2 p)) ;; NEW | |
(not (overlap t1 t2))] ;; NEW | |
[((Bot:) _) #t] | |
[(_ (Bot:)) #t] | |
[(_ _) #f])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment