Combinatorial Logic

from Wikipedia, the free encyclopedia

Combinatorial Logic (abbreviated CL for English. Combinatory Logic) is a notation that of Moses Schönfinkel and Haskell Curry was introduced to the use of variables in mathematical logic to avoid. It is used particularly in computer science as a theoretical model for computation and as a basis for the design of functional programming languages.

Combinatorial Logic in Mathematics

Combinatorial logic was intended to be simpler logic that should clarify the meaning of quantified variables in the notation of logic and actually make them unnecessary.

See Curry, 1958-1972.

Combinatorial Logic in Computer Science

In computer science, the combinatorial logic serves as a simple model of a calculation. This is needed in computability theory and proof theory . Indeed, combinatorial logic encompasses many aspects of natural computation.

The combinatorial logic can be understood as a variation of the lambda calculus , whereby the expressions of the lambda calculus are replaced by a few combiners . Combinators are primitive functions that do not contain free variables. Since it is very easy to convert lambda expressions into terms of the CL, and the reduction of combiners is much easier than the lambda reduction, the CL is often used as an implementation basis for non-strict languages.

There are many other ways of looking at CL, as many earlier papers show the equivalence of different combiners to axioms of logic. [Hindley and Meredith, 1990].

A brief summary of the lambda calculus

A detailed description of the lambda calculus can be found under its article. Lambda terms consist of

  • Variables ,
  • abstractions ,
  • Applications ,

where here for any variable name and , and again for lambda terms. Lambda terms are simplified by beta reduction, where the application is replaced by the replacement .

The combinatorial logic is a calculation model that is equivalent to the lambda calculus, but does without abstraction.

The combinatorial calculus

Since abstraction is used in the lambda calculus to model functions, there must be something comparable in the combinatorial calculus. Instead of abstraction, there are a few primitive functions ( combiners ) from which further functions can now be put together.

Combinatorial terms

Combinatorial terms consist of

  • Combiners
  • Applications

and are again combinatorial terms. As in the lambda calculus, the application is left-associative, i.e. it is synonymous with .

Examples of combiners

, etc. denote arbitrary terms in the following.

The simplest combiner is the identity combiner . For him applies:

Another simple combiner is the constant combiner . models a function that always returns for a further argument , so:

A third combiner is , it represents a generalized version of the application:

turns on to, except that before one in both.

It is actually unnecessary if you have and , because

.

Fixed point combiner

Even more interesting is the checkpoint combiner used to implement recursion.

Also is unnecessary. If typing is not required, it can be used as a

being represented.

Completeness of the basis SK

It is astonishing that combiners can be put together from and alone, which are extensionally equal to any arbitrary lambda term, and therefore, according to Church's thesis , extensionally equal to any arbitrary computable function. The proof is a transformation that converts lambda terms into an equivalent CL term. The only requirement is that the lambda term to be transformed does not contain any free variables.

can be defined as follows

  1. (only if not free in )
  2. (if free variable of )

The transformation of a lambda term into a CL term

For example, we're trying to translate the term into a CL term:

(Rule 5)
(Rule 6)
(Rule 4)
(Rule 3 and rule 1)
(Rule 6)
(Rule 3)
(Rule 6)
(Rule 3)
(Rule 4)

If we now apply this combiner to two terms and , the reduction looks like this:

The combinatorial representation is much longer than the lambda term . That is typical of the transformation. In general it can happen that a -Construction converts a lambda term of the length into a combiner of the length .

Explanation of the T [] transformation

The motivation of the transformation is the elimination of abstractions. Three of the rules are trivial: Rule 4 transforms into its unique equivalence , Rule 3 transforms into , which only works if the bound variable in is not used (ie: in is not free). Rule 2 transforms the application of two terms, which is also allowed in the terms of the CL.

Rule 1 is a bit tricky because it converts variables: variables can only be resolved by rule 4, so they are preserved for now. Since there are no free variables in the overall term and every transformation of abstractions takes the bound variables into account (rules 3, 4, 5, 6), all variables will eventually be resolved.

