Created
January 20, 2019 20:35
-
-
Save geekosaur/d4df269636f29bf78bb5f6b2fab8ed78 to your computer and use it in GitHub Desktop.
lambda calculus example - DukeDrake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(\g.\f.\x. g f (f x)) (\f.\x. x) | |
(\g. \f0. \x0. g f0 (f0 x0)) (\f1. \x1. x1) -- alpha rename to avoid collisions | |
\f0. \x0. (\f1. \x1. x1) f0 (f0 x0) -- apply parameter for g | |
g = (\f1. \x1. x1) | |
\f0. \x0. f0 x0 -- apply parameters to inner lambda and reduce | |
f1 = f0 | |
x1 = f0 x0 | |
reduction of (\f1. \x1. x1) eliminates f1 and produces x1 | |
one can now further note that the above is essentially id, because it takes | |
f0 x0 and produces f0 x0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment