Questions tagged [lambda-calculus]

For questions on the formal system in mathematical logic for expressing computation using abstract notions of functions and combining them through binding and substitution.

Lambda calculus (also written as λ-calculus) is a formal system in mathematical and theoretical for expressing computation based on function abstraction and application using variable binding and substitution. Its namesake, the Greek letter lambda (λ), is used in lambda expressions and lambda terms to denote binding a variable in a function.

It was first introduced by mathematician Alonzo Church in the 1930s as part of his research of the of mathematics. The original system was shown to be logically inconsistent because of the Kleene–Rosser paradox. Subsequently, in 1936 Church isolated and published just the portion relevant to computation, what is now called the untyped lambda calculus.

Untyped lambda calculus is Turing complete, that is, it is a universal model of computation that can be used to simulate any (see ). It may be used to model booleans, arithmetic, data structures and recursion.

Lambda calculus may be untyped or typed. In typed lambda calculus (see ), functions can be applied only if they are capable of accepting the given input's "type" of data. Typed lambda calculi are weaker than the untyped lambda calculus, in the sense that typed lambda calculi can express less than the untyped calculus can, but on the other hand typed lambda calculi allow more things to be proved; in the simply typed lambda calculus it is for example a theorem that every evaluation strategy terminates for every simply typed lambda-term, whereas evaluation of untyped lambda-terms need not terminate. One reason there are many different typed lambda calculi has been the desire to do more (of what the untyped calculus can do) without giving up on being able to prove strong theorems about the calculus.

Typed lambda calculi are closely related to mathematical and via the Curry–Howard isomorphism: types correspond to logic formulas, lambda-terms correspond to derivations in a logic system (depending on the kind of typed lambda calculus) and computation steps in the lambda calculus correspond to normalization (i.e. cut-elimination) steps for derivations.

Lambda calculus has applications in many different areas in mathematics, philosophy, linguistics, and computer science. Lambda calculus has played an important role in the development of the theory of languages, since functional programming languages implement the lambda calculus. Lambda calculus also is a current research topic in .

655 questions
2
votes
1 answer

Beta reduction result

I'm not understanding how to solve the following beta reduction : $$ (\lambda n.\lambda m.\lambda f.\lambda x.(n\,\,\,f)((m\,\,\,f)\,\,\,x))(\lambda f.\lambda x.ffffx)(\lambda f.\lambda x.fx) $$ My problem is with the notation, as far as I know an…
MFranc
  • 213
2
votes
1 answer

Formal definition of substitution being defined in type free lambda calculus

In "Lectures on the Curry-Howard Isomorphism" by Morten Heine Sørensen and Pawel Urzyczyn, it is stated that: The substitution of $N$ for $x$ in $M$, written $M [ x := N ]$, is defined iff no free occurrence of $x$ in $M$ is in a part of $M$ with…
2
votes
1 answer

How many possible Beta-reductions considering order of the expression $(\lambda x.\lambda y.y)(\lambda x.x) ((\lambda x.x) (\lambda y.y))$

Here is a lamba calculus expression: $(\lambda x.\lambda y.y)(\lambda x.x)((\lambda x.x) (\lambda y.y))$ For simplicity let $a:=(\lambda x.\lambda y.y)$ $b:=(\lambda x.x)$ $c:=(\lambda x.x)$ $d:=(\lambda y.y)$ Then I can re-write the expressions as…
2
votes
1 answer

$(M B) (M B)$ canonical form

Are there lambda terms $M$ and $B$ with $M \neq B$, so that $M B$ and $(M B) (M B)$ have the same canonical form? Is a problem I encountered while I am still new with lambda calculus I approached this by having $M = λx.x$ and $B = λy.y$, so $MB =…
Jeoster
  • 21
2
votes
1 answer

What is the meaning of this Church numeral example?

There is an example of Church numeral, on the secion Encoding Datatypes of lambda calculus's wikipedia page. One way of thinking about the Church numeral n, which is often useful when analysing programs, is as an instruction 'repeat n times'.…
cmal
  • 135
2
votes
1 answer

Is it possible to express syntactic equality function in lambda calculus?

Let's denote truth and false by two suitable constants $T, F$ where $T \not=_\beta F$ where $\equiv$ is syntactic identity. Could I define a $\lambda$-term $E$ such that for $\lambda$-terms $X$ and $Y$ in $\beta\eta$-nf, where $X \not\equiv Y$ $E…
2
votes
1 answer

How far does $\eta$-reduction go?

A term is is normal form, if there are no more redexes. But I'm confused as to what that means. E.g. $\lambda x. f x$ isn't in normal form, obviously, because it contains an $\eta$-redex. But is $\lambda x. f$ in a normal form? Because applying any…
hgiesel
  • 1,257
2
votes
0 answers

Lambda Calculus and naming

I see that $\lambda$-calculus let's you work with anonymous functions and names are purely local. As an example $$\lambda x.x$$ contains $x$ only as a local name. This will be replaced during reduction by another anonymous $\lambda$-term. So, I am…
meguli
  • 640
2
votes
1 answer

Normative vs applicative order in reduction in the Lambda Calculus

Ok, so I am attempting to learn reduction of terms in lambda calculus in detail. The only thing seemingly that I don't quite get is the sense of "order of operations" in the lambda calculus. I understand that in lambda calculus variable and function…
2
votes
1 answer

Beta reduction in Lambda-Calculus

"A term of the form (λx.M)N, which consists of a lambda abstraction applied to another term, is called a β-redex. We say that it reduces to M[N/x], and we call the latter term the reduct. We reduce lambda terms by finding a subterm that is a redex,…
Bleeeaa
  • 59
2
votes
1 answer

Define lambda calculus encoding for boolean implication (⇒)

how to define lambda calculus encoding for boolean implication(⇒). (Recall that in boolean logic, x ⇒ y iff ¬x ∨ y.) You may use true, false and cond by name in your definitions if you want. true := λx. λy. x false := λx. λy. y cond := λb. λx. λy. b…
Student
  • 119
2
votes
1 answer

Finding a term $s$ such that for all terms $t$, $st$ = $ss$

I really have no idea how to approach this problem. Thinking about it informally, $s$ ignores its argument and returns itself applied to itself. So maybe something like: $$ s = \lambda x \,. ss $$ Then I could solve for $s$ somehow. But I'm not sure…
pizzaroll
  • 993
2
votes
1 answer

How to check an implementation of call-by-need is correct?

I implemented call-by-need evaluation of untyped $\lambda$-terms. I run it with the following inputs $ (((2 \, 2) \lambda x.x) \lambda x.x )$ $ (((3 \, 3) \lambda x.x) \lambda x.x )$ $ (((4 \, 4) \lambda x.x) \lambda x.x )$ All these reduced…
alim
  • 207
2
votes
1 answer

Evaluate expressions in lambda calculus

Consider $(\;(\lambda f.\lambda x. f(f(f(x))))\;(\lambda g.\lambda y.g(g(y))) \;)$. Lets take the first lambda function, now $(\lambda f.\lambda x. f(f(f(x))))\;(\lambda x.x+1)(0) = 3 $ right? And for the second one, $(\lambda g.\lambda…
Swair
  • 597
  • 5
  • 14
2
votes
0 answers

Denotation in Lambda Calculus

I have the following sentence: "John offends nobody." I need to do three things. First, figure out what semantic types each node of a syntax tree refers to. Second, determine what each node in the tree specifically refers to. And third, calculate…
Rusty
  • 245