E N D
Lambda-calculus • In mathematical logic and computer science, lambda calculus, also written as λ-calculus, is a formal system designed to investigate function definition, function application and recursion. It was introduced by Alonzo Church and Stephen Cole Kleene in the 1930s as part of an investigation into the foundations of mathematics, but has emerged as a useful tool in the investigation of problems in computer sciences. • The lambda calculus can be thought of as an idealized, minimalistic programming language. It is capable of expressing any algorithm. All programming languages follow its principle. • Lambda-calculus is established with the ideas initiated by ancient pythagorean school going through medieval philosophy and modern european philosophy. The main idea behind is an endeavour to describe the world by logic. (e.g. “To understand, how the God is doing his things.”) • Lambda-calculus and Turing machine are instruments having direct influence to computers’ evolution in 1940s and 1950s. • http://en.wikipedia.org/wiki/Lambda_calculus
Principle of the-calculus • There are 3 concepts: abstraction function application of a function
ABSTRACTION 5 · 8 = 40 How much are 5 cakes if one is for 8? 7 · 8 = 56 How much are 7 cakes if one is for 8? . . . . . . Then, how much does my shopping cost in general case? cakes · 8 cakesis an abstraction for the variable number of concrete cakes.
FUNCTION FUNCTION describes, WHAT has the computer to do with an ABSTRACTION, if there is a concrete VALUE: REPLACEcakesINcakes · 8
FUNCTION APPLICATION It is USAGE of function with a concrete VALUE: ( REPLACEcakesINcakes · 8 ) BY_VALUE7 Here is a sequence of computing steps: 1. ( REPLACEcakes=7INcakes · 8 ) 2. ( 7 · 8 ) 3. 56
HOW TO WRITE LAMBDA-CALCULUS L = (lx| … x …) L v There are several miscellaneous styles. Here we will use the type-less lambda calculus with some additional operators in order to describe data (both relational and object-oriented) modeling behavior. ( REPLACEcakesINcakes · 8 ) BY_VALUE 7 (cakes|cakes · 8) 7 Body consisting of very standardmath syntax Value application Header havingfree (unbound)variables
b-REDUCTION Beta-reduction is an operation replacing unbound lambda-variables by values. The result of this reduction is an ordinary mathematical expression, which is later transformable ins the same manner as with ordinary mathematical expressions (shortening, decompositions, substitutions, parenthesis emphasizing, etc.). for example (cakes| cakes · 8) 7 envokes following β-reduction: (cakes| cakes · 8) 7 (cakes=7| cakes · 8), which is transformed as: (cakes=7| cakes · 8) 7 · 8 56.
a-coversion Alpha conversion allows bound variable names to be changed. Expressions that differ only by alpha conversion are considered to be equivalent.The precise rules for alpha conversion are not completely trivial. For example, when alpha-converting an abstraction, the only variable occurrences that are renamed are those that are bound to the same abstraction. for example (cakes| cakes · 8) can be transformed as (x | x · 8). informal proof: (x | x · 8) : 7 (x=7| x · 8) (7 · 8) 56.
L1 L2 l-expression as a value Let us have lambda expression for total number of cakes for some summer camp. First variable is number of children in a camp and second variable is the requested number of cakes for the camp headman. We assume 2 cakes per each child: (a b | 2a+b). Here is the expression saying the total price of cake shopping. (x | x · 8). The expression saying total number of cakes can be used as a value for the previous expression saying the total price: (x | x · 8) (ab | 2a+b) (x=(ab | 2a+b) | x · 8) ((ab | 2a+b) · 8).
l-expression as a value …continued This function represents the total price of cake shopping in the same way as any standard integer number: ((ab | 2a+b) · 8). Proof: If we know concrete values, how many children we have and how much cakes wants a camp headman to eat, we can directly use the previous expression and subsequently obtain the result as a number: ((a b | 2a + b) 8) (14 , 3) ((a=14b=3 | 2a + b) 8). (214 + 3) 8. 248.