C. Varela1 Programming Languages (CSCI 4430/6969) Lambda Calculus Carlos Varela Rennselaer Polytechnic Institute September 17, 2007.

Slides:



Advertisements
Similar presentations
2.3 Combinations of Functions Introductory MATHEMATICAL ANALYSIS For Business, Economics, and the Life and Social Sciences (12 th Edition) Copyright ©
Advertisements

Domain: 1) f(0) = 8 2) f(3) = 3) g(-2) = -2 4) g(2) = 0 5) f(g(0)) = f(2) =0 6) f(g(-2)) = f(-2) =undefined 7) f(g(2)) = f(0) =8 8) f(g(-1)) = f(1) =3.
C. Varela1 Lambda Calculus alpha-renaming, beta reduction, applicative and normal evaluation orders, Church-Rosser theorem, combinators Carlos Varela Rennselaer.
Dr. Muhammed Al-Mulhem ICS An Introduction to Functional Programming.
Functions Domain and range The domain of a function f(x) is the set of all possible x values. (the input values) The range of a function f(x) is the set.
Composition of Functions. Definition of Composition of Functions The composition of the functions f and g are given by (f o g)(x) = f(g(x))
1.4 FUNCTIONS!!! CALCULUS 9/10/14 -9/11/14. WARM-UP  Write a general equation to represent the total cost, C, in a business problem. How is it different.
Chapter 7 7.6: Function Operations. Function Operations.
Inverse Functions Given 2 functions, f(x) & g(x), if f(g(x))=x AND g(f(x))=x, then f(x) & g(x) are inverses of each other. Symbols: f -1(x) means “f.
C. Varela1 Programming Languages (CSCI 4430/6430) History, Syntax, Semantics, Essentials, Paradigms Carlos Varela Rennselaer Polytechnic Institute September.
5.1 Composite Functions Goals 1.Form f(g(x)) = (f  g) (x) 2.Show that 2 Composites are Equal.
Operations on Functions Lesson 3.5. Sums and Differences of Functions If f(x) = 3x + 7 and g(x) = x 2 – 5 then, h(x) = f(x) + g(x) = 3x (x 2 – 5)
Relations and Functions By: Jeffrey Bivin Lake Zurich High School Last Updated: November 14, 2007.
6-1: Operations on Functions (Composition of Functions)
Composite Functions How would you define composite functions? Math30-1.
How do we verify and find inverses of functions?
1-1 An Introduction to Functional Programming Sept
Do Now: Find f(g(x)) and g(f(x)). f(x) = x + 4, g(x) = x f(x) = x + 4, g(x) = x
Ch 9 – Properties and Attributes of Functions 9.4 – Operations with Functions.
Aim: What is the composition of functions? Do Now: Given: Express z in terms of x HW: Work sheet.
Review finding inverses and composite functions using square roots To find an inverse mathamaticaly there is one simple rule: Switch the x and y XY.
6.6 Function Operations Honors. Operations on Functions Addition: h(x) = f(x) + g(x) Subtraction: h(x) = f(x) – g(x) Multiplication: h(x) = f(x) g(x)
Function Operations and Composition MM2A5d. Use composition to verify that functions are inverses of each other.
Chapter 2: Lambda Calculus
Operations with Functions
Ch. 1 – Functions and Their Graphs
LESSON 1-2 COMPOSITION OF FUNCTIONS
3.5 Operations on Functions
Digital Lesson Algebra of Functions.
Quiz PowerPoint Review
Carlos Varela Rennselaer Polytechnic Institute September 5, 2017
Carlos Varela Rennselaer Polytechnic Institute September 1, 2017
Relations and Functions
Composition of Functions
Composition of Functions 1.
Find (f + g)(x), (f – g)(x), (f · g)(x), and
Functions Review.
Section 5.1 Composite Functions.
Carlos Varela Rennselaer Polytechnic Institute September 6, 2016
Homework Questions.
Objective 1A f(x) = 2x + 3 What is the Range of the function
Carlos Varela Rennselaer Polytechnic Institute September 4, 2015
= + 1 x x2 - 4 x x x2 x g(x) = f(x) = x2 - 4 g(f(x))
Combinations of Functions:
Carlos Varela Rennselaer Polytechnic Institute September 8, 2017
Activity 2.8 Study Time.
Homework Questions.
2-6: Combinations of Functions
2.6 Operations on Functions
Combinations of Functions
By: Jeffrey Bivin Lake Zurich High School
3.5 Operations on Functions
Function Operations Function Composition
Warm Up Determine the domain of the function.
Determine if 2 Functions are Inverses by Compositions
Warm Up Determine the domain of f(g(x)). f(x) = g(x) =
Function And Relations Review
Section 2 – Composition of Functions
Use Inverse Functions Notes 7.5 (Day 2).
Function Operations Function Composition
Replace inside with “x” of other function
2-6: Combinations of Functions
Carlos Varela Rennselaer Polytechnic Institute September 8, 2015
Operations on Functions
Do Now: Given: Express z in terms of x HW: p.159 # 4,6,8,
Evaluate x = 3; 2x + 6.
FUNCTIONS & THEIR GRAPHS
Composition of Functions
Carlos Varela Rennselaer Polytechnic Institute September 6, 2019
Carlos Varela Rennselaer Polytechnic Institute September 10, 2019
Presentation transcript:

C. Varela1 Programming Languages (CSCI 4430/6969) Lambda Calculus Carlos Varela Rennselaer Polytechnic Institute September 17, 2007

C. Varela2 Mathematical Functions Take the mathematical function: f(x) = x 2 f is a function that maps integers to integers: f: Z  Z We apply the function f to numbers in its domain to obtain a number in its range, e.g.: f(-2) = 4 Function Domain Range

C. Varela3 Function Composition Given the mathematical functions: f(x) = x 2, g(x) = x+1 f  g is the composition of f and g: f  g (x) = f(g(x)) f  g (x) = f(g(x)) = f(x+1) = (x+1) 2 = x 2 + 2x + 1 g  f (x) = g(f(x)) = g(x 2 ) = x Function composition is therefore not commutative. Function composition can be regarded as a (higher-order) function with the following type:  : (Z  Z) x (Z  Z)  (Z  Z)

C. Varela4 Lambda Calculus (Church and Kleene 1930’s) A unified language to manipulate and reason about functions. Given f(x) = x 2 x. x 2 represents the same f function, except it is anonymous. To represent the function evaluation f(2) = 4, we use the following -calculus syntax: ( x. x 2 2)  2 2  4

C. Varela5 Lambda Calculus Syntax and Semantics The syntax of a -calculus expression is as follows: e ::=vvariable reference | v.elambda abstraction |(e e)procedure call The semantics of a -calculus expression is as follows: ( x.E M)  E{M/x} where we choose a fresh x, alpha-renaming the lambda abstraction if necessary.

C. Varela6 Currying The lambda calculus can only represent functions of one variable. It turns out that one-variable functions are sufficient to represent multiple-variable functions, using a strategy called currying. E.g., given the mathematical function:h(x,y) = x+y of typeh: Z x Z  Z We can represent h as h’ of type:h’: Z  Z  Z Such that h(x,y) = h’(x)(y) = x+y For example, h’(2) = g, where g(y) = 2+y We say that h’ is the curried version of h.