10.07.2015 Views

An Introduction to Functional Programming Through Lambda Calculus

An Introduction to Functional Programming Through Lambda Calculus

An Introduction to Functional Programming Through Lambda Calculus

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

- 222 -6)i) λx.λy.(λz.y λa.x)ii)λx.(x (λy.(λz.z y) x))iii) λa.(λb.a λb.(λc.c b))v) λp.λq.(λr.(p (λq.(λs.(r q)))) (q p))Chapter 31)def implies = λx.λy.(x y true)implies false false => ... => false false true => ... => trueimplies false true => ... => false true true => ... => trueimplies true false => ... => true false true => ... => falseimplies true true => ... => true true true => ... => true2)def equiv = λx.λy.(x y (not y)equiv false false => ... => false false (not false) => ... => trueequiv false true => ... => false true (not true) => ... => falseequiv true false => ... => true false (not false) => ... => falseequiv true true => ... => true true (not true) => ... => true3)i) a) λx.λy.(and (not x) (not y)) false false => ... =>and (not false) (not false) => ... =>(not false) (not false) false) => ... =>true (not false) false => ... =>not false => ... => trueλx.λy.(and (not x) (not y)) false true => ... =>and (not false) (not true) => ... =>(not false) (not true) false => ... =>true (not true) false => ... =>not true => ... => falseλx.λy.(and (not x) (not y)) true false => ... =>and (not true) (not false) => ... =>(not true) (not false) false => ... =>false (not false) false => .. => falseλx.λy.(and (not x) (not y)) true true => ... =>and (not true) (not true)(not true) (not true) false => ... =>false (not true) false => ... => falseb) λx.λy.(not (or x y)) false false => ... =>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!