Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Lambda calculus
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Motivation === [[Computable function]]s are a fundamental concept within computer science and mathematics. The lambda calculus provides simple [[Semantics#Computer science|semantics]] for computation which are useful for formally studying properties of computation. The lambda calculus incorporates two simplifications that make its semantics simple. {{anchor|anonymousForm}}The first simplification is that the lambda calculus treats functions "anonymously"; it does not give them explicit names. For example, the function : <math>\operatorname{square\_sum}(x, y) = x^2 + y^2</math> can be rewritten in ''anonymous form'' as : <math>(x, y) \mapsto x^2 + y^2</math> (which is read as "a [[tuple]] of {{mvar|x}} and {{mvar|y}} is [[maplet|mapped]] to <math display="inline">x^2 + y^2</math>").{{efn|name= mapsTo}} Similarly, the function : <math>\operatorname{id}(x) = x</math> can be rewritten in anonymous form as : <math>x \mapsto x</math> where the input is simply mapped to itself.{{efn|name= mapsTo|1= <math> \mapsto </math> is pronounced "[[maplet|maps to]]".}} The second simplification is that the lambda calculus only uses functions of a single input. An ordinary function that requires two inputs, for instance the <math display="inline">\operatorname{square\_sum}</math> function, can be reworked into an equivalent function that accepts a single input, and as output returns ''another'' function, that in turn accepts a single input. For example, : <math>(x, y) \mapsto x^2 + y^2</math> can be reworked into : <math>x \mapsto (y \mapsto x^2 + y^2)</math> This method, known as [[currying]], transforms a function that takes multiple arguments into a chain of functions each with a single argument. [[Function application]] of the <math display="inline">\operatorname{square\_sum}</math> function to the arguments (5, 2), yields at once : <math display="inline">((x, y) \mapsto x^2 + y^2)(5, 2)</math> : <math display="inline"> = 5^2 + 2^2 </math> : <math display="inline"> = 29</math>, whereas evaluation of the curried version requires one more step : <math display="inline">\Bigl(\bigl(x \mapsto (y \mapsto x^2 + y^2)\bigr)(5)\Bigr)(2)</math> : <math display="inline"> = (y \mapsto 5^2 + y^2)(2)</math> // the definition of <math>x</math> has been used with <math>5</math> in the inner expression. This is like Ξ²-reduction. : <math display="inline"> = 5^2 + 2^2</math> // the definition of <math>y</math> has been used with <math>2</math>. Again, similar to Ξ²-reduction. : <math display="inline"> = 29 </math> to arrive at the same result.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)