can't deduce the numeral representation (church encoding) of a lambda expression λx.λy.x(xy) -
i have lambda expression: λx.λy.x(xy), , i'm supposed infer integer representation of it. i've read lot church encodings , church numerals can't find number is. can explain me in way 3 year old can understand or refer me resource better wikipedia?
church encoding of integers following:
"0" ≡ (λf.(λx.x)): think of(λf.(λx.x))meaning: given functionf, elementx, resultx: it's applying functionf0 timesx."1" ≡ (λf.(λx.(fx))): think of(λf.(λx.(fx)))meaning: given functionf, elementx, result(fx): should thought of applyfxor, in more standard mathematical notation, f(x)."2" ≡ (λf.(λx.(f(fx)))): think of(λf.(λx.(f(fx))))meaning: given functionf, elementx, result(f(fx)): should thought of applyfxtwice or, in more standard mathematical notation, f(f(x))."3" ≡ (λf.(λx.(f(f(fx))))): think of(λf.(λx.(f(f(fx)))))meaning: given functionf, elementx, result(f(f(fx))): should thought of applyfxthree times or, in more standard mathematical notation, f(f(f(x))).
i hope see pattern (and logic behind). in case, (λx.(λy.(x(xy)))) church encoding of number 2 (using alpha-equivalence, of course).
the wikiped article quite clear. don't understand?
Comments
Post a Comment