Hendrik Leidinger
email: hleiding@mpi-inf.mpg.de

Christoph Weidenbach
email: weidenbach@mpi-inf.mpg.de

SCL(EQ): SCL for First-Order Logic with Equality

Keywords: First-order logic with equality, Term rewriting, Model-based reasoning B A Proofs and Auxiliary Lemmas

We propose a new calculus SCL(EQ) for first-order logic with equality that only learns nonredundant clauses. Following the idea of CDCL (Conflict Driven Clause Learning) and SCL (Clause Learning from Simple Models) a ground literal model assumption is used to guide inferences that are then guaranteed to be non-redundant. Redundancy is defined with respect to a dynamically changing ordering derived from the ground literal model assumption. We prove SCL(EQ) sound and complete and provide examples where our calculus improves on superposition.

Introduction

There has been extensive research on sound and complete calculi for first-order logic with equality. The current prime calculus is superposition [2], where ordering restrictions guide paramodulation inferences and an abstract redundancy notion enables a number of clause simplification and deletion mechanisms, such as rewriting or subsumption. Still this "syntactic" form of superposition infers many redundant clauses. The completeness proof of superposition provides a "semantic" way of generating only non-redundant clauses, however, the underlying ground model assumption cannot be effectively computed in general [START_REF] Teucke | An approximation and refinement approach to first-order automated reasoning[END_REF]. It requires an ordered enumeration of infinitely many ground instances of the given clause set, in general. Our calculus overcomes this issue by providing an effective way of generating ground model assumptions that then guarantee non-redundant inferences on the original clauses with variables.

The underlying ordering is based on the order of ground literals in the model assumption, hence changes during a run of the calculus. It incorporates a standard rewrite ordering. For practical redundancy criteria this means that both rewriting and redundancy notions that are based on literal subset relations are permitted to dynamically simplify or eliminate clauses. Newly generated clauses are non-redundant, so redundancy tests are only needed backwards. Furthermore, the ordering is automatically generated by the structure of the clause set. Instead of a fixed ordering as done in the superposition case, the calculus finds and changes an ordering according to the currently easiest way to make progress, analogous to CDCL (Conflict Driven Clause Learning) [START_REF] Bayardo | Using CSP look-back techniques to solve exceptionally hard SAT instances[END_REF][START_REF]Handbook of Satisfiability[END_REF][START_REF] Moskewicz | Chaff: engineering an efficient SAT solver[END_REF][START_REF] Silva | GRASP-a new search algorithm for satisfiability[END_REF][START_REF] Weidenbach | Automated reasoning building blocks[END_REF].

Typical for CDCL and SCL (Clause Learning from Simple Models) [1,[START_REF] Bromberger | Deciding the Bernays-Schoenfinkel fragment over bounded difference constraints by simple clause learning over theories[END_REF][START_REF] Fiori | SCL clause learning from simple models[END_REF] approaches to reasoning, the development of a model assumption is done by decisions and propagations. A decision guesses a ground literal to be true whereas a propagation concludes the truth of a ground literal through an otherwise false clause. While propagations in CDCL and propositional logic are restricted to the finite number of propositional variables, in first-order logic there can already be infinite propagation sequences [START_REF] Fiori | SCL clause learning from simple models[END_REF], as there might exist an infinite set of ground instances. In order to overcome this issue, model assumptions in SCL(EQ) are at any point in time restricted to a finite number of ground literals, hence to a finite number of ground instances of the clause set at hand. Therefore, without increasing the number of considered ground literals, the calculus either finds a refutation or runs into a stuck state where the current model assumption satisfies the finite number of ground instances. In this case one can check whether the model assumption can be generalized to a model assumption of the overall clause set or the information of the stuck state can be used to appropriately increase the number of considered ground literals and continue search for a refutation. SCL(EQ) does not require exhaustive propagation, in general, it just forbids the decision of the complement of a literal that could otherwise be propagated.

For an example of SCL(EQ) inferring clauses, consider the three first-order clauses

C 1 := h(x) ≈ g(x) ∨ c ≈ d C 2 := f (x) ≈ g(x) ∨ a ≈ b C 3 := f (x) ≈ h(x) ∨ f (x) ≈ g(x)
with a Knuth-Bendix Ordering (KBO), unique weight 1, and precedence d ≺ c ≺ b ≺ a ≺ g ≺ h ≺ f . A Superposition Left [2] inference between C 2 and C 3 results in

C 4 := h(x) ≈ g(x) ∨ f (x) ≈ g(x) ∨ a ≈ b.
For SCL(EQ) we start by building a partial model assumption, called a trail, with two decisions := h(a) ≈ g(a) 1:(h(x)≈g(x)∨h(x) ≈g(x))•σ , f (a) ≈ g(a) 2:( f (x)≈g(x)∨ f (x) ≈g(x))•σ , where σ :={x → a}. Decisions and propagations are always ground instances of literals from the first-order clauses, and are annotated with a level and a justification clause, in case of a decision a tautology. Now with respect to clause C 3 is false with grounding σ , and rule Conflict is applicable; see Sect. 3.1 for details on the inference rules. In general, clauses and justifications are considered variable disjoint, but for simplicity of the presentation of this example, we repeat variable names here as long as the same ground substitution is shared. The maximal literal in C 3 σ is ( f (x) ≈ h(x))σ and a rewrite refutation using the ground equations from the trail results in the justification clause

(g(x) ≈ g(x) ∨ f (x) ≈ g(x) ∨ f (x) ≈ g(x) ∨ h(x) ≈ g(x)) • σ,
where for the refutation justification clauses and all otherwise inferred clauses we use the grounding σ for guidance, but operate on the clauses with variables. The respective ground clause is smaller than ( f (x) ≈ h(x))σ , false with respect to and becomes our new conflict clause by an application of our inference rule Explore-Refutation. It is simplified by our inference rules Equality-Resolution and Factorize, resulting in the finally learned clause

C 4 := h(x) ≈ g(x) ∨ f (x) ≈ g(x),
which is then used to apply rule Backtrack to the trail. Further details on this example are available from the Appendix, Example 6. Observe that C 4 is strictly stronger than C 4 the clause inferred by superposition and that C 4 cannot be inferred by superposition. Thus SCL(EQ) can infer stronger clauses than superposition for this example.

Related Work

SCL(EQ) is based on ideas of SCL [1,[START_REF] Bromberger | Deciding the Bernays-Schoenfinkel fragment over bounded difference constraints by simple clause learning over theories[END_REF][START_REF] Bromberger | SCL(FOL) Revisited[END_REF][START_REF] Fiori | SCL clause learning from simple models[END_REF] but for the first time includes a native treatment of first-order equality reasoning. Similar to [START_REF] Bromberger | Deciding the Bernays-Schoenfinkel fragment over bounded difference constraints by simple clause learning over theories[END_REF] propagations need not to be exhaustively applied, the trail is built out of decisions and propagations of ground literals annotated by first-order clauses, SCL(EQ) only learns non-redundant clauses, but for the first time conflicts resulting out of a decision have to be considered, due to the nature of the equality relation.

There have been suggested several approaches to lift the idea of an inference guiding model assumption from propositional to full first-order logic [START_REF] Baumgartner | Lemma learning in the model evolution calculus[END_REF][START_REF] Bonacina | SGGS theorem proving: an exposition[END_REF][START_REF] Bonacina | On First-Order Model-Based Reasoning[END_REF][START_REF] Fiori | SCL clause learning from simple models[END_REF]. They do not provide a native treatment of equality, e.g., via paramodulation or rewriting.

Baumgartner et al. describe multiple calculi that handle equality by using unit superposition style inference rules and are based on either hyper tableaux [START_REF] Baumgartner | Hyper tableau-the next generation[END_REF] or DPLL [START_REF] Davis | A computing procedure for quantification theory[END_REF][START_REF] Davis | A machine program for theorem-proving[END_REF]. Hyper tableaux fix a major problem of the well-known free variable tableaux, namely the fact that free variables within the tableau are rigid, i.e., substitutions have to be applied to all occurrences of a free variable within the entire tableau. Hyper tableaux with equality [START_REF] Baumgartner | Hyper tableaux with equality[END_REF] in turn integrates unit superposition style inference rules into the hyper tableau calculus.

Another approach that is related to ours is the model evolution calculus with equality (ME E ) by Baumgartner et al. [START_REF] Baumgartner | The model evolution calculus with equality[END_REF][START_REF] Baumgartner | Model evolution with equality-revised and implemented[END_REF] which lifts the DPLL calculus to first-order logic with equality. Similar to our approach, ME E creates a candidate model until a clause instance contradicts this model or all instances are satisfied by the model. The candidate model results from a so-called context, which consists of a finite set of non-ground rewrite literals. Roughly speaking, a context literal specifies the truth value of all its ground instances unless a more specific literal specifies the complement. Initially the model satisfies the identity relation over the set of all ground terms. Literals within a context may be universal or parametric, where universal literals guarantee all its ground instances to be true. If a clause contradicts the current model, it is repaired by a non-deterministic split which adds a parametric literal to the current model. If the added literal does not share any variables in the contradictory clause it is added as a universal literal.

Another approach by Baumgartner and Waldmann [START_REF] Baumgartner | Superposition and model evolution combined[END_REF] combined the superposition calculus with the Model Evolution calculus with equality. In this calculus the atoms of the clauses are labeled as "split atoms" or "superposition atoms". The superposition part of the calculus then generates a model for the superposition atoms while the model evolution part generates a model for the split atoms. Conversely, this means that if all atoms are labeled as "split atom", the calculus behaves similar to the model evolution calculus. If all atoms are labeled as "superposition atom", it behaves like the superposition calculus.

Both the hyper tableaux calculus with equality and the model evolution calculus with equality allow only unit superposition applications, while SCL(EQ) inferences are guided paramodulation inferences on clauses of arbitrary length. The model evolution calculus with equality was revised and implemented in 2011 [START_REF] Baumgartner | Model evolution with equality-revised and implemented[END_REF] and compares its performance with that of hyper tableaux. Model evolution performed significantly better, with more problems solved in all relevant TPTP [START_REF] Sutcliffe | The TPTP problem library and associated infrastructure-from CNF to th0, TPTP v6.4.0[END_REF] categories, than the implementation of the hyper tableaux calculus.

Plaisted et al. [START_REF] Plaisted | Ordered semantic hyper-linking[END_REF] present the Ordered Semantic Hyper-Linking (OSHL) calculus. OSHL is an instantiation based approach that repeatedly chooses ground instances of a non-ground input clause set such that the current model does not satisfy the current ground clause set. A further step repairs the current model such that it satisfies the ground clause set again. The algorithm terminates if the set of ground clauses contains the empty clause. OSHL supports rewriting and narrowing, but only with unit clauses. In order to handle non-unit clauses it makes use of other mechanisms such as Brand's Transformation [START_REF] Bachmair | Elimination of equality via transformation with ordering constraints[END_REF].

Inst-Gen [START_REF] Korovin | Inst-Gen-A Modular Approach to Instantiation-Based Automated Reasoning[END_REF] is an instantiation based calculus, that creates ground instances of the input first-order formulas which are forwarded to a SAT solver. If a ground instance is unsatisfiable, then the first-order set is as well. If not then the calculus creates more instances. The Inst-Gen-EQ calculus [START_REF] Korovin | iProver-Eq: An instantiation-based theorem prover with equality[END_REF] creates instances by extracting instantiations of unit superposition refutations of selected literals of the first-order clause set. The ground abstraction is then extended by the extracted clauses and an SMT solver then checks the satisfiability of the resulting set of equational and non-equational ground literals.

On ground equational clauses, the behavior of SCL(EQ) is similar to SMT (Satisfiability Modulo Theories) [START_REF] Nieuwenhuis | Solving sat and sat modulo theories: from an abstract Davis-Putnam-Logemann-Loveland procedure to dpll(t)[END_REF]. SCL(EQ) rigorously searches for implied equalities and does not explicitely consider the propositional abstraction that drives SMT. Therefore, SCL(EQ) only learns non-redundant clauses that is not guaranteed by standard SMT reasoning. On the other hand the level of laziness in reasoning that is offered by SMT is currently not supported by SCL(EQ). On equational clauses with variables, SCL(EQ) learns only non-redundant clauses with variables whereas SMT solely operates on ground instances.

This article is an extended version of our proceedings paper [START_REF] Leidinger | SCL(EQ): SCL for first-order logic with equality[END_REF]. It includes more examples and an extended background and discussion section. In favor of a better structure we have moved all proofs to an Appendix. The rest of the paper is organized as follows. Section 2 provides basic formalisms underlying SCL(EQ). The rules of the calculus are presented in Sect. 3. Soundness and completeness results are provided in Sect. 4. We end with a discussion of obtained results and future work, Sect. 5. The main contribution of this paper is the SCL(EQ) calculus that only learns non-redundant clauses, permits subset based redundancy elimination and rewriting, and its soundness and completeness.

Preliminaries

We assume a standard first-order language with equality and signature = ( , ∅) where the only predicate symbol is equality ≈. N denotes a set of clauses, C, D denote clauses, L, K , H denote equational literals, A, B denote equational atoms, t, s terms from T ( , X ) for an infinite set of variables X , f , g, h function symbols from , a, b, c constants from and x, y, z variables from X . The function comp denotes the complement of a literal. We write s ≈ t as a shortcut for ¬(s ≈ t). The literal s # t may denote both s ≈ t and s ≈ t. The semantics of first-order logic and semantic entailment | is defined as usual.

By σ, τ, δ we denote substitutions, which are total mappings from variables to terms. Let σ be a substitution, then its finite domain is defined as dom(σ ):={x | xσ = x} and its codomain is defined as codom(σ ) = {t | xσ = t, x ∈ dom(σ )}. We extend their application to literals, clauses and sets of such objects in the usual way. A term, literal, clause or sets of these objects is ground if it does not contain any variable. A substitution σ is ground if codom(σ ) is ground. A substitution σ is grounding for a term t, literal L, clause C if tσ , Lσ , Cσ is ground, respectively. By C • σ , L • σ we denote a closure consisting of a clause C, literal L and a grounding substitution σ , respectively. The function gnd computes the set of all ground instances of a literal, clause, or clause set. The function mgu denotes the most general unifier of terms, atoms, literals, respectively. We assume that mgus do not introduce fresh variables and that they are idempotent.

The set of positions pos(L) of a literal (term pos(t)) is inductively defined as usual. The notion L| p denotes the subterm of a literal L (t| p for term t) at position p ∈ pos(L) ( p ∈ pos(t)). The replacement of a subterm of a literal L (term t) at position p ∈ pos(L) ( p ∈ pos(t)) by a term s is denoted by L[s] p (t[s] p ). For example, the term f (a, g(x)) has the positions

{ , 1, 2, 21}, f (a, g(x))| 21 = x and f (a, g(x))[b] 2 denotes the term f (a, b).
Let R be a set of rewrite rules l → r , called a term rewrite system (TRS). The rewrite relation → R ⊆ T ( , X )×T ( , X ) is defined as usual by s → R t if there exists (l → r ) ∈ R, p ∈ pos(s), and a matcher σ , such that s| p = lσ and t = s[r σ ] p . We write s = t↓ R if s is the normal form of t in the rewrite relation → R . We write Let ≺ T denote a well-founded rewrite ordering on terms which is total on ground terms and for all ground terms t there exist only finitely many ground terms s ≺ T t. We call ≺ T a desired term ordering. We extend ≺ T to equations by assigning the multiset {s, t} to positive equations s ≈ t and {s, s, t, t} to inequations s ≈ t. Furthermore, we identify ≺ T with its multiset extension comparing multisets of literals. For a (multi)set of terms {t 1 , . . . , t n } and a term t, we define {t 1 , . . . , t n } ≺ T t if {t 1 , . . . , t n } ≺ T {t}. For a (multi)set of Literals {L 1 , . . . , L n } and a term t, we define {L 1 , . . . , L n } ≺ T t if {L 1 , . . . , L n } ≺ T {{t}}. Given a ground term β then gnd ≺ T β computes the set of all ground instances of a literal, clause, or clause set where the groundings are smaller than β according to the ordering ≺ T . Given a set (sequence) of ground literals let conv( ) be a convergent rewrite system from the positive equations in using ≺ T .

s # t = (s # t )↓ R if s
Let ≺ be a well-founded, total, strict ordering on ground literals, which is lifted to clauses and clause sets by its respective multiset extension. We overload ≺ for literals, clauses, clause sets if the meaning is clear from the context. The ordering is lifted to the non-ground case via instantiation: we define C ≺ D if for all grounding substitutions σ it holds Cσ ≺ Dσ . Then we define as the reflexive closure of ≺ and N C :={D | D ∈ N and D C} and use the standard superposition style notion of redundancy [2].

Definition 1 (Clause Redundancy)

A ground clause C is redundant with respect to a set N of ground clauses and an ordering ≺ if N C | C. A clause C is redundant with respect to a clause set N and an ordering ≺ if for all C ∈ gnd(C), C is redundant with respect to gnd(N ).

The Superposition calculus [2] is defined by the following rules. Given a reduction order on terms which is extended to an ordering on literals and clauses in the usual way, the basic Superposition rule is as follows:

Superposition N ∪{D∨t ≈ t , C ∨s[u] # s } ⇒ SUP N ∪{D∨t ≈ t , C ∨s[u] # s , (C ∨ D∨s[t ] # s )σ } where σ = mgu(t, u) and u is not a variable.
Inferences are only allowed if the left premise is not greater than or equal to the right one, the last literal of each premise is greater than the remaining literals of the respective clause and the lefthand side of these literals is not smaller or equal to the righthand side. Two more rules are needed for completeness:

Equality Resolution N ∪ {C ∨ s ≈ s } ⇒ SUP N ∪ {Cσ } where σ = mgu(s, s ) Equality Factoring N ∪ {C ∨ s ≈ t ∨ s ≈ t} ⇒ SUP N ∪ {(C ∨ t ≈ t ∨ s ≈ t )σ } where σ = mgu(s, s )

The SCL(EQ) Calculus

We start the introduction of the calculus by defining the ingredients of an SCL(EQ) state.

Definition 2 (Trail)

A trail :=[L i 1 :C 1 •σ 1 1 , ..., L i n :C n •σ n n
] is a consistent sequence of ground equations and inequations where L j is annotated by a level i j with i j-1 ≤ i j , and a closure C j • σ j . We omit the annotations if they are not needed in a certain context. A ground literal

L is true in if | L. A ground literal L is false in if | comp(L). A ground literal L is undefined in if | L and | comp(L).
Otherwise it is defined. For each literal L j in it holds that L j is undefined in [L 1 , ..., L j-1 ] and irreducible by conv({L 1 , ..., L j-1 }).

The above definition of truth and undefinedness is extended to clauses in the obvious way. The notions of true, false, undefined can be parameterized by a ground term β by saying that L is β-undefined in a trail if β ≺ T L or L is undefined. The notions of a β-true, β-false term are restrictions of the above notions to literals smaller β, respectively. All SCL(EQ) reasoning is layered with respect to a ground term β. Definition 3 Let be a trail and L a ground literal such that L is defined in . By core( ; L) we denote a minimal subsequence ⊆ such that L is defined in . By cores( ; L) we denote the set of all cores. Note that core( ; L) is not necessarily unique. There can be multiple cores for a given trail and ground literal L. Definition 4 (Trail Ordering) Let :=[L 1 , ..., L n ] be a trail. The (partial) trail ordering ≺ is the sequence ordering given by , i.e., (L i ≺ L j if i < j) for all 1 ≤ i, j ≤ n. Definition 5 (Defining Core and Defining Literal) For a trail and a sequence of literals ⊆ we write max ≺ ( ) for the largest literal in according to the trail ordering ≺ . Let be a trail and L a ground literal such that L is defined in . Let ∈ cores( ; L) be a sequence of literals where max ≺ ( ) max ≺ ( ) for all ∈ cores( ; L), then max (L):= max ≺ ( ) is called the defining literal and is called a defining core for L in . If cores( ; L) contains only the empty core, then L has no defining literal and no defining core.

As an example, consider the trail

:=[L 1 , L 2 , L 3 ] and literal L, such that [L 1 , L 2 ] | L and [L 2 , L 3 ] | L. Then both [L 1 , L 2 ] and [L 2 , L 3 ] are cores, but only [L 1 , L 2 ]
is a defining core and only L 2 is the defining literal. Note that there can be multiple defining cores but only one defining literal for any defined literal L. For example, consider a trail :

=[ f (a) ≈ f (b) 1:C 1 •σ 1 , a ≈ b 2:C 2 •σ 2 , b ≈ c 3:C 3 •σ 3
] with an ordering ≺ T that orders the terms of the equations from left to right, and a literal g( f (a)) ≈ g( f (c)). Then the defining cores are

1 :=[a ≈ b, b ≈ c] and 2 :=[ f (a) ≈ f (b), b ≈ c].
The defining literal, however, is in both cases b ≈ c. Defined literals that have no defining core and therefore no defining literal are literals that are trivially false or true. Consider, for example, g( f (a)) ≈ g( f (a)). This literal is trivially true in . Thus an empty subset of is sufficient to show that g( f (a)) ≈ g( f (a)) is defined in .

Definition 6 (Literal Level) Let be a trail. A ground literal L ∈ is of level i if L is annotated with i in . A defined ground literal L / ∈ is of level i if the defining literal of L is of level i. If L has no defining literal, then L is of level 0. A ground clause D is of level i if i is the maximum level of a literal in D.
The restriction to minimal subsequences for the defining literal and definition of a level eventually guarantee that learned clauses are smaller in the trail ordering. This enables completeness in combination with learning non-redundant clauses as shown later.

Lemma 1 Let 1 be a trail and K a defined literal that is of level i in 1 . Then K is of level i in a trail := 1 , 2 .

Definition 7 Let be a trail and L

∈ a literal. L is called a decision literal if = 0 , K i:C•τ , L i+1:C •τ , 1 .
Otherwise L is called a propagated literal.

In other words: L is a decision literal if the level of L is one greater than the level of the preceeding literal K . In our above example g( f (a)) ≈ g( f (c)) is of level 3 since the defining literal b ≈ c is annotated with 3. a ≈ b on the other hand is of level 2.

We define a well-founded total strict ordering which is induced by the trail and with which non-redundancy is proven in Sect. 4. Unlike SCL [START_REF] Bromberger | Deciding the Bernays-Schoenfinkel fragment over bounded difference constraints by simple clause learning over theories[END_REF][START_REF] Fiori | SCL clause learning from simple models[END_REF] we use this ordering for the inference rules as well. In previous SCL calculi, conflict resolution automatically chooses the greatest literal and resolves with this literal. In SCL(EQ) this is generalized. Coming back to our running example above, suppose we have a conflict clause f (b) ≈ f (c) ∨ b ≈ c. The defining literal for both inequations is b ≈ c. So we could do paramodulation inferences with both literals. The following ordering makes this non-deterministic choice deterministic.

Definition 8 (Trail Induced Ordering)

Let :=[L i 1 :C 1 •σ 1 1 , ..., L i n :C n •σ n n
] be a trail, β a ground term such that {L 1 , ..., L n } ≺ T β and M i, j all β-defined ground literals not contained in ∪ comp( ): for a defining literal max (M i, j ) = L i and for two literals

M i, j , M i,k we have j < k if M i, j ≺ T M i,k .
The trail induces a total well-founded strict order ≺ * on β-defined ground literals M k,l , M m,n , L i , L j of level greater than zero, where

7. M k,l ≺ * L i , M k,l ≺ * comp(L i ) if k < i;
and for all β-defined literals L of level zero: 8. ≺ * := ≺ T ; 9. L ≺ * K if K is of level greater than zero and K is β-defined; and can eventually be extended to β-undefined ground literals K , H by

10. K ≺ * H if K ≺ T H ; 11. L ≺ * H if L is β-defined.
The literal ordering ≺ * is extended to ground clauses by multiset extension and identified with ≺ * as well.

Note, that in the above definition for a given i we can always put the M i, j in an order corresponding to the integers. This is due to the fact, that the total number of ground literals is countable and since there are only finitely many β-defined literals.

Lemma 2 (Properties of ≺ * ) 1. ≺ * is well-defined. 2. ≺ * is a total strict order, i.e. ≺ * is irreflexive, transitive and total. 3. ≺ * is a well-founded ordering.

Example 1 Assume a trail

:=[a ≈ b 1:C 0 •σ 0 , c ≈ d 1:C 1 •σ 1 , f (a ) ≈ f (b ) 1:C 2 •σ 2 ],
L 1 ≺ * ... ≺ * a ≈ b ≺ * a ≈ b ≺ * f (a) ≈ f (b) ≺ * f (a) ≈ f (b) ≺ * c ≈ d ≺ * c ≈ d ≺ * f (c) ≈ f (d) ≺ * f (c) ≈ f (d) ≺ * f (a ) ≈ f (b ) ≺ * f (a ) ≈ f (b ) ≺ * a ≈ b ≺ * a ≈ b ≺ * K 1 ≺ * . . .
where K i are the β-undefined literals and L j are the trivially defined literals.

Table 1 summarizes the various orders presented so far. R,S,p) and inductively defined as follows. The tuple

Definition 9 (Rewrite

Step) A rewrite step is a five-tuple (s#t • σ, s#t ∨ C • σ,
(s#t • σ, s#t ∨ C • σ, , , ) is a rewrite step. Given rewrite steps R, S and a position p then (s#t • σ, s#t ∨ C • σ, R, S, p) is a rewrite step.
The literal s#t is called the rewrite literal. In case R, S are not , the rewrite literal of R is an equation.

Note that R and S in the above definition describe the "history" of a rewrite step, i.e. they contain all preceeding rewrite steps.

Rewriting is one of the core features of our calculus. The following definition describes a rewrite inference between two clauses. Note that unlike the superposition calculus we allow rewriting below variable level.

:=(l 1 ≈ r 1 • σ 1 , l 1 ≈ r 1 ∨ C 1 • σ 1 , R 1 , L 1 , p 1 )
and

I 2 :=(l 2 #r 2 • σ 2 , l 2 #r 2 ∨ C 2 • σ 2 , R 2 , L 2 , p 2 ) be two variable disjoint rewrite steps where r 1 σ 1 ≺ T l 1 σ 1 , (l 2 #r 2 )σ 2 | p = l 1 σ 1 for
some position p. We distinguish two cases:

1. if p ∈ pos(l 2 #r 2 ) and μ:= mgu((l 2 #r 2 )| p , l 1 ) then (((l 2 #r 2 )[r 1 ] p )μ • σ 1 σ 2 , ((l 2 #r 2 )[r 1 ] p )μ ∨ C 1 μ ∨ C 2 μ • σ 1 σ 2 , I 1 , I 2 , p) is the result of a rewrite inference. 2. if p / ∈ pos(l 2 #r 2 ) then let (l 2 #r 2 )δ be the most general instance of l 2 #r 2 such that p ∈ pos((l 2 #r 2 )δ), δ introduces only fresh variables and (l 2 #r 2 )δσ 2 ρ = (l 2 #r 2 )σ 2 for some minimal ρ. Let μ:= mgu((l 2 #r 2 )δ| p , l 1 ). Then ((l 2 #r 2 )δ[r 1 ] p μ • σ 1 σ 2 ρ, (l 2 #r 2 )δ[r 1 ] p μ ∨ C 1 μ ∨ C 2 δμ • σ 1 σ 2 ρ, I 1 , I 2 , p) is the result of a rewrite inference.
Note that case 1 describes rewriting above or at a variable and case 2 describes rewriting inside a variable.

Lemma 3 Let I

1 :=(l 1 ≈ r 1 • σ 1 , l 1 ≈ r 1 ∨ C 1 • σ 1 , R 1 , L 1 , p 1 ) and I 2 :=(l 2 #r 2 • σ 2 , l 2 #r 2 ∨ C 2 •σ 2 , R 2 , L 2 , p 2 ) be two variable disjoint rewrite steps where r 1 σ 1 ≺ T l 1 σ 1 , (l 2 #r 2 )σ 2 | p = l 1 σ 1 for some position p. Let I 3 :=(l 3 #r 3 • σ 3 , l 3 #r 3 ∨ C 3 • σ 3 , I 1 , I 2 , p
) be the result of a rewrite inference. Then:

1. C 3 σ 3 = (C 1 ∨ C 2 )σ 1 σ 2 and l 3 #r 3 σ 3 = (l 2 #r 2 )σ 2 [r 1 σ 1 ] p . 2. (l 3 #r 3 )σ 3 ≺ T (l 2 #r 2 )σ 2 3. If N | (l 1 ≈ r 1 ∨ C 1 ) ∧ (l 2 #r 2 ∨ C 2 ) for some set of clauses N , then N | l 3 #r 3 ∨ C 3
Now that we have defined rewrite inferences we can use them to define a reduction chain application and a refutation, which are sequences of rewrite steps. Intuitively speaking, a reduction chain application reduces a literal in a clause with literals in conv( ) until it is irreducible. A refutation for a literal L that is β-false in for a given β, is a sequence of rewrite steps with literals in , L such that ⊥ is inferred. Refutations for the literals of the conflict clause will be examined during conflict resolution by the rule Explore-Refutation.

Definition 11 (Reduction Chain) Let be a trail. A reduction chain P from is a sequence of rewrite steps [I 1 , ..., I m ] such that for each

I i = (s i #t i • σ i , s i #t i ∨ C i • σ i , I j , I k , p i ) either 1. s i #t n i :s i #t i ∨C i •σ i is contained in and I j = I k = p i = or 2. I i is the result of a rewriting inference from rewrite steps I j , I k out of [I 1 , ..., I m ] where j, k < i.
Let (l # r )δ o:l # r ∨C•δ be an annotated ground literal. A reduction chain application from to l # r is a reduction chain [I 1 , ..., I m ] from , (l # r )δ o:l # r ∨C•δ such that lδ↓ conv( ) = s m σ m and r δ↓ conv( ) = t m σ m . We assume reduction chain applications to be minimal, i.e., if any rewrite step is removed from the sequence it is no longer a reduction chain application.

Definition 12 (Refutation) Let be a trail and (l # r )δ o:l # r ∨C•δ an annotated ground literal that is β-false in for a given β. A refutation P from and l # r is a reduction chain

[I 1 , ..., I m ] from , (l # r )δ o:l # r ∨C•δ such that (s m #t m )σ m = s ≈ s for some s.
We assume refutations to be minimal, i.e., if any rewrite step I k , k < m is removed from the refutation, it is no longer a refutation.

The SCL(EQ) Inference Rules

We can now define the rules of our calculus based on the previous definitions. A state is a six-tuple ( ; N ; U ; β; k; D) similar to the SCL calculus, where a sequence of annotated ground literals, N and U the sets of initial and learned clauses, β is a ground term such that for all L ∈ it holds L ≺ T β, k is the decision level, and D a status that is , ⊥ or a closure C • σ . Before we propagate or decide any literal, we make sure that it is irreducible in the current trail. Together with the design of ≺ * this eventually enables rewriting as a simplification rule.

Propagate ( ; N ; U ; β; k; ) ⇒ SCL(EQ) ( , s m #t m σ k:(s m #t m ∨C m )•σ m m ; N ; U ; β; k; ) provided there is a C ∈ (N ∪ U ), σ grounding for C, C = C 0 ∨ C 1 ∨ L, | ¬C 0 σ , C 1 σ = Lσ ∨ ... ∨ Lσ , C 1 = L 1 ∨ ... ∨ L n , μ = mgu(L 1 , ..., L n , L) Lσ is β-undefined in , (C 0 ∨ L)μσ ≺ T β, σ is irreducible by conv( ), [I 1 , . . . , I m ] is a reduction chain application from to Lσ k:(L∨C 0 )μ•σ where I m = (s m #t m • σ m , s m #t m ∨ C m • σ m , I j , I k , p m ).
The rule Propagate finds a ground instance of a clause which is propagable, i.e. it contains (possibly multiple occurences of) a literal that is undefined and all other literals are false in the trail. The multiple occurences of the undefined literal are factored. Then it adds the normal form of this literal to the trail. The propagating clause is reduced by the corresponding paramodulation steps. Note that the definition of Propagate also includes the case where Lσ is irreducible by . In this case L = s m #t m and m = 1. The rule Decide below, is similar to Propagate, except for the subclause C 0 which must be β-undefined or β-true in , i.e., Propagate cannot be applied and the decision literal is annotated by a tautology.

Decide ( ; N ; U ; β; k; ) ⇒ SCL(EQ) ( , s m #t m σ k+1:(s m #t m ∨comp(s m #t m ))•σ m m ; N ; U ; β; k + 1; ) provided there is a C ∈ (N ∪ U ), σ grounding for C, C = C 0 ∨ L, C 0 σ is β-undefined or β-true in , Lσ is β-undefined in , (C 0 ∨ L)σ ≺ T β, σ is irreducible by conv( ), [I 1 , . . . , I m ] is a reduction chain application from to Lσ k+1:L∨C 0 •σ where I m = (s m #t m • σ m , s m #t m ∨ C m • σ m , I j , I k , p m ). Conflict ( ; N ; U ; β; k; ) ⇒ SCL(EQ) ( ; N ; U ; β; k; D) provided there is a D ∈ (N ∪ U ), σ grounding for D , D σ is β-false in , σ is irreducible by conv( ), D = ⊥ if D σ is of level 0 and D = D • σ otherwise.
For the non-equational case, when a conflict clause is found by an SCL calculus [START_REF] Bromberger | Deciding the Bernays-Schoenfinkel fragment over bounded difference constraints by simple clause learning over theories[END_REF][START_REF] Fiori | SCL clause learning from simple models[END_REF], the complements of its first-order ground literals are contained in the trail. For equational literals this is not the case, in general. The proof showing D to be β-false with respect to is a rewrite proof with respect to conv( ). This proof needs to be analyzed to eventually perform paramodulation steps on D or to replace D by a ≺ * smaller β-false clause showing up in the proof.

Skip ( , K l:C•τ , L k:C •τ ; N ; U ; β; k; D • σ ) ⇒ SCL(EQ) ( , K l:C•τ ; N ; U ; β; l; D • σ ) if Dσ is β-false in , K l:C•τ .
The Explore-Refutation rule is the FOL with Equality counterpart to the resolve rule in CDCL or SCL. While in CDCL or SCL complementary literals of the conflict clause are present on the trail and can directly be used for resolution steps, this needs a generalization for FOL with Equality. Here, in general, we need to look at (rewriting) refutations of the conflict clause and pick an appropriate clause from the refutation as the next conflict clause.

Explore-Refutation

( , L; N ; U ; β; k; (D ∨ s # t) • σ )) ⇒ SCL(EQ) ( , L; N ; U ; β; k; (s j #t j ∨ C j ) • σ j ) if (s # t)σ is strictly ≺ * maximal in (D ∨ s # t)σ , L is the defining literal of (s # t)σ, [I 1 , ..., I m ] is a refutation from and (s # t)σ , I j = (s j #t j • σ j , (s j #t j ∨ C j ) • σ j , I l , I k , p j ), 1 ≤ j ≤ m, (s j # t j ∨ C j )σ j ≺ * (D ∨ s # t)σ , (s j #t j ∨ C j )σ j is β-false in . Factorize ( ; N ; U ; β; k; (D ∨ L ∨ L ) • σ ) ⇒ SCL(EQ) ( ; N ; U ; β; k; (D ∨ L)μ • σ ) provided Lσ = L σ , and μ = mgu(L, L ).

Equality-Resolution

( ; N ; U ; β; k; (D ∨ s ≈ s ) • σ ) ⇒ SCL(EQ) ( ; N ; U ; β; k; Dμ • σ ) provided sσ = s σ , μ = mgu(s, s ).
For backtracking we have to make sure, that the learned clause is not false in the resulting trail. It is not sufficient to backtrack to the point where the clause with the current substitution is no longer false, but where it is no longer false with all possible substitutions.

Backtrack ( , K , ; N ; U ; β; k; (D ∨ L)•σ ) ⇒ SCL(EQ) ( ; N ; U ∪{D ∨ L}; β; j - i; )
provided Dσ is of level i where i < k, K is of level j and , K the minimal trail subsequence such that there is a grounding substitution τ with (D ∨ L)τ β-false in , K but not in ; i = 1 if K is a decision literal and i = 0 otherwise. Grow ( ; N ; U ; β; k; ) ⇒ SCL(EQ) ( ; N ; U ; β ; 0; ) provided β ≺ T β .

In addition to soundness and completeness of the SCL(EQ) rules their tractability in practice is an important property for a successful implementation. In particular, finding propagating literals or detecting a false clause under some grounding. It turns out that these operations are NP-complete, similar to first-order subsumption which has been shown to be tractable in practice.

Lemma 4

Assume that all ground terms t with t ≺ T β for any β are polynomial in the size of β. Then testing Propagate (Conflict) is NP-Complete, i.e., the problem of checking for a given clause C whether there exists a grounding substitution σ such that Cσ propagates (is false) is NP-Complete.

Example 2 (SCL(EQ) vs. Superposition: Saturation) Consider the following clauses:

N :={C 1 :=c ≈ d ∨ D, C 2 :=a ≈ b ∨ c ≈ d, C 3 := f (a) ≈ f (b) ∨ g(c) ≈ g(d)},
C 1 = D C 5 = c ≈ d C 3 = f (a) ≈ f (b) ∨ g(c) ≈ g(d)
where we derived C 1 out of C 1 by subsumption resolution [START_REF] Weidenbach | Combining superposition, sorts and splitting[END_REF] using C 5 . Actually, subsumption resolution is compatible with the general redundancy notion of SCL(EQ), see Lemma 6. Now we consider the same example with superposition and the very same ordering (N i is the clause set of the previous step and N 0 the initial clause set N ).

N 0 ⇒ Sup(C 2 ,C 3 ) N 1 ∪ {C 4 :=c ≈ d ∨ g(c) ≈ g(d)} ⇒ Sup(C 1 ,C 4 ) N 2 ∪ {C 5 :=c ≈ d ∨ D} ⇒ Sup(C 1 ,C 5 ) N 3 ∪ {C 6 :=D}
Thus superposition ends up with the following clauses:

C 2 = a ≈ b ∨ c ≈ d C 3 = f (a) ≈ f (b) ∨ g(c) ≈ g(d) C 4 = c ≈ d ∨ g(c) ≈ g(d) C 6 = D
The superposition calculus generates more and larger clauses.

Example 3 (SCL(EQ) vs. Superposition: Refutation) Suppose the following set of clauses:

N :={C 1 := f (x) ≈ a ∨ f (x) ≈ b, C 2 := f ( f (y)) ≈ y,
N 0 ⇒ Sup(C 1 ,C 2 ) N 1 ∪ {C 4 :=y ≈ a ∨ f ( f (y)) ≈ b} ⇒ Sup(C 1 ,C 4 ) N 2 ∪ {C 5 :=a ≈ b ∨ f ( f (y)) ≈ b ∨ y ≈ a} ⇒ Sup(C 2 ,C 5 ) N 3 ∪ {C 6 :=a ≈ b ∨ b ≈ y ∨ y ≈ a} ⇒ Sup(C 2 ,C 4 ) N 4 ∪ {C 7 :=y ≈ b ∨ y ≈ a} ⇒ Eq Res(C 7 ) N 5 ∪ {C 8 :=a ≈ b} ⇒ Sup(C 3 ,C 8 ) N 6 ∪ {⊥}
The shortest refutation by the superposition calculus is as follows:

N 0 ⇒ Sup(C 1 ,C 2 ) N 1 ∪ {C 4 :=y ≈ a ∨ f ( f (y)) ≈ b} ⇒ Sup(C 2 ,C 4 ) N 2 ∪ {C 5 :=y ≈ b ∨ y ≈ a} ⇒ Eq Res(C 5 ) N 3 ∪ {C 6 :=a ≈ b} ⇒ Sup(C 3 ,C 6 ) N 4 ∪ {⊥}
In SCL(EQ) on the other hand we would always first propagate a ≈ b, f ( f (a)) ≈ a and f ( f (b)) ≈ b. As soon as a ≈ b and f ( f (a)) ≈ a are propagated we have a conflict with C 1 {x → f (a)}. So suppose in the worst case we propagate:

:=[a ≈ b 0:a ≈b f ( f (b)) ≈ b 0:( f ( f (y))≈y){y→b} f ( f (a)) ≈ a 0:( f ( f (y))≈y){y→a} ]
Now we have a conflict with C 1 {x → f (a)}. Since there is no decision literal on the trail, Conflict rule immediately returns ⊥ and we are done.

Soundness and Completeness

In this section we show soundness and refutational completeness of SCL(EQ) under the assumption of a regular run. We provide the definition of a regular run and show that for a regular run all learned clauses are non-redundant according to our trail induced ordering. We start with the definition of a sound state.

Definition 13 A state ( ; N ; U ; β; k; D) is sound if the following conditions hold:

1. is a consistent sequence of annotated literals, 2. for each decomposition = 1 , Lσ i:(C∨L)•σ , 2 where Lσ is a propagated literal, we have that Cσ is β-false in 1 , Lσ is β-undefined in 1 and irreducible by conv( 1),

N ∪ U | (C ∨ L) and (C ∨ L)σ ≺ T β, 3. for each decomposition = 1 , Lσ i:(L∨comp(L))•σ , 2
where Lσ is a decision literal, we have that Lσ is β-undefined in 1 and irreducible by conv( 1 ),

N ∪U | (L ∨comp(L)) and (L ∨ comp(L))σ ≺ T β, 4. N | U , 5. if D = C • σ , then Cσ is β-false in , N ∪ U | C Lemma 5
The initial state ( ; N ; ∅; β; 0; ) is sound. Definition 14 A run is a sequence of applications of SCL(EQ) rules starting from the initial state.

Theorem 1 Assume a state ( ; N ; U ; β; k; D) resulting from a run. Then ( ; N ; U ; β; k; D) is sound.

Next, we give the definition of a regular run. Intuitively speaking, in a regular run we are always allowed to do decisions except if 1. a literal can be propagated before the first decision and 2. the negation of a literal can be propagated.

To ensure non-redundant learning we enforce at least one application of Skip during conflict resolution except for the special case of a conflict after a decision.

Definition 15 (Regular

k; D • σ ) if Lσ = comp(L ) for some L ∈ D.
Now we show that any learned clause in a regular run is non-redundant according to our trail induced ordering. Lemma 6 (Non-Redundant Clause Learning) Let N be a clause set. The clauses learned during a regular run in SCL(EQ) are not redundant with respect to ≺ * and N ∪ U . For the trail only non-redundant clauses need to be considered.

The proof of Lemma 6 is based on the fact that conflict resolution eventually produces a clause smaller then the original conflict clause with respect to ≺ * . All simplifications, e.g., contextual rewriting, as defined in [2,[START_REF] Gleiss | Subsumption demodulation in first-order theorem proving[END_REF][START_REF] Weidenbach | Combining superposition, sorts and splitting[END_REF][START_REF] Wischnewski | Efficient reasoning procedures for complex first-order theories[END_REF][START_REF] Weidenbach | Contextual rewriting in SPASS[END_REF][START_REF] Weidenbach | Subterm contextual rewriting[END_REF], are therefore compatible with Lemma 6 and may be applied to the newly learned clause as long as they respect the induced trail ordering. In detail, let be the trail before the application of rule Backtrack. The newly learned clause can be simplified according to the induced trail ordering ≺ * as long as the simplified clause is smaller with respect to ≺ * .

Another important consequence of Lemma 6 is that newly learned clauses need not to be considered for redundancy. Furthermore, the SCL(EQ) calculus always terminates, Lemma 11, because there only finitely many non-redundant clauses with respect to a fixed β.

For dynamic redundancy, we have to consider the fact that the induced trail ordering changes. At this level, only redundancy criteria and simplifications that are compatible with all induced trail orderings may be applied. Due to the construction of the induced trail ordering, it is compatible with ≺ T for unit clauses.

Lemma 7 (Unit Rewriting) Assume a state ( ; N ; U ; β; k; D) resulting from a regular run where the current level k > 0 and a unit clause l ≈ r ∈ N . Now assume a clause C ∨ L[l ] p ∈ N such that l = lμ for some matcher μ. Now assume some arbitrary grounding substitutions σ for C ∨ L[l ] p , σ for l ≈ r such that lσ = l σ and r σ ≺ T lσ . Then

(C ∨ L[r μσ σ ] p )σ ≺ * (C ∨ L[l ] p )σ .
In addition, any notion that is based on a literal subset relationship is also compatible with ordering changes. The standard example is subsumption. The notion of redundancy, Definition 1, only supports a strict subset relation for Lemma 8, similar to the superposition calculus. However, the newly generated clauses of SCL(EQ) are the result of paramodulation inferences [START_REF] Robinson | Paramodulation and theorem-proving in first-order theories with equality[END_REF]. In a recent contribution to dynamic, abstract redundancy [START_REF] Waldmann | A comprehensive framework for saturation theorem proving[END_REF] it is shown that also the non-strict subset relation in Lemma 8, i.e., Cσ ⊆ D, preserves completeness.

If all stuck states, see below Definition 16, with respect to a fixed β are visited before increasing β then this provides a simple dynamic fairness strategy.

When unit reduction or any other form of supported rewriting is applied to clauses smaller than the current β, it can be applied independently from the current trail. If, however, unit reduction is applied to clauses larger than the current β then the calculus must do a restart to its initial state, in particular the trail must be emptied, as for otherwise rewriting may result generating a conflict that did not exist with respect to the current trail before the rewriting. This is analogous to a restart in CDCL once a propositional unit clause is derived and used for simplification. More formally, we add the following new Restart rule to the calculus to reset the trail to its initial state after a unit reduction.

Restart ( ; N ; U ; β; k; ) ⇒ SCL(EQ) ( ; N ; U ; β; 0; ) Next we show refutation completeness of SCL(EQ). To achieve this we first give a definition of a stuck state. Then we show that stuck states only occur if all ground literals L ≺ T β are β-defined in and not during conflict resolution. Finally we show that conflict resolution will always result in an application of Backtrack. This allows us to show termination (without application of Grow) and refutational completeness. Thus a stuck state can be seen as an indication for a satisfiable clause set. Of course, it remains to be investigated whether the clause set is actually satisfiable. Superposition is one of the strongest approaches to detect satisfiability and constitutes a decision procedure for many decidable first-order fragments [START_REF] Bachmair | Superposition with simplification as a decision procedure for the monadic class with equality[END_REF][START_REF] Ganzinger | A superposition decision procedure for the guarded fragment with equality[END_REF]. Now given a stuck state and some specific ordering such as KBO, LPO, or some polynomial ordering [START_REF] Dershowitz | Rewriting[END_REF], it is decidable whether the ordering can be instantiated from a stuck state such that coincides with the superposition model operator on the ground terms smaller than β. In this case it can be effectively checked whether the clauses derived so far are actually saturated by the superposition calculus with respect to this specific ordering. In this sense, SCL(EQ) has the same power to decide satisfiability of first-order clause sets as superposition. Theorem 2 (Refutational Completeness) Let N be an unsatisfiable clause set, and ≺ T a desired term ordering. For any ground term β where gnd ≺ T β (N ) is unsatisfiable, any regular SCL(EQ) run without rule Grow will terminate by deriving ⊥.

Discussion

We presented SCL(EQ), a new sound and complete calculus for reasoning in first-order logic with equality. We will now discuss some of its aspects and present ideas for future work beyond the scope of this paper.

The SCL(EQ) calculus can be viewed as a generalization of the first-order without equality SCL calculus [START_REF] Bromberger | SCL(FOL) Revisited[END_REF], where syntactic equality with respect to trail literals is replaced with equality modulo the presented equational theory. If standard first-order literals like R(x, y) are represented by equations like f R (x, y) ≈ true then performing SCL(EQ) on the latter simplifies to classical SCL reasoning on the first-order literals with a slightly different strategy.

The trail induced ordering, Definition 8, is the result of letting the calculus follow the logical structure of the clause set on the literal level and at the same time supporting rewriting at the term level. It can already be seen by examples on ground clauses over (in)equations over constants that this combination requires a layered approach as suggested by Definition 8, see Example 4.

Example 4 (Propagate Smaller Equation) Assume a term ordering ≺ kbo , unique weight 1 and with precedence d ≺ c ≺ b ≺ a. Further assume β to be large enough. Assume the ground clause set N solely built out of constants

C 1 :=c ≈ d C 2 :=c ≈ d ∨ a ≈ b C 3 :=a ≈ b ∨ a ≈ c and the trail :=[c ≈ d 0:C 1 , a ≈ b 0:C 2 , b ≈ d 0:C 3 ]
. Now, although the first two steps propagated equations that are strictly maximal in the ordering in their respective clauses, the finally propagated equation b ≈ d is smaller in the term ordering ≺ kbo than a ≈ b. Thus the structure of the clause set forces propagation of a smaller equation in the term ordering. So the more complicated trail ordering is a result of following the structure of the clause set rather than employing an a priori fixed ordering.

In case the calculus runs into a stuck state, i.e., the current trail is a model for the set of considered ground instances, then the trail information can be effectively used for a guided continuation. For example, in order to use the trail to certify a model, the trail literals can be used to guide the design of a lifted ordering for the clauses with variables such that propagated trail literals are maximal in respective clauses. Then it could be checked by superposition, if the current clause is saturated by such an ordering. If this is not the case, then there must be a superposition inference larger than the current β, thus giving a hint on how to extend β. Another possibility is to try to extend the finite set of ground terms considered in a stuck state to the infinite set of all ground terms by building extended equivalence classes following patterns that ensure decidability of clause testing, similar to the ideas in [START_REF] Bromberger | Deciding the Bernays-Schoenfinkel fragment over bounded difference constraints by simple clause learning over theories[END_REF]. If this fails, then again this information can be used to find an appropriate extension term β for rule Grow.

In contrast to superposition, SCL(EQ) does also inferences below variable level. In general, single superposition inferences below variables are redundant [2]. Inferences in SCL(EQ) are guided by a false clause with respect to a partial model assumption represented by the trail. They are typically not single superposition steps, but a sequence of superposition inferences eventually resulting in a non-redundant clause changing the partial model assumption. Therefore, compared to the syntactic style of superposition-based theorem proving, in SCL(EQ) reasoning below variables does not result in an explosion in the number of possibly inferred clauses but also rather in the derivation of more general clauses, see Example 5.

Example 5 (Rewriting below variable level) Assume a term ordering ≺ kbo , unique weight 1 and with precedence d ≺ c ≺ b ≺ a ≺ g ≺ h ≺ f . Further assume β to be large enough. Assume the clause set N : (b) ] and C 3 is a conflict clause. Explore-Refutation now creates the following refutation for a ≈ b:

C 1 := f (x) ≈ h(b) ∨ x ≈ g(a) C 2 :=c ≈ d ∨ f (g(b)) ≈ h(b) C 3 :=a ≈ b ∨ f (g(b)) ≈ h(b) Let σ = {x → g(a)} be a substitution. C 1 σ must be propagated: = [ f (g(a)) ≈ h(b) 0:C 1 σ ]. Now suppose that we decide f (g(b)) ≈ h(b). Then = [ f (g(a)) ≈ h(b) 0:C 1 σ , f (g(b)) ≈ h(b) 1: f (g(b)) ≈h(b)∨ f (g(b))≈h
I 1 := ( f (x) ≈ h(b) • σ, C 1 • σ, , , ) I 2 := ( f (g(b)) ≈ h(b), C 2 , , , ) I 3 := (a ≈ b, C 3 , , , ) I 4 := ( f (g(b)) ≈ h(b), f (g(b)) ≈ h(b) ∨ g(a) ≈ g(a) ∨ f (g(b)) ≈ h(b), I 3 , I 1 , ) I 5 := (h(b) ≈ h(b), h(b) ≈ h(b) ∨ g(a) ≈ g(a) ∨ f (g(b)) ≈ h(b) ∨ f (g(b)) ≈ h(b), I 4 , I 2 , )
Multiple applications of Equality-Resolution and Factorize result in the final conflict clause C 4 := f (g(b)) ≈ h(b) with which we can backtrack. The clause set resulting from this new clause is:

C 1 = f (x) ≈ h(b) ∨ x ≈ g(a) C 2 = c ≈ d C 4 = f (g(b)) ≈ h(b)
where C 2 is the result of a unit reduction between C 4 and C 2 . Note that the refutation required rewriting below variable level in step I 4 . Superposition would create the following clauses (Equality-Resolution and Factorization steps are implicitly done):

N ⇒ Sup(C 2 ,C 3 ) N 1 ∪ {C 4 :=c ≈ d ∨ a ≈ b} ⇒ Sup(C 1 ,C 2 ) N 2 ∪ {C 5 :=c ≈ d ∨ g(a) ≈ g(b)} ⇒ Sup(C 4 ,C 5 ) N 3 ∪ {C 6 :=c ≈ d}
For superposition the resulting clause set is thus:

C 1 = f (x) ≈ h(b) ∨ x ≈ g(a) C 2 = a ≈ b ∨ f (g(b)) ≈ h(b) C 6 = c ≈ d
Currently, the reasoning with solely positive equations is done on and with respect to the trail. It is well-known that also inferences from this type of reasoning can be used to speed up the overall reasoning process. The SCL(EQ) calculus already provides all information for such a type of reasoning, because it computes the justification clauses for trail reasoning via rewriting inferences. By an assessment of the quality of these clauses, e.g., their reduction potential with respect to trail literals, they could also be added, independently from resolving a conflict.

The trail reasoning is currently defined with respect to rewriting. It could also be performed by congruence closure [START_REF] Nelson | Fast decision procedures based on congruence closure[END_REF]. However, we still need a ground term rewrite system to propagate literals. A possible solution to this is an algorithm by Gallier et al. [START_REF] Gallier | An algorithm for finding canonical sets of ground rewrite rules in polynomial time[END_REF] which creates a ground rewrite system out of the congruence classes in polynomial time.

Bromberger et al. [START_REF] Bromberger | A two-watched literal scheme for first-order logic[END_REF] showed how to lift the two-watched literal scheme to SCL. We could make use of this in an implementation as well. In general, an implementation of SCL(EQ) requires both the infrastructure of a superpositon-based prover and an CDCL/SMT solver. The aspect of how to find interesting ground decision or propagation literals for the trail including the respective grounding substituion σ can be treated similar to CDCL [START_REF] Bayardo | Using CSP look-back techniques to solve exceptionally hard SAT instances[END_REF][START_REF]Handbook of Satisfiability[END_REF][START_REF] Moskewicz | Chaff: engineering an efficient SAT solver[END_REF][START_REF] Silva | GRASP-a new search algorithm for satisfiability[END_REF]. A simple heuristic may be used from the start, like counting the number of instance relationships of some ground literal with respect to the clause set, but later on a bonus system can focus the search towards the structure of the clause sets. Ground literals involved in a conflict or the process of learning a new clause get a bonus or preference. However, since the number of ground literals is not fixed from the beginning with growing β, all these operations need to be done via hashing or indexing operations modulo matching/unification in contrast to simple look-ups in the CDCL case. The regular strategy requires the propagation of all ground unit clauses smaller than β. For an implementation a propagation of the (explicit and implicit) unit clauses with variables to the trail will be a better choice. This complicates the implementation of refutation proofs and rewriting (congruence closure), but because every reasoning is layered by a ground term β this can still be efficiently done.

1. K has no defining literal in 1 . Then cores( 1 ; K ) = {[]} contains only the empty core and K is of level 0 in 1 . Then cores( ; K ) = {[]} as well and thus K is of level 0 in . 2. K has a defining literal L:=max 1 (K ) and L is of level i. Then there exists a core ∈ cores( 1 ; K ) such that L is the maximum literal in according to ≺ and for all ∈ cores( 1 ; K ) it holds max ≺ ( ) max ≺ ( ). Thus is a defining core. Now any ∈ (cores( ; K )\cores( 1 ; K )) has a higher maximum literal according to ≺ . Thus is also a defining core in and L is the defining literal of K in and thus K is of level i in .

Auxiliary Lemmas for the Proofs of Lemma 2

Lemma 13 Let be a trail. Then any literal in occurs exactly once.

Proof Let :=[L i 1 :C 1 •σ 1 1 , ..., L i n :C n •σ n n
]. Now suppose there exist L i , L j with i < j and 1 ≤ i, j ≤ n such that L i = L j . By definition of , L j is undefined in [L 1 , ..., L i , ..., L j-1 ]. But obviously L j is defined in . Contradiction.

Lemma 14 Let be a trail. If a literal L is of level i, then it is not of level j = i.

Proof Let be a trail. By Lemma 13 any literal in is unique. Suppose there exists a literal L such that L is of level i and of level j. If the core is empty for L then L is of level 0 by definition. Otherwise there must exist cores , ∈ cores( ; L) such that max ≺ ( ) max ≺ ( ) and max ≺ ( ) max ≺ ( ) for all ∈ cores( ; L). But then max ≺ ( ) = max ≺ ( ). Contradiction.

Lemma 15 Let L be a ground literal and a trail. If L is defined in then L has a level.

Proof Let be a trail. Suppose that L is defined in . Then it either has a defining literal or it has no defining literal. If it has a defining literal K , then the level of K is the level of L. Since K ∈ it is annotated by a level. Thus L has a level. If L does not have a defining literal, then L is of level 0 by definition of a literal level.

Proof of Lemma

2-1 ≺ * is well-defined. Proof Suppose a trail :=[L i 1 :C 1 •σ 1 1 , ..., L i n :C n •σ n n
] and a term β such that {L 1 , ..., L n } ≺ T β. We have to show that the rules 8. 1-8.11 Proof of Lemma 2-2 ≺ * is a total strict order, i.e. ≺ * is irreflexive, transitive and total.

Proof Suppose a trail

:=[L i 1 :C 1 •σ 1 1 , ..., L i n :C n •σ n n
] and a term β such that {L 1 , ..., L n } ≺ T β. Irreflexivity We have to show that there is no ground literal L such that L ≺ * L. Suppose two literals L and K such that L ≺ * K and L = K . Now we have several cases:

1. Suppose that L, K are β-defined and of level 1 or higher. Then we have several cases: (a) L = M i, j and K = M k,l . Then by 8.1 M i, j ≺ * M k,l if i < k or (i = k and j < l). Thus i = k or j = l. We show that for M i, j , M k,l with i = k or j = l it holds M i, j = M k,l . Assume that M i, j = M k,l and k = i or j = l. Assume that k = i. Then, by Definition 8

M i, j ≺ T M k,l or M k,l ≺ T M i, j . Thus M i, j = M k,l since ≺ T is a rewrite ordering. Now assume that k = i. Since M i, j = M k,l it holds max (M i, j ) = max (M k,l
), since both have the same level by Lemma 14. But then

k = i. Thus M i, j = M k,l for k = i or j = l. Thus if by 8.1 M i, j ≺ * M k,l if i < k or (i = k and j < l), then M i, j = M k,l . (b) L = L i and K = L j . Then by 8.2 L i ≺ * L j if L i ≺ L j . Then by Lemma 13 L i = L j . (c) L = comp(L i ) and K = L j . Then by 8.3 comp(L i ) ≺ * L j if L i ≺ L j . L i = L j by Lemma 13. L = K has to hold since is consistent. (d) L = L i and K = comp(L j ). Then by 8.4 L i ≺ * comp(L j ) if L i ≺ L j or i = j.
If i = j then we can proceed analogous to the previous step. If i = j then obviously

L i = comp(L i ). (e) L = comp(L i ) and K = comp(L j ). Then by 8.5 comp(L i ) ≺ * comp(L j ) if L i ≺ L j . By Lemma 13 L i = L j . Thus comp(L i ) = comp(L j ). (f) L = L i and K = M k,l . Then by 8.6 L i ≺ * M k,l , comp(L i ) ≺ * M k,l if i ≤ k. M k,l = L i and M k,l = comp(L i ) follows directly from the Definition 8. Thus if L i ≺ * M k,l or comp(L i ) ≺ * M k,l if i ≤ k by 8.6, then L i = M k,l and comp(L i ) = M k,l .

123

(g) L = M k,l and K = L i . Then we can proceed analogous to the previous step for 8.7.

2. Suppose that L and K are β-defined and of level zero. Since ≺ T is irreflexive, L ⊀ T K has to hold. Since ≺ * =≺ T for literals of level zero L ⊀ * K has to hold too. 3. Suppose that L, K are β-defined and L is of level zero and K is of level greater than zero.

But then L = K has to hold by Lemma 14. Thus L ⊀ * K for 8.9. 4. Suppose that L and K are β-undefined. Then by 8.10

K ≺ * H if K ≺ T H . Since ≺ T is a rewrite ordering K ≺ T H iff K = H . 5.
Suppose that L is β-defined and K is β-undefined. Then by 8.11 L ≺ * K . Then L = K has to hold since otherwise L, K would be both β-defined and β-undefined, contradicting consistency of . (a) Suppose all literals have the same defining literal L i and L i is of level 1 or higher. By 8.6 L i ≺ * M i, j and comp(L i ) ≺ * M i, j for all j. By 8.4 L i ≺ * comp(L i ).

Thus L i ≺ * comp(L i ) ≺ * M i, j for all j. Since K ≺ * L either K = L i and L = L i or L = M i, j and K = comp(L i ) or L = M i, j and K = M i,k with k < j. (i) Assume K = L i and L = L i . Since K is the smallest literal with defining literal L i , K = H has to hold. But then K ≺ * K contradicting irreflexivity. (ii) Assume L = M i, j and K = comp(L i ). Since H ≺ * K and all literals have the same defining literal, H = L i has to hold by 8.6 and 8.4. Then, again by 8.6, H ≺ * L. (iii) L = M i, j and K = M i,k with k < j. Since H ≺ * K and all have the same defining literal either H = M i,l with l < k by 8.1, or H = L i or H = comp(L i ) by 8.6. In both cases H ≺ * L holds by 8.1 and 8.6. (b) Suppose H , K , L have at least one different defining literal and max (L) = L i with L i of level 1 or higher. First, we have to show that if L j = max (K ) ≺ max (L ) = L i and L i is of level 1 or higher, then K ≺ * L . Suppose that L j is of level 0. Then K ≺ * L by 8.9. Suppose that L = M i,k and K = M j,l . Then K ≺ * L by 8.1. Suppose that L = M i,k and K = L j or K = comp(L j ). Then K ≺ * L by 8.6. Suppose that L = L i or L = comp(L i ) and K = L j or K = comp(L j ). Then K ≺ * L by 8.2-8.5. Suppose that L = L i or L = comp(L i ) and K = M j,l .

Then K ≺ * L by 8. Totality First we show that any ground literal is either β-defined and has a level or β-undefined. Since is consistent, a literal is either β-defined or β-undefined. We just need to show that if a literal is β-defined, it has a level. By Lemma 15 all defined literals have a level. β-definedness implies definedness. Thus all β-defined literals have a level. Now assume some arbitrary ground literals L = K . We have several cases: (a) L is of level zero and K is of level greater than zero or vice versa. Then by 8.9

1. L, K are β-undefined. Since L = K we have L ≺ T K or K ≺ T L
L ≺ * K or K ≺ * L has to hold. (b) max (L) = L i and max (K ) = L j and both are of level 1 or higher.

(i

) L = M i,k and K = M j,l . Then either M i,k ≺ * M j,l or M j,l ≺ * M i,k by 8.1. (ii) L = M i,k and K = L j or K = comp(L j ). If i ≥ j then by 8.6 L j ≺ * M i,k or comp(L j ) ≺ * M i,k . If i < j then by 8.7 M i,k ≺ * L j or M i,k ≺ * comp(L j ). (iii) K = M i
= comp(L j ). Then if i ≤ j by 8.4 L i ≺ * comp(L j ). If j < i by 8.3 comp(L j ) ≺ * L i . (vii) L = comp(L i ) and K = L j . Then if i < j by 8.3 comp(L i ) ≺ * L j . If j ≤ i by 8.4 L j ≺ * comp(L i ). (c) max (L) = L i and max (K ) = L j and both are of level 0. Now either L ≺ T K or K ≺ T L. Thus by 8.8 L ≺ * K or K ≺ * L.
Proof of Lemma 2-3 ≺ * is a well-founded ordering.

Proof Suppose some arbitrary subset M of all ground literals, a trail :

=[L i 1 :C 1 •σ 1 1 , ..., L i n :C n •σ n n
] and a term β such that {L 1 , ..., L n } ≺ T β. We have to show that M has a minimal element. We have several cases: 1. L is β-undefined in for all literals L ∈ M. Then ≺ * =≺ T . Since ≺ T is well-founded there exists a minimal element in M. Thus there exists a minimal element in M with regard to ≺ * . 2. there exists at least one literal in M that is β-defined. Then we have two cases: (a) there exists a literal in M that is of level zero. Then let L ∈ M be the literal of level zero, where L ≺ T K for all K ∈ M with K of level zero. We show that L is the minimal element. Suppose there exists a literal L ∈ M that is smaller than L. Since L is of level zero, L ≺ * K for all literals K of level greater than zero by 8.9 and L ≺ * H for all β-undefined literals H by 8.11. Thus L must be of level zero. But then L ≺ T L has to hold, contradicting assumption. (b) There exists no literal in M that is of level zero. Let L ∈ M be the literal where max (L) max (K ) for all K ∈ M and (i) L = max (L) or; (ii) L = comp(max (L)) and max (L) / ∈ M or; (iii) L ≺ T H for all H ∈ M such that max (L) = max (H ) and max (L) / ∈ M and comp(max (L)) / ∈ M. We show that L is the minimal element. Suppose there exists a literal L ∈ M that is smaller than L. We have three cases:

(i) max (L) = L = L i . Since L i ≺ T β we have either L = L j with j < i by 8.2 or L = comp(L j ) with j < i by 8.3 or L = M k,l with k < i by 8.7. In all three cases we have max (L ) ≺ max (L) contradicting assumption that the defining literal of L is minimal in M.

(ii) L = comp(L i ) = comp(max (L)) and max (L) / ∈ M. Since L i ≺ T β either L = L j
with j < i by 8.4 or L = comp(L j ) with j < i by 8.5 or L = M k,l with k < i by 8.7. In all three cases we have max (L ) ≺ max (L) contradicting assumption that the defining literal of L is minimal in M.

(iii) L = M k,l and max (L) / ∈ M and comp(max (L)) / ∈ M. Then either L = M i, j with i < k or (i = k and j < l) by 8.1 or L = L i or L = comp(L i ) with i ≤ k. Suppose that L = M i, j and i < k. Then max (L ) ≺ max (L)
contradicting assumption. Suppose that L = M i, j and i = k and j < l. Then L ≺ T L and max (L) = max (L ). For L it holds L ≺ T H for all H ∈ M such that max (L) = max (H ). Contradiction. Suppose that L = L i or L = comp(L i ) with i = k. Then max (L) = L i . By assumption max (L) / ∈ M and comp(max (L)) / ∈ M. Contradiction. Suppose that L = L i or L = comp(L i ) with i < k. Then we have max (L ) ≺ max (L) contradicting assumption that the defining literal of L is minimal in M.

Proof of Lemma 4

Assume that all ground terms t with t ≺ T β for any β are polynomial in the size of β. Then testing Propagate (Conflict) is NP-Complete, i.e., the problem of checking for a given clause C whether there exists a grounding substitution σ such that Cσ propagates (is false) is NP-Complete.

Proof Let Cσ be propagable (false). The problem is in NP because β is constant and for all t ∈ codom(σ ) it holds that t is polynomial in the size of β. Checking if Cσ is propagable (false) can be done in polynomial time with Congruence Closure [START_REF] Nelson | Fast decision procedures based on congruence closure[END_REF] since σ has polynomial size.

We reduce 3-SAT to testing rule Conflict. Consider a 3-place predicate R, a unary function g, and a mapping from propositional variables P to first-order variables x P . Assume a 3-SAT clause set N = {{L 0 , L 1 , L 2 }, ..., {L n-2 , L n-1 , L n }}, where L i may denote both P i and ¬P i . Now we create the clause

{R(t 0 , t 1 , t 2 ) ≈ true, ..., R(t n-2 , t n-1 , t n ≈ true)},
where t i :=x P i if L i = P i and t i :=g(x P i ) otherwise. Now let :={R(x 0 , x 1 , x 2 ) | x i ∈ {0, 1, g(0), g(1)} such that (x 0 ∨ x 1 ∨ x 2 ) ↓ {g(x) →(¬x)} is true } be the set of all R-atoms that evaluate to true if considered as a three literal propositional clause. Now N is satisfiable if and only if Conflict is applicable to the new clause. The reduction is analogous for Propagate.

Proof of Theorem 1 Assume a state ( ; N ; U ; β; k; D) resulting from a run. Then ( ; N ; U ; β; k; D) is sound.

Proof Proof by structural induction on ( ; N ; U ; β; k; D). Let ( ; N ; U ; β; k; D) = ( , N , ∅, β, 0, ), the initial state. Then it is sound according to Lemma 5. Now assume that ( ; N ; U ; β; k; D) is sound. We need to show that any application of a rule results in a sound state.

Propagate Assume Propagate is applicable. Then there exists

C ∈ N ∪ U such that C = C 0 ∨ C 1 ∨ L, Lσ is β-undefined in , C 1 σ = Lσ ∨ ... ∨ Lσ , C 1 = L 1 ∨ ... ∨ L n ,μ = mgu(L 1 , ..., L n , L) and C 0 σ is β-false in . Then a reduction chain application [I 1 , ..., I m ] from to Lσ k:(C 0 ∨L)μ•σ is created with I m :=(s m #t m • σ m , s m #t m ∨ C m • σ m , I j , I k , p m ). Finally s m #t m σ k:(s m #t m ∨C m )•σ m m
is added to . By definition of a reduction chain application (s m #t m )σ m = Lσ ↓ conv( ) . Thus, (s m #t m )σ m must be β-undefined in and irreducible by conv( ), since (C 0 ∨ L)μσ ≺ T β by definition of Propagate.

• 13.1: Since (s m #t m )σ m is β-undefined in , adding (s m #t m )σ m does not make incon- sistent. Thus , (s m #t m )σ m remains consistent. • 13.2: (s m #t m )σ m is β-undefined in and irreducible by conv( ). It remains to show that C m σ m is β-false in , N ∪ U | s m #t m ∨ C m and (s m #t m ∨ C m )σ m ≺ T β. By i.h. for all L σ l:(L ∨C )•σ ∈ it holds that C σ is β-false in , (L ∨ C )σ ≺ T β and N ∪ U | (L ∨ C ). By definition of Propagate C 0 σ is β-false in and Cσ ≺ T β and N ∪ U | C. (C 0 ∨ C 1 ∨ L)μ is an instance of C. Thus C | (C 0 ∨ C 1 ∨ L)μ. C 0 μ = Lμ ∨ ... ∨ Lμ by definition of Propagate. Thus C | (C 1 ∨ L)μ and by this N ∪ U | (C 1 ∨ L)μ.
By definition of a reduction chain application I j either contains a clause annotation from , Lσ k:(C 0 ∨L)•σ or it is a rewriting inference from smaller rewrite steps for all 1 ≤ j ≤ m. Thus, by Lemma 3 it follows by induction that for any rewriting inference Decide Assume Decide is applicable. Then there exists C ∈ N ∪U such that C = C 0 ∨ L, Lσ is ground and β-undefined in and C 0 σ is ground and β-undefined or β-true in . Then a reduction chain application [I 1 , ..., I m ] from to Lσ k+1:(C 0 ∨L)•σ is created with

I j :=(s j #t j • σ j , s j #t j ∨ C j • σ j , I i , I k , p j ) it holds C j σ j is β-false in , N ∪ U | s j #t j ∨ C j and (s j #t j ∨ C j )σ j ≺ T β. • 13.
I m :=(s m #t m • σ m , s m #t m ∨ C m • σ m , I j , I k , p m ). Finally s m #t m σ k+1:(s m #t m ∨comp(s m #t m ))•σ m m is added to .
By definition of a reduction chain application (s m #t m )σ m = Lσ ↓ conv( ) . Thus, (s m #t m )σ m must be β-undefined in and irreducible by conv( ), since (C 0 ∨ L)σ ≺ T β by definition of Decide. Now assume that Propagate is applied. Then a literal L is added to the trail. Let C 1 ∨ L 1 , ..., C n ∨ L n be the ground clause instances that get β-false in by the application such that L is the defining literal of L 1 , ..., L n . Then L i is of level k for 1 ≤ i ≤ n. Thus L i = comp(K ) for the decision literal K ∈ of level k. Thus C 1 ∨ L 1 , ..., C n ∨ L n do not have the above properties. Now assume that Decide is applied. Then a literal L of level k + 1 is added to the trail. Let C 1 ∨ L 1 , ..., C n ∨ L n be the (ground) clause instances that get β-false in by the application such that L is the defining literal of L 1 , ..., L n . By the definition of a regular run for all L i with 1 ≤ i ≤ n it holds that L i = comp(L) or there exists another literal K i ∈ C i such that K i is of level k + 1 and L i = K i , since otherwise Propagate must be applied. Thus C 1 ∨ L 1 , ..., C n ∨ L n do not have the above properties. Now assume that Ski p is applied. Then there are no new clauses that get β-false in . Thus this trivially holds. Now assume that Backtrack is applied. Then a new clause D ∨ L is added to U and = , K , such that there is a grounding substitution τ with (D ∨ L)τ β-false in , K , there is no grounding substitution δ with (D ∨ L)δ β-false in . is the trail resulting from the application of Backtrack. By Lemma 16, after application of Backtrack there exists no clause C ∈ N ∪ U and a substitution σ such that Cσ is β-false in . Thus there exists no clause with the above properties.

• 13.1: Since (s m # t m )σ m is β-undefined in adding (s m #t m )σ m does not make incon- sistent. Thus , (s m #t m )σ m remains consistent. • 13.3: (s m #t m )σ m is β-undefined in and irreducible by conv( ). N ∪ U | (s m #t m ) ∨ comp(s m #t m ) obviously holds. (s m #t m )σ m ≺ T β
(L[l ] p )σ ) ∪ core( ; (l ≈ r )σ ) is a core for (L[r μ] p )σ σ . Thus (L[r μ] p )σ σ is of level 0. Since (L[r μ] p )σ σ ≺ T (L[l ] p )σ , (L[r μ] p )σ σ ≺ * (L[l ] p )σ

Proof of Lemma 6

Let N be a clause set. The clauses learned during a regular run in SCL(EQ) are not redundant with respect to ≺ * and N ∪ U . For the trail only non-redundant clauses need to be considered.

We first prove that learned clauses are non-redundant and then that only non-redundant clauses need to be considered, Lemma 21, below. 1.

Proof

= . Then = , . Thus at least one Skip was applied, so Cσ does not contain a literal that is β-undefined without the rightmost literal of , therefore Cσ = Dσ . Suppose that this is not the case, so Cσ = Dσ . Then Dσ is β-false in . But since Backtrack does not produce any β-false clauses by Lemma 16, Conflict could have been applied earlier on Dσ contradicting a regular run. Since C * Cσ we have that C = Dσ as well. Thus, again since Backtrack does not produce any β-false clauses by Lemma 16, at a previous point in the derivation there must have been a state such that C was β-false under the current trail and Conflict was applicable but not applied, a contradiction to the definition of a regular run.

2.

= , then conflict was applied immediately after an application of Decide by Corollary 2 and the definition of a regular run. Thus = , K (k-1):D •δ , L k:D •τ . C does not have any β-undefined literals. Suppose that C has no literals of level k. Then all literals in C are of level i < k. Since C is β-false in , C is β-false in , K as well, since it does not have any literals of level k. Thus, again since Backtrack does not produce any β-false clauses by Lemma 16, at a previous point in the derivation there must have been a state such that C was β-false under the current trail and Conflict was applicable but not applied, a contradiction to the definition of a regular run. Since C * Cσ , it may have at most one literal of level k, namely comp(L), since comp(L) ∈ Cσ by definition of a regular run, since Skip was not applied, and there exists only L such that L ≺ * comp(L) and L is of level k. But L is β-true in . Thus L / ∈ C has to hold. Now suppose that C has one literal of level k. Thus C = C ∨ comp(L), where C is β-false in , K . But by Lemma 17 there does not exist such a clause. Contradiction.

Auxiliary Lemma for the Proof of Lemma 9

Lemma 20 Suppose a sound state ( ; N ; U ; β; k; D • σ ) resulting from a regular run. Then Dσ is of level 1 or higher. Proof Let ( ; N ; U ; β; k; D • σ ) be a state resulting from a regular run. Suppose that Dσ is not of level 1 or higher, thus Dσ is of level 0. Then Conflict was applied earlier to a clause that was of level 1 or higher. Thus there must have been an application of Explore-Refutation on a state ( , , L; N ; U ; β; l; D • σ ) between the state after the application of Conflict and the current state resulting in a state ( , , L l:(L∨C)•δ ; N ; U ; β; l; D • σ ) such that D σ is of level l and D σ is of level 0, since no other rule can reduce the level of D σ . Then there exists a K ∈ D σ such that L is the defining literal of K . Let [I 1 , ..., I m ] be the refutation of K and I j = (s j #t j • σ j , (s j #t j ∨ C j ) • σ j , I i , I k , p j ) be the step that was chosen by Explore-Refutation. Then D σ = (s j #t j ∨ C j )σ j . Cδ ⊂ C j σ j has to hold since L is the defining literal of K . Then Cδ must be of level 0 or empty. Note that Cδ is of level l if L is a decision literal. But then, by the definition of a regular run, L l:(L∨C)•δ must have been propagated before the first decision, since propagation is exhaustive at level 0. Contradiction. Proof First we prove that stuck states never appear during conflict resolution. Assume a sound state ( ; N ; U ; β; k; D • σ ) resulting from a regular run. Now we show that we can always apply a rule. Suppose that Dσ = (D ∨ L ∨ L )σ such that Lσ = L σ . Then we must apply Factorize by the definition of a regular run. Now suppose that Factorize is not applicable and := , L and Dσ is false in . If Dσ = (D ∨ s ≈ s )σ such that sσ = s σ , we can apply Equality-Resolution. So suppose that Equality-Resolution is not applicable. Then we can apply Ski p. Now suppose that := , L k:(L∨C)δ and L is the defining literal of at least one literal in Dσ , so Skip is not applicable. If Dσ = (D ∨ L )σ where D σ is of level i < k and L σ is of level k and Ski p was applied at least once during this conflict resolution, then Backtrack is applicable. If Ski p was not applied and L = comp(L σ ) and L is a decision literal, then Backtrack is also applicable. Otherwise, let (s # t)σ ∈ Dσ such that K ≺ * (s # t)σ for all K ∈ Dσ . (s # t)σ exists since Factorize is not applicable. By Lemma 20, (s # t)σ must be of level 1 or higher. By the definition of ≺ * , L must be the defining literal of (s # t)σ since L is of level 1 or higher and any literal in Dσ that has another defining literal is smaller than (s # t)σ . Now suppose that L is a decision literal and (s # t)σ = comp(L). Then (s # t)σ is of level k and all other literals K ∈ Dσ are of level i < k, since (s # t)σ is the smallest β-false literal of level k and Factorize is not applicable. In this case Explore-Refutation is not applicable since a paramodulation step with the decision literal does not make the conflict clause smaller. But Backtrack is applicable in this case even if Skip was not applied earlier by the definition of a regular run. Thus (s # t)σ = comp(L) or L is a propagated literal has to hold. We show that in this case Explore-Refutation is applicable. Let [I 1 , ..., I m ] be a refutation of (s # t)σ from ,

Proof of

I m = (s m #t m •σ m , (s m #t m ∨C m )•σ m , I j , I k , p m ). Since [I 1 , ..., I m ] is a refutation s m #t m σ m = s ≈ s .
Furthermore any I i either contains a clause annotation from , (s # t)σ k:D•σ or it is a rewrite inference from I j , I k with j , k < i. Thus by Lemma 3 it inductively follows that where L is the defining literal of (s # t)σ , then Ski p is applicable | | times, since otherwise (s # t)σ would not be maximal in Dσ . So at some point it is no longer applicable. Since Dσ is finite, Equality-Resolution can be applied only finitely often. Thus we finally have to apply Explore-Refutation. Then [I 1 , ..., I m ] is a refutation of (s # t)σ from , and there exists an 1 ≤ j ≤ m, such that I j = (s j #t j • σ j , (s j #t j ∨ C j ) • σ j , I l , I k , p j ), (C j ∨ s j # t j )σ j ≺ * (D ∨s # t)σ . Otherwise Explore-Refutation would not be applicable, contradicting Lemma 9. Thus in this case we are done. Now we show that Backtrack is finally applicable. Since ≺ * is well-founded and is finite there must be a state where Explore-Refutation, Ski p, Factorize, Equality-Resolution are no longer applicable. By Lemma 20 the conflict clause in this state must be of level 1 or higher, thus ⊥ cannot be inferred. Suppose that it is always of level i ≥ l for some l. The smallest literal of level l that is false in is comp(L), where L is the decision literal of level l. Since we can always reduce if Backtrack is not applicable and since we can always apply a rule by Lemma 9, we must finally reach a conflict clause comp(L) ∨ C, where C is of level j < l. Thus Backtrack is applicable.

C m σ m = D σ m ∨ ... ∨ D σ m ∨ C 1 σ m ∨ ... ∨ C n σ m ,

Proof of Lemma 11

Let N be a set of clauses and β be a ground term. Then any regular run that never uses Grow terminates.

Proof Assume a new ground clause Dσ is learned. By Lemma 6 all learned clauses are non-redundant. Thus Dσ is non-redundant. By the definition of a regular run Factorize has precedence over all other rules. Thus Dσ does not contain any duplicate literals. By Theorem 1, Dσ ≺ T β has to hold. There are only finitely many clauses Cσ ≺ T β, where Cσ is neither a tautology nor does it contain any duplicate literals. Thus there are only finitely many clauses Dσ that can be learned. Thus there are only finitely many literals that can be decided or propagated.

Proof of Lemma 12

If a regular run reaches the state ( ; N ; U ; β; k; ⊥) then N is unsatisfiable.

Proof By definition of soundness, all learned clauses are consequences of N ∪ U , Definition 13.5, and is satisfiable, Definition 13.1.

Proof of Theorem 2

Let N be an unsatisfiable clause set, and ≺ T a desired term ordering. For any ground term β where gnd ≺ T β (N ) is unsatisfiable, any regular SCL(EQ) run without rule Grow will terminate by deriving ⊥.

Proof Since regular runs of SCL(EQ) terminate we just need to prove that it terminates in a failure state. Assume by contradiction that we terminate in a state ( ; N ; U ; β; k; ). If no rule can be applied in then for all s # t ∈ C for some arbitrary C ∈ gnd ≺ T β (N ) it holds that s # t is β-defined in (otherwise Propagate or Decide woud be applicable, see Lemma 19) and there aren't any clauses in gnd ≺ T β (N ) β-false under (otherwise Conflict would be applicable, see again Lemma 19). Thus, for each C ∈ gnd ≺ T β (N ) it holds that C is β-true in . So we have | gnd ≺ T β (N ), but by hypothesis there is a superposition refutation of N that only uses ground literals from gnd ≺ T β (N ), so also gnd ≺ T β (N ) is unsatisfiable, a contradiction.

Further Examples

For the following examples we assume a term ordering ≺ kbo , unique weight 1 and with precedence d ≺ c ≺ b ≺ a ≺ a 1 ≺ • • • ≺ a n ≺ g ≺ h ≺ f . Further assume β to be large enough.

Example 6 (Implicit Conflict after Decision) Consider the following clause set N

C 1 := h(x) ≈ g(x) ∨ c ≈ d C 2 := f (x) ≈ g(x) ∨ a ≈ b C 3 := f (x) ≈ h(x) ∨ f (x) ≈ g(x)
Suppose we apply the rule Decide first to C 1 and then to C 2 with substitution σ = {x → a}. Then we yield a conflict with C 3 σ , resulting in the following state:

([h(a) ≈ g(a) 1:(h(x)≈g(x)∨h(x) ≈g(x))•σ , f (a) ≈ g(a) 2:( f (x)≈g(x)∨ f (x) ≈g(x))•σ ]; N ; {}; 2; C 3 • σ )

123

According to ≺ * , f (a) ≈ h(a) is the greatest literal in C 3 σ . Since f (a) ≈ g(a) is the defining literal of f (a) ≈ h(a) we can not apply Skip. Factorize is also not applicable, since f (a) ≈ h(a) and f (a) ≈ g(a) are not equal. Thus we must apply Explore-Refutation to the greatest literal f (a) ≈ h(a). The rule first creates a refutation [I 1 , ..., I 5 ], where: ,, ) I 2 := (( f (x) ≈ g(x)) • σ, ( f (x) ≈ g(x) ∨ f (x) ≈ g(x)) • σ, , , ) I 3 := ((h(x) ≈ g(x)) • σ, (h(x) ≈ g(x) ∨ h(x) ≈ g(x)) • σ, , , ) I 4 := ((h(x) ≈ g(x)) • σ, (h(x) ≈ g(x) ∨ f (x) ≈ g(x) ∨ f (x) ≈ g(x)) • σ, I 2 , I 1 , 1) I 5 := ((g(x) ≈ g(x)) • σ, (g(x) ≈ g(x) ∨ f (x) ≈ g(x) ∨ f (x) ≈ g(x)

I 1 := (( f (x) ≈ h(x)) • σ, C 3 • σ,
∨h(x) ≈ g(x)) • σ, I 4 , I 3 , 1)

Explore-Refutation can now choose either I 4 or I 5 . Both, (h(x) ≈ g(x))σ and (g(x) ≈ g(x))σ are smaller than ( f (x) ≈ h(x))σ according to ≺ * and false in . Suppose we choose I 5 . Now our new conflict state is:

([h(a) ≈ g(a) 1:(h(x)≈g(x)∨h(x) ≈g(x))•σ , f (a) ≈ g(a) 2:( f (x)≈g(x)∨ f (x) ≈g(x))•σ ]; N ; {}; 2; (g(x) ≈ g(x) ∨ f (x) ≈ g(x) ∨ f (x) ≈ g(x) ∨ h(x) ≈ g(x))σ ). Now we apply Equality-Resolution and Factorize to get the new state ([g(a) ≈ h(a) 1:(g(x)≈h(x)∨g(x) ≈h(x))•σ , f (a) ≈ g(a) 2:( f (x)≈g(x)∨ f (x) ≈g(x))•σ ]; N ; {}; 2; ( f (x) ≈ g(x) ∨ h(x) ≈ g(x)) • σ ) Now we can backtrack. Note, that this clause is non-redundant according to our ordering, although conflict was applied immediately after decision. Example 8 (SCL(EQ) vs. Superposition: Clause learning) Assume clauses:

C 1 :=b ≈ c ∨ c ≈ d C 2 :=a 1 ≈ b ∨ a 1 ≈ c ... C n+1 :=a n ≈ b ∨ a n ≈ c
The completeness proof of superposition requires that adding a new literal to an interpretation does not make any smaller literal true. In this example, however, after adding b ≈ c to the interpretation, we cannot any further literal, since it breaks this invariant. So in superposition we would have to add the following clauses with the help of the Equalit y Factoring rule:

C n+2 :=b ≈ c ∨ a 1 ≈ c ... C 2n+1 :=b ≈ c ∨ a n ≈ c
In SCL(EQ) on the other hand we can just decide a literal in each clause to get a model for this clause set. As we support undefined literals we do not have to bother with this problem at all. For example if we add b ≈ c to our model, both literals a 1 ≈ b and a 1 ≈ c are undefined in our model. Thus we need to decide one of these literals to add it to our model.

  select KBO as the term ordering ≺ T where all symbols have weight one and a ≺ a ≺ b ≺ b ≺ c ≺ d ≺ f and a ground term β:= f ( f (a)). According to the trail induced ordering we have that a ≈ b ≺ * c ≈ d ≺ * f (a ) ≈ f (b ) by 8.2. Furthermore we have that a ≈ b ≺ * a ≈ b ≺ * c ≈ d ≺ * c ≈ d ≺ * f (a ) ≈ f (b ) ≺ * f (a ) ≈ f (b ), by 8.3 and 8.4. Now for any literal L that is β-defined in and the defining literal is a ≈ b it holds that a ≈ b ≺ * L ≺ * c ≈ d by 8.6 and 8.7. This holds analogously for all literals that are β-defined in and the defining literal is c ≈ d or f (a ) ≈ f (b ). Thus we get:

  where again we assume a KBO with all symbols having weight one, precedence d ≺ c ≺ b ≺ a ≺ g ≺ f and β:= f ( f (g(a))). Suppose that we first decide c ≈ d and then propagate a ≈ b: = [c ≈ d 1:c≈d∨c ≈d , a ≈ b 1:C 2 ]. Now we have a conflict with C 3 . Explore-Refutation applied to the conflict clause C 3 results in a paramodulation inference between 123 C 3 and C 2 . Another application of Equality-Resolution gives us the new conflict clause C 4 :=c ≈ d ∨ g(c) ≈ g(d). Now we can Skip the last literal on the trail, which gives us = [c ≈ d 1:c≈d∨c ≈d ]. Another application of the Explore-Refutation rule to C 4 using the decision justification clause followed by Equality-Resolution and Factorize gives us C 5 :=c ≈ d. Thus with SCL(EQ) the following clauses remain:

  C 3 :=a ≈ b} where again we assume a KBO with all symbols having weight one, precedence b ≺ a ≺ f and β:= f ( f ( f (a))). A long refutation by the superposition calculus results in the following (N i is the clause set of the previous step and N 0 the initial clause set N ):

Lemma 8

 8 Let C, D be two clauses. If there exists a substitution σ such that Cσ ⊂ D, then D is redundant with respect to C and any ≺ * .

Definition 17 A

 17 regular run terminates in a state ( ; N ; U ; β; k; D) if D = and no rule is applicable, or D = ⊥. Lemma 11 Let N be a set of clauses and β be a ground term. Then any regular run that never uses Grow terminates. Lemma 12 If a regular run reaches the state ( ; N ; U ; β; k; ⊥) then N is unsatisfiable.

  ,k and L = L j or L = comp(L j ). Analogous to previous step. (iv) L = L i and K = L j . Then if i < j by 8.2 L i ≺ * L j and L j ≺ * L i otherwise. (v) L = comp(L i ) and K = comp(L j ) analogous to previous step for 8.5. (vi) L = L i and K

  3 and 13.4: trivially hold by induction hypothesis. • 13.5: trivially holds since D = .

  holds inductively by Lemma 3 and since Lσ ≺ T β. • 13.2 and 13.4 trivially hold by induction hypothesis. • 13.5: trivially holds since D = . 123 • 13.2-13.3: Since is a prefix of by i.h. this holds. • 13.4: By i.h. N ∪ U | D ∨ L and N | U . Thus N | U ∪ {D ∨ L}. • 13.5: trivially holds since D = after backtracking. Proof of Lemma 7 Assume a state ( ; N ; U ; β; k; D) resulting from a regular run where the current level k > 0 and a unit clause l ≈ r ∈ N . Now assume a clause C ∨ L[l ] p ∈ N such that l = lμ for some matcher μ. Now assume some arbitrary grounding substitutions σ for C ∨ L[l ] p , σ for l ≈ r such that lσ = l σ and r σ ≺ T lσ . Then (C ∨ L[r μσ σ ] p )σ ≺ * (C ∨ L[l ] p )σ . Proof Let ( ; N ; U ; β; k; D) be a state resulting from a regular run where k > 0 and = [L 1 , ..., L n ]. Now we have two cases:1. β ≺ T (l ≈ r )σ . Since (l ≈ r )σ rewrites L[l ] p σ , β ≺ T L[l ] p σ has to hold as well. Thus (l ≈ r )σ is β-undefined in and L[l ] p σ is β-undefined in . By definition of a trail induced ordering ≺ * := ≺ T for β-undefined literals. Thus, in case that L[r μ] p )σ σ is still undefined, (L[r μ] p )σ σ ≺ * (L[l ] p )σ has to hold since (L[r μ] p )σ σ ≺ T (L[l ] p )σ .Thus, according to the definition of multiset orderings,(C ∨ L[r μ] p )σ σ ≺ * (C ∨ L[l ] p )σ . In the case that (L[r μ] p )σ σ is defined, (L[r μ] p )σ σ ≺ * (L[l ] p)σ has to hold as well by Definition 8.11. Thus, according to the definition of multiset orderings,(C ∨ L[r μ] p )σ σ ≺ * (C ∨ L[l ] p )σ . 2. (l ≈ r )σ ≺ T β. Since propagation is exhaustive for literals of level 0 (cf. 15.2) (l ≈ r )σis on the trail or defined and of level 0. Now we have two cases:(a) (L[l ] p )σ is of level 1 or higher. Since (L[l ] p )σ is reducible by (l ≈ r )σ , (L[l ] p )σ = L i and (L[l ] p )σ = comp(L i ) for all L i ∈ . Since (L[l ] p )σ is oflevel 1 or higher, rewriting with (l ≈ r )σ does not change the defining literal of (L[l ] p )σ . Thus (L[r μ] p )σ σ ≺ * (L[l ] p )σ has to hold since (L[r μ] p )σ σ ≺ T (L[l ] p )σ . Thus, according to the definition of multiset orderings, (C ∨ L[r μ] p )σ σ ≺ * (C ∨ L[l ] p )σ . (b) (L[l ] p )σ is of level 0. First we show that (L[r μ] p )σ σ is still of level 0. Suppose that (L[l ] p )σ = s # s. Then rewriting either the left or right side of the equation results in (L[r μ] p )σ σ . Then core( ; (l ≈ r )σ ) is also a core for (L[r μ] p )σ σ and thus (L[r μ] p )σ σ must be of level 0. Now suppose that (L[r μ] p )σ σ = s # s. Then it is of level 0 by definition of a level. Finally suppose that (L[r μ] p )σ σ = s # s and (L[l ] p )σ = s # s. Then core( ;

  according to the definition of ≺ * . Thus, according to the definition of multiset orderings,(C ∨ L[r μ] p )σ σ ≺ * (C ∨ L[l ] p )σ .Proof ofLemma 8 Let C, D be two clauses. If there exists a substitution σ such that Cσ ⊂ D, then D is redundant with respect to C and any ≺ * . Proof Let τ be a grounding substitution for D. Since Cσ ⊂ D, Cσ τ ⊂ Dτ . Thus, for any L ∈ Cσ τ it holds L ∈ Dτ and Cσ τ = Dτ . Thus, Cσ τ ≺ * Dτ by definition of a multiset extension and Cσ τ makes Dτ redundant by Definition 1.

  Consider the following fragment of a derivation learning a clause:⇒ Conflict SCL(EQ) ( ; N ; U ; β; k; D • σ ) ⇒ {Explore-Re f utation,Ski p,Eq-Res,Factori ze} * SCL(EQ) ( ; N ; U ; β; l; C • σ ) ⇒ Backtrack SCL(EQ) ( ; N ; U ∪ {C}; β; k ; ).Assume there are clauses in N ⊆ (gnd(N ∪ U ) * Cσ ) such that N | Cσ . Since N * Cσ and Cσ is β-defined in , there is no β-undefined literal in N , as all β-undefined literals are greater than all β-defined literals. If | N then | Cσ , a contradiction. Thus there is a C ∈ N with C * Cσ such that C is β-false in . Now we have two cases:

Lemma 9

 9 If a regular run (without rule Grow) ends in a stuck state ( ; N ; U ; β; k; D), then D = and all ground literals Lσ ≺ T β, where L ∨ C ∈ N ∪ U are β-defined in .

Lemma 21 ( 1 ,[L i 1 :C 1 •σ 1 1 , 1 ].

 211111 Only Non-Redundant Clauses Building the Trail) Let= [L i 1 :C 1 •σ 1 1 , ..., L i n :C n •σ n n ] be a trail. If L i j :C j •σ j jis a propagated literal and there exist clauses{D 1 ∨ K 1 , ..., D m ∨ K m } with grounding substitutions δ 1 , ..., δ m such that N :={(D 1 ∨ K 1 )δ 1 , ..., (D m ∨ K m )δ m } ≺ * C j σ j and {(D 1 ∨ K 1 )δ 1 , ..., (D m ∨ K m )δ m } | C j σ j , then there exists a (D k ∨ K k )δ k ∈ N such that [L i 1 :C 1 •σ 1 ..., L i j-1 :C j-1 •σ j-1 j-1 , K i j :(D k ∨K k )•δ k k , ..., L i n :C n •σ n n ] is a trail. Proof Let N = {(D 1 ∨ K 1 )δ 1 , ..., (D m ∨ K m )δ m } and L i j :C j •σ j jbe as above. Let = ..., L i j-1 :C j-1 •σ j-1 j-Now suppose that for every literal L ∈ N it holds L ≺ * L j . Then every literal in N is defined in and | N , otherwise Conflict would have been applied to a clause in N . Thus | C j σ j would have to hold as well. But by definition of a trail L j is undefined in . Thus there must be at least one clause(D k ∨ K k )δ k ∈ N with K k = L j and D k δ k ≺ * L j (otherwise (D k ∨K k )δ k ⊀ * C j σ j ), such that | D k . Suppose that | D k . Then N | C j σ j ,since there exists an allocation, namely , ¬L k such that , ¬L k | N but , ¬L k | C j σ j . Thus we can replace L i j :C j •σ j j by K i j :(D k ∨K k )•δ k k in .

Example 7 (

 7 Undefined conflict clause) Consider the following ground clause set N :C 1 := f (a, a) ≈ f (b, b) ∨ c ≈ d C 2 :=a ≈ b ∨ f (a, a) ≈ f (b, b) Suppose that we decide f (a, a) ≈ f (b, b). Then C 2 is false in . Conflict state is as follows: ([ f (a, a) ≈ f (b, b) 1: f (a,a) ≈ f (b,b)∨ f (a,a)≈ f (b,b) ]; N ; {}; 2; C 2 ). Explore-Refutation creates the following ground refutation for a ≈ b, since it is greatest literal in the conflict clause:I 1 := ( f (a, a) ≈ f (b, b), f (a, a) ≈ f (b, b) ∨ f (a, a) ≈ f (b, b), , , ) I 2 := (a ≈ b, C 2 , , , ) I 3 := ( f (b, a) ≈ f (b, b), f (b, a) ≈ f (b, b) ∨ f (a, a) ≈ f (b, b) ∨ f (a, a) ≈ f (b, b), I 2 , I 1 , 11) I 4 := ( f (b, b) ≈ f (b, b), f (b, b) ≈ f (b, b) ∨ f (a, a) ≈ f (b, b) ∨ f (a, a) ≈ f (b, b) ∨ f (a, a) ≈ f (b, b), I 3 , I 1 , 12)As one can see, the intermediate result f (b, a) ≈ f (b, b) is not false in . Thus it is no candidate for the new conflict clause. We have to choose I 4 . The new state is thus:([ f (a, a) ≈ f (b, b) 1: f (a,a) ≈ f (b,b)∨ f (a,a)≈ f (b,b) ]; N ; {}; 2; f (b, b) ≈ f (b, b) ∨ f (a, a) ≈ f (b, b) ∨ f (a, a) ≈ f (b, b) ∨ f (a, a) ≈ f (b, b))Now we can apply Equality-Resolution and two times Factorize to get the final clause f (a, a) ≈ f (b, b) with which we can backtrack.

  is the normal form of s and t is the normal form of t . A rewrite relation is terminating if there is no infinite descending chain t 0 → t 1 → ... and confluent if t * ← s → * t implies t ↔ * t . A rewrite relation is convergent if it is terminating and confluent. A rewrite order is a irreflexive and transitive rewrite relation. A TRS R is terminating, confluent, convergent, if the rewrite relation → R is terminating, confluent, convergent, respectively. A term t is called irreducible by a TRS R if no rule from R rewrites t. Otherwise it is called reducible. A literal, clause is irreducible if all of its terms are irreducible, and reducible otherwise. A substitution σ is called irreducible if any t ∈ codom(σ ) is irreducible, and reducible otherwise.

Table 1

 1 Summary of the orderings presented so far

	Order		Description
	Term order	≺ T	Well-founded rewrite ordering on terms
			Total on ground terms
			For all ground terms t there exist only finitely many ground terms
			s ≺ T t
	Trail order	≺	Sequence ordering given by the trail
	Trail induced order	≺ *	Extends the sequence ordering to all literals implicitly defined due
			to literals of level >0
			Uses ≺ T for literals of level 0 and undefined literals
			Literals of level 0 are smaller and undefined literals are greater than
			literals of level >0

Definition 10 (Rewrite Inference) Let I 1

  Run) A run is called regular if 1. the rules Conflict and Factorize have precedence over all other rules, 2. If k = 0 in a state ( ; N ; U ; β; k; D), then Propagate has precedence over Decide, 3. If an annotated literal L k:C•σ could be added by an application of Propagate on in a •σ is not added by Decide on , 4. during conflict resolution Skip is applied at least once, except if Conflict is applied immediately after an application of Decide. 5. if Conflict is applied immediately after an application of Decide, then Backtrack is only

state ( ; N ; U ; β; k; D) and C ∈ N ∪ U , then the annotated literal comp(L) k+1:C applied in a state ( , L ; N ; U ; β;

  Definition 16 (Stuck State) A state ( ; N ; U ; β; k; D) is called stuck if D = ⊥ and none of the rules of the calculus, except for Grow, is applicable. Lemma 9 (Form of Stuck States) If a regular run (without rule Grow) ends in a stuck state ( ; N ; U ; β; k; D), then D = and all ground literals Lσ ≺ T β, where L ∨ C ∈ (N ∪ U ) are β-defined in . ⊥}. If Backtrack is not applicable then any set of applications of Explore-Refutation, Ski p, Factorize, Equality-Resolution will finally result in a sound state ( ; N ; U ; β; k; D ), where D ≺ * D. Then Backtrack will be finally applicable. Corollary 1 (Satisfiable Clause Sets) Let N be a satisfiable clause set. Then any regular run without rule Grow will end in a stuck state, for any β.

	Lemma 10 Suppose there is a sound state ( ; N ; U ; β; k; D) resulting from a regular
	run where D / ∈ { ,

  are pairwise disjunct. Consider the rules 8.1-8.7. These rules are pairwise disjunct, if the sets {L 1 , ...,L n }, {comp(L 1 ), ..., comp(L n )} and {M i, j | i ≤ n} are pairwise disjunct. Obviously, {L 1 , ..., L n }∩{comp(L 1 ), ..., comp(L n )} = ∅. Furthermore ({L 1 , ..., L n }∪ {comp(L 1 ), ..., comp(L n )}) ∩ {M i, j | i ≤ n} = ∅follows directly from the definition of a trail induced ordering. 8.8 and 8.9 are disjunct since {L | L is of level 0} and {L | L is of level gr eater 0} are disjunct by Lemma 14. It follows that 8.1-8.9 are pairwise disjunct, since all relations in 8.1-8.7 contain only β-defined literals of level 1 or higher and all relations in 8.8, 8.9 contain at least one β-defined literal of level 0. 8.10 and 8.11 are disjunct since a literal cannot be both β-defined and β-undefined. It follows that 8.1-8.11 are pairwise disjunct, since all relations in 8.1-8.9 contain only β-defined literals and all relations in 8.10, 8.11 contain at least one β-undefined literal.

  Transitivity Suppose there exist literals L, K , H such that H ≺ * K and K ≺ * L but not H ≺ * L. We have several cases:1. Suppose all literals are β-undefined. Then K ≺ T L and H ≺ T K . Otherwise K ≺ * L and H ≺ * K would not hold. Thus also H ≺ T L by transitivity of ≺ T . Thus H ≺ * L by 8.10. 2. Suppose two literals are β-undefined. If K would be β-defined, then K ≺

* H by 8.11 contradicting assumption. If L would be β-defined, then L ≺ * K by 8.11 again contradicting assumption. Thus H has to be β-defined. Then H ≺ * L by definition 8.11. 3. Suppose one literal is β-undefined. If K would be β-undefined, then L ≺ * K by Definition 8.11 contradicting assumption. If H would be β-undefined, then K ≺ * H by Definition 8.11 again contradicting assumption. Thus L has to be β-undefined. Then H ≺ * L by Definition 8.11. 4. Suppose all literals are β-defined. Then we have multiple subcases:

  follows from above. In the second case max (H ) max (K ) has to hold. Thus H ≺ * L follows again. (c) Suppose that max (L) = L i where L i is of level 0. Since K ≺ * L, max (K ) = L j with L j of level 0 has to hold by 8.9 and 8.11. Now assume that L ≺ T K . Then L ≺ * K by 8.8 contradicting assumption. Thus K ≺ T L has to hold since K = L. Since H ≺ * K , max (H ) = L k with L k of level 0 has to hold by 8.9 and 8.11. Now assume that K ≺ T H . Then K ≺ * H by 8.8 contradicting assumption. Thus H ≺ T K has to hold since H = K . By transitivity of ≺ T , H ≺ T L and thus H ≺ * L has to hold.

[START_REF] Baumgartner | Superposition and model evolution combined[END_REF]

. Now by assumption H ≺ * K and K ≺ * L. If max (K ) ≺ max (H ) then K ≺ * H contradicting assumption. The same holds for L and K . Thus either max (H ) ≺ max (L) or max (K ) ≺ max (L). In the first case H ≺ * L

  by totality of ≺ T on ground literals. Thus by 8.10 L ≺ * K or K ≺ * L. 2. One is β-defined. Then either L ≺ * K or K ≺ * L by 8.11. 3. Both are β-defined. Then we have several subcases:

Auxiliary Lemmas for the Proof of Lemma 6 Lemma 16

  During a regular run, if ( ; N ; U ; β; k; ) is the immediate result of an application of Backtrack, then there exists no clause C ∈ N ∪ U and no substitution σ such that Cσ is β-false in .Proof We prove this by induction. For the induction start assume the state ( ; N ; U ∪ {D}; β; i; ) after the first application of Backtrack in a regular run, where D is the learned clause. Since Backtrack was not applied before, the previous (first) application of Conflict in a state ( , K ; N ; U ; β; k; ) was immediately preceded by an application of Propagate or Decide. By the definition of a regular run there is no clause C ∈ N with substitution σ such that Cσ is β-false in . Otherwise Conflict would have been applied earlier. By the definition of Backtrack, there exists no substition τ such that Dτ is β-false in . Since there existed such a substitution before the application of Backtrack, has to be a prefix of and = . Thus there exists no clause C ∈ N ∪ U ∪ {D} and a grounding substitution δ such that Cδ is β-false in .For the induction step assume the state ( ; N ; U ∪ {D}; β; i; ) after nth application of Backtrack. By i.h. the previous application of Backtrack did not produce any β-false clause. It follows that the the previous application of Conflict in a state ( , K ; N ; U ; β; k; ) was immediately preceded by an application of Propagate or Decide. By the definition of a regular run there is no clause C ∈ N ∪ U with substitution σ such that Cσ is β-false in . Otherwise Conflict would have been applied earlier. By the definition of Backtrack, there exists no substition τ such that Dτ is β-false in . Since there existed such a substitution before the application of Backtrack, has to be a prefix of and = . Thus there exists no clause C ∈ N ∪ U ∪ {D} and a grounding substitution δ such that Cδ is β-false in . If Conflict is applied in a regular run, then it is immediately preceded by an application of Pr opagate or Decide, except if it is applied to the initial state. ∨ L) ∈ N ∪ U and no grounding substitution σ such that (C ∨ L)σ is β-false in , comp(Lσ ) is a decision literal of level i in and Cσ is of level j < i.Proof Proof is by induction. Assume the initial state ( ; N ; ∅; β; 0; ). Then any clause C ∈ N is undefined in . Then this trivially holds. Now for the induction step assume a state ( ; N ; U ; β; k; D). Only Propagate, Decide, Backtrack and Ski p change the trail and only Backtrack adds a new literal to U . By i.h. there exists no clause with the above properties in N ∪ U .

	Corollary 2 Lemma 17 Assume a state ( ; N ; U ; β; k; D) resulting from a regular run. Then there exists
	no clause (C

  where C 1 σ m , ..., C n σ m are clauses from without the leading trail literal and Dσ = D σ m ∨ (s#t)σ . Since L is the defining literal of (s # t)σ there must exist at least one C i such that C i σ m = Cδ. If L is a propagated literal, then any literal in C i σ m is smaller than (s # t)σ , since they are already false in . If L is a decision literal, thenC i σ m = comp(L). Then comp(L) is smaller, since (s # t)σ = comp(L) and (s # t)σ = L. Thus comp(L) ≺ * (s # t)σ . Any other literal in C 1 σ m , ..., C n σ m is smaller in ≺ * ,since they are already defined in . Since Factori ze is not applicable (s # t)σ is also strictly maximal in D σ m . Thus (s m #t m ∨ C m )σ m ≺ * Dσ which makes Explore-Refutation applicable. Now by Lemma 19 it holds that if there exists an β-undefined literal in gnd ≺ T β (N ∪ U ), we can always apply at least one of the rules Propagate or Decide which makes a previously β-undefined literal in gnd ≺ T β (N ∪ U ) β-defined. Suppose a sound state ( ; N ; U ; β; k; D) resulting from a regular run where D / ∈ { , ⊥}. If Backtrack is not applicable then any set of applications of Explore-Refutation, Ski p, Factorize, Equality-Resolution will finally result in a sound state ( ; N ; U ; β; k; D ), where D ≺ * D. Then Backtrack will be finally applicable. Proof Assume a sound state ( ; N ; U ; β; k; D•σ ) resulting from a regular run. Let (s # t)σ ∈ Dσ such that L Factori ze is applicable. Suppose that it is applied. Then Dσ = (D ∨(s # t)∨L)σ , where Lσ = (s # t)σ . Then μ = mgu(s # t, L) and the new conflict clause is (D ∨ s # t)μσ ≺ * Dσ . Thus in this case we are done. If Factori ze is not applicable, then the only remaining applicable rules are Ski p, Explore-Refutation and Equality-Resolution. If = , L,

	Proof of Lemma 10

* (s # t)σ for all L ∈ Dσ . If (s # t)σ occurs twice in Dσ , then

Acknowledgements This work was partly funded by DFG Grant 389792660 as part of TRR 248, see https://

and organized by Projekt DEAL.

Conflict Assume Conflict is applicable. Then there exists a D σ such that D σ is β-false in . Then: Explore-Refutation Assume Explore-Refutation is applicable.

• 13.1-13:4 trivially hold by i.h. • 13.5: By definition (C j ∨ s j # t j )σ j is β-false in . By i.h. for all L σ l:

By definition of a refutation I j :=(s j #t j • σ j , s j #t j ∨ C j • σ j , I i , I k , p j ) either contains a clause annotation from , (s # t)σ k:(D ∨s # t)•σ or it is a rewriting inference from smaller rewrite steps for all 1 ≤ j ≤ m. Thus it follows inductively by Lemma 3 that

Factorize Assume Factorize is applicable. Then D = D • σ .

• 13.1-13.4: trivially hold by induction hypothesis.

Equality-Resolution Assume Equality-Resolution is applicable. Then D = (D ∨s ≈ s )σ and sσ = s σ , μ = mgu(s, s ). Then

Backtrack Assume Backtrack is applicable. Then = , K , and D = (D ∨ L)σ , where Lσ is of level k, and D σ is of level i.

• 13.1: By i.h. is consistent. Thus ⊆ is consistent.

Auxiliary Lemma for the Proof of Lemma 19

Lemma 18 Assume a clause L 1 ∨ ... ∨ L m , a trail resulting from a regular run starting from the initial state, and a reducible (by conv( )) grounding substitution σ , such that L i σ is β-false (β-true or β-undefined) in and L i σ ≺ T β for 1 ≤ i ≤ m. Then there exists a substitution σ that is irreducible by conv(

Proof Let L 1 ∨ ... ∨ L m be a clause, a trail resulting from a regular run. Let σ :={x 1 → t 1 , ..., x n → t n }. Now set σ :={x 1 → (t 1 ↓ conv( ) ), ..., x n → (t n ↓ conv( ) )}. Obviously σ is irreducible by conv( ) and L i σ ≺ T β for all 1 ≤ i ≤ m. By definition, conv( ) is a confluent and terminating rewrite system. Since is consistent, t j ↓ conv( ) ≈ t j is β-true in for 1 ≤ j ≤ n. Thus there exists a chain such that

Auxiliary Lemma for the Proof of Lemma 9 and Theorem 2

Lemma 19 Suppose a sound state ( ; N ; U ; β; k; ) resulting from a regular run. If there exists a C ∈ N ∪U and a grounding substitution σ such that Cσ is β-false in , then Conflict is applicable. Otherwise, if there exists a C ∈ N ∪ U and a grounding substitution σ such that Cσ ≺ T β and there exists at least one L ∈ C such that Lσ is β-undefined, then one of the rules Pr opagate or Decide is applicable and a β-undefined literal K ∈ D, where D ∈ gnd ≺ T β(N ∪ U ) is β-defined after application. Proof Let ( ; N ; U ; β; k; ) be a state resulting from a regular run. Suppose there exists a C ∈ N ∪ U and a grounding σ such that Cσ is β-false in , then by Lemma 18 there exists an irreducible substitution σ such that Cσ is β-false. Thus Conflict is applicable. Now suppose there exists a C ∈ N ∪ U and a grounding substitution σ such that Cσ ≺ T β and there exists at least one L ∈ C such that Lσ is β-undefined. By Lemma 18 there exists a irreducible substitution σ such that Lσ is β-undefined. Now assume that C = C 0 ∨ C 1 ∨ L such that C 1 σ = Lσ ∨ ... ∨ Lσ and C 0 σ is β-false in . Then Propagate is applicable. Let C 1 = L 1 , ..., L n and μ = mgu(L 1 , ..., L n , L). Now let [I 1 , ..., I m ] be the reduction chain application from to Lσ k:

, s m #t m σ m as well. If C 0 σ is β-undefined or β-true in then Propagate is not applicable to Cσ . If Decide is not applicable by definition of a regular run, then there exists a clause C ∈ (N ∪ U ) and a substitution δ such that Propagate is applicable. Then we can apply Propagate by definition of a regular run and a previously undefined literal gets defined after application as seen above and we are done. Now suppose that there exists no such clause. Then let [I 1 , ..., I l ] be the reduction chain application from to Lσ k+1:C•σ and I l = (s l #t l •σ l , (s l #t l ∨C l )•σ l , I j , I k , p l ). Then Lσ ↓ conv( ) = (s l #t l )σ l by definition of a reduction chain application. Thus Lσ is β-true in , (s l #t l )σ l . Since Lσ ↓ conv( ) = Lσ ↓ conv( ) by lemma 18, Lσ is β-true in , (s l #t l )σ l as well. (s l #t l )σ k+1:(s l #t l ∨comp(s l #t l ))•σ l l can be added to by definition of a regular run and also by definition of Decide since C ∈ N ∪ U , σ is grounding for C and irreducible in conv( ), Lσ is β-undefined in and Cσ ≺ T β.

Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.