home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / scheme / 2034 < prev    next >
Encoding:
Text File  |  1992-08-14  |  1.1 KB  |  39 lines

  1. Newsgroups: comp.lang.scheme
  2. Path: sparky!uunet!cs.utexas.edu!mercury.unt.edu!ponder!cyen
  3. From: Jesse
  4. Subject: Correction of [Summary of Church Numeral]
  5. Message-ID: <cyen.713872469@ponder>
  6. Summary: Church Numeral
  7. Originator: cyen@ponder.csci.unt.edu
  8. Keywords: Church Numeral
  9. Sender: usenet@mercury.unt.edu (UNT USENet Adminstrator)
  10. Organization: Computer Science Dept .of UNT
  11. Date: Sat, 15 Aug 1992 09:54:29 GMT
  12. Lines: 25
  13.  
  14. Days ago I said when m=zero the mult and expt functions will go wrong.
  15. Maybe because of the evaluation order of ML , these functions cannot be
  16. tested right.
  17.  
  18. The lambda expression of these two functions are absolutely right.
  19.  
  20. mult=\m.\n.\f.\x. m (n f) x
  21. expt=\m.\n.\f.\x. m n f x
  22.  
  23. Besides the substraction function of two Church Numerals is:
  24.  
  25. sub=\m.\n.n pre m
  26.  
  27. whereas pre=\n.\f.\x.snd (n (prefn f) (pair x x))
  28.         prefn=\f.\p.pair (f (fst p))(fst p)
  29.         pair=\x.\y.\f.f x y
  30.         fst=\p.p true
  31.         snd=\p.p false
  32.         true=\x.\y.x
  33.         false=\x.\y.y
  34.  
  35. Sorry for the mistake I made in the last post, please post if you know
  36. any interesting stuff on Church Numeral.
  37.  
  38. Jesse
  39.