Rules 5 and 6 move the abstractions inside the function body until they can be resolved by rule 4. Rule 5 first converts the body of the external abstraction, then the abstraction itself. Rule 6 distributes the abstraction over an application to its sub-terms:

is a function that takes an argument and replaces it in the lambda term for . This is exactly what the combiner does , only for functions or :

Therefore, according to extensional equality:

In order to find a combiner for , it is sufficient to find a combiner for , so:

Simplify the transformation

η reduction

The combinators that yields become shorter if we use the η-reduction from the lambda calculus:

(only if not free in )

is the function that takes an argument and puts it in the function ; this is extensionally equal to the function itself. It is therefore sufficient to simply transform into its combinatorial form.

With this simplification, the above example becomes:

(by η-reduction)

This combiner is (extensionally) equal to the longer one from the previous example:

Similarly, the normal -T transformation would turn the identity function into . With the new η-reduction rule it just becomes .

The combiners B, C of Curry

The combiners and already immersed in the work of Schönfinkel on (but was there ), Curry led his dissertation basics of combinational logic continues , , (and ) one. and can simplify many reductions, they look like this:

For these two combiners, the rules are extended as follows:

  1. (only if not free in )
  2. (if free variable of )
  3. (if free variable of and )
  4. (if free variable from but not from )
  5. (if free variable from but not from )

For example, the transformation looks like this:

(Rule 7)
(η reduction)
(Notation: )
(Notation: )

In fact reduced to :

and represent limited versions of . While inserting a value into both the applicant and the argument, inserting it only into the applicant and only into the argument.

Reverse transformation

The transformation of CL terms into lambda terms is very easy, since we have all the options in the lambda calculus that are also available in the CL:

It is important to know, however, that this transformation is not the inverse of the -transformation, since it is extensionally the same , but the term is not necessarily retained.

Undecidability of the combinatorial calculus

It is undecidable whether a general combiner has a normal form, whether two combiners are equal, etc. This already results from the similarity to the lambda calculus, but here again a direct proof:

The term

has no normal form, as it reduces to itself again in three steps:

and there can't be any other way that makes the combiner shorter.

Now be a combiner that tests for normal form such that

if has a normal form,
, otherwise.

( and here are the corresponding combiners to and from the lambda calculus:

)

Be now

Let's examine the term . Has a normal form? If so, the following derivatives must also have a normal form:

(Definition of )

Now we turn on to. Either has a normal form or it doesn't.

If so, then:

(Definition of )

but has no normal form. we got from derivatives , so it has no normal form. This is a contradiction.

If has no normal form, the term is reduced as follows:

(Definition of )

which means that the normal form has simple , so again a contradiction. Hence there cannot be such a combiner .

application areas

Translation of functional programming languages

Functional programming languages are often based on the simple but universal semantics of the lambda calculus.

David Turner used CL for the SASL language.

credentials

  • “On the building blocks of mathematical logic”, Moses Schönfinkel, 1924, translated as “On the Building Blocks of Mathematical Logic” in From Frege to Gödel: a source book in mathematical logic, 1879–1931 , ed. Jean van Heijenoort, Harvard University Press, 1977. ISBN 0-674-32449-8 - The original publication on combinatorial logic.
  • Combinatory Logic . Curry, Haskell B. et al. , North-Holland, 1972. ISBN 0-7204-2208-6 - A comprehensive overview of the CL, including the historical outlines.
  • Functional programming . Field, Anthony J. and Peter G. Harrison. Addison-Wesley, 1998. ISBN 0-201-19249-7
  • "Foundations of Functional Programming" ( GZIP ; 105 kB). Lawrence C. Paulson. University of Cambridge, 1995.
  • "Lectures on the Curry-Howard Isomorphism" . Sørensen, Morten Heine B. and Pawel Urzyczyn. University of Copenhagen and University of Warsaw, 1998.
  • "Principal Type-Schemes and Condensed Detachment", Hindley and Meredith, Journal of Symbolic Logic (JSL), Volume 55 (1990), Number 1, pages 90-105

Web links