Results 1 to 1 of 1
Thread: Church numerals
 05132011, 07:49 AM #1
 Join Date
 Jan 2011
 Location
 Richmond, Virginia
 Posts
 3,069
 Blog Entries
 3
 Rep Power
 8
Church numerals
I'm looking for some help in understanding this question in sicp, 2.6:
If zero is
Java Code:(define zero(lambda(f)(lambda(x)x)))
Java Code:(define(add1 n) (lambda(f)(lambda(x)(f((n f)x)))))
Zero takes an argument and returns a procedure which simple produces the identity of an argument, is this correct thinking? If so, how is this zero? Wouldn't it be dependent on the input argument?
I'm wondering, is there a way to formulate this with less use of lambda? I'm trying to but I am having a hard time. I'm thinking if I see it without the lbda it may make more sense.
I'm just looking for a bit of help in really understanding it.
Edit: I read up on church numerals and believe I understand it more, basically zero isn't representing the numerical 0, instead an abstraction of the idea of zero. In this case it applies the passed in argument 0 times, correct?
So add 1 will simply increase the amount of times the procedure will be applied to x, in the case of zero, add1 will change zero to one, or
Java Code:(define one (lambda(f) (lambda(x) (f x))))
Java Code:(define three (lambda(f) (lambda(x) (f(f(f x)))))) (three inc 0) would be 3 right? (define(inc x) (+ x 1))
Last edited by sunde887; 05132011 at 08:19 AM.
Similar Threads

Convert the number to Roman numerals
By ŖàΫ ỏƒ Ңόρę in forum New To JavaReplies: 9Last Post: 11292012, 10:44 PM 
Convert roman numerals
By matzahboy in forum New To JavaReplies: 4Last Post: 02212010, 10:06 PM 
convert from roman numerals to integers and vice versa
By number1cynic in forum New To JavaReplies: 10Last Post: 01182010, 11:54 PM 
Convert roman numerals to integers
By Felissa in forum Advanced JavaReplies: 2Last Post: 07012007, 11:27 PM
Bookmarks