Polarized Rewriting and Tableaux in B Set Theory

06/22/2018 ∙ by Olivier Hermant, et al. ∙ MINES ParisTech 0

We propose and extension of the tableau-based first-order automated theorem prover Zenon Modulo to polarized rewriting. We introduce the framework and explain the potential benefits. The first target is an industrial benchmark composed of B Set Theory problems.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

The B Method set theory [JRAbr96] has been extensively used for 20 years by the railway industry in France to develop certified correct-by-construction software. Recently, the BWare [BWar12] project has tackled the issue of automatically proving the thousands of proof obligations generated by the development process.

Zenon Modulo [DDelDDolFGilPHalOHer13] is one of the tools developed to this aim. Originally a tableau-based prover, Zenon [RBonDDelDDol07] is used for instance by TLA+ [DCouDDolLLamSMerDRicHVan12] and FoCaLiZe [CDubRRio14]. To help manage the axioms of set theory, but also the uncountable derived constructs definitions (e.g. inclusion, union, functions), we deemed useful to not let nonlogical axioms wander as formulas: a prover would easily get lost by decomposing one or another axiom in an unorganized fashion.

We replaced them with rewrite rules, turning Zenon into an implementation of Deduction Modulo Theory [RBon04, RBonOHer06a, GDowTHarCKir03], which allows rewriting on terms and formulas. Additionally, we equipped it with ML polymorphic types and arithmetic [GBurDDelDDolPHalOHer15]. On the BWare benchmark, the success rate was raised from 2.5% to 95%.

We propose to extend Zenon Modulo with polarized rewriting, a more permissive rewrite relation. We first introduce the framework, then we discuss examples and the pros and cons of the approach. There is currently no implementation, essentially because this is a perfect match for an intern or a PhD student.

2 Polarized Tableaux Modulo Theory

We assume familiarity with first-order logic and at least one deduction system. Tableaux calculus is a refutational calculus, thus, to show under the assumptions , we refute . The first-order tableaux rules are recalled in Figure 1, see textbooks [ANerRsho93] for details. The rules have the following characteristics:

  • as customary, they are presented in a top-down fashion.

  • Formulas are not in negation normal form, rules are duplicated.

  • A branch may be closed, denoted , if we find on it (including internal nodes) an occurrence of some and its negation, or an explicit contradiction. A tableau is a proof iff each branch is closed.

  • -rules are for non-branching connectives rules and -rules for branching ones, -rules are for quantifier rules introducing a fresh constant and -rules for those introducing any term.

Figure 1: Tableaux Rules

Tableaux Modulo Theory [RBon04] extends tableaux with a set of rewrite rules . A rewrite rule is a pair of terms, , where the variables of appear in . Given a set , a term rewrites into , denoted , if there is a rule and a substitution , such that there is an occurrence of in , and is where that occurrence has been replaced with . In other words, is the closure of by substitution and the subterm relation. The transitive closure of is denoted and its further reflexive-symmetric closure is , which is a congruence.

Deduction Modulo Theory also allows rewrite rules on formulas, provided the left member of such a rule is atomic. The relations on formulas embed their counterparts on the subterms of the formulas.

Tableaux can be extended to rewriting with the addition of a rule allowing to convert any formula with , as in Figure 1(a). When rewriting is confluent, we can orient this rule as in Figure 1(b). In practice, Deduction Modulo Theory-based automated theorem provers [GBur10] implement this last rule, which is a way to decide when confluence holds. Other presentations exist [RBon04, RBonOHer06a, GBurDDelDDolPHalOHer15].

(a) General Case

(b) Confluent Case
Figure 2: The Additional Rule of Tableaux Modulo Theory

The calculus of Zenon Modulo [GBurDDelDDolPHalOHer15] enjoys meta-variables, Hilbert’s operator, reasoning over reflexive/transitive/symmetric relations, an equality predicate, ML-polymorphic types, and, of course, rewriting. The simpler case of Figure 1 is sufficient here, as we focus on rewriting, that we now extend to polarity.

Definition 1 (Polarity of an Occurrence)

The occurrence of a formula in a formula is positive (resp. negative) iff

  • is ,

  • is , , , or and the occurence of in or is positive (resp. negative),

  • is or and the occurrence of in is negative (resp. positive).

Now, we consider two (proposition) rewrite systems .

Definition 2 (Polarized Rewrite Relation)

Let and be two formulas. iff with a term rewrite rule or there exists a positive (resp. negative) occurrence in , a substitution , and a rule (resp. ), such that and is where has been replaced with .

iff , that is to say we exchange and above.

