1 / 10

Lambda- c al c ul us

Lambda- c al c ul us.

novia
Download Presentation

Lambda- c al c ul us

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. Principle of the-calculus • There are 3 concepts: abstraction function application of a function

  3. 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.

  4. FUNCTION FUNCTION describes, WHAT has the computer to do with an ABSTRACTION, if there is a concrete VALUE: REPLACEcakesINcakes · 8

  5. 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

  6. 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

  7. 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.

  8. 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.

  9. 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) (ab | 2a+b)  (x=(ab | 2a+b) | x · 8)  ((ab | 2a+b) · 8).

  10. l-expression as a value …continued This function represents the total price of cake shopping in the same way as any standard integer number: ((ab | 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=14b=3 | 2a + b)  8).  (214 + 3)  8.  248.

More Related