Higher order proof reconstruction from paramodulation-based - - PowerPoint PPT Presentation

higher order proof reconstruction from paramodulation
SMART_READER_LITE
LIVE PREVIEW

Higher order proof reconstruction from paramodulation-based - - PowerPoint PPT Presentation

Higher order proof reconstruction from paramodulation-based refutations: the unit equality case Andrea Asperti and Enrico Tassi Department of Computer Science, University of Bologna 28-30 June 2007 Context What we had: Matita is an ITP


slide-1
SLIDE 1

Higher order proof reconstruction from paramodulation-based refutations: the unit equality case

Andrea Asperti and Enrico Tassi

Department of Computer Science, University of Bologna

28-30 June 2007

slide-2
SLIDE 2

Context

What we had:

◮ Matita is an ITP developed at the university of Bologna ◮ Lack of automation is one of the most reported issues of ITPs ◮ ATP are effective tools, but usually do not provide a proof

  • bject, sometimes a minimalistic trace mainly for efficiency

(both space and time).

◮ Matita follows the independent verification principle: we need

a real CIC proof

◮ We implemented our own first order paramodulation based

automatic theorem prover (that, of course, provides a good trace), restricted to the unit equality case.

slide-3
SLIDE 3

Context

What we had:

◮ Matita is an ITP developed at the university of Bologna ◮ Lack of automation is one of the most reported issues of ITPs ◮ ATP are effective tools, but usually do not provide a proof

  • bject, sometimes a minimalistic trace mainly for efficiency

(both space and time).

◮ Matita follows the independent verification principle: we need

a real CIC proof

◮ We implemented our own first order paramodulation based

automatic theorem prover (that, of course, provides a good trace), restricted to the unit equality case.

◮ Why your own prover?

slide-4
SLIDE 4

Context

What we had:

◮ Matita is an ITP developed at the university of Bologna ◮ Lack of automation is one of the most reported issues of ITPs ◮ ATP are effective tools, but usually do not provide a proof

  • bject, sometimes a minimalistic trace mainly for efficiency

(both space and time).

◮ Matita follows the independent verification principle: we need

a real CIC proof

◮ We implemented our own first order paramodulation based

automatic theorem prover (that, of course, provides a good trace), restricted to the unit equality case.

◮ Why your own prover? For fun :-)

slide-5
SLIDE 5

Aim

What we want:

◮ To be able to read the proofs:

◮ To understand what the automatic procedure did. ◮ Nice natural language rendering using MoWGLI tech.

a = b by lemma 1 = c by lemma 2 = d by lemma 3

slide-6
SLIDE 6

Aim

What we want:

◮ To be able to read the proofs:

◮ To understand what the automatic procedure did. ◮ Nice natural language rendering using MoWGLI tech.

a = b by lemma 1 = c by lemma 2 = d by lemma 3

◮ Save earth from overheating

◮ Fast to typecheck ◮ Not re-doing proof search every time we compile a file

slide-7
SLIDE 7

Plan

The plan:

  • 1. Start from the trace of the prover
  • 2. Transform it into a CIC object
  • 3. Apply type preserving transformations to obtain a nice proof
  • bject suitable for point 4.
  • 4. Render it in natural language (re-using MoWGLI/Matita

rendering facility)

  • 5. Thanks to C. Sacerdoti Coen declarative language, the printed

proof is a re-executable script (PLMMS talk).

slide-8
SLIDE 8

Outline

◮ Equality in CIC ◮ Superposition rules ◮ Proof reconstruction ◮ Demo ◮ Conclusion

slide-9
SLIDE 9

Equality in CIC

◮ Not built in, but an inductive predicate with one constructor:

refl eq : x =A x

◮ As any inductive type, comes with an eliminator in two

flavours: h : P a1 k : a1 =A a2 (eq ind A a1 P h a2 k) : P a2 h : P a2 k : a1 =A a2 (eq ind r A a2 P h a1 k) : P a1

slide-10
SLIDE 10

