I’m sure many other people have something like this, but here’s “Lab 5” from my
currently-running PL course:
https://www.brinckerhoff.org/clements/2202-csc430/Labs/lab5.html
It introduces church numeral encodings and also this kind of true-false
encoding as small programming challenges in
On 2/17/2020 12:12 PM, Lawrence Bottorff wrote:
I found these blowing down the sidewalk today
; TRUE = λx.λy.x
(define mytrue
(lambda (t) (lambda (f) t)))
and
; FALSE = λx.λy.y
(define myfalse
(lambda (t) (lambda (f) f)))
Two problems, I don't understand them and AFAICT, they don't
Hi,
The idea is that you can encode an expression
"if B then P else Q"
as a λ-term BPQ. So if B is true, you get P, otherwise Q.
For an overview of λ-calculus I suggest reading this:
https://ecee.colorado.edu/ecen5533/fall11/reading/lambda_types.pdf
The encoding of boolean expressions is
I found these blowing down the sidewalk today
; TRUE = λx.λy.x
(define mytrue
(lambda (t) (lambda (f) t)))
and
; FALSE = λx.λy.y
(define myfalse
(lambda (t) (lambda (f) f)))
Two problems, I don't understand them and AFAICT, they don't work. I traced
them back to this
4 matches
Mail list logo