Polarized Rewriting and Tableaux in B Set Theory SETS 2018 Olivier Hermant CRI, MINES ParisTech, PSL Research University June 5, 2018 O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 1 / 17
Introduction Assumes familiarity with FOL Tableaux method Extension with rewriting : Tableaux Modulo Theory Implementation and benchmark : Zenon Modulo and B Set theory Proposed extension : polarized rewriting Discussions O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 2 / 17
Tableaux Method F, F F F α F G α F, G (F G) α F, G (F G) α F, G F G β F G (F G) β F G F G β F G x F(x) δ F(c) x F(x) δ F(c) x F(x) γ F(t) x F(x) γ F(t) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 3 / 17
Example : Inclusion we want to show A A, for a given set A axiomatization of inclusion is X Y X Y ( z z X z Y) we shall refute X Y X Y ( z z X z Y), (A A) the proof : X Y X Y ( z z X z Y), (A A) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 4 / 17
Example : Inclusion we want to show A A, for a given set A axiomatization of inclusion is X Y X Y ( z z X z Y) we shall refute X Y X Y ( z z X z Y), (A A) the proof : X Y X Y ( z z X z Y), (A A) y A Y ( z z A z Y) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 4 / 17
Example : Inclusion we want to show A A, for a given set A axiomatization of inclusion is X Y X Y ( z z X z Y) we shall refute X Y X Y ( z z X z Y), (A A) the proof : X Y X Y ( z z X z Y), (A A) y A Y ( z z A z Y) A A ( z z A z A) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 4 / 17
Example : Inclusion we want to show A A, for a given set A axiomatization of inclusion is X Y X Y ( z z X z Y) we shall refute X Y X Y ( z z X z Y), (A A) the proof : X Y X Y ( z z X z Y), (A A) y A Y ( z z A z Y) A A ( z z A z A) α ( z z A z A) A A, A A ( z z A z A) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 4 / 17
Example : Inclusion we want to show A A, for a given set A axiomatization of inclusion is X Y X Y ( z z X z Y) we shall refute X Y X Y ( z z X z Y), (A A) the proof : X Y X Y ( z z X z Y), (A A) y A Y ( z z A z Y) A A ( z z A z A) α ( z z A z A) A A, A A ( z z A z A) β A A z (z A z A) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 4 / 17
Example : Inclusion we want to show A A, for a given set A axiomatization of inclusion is X Y X Y ( z z X z Y) we shall refute X Y X Y ( z z X z Y), (A A) the proof : X Y X Y ( z z X z Y), (A A) β A A y A Y ( z z A z Y) A A ( z z A z A) α ( z z A z A) A A, A A ( z z A z A) z (z A z A) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 4 / 17
Example : Inclusion we want to show A A, for a given set A axiomatization of inclusion is X Y X Y ( z z X z Y) we shall refute X Y X Y ( z z X z Y), (A A) the proof : X Y X Y ( z z X z Y), (A A) β A A y A Y ( z z A z Y) A A ( z z A z A) α ( z z A z A) A A, A A ( z z A z A) z (z A z A) δ (c A c A) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 4 / 17
Example : Inclusion we want to show A A, for a given set A axiomatization of inclusion is X Y X Y ( z z X z Y) we shall refute X Y X Y ( z z X z Y), (A A) the proof : X Y X Y ( z z X z Y), (A A) β A A y A Y ( z z A z Y) A A ( z z A z A) α ( z z A z A) A A, A A ( z z A z A) z (z A z A) δ (c A c A) α c A, (c A) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 4 / 17
Example : Inclusion we want to show A A, for a given set A axiomatization of inclusion is X Y X Y ( z z X z Y) we shall refute X Y X Y ( z z X z Y), (A A) the proof : X Y X Y ( z z X z Y), (A A) β A A y A Y ( z z A z Y) A A ( z z A z A) α ( z z A z A) A A, A A ( z z A z A) z (z A z A) δ (c A c A) α c A, (c A) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 4 / 17
term rewrite rule : a a Deduction Modulo Theory Rewrite Rule A term (resp. proposition) rewrite rule is a pair of terms (resp. formulæ) l r, where F V(l) F V(r) and, in the propositiona case, l is atomic. Examples : proposition rewrite rule : a b x x a x b Conversion modulo a Rewrite System We consider the congruence generated by a set of proposition rewrite rules R and a set of term rewrite rules E (often implicit). Forward-only rewriting is denoted. Example : A A x x A x A O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 5 / 17
Tableaux Modulo Theory two flavors, essentially equivalent add a conversion rule : F (Conv), if F G G or integrate conversion inside each rule : H F, G α, if H F G O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 6 / 17
Example : Inclusion delete the axiom X Y (X Y z z X z Y) replace with the rewrite rule X Y z z X z Y we now refute only (A A) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 7 / 17
Example : Inclusion delete the axiom X Y (X Y z z X z Y) replace with the rewrite rule X Y z z X z Y we now refute only (A A) yields (A A) (Conv) ( z z A z A) α (c A c A) α (c A), c A O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 7 / 17
Expressing B Set Theory with Rewriting for power set and comprehension s P(t) x (x s x t) x {z P(z)} P(x) derived constructs with typing, too s set(α) P α (t) x : α (x α s x α t) O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 8 / 17
Zenon Zenon : classical first-order tableaux-based ATP Extended to ML polymorphism Extended to Deduction Modulo Theory Extended to linear arithmetic Reads TPTP input format Dedukti certificates work of P. Halmagrand, G. Bury O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 9 / 17
Zenon Zenon : classical first-order tableaux-based ATP Extended to ML polymorphism Extended to Deduction Modulo Theory Extended to linear arithmetic Reads TPTP input format Dedukti certificates work of P. Halmagrand, G. Bury We propose to extend it to Polarized Deduction Modulo Theory O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 9 / 17
Benchmarks A set of Proof Obligations Provided by Industrial Partners 12.876 PO Provable : proved in Atelier B (automatically or interactively) Wide spectrum Mild difficulty, large files O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 10 / 17
Zenon results All Tools (98,9%) 12.876 mp Zenon Zenon Zenon Zenon Zenon Types Arith Modulo Mod+Ari % 85% 2% 48% 57% 80% 95% Time (s) - 6,9 2,3 2,5 3,0 2,6 Unique 329 0 0 0 34 946 Protocol Processor Intel Xeon E5-2660 v2 Timeout 120 s Memory 1 GiB O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 11 / 17
Polarized Rewriting asymetry rewrite positive formulas a certain way rewrite negative formulas another way interchangeable : F G iff F + G let R+ and R be two sets of rewrite rules Polarized Rewriting F + G is there exists a positive (resp. negative) occurrence H in F, a substitution σ, and a rule l r R + (resp. R ), such that H = lσ and G is F where H has been replaced with rσ. O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 12 / 17
Tableaux Modulo Polarized Theory tableaux is one-sided, we need only positive rewriting add to first-order tableau, the conversion rule F +, if F + G G notice forward rewriting only O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 13 / 17
Example : Inclusion delete the axiom X Y (X Y z z X z Y) replace it with two rewrite rules X Y + ( z z X z Y), X Y (f(x, Y) X f(x, Y) Y) f is a fresh symbol (Skolem symbol) negative quantifiers can be Skolemized! impossible in Deduction Modulo Theory : unpolarized rewriting here positive rewriting applied in positive contexts, negative in negative contexts pre-apply δ and δ : Skolemize O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 14 / 17
Example : Inclusion delete the axiom X Y (X Y z z X z Y) replace it with two rewrite rules X Y + ( z z X z Y), X Y (f(x, Y) X f(x, Y) Y) f is a fresh symbol (Skolem symbol) negative quantifiers can be Skolemized! impossible in Deduction Modulo Theory : unpolarized rewriting here positive rewriting applied in positive contexts, negative in negative contexts pre-apply δ and δ : Skolemize the proof becomes (A A) (f(a, A) A f(a, A) A) α (f(a, A) A), f(a, A) A O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 14 / 17
Advantages Skolemization of the rules = a single Skolem symbol instead of a fresh one for each δ-rule, even if the formula is the same fixable with ɛ-hilbert operator? Skolemization at pre-processing, once and for all more axioms become rewrite rules Deduction Modulo Theory, sole shape x(p F) Polarization allows two more shapes x(p F) turned into P + F x(f P) turned into P F x(p F) subsumed O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 15 / 17
Issues Deciding rewriting in Deduction Modulo Theory : strongly needs non confusion if F G, then they have the same main connective needs confluence if F G, then there is H such that F H G allows to have a simpler additional tableaux rule F (Conv), if F G G termination of rewriting helps, too the more rules, the more potential troubles needs proper study (and definitions!) Completeness not implied by confluence and termination e.g. requires narrowing we do not care much, except for nice theoretical results performance is more important O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 16 / 17
Issues Deciding rewriting in Deduction Modulo Theory : strongly needs non confusion if F G, then they have the same main connective needs confluence if F G, then there is H such that F H G allows to have a simpler additional tableaux rule F (Conv), if F G G termination of rewriting helps, too the more rules, the more potential troubles needs proper study (and definitions!) Completeness not implied by confluence and termination e.g. requires narrowing we do not care much, except for nice theoretical results performance is more important O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 16 / 17
Conclusion implement and test theory can come later except soundness develop proper notions of confluence, cut elimination, models, etc. which Skolemization? O. Hermant (MINES ParisTech) Polarized Tableaux Modulo in B June 5, 2018 17 / 17