The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: sg | March 8, 2008 @ 8:36pm
PHP Code
[
Download
]
Problem 1 a) set-equalp = (and (set-equalp x x) ((set-equalp x y) => (set-equalp y x)) ((and (set-equalp x y) (set-equalp y z)) => (set-equalp x z))) Reflexive (set-equalp x x) = T Proof - (set-equalp x x) || by def. of setequalp (and (set-subsetp x x) (set-subsetp x x))) || by def. of set-subsetp (and (if (endp x) t (and (set-memberp (car x) x) (set-subsetp (cdr x) x)))) (if (endp x) t (and (set-memberp (car x) x) (set-subsetp (cdr x) x)))) || I chose not to expand this any further (by def. of set-memberp), just because it would become too messy and unreadable. However, (set-subsetp x x) always returns T. This is because (set-memberp (car x) x) obviously always returns true because an element of set �x� is always going to be in set �x�. Eventually (set-subsetp x x) will run (set-memberp) on every element of x and the function will return T (and (T (T)) || and axiom T.. Therefore, set-equalp is reflexive
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.40 / 8
163 Votes
http://codebin.yi.org/119
page generated in 0.01 seconds