Following standard superposition, our calculus employs a term order and a literal selection function to restrict the search space. To accommodate for quantified Boolean terms, we impose additional requirements on the term order. To support flexible reasoning with Boolean subterms, in addition to the literal selection function, we introduce a Boolean subterm selection function.
Term Order The calculus is parameterized by a strict well-founded order \(\succ \) on ground terms that fulfills: (O1)
for any term u that is not
or
; (O2) \(\forall x.\,t\succ \{x\mapsto u\}t\) and \(\exists x.\,t\succ \{x\mapsto u\}t\) for any term u whose only Boolean subterms are
and
; (O3) subterm property; (O4) compatibility with contexts (not necessarily below \(\forall \) and \(\exists \)); (O5) totality. The order is extended to literals, clauses, and nonground terms as usual [2]. The nonground order then also enjoys (O6) stability under grounding substitutions.
Ganzinger and Stuber’s term order restrictions are similar but incompatible with KBO. Using an encoding of our terms into untyped first-order logic we describe how both LPO and the transfinite variant of KBO [19] can satisfy conditions (O1)–(O6).
Our encoding represents bound variables by De Bruijn indices, which become new constant symbols \({\mathsf {db}}_{n}\) for \(n\in \mathbb {N}\). Quantifiers are represented by two new unary function symbols, also denoted by \(\forall \) and \(\exists \). All other symbols are simply identified with their untyped counterpart. Regardless of symbol precedence or symbol weights, KBO and LPO enjoy properties (O3)–(O6) when applied to the encoded terms. They are even compatible with contexts below quantifiers.
To satisfy (O1) and (O2), let the precedence for LPO be
where \({\mathsf {f}}\) is any other symbol. For KBO, we can use the same symbol precedence and a symbol weight function \(\mathcal {W}\) that assigns each symbol ordinal weights (of the form \(\omega a+b\) with \(a,b\in \mathbb {N}\)), where
, and \(\mathcal {W}({\mathsf {f}})\in \mathbb {N}\setminus \{0\}\) for any other symbol \({\mathsf {f}}\).
Selection and Eligibility
Following an idea of Ganzinger and Stuber, we parameterize our calculus with two selection functions: one selecting literals and one selecting Boolean subterms.
Definition 1
(Selection functions). The calculus is parameterized by a literal selection function \( FLSel \) and a Boolean subterm selection function \( FBSel \). The function \( FLSel \) maps each clause to a subset of its literals. The selection function \( FBSel \) maps each clause to a subset of its Boolean subterms. The literals \( FLSel (C)\) and the subterms \( FBSel (C)\) are selected in C. The following restrictions apply: (S1) A literal can only be selected if it is negative or of the form
. (S2) A Boolean subterm can only be selected if it is not
,
, or a variable. (S3) A Boolean subterm can only be selected if its occurrence is not below a quantifier. (S4) The topmost terms on either side of a positive literal cannot be selected.
The interplay of maximality w.r.t. term order, literal and Boolean selection functions gives rise to a new notion of eligibility:
Definition 2
(Eligibility). A literal L is (strictly) eligible w.r.t. a substitution \(\sigma \) in C if it is selected in C or there are no selected literals and no selected Boolean subterms in C and \(\sigma L\) is (strictly) maximal in \(\sigma C.\) The eligible subterms of a clause C w.r.t. a substitution \(\sigma \) are inductively defined as follows: (E1) Any selected subterm is eligible. (E2) If a literal \(s \mathrel {\dot{\approx }}t\) with \(\sigma s\not \preceq \sigma t\) is either eligible and negative or strictly eligible and positive, then s is eligible. (E3) If a subterm is eligible and its root is not
,
,
, or
, all of its direct subterms are also eligible. (E4) If a subterm is eligible and of the form
or
, then s is eligible if \(\sigma s\not \preceq \sigma t\) and t is eligible if \(\sigma s\not \succeq \sigma t\). The substitution \(\sigma \) is left implicit if it is the identity substitution.
The Core Inference Rules The following inference rules form our calculus:
The rules are subject to the following side conditions:
-
Sup (1) \(\sigma = \mathrm {mgu}(t, u)\); (2) u is not a variable; (3) \(\sigma t\not \preceq \sigma t'\); (4) \(D\prec C[u]\); (5) u is eligible in C w.r.t. \(\sigma \); (6) \(t \approx t'\) is strictly eligible in D w.r.t. \(\sigma \); (7) the root of t is not a logical symbol; (8) if
, the subterm u is at the top level of a positive literal.
-
Factor (1) \(\sigma = \mathrm {mgu}(u, u')\); (2) \(\sigma u\not \approx t\not \in \sigma C\) for any term t; (3) no Boolean subterm and no literal is selected in C; (4) \(\sigma u\) is a maximal term in \(\sigma C\); (5) \(\sigma v\) is maximal in \(\left\{ t\mid \sigma u\approx t\in \sigma C\right\} \).
-
Irrefl (1) \(\sigma = \mathrm {mgu}(u, u')\); (2) \(u \not \approx u'\) is eligible in C w.r.t. \(\sigma \).
-
(1)
; (2) \(s \approx t\) is strictly eligible in C w.r.t. \(\sigma \).
-
BoolRw (1) \((t , t')\) is one of the following pairs, where x is a fresh variable:
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
; (2) \(\sigma = \mathrm {mgu}(t,u)\); (3) u is not a variable; (4) u is eligible in C w.r.t. \(\sigma \).
-
\(\star \) Rw (where \(\star \in \{\forall , \exists \}\)) (1) v is a term that may refer to z; (2) \(\bar{y}\) are the free variables occurring in \(\forall z.\>v\) and \(\exists z.\>v\), respectively, in order of first appearance; (3) the indicated subterm is eligible in C; (4) for \(\forall \) Rw,
is not a tautology; (5) for \(\exists \) Rw,
is not a tautology. (In an implementation, the tautology check can be approximated by checking if the affected literal is of the form
or
.)
-
BoolHoist (1) u is a Boolean term whose root is an uninterpreted predicate; (2) u is eligible in C; (3) u is not a variable; (4) u is not at the top level of a positive literal.
-
\(\star \) Hoist (where
) (1) the indicated subterm is eligible in C; (2) y is a fresh variable.
Rationale for the Rules Our calculus is a graceful generalization of superposition: if the input clauses do not contain any Boolean terms, it coincides with standard superposition. In addition to the standard superposition rules Sup, Factor, and Irrefl, our calculus contains various rules to deal with Booleans. For each logical symbol and quantifier, we must consider the case where it is true and the case where it is false. Whenever possible, we prefer rules that rewrite the Boolean subterm in place (with names ending in Rw). When this cannot be done in a satisfiability-preserving way, we resort to rules hoisting the Boolean subterm into a dedicated literal (with names ending in Hoist). For terms rooted by an uninterpreted predicate, the rule BoolHoist only deals with the case that the term is false. If it is true, we rely on Sup to rewrite it to
eventually.
Example 3
The clause
can be refuted by the core inferences as follows. First we derive
(displayed on the left) and then we use it to derive \(\bot \) (displayed on the right). In this and the following example, we assume eager selection of literals whenever the selection restrictions allow it.
The derivation illustrates how BoolHoist and Sup replace uninterpreted predicates by
and
to allow BoolRw to eliminate the surrounding logical symbols.
Example 4
The clause
can be refuted as follows:
Redundancy Criterion In standard superposition, a clause is defined as redundant if all of its ground instances follow from smaller ground instances of other clauses. We keep this definition, but use a nonstandard notion of ground instances, inspired by constraint superposition [23]. In our completeness proof, this new notion of ground instances ensures that ground instances of the conclusion of \(\forall \) Rw, \(\exists \) Rw, \(\forall \) Hoist, and \(\exists \) Hoist inferences are smaller than the corresponding instances of their premise by property (O2).
Definition 5
(Redundancy of clauses). The ground instances of a clause C are all ground clauses of the form \(\gamma C\) where \(\gamma \) is a substitution such that for all variables x, the only Boolean subterms of \(\gamma x\) are
and
. A ground clause C is redundant w.r.t. a ground clause set N if there exist clauses \(C_1, \ldots , C_k \in N\) such that \(C_1, \dots , C_k \models C\) and \(C \succ C_i\) for all \(1\le i\le k\). A nonground clause C is redundant w.r.t. clauses N if C is strictly subsumed by a clause in N or every ground instance of C is redundant w.r.t. ground instances of N.
In standard superposition, an inference is defined as redundant if all its ground instances are, and a ground inference is defined as redundant if its conclusion follows from other clauses smaller than the main premise. We keep this definition as well, but we use a nonstandard notion of ground instances for some of the Boolean rules. In our report, we define a slightly stronger variant of inference redundancy via an explicit ground calculus, but the following notion is also strong enough to justify the few prover optimizations based on inference redundancy we know from the literature (e.g., simultaneous superposition [7]).
Definition 6
(Redundancy of inferences). A ground instance of a \(\forall \textsc {Rw}\), \(\exists \textsc {Rw}\), \(\forall \textsc {Hoist}\), or \(\exists \textsc {Hoist}\) inference is an inference obtained by applying a grounding substitution to premise and conclusion, regardless of whether the result is a valid \(\forall \textsc {Rw}\), \(\exists \textsc {Rw}\), \(\forall \textsc {Hoist}\), or \(\exists \textsc {Hoist}\) inference. A ground instance of an inference \(\iota \) of other rules is an inference \(\iota '\) of the same rule such that premises and conclusion of \(\iota '\) are ground instances of the respective premises and conclusion of \(\iota \). For \(\iota '\), we use selection functions that select the ground literals and Boolean subterms corresponding to the ones selected in the nonground premises. A ground inference with main premise C, side premises \(C_1, \ldots , C_n\), and conclusion D is redundant w.r.t. N if there exist clauses \(D_1,\dots ,D_k \prec C\) in N such that \(D_1, \ldots , D_k,C_1,\ldots ,C_n\models D\). A nonground inference is redundant if all its ground instances are redundant.
A clause set N is saturated if every inference from N is redundant w.r.t. N.
Simplification Rules The redundancy criterion is a graceful generalization of the criterion of standard superposition. Thus, the standard simplification and deletion rules, such as deletion of trivial literals and clauses, subsumption, and demodulation, can be justified. Demodulation below quantifiers is justified if the term order is compatible with contexts below quantifiers.
Some calculus rules can act as simplifications.
Elim can always be a simplification. Given a clause on which both \(\star \) Rw and \(\star \) Hoist apply, where \(\star \in \{\forall ,\exists \}\), the clause can be replaced by the conclusions of these rules. If \(\star \) Rw does not apply because of condition 4 or 5, \(\star \) Hoist alone can be a simplification. Also justified by redundancy, the rules BoolHoist and \(\star \) Hoist can simultaneously replace all occurrences of the eligible subterm they act on. For example, applying
Hoist to
yields
.
While experimenting with our implementation, we have observed that the following simplification rule from Vampire [18] can substantially shorten proofs:
In this rule, we require \(s \succ t\).
Interpreting literals of the form
as
and
as
we can apply the rule even to these positive literals. This especially convenient with rules such as BoolHoist. Consider the clause
, assume no literal is selected and the Boolean selection function always selects a subterm
. Applying BoolHoist to C we get
. This can then be simplified to a tautological clause
using \(i-2\) LocalRw steps. If we did not use LocalRw, BoolHoist would produce \(i-2\) intermediary clauses starting from C, none of which would be recognized as a tautology.
Many rules of our calculus replace subterms with
or
. After this replacement, resulting terms can be simplified using Boolean equivalences that specify the behavior of logical operations on
and
. To this end, we use the rule BoolSimp [33], similar to simp of Leo-III [27, Sect. 4.2.1]:
This rule replaces s with t whenever
is contained in a predefined set of tautological equations. In addition to all equations that Leo-III uses for simp, we also include more complex ones, such as
and
where \(u_i = v_j\) for some i and j. The exhaustive list is given in our technical report. Using BoolSimp and
Elim, the twelve steps of Example 3 can be replaced by just two simplification steps.
BoolSimp simplifies terms with logical symbol roots if one argument is either
or
or if two arguments are identical. Thus, after simplification, BoolRw applies only in two remaining cases: if all arguments of a logical symbol are distinct variables and if the sides of a (dis)equation are different and unifiable. This observation can be used to streamline the implementation of BoolRw.