• No results found

Prime implicate saturation methods will typically infer huge sets of clauses. It is thus essential to devise good data-structures for storing and retrieving the gen- erated clauses, in such a way that the redundancy criterion (i.e. i-subsumption or e-subsumption) introduced in Part I, Chapter 1 (see Definitions 1.17 and 1.23) can be tested efficiently. We devise for this purpose a tree data structure, called a clausal tree, specifically tailored to store sets of clauses while taking into account the usual properties of the equality predicate. The goal is to share common prefixes of stored clauses, in a way that allows redundancy elimination algorithms to be applied simultaneously on all shared literals. Clausal trees are similar to the tries presented Chaptericorresponding to the CLTMS algorithm [17]. In such trees, the clauses are represented by the branches, i.e., by the disjunction of the literals labeling the edges from root to leaf. To ensure that operations on trees and clauses are as simple as possible, and that literals are well shared, restrictions are added to the trees.

Definition 4.1 In E0 and in E1, a clausal tree is inductively defined as either

, or a finite set of pairs of the form (l, T0) where l is a literal and T0 a clausal tree. Intuitively, a pair (l, T0) represents an edge from the root of the tree to T0, labeled by literal l. In addition, a clausal tree T with (l, T0) ∈ T must respect the following conditions:

— for all l0 appearing in T0, l <πl01,

— there is no clausal tree T00 such that T006= T0 and (l, T00) ∈ T .