Superposition rules

◮ Superposition left (backward reasoning)

⊢ l =A r t =B s ⊢ C t[r]pσ =B sσ ⊢ Cσ

◮ Superposition right (forward reasoning)

⊢ l =A r ⊢ t =B s ⊢ t[r]pσ =B sσ

◮ Equality resolution

t =A s ⊢ C ⊢ Cσ

slide-11
SLIDE 11

Data flow (1/3)

  • Proof

trace ψ

  • CIC

eq ind ρ

  • CIC

eq trans eq sym θ

  • CIC

canonical

slide-12
SLIDE 12

Data flow (1/3)

  • Proof

trace ψ

  • CIC

eq ind ρ

  • CIC

eq trans eq sym θ

  • CIC

canonical

slide-13
SLIDE 13

Superposition rules with CIC proofs

◮ Superposition left (backward reasoning)

⊢ l =A r t =B s ⊢ C t[r]pσ =B sσ ⊢ Cσ

◮ Superposition right (forward reasoning)

⊢ l =A r ⊢ t =B s ⊢ t[r]pσ =B sσ

◮ Equality resolution

t =A s ⊢ C ⊢ Cσ

slide-14
SLIDE 14

Superposition rules with CIC proofs

◮ Superposition left (backward reasoning)

⊢ h : l =A r α : t =B s ⊢ M : C β : t[r]pσ =B sσ ⊢ Mσ[R/ασ] : Cσ R = (eq ind r A rσ (λx : A.t[x]p =B s)σ β lσ hσ) : tσ =B sσ

◮ Superposition right (forward reasoning)

⊢ l =A r ⊢ t =B s ⊢ t[r]pσ =B sσ

◮ Equality resolution

t =A s ⊢ C ⊢ Cσ

slide-15
SLIDE 15

Superposition rules with CIC proofs

◮ Superposition left (backward reasoning)

⊢ h : l =A r α : t =B s ⊢ M : C β : t[r]pσ =B sσ ⊢ Mσ[R/ασ] : Cσ R = (eq ind r A rσ (λx : A.t[x]p =B s)σ β lσ hσ) : tσ =B sσ

◮ Superposition right (forward reasoning)

⊢ h : l =A r ⊢ k : t =B s ⊢ R : t[r]pσ =B sσ R = (eq ind A lσ (λx : A.t[x]p =B s)σ kσ rσ hσ) : t[r]pσ =B sσ

◮ Equality resolution

t =A s ⊢ C ⊢ Cσ

slide-16
SLIDE 16

Superposition rules with CIC proofs

◮ Superposition left (backward reasoning)

⊢ h : l =A r α : t =B s ⊢ M : C β : t[r]pσ =B sσ ⊢ Mσ[R/ασ] : Cσ R = (eq ind r A rσ (λx : A.t[x]p =B s)σ β lσ hσ) : tσ =B sσ

◮ Superposition right (forward reasoning)

⊢ h : l =A r ⊢ k : t =B s ⊢ R : t[r]pσ =B sσ R = (eq ind A lσ (λx : A.t[x]p =B s)σ kσ rσ hσ) : t[r]pσ =B sσ

◮ Equality resolution

α : t =A s ⊢ M : C ⊢ M[refl eq A tσ/α] : Cσ

slide-17
SLIDE 17

Superposition rules with CIC proofs

◮ Superposition left (backward reasoning)

⊢ h : l =A r α : t =B s ⊢ M : C t[r]pσ =B sσ ⊢ Cσ

◮ Superposition right (forward reasoning)

⊢ h : l =A r ⊢ k : t =B s ⊢ t[r]pσ =B sσ

◮ Equality resolution

α : t =A s ⊢ C ⊢ Cσ

slide-18
SLIDE 18

Data flow (2/3)

  • Proof

trace ψ

  • CIC

eq ind ρ

  • CIC

eq trans eq sym θ

  • CIC

canonical

slide-19
SLIDE 19

Data flow (2/3)

  • Proof

