Created
September 27, 2011 05:43
-
-
Save gavinwahl/1244417 to your computer and use it in GitHub Desktop.
relation algebra
This file contains hidden or 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
(define (zip-cons a b) | |
(if (null? a) | |
'() | |
(cons (cons (car a) (car b)) | |
(zip-cons (cdr a) (cdr b))))) | |
(define (p c r) | |
(cond | |
((null? c) (map (lambda (x) '()) r)) | |
((eq? (car c) (caar r)) | |
(zip-cons | |
(map car r) | |
(p (cdr c) (map cdr r)))) | |
(else (p c (map cdr r))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment