1. Home
  2. Explore
  3. Computer Science
  4. Lambda Calculus Fundamentals

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Lambda Calculus Fundamentals

  • 54Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Lambda Foundations
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is the lambda calculus fundamentally a theory of?

Tap to flipClick to flipspace

Functions understood as mappings from inputs to outputs.

Or swipe the card

54 cards

  1. What is the lambda calculus fundamentally a theory of?

    Functions understood as mappings from inputs to outputs.

  2. In the lambda calculus, what does a variable such as xxx represent?

    An arbitrary input to a function.

  3. What does it mean for two lambda expressions to be alpha equivalent?

    They differ only in the name of a bound input variable and represent the same function.

  4. What is alpha conversion?

    Renaming a function's bound variable and its occurrences in the function body.

  5. How is a function that maps input xxx to output mmm written as a lambda abstraction?

    λx.mλx.mλx.m

  6. What is a lambda abstraction?

    A function written using lambda notation, such as λx.mλx.mλx.m.

  7. What are the three kinds of expressions in the basic lambda calculus?

    Variables, lambda abstractions, and function applications.

  8. What does function application do in the lambda calculus?

    It supplies an input to a function so that the function can be evaluated.

  9. What is beta reduction?

    Substituting a function's supplied input for its bound input variable in the function body.

  10. How is a beta reduction conventionally marked?

    With an arrow labeled beta: →β→_β→β​.

  11. What is the general beta-reduction rule for applying λx.mλx.mλx.m to nnn?

    (λx.m)n→βm[x:=n](λx.m)n →_β m[x := n](λx.m)n→β​m[x:=n].

  12. What does applying λx.x+1λx.x+1λx.x+1 to 333 produce?

    3+13+13+1, which evaluates to 444.

  13. What makes a lambda-calculus function higher order?

    It can take functions as inputs or return functions as outputs.

  14. How can a calculus in which each abstraction has one input represent a function with two inputs?

    Make the first input produce a function that accepts the second input.

  15. What is currying?

    Representing a multi-input function as a sequence of functions, each taking one input.

  16. How does the curried function λx.λy.x+yλx.λy.x+yλx.λy.x+y add two inputs?

    Apply it to the first input to get a function, then apply that function to the second input.

  17. What is the result of applying λx.λy.Lλx.λy.Lλx.λy.L first to mmm and then to nnn?

    L[x:=m][y:=n]L[x := m][y := n]L[x:=m][y:=n].

  18. Who was currying named after?

    Logician Haskell Curry.

  19. How is true represented using the lambda-calculus boolean encoding?

    λx.λy.xλx.λy.xλx.λy.x.

  20. How is false represented using the lambda-calculus boolean encoding?

    λx.λy.yλx.λy.yλx.λy.y.

  21. How can an if-then-else operation be represented in the lambda calculus?

    λb.λx.λy.bxyλb.λx.λy.bxyλb.λx.λy.bxy.

  22. How does the encoded if operation choose between its two terms?

    It returns the first term when given true and the second when given false.

  23. What does the encoded if operation return when given true, MMM, and NNN?

    MMM.

  24. What does the encoded if operation return when given false, MMM, and NNN?

    NNN.

  25. How can logical negation be expressed using the encoded booleans and conditional?

    λb. if b then false else trueλb.\,\text{if } b \text{ then false else true}λb.if b then false else true.

  26. Why can programmers reason about encoded booleans and conditionals without expanding their definitions every time?

    Once their encodings are established, they can be treated as the concepts they represent.

  27. Besides booleans and conditionals, what other programming concepts does the content say can be encoded in the lambda calculus?

    Numbers, recursion, and data types such as pairs.

  28. What problem is a type system intended to prevent in the lambda calculus?

    Meaningless applications, such as using a number where a boolean is required.

  29. Which basic types are used in the typed example from the content?

    bool\text{bool}bool for booleans and num\text{num}num for numbers.

  30. How is the type of a term indicated?

    Write the type after a colon, as in true:bool\text{true}:\text{bool}true:bool.

  31. What does the function type A→BA → BA→B mean?

    A function that takes an input of type AAA and produces an output of type BBB.

  32. How is the input type shown in a typed lambda abstraction?

    Write the type next to the input variable.

  33. When is a function application allowed in the simply typed lambda calculus?

    When the argument has the same type as the function's specified input type.

  34. What is the type of a negation function that takes a boolean and returns a boolean?

    bool→bool\text{bool} → \text{bool}bool→bool.

  35. Why does a boolean negation function reject the numeric term 111 in the typed calculus?

    The function expects a bool\text{bool}bool input, while 111 has type num\text{num}num.

  36. What is the simply typed lambda calculus?

    The lambda calculus augmented with a type system.

  37. How is the simply typed lambda calculus compared with languages such as C or Java?

    Its use of types is reminiscent of statically typed programming languages such as C and Java.

  38. In the Curry–Howard interpretation, what does a type represent?

    A proposition.

  39. In the Curry–Howard interpretation, what does a term of a given type represent?

    A proof of the proposition represented by that type.

  40. In the interpretation described, what does the absence of a term of type AAA indicate?

    That the proposition represented by AAA is false.

  41. What logical proposition corresponds to the function type A→BA → BA→B?

    AAA implies BBB.

  42. What does the proposition AAA implies BBB assert?

    If AAA is true, then BBB is true.

  43. How does a function of type A→BA → BA→B establish the implication from AAA to BBB?

    Apply the function to a term of type AAA to obtain a term of type BBB.

  44. If there is a term nnn of type AAA and a function of type A→BA → BA→B, what can be constructed?

    A term of type BBB, by applying the function to nnn.

  45. What is the Curry–Howard correspondence?

    The relationship between types and propositions, and between program terms and proofs.

  46. What are proof assistants?

    Programming systems that use the correspondence between types and proofs to express and check mathematical proofs.

  47. Which proof assistants are mentioned in the content?

    Lean and Agda.

  48. What example of a mathematical result is described as being proved in Lean?

    That there are infinitely many prime numbers.

  49. What does the Church–Turing thesis say about the computational power of the lambda calculus, as described in the content?

    The lambda calculus can perform any computation that other programming languages can perform.

  50. Why can the lambda calculus be computationally powerful despite its minimal syntax?

    Its functions are higher order: they can accept functions and return functions.

  51. Is the lambda calculus presented as a practical replacement for modern programming languages?

    No. Its basic encodings are tedious, so it is not suited to ordinary real-world programming.

  52. What is one major benefit of representing computation with the lambda calculus?

    It provides a small mathematical framework for studying computation and reasoning about programs rigorously.

  53. Who developed the lambda calculus, and when?

    Alonzo Church developed it between the 1930s and 1940s.

  54. What connection did Alonzo Church have to Alan Turing?

    Church was Turing's doctoral adviser.

Card 1 of 54
Card 1 of 54

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent