Created
January 18, 2009 20:21
-
-
Save patrickt/48754 to your computer and use it in GitHub Desktop.
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
(require srfi/1) | |
(define || (lambda (x y) (or x y))) | |
(define && (lambda (x y) (and x y))) | |
(define --> | |
(lambda (x y) | |
(not (and x (not y))))) | |
(define interpret | |
(lambda (f) | |
(list-of (list (f x y z) (list x y z)) | |
(x <- '(#t #f)) | |
(y <- '(#t #f)) | |
(z <- '(#t #f))))) | |
(define helper | |
(lambda (m s f) | |
(list-of (m n) | |
(n <- (filter s (interpret f)))))) | |
(define valid? | |
(lambda (f) | |
(every | |
(lambda (x) x) | |
(helper car (lambda (x) #t) f)))) | |
(define models | |
(lambda (f) | |
(helper cadr (lambda (x) (car x))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment