Let expression
   HOME

TheInfoList



OR:

In computer science, a "let" expression associates a
function Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-oriente ...
definition with a restricted
scope Scope or scopes may refer to: People with the surname * Jamie Scope (born 1986), English footballer * John T. Scopes (1900–1970), central figure in the Scopes Trial regarding the teaching of evolution Arts, media, and entertainment * Cinem ...
. The "let" expression may also be defined in mathematics, where it associates a Boolean condition with a restricted scope. The "let" expression may be considered as a
lambda abstraction Lambda calculus (also written as ''λ''-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation tha ...
applied to a value. Within mathematics, a let expression may also be considered as a
conjunction Conjunction may refer to: * Conjunction (grammar), a part of speech * Logical conjunction, a mathematical operator ** Conjunction introduction, a rule of inference of propositional logic * Conjunction (astronomy), in which two astronomical bodies ...
of expressions, within an
existential quantifier In predicate logic, an existential quantification is a type of quantifier, a logical constant which is interpreted as "there exists", "there is at least one", or "for some". It is usually denoted by the logical operator symbol ∃, which, w ...
which restricts the scope of the variable. The let expression is present in many functional languages to allow the local definition of expression, for use in defining another expression. The let-expression is present in some functional languages in two forms; let or "let rec". Let rec is an extension of the simple let expression which uses the
fixed-point combinator In mathematics and computer science in general, a '' fixed point'' of a function is a value that is mapped to itself by the function. In combinatory logic for computer science, a fixed-point combinator (or fixpoint combinator) is a higher-order ...
to implement
recursion Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematics ...
.


History

Dana Scott Dana Stewart Scott (born October 11, 1932) is an American logician who is the emeritus Hillman University Professor of Computer Science, Philosophy, and Mathematical Logic at Carnegie Mellon University; he is now retired and lives in Berkeley, Ca ...
's LCF language was a stage in the evolution of lambda calculus into modern functional languages. This language introduced the let expression, which has appeared in most functional languages since that time. The languages
Scheme A scheme is a systematic plan for the implementation of a certain idea. Scheme or schemer may refer to: Arts and entertainment * ''The Scheme'' (TV series), a BBC Scotland documentary series * The Scheme (band), an English pop band * ''The Schem ...
, ML, and more recently
Haskell Haskell () is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research and industrial applications, Haskell has pioneered a number of programming lan ...
have inherited let expressions from LCF. Stateful imperative languages such as
ALGOL ALGOL (; short for "Algorithmic Language") is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the ...
and
Pascal Pascal, Pascal's or PASCAL may refer to: People and fictional characters * Pascal (given name), including a list of people with the name * Pascal (surname), including a list of people and fictional characters with the name ** Blaise Pascal, Fren ...
essentially implement a let expression, to implement restricted scope of functions, in block structures. A closely related "where" clause, together with its recursive variant "where rec", appeared already in
Peter Landin Peter John Landin (5 June 1930 – 3 June 2009) was a British computer scientist. He was one of the first to realise that the lambda calculus could be used to model a programming language, an insight that is essential to the development of bo ...
's ''The mechanical evaluation of expressions''.


Description

A "let" expression defines a function or value for use in another expression. As well as being a construct used in many functional programming languages, it is a natural language construct often used in mathematical texts. It is an alternate syntactical construct for a where clause. In both cases the whole construct is an expression whose value is 5. Like the
if-then-else In computer science, conditionals (that is, conditional statements, conditional expressions and conditional constructs,) are programming language commands for handling decisions. Specifically, conditionals perform different computations or actio ...
the type returned by the expression is not necessarily Boolean. A let expression comes in 4 main forms, In functional languages the ''let'' expression defines functions which may be called in the expression. The scope of the function name is limited to the let expression structure. In mathematics, the let expression defines a condition, which is a constraint on the expression. The syntax may also support the declaration of existentially quantified variables local to the let expression. The terminology, syntax and semantics vary from language to language. In
Scheme A scheme is a systematic plan for the implementation of a certain idea. Scheme or schemer may refer to: Arts and entertainment * ''The Scheme'' (TV series), a BBC Scotland documentary series * The Scheme (band), an English pop band * ''The Schem ...
, ''let'' is used for the simple form and ''let rec'' for the recursive form. In ML ''let'' marks only the start of a block of declarations with ''fun'' marking the start of the function definition. In Haskell, ''let'' may be mutually recursive, with the compiler figuring out what is needed.


Definition

A
lambda abstraction Lambda calculus (also written as ''λ''-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation tha ...
represents a function without a name. This is a source of the inconsistency in the definition of a lambda abstraction. However lambda abstractions may be composed to represent a function with a name. In this form the inconsistency is removed. The lambda term, : (\lambda f.z)\ (\lambda x.y) is equivalent to defining the function f by f\ x = y in the expression z, which may be written as the ''let'' expression; :\operatorname f\ x = y \operatorname z The let expression is understandable as a natural language expression. The let expression represents the substitution of a variable for a value. The substitution rule describes the implications of equality as substitution.


Let definition in mathematics

In
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
the ''let'' expression is described as the conjunction of expressions. In functional languages the let expression is also used to limit scope. In mathematics scope is described by quantifiers. The let expression is a conjunction within an existential quantifier. : (\exists x E \land F) \iff \operatorname x : E \operatorname F where ''E'' and ''F'' are of type Boolean. The ''let'' expression allows the substitution to be applied to another expression. This substitution may be applied within a restricted scope, to a sub expression. The natural use of the let expression is in application to a restricted scope (called lambda dropping). These rules define how the scope may be restricted; :\begin x \not \in \operatorname(E) \land x \in \operatorname(F) \implies \operatorname x : G \operatorname E\ F = E\ (\operatorname x : G \operatorname F)\\ x \in \operatorname(E) \land x \not \in \operatorname(F) \implies \operatorname x : G \operatorname E\ F = (\operatorname x : G \operatorname E)\ F\\ x \not \in \operatorname(E) \land x \not \in \operatorname(F) \implies \operatorname x : G \operatorname E\ F = E\ F \end where ''F'' is not of type Boolean. From this definition the following standard definition of a let expression, as used in a functional language may be derived. : x \not \in \operatorname(y) \implies (\operatorname x : x = y \operatorname z) = z := y= (\lambda x.z)\ y For simplicity the marker specifying the existential variable, x :, will be omitted from the expression where it is clear from the context. : x \not \in \operatorname(y) \implies (\operatorname x = y \operatorname z) = z := y= (\lambda x.z)\ y


Derivation

To derive this result, first assume, : x \not \in \operatorname(L) then :\begin L\ (\operatorname x : x = y \operatorname z) & \iff (\operatorname x : x = y \operatorname L\ z) \\ & \iff x = y \land L\ z \end Using the rule of substitution, :\begin & \iff x = y \land(L\ z) :=y\ & \iff x = y \land(L :=y z :=y\\ & \iff x = y \land L\ z :=y\ & \implies L\ z :=y\end so for all ''L'', : L \operatorname x : x = y \operatorname z \implies L\ z :=y/math> Let L\ X = (X = K) where ''K'' is a new variable. then, : (\operatorname x : x = y \operatorname z) = K \implies z :=y= K So, : \operatorname x : x = y \operatorname z = z :=y/math> But from the mathematical interpretation of a beta reduction, : (\lambda x.z)\ y = z :=y/math> Here if y is a function of a variable x, it is not the same x as in z. Alpha renaming may be applied. So we must have, : x \not \in \operatorname(y) so, : x \not \in \operatorname(y) \implies \operatorname x : x = y \operatorname z = (\lambda x.z)\ y This result is represented in a functional language in an abbreviated form, where the meaning is unambiguous; : x \not \in \operatorname(y) \implies (\operatorname x = y \operatorname z) = z := y= (\lambda x.z)\ y Here the variable ''x'' is implicitly recognised as both part of the equation defining x, and the variable in the existential quantifier.


No lifting from Boolean

A contradiction arises if E is defined by E = \neg . In this case, : x \not \in \operatorname(E) \land x \in \operatorname(F) \implies \operatorname x : G \operatorname E\ F = E\ (\operatorname x : G \operatorname F) becomes, : \operatorname x : G \operatorname \neg F = \neg\ (\operatorname x : G \operatorname F) and using, : (\exists x E \land F) \iff \operatorname x : E \operatorname F : (\exists x G \land \neg F) = \neg\ (\exists x G \land F) : = (\exists x \neg G \lor \neg F) This is false if G is false. To avoid this contradiction ''F'' is not allowed to be of type Boolean. For Boolean ''F'' the correct statement of the dropping rule uses implication instead of equality, : x \not \in \operatorname(E) \land x \in \operatorname(F) \implies (\operatorname x : G \operatorname E\ F \to E\ (\operatorname x : G \operatorname F)) It may appear strange that a different rule applies for Boolean than other types. The reason for this is that the rule, : (\exists x E \land F) \iff \operatorname x : E \operatorname F only applies where ''F'' is Boolean. The combination of the two rules creates a contradiction, so where one rule holds, the other does not.


Joining let expressions

Let expressions may be defined with multiple variables, : (\exists v \cdots \exists w \exists x E \land F) \iff \operatorname v, \ldots ,w , x : E \operatorname F then it can be derived, : x \not \in FV(E) \implies (\exists v \cdots \exists w \exists x E \land F) \iff (\exists v \cdots \exists w (E \land \exists x F)) so, : x \not \in FV(E) \implies (\operatorname v, \ldots, w, x : E \land F \operatorname L \equiv \operatorname v, \ldots, w: E \operatorname \operatorname x : F \operatorname L)


Laws relating lambda calculus and let expressions

The
Eta reduction Lambda calculus (also written as ''λ''-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation ...
gives a rule for describing lambda abstractions. This rule along with the two laws derived above define the relationship between lambda calculus and let expressions.


Let definition defined from lambda calculus

To avoid the potential problems associated with the mathematical definition,
Dana Scott Dana Stewart Scott (born October 11, 1932) is an American logician who is the emeritus Hillman University Professor of Computer Science, Philosophy, and Mathematical Logic at Carnegie Mellon University; he is now retired and lives in Berkeley, Ca ...
originally defined the ''let'' expression from lambda calculus. This may be considered as the bottom up, or constructive, definition of the ''let'' expression, in contrast to the top down, or axiomatic mathematical definition. The simple, non recursive ''let'' expression was defined as being
syntactic sugar In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language "sweeter" for human use: things can be expressed more clearly, more concisely, or in an ...
for the lambda abstraction applied to a term. In that definition, :(\operatorname_s x = y \operatorname z) \equiv (\lambda x.z)\ y The simple ''let'' expression definition was then extended to allow recursion using the
fixed-point combinator In mathematics and computer science in general, a '' fixed point'' of a function is a value that is mapped to itself by the function. In combinatory logic for computer science, a fixed-point combinator (or fixpoint combinator) is a higher-order ...
.


Fixed-point combinator

The
fixed-point combinator In mathematics and computer science in general, a '' fixed point'' of a function is a value that is mapped to itself by the function. In combinatory logic for computer science, a fixed-point combinator (or fixpoint combinator) is a higher-order ...
may be represented by the expression, : \lambda f.\operatorname x = f\ x \operatorname x This representation may be converted into a lambda term. A lambda abstraction does not support reference to the variable name, in the applied expression, so ''x'' must be passed in as a parameter to ''x''. : \lambda f.\operatorname x\ x = f\ (x\ x) \operatorname x\ x Using the eta reduction rule, : f\ x = y \equiv f = \lambda x.y gives, : \lambda f.\operatorname x = \lambda x.f\ (x\ x) \operatorname x\ x A let expression may be expressed as a lambda abstraction using, : n \not \in FV(E) \to (\operatorname n = E \operatorname L \equiv (\lambda n.L)\ E) gives, : \lambda f.(\lambda x.x\ x)\ (\lambda x.f\ (x\ x)) This is possibly the simplest implementation of a fixed point combinator in lambda calculus. However one beta reduction gives the more symmetrical form of Curry's Y combinator. : \lambda f.(\lambda x.f\ (x\ x))\ (\lambda x.f\ (x\ x))


Recursive let expression

The recursive ''let'' expression called "let rec" is defined using the Y combinator for recursive let expressions. :(\operatorname x = y \operatorname z) \equiv (\lambda x.z)\ (Y\ (\lambda x.y))


Mutually recursive let expression

This approach is then generalized to support mutual recursion. A mutually recursive let expression may be composed by rearranging the expression to remove any and conditions. This is achieved by replacing multiple function definitions with a single function definition, which sets a list of variables equal to a list of expressions. A version of the Y combinator, called the ''Y*'' poly-variadic fix-point combinator is then used to calculate fixed point of all the functions at the same time. The result is a mutually recursive implementation of the ''let'' expression.


Multiple values

A let expression may be used to represent a value that is a member of a set, : \operatorname x \in X \operatorname x Under function application, of one let expression to another, :\begin & (\operatorname x \in X \operatorname x)\ (\operatorname y \in Y \operatorname y) \\ & = \operatorname x \in X \land y \in Y \operatorname x\ y \\ & = \operatorname (x, y) \in X \times Y \operatorname x\ y \end But a different rule applies for applying the let expression to itself. :\begin & (\operatorname x \in X \operatorname x)\ (\operatorname x \in X \operatorname x) \\ & = \operatorname x \in X \operatorname x\ x \end There appear no simple rule for combining values. What is required is a general form of expression that represents a variable whose value is a member of a set of values. The expression should be based on the variable and the set. Function application applied to this form should give another expression in the same form. In this way any expression on functions of multiple values may be treated as if it had one value. It is not sufficient for the form to represent only the set of values. Each value must have a condition that determines when the expression takes the value. The resulting construct is a set of pairs of conditions and values, called a "value set". See narrowing of algebraic value sets.


Rules for conversion between lambda calculus and let expressions

Meta-functions will be given that describe the conversion between ''lambda'' and ''let'' expressions. A meta-function is a function that takes a program as a parameter. The program is data for the meta-program. The program and the meta program are at different meta-levels. The following conventions will be used to distinguish program from the meta program, * Square brackets [] will be used to represent function application in the meta program. * Capital letters will be used for variables in the meta program. Lower case letters represent variables in the program. * \equiv will be used for equals in the meta program. For simplicity the first rule given that matches will be applied. The rules also assume that the lambda expressions have been pre-processed so that each lambda abstraction has a unique name. The substitution operator is also used. The expression L := S means substitute every occurrence of ''G'' in ''L'' by ''S'' and return the expression. The definition used is extended to cover the substitution of expressions, from the definition given on the
Lambda calculus Lambda calculus (also written as ''λ''-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation ...
page. The matching of expressions should compare expressions for alpha equivalence (renaming of variables).


Conversion from lambda to let expressions

The following rules describe how to convert from a lambda expression to a ''let'' expression, without altering the structure. # \operatorname \equiv V # \operatorname \ N\equiv \operatorname \operatorname # \operatorname = \lambda P.E\equiv \operatorname \ P = E # \operatorname = F\equiv \operatorname = \operatorname # \operatorname \lambda F.E) L\equiv \operatorname operatorname_F_:_\operatorname[F_=_L\operatorname_E.html" ;"title="_=_L.html" ;"title="operatorname F : \operatorname[F = L">operatorname F : \operatorname[F = L\operatorname E">_=_L.html" ;"title="operatorname F : \operatorname[F = L">operatorname F : \operatorname[F = L\operatorname E # V \not \in \operatorname[\lambda F.E] \to \operatorname[\lambda F.E] \equiv \operatorname[\operatorname V : \operatorname[V\ F = E] \operatorname V] # V \ne W \to \operatorname[\operatorname V : E \operatorname \operatorname W : F \operatorname G] \equiv \operatorname V, W : E \land F \operatorname G # \operatorname operatorname V : E \operatorname F\equiv \operatorname V : E \operatorname F Rule 6 creates a unique variable V, as a name for the function.


Example

For example, the
Y combinator Y Combinator (YC) is an American technology startup accelerator launched in March 2005. It has been used to launch more than 3,000 companies, including Airbnb, Coinbase, Cruise, DoorDash, Dropbox, Instacart, Quora, PagerDuty, Reddit, Str ...
, : \lambda f.(\lambda x.f\ (x\ x))\ (\lambda x.f\ (x\ x)) is converted to, : \operatorname p : p\ f = \operatorname x : x\ q = f\ (q\ q) \operatorname f\ (x\ x) \operatorname p


Conversion from let to lambda expressions

These rules reverse the conversion described above. They convert from a ''let'' expression to a lambda expression, without altering the structure. Not all let expressions may be converted using these rules. The rules assume that the expressions are already arranged as if they had been generated by ''de-lambda''. # \operatorname , G\ V = E= \operatorname , G = \lambda V.E # \operatorname
, F = E The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
= \operatorname # \operatorname
lambda V.E Lambda (}, ''lám(b)da'') is the 11th letter of the Greek alphabet, representing the Dental, alveolar and postalveolar lateral approximants, voiced alveolar lateral approximant . In the system of Greek numerals, lambda has a value of 30. Lambda ...
\equiv \lambda V.\operatorname # \operatorname \ N\equiv \operatorname \operatorname # \operatorname \equiv V # V \not \in FV operatorname[V,_E_\to_\operatorname[\operatorname_V_:_E_\_\operatorname_V.html" ;"title=",_E.html" ;"title="operatorname[V, E">operatorname[V, E \to \operatorname[\operatorname V : E \ \operatorname V">,_E.html" ;"title="operatorname[V, E">operatorname[V, E \to \operatorname[\operatorname V : E \ \operatorname V\equiv \operatorname , E # V \not \in FV operatorname[V, E \to \operatorname[\operatorname V : E \ \operatorname L] \equiv (\lambda V.\operatorname \ \operatorname , E # W \not \in \operatorname operatorname[V,_E_\to_\operatorname[\operatorname_V,_W_:_E_\land_F_\_\operatorname_G.html" ;"title=",_E.html" ;"title="operatorname[V, E">operatorname[V, E \to \operatorname[\operatorname V, W : E \land F \ \operatorname G">,_E.html" ;"title="operatorname[V, E">operatorname[V, E \to \operatorname[\operatorname V, W : E \land F \ \operatorname G\equiv \operatorname[\operatorname V : E \ \operatorname \operatorname W : F \ \operatorname G] # V \in \operatorname operatorname[V, E \to \operatorname[\operatorname V : E \ \operatorname L] \equiv \operatorname operatorname_V_:_V\_V_=_\operatorname[V,_EV:=V\_V.html" ;"title=",_E.html" ;"title="operatorname V : V\ V = \operatorname[V, E">operatorname V : V\ V = \operatorname[V, EV:=V\ V">,_E.html" ;"title="operatorname V : V\ V = \operatorname[V, E">operatorname V : V\ V = \operatorname[V, EV:=V\ V\ \operatorname L[V:=V\ V # W \in \operatorname operatorname[V, E \to \operatorname[\operatorname V, W : E \land F \ \operatorname L] \equiv \operatorname operatorname_V:_V\_W_=_\operatorname[V,_EV:=V\_W.html" ;"title=",_E.html" ;"title="operatorname V: V\ W = \operatorname[V, E">operatorname V: V\ W = \operatorname[V, EV:=V\ W">,_E.html" ;"title="operatorname V: V\ W = \operatorname[V, E">operatorname V: V\ W = \operatorname[V, EV:=V\ W\ \operatorname \operatorname W: F[V:=V\ W] \ \operatorname L[V:=V\ W There is no exact structural equivalent in lambda calculus for ''let'' expressions that have free variables that are used recursively. In this case some addition of parameters is required. Rules 8 and 10 add these parameters. Rules 8 and 10 are sufficient for two mutually recursive equations in the ''let'' expression. However they will not work for three or more mutually recursive equations. The general case needs an extra level of looping which makes the meta function a little more difficult. The rules that follow replace rules 8 and 10 in implementing the general case. Rules 8 and 10 have been left so that the simpler case may be studied first. # ''lambda-form'' - Convert the expression into a conjunction of expressions, each of the form ''variable'' = ''expression''. ## \operatorname \ V = E= \operatorname = \lambda V.E ## \operatorname \land F= \operatorname \land \operatorname ## \operatorname = E= V = E ...... where ''V'' is a variable. # ''lift-vars'' - Get the set of variables that need ''X'' as a parameter, because the expression has ''X'' as a free variable. ## X \in \operatorname \to \operatorname , V = E= \ ## X \not \in \operatorname \to \operatorname , V = E= \ ## \operatorname , E \land F= \operatorname , E\cup \operatorname . F # ''sub-vars'' - For each variable in the set substitute it for the variable applied to X in the expression. This makes ''X'' a variable passed in as a parameter, instead of being a free variable in the right hand side of the equation. ## \operatorname , \ \cup S, X= \operatorname [V:=V\_X_S,_X.html"_;"title=":=V\_X.html"_;"title="[V:=V\_X">[V:=V\_X_S,_X">:=V\_X.html"_;"title="[V:=V\_X">[V:=V\_X_S,_X ##__\operatorname
[V:=V\_X_S,_X.html"_;"title=":=V\_X.html"_;"title="[V:=V\_X">[V:=V\_X_S,_X">:=V\_X.html"_;"title="[V:=V\_X">[V:=V\_X_S,_X ##__\operatorname[E,_\,_X">:=V\_X">[V:=V\_X_S,_X.html"_;"title=":=V\_X.html"_;"title="[V:=V\_X">[V:=V\_X_S,_X">:=V\_X.html"_;"title="[V:=V\_X">[V:=V\_X_S,_X ##__\operatorname[E,_\,_X=_E_ #_''de-let''_-_Lambda_lifting.html" "title=",_\,_X.html" ;"title=":=V\_X">[V:=V\_X_S,_X.html" ;"title=":=V\_X.html" ;"title="[V:=V\ X">[V:=V\ X S, X">:=V\_X.html" ;"title="[V:=V\ X">[V:=V\ X S, X ## \operatorname[E, \, X">:=V\_X">[V:=V\_X_S,_X.html" ;"title=":=V\_X.html" ;"title="[V:=V\ X">[V:=V\ X S, X">:=V\_X.html" ;"title="[V:=V\ X">[V:=V\ X S, X ## \operatorname[E, \, X= E # ''de-let'' - Lambda lifting">Lift Lift or LIFT may refer to: Physical devices * Elevator, or lift, a device used for raising and lowering people or goods ** Paternoster lift, a type of lift using a continuous chain of cars which do not stop ** Patient lift, or Hoyer lift, mobil ...
each condition in ''E'' so that ''X'' is not a free variable on the right hand side of the equation. ## \begin L &= \operatorname \land S = \operatorname[X, L] \to \operatorname[\operatorname V \ldots W, X : E \land F \ \operatorname G] \\ & \equiv \operatorname[\operatorname V \ldots W: \operatorname[L, S, X] \ \operatorname \operatorname \operatorname[\operatorname S, X] \ \operatorname \operatorname , S, X \end


Examples

For example, the ''let'' expression obtained from the
Y combinator Y Combinator (YC) is an American technology startup accelerator launched in March 2005. It has been used to launch more than 3,000 companies, including Airbnb, Coinbase, Cruise, DoorDash, Dropbox, Instacart, Quora, PagerDuty, Reddit, Str ...
, : \operatorname p : p\ f = \operatorname x : x\ q = f\ (q\ q) \ \operatorname f\ (x\ x) \ \operatorname p is converted to, : \lambda f.(\lambda x.f\ (x\ x))\ (\lambda q.f\ (q\ q)) For a second example take the lifted version of the
Y combinator Y Combinator (YC) is an American technology startup accelerator launched in March 2005. It has been used to launch more than 3,000 companies, including Airbnb, Coinbase, Cruise, DoorDash, Dropbox, Instacart, Quora, PagerDuty, Reddit, Str ...
, :\operatornamep, q : p\ f\ x = f\ (x\ x) \land q\ p\ f = (p\ f)\ (p\ f) \ \operatorname q\ p is converted to, : (\lambda p.(\lambda q.q\ p)\ \lambda p.\lambda f.(p\ f)\ (p\ f))\ \lambda f.\lambda x.f\ (x\ x) For a third example the translation of, : \operatorname x: x\ f = f\ (x\ f) \ \operatorname x is, : (\lambda x.x\ x)\ (\lambda x.\lambda f.f\ (x\ x\ f)) For a forth example the translation of, : \operatorname x: x = f\ x \ \operatorname x is, : (\lambda x.x\ x)\ (\lambda x. f\ (x\ x)) which is the famous
y combinator Y Combinator (YC) is an American technology startup accelerator launched in March 2005. It has been used to launch more than 3,000 companies, including Airbnb, Coinbase, Cruise, DoorDash, Dropbox, Instacart, Quora, PagerDuty, Reddit, Str ...
.


Key people

*
Dana Scott Dana Stewart Scott (born October 11, 1932) is an American logician who is the emeritus Hillman University Professor of Computer Science, Philosophy, and Mathematical Logic at Carnegie Mellon University; he is now retired and lives in Berkeley, Ca ...


See also

*
Scope (computer science) In computer programming, the scope of a name binding (an association of a name to an entity, such as a variable) is the part of a program where the name binding is valid; that is, where the name can be used to refer to the entity. In other parts o ...
*
Lambda lifting Lambda lifting is a meta-process that restructures a computer program so that functions are defined independently of each other in a global scope. An individual "lift" transforms a local function into a global function. It is a two step process ...
*
Fixed-point combinator In mathematics and computer science in general, a '' fixed point'' of a function is a value that is mapped to itself by the function. In combinatory logic for computer science, a fixed-point combinator (or fixpoint combinator) is a higher-order ...
*
Lambda calculus Lambda calculus (also written as ''λ''-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation ...
*
Curry's paradox Curry's paradox is a paradox in which an arbitrary claim ''F'' is proved from the mere existence of a sentence ''C'' that says of itself "If ''C'', then ''F''", requiring only a few apparently innocuous logical deduction rules. Since ''F'' is arbi ...
*
Deductive lambda calculus Deductive lambda calculus considers what happens when lambda terms are regarded as mathematical expressions. One interpretation of the untyped lambda calculus is as a programming language where evaluation proceeds by performing reductions on an ex ...
*
Constraint logic programming Constraint logic programming is a form of constraint programming, in which logic programming is extended to include concepts from constraint satisfaction. A constraint logic program is a logic program that contains constraints in the body of clau ...
* Narrowing of algebraic value sets


References

{{reflist, group=note Lambda calculus