Penguin
Diff: LambdaCalculus
EditPageHistoryDiffInfoLikePages

Differences between version 4 and predecessor to the previous major change of LambdaCalculus.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 4 Last edited on Friday, October 24, 2003 12:56:22 pm by PerryLorier Revert
Older page: version 1 Last edited on Friday, October 24, 2003 11:49:11 am by StuartYeates Revert
@@ -1,3 +1,38 @@
 A conceptual model of computers based on defining and evaluating functions. Of current ProgrammingLanguages, [LISP], [Scheme] and [Haskell] best expose this conceptual model. 
  
 One of the fundamental proofs in ComputerScience is that any result calculatable in LambdaCalculus is calculatable on a FiniteStateMachine. 
+  
+(From memory:)  
+  
+LambdaCalculus is based on the idea that you have two types of rewrite rules, one where you change the names of variables, and one where you replace a variable with it's expansion. And thats it.  
+  
+For instance, if we define "one" as a function which outputs it's argument once, we have:  
+  
+ one = Λx(x)  
+  
+then the successor function might be defined as  
+ successor = Λx.y(x y y)  
+  
+so "successor one" is  
+ two = successor one  
+ two = Λx.y(x y y) Λx(x)  
+now we do an alpha reduction (rename some variables)  
+ two = Λx.y(x y y) Λz(z)  
+now we do a beta reduction (replace x with it's value (Λz(z))  
+ two = Λy(Λz(z) y y)  
+and a beta reduction on z  
+ two = Λy(y y)  
+we now have a function that outputs it's argument twice.  
+  
+Three is obvious  
+ three = sucessor two  
+which eventually expands to  
+ three = Λx(x x x)  
+  
+Addiction is easy  
+ addition = Λx.y.z(x z y z)  
+  
+ five = add two three  
+ five = Λx.y.z(x z y z) Λa(a a) Λa(a a a)  
+ five = Λz(Λa(a a) z Λa(a a a) z)  
+ five = Λz(z z z z z)