We denote by and the reflexive-transitive closures of and , respectively. Defining and is more delicate and unlikely to be useful practice. Polarized Tableaux combine the rules of Figure 1 and Figure 3.

Figure 3: The Additional Rule of Polarized Tableaux Modulo Theory

3 Implementation

Zenon Modulo rewrites only literals, in a forward fashion. This is a further restriction of Figure 1(b)

and it relies on termination of term rewriting and on confluence of the whole rewriting. Otherwise, completeness of the proof search fails. The heuristic is, each time we meet a literal, to:

  1. normalize the terms it contains;

  2. rewrite the literal itself (if there is an applicable rewrite rule) on one step;

  3. if the formula is in normal form or compound, stop, otherwise repeat.

To get polarized rewriting it suffices to modify the second step into “rewrite positively if the literal is positive, negatively otherwise”. The expected gain does not lie here, but in an optimized preprocessing for rules. Indeed [GDow10], a polarized rule represents/can be represented as an axiom ( is the universal closure over the free variables). Similarly, a negative rewrite rule is equivalent to the axiom . In contrast, Deduction Modulo Theory’s rewrite rules are equivalent to [GDowTHarCKir03]. Remind that we are discussing propositional rewrite rules, so has to be atomic. Consequently, polarization offers the following improvements:

  • more axioms correspond to rewrite rules, and this improves proof search [DDelDDolFGilPHalOHer13]. Axioms of the form and , with atomic, become rules of and , respectively. In classical logic, when is a negated atom, we also get rewrite rules in and , respectively.

  • We can Skolemize rewrite rules. This has two benefits: first, less inference rules are necessary in the tableaux, and second, the Skolem term is uniform, while multiple applications of or introduce different fresh symbols at each time. This also holds in the presence of meta-variables.

Skolemizing the rules is impossible in vanilla Deduction Modulo Theory, as rewriting applies at positive and negative occurrences. Therefore, we do not know in advance which quantifiers are positive and negative. To illustrate the difference, consider axioms of the type and .

  • In , we can replace all the positive existential and negative universal quantifiers of by a Skolem function symbol.

  • Similarly, in , we can replace all the positive universal and negative existential quantifiers of by a Skolem function symbol.

The very same principle applies to polarized rewrite rules. We leave the study and the choice of the strategies for Skolemization [ANonCWei01] for a later stage. Both improvements can be applied to heuristics turning assumptions (of a given problem) into rewrite rules, and to hand-tuning of the rewrite rules of a specific theory, for instance B Method set theory.

4 Example

Let us consider the classical example of proving with the standard axiom of inclusion . A usual tableau proof involves the succession of rules (twice), , , and on the axiom. Deduction Modulo Theory turns it into the rewrite rule , and yields the 3-rules axiomless proof of Figure 3(a).

If we switch to Polarized Deduction Modulo Theory, we get the pair and . The proof of is one more step smaller, as shown in Figure 3(b).

(a) Pristine Tableaux

(b) Polarized Tableaux
Figure 4: Proof of in Deduction Modulo Theory

5 Conclusion

We expect the polarized approach to give at least as efficient as Zenon Modulo itself. The proof-search algorithm needs only few changes, mostly in the rule pre-processing. The obtained rules contain less quantifiers, allowing for fewer rules in proof-search and potential earlier unification and branch closure, since using a rewrite rule several times now involves the same Skolem symbol.

On the risk side, implicational axioms can now be turned into rewrite rules. This might be a threat to termination or confluence. A study of the theoretical framework, including models, is required.

Automated theorem provers are aggressively optimized tools, naturally lending themselves to bugs. This is why independent double checking facilities are important. Zenon Modulo is able to produce proof-terms or proof certificates, though it provides no rewrite steps explicitly, following Poincaré’s Principle: computations (rewriting) in proofs give no insight, they can be quickly reconstructed (by the checker) at will and are to be left implicit. Such a clerk/expert distinction has for instance been studied in the Foundational Proof Certificate project [DMil15], at the proof level, with the help of focusing [ZChiDMilFRen17].

On the BWare benchmark, all statements proved by Zenon Modulo [GBurDDelDDolPHalOHer15], that do not involve arithmetic, are actually declared well-typed by Dedukti [MBoeQCarOHer12], a type checker based on an extension of Deduction Modulo Theory to dependent types. Dedukti’s rewriting ability made extremely smooth the reconstruction of rewriting : there is essentially nothing to do but to declare the rules.

The challenge is to keep this skeptical double-checking approach viable. We may need a depolarization of the proofs, perhaps following [GBurCKir10], or an substantial extension of Dedukti and its foundations to polarized rewriting, perhaps with the help of subtyping.

References