Computation, Computers, and Programs Lambda calculus - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

Computation, Computers, and Programs Lambda calculus

Description:

Computation, Computers, and Programs Lambda calculus. http://www.cs.caltech.edu/courses/cs20/a ... Lambda calculus. A starting point for reasoning about functions ... – PowerPoint PPT presentation

Number of Views:47
Avg rating:3.0/5.0
Slides: 27
Provided by: jasonh57
Category:

less

Transcript and Presenter's Notes

Title: Computation, Computers, and Programs Lambda calculus


1
Lambda calculus
  • A starting point for reasoning about functions
  • The foundation of most functional programming
    languages, including the Lisp and ML languages

2
Evaluation
3
Reduction
4
Single-step evaluation
  • A single-step reduction is just a substitution
  • Called beta-reduction

5
Defining substitution
6
Capture-avoiding substitution
7
Variables
  • An occurrence of a variable is a binding
    occurrence if it is defined by a lambda
  • An occurrence is bound if it is in the scope of
    a binding occurrence with the same name
  • Other occurrences are free

8
Free variables
9
Some sensible properties
  • Any two alpha-equivalent terms have the same free
    variables
  • Free variables only decrease during evaluation
  • Beta-reduction works

10
More terminology
11
Rules, inductive definitions
12
Multi-step reduction
13
Multi-step reduction
14
Problems
  • How is a program evaluated?
  • What are the values (the result of a program
    evaluation)

15
Normal forms
16
Programs and normal forms
17
Normal forms
  • It is probably best to stop as soon as a
    functional form is reached
  • What about evaluation order?
  • Does evaluation order matter?

18
Church-Rosser
19
Natural semantics
  • While beta-reduction is sufficient for reasoning
    about evaluation, it is not a very good method
    for automated evaluation
  • Pick any redex in any subterm, reduce it, and
    continue
  • Natural semantics define a procedure for program
    evaluation
  • Also called big-step semantics (beta-reduction
    is small-step semantics)

20
Natural semantics
21
Natural semantics of application
  • Two forms
  • Eager evaluate the argument first
  • Lazy do not evaluate the argument first

22
Natural semantics
  • Soundness

23
Structural induction
24
Proof induction
25
Soundness of natural semantics
26
Induction step
Write a Comment
User Comments (0)
About PowerShow.com