The set of clauses represented by a clausal tree T is denoted by C(T ) and defined inductively as follows: C(T ) =        {} if T =, [ (l,T0)∈T   [ D∈C(T0) l ∨ D   otherwise. ♦ 1. For the definition of <π, see Definitionii.10

Remark 4.2 By considering propositional literals instead of equational ones, the definition of a clausal tree becomes that of a propositional trie.

Remark 4.3 Employing the ordering <π to constrain the order in which literals

occur along the branches of the trees has two uses

— it limits the number of repetitions of the same literal,

— it simplifies the application of the redundancy elimination algorithms pre- sented in the subsequent chapters.

The first point can be enforced using any total ordering on literals, but to ensure the second point, the use of <π is a necessity.

As the definition implies, leaves can be either or ∅, but in practice if a leaf is ∅ then the corresponding branch is irrelevant because by definition the trees T and T0, where T0is T without the branches containing ∅, are such that C(T ) = C(T0). In other words, a pair (l, ∅) can be deleted from the tree without affecting C(T ). The only exception is the empty tree, in which the root is labeled with ∅. Note that by definition C(∅) = ∅.

A functions describing the size of a tree is defined. Definition 4.4 Let T be a clausal tree.

size(T ) =    0 if T =, X (l,T0)∈T 1 + size(T0) otherwise. ♦ Example 4.5 The structure T in Figure 9 is a clausal tree in E0 with the

constant ordering a ≺ b ≺ . . . . For readability the labels are associated with the nodes rather than with the edges leading to them.

T b ' a c ' a b 6' a c ' a d 6' c e ' c c ' a

The represented clauses C(T ) are: b 6' a ∨ d 6' c ∨ c ' a b 6' a ∨ d 6' c ∨ e ' c b 6' a ∨ c ' a b ' a ∨ c ' a

Figure 9 – A clausal tree in E0

Formally, this tree is defined as {(b 6' a, T00), (b ' a, T0)}, with T0= {(c ' a, )}

T b ' a f (a) ' c g(b) 6' a f (d) 6' f (c) g(e) ' c c ' a f (a) ' c

The clauses in C(T ) are: g(b) 6' a ∨ f (a) ' c

g(b) 6' a ∨ f (d) 6' f (c) ∨ c ' a g(b) 6' a ∨ f (d) 6' f (c) ∨ g(e) ' c b ' a ∨ f (a) ' c

Figure 10 – A clausal tree in E1

Example 4.6 The structure T in Figure10is a clausal tree in E1with the term

order a ≺ b ≺ c ≺ g(c) ≺ g(e) ≺ f (c) ≺ f (d). Again the labels are associated with the nodes rather than with the edges leading to them.

Definition 4.7 In E0 and in E1, a clausal tree is in normal form (or simply

normal) if all the clauses in C(T ) are in normal form. In E0, it is possible to impose additional conditions on clausal trees in order to

ensure that the represented clauses are in normal form.

Proposition 4.8 In E0, a clausal tree T is a normal clausal tree iff for any

pair (l, T0) in T , all the following conditions hold: — l is not of the form a ' a or a 6' a,

— if l = a 6' b with a ≺ b then b does not occur in T0, — T0 is a normal clausal tree.

It is easy to see that if T verifies the conditions of the previous proposition then all the clauses in C(T ) are in normal form. The tree of Example 4.5 satisfies these requirements. For example the constants b and d do not occur below the literals b 6' a and d 6' c respectively. In E1, the more complex definition of

the clausal normal form prevents us from defining simple syntactic criteria for normal clausal trees.

Notation 4.9 Let C be a clause in normal form in E0or E1and T be a normal

clausal tree such that ∀D ∈ C(T ), C ∨ D is in normal form and ∀l ∈ D, C <πl.

In this case, C.T denotes the clausal tree such that: if C = then C.T = T , otherwise C.T = {(l1, C0.T )} where C = l1∨ C0 and l1= min

{l ∈ C}. Notation 4.10 We extend the notation [a/b] to trees: For any tree T , T [a/b] denotes the tree obtained from T by replacing all occurrences of b by a. Note that this replacement may interfere with the ordering constraints imposed on clausal trees, hence >[a/b] may not be a clausal tree even if T is one.

No matter the logic or the nature of the clauses, there are three main opera- tions on clausal trees. The first one consists in checking whether a new clause is redundant w.r.t. an existing one already stored in a clausal tree. In propositional logic, this operation corresponds to Algorithm2

Algorithm 2 isEntailedProp(C, T )

Require: C is a propositional clause and T is a trie.

Ensure: isEntailedProp(C, T ) = > ⇔ ∃D ∈ C(T ), D subsumes C 1: if T = then 2: return > 3: end if 4: if C = then 5: return ⊥ 6: end if 7: m1← min

< {m ∈ C} // given <, an ordering on propositional literals

8: T1← {(p, T0) ∈ T | p = m1} 9: T2← {(p, T0) ∈ T | m1< p} 10: return W (p,T0)∈T 1 isEntailedProp(C \ {m1}, T0) ∨ W (p,T0)∈T 2 isEntailedProp(C \ {m1}, (p.T0))

The second one removes from a clausal tree all clauses that are redundant w.r.t. a given clause. In propositional logic, this action is realized by Algorithm 3

Algorithm 3 pruneEntailedProp(C, T )

Require: C is a propositional clause, T is a trie and isEntailedProp(C, T ) = ⊥.

Ensure: ∀D ∈ C(pruneEntailedi0(C, T )), C does not subsume D.

1: if C = then 2: return ∅ 3: end if 4: if T = then 5: return T 6: end if 7: m1← min

< {m ∈ C} // given <, an ordering on propositional literals

8: T1← {(p, T0) ∈ T | p = m1}

9: Tout1← {(p, pruneEntailedProp(C \ {m1} , T0))|(p, T0) ∈ T1}

10: T2← {(p, T0) ∈ T | p < m1}

11: Tout2← {(p, pruneEntailedProp(C, T0))|(p, T0) ∈ T2}

12: return Tout1∪ Tout2∪ (T \ (T1∪ T2))

operation is straightforward and thus will not be described here. On the other hand, the first two operations are not trivial and significantly more complex in equational logic than in propositional logic. Thus they are carefully described in the remaining chapters of this part of the thesis. So as to expose all the variants of these manipulations, the algorithms are presented once for E0 and

i-subsumption, and a second time for E1 and e-subsumption. This choice is

justified by the fact that i-subsumption is the redundancy criterion associated with the K-paramodulation calculus (presented in Part I, Chapter 2), that is only defined in E0, while e-subsumption, associated to the cSP calculus (pre-

sented PartIChapter3) is useful both in E0and E1. Although cSP manipulates

c-clauses, for simplicity we present the algorithms for standard clauses both in E0 and in E1. The final chapter of this part is dedicated to the extension of the