Sharing a Library between Proof Assistants: Reaching out the HOL - - PowerPoint PPT Presentation

sharing a library between proof assistants reaching out
SMART_READER_LITE
LIVE PREVIEW

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 1

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

slide-2
SLIDE 2

Introduction

slide-3
SLIDE 3

Dedukti Coq Agda RedPRL Isabelle/HOL Matita Twelf Automath PVS Beluga Abella

2

slide-4
SLIDE 4

Dedukti Coq Agda RedPRL Isabelle/HOL Matita Twelf Automath PVS Beluga Abella

2

slide-5
SLIDE 5

Dedukti Coq Agda RedPRL Isabelle/HOL Matita Twelf Automath PVS Beluga Abella

2

slide-6
SLIDE 6

Dedukti

2

slide-7
SLIDE 7

Dedukti Matita OpenTheory

2

slide-8
SLIDE 8

OpenTheory HOL-Light HOL4 Isabelle/HOL HOL Zero

2

slide-9
SLIDE 9

Dedukti D[OT] D[Matita] OpenTheory Matita

2

slide-10
SLIDE 10

Dedukti D[STT∀βδ] D[CiCω] OpenTheory Matita

2

slide-11
SLIDE 11

Dedukti D[STT∀βδ] D[CiCω] OpenTheory Matita Coq

2

slide-12
SLIDE 12

Dedukti D[STT∀βδ] D[CiCω] OpenTheory Matita Coq Lean ? PVS

2

slide-13
SLIDE 13

STT∀βδ

slide-14
SLIDE 14

A real implementation of STT∀βδ?

Dedukti D[STT∀βδ] STT∀βδ

3

slide-15
SLIDE 15

A real implementation of STT∀βδ?

Dedukti D[STT∀βδ] STT∀βδ

3

slide-16
SLIDE 16

A real implementation of STT∀βδ?

Dedukti D[STT∀βδ] STT∀βδ In this talk, Dedukti is abstract! The encoding is shallow

3

slide-17
SLIDE 17

STT

Types A, B :≡ ι | o | A → B Terms t, u :≡ x | λxA. t | t u | ∀xA. t | t ⇒ u

4

slide-18
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
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
SLIDE 20

STT∀βδ is an extension of STT

STT∀βδ = STTβδ + prenex polymorphism

5

slide-21
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
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
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
SLIDE 24

A reflexivity proof

eq; ∅; ∅ ⊢ A

  • X. ∀aX. eq X a a

A

I

6

slide-25
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
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
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
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
SLIDE 29

STT∀βδ as a PTS

Γ ⊢ A : s1 Γ, x : A ⊢ B : s2 (s1, s2, s3) ∈ R Γ ⊢ (x : A) → B : s3

7

slide-30
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
SLIDE 31

OpenTheory

slide-32
SLIDE 32

Dedukti D[STT∀βδ] OpenTheory Coq

8

slide-33
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
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
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
SLIDE 36

Coq

slide-37
SLIDE 37

Dedukti D[STT∀βδ] OpenTheory Coq

11

slide-38
SLIDE 38

Trivial: STT∀βδ is a subsystem of Coq !

12

slide-39
SLIDE 39

DEMO

13

slide-40
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
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
SLIDE 42

Concept Alignement

slide-43
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
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
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
SLIDE 46

Conclusion

slide-47
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
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
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?

Contributions are welcome! https://github.com/Deducteam/Logipedia

17