Calculus of constructions

Calculus of constructions

The calculus of constructions (CoC) is a higher-order typed lambda calculus, initially developed by Thierry Coquand, where types are first-class values. It is thus possible, within the CoC, to define functions from, say, integers to types, types to types as well as functions from integers to integers.

The CoC is strongly normalizing, though, by Gödel's incompleteness theorem, it is impossible to prove this property within the CoC since it implies consistency.

The CoC was the basis of the early versions of the Coq theorem prover; later versions were built upon the Calculus of inductive constructions, an extension of CoC with native support for inductive datatypes. In the original CoC, inductive datatypes had to be emulated as their polymorphic destructor function.

The basics of the calculus of constructions

The Calculus of Constructions can be considered an extension of the Curry-Howard isomorphism. The Curry-Howard isomorphism associates a term in the simply typed lambda calculus with each natural-deduction proof in intuitionistic propositional logic. The Calculus of Constructions extends this isomorphism to proofs in the full intuitionistic predicate calculus, which includes proofs of quantified statements (which we will also call "propositions").

Terms

A "term" in the calculus of constructions is constructed using the following rules:

* T is a term (also called "Type")
* P is a term (also called "Prop", the type of all propositions)
* If A and B are terms, then so are
** mathbf{(} A B )
** (mathbf{lambda}x:A . B)
** (forall x:A . B)

The calculus of constructions has four object types:
# "proofs", which are terms whose types are "propositions"
# "propositions", which are also known as "small types"
# "predicates", which are functions that return propositions
# "large types", which are the types of predicates. (P is an example of a large type)
# T itself, which is the type of large types.

Judgements

In the calculus of constructions, a judgement is a typing inference:

: x_1:A_1, x_2:A_2, ldots vdash t:B

Which can be read as the implication

: If variables x_1, x_2, ldots have types A_1, A_2, ldots, then term t has type B.

The valid judgements for the calculus of constructions are derivable from a set of inference rules. In the following, we use Gamma to mean a sequence of type assignments x_1:A_1, x_2:A_2, ldots , and we use K to mean either P or T. We will write A : B :C to mean "A has type B, and B has type C". We will write B(x:=N) to mean the result of substituting the term N for the variable x in the term B.

An inference rule is written in the form

: {Gamma vdash A:B} over {Gamma' vdash C:D}

which means

: If Gamma vdash A:B is a valid judgement, then so is Gamma' vdash C:D

Inference rules for calculus of constructions

# } over {} vdash P : T}
# {Gamma vdash A : K over {Gamma, x:A vdash x : A

# {Gamma, x:A vdash t : B : K over {Gamma vdash (lambda x:A . t) : (forall x:A . B) : K
# {Gamma vdash M : (forall x:A . B)qquadqquadGammavdash N : A over {Gamma vdash M N : B(x := N)
# {Gamma vdash M : A qquad qquad A =_eta B qquad qquad B : K over {Gamma vdash M : B

Defining logical operators

The calculus of constructions has very few basic operators: the only logical operator for forming propositions is forall. However, this one operator is sufficient to define all the other logical operators:

: egin{matrix}A Rightarrow B & equiv & forall x:A . B & (x otin B) \A wedge B & equiv & forall C:P . (A Rightarrow B Rightarrow C) Rightarrow C & \A vee B & equiv & forall C:P . (A Rightarrow C) Rightarrow (B Rightarrow C) Rightarrow C & \ eg A & equiv & forall C:P . (A Rightarrow C) & \exists x:A.B & equiv & forall C:P . (forall x:A.(B Rightarrow C)) Rightarrow C &end{matrix}

Defining data types

The basic data types used in computer science can be definedwithin the Calculus of Constructions:

; Booleans : forall A: P . A Rightarrow A Rightarrow A; Naturals : forall A:P . (A Rightarrow A) Rightarrow (A Rightarrow A); Product A imes B : A wedge B; Disjoint union A + B : A vee B

ee also

Topics

* Curry–Howard isomorphism
* Intuitionistic logic
* Intuitionistic type theory
* Lambda calculus
* Lambda cube
* System F
* Typed lambda calculus

Theorists

* Coquand, Thierry
* Girard, Jean-Yves

References

* Thierry Coquand and Gerard Huet: The Calculus of Constructions. Information and Computation, Vol. 76, Issue 2-3, 1988.
* For a source freely accessible online, see Coquand and Huet: [http://www.inria.fr/rrrt/rr-0530.html The calculus of constructions] . Technical Report 530, INRIA, Centre de Rocquencourt, 1986. Note terminology is rather different. For instance, (forall x:A . B) is written ["x" : "A"] "B".
* M. W. Bunder and Jonathan P. Seldin: [http://citeseer.ist.psu.edu/bunder04variants.html Variants of the Basic Calculus of Constructions] . 2004.


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Calculus of inductive constructions — The calculus of inductive constructions is the underlying core language of the Coq Proof Assistant. It is based on the calculus of constructions extended by inductive definitions as they are known from intuitionistic type theory …   Wikipedia

  • Calcul des constructions — Le calcul des constructions (CoC de l anglais calculus of constructions) est un lambda calcul typé d ordre supérieur dans lequel les types sont des valeurs de première classe. Il est par conséquent possible, dans le CoC, de définir des fonctions… …   Wikipédia en Français

  • Calcul Des Constructions — Le calcul des constructions (CoC de l anglais calculus of constructions) est un lambda calcul typé d ordre supérieur dans lequel les types sont des valeurs de première classe. Il est par conséquent possible, dans le CoC, de définir des fonctions… …   Wikipédia en Français

  • Calcul des Constructions — Le calcul des constructions (CoC de l anglais calculus of constructions) est un lambda calcul typé d ordre supérieur dans lequel les types sont des valeurs de première classe. Il est par conséquent possible, dans le CoC, de définir des fonctions… …   Wikipédia en Français

  • Normalization property (lambda-calculus) — In mathematical logic and theoretical computer science, a rewrite system has the strong normalization property (in short: the normalization property) if every term is strongly normalizing ; that is, if every sequence of rewrites eventually… …   Wikipedia

  • Typed lambda calculus — A typed lambda calculus is a typed formalism that uses the lambda symbol (lambda) to denote anonymous function abstraction. Typed lambda calculi are foundational programming languages and are the base of typed functional programming languages… …   Wikipedia

  • 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… …   Wikipedia

  • Secondary calculus and cohomological physics — In mathematics, secondary calculus is a proposed expansion of classical differential calculus on manifolds, to the space of solutions of a (nonlinear) partial differential equation. It is a sophisticated theory at the level of jet spaces and… …   Wikipedia

  • Visual calculus — by Mamikon Mnatsakanian (known as Mamikon) is an approach to solving a variety of integral calculus problems.[1] Many problems that would otherwise seem quite difficult yield to the method with hardly a line of calculation, often reminiscent of… …   Wikipedia

  • Curry–Howard correspondence — A proof written as a functional program: the proof of commutativity of addition on natural numbers in the proof assistant Coq. nat ind stands for mathematical induction, eq ind for substitution of equals and f equal for taking the same function… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”