trace ψ

  • CIC

eq ind ρ

  • CIC

eq trans eq sym θ

  • CIC

canonical

slide-20
SLIDE 20

Data flow (2/3)

Problem Search Steps Typing Proof size raw

  • pt

raw

  • pt

BOO069-1 2.15 27 79.50 3.1M BOO071-1 2.23 27 203.03 5.4M GRP118-1 0.11 17 7.66 546K GRP485-1 0.17 47 323.35 5.1M LAT008-1 0.48 40 22.56 933K LCL115-2 0.81 52 24.42 1.1M

  • Tab. 1. Timing (in seconds) and proof size
slide-21
SLIDE 21

Data flow (2/3)

Problem Search Steps Typing Proof size raw

  • pt

raw

  • pt

BOO069-1 2.15 27 79.50 0.23 3.1M 29K BOO071-1 2.23 27 203.03 0.22 5.4M 28K GRP118-1 0.11 17 7.66 0.13 546K 21K GRP485-1 0.17 47 323.35 0.23 5.1M 33K LAT008-1 0.48 40 22.56 0.12 933K 19K LCL115-2 0.81 52 24.42 0.29 1.1M 37K

  • Tab. 1. Timing (in seconds) and proof size
slide-22
SLIDE 22

Data flow (2/3)

  • Proof

trace ψ

  • CIC

letin eq ind ρ

  • CIC

letin eq trans eq sym θ

  • CIC

letin canonical

slide-23
SLIDE 23

Data flow (2/3)

  • Proof

trace ψ

  • CIC

letin eq ind ρ

  • CIC

letin eq trans eq sym θ

  • CIC

letin canonical

slide-24
SLIDE 24

Normal form

Given the following standard lemmas: trans : ∀A : Type.∀x, y, z : A.x =A y → y =A z → x =A z sym : ∀A : Type.∀x, y : A.x =A y → y =A x eq f : ∀A, B : Type.∀f : A → B.∀x, y : A.x =A y → (f x) =B (f y)

Definition (Proof normal form)

π = eq f B C ∆ a b axiom | eq f B C ∆ a b (sym B b a axiom) | trans A a b c π π

slide-25
SLIDE 25

ρ, CIC eq ind→ CIC trans sym

ρ(π) ρ′(λx :B.x, π) when π : a =B b ρ′(∆, eq ind A a (λx.Γ[x] =B m) π1 b π2) trans C (∆ ◦ Γ)[b] (∆ ◦ Γ)[a] ∆[m] (sym C (∆ ◦ Γ)[a] (∆ ◦ Γ)[b] ρ′(∆ ◦ Γ, π2)) ρ′(∆, π1) ρ′(∆, eq ind r A a (λx.Γ[x] =B m) π1 b π2) trans C (∆ ◦ Γ)[b] (∆ ◦ Γ)[a] ∆[m] ρ′(∆ ◦ Γ, π2) ρ′(∆, π1) ρ′(∆, eq ind A a (λx.m =B Γ[x]) π2 b π1) trans C ∆[m] (∆ ◦ Γ)[a] (∆ ◦ Γ)[b] ρ′(∆, π2) ρ′(∆ ◦ Γ, π1) ρ′(∆, eq ind r A a (λx.m =B Γ[x]) π1 b π2) trans C ∆[m] (∆ ◦ Γ)[a] (∆ ◦ Γ)[b] ρ′(∆, π1) (sym C (∆ ◦ Γ)[b] (∆ ◦ Γ)[a] ρ′(∆ ◦ Γ, π2)) ρ′(∆, π) eq f B C ∆ a b π when π : a =B b and ∆ : B → C

slide-26
SLIDE 26

Theorem 1: ρ is type preserving

