Unified Classical Logic Completeness A Coinductive Pearl Jasmin - - PowerPoint PPT Presentation

unified classical logic completeness
SMART_READER_LITE
LIVE PREVIEW

Unified Classical Logic Completeness A Coinductive Pearl Jasmin - - PowerPoint PPT Presentation

Unified Classical Logic Completeness A Coinductive Pearl Jasmin Blanchette Andrei Popescu Dmitriy Traytel Isabelle H O L = All too often, proof-theoretic methods are neglected in favor of shorter, and superficially


slide-1
SLIDE 1

Unified Classical Logic Completeness

A Coinductive Pearl

Jasmin Blanchette Andrei Popescu Dmitriy Traytel

λ → ∀

=

Isabelle

β α

H O L

slide-2
SLIDE 2
slide-3
SLIDE 3

All too often, proof-theoretic methods are neglected in favor of shorter, and superficially more elegant semantic arguments. [In contrast, in Gallier’s book] the treatment of the proof theory of the Gentzen system is oriented towards computation with proofs. For example, a pseudo-Pascal version of a complete search procedure for first-order cut-free Gentzen proofs is presented. Frank Pfenning

slide-4
SLIDE 4

A Proof

∀x. p(x) ⊢ p(y) ∧ p(z)

slide-5
SLIDE 5

A Proof

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x) ⊢ p(z)

CONJRp(y), p(z)

slide-6
SLIDE 6

A Proof

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ p(z)

CONJRp(y), p(z) ALLLx,p(x),y

slide-7
SLIDE 7

A Proof

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ p(z)

CONJRp(y), p(z) ALLLx,p(x),y AXp(y)

slide-8
SLIDE 8

A Proof

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ p(z) ∀x. p(x), p(z) ⊢ p(z)

CONJRp(y), p(z) ALLLx,p(x),y ALLLx,p(x),z AXp(y)

slide-9
SLIDE 9

A Proof

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ p(z) ∀x. p(x), p(z) ⊢ p(z)

CONJRp(y), p(z) ALLLx,p(x),y ALLLx,p(x),z AXp(y) AXp(z)

slide-10
SLIDE 10

A Failing Proof

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ p(z)

CONJRp(y), p(z) ALLLx,p(x),y AXp(y)

slide-11
SLIDE 11

A Failing Proof

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ p(z) ∀x. p(x), p(y) ⊢ p(z)

CONJRp(y), p(z) ALLLx,p(x),y AXp(y) ALLLx,p(x),y

slide-12
SLIDE 12

A Failing Proof

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ p(z) ∀x. p(x), p(y) ⊢ p(z) ∀x. p(x), p(y) ⊢ p(z)

CONJRp(y), p(z) ALLLx,p(x),y AXp(y) ALLLx,p(x),y ALLLx,p(x),y

slide-13
SLIDE 13

A Failing Proof

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ p(z) ∀x. p(x), p(y) ⊢ p(z) ∀x. p(x), p(y) ⊢ p(z) ∀x. p(x), p(y) ⊢ p(z)

. . .

CONJRp(y), p(z) ALLLx,p(x),y AXp(y) ALLLx,p(x),y ALLLx,p(x),y ALLLx,p(x),y ALLLx,p(x),y

slide-14
SLIDE 14

A Systematic Proof

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ p(z) ∀x. p(x), p(x) ⊢ p(z) ∀x. p(x), p(y) ⊢ p(z) ∀x. p(x), p(z) ⊢ p(z)

CONJRp(y), p(z) ALLLx,p(x),y AXp(y) ALLLx,p(x),x ALLLx,p(x),y ALLLx,p(x),z AXp(z)

slide-15
SLIDE 15

A Failing Systematic Proof

