Questions tagged [lambda-calculus]

λ-calculus is a formal system for function definition, function application and recursion which forms the mathematical basis of functional programming.

λ-calculus is a formal system for function definition, function application and recursion which forms the mathematical basis of functional programming.

Since many people ask how to reduce λ-expressions with the intermediate steps, take a look at Lambda Calculus Calculator

Also available, Lambda calculus reduction workbench and its interpreter.

Free books and papers

An Introduction To Functional Programming Through Lambda Calculus by Greg Michaelson
Lambda Calculi with Types by Henk Barendregt
Introduction to Lambda Calculus by Henk Barendregt and Erik Barendsen

Interpretation of the Lambda Calculus in Practical Foundations of Mathematics by Paul Taylor
Note: This is an online book as HTML, no downloadable PDF version

555 questions
16
votes
3 answers

A quine in pure lambda calculus

I would like an example of a quine in pure lambda calculus. I was quite surprised that I couldn't find one by googling. The quine page lists quines for many "real" languages, but not for lambda calculus. Of course, this means defining what I mean…
N. Virgo
  • 966
  • 4
  • 21
14
votes
2 answers

Solving functional equations for unknown functions in lambda calculus

Are there any techniques for solving functional equations for unknown functions in lambda calculus? Suppose I have the identity function defined extensionally as such: $I x = x$ (that is, by writing down an equation for the expected behaviour of…
BarbaraKwarc
  • 261
  • 1
  • 6
13
votes
5 answers

Lambda Calculus Generator

I don't know where else to ask this question, I hope this is a good place. I'm just curious to know if its possible to make a lambda calculus generator; essentially, a loop that will, given infinite time, produce every possible lambda calculus…
MetaStack
  • 327
  • 2
  • 12
7
votes
2 answers

Equivalence of two lambda expressions for NOT

I've seen two different lambda expressions for the logical NOT function. One of them just applies its parameter to constants true and false internally in a reverse order: $NOT \;\;=\;\; \lambda x.\; x \; \mbox{false}\; \mbox{true} \;\;=\;\; \lambda…
SasQ
  • 290
  • 1
  • 9
7
votes
1 answer

Free and Bound in Lambda Calculus

Here's something from Slonneger's "Syntax and Semantics of Programming Languages": A variable may occur both bound and free in the same lambda expression: for example, in λx.yλy.yx the first occurrence of y is free and the other two are…
user2054900
6
votes
1 answer

What is "extended polynomials"

I've heard that the functions that are definable in simply-typed $\lambda$-calculus is the class of extended polynomials. However, it is still not clear to me what exactly is extended polynomials. Could someone explain that to me? Some pointers…
Steinway Wu
  • 211
  • 1
  • 5
5
votes
1 answer

Differences between Church and Scott encoding

I'm kind of new to lambda calculus and I found this Wikipedia article https://en.wikipedia.org/wiki/Mogensen%E2%80%93Scott_encoding The section Comparison to the Church encoding presents a short comparison between Church and Scott…
jack malkovick
  • 251
  • 2
  • 9
5
votes
2 answers

Why is abstraction in lambda calculus called abstraction?

The term abstraction as I understand it, is used in many different contexts, but has one essential meaning, namely that it refers to the “general properties of some class of objects that doesn’t rely on their details”. For example, abstraction in…
user56834
  • 3,722
  • 4
  • 18
  • 32
5
votes
1 answer

Abstractions in call-by-push-value

In "Call-by-push-value: A subsuming paradigm." (Levy, Paul Blain. Springer, Dordrecht, 2003. 27-47) terms of the lambda calculus get split in to values and computations, with the slogan "A value is, a computation does". What I don't understand is:…
Labbekak
  • 565
  • 2
  • 11
5
votes
0 answers

Pattern calculus : Can I define function for data type with variadic number of type variables?

apply1 : (a -> b) -> Foo a -> b apply2 : (a -> b -> c) -> Bar a b -> c apply3 : (a -> b -> c -> d) -> Baz a b c -> d As you see there is a repeating pattern, we obtain a function and a data structure, then we apply that…
Ford O.
  • 243
  • 1
  • 6
5
votes
2 answers

Equivalence of two definitions of substitution

Preliminary definitions Barendregt [2004] introduces the following two definitions of substitution and their equivalence: Ottamnn variable convention (p. 26) 2.1.13. Ottamnn variable convention. If $M_1, ..., M_n$ occur in a certain mathematical…
asr
  • 163
  • 6
5
votes
0 answers

Is α-renaming necessary for STLC?

Consider the following in untyped lambda calculus ( \ x. x x ) ( \ g. \ f. g f ) Even though each variable is uniquely named reducing this will require an $\alpha$-renaming. ( \ x. x x ) ( \ g. \ f. g f ) ( \ g. \ f. g f ) ( \ g. \ f. g f ) ( \ f.…
5
votes
1 answer

Zero-knowledge proof of $\beta\eta$ equality

Is there some way to give a zero-knowledge proof that two $\lambda$-terms are convertible, i.e. equal modulo $\beta\eta$? A usual (and not zero-knowledge) proof that two terms are convertible is a path of terms between the two such that each step is…
xavierm02
  • 1,255
  • 6
  • 14
5
votes
2 answers

Are there lambda-calculus functions which always output booleans, but are not constant functions?

In labmda calculus, true = $\lambda x,y.x$ and false = $\lambda x,y.y$. Is there a term $f$ such that for any other term $x$, $f x$ normalizes to true or false BUT $f$ does not have the same output for all inputs?
while1fork
  • 319
  • 1
  • 7
4
votes
2 answers

Composition of handler types in algebraic effects and handlers

In the paper "An introduction to algebraic effects and handlers" (Pretnar, Matija. Electronic Notes in Theoretical Computer Science 319 (2015): 19-35), handlers get a handler type that looks like a function type: $\underline{C} \Rightarrow…
Labbekak
  • 565
  • 2
  • 11
1
2 3
8 9