home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / scheme / 2018 next >
Encoding:
Internet Message Format  |  1992-08-12  |  963 b 

  1. Path: sparky!uunet!mcsun!sunic!dkuug!diku!torbenm
  2. From: torbenm@diku.dk (Torben AEgidius Mogensen)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: How to define mult function of Church Numerals by lambda calculus?
  5. Keywords: Church Numberals/Lambda calculus
  6. Message-ID: <1992Aug12.140114.9046@odin.diku.dk>
  7. Date: 12 Aug 92 14:01:14 GMT
  8. References: <cyen.713461957@ponder>
  9. Sender: torbenm@gere.diku.dk
  10. Organization: Department of Computer Science, U of Copenhagen
  11. Lines: 25
  12.  
  13. Jesse writes:
  14.  
  15. >The Church Numerals are defined:
  16. >0'=lambda f.lambda x.x
  17. >1'=lambda f.lambda x.f x
  18. >2'=lambda f.lambda x.f (f x)
  19. >......
  20.  
  21. >n'=lambda f.lambda x.f^n x
  22.  
  23. >Thus adding two Church Numerals:
  24.  
  25. >add=lambda m.lambda n.lambda f.lambda x.m f (n f x)
  26.  
  27. >m,n are Church Numerals
  28.  
  29. >My problem is: how to define mult, which multiplies two Church Numerals m,n.
  30.  
  31. mult = lambda m. lambda n. lambda f. m (n f)
  32.  
  33. pow = lambda m. lambda n . m n
  34.  
  35. where pow m n = n^m.
  36.  
  37.     Torben Mogensen (torbenm@diku.dk)
  38.