Polarized Rewriting and Tableaux in B Set Theory SETS 2018 Olivier - - PowerPoint PPT Presentation

polarized rewriting and tableaux in b set theory
SMART_READER_LITE
LIVE PREVIEW

Polarized Rewriting and Tableaux in B Set Theory SETS 2018 Olivier - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

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

slide-3
SLIDE 3

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

slide-4
SLIDE 4

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

slide-5
SLIDE 5

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

slide-6
SLIDE 6

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

slide-7
SLIDE 7

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

slide-8
SLIDE 8

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

slide-9
SLIDE 9

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

slide-10
SLIDE 10

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) δ¬∀ ¬(c ∈ A ⇒ c ∈ A)

  • O. Hermant (MINES ParisTech)

Polarized Tableaux Modulo in B June 5, 2018 4 / 17

slide-11
SLIDE 11

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) δ¬∀ ¬(c ∈ A ⇒ c ∈ A) α¬⇒

c ∈ A, ¬(c ∈ A)

  • O. Hermant (MINES ParisTech)

Polarized Tableaux Modulo in B June 5, 2018 4 / 17

slide-12
SLIDE 12

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) δ¬∀ ¬(c ∈ A ⇒ c ∈ A) α¬⇒

c ∈ A, ¬(c ∈ A) ⊙

  • O. Hermant (MINES ParisTech)

Polarized Tableaux Modulo in B June 5, 2018 4 / 17

slide-13
SLIDE 13

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 :

◮ term rewrite rule :

a ∪ ∅ → a

◮ 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

slide-14
SLIDE 14

Tableaux Modulo Theory

◮ two flavors, essentially equivalent ◮ add a conversion rule :

F (Conv), if F ≡ G G

◮ or integrate conversion inside each rule :

H

α∧, if H ≡ F ∧ G

F, G

  • O. Hermant (MINES ParisTech)

Polarized Tableaux Modulo in B June 5, 2018 6 / 17

slide-15
SLIDE 15

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

slide-16
SLIDE 16

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

slide-17
SLIDE 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

slide-18
SLIDE 18

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

slide-19
SLIDE 19

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

slide-20
SLIDE 20

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

slide-21
SLIDE 21

Zenon results

All Tools (98,9%) 12.876 mp Zenon Zenon Types Zenon Arith Zenon Modulo Zenon Mod+Ari % 85% 2% 48% 57% 80% 95% Time (s)

  • 6,9

2,3 2,5 3,0 2,6 Unique 329 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

slide-22
SLIDE 22

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

slide-23
SLIDE 23

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

slide-24
SLIDE 24

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

slide-25
SLIDE 25

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

slide-26
SLIDE 26

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

slide-27
SLIDE 27

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

slide-28
SLIDE 28

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

slide-29
SLIDE 29

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