∀x. p(x) ⊢ p(y) ∧ q(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ q(z) ∀x. p(x), p(x) ⊢ q(z) ∀x. p(x), p(y) ⊢ q(z) ∀x. p(x), p(z) ⊢ q(z)

. . .

CONJRp(y), p(z) ALLLx,p(x),y AXp(y) ALLLx,p(x),x ALLLx,p(x),y ALLLx,p(x),z ALLLx,p(x),y

slide-16
SLIDE 16

Our Interest in Gallier’s Proof

Polymorphic FOL

  • TFF1

− → Monomorphic FOL

  • TFF0

− → Untyped FOL

  • FOF
slide-17
SLIDE 17

Our Interest in Gallier’s Proof

Polymorphic FOL

  • TFF1

− → Monomorphic FOL

  • TFF0

− → Untyped FOL

  • FOF

Claessen, Lillieström, Smallbone CADE 2011 Blanchette, Böhme, Popescu, Smallbone TACAS 2013

slide-18
SLIDE 18

Our Interest in Gallier’s Proof

Polymorphic FOL

  • TFF1

− → Monomorphic FOL

  • TFF0

− → Untyped FOL

  • FOF

Claessen, Lillieström, Smallbone CADE 2011 Blanchette, Böhme, Popescu, Smallbone TACAS 2013 Blanchette, Popescu FroCoS 2013

slide-19
SLIDE 19

How to Formalize Completeness?

Harrison TPHOLs 1998 HOL Light Henkin Berghofer 2002 Isabelle/HOL Henkin Ridge, Margetson TPHOLs 2005 Isabelle/HOL Beth–Hintikka Ilik 2010 Coq Henkin Schlöder, Koepke 2012 Mizar Henkin

Henkin ≈ Gödel ≈ canonical models ≈ semantic Beth–Hintikka ≈ Gallier ≈ complete prover ≈ syntactic

slide-20
SLIDE 20

How to Formalize Completeness?

Harrison TPHOLs 1998 HOL Light Henkin Berghofer 2002 Isabelle/HOL Henkin Ridge, Margetson TPHOLs 2005 Isabelle/HOL Beth–Hintikka Ilik 2010 Coq Henkin Schlöder, Koepke 2012 Mizar Henkin

Henkin ≈ Gödel ≈ canonical models ≈ semantic Beth–Hintikka ≈ Gallier ≈ complete prover ≈ syntactic

slide-21
SLIDE 21

Our Version

  • Isabelle/HOL, Beth–Hintikka
  • Abstract proof + instantiation with rich FOLs
  • Codatatype of possibly infinite trees
  • Code generation to Haskell
slide-22
SLIDE 22

Our Version

  • Isabelle/HOL, Beth–Hintikka
  • Abstract proof + instantiation with rich FOLs
  • Codatatype of possibly infinite trees
  • Code generation to Haskell

A A pseudo-Pascal version of a complete search procedure for first-order cut-free Gentzen proofs is presented.

slide-23
SLIDE 23

Our Version

  • Isabelle/HOL, Beth–Hintikka
  • Abstract proof + instantiation with rich FOLs
  • Codatatype of possibly infinite trees
  • Code generation to Haskell

A Haskell A pseudo-Pascal ——————– version of a complete search procedure for first-order cut-free Gentzen proofs is presented.

slide-24
SLIDE 24

Isabelle/HOL Demonstration

slide-25
SLIDE 25

Codatatypes

Inductive (or algebraic) datatypes: datatype α list = Nil | Cons α (α list)

slide-26
SLIDE 26

Codatatypes

Inductive (or algebraic) datatypes: datatype α list = Nil | Cons α (α list) Theorems: Distinctness, injectivity, exhaustiveness, induction

slide-27
SLIDE 27

Codatatypes

Inductive (or algebraic) datatypes: datatype α list = Nil | Cons α (α list) Theorems: Distinctness, injectivity, exhaustiveness, induction Coinductive (or coalgebraic) datatypes: codatatype α llist = LNil | LCons α (α llist)

slide-28
SLIDE 28

Codatatypes

Inductive (or algebraic) datatypes: datatype α list = Nil | Cons α (α list) Theorems: Distinctness, injectivity, exhaustiveness, induction Coinductive (or coalgebraic) datatypes: codatatype α llist = LNil | LCons α (α llist) codatatype α stream = SCons α (α stream)

slide-29
SLIDE 29

Codatatypes

Inductive (or algebraic) datatypes: datatype α list = Nil | Cons α (α list) Theorems: Distinctness, injectivity, exhaustiveness, induction Coinductive (or coalgebraic) datatypes: codatatype α llist = LNil | LCons α (α llist) codatatype α stream = SCons α (α stream) Theorems: Distinctness, injectivity, exhaustiveness, coinduction

slide-30
SLIDE 30

Syntax and Semantics

datatype fmla = Atm atom | Neg fmla | Conj fmla fmla | All var fmla

slide-31
SLIDE 31

Syntax and Semantics

datatype fmla = Atm atom | Neg fmla | Conj fmla fmla | All var fmla Terms

xS

ξ

= ξ x f(t1, ... , tn)S

ξ

=

F

f

  • t1S

ξ , ... , tnS ξ

  • Atoms

S | =ξ p(t1, ... , tn) =

P

p

  • t1S

ξ , ... , tnS ξ

slide-32
SLIDE 32

Syntax and Semantics

datatype fmla = Atm atom | Neg fmla | Conj fmla fmla | All var fmla Terms

xS

ξ

= ξ x f(t1, ... , tn)S

ξ

=

F

f

  • t1S

ξ , ... , tnS ξ

  • Atoms

S | =ξ p(t1, ... , tn) =

P

p

  • t1S

ξ , ... , tnS ξ

  • Formulas

S | =ξ Atm a = S | =ξ a S | =ξ Neg ϕ = S | =ξ ϕ S | =ξ Conj ϕ ψ = S | =ξ ϕ ∧ S | =ξ ψ S | =ξ All x ϕ = ∀a∈ S. S | =ξ[x←a] ϕ

slide-33
SLIDE 33

A Gentzen System

AX

Γ, Atm a ⊢ ∆, Atm a Γ ⊢ ∆, ϕ

NEGL

Γ, Neg ϕ ⊢ ∆ Γ, ϕ ⊢ ∆

NEGR

Γ ⊢ ∆, Neg ϕ Γ, ϕ, ψ ⊢ ∆

CONJL

Γ, Conj ϕ ψ ⊢ ∆ Γ ⊢ ∆, ϕ Γ ⊢ ∆, ψ

CONJR

Γ ⊢ ∆, Conj ϕ ψ Γ, All x ϕ, ϕ[t/x] ⊢ ∆

ALLL

Γ, All x ϕ ⊢ ∆ Γ ⊢ ∆, ϕ[y/x] ALLR (y fresh) Γ ⊢ ∆, All x ϕ

slide-34
SLIDE 34

Abstracting Away

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ p(z) ∀x. p(x), p(x) ⊢ p(z) ∀x. p(x), p(y) ⊢ p(z) ∀x. p(x), p(z) ⊢ p(z)

CONJRp(y), p(z) ALLLx,p(x),y AXp(y) ALLLx,p(x),x ALLLx,p(x),y ALLLx,p(x),z AXp(z)

slide-35
SLIDE 35

Abstracting Away

s0 s1 s3 s2 s4 s5 s6

r0 r1 r3 r2 r4 r5 r6

slide-36
SLIDE 36

Abstracting Away

(s0, r0) (s1, r1) (s3, r3) (s2, r2) (s4, r4) (s5, r5) (s6, r6)

slide-37
SLIDE 37

Abstracting Away

(s0, r0) (s1, r1) (s3, r3) (s2, r2) (s4, r4) (s5, r5) (s6, r6)

∀x. p(x) ⊢ p(y) ∧ p(z) ∀x. p(x) ⊢ p(y) ∀x. p(x), p(y) ⊢ p(y) ∀x. p(x) ⊢ p(z) ∀x. p(x), p(y) ⊢ p(z) ∀x. p(x), p(y) ⊢ p(z) ∀x. p(x), p(y) ⊢ p(z)

. . . CONJRp(y), p(z) ALLLx,p(x),y AXp(y) ALLLx,p(x),y ALLLx,p(x),y ALLLx,p(x),y AXp(z)

slide-38
SLIDE 38

Abstracting Away

(s0, r0) (s1, r1) (s3, r3) (s2, r2) (s4, r4) (s5, r5) (s6, r6) (s0, r0) (s1, r1) (s3, r3) (s2, r2) (s4, r4) (s5, r5) (s6, r6)

. . .

slide-39
SLIDE 39

Abstracting Away

(s0, r0) (s1, r1) (s3, r3) (s2, r2) (s4, r4) (s5, r5) (s6, r6)

. . .

slide-40
SLIDE 40

Abstracting Away

(s0, r0) (s1, r1) (s3, r3) (s2, r2) (s4, r4) (s5, r5) (s6, r6)

. . . eff : rule → state → state fset → bool enabled r s = (∃ss. eff r s ss)

slide-41
SLIDE 41

Abstracting Away

(s0, r0) (s1, r1) (s3, r3) (s2, r2) (s4, r4) (s5, r5) (s6, r6)

. . . eff : rule → state → state fset → bool enabled r s = (∃ss. eff r s ss) Available ∀s. ∃r. enabled r s Persistent ∀s, r, r ′, s′, ss. enabled r ′ s ∧ r′ = r ∧ eff r s ss ∧ s′ ∈ set ss ⇒ enabled r ′ s′

slide-42
SLIDE 42

Abstracting Away

(s0, r0) (s1, r1) (s3, r3) (s2, r2) (s4, r4) (s5, r5) (s6, r6)

. . . eff : rule → state → state fset → bool enabled r s = (∃ss. eff r s ss) Available ∀s. ∃r. enabled r s Persistent ∀s, r, r ′, s′, ss. enabled r ′ s ∧ r′ = r ∧ eff r s ss ∧ s′ ∈ set ss ⇒ enabled r ′ s′

codatatype tree = Node (state× rule) (tree fset)

slide-43
SLIDE 43

Abstracting Away

(s0, r0) (s1, r1) (s3, r3) (s2, r2) (s4, r4) (s5, r5) (s6, r6)

. . . eff : rule → state → state fset → bool enabled r s = (∃ss. eff r s ss) Available ∀s. ∃r. enabled r s Persistent ∀s, r, r ′, s′, ss. enabled r ′ s ∧ r′ = r ∧ eff r s ss ∧ s′ ∈ set ss ⇒ enabled r ′ s′

codatatype tree = Node (state× rule) (tree fset)

eff r s ss s′ ∈ ss epath (SCons (s′, r ′) σ) epath (SCons (s, r) (SCons (s′, r ′) σ))

slide-44
SLIDE 44

Abstracting Away

(s0, r0) (s1, r1) (s3, r3) (s2, r2) (s4, r4) (s5, r5) (s6, r6)

. . . eff : rule → state → state fset → bool enabled r s = (∃ss. eff r s ss) Available ∀s. ∃r. enabled r s Persistent ∀s, r, r ′, s′, ss. enabled r ′ s ∧ r′ = r ∧ eff r s ss ∧ s′ ∈ set ss ⇒ enabled r ′ s′

codatatype tree = Node (state× rule) (tree fset)

eff r s ss s′ ∈ ss epath (SCons (s′, r ′) σ) epath (SCons (s, r) (SCons (s′, r ′) σ)) Fair ∀r. ev (alw enabledAtr) σ ⇒ alw (ev takenr) σ

slide-45
SLIDE 45

Theorem (Abstract Completeness)

Assume that the effect relation is available and persistent. Then each state admits either a finite proof tree or a fair escape path.

Proof Idea.

mk Tree : rule stream → state → tree

slide-46
SLIDE 46

Theorem (Abstract Completeness)

Assume that the effect relation is available and persistent. Then each state admits either a finite proof tree or a fair escape path.

Proof Idea.

mk Tree : rule stream → state → tree mk Tree ρ s = let SCons r ρ′ = sdropWhile (λr. ¬ enabled r s) ρ ss = (εss. eff r s ss) in Node (s, r) (image (mk Tree ρ′) ss)

slide-47
SLIDE 47

Our CASC-25 Submission

data Stream a = SCons a (Stream a) newtype FSet a = FSet [a] data Tree a = Node a (FSet (Tree a)) fmap f (FSet xs) = FSet (map f xs) sdropWhile p (SCons a s) = if p a then sdropWhile p s else SCons a s mkTree eff rho s = Node (s, r) (fmap (mkTree eff rho’) (fromJust (eff r s))) where SCons r rho’ = sdropWhile (\r -> not (isJust (eff r s))) rho

slide-48
SLIDE 48

Our CASC-25 Submission

data Stream a = SCons a (Stream a) newtype FSet a = FSet [a] data Tree a = Node a (FSet (Tree a)) fmap f (FSet xs) = FSet (map f xs) sdropWhile p (SCons a s) = if p a then sdropWhile p s else SCons a s mkTree eff rho s = Node (s, r) (fmap (mkTree eff rho’) (fromJust (eff r s))) where SCons r rho’ = sdropWhile (\r -> not (isJust (eff r s))) rho

slide-49
SLIDE 49

Conclusion

Our complete abstract proof:

  • 425 lines of Isabelle (≈ 8 pages)
  • Rigorous
  • Formal (mechanized)
  • Coinductive
slide-50
SLIDE 50

Conclusion

Our complete abstract proof:

  • 425 lines of Isabelle (≈ 8 pages)
  • Rigorous
  • Formal (mechanized)
  • Coinductive

A key part of “mechanized metatheory of Sledgehammer”

slide-51
SLIDE 51

Conclusion

Our complete abstract proof:

  • 425 lines of Isabelle (≈ 8 pages)
  • Rigorous
  • Formal (mechanized)
  • Coinductive

A key part of “mechanized metatheory of Sledgehammer” Future work:

  • Completeness for resolution, superposition, ... ?
slide-52
SLIDE 52

Evangelizing presupposes a desire in the Church to come out of

  • herself. ... When the Church does not come out of herself to

evangelize, she becomes self-referential and then gets sick. The evils that, over time, happen in ecclesial institutions have their root in self-referentiality and a kind of theological narcissism. Jorge Mario Bergoglio