Lambda calculus and Lambda function

This is not want to discuss specific issues related to the lambda calculus.

Ideas Source: on the way to dinner to discuss the sudden lambda expression lambda calculus and in Python, and I suddenly ignorant force in Python lambda expression is not in the lambda calculus concepts.

First conclusions are given: the concept of correlation lambda expression and lambda calculus of Python is not so great. More lambda expression in Python is to act as anonymous function syntax sugar, but for convenience of use. Anonymous expression is when some of the concepts by means of lambda calculus.

Lambda Calculus

Lambda calculus concept is much more than this time Python language appeared earlier discussion Lambda calculus can be traced back to the 1920s, it is a basic tool used to perform logical calculus.

Lambda calculs the concept sounds very iffy: "a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution."

Lambda calculus method is very simple: construction lambda term, and then followed them reduction. (Reduction bad translation can be understood as the reduction or simplification)

Lambda calculus minimum configuration, only three parts:

  1. Definition of variables: define a variable, the value may represent a logic.
  2. Defined functions: a function rule is defined for the parameters of the function, is limited by the constraint function.
  3. Seeking function: function equivalent to solve.

Only three parts, to complete the definition of the minimum lambda calculus.

As for the reduction rule, it requires only two rules.

  1. α-conversion renaming variables: part of the predicate calculus, we call the replacement rules.
  2. β-reduction function is substituted into the variables: the predicate calculus section, as will be appreciated substituting law.

Expression The Python in the Lambda
the lambda expression The Python, is a syntactic sugar, he can define an anonymous function declarations without the need to display the function names. With Python's design also has some of the concepts Lambda Calculus, such as variable bindings, for example, function also can be used as a variable transmission. The language is relatively old-fashioned in not.
Lambda Expression syntax rules are as follows:
the lambda :

Which belong lambda keyword, is essential, valist may be empty, but the expression can not be empty.

We can just use lambda expressions in Python, build a complete lambda calculus. http://matt.might.net/articles/python-church-y-combinator/

Guess you like

Origin www.cnblogs.com/wAther/p/12113874.html