if ∆ : B → C and π : x =B y, then ρ′(∆, π) : ∆[x] =C ∆[y] By induction on the size of π Γ : A → B π1 : Γ[a] =B m π2 : a =A b ρ′(∆, eq ind A a (λx.Γ[x] =B m) π1 b π2 : Γ[b] =B m) ⇒ ρ′(∆ ◦ Γ, π2) : ∆[Γ[a]] =C ∆[Γ[b]] P ≡ (sym C ∆[Γ[a]] ∆[Γ[b]] ρ′(∆ ◦ Γ, π2)) : ∆[Γ[b]] =C ∆[Γ[a]] π1 : Γ[a] =B m Q ≡ ρ′(∆, π1) : ∆[Γ[a]] =C ∆[m] P : ∆[Γ[b]] =C ∆[Γ[a]] Q : ∆[Γ[a]] =C ∆[m] trans C ∆[Γ[b]] ∆[Γ[a]] ∆[m] P Q : ∆[Γ[b]] =C ∆[m]

slide-27
SLIDE 27

Data flow (3/3)

  • Proof

trace ψ

  • CIC

eq ind ρ

  • CIC

eq trans eq sym θ

  • CIC

canonical

slide-28
SLIDE 28

θ, CIC trans sym→ CIC canonical

Pushing sym up. θ(sym A b a (trans A b c a π1 π2)) trans A a c b θ(sym A c a π2) θ(sym A b c π1) θ(sym A b a (sym A a b π)) θ(π) θ(trans A a c b π1 π2) trans A a c b θ(π1) θ(π2) θ(sym B ∆[a] ∆[b] (eq f A B ∆ a b π)) eq f A B ∆ b a (sym A a b π) θ(π) π

slide-29
SLIDE 29

Theorem 2: θ is type preserving

By induction on the size of the proof. θ(sym A b a (trans A b c a π1 π2) ) ⇒ trans A a c b θ(sym A c a π2) θ(sym A b c π1)

slide-30
SLIDE 30

Theorem 2: θ is type preserving

By induction on the size of the proof. θ(sym A b a (trans A b c a π1 π2) : a =A b) ⇒ trans A a c b θ(sym A c a π2) θ(sym A b c π1)

slide-31
SLIDE 31

Theorem 2: θ is type preserving

By induction on the size of the proof. θ(sym A b a (trans A b c a π1 π2) : a =A b) ⇒ trans A a c b θ(sym A c a π2) θ(sym A b c π1) : a =A b

slide-32
SLIDE 32

Theorem 2: θ is type preserving

By induction on the size of the proof. π1 : b =A c π2 : c =A a θ(sym A b a (trans A b c a π1 π2) : a =A b) ⇒ trans A a c b θ(sym A c a π2) θ(sym A b c π1) : a =A b

slide-33
SLIDE 33

Theorem 2: θ is type preserving

By induction on the size of the proof. π1 : b =A c π2 : c =A a θ(sym A b a (trans A b c a π1 π2) : a =A b) ⇒ sym A c a π2 : a =A c trans A a c b θ(sym A c a π2) θ(sym A b c π1) : a =A b

slide-34
SLIDE 34

Theorem 2: θ is type preserving

By induction on the size of the proof. π1 : b =A c π2 : c =A a θ(sym A b a (trans A b c a π1 π2) : a =A b) ⇒ sym A c a π2 : a =A c sym A b c π1 : c =A b trans A a c b θ(sym A c a π2) θ(sym A b c π1) : a =A b

slide-35
SLIDE 35

Theorem 2: θ is type preserving

By induction on the size of the proof. π1 : b =A c π2 : c =A a θ(sym A b a (trans A b c a π1 π2) : a =A b) ⇒ θ(sym A c a π2) : a =A c θ(sym A b c π1) : c =A b trans A a c b θ(sym A c a π2) θ(sym A b c π1) : a =A b

slide-36
SLIDE 36

Examples

◮ Demo!

slide-37
SLIDE 37

Future work

◮ We developed a prolog-style proof search procedure, we want

nice proof objects also in this case.

◮ Declarative and procedural language rendering of such proof

  • bjects (work in progress).

◮ Make tactics more “proof reconstruction” friendly.