• Aucun résultat trouvé

Proof assistants

N/A
N/A
Protected

Academic year: 2022

Partager "Proof assistants"

Copied!
2
0
0

Texte intégral

(1)

Proof assistants

TD 1- From the Calculus of Constructions to the Calculus of Inductive Constructions

1 Basic inductive denitions

1.1 Booleans

We dene

Inductive bool : Type := true : bool | false : bool.

1- Dene boolean negation negb and boolean conjunction andb in CCI (on paper or with Coq).

2- Detail the normalisation steps of expressions λx : bool. negb (andb f alse x) et λx : bool. negb (andb x f alse) (in Coq, one can use the command Eval). What is remarkable ?

1.2 Disjonction

We dene, in Coq, the following type scheme:

Inductive sum (A B:Type) : Type :=

| inl : A -> sum A B

| inr : B -> sum A B.

1- Give an equivalent denition using Objective Caml. How the case analysis operator (elimination) for sum can be written in Objective Caml ?

2- Give an equivalent expression in system Fω, as follows

ˆ a type sum0 :Prop→Prop→Prop,

ˆ two functionsinl0 :∀A B :Prop, A→sum0 A Bandinr0 :∀A B :Prop, B →sum0 A B,

ˆ a (non dependent) case analysis function casesum0 :∀A B P : Prop,(A → P) → (B → P)→sum A B →P.

3- Dene in the Calculus of Inductive Constructions a function with type∀A, B :T ype.sumA B → bool which returns which component of the sum is fullled.

4- With the command Extraction ident from Coq to Objective Caml, check the correspon- dance between Coq denitions and the corresponding denitions in Objective Caml.

1.3 Conjunction

Give an inductive denition in Prop for conjunction ∧. Give a proof term for the property

∀A, B :P rop.A∧B →B∧A where∧ is your conjunction.

1

(2)

2 Expressivity : Church's numbers

A Church number is a natural number represented by a functional term of the form λx.λf.f(. . .(f(x)). . .).

We use the calculus of constructions (sorts are called Prop and Type and the product is written∀). If A is a type, we dene equality on A with

(x=Ay),∀P : (A →P rop), P(x)→P(y) and negation ¬A of A with

¬A,A→ ∀C. C .

A- Denition of Church's numbers at the Prop level in the Calculus of Constructions In the following s represents the sort Prop.

1. Give a closed expression N of type sfor the type of Church numbers. Write terms for 0 and the operation successor (writtenS) ?

2. How to dene addition and multiplication on N ? 3. Can we dene the predecessor function on N ?

4. We dene IN D(n) , ∀P : N → Prop.P(0) → (∀m : N. P(m)→ P(S(m))) → P(n). Can we derive the induction principle ∀n:N. IN D(n) ?

5. Can we express (in Prop) the property ∀n, m:N, S(n) =S(m)→n =m ? If yes can we prove it ? If not, can we prove ∀n, m:N, IN D(n)→IN D(m)→S(n) =S(m)→ n=m ?

6. Can we express (in Prop) the property ∀n : N, S(n)6= 0 ? If yes can we prove it ? If not, can we prove∀n :N, IN D(n)→S(n)6= 0 ?

B- Same questions but with s the sortType of the Calculus of Constructions C- Same questions but with s the sort Typeand if we are only in Fω.

D- Same questions but with s the sortType and if we are only in Fω.2.

Remarks: you may or not use a polymorphic type for Church numbers. In this case, the representation can introduce a type abstraction (as in λX.λx:X.λf :X →X.f(f(f(x)))).

Non-provability results are hard to obtain. A rst attempt can be to consider the proof- irrelevent interpretation of the Calculus ofs Constructions. In this interpretation Prop is interpreted as a set with two values and proof dependencies in typed can be ignored.

2

Références

Documents relatifs

These tools have allowed to both improve all earlier results on the Random Hopping dynamics of mean-field models [22], [12], [13], turning statements previously obtained in law into

Lemma 151 ( complete normed vector space of continuous linear maps ), Theorem 180 ( orthogonal projection onto nonempty complete convex ), Lemma 193 ( sum of complete subspace

The starting point of the proof of Lehmer’s Conjecture is the investigation of the zeroes of the Parry Upper functions f β (z) in the annular region {β −1 < |z| < 1} ∪ {β

Using this last one, Riemann has shown that the non trivial zeros of ζ are located sym- metrically with respect to the line <(s) = 1/2, inside the critical strip 0 < <(s)

If a minimum experimentation design was required to validate the hypothesis (proof of the known), additional design activity had to be performed to enable the proof of the

We illustrate several merits of the logical specifications permitted by this logic: they are natural and declarative; they contain no side-conditions concerning names of variables

Since the proofs in the implicative propositional classical logic can be coded by Parigot’s λµ-terms and the cut elimination corresponds to the λµ-reduction, the result can be seen as

Chapter 3 proposes a new mu ltircsolutiou and rnultidircction im age representation with critical sampling and perfect reconstruction properties, called the nonrcdundant