Sharing a Library between Proof Assistants: Reaching out the HOL - - PowerPoint PPT Presentation
Sharing a Library between Proof Assistants: Reaching out the HOL - - PowerPoint PPT Presentation
Sharing a Library between Proof Assistants: Reaching out the HOL Family Franc ois Thir e July 7, 2018 LSV, CNRS, Inria, ENS Paris-Saclay 1 Introduction Beluga PVS Automath Coq Agda RedPRL Isabelle/HOL Twelf Abella Matita
SLIDE 1
SLIDE 2
Introduction
SLIDE 3
Dedukti Coq Agda RedPRL Isabelle/HOL Matita Twelf Automath PVS Beluga Abella
2
SLIDE 4
Dedukti Coq Agda RedPRL Isabelle/HOL Matita Twelf Automath PVS Beluga Abella
2
SLIDE 5
Dedukti Coq Agda RedPRL Isabelle/HOL Matita Twelf Automath PVS Beluga Abella
2
SLIDE 6
Dedukti
2
SLIDE 7
Dedukti Matita OpenTheory
2
SLIDE 8
OpenTheory HOL-Light HOL4 Isabelle/HOL HOL Zero
2
SLIDE 9
Dedukti D[OT] D[Matita] OpenTheory Matita
2
SLIDE 10
Dedukti D[STT∀βδ] D[CiCω] OpenTheory Matita
2
SLIDE 11
Dedukti D[STT∀βδ] D[CiCω] OpenTheory Matita Coq
2
SLIDE 12
Dedukti D[STT∀βδ] D[CiCω] OpenTheory Matita Coq Lean ? PVS
2
SLIDE 13
STT∀βδ
SLIDE 14
A real implementation of STT∀βδ?
Dedukti D[STT∀βδ] STT∀βδ
3
SLIDE 15
A real implementation of STT∀βδ?
Dedukti D[STT∀βδ] STT∀βδ
3
SLIDE 16
A real implementation of STT∀βδ?
Dedukti D[STT∀βδ] STT∀βδ In this talk, Dedukti is abstract! The encoding is shallow
3
SLIDE 17
STT
Types A, B :≡ ι | o | A → B Terms t, u :≡ x | λxA. t | t u | ∀xA. t | t ⇒ u
4
SLIDE 18
STT
Types A, B :≡ ι | o | A → B Terms t, u :≡ x | λxA. t | t u | ∀xA. t | t ⇒ u
C ⊢ t : o C, t ⊢ t assume C ⊢ t C ⊢ t ⇒ u C ⊢ u
⇒E
C, t ⊢ u C ⊢ t ⇒ u ⇒I C ⊢ ∀xA. t C ⊢ u : A C ⊢ t[x := u]
∀E
C, x : A ⊢ t x ∈ C C ⊢ ∀xA. t
∀I
- Fig. 1: Proof system
4
SLIDE 19
STTβδ
Types A, B :≡ ι | o | A → B Terms t, u :≡ x | λxA. t | t u | ∀xA. t | t ⇒ u
C ⊢ t : o C, t ⊢ t assume C ⊢ t t ≡βδ t′ C ⊢ t′
conv
C ⊢ t C ⊢ t ⇒ u C ⊢ u
⇒E
C, t ⊢ u C ⊢ t ⇒ u ⇒I C ⊢ ∀xA. t C ⊢ u : A C ⊢ t[x := u]
∀E
C, x : A ⊢ t x ∈ C C ⊢ ∀xA. t
∀I
- Fig. 1: Proof system
4
SLIDE 20
STT∀βδ is an extension of STT
STT∀βδ = STTβδ + prenex polymorphism
5
SLIDE 21
STT∀βδ is an extension of STT
monotypes A, B :≡
- | A → B | X | p A1 . . . An
polytypes T :≡ ∀KX. T | A
- nat
- ∀KX. list X
- list nat
- ∀KX. X→X→ o
5
SLIDE 22
STT∀βδ is an extension of STT
monotypes A, B :≡
- | A → B | X | p A1 . . . An
polytypes T :≡ ∀KX. T | A monoterms t,u :≡ ... | c A1 . . . An | ΛX. t polyterms τ :≡ A
- X. τ | t
- 0 : nat
- ΛX. λxX. λyX. ∀PX→o. P x ⇒ P y : ∀KX. X → X → o
(eq)
- A
- X. ∀aX. eq X a a
5
SLIDE 23
STT∀βδ is an extension of STT
monotypes A, B :≡
- | A → B | X | p A1 . . . An
polytypes T :≡ ∀KX. T | A monoterms t,u :≡ ... | c A1 . . . An | ΛX. t polyterms τ :≡ A
- X. τ | t
. . . C ⊢ A
- X. τ
C ⊢ A wf C ⊢ τ[X := A]
A
E
C, X ⊢ τ C ⊢ A
- X. τ
A
I
- Fig. 2: Rules for STT∀βδ
5
SLIDE 24
A reflexivity proof
eq; ∅; ∅ ⊢ A
- X. ∀aX. eq X a a
A
I
6
SLIDE 25
A reflexivity proof
eq; X; ∅ ⊢ ∀aX. eq X a a
∀I
eq; ∅; ∅ ⊢ A
- X. ∀aX. eq X a a
A
I
6
SLIDE 26
A reflexivity proof
eq; X, a : X; ∅ ⊢ eq X a a
conv
eq; X; ∅ ⊢ ∀aX. eq X a a
∀I
eq; ∅; ∅ ⊢ A
- X. ∀aX. eq X a a
A
I
6
SLIDE 27
A reflexivity proof
eq; X, a : X; ∅ ⊢ P a ⇒ P a
⇒I
eq; X, a : X; ∅ ⊢ eq X a a
conv
eq; X; ∅ ⊢ ∀aX. eq X a a
∀I
eq; ∅; ∅ ⊢ A
- X. ∀aX. eq X a a
A
I
6
SLIDE 28
A reflexivity proof
eq; X, a : X; P a ⊢ P a
assume
eq; X, a : X; ∅ ⊢ P a ⇒ P a
⇒I
eq; X, a : X; ∅ ⊢ eq X a a
conv
eq; X; ∅ ⊢ ∀aX. eq X a a
∀I
eq; ∅; ∅ ⊢ A
- X. ∀aX. eq X a a
A
I
6
SLIDE 29
STT∀βδ as a PTS
Γ ⊢ A : s1 Γ, x : A ⊢ B : s2 (s1, s2, s3) ∈ R Γ ⊢ (x : A) → B : s3
7
SLIDE 30
STT∀βδ as a PTS
S, A = Prop : Type : Kind ∀K ∀ ⇒ → A (Type, Kind, Kind) (Type, Prop, Prop) (Prop, Prop, Prop) (Type, Type, Type) (Kind, Prop, Prop) Type ≺ Kind (subtyping)
7
SLIDE 31
OpenTheory
SLIDE 32
Dedukti D[STT∀βδ] OpenTheory Coq
8
SLIDE 33
OpenTheory vs STT∀βδ
Terms and types are almost the same! Three main differences: In STT∀βδ:
- β and δ extensional
- ∀ and ⇒ connectives
- ∀K is explicit
In OpenTheory:
- β and δ intensional
- = connective
- ∀K is implicit
9
SLIDE 34
OpenTheory vs STT∀βδ
In STT∀βδ:
- β and δ extensional
- ∀ and ⇒ connectives
- ∀K is explicit
In OpenTheory:
- β and δ intensional
- = connective
- ∀K is implicit
hard easy easy
9
SLIDE 35
Why is it hard?
C ⊢ t t≡βδt′ C ⊢ t′
conv
- ≡βδ is the one of Dedukti
- How to annotate proofs? Reduce the term step by step.
- β of STT∀βδ vs administrative β
- Don’t compute the normal form everytime!
10
SLIDE 36
Coq
SLIDE 37
Dedukti D[STT∀βδ] OpenTheory Coq
11
SLIDE 38
Trivial: STT∀βδ is a subsystem of Coq !
12
SLIDE 39
DEMO
13
SLIDE 40
Arithmetic library
Dedukti[STT] OpenTheory Coq Matita Lean PVS size (mb) 1.5 41 0.6 0.6 0.6 9 translation time (s)
- 18
3 3 3 3 checking time (s) 0.1 13 6 2 1 ∼300 14
SLIDE 41
Arithmetic library
Dedukti[STT] OpenTheory Coq Matita Lean PVS size (mb) 1.5 41 0.6 0.6 0.6 9 translation time (s)
- 18
3 3 3 3 checking time (s) 0.1 13 6 2 1 ∼300
- Theorems: 340 (Commutativity of addition, Fermat’s little
theorem)
- Parameters: 46 (nat, bool, ...)
- Axiom: 71 (equalities generated from recursive definitions,...)
- Definitions: 34 (le,primes,...)
14
SLIDE 42
Concept Alignement
SLIDE 43
Fermat’s little theorem
Theorem congruent_exp_pred_SO : forall p a : Nat, prime p -> Not (divides p a) -> congruent (exp a (pred p)) (S O) p.
15
SLIDE 44
Fermat’s little theorem
Theorem congruent_exp_pred_SO : forall p a : Nat, prime p -> Not (divides p a) -> congruent (exp a (pred p)) (S O) p.
15
SLIDE 45
Fermat’s little theorem
Theorem congruent_exp_pred_SO : forall p a : Nat, prime p -> Not (divides p a) -> congruent (exp a (pred p)) (S O) p. Parameter exp : Nat -> Nat -> Nat. Axiom axiom_exp_O : forall n : Nat, equal Nat (exp n O) (S O). Axiom axiom_exp_S : forall n m : Nat, equal Nat (exp n (S m)) (times (exp n m) n).
15
SLIDE 46
Conclusion
SLIDE 47
Conclusion
Dedukti D[STT∀βδ] D[CiCω] OpenTheory Matita Coq Lean ? PVS
- A relatively weak logic: STT∀βδ
- An automatic translation of a library to 5 other proof systems
16
SLIDE 48
Future work
- Sharing the aritmetic library to other systems (Agda, Idris,...)
- Developing an encylopedia of proofs: Logipedia
- A standardization of an arithmetic library?
17
SLIDE 49
Future work
- Sharing the aritmetic library to other systems (Agda, Idris,...)
- Developing an encylopedia of proofs: Logipedia
- A standardization of an arithmetic library?