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 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
A Proof ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
A Proof ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ p ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
A Proof ∀ x . p ( x ) , p ( y ) ⊢ p ( y ) A LL L x , p ( x ) , y ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ p ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
A Proof A X p ( y ) ∀ x . p ( x ) , p ( y ) ⊢ p ( y ) A LL L x , p ( x ) , y ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ p ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
A Proof A X p ( y ) ∀ x . p ( x ) , p ( y ) ⊢ p ( y ) ∀ x . p ( x ) , p ( z ) ⊢ p ( z ) A LL L x , p ( x ) , y A LL L x , p ( x ) , z ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ p ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
A Proof A X p ( y ) A X p ( z ) ∀ x . p ( x ) , p ( y ) ⊢ p ( y ) ∀ x . p ( x ) , p ( z ) ⊢ p ( z ) A LL L x , p ( x ) , y A LL L x , p ( x ) , z ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ p ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
A Failing Proof A X p ( y ) ∀ x . p ( x ) , p ( y ) ⊢ p ( y ) A LL L x , p ( x ) , y ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ p ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
A Failing Proof A X p ( y ) ∀ x . p ( x ) , p ( y ) ⊢ p ( y ) ∀ x . p ( x ) , p ( y ) ⊢ p ( z ) A LL L x , p ( x ) , y A LL L x , p ( x ) , y ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ p ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
A Failing Proof ∀ x . p ( x ) , p ( y ) ⊢ p ( z ) A LL L x , p ( x ) , y A X p ( y ) ∀ x . p ( x ) , p ( y ) ⊢ p ( y ) ∀ x . p ( x ) , p ( y ) ⊢ p ( z ) A LL L x , p ( x ) , y A LL L x , p ( x ) , y ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ p ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
A Failing Proof . . . A LL L x , p ( x ) , y ∀ x . p ( x ) , p ( y ) ⊢ p ( z ) A LL L x , p ( x ) , y ∀ x . p ( x ) , p ( y ) ⊢ p ( z ) A LL L x , p ( x ) , y A X p ( y ) ∀ x . p ( x ) , p ( y ) ⊢ p ( y ) ∀ x . p ( x ) , p ( y ) ⊢ p ( z ) A LL L x , p ( x ) , y A LL L x , p ( x ) , y ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ p ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
A Systematic Proof A X p ( z ) ∀ x . p ( x ) , p ( z ) ⊢ p ( z ) A LL L x , p ( x ) , z ∀ x . p ( x ) , p ( y ) ⊢ p ( z ) A LL L x , p ( x ) , y A X p ( y ) ∀ x . p ( x ) , p ( y ) ⊢ p ( y ) ∀ x . p ( x ) , p ( x ) ⊢ p ( z ) A LL L x , p ( x ) , y A LL L x , p ( x ) , x ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ p ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
A Failing Systematic Proof . . . A LL L x , p ( x ) , y ∀ x . p ( x ) , p ( z ) ⊢ q ( z ) A LL L x , p ( x ) , z ∀ x . p ( x ) , p ( y ) ⊢ q ( z ) A LL L x , p ( x ) , y A X p ( y ) ∀ x . p ( x ) , p ( y ) ⊢ p ( y ) ∀ x . p ( x ) , p ( x ) ⊢ q ( z ) A LL L x , p ( x ) , y A LL L x , p ( x ) , x ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ q ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ q ( z )
Our Interest in Gallier’s Proof − → Monomorphic FOL − → Untyped FOL Polymorphic FOL � �� � � �� � � �� � TFF1 TFF0 FOF
Our Interest in Gallier’s Proof − → Monomorphic FOL − → Untyped FOL Polymorphic FOL � �� � � �� � � �� � TFF1 TFF0 FOF Claessen, Lillieström, Smallbone CADE 2011 Blanchette, Böhme, Popescu, Smallbone TACAS 2013
Our Interest in Gallier’s Proof − → Monomorphic FOL − → Untyped FOL Polymorphic FOL � �� � � �� � � �� � TFF1 TFF0 FOF Claessen, Lillieström, Smallbone CADE 2011 Blanchette, Böhme, Popescu, Smallbone TACAS 2013 Blanchette, Popescu FroCoS 2013
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
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
Our Version • Isabelle/HOL, Beth–Hintikka • Abstract proof + instantiation with rich FOLs • Codatatype of possibly infinite trees • Code generation to Haskell
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.
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.
Isabelle/HOL Demonstration
Codatatypes Inductive (or algebraic) datatypes: datatype α list = Nil | Cons α ( α list )
Codatatypes Inductive (or algebraic) datatypes: datatype α list = Nil | Cons α ( α list ) Theorems: Distinctness, injectivity, exhaustiveness, induction
Codatatypes Inductive (or algebraic) datatypes: datatype α list = Nil | Cons α ( α list ) Theorems: Distinctness, injectivity, exhaustiveness, induction Coinductive (or coalgebraic) datatypes: codatatype α llist = LNil | LCons α ( α llist )
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 )
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
Syntax and Semantics datatype fmla = Atm atom | Neg fmla | Conj fmla fmla | All var fmla
Syntax and Semantics datatype fmla = Atm atom | Neg fmla | Conj fmla fmla | All var fmla � x � S = Terms ξ x ξ � � � f ( t 1 , ... , t n ) � S � t 1 � S ξ , ... , � t n � S = F f ξ ξ � � � t 1 � S ξ , ... , � t n � S S | = ξ p ( t 1 , ... , t n ) = Atoms P p ξ
Syntax and Semantics datatype fmla = Atm atom | Neg fmla | Conj fmla fmla | All var fmla � x � S = Terms ξ x ξ � � � f ( t 1 , ... , t n ) � S � t 1 � S ξ , ... , � t n � S = F f ξ ξ � � � t 1 � S ξ , ... , � t n � S S | = ξ p ( t 1 , ... , t n ) = Atoms P p ξ S | = ξ Atm a = S | = ξ a Formulas = ξ Neg ϕ = = ξ ϕ S | S �| S | = ξ Conj ϕ ψ = S | = ξ ϕ ∧ S | = ξ ψ = ξ All x ϕ = = ξ [ x ← a ] ϕ S | ∀ a ∈ S . S |
A Gentzen System Γ ⊢ ∆ , ϕ Γ , ϕ ⊢ ∆ A X N EG L N EG R Γ , Atm a ⊢ ∆ , Atm a Γ , Neg ϕ ⊢ ∆ Γ ⊢ ∆ , Neg ϕ Γ , ϕ , ψ ⊢ ∆ Γ ⊢ ∆ , ϕ Γ ⊢ ∆ , ψ C ONJ L C ONJ R Γ , Conj ϕ ψ ⊢ ∆ Γ ⊢ ∆ , Conj ϕ ψ Γ , All x ϕ , ϕ [ t / x ] ⊢ ∆ Γ ⊢ ∆ , ϕ [ y / x ] A LL R A LL L ( y fresh) Γ , All x ϕ ⊢ ∆ Γ ⊢ ∆ , All x ϕ
Abstracting Away A X p ( z ) ∀ x . p ( x ) , p ( z ) ⊢ p ( z ) A LL L x , p ( x ) , z ∀ x . p ( x ) , p ( y ) ⊢ p ( z ) A X p ( y ) A LL L x , p ( x ) , y ∀ x . p ( x ) , p ( y ) ⊢ p ( y ) ∀ x . p ( x ) , p ( x ) ⊢ p ( z ) A LL L x , p ( x ) , y A LL L x , p ( x ) , x ∀ x . p ( x ) ⊢ p ( y ) ∀ x . p ( x ) ⊢ p ( z ) C ONJ R p ( y ) , p ( z ) ∀ x . p ( x ) ⊢ p ( y ) ∧ p ( z )
Abstracting Away r 6 s 6 r 5 s 5 r 4 r 3 s 3 s 4 r 1 r 2 s 1 s 2 r 0 s 0
Abstracting Away ( s 6 , r 6 ) ( s 5 , r 5 ) ( s 3 , r 3 ) ( s 4 , r 4 ) ( s 1 , r 1 ) ( s 2 , r 2 ) ( s 0 , r 0 )
Recommend
More recommend