UNIVERSITY OF ILLINOIS LIBRARY AT URBANA-CHAMPAIGN CENTRAL CIRCULATION AND BOOKSTACKS The person borrowing this material is re- sponsible for its renewal or return before the Latest Date stamped below. You may be charged a minimum fee of $75.00 for each non-returned or lost item. Theft, mutilation, or defacement of library materials can be causes for student disciplinary action. All materials owned by the University of Illinois Library are the property of the State of Illinois and are protected by Article 16B of Illinois Criminal Law and Procedure. TO RENEW, CALL (217) 333-8400. University of Illinois Library at Urbana-Champaign OEC l jooo When renewing by phone, write new due date below previous due date. L162 Digitized by the Internet Archive in 2013 http://archive.org/details/theoremprovingwi965plai Ct1p .2- UIUCDCS-R-79-965 UILU-ENG 79 1711 Theorem Proving with Abstraction, Part II by David A. Plaisted March 1979 DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN URBANA, ILLINOIS Theorem Proving with Abstraction, Part II David A. Plaisted University of Illinois at Urbana-Champaign Address: 222 Digital Computer Laboratory Department of Computer Science University of Illinois Urbana, Illinois 61801 This research was supported in part by the National Science Foundation under Grant MCS 77-22830. Abstract The concept of an abstraction was defined in Part I of this paper, and some theorem proving strategies based on abstraction were presented. The basic idea is to use the solution of a simple "abstracted" problem as a guide to the solution of a more complicated problem. This idea was formalized to yield a wide class of complete theorem proving strategies for the first-order predicate calculus. In part II, m-abstractions are defined, and their advantages are discussed. They operate on "multi clauses" , which are multisets of literals. Several elegant strategies based on m-abstractions are pre- sented. Next, bounded multiclauses are introduced, together with abstractions on them. These have most of the advantages of ordinary multiclauses, but restrict the size of the abstracted search space more. All strategies considered in Part II are complete. Finally, some new classes of abstraction and m-abstraction mappings are pre- sented. Table of Contents 1. Introduction 1 2. M-resolutions and m-abstractions 3 2.1 Examples of m-abstractions 7 2.2 M-abstractions of m-resolution proofs 9 3. A complete strategy for a single m-abstraction 12 4. Using more than one m-abstraction at the same time 19 4.1 A strategy without matching 20 4.2 A strategy with matching 22 5. Bounded m-clauses 32 5.1 Bounded m-resolution 34 5.2 Bounded m-abstractions 36 6. Interval multisets 39 7. Partitioned semantic abstractions 41 8. Other abstractions 42 9. Conclusions 44 10. References 46 -1- 1. INTRODUCTION In Part I of this paper, we introduced the concept of an abstraction. We also introduced a complete theorem proving strategy for the first-order predicate calculus. This strategy uses an ab- straction to map a given problem onto a simpler problem, and attempts to invert the mapping to obtain solutions to the original problem from solutions to the simplified problem. Abstractions are defined as a class of mappings possessing a few simple mathematically specified properties. We exhibited some sample abstraction mappings, and gave general methods for obtaining many more. In Part II, we extend the concept of abstraction to "multi- clauses", which are multisets of literals. That is, we allow a literal to occur more than once in a multi clause. This added complexity allows much simpler strategies than we could obtain for ordinary clauses. The concept of abstraction is adapted to multiclauses to obtain the "m-abstraction" mappings. These mappings have properties similar to those of abstraction mappings. We present some examples of m-abstraction mappings, and give general methods for obtaining more. One advantage of m-abstraction mappings and multiclauses is that several such mappings can be used together in a natural way in the search for a proof. We also present "bounded multiclauses" and strategies and abstractions related to them. The advantage of bounded multiclauses is that the size of the abstracted search space is smaller than for ordinary multiclauses. In fact, in certain useful special cases, the size of the abstracted search -2- space is finite. Finally, we present more methods of obtaining m-abstraction mappings (and corresponding mappings for bounded m-clauses). Part I of this paper, except for sections 2.7 and 2.8 of Part I, is a prerequisite for Part II. We use similar notation as in Part I. In particular, the programming constructs are the same. For loops, we use loop - • • while ' • - repeat and loop - • - until • • - repeat , where the while clause and the until clause can occur at the beginning or at the end of the loop. We also use the fairly standard if- • - then - • • else ---fi and do'-'od constructs. For existential formulae, expressions of the form there exists x, , x,,, . . . , x such that A(x, , x ? , . . . , x ) are used. Here A is a Boolean-valued expression involving the program variables x, , x ? , . . . , x . The construct there exists x, , x ? , . . . , x such that A(x, , x 2 , ..., x ) has a Boolean value, which is the truth value of the formula 3X-,3X 2 ...3X A(x-, , x 2 , ..., x ). Also, if 3x-j3x 2 ...3x A(x-|, Xp, ..., x ) is true, the program variables x-, , x^, ..., x are given values making A(x-, , x 2 , ..., x ) true. In this way we can specify searches without specifying the details of the search. Thus we can write statements like if there exist x, , x , ..., x„ such that 12 n A(x, , x^, . . . , x ) then [do something with x-, , x 2 , . . . , x ] else • • • fi_. -3- 2. M-RESOLUTIONS AND M-ABSTRACTIONS Definition : A multiset M is a set S together with a function g mapping S into the set of positive integers. We refer to S as Set(M) and for x e S, g(x) is denoted by mult(x, M). By convention, mult(x, M) = if x t S. Intuitively, a multiset is a set in which elements can occur more than once. For x e S, mult(x, M) tells "how many times" x occurs in M. We write M as {n,*x, , ..., n *x, } where mult(x, M) = I. n.. II k k J J Also, l*x is written as x. x j~ x We often regard an ordinary set A as a multiset M in which each element of A occurs exactly once, and in which no other elements occur. The size |M| of a multiset M = {n,*x,, ..., n i < * x | < ^ 1S defined to be En.. i=l ] Definition : If Ml and M2 are multisets, then their union Ml w M2 is defined by mult(x, Ml w M2) = mult(x, Ml) + mult(x, M2). Their intersection Ml ffl M2 is defined by mult(x, Ml * M2) = min(mult(x, Ml), mult(x, M2)). Their difference Ml - M2 is defined by mult(x, Ml - M2) = min(0, mult(x, Ml) - mult(x, M2)). Sometimes we write * as u. Note that Set(Ml w M2) = Set(Ml) u Set(M2). Definition : If Ml and M2 are multisets, then we write Ml c M2 (Ml is a sub-multiset of M2) if for all x, mult(x, Ml) ^mult(x, M2). Definition : If M is a multiset and g is a mapping from Set(M) into a set N, then g(M) = «Ug(x)}. Thus mult(y, g(M)) = £ x mult(x, M), XeM ' f(x)=y •4- and |g(M)| = |M|. Note that for multisets Ml and M2, g(Ml - M2) = g(Ml) - g(M2). This is not true of ordinary sets, however. Definition : A mul ticlause (or m-clause) is a multiset of literals. That is, with each literal in the clause, a multiplicity is kept, which is a positive integer telling how many times the literal occurs in the multiclause. We can write a multiclause by writing each element the number of times it occurs in the multiclause. Thus {P, P, Q} is a multiclause in which the multiplicity of P is 2 and the multiplicity of Q is 1. Definition : If C is a multiclause and a is a substitution, then Ca is {La:L e C} where La is counted the right number of times. That is, mult (LI, Ca) = Z, - . _.,mult(L, C). Thus |Ca| = |C|, and if C = {!_,, L„, ..., L n ) then Ca = {L,a, L,,a, ..., La}. Example : Suppose C is (P(x), P(c), Q(x)}. Suppose a is {x +■ c}. That is, a replaces x by c. Then Ca is (P(c), P(c), Q(c)}. Note that the literal P(c) occurs twice in Ca. Definition : Suppose CI and C2 are multiclauses. Suppose Al c CI and A2 c C2. (This means that ewery literal occurs no more times in Al than in CI, and similarly for A2.) Suppose there exist substitutions al and a2 such that for some literal L, Set(Alal) = {L} and Set(A2a2) = {L}. Let al and a2 be most general such substitutions. Then (CI - Al)al * (C2 - A2)a2 is an m-resolvent of CI and C2. (Recall the definition of CI - Al for multisets CI and Al , and similarly for C2 - A2.) -5- Examples: Suppose CI is (P(a), P(x)} and C2 is {P(a)L Then {P(x)}, (P(a)} and NIL (the empty multiset) are m-resolvents of CI and C2. Suppose CI is {P, P} and C2 is {P, Q, Q}. Then the following are the m-resolvents of CI and C2: {P, Q, Q) {Q. Q>. Ordinary clauses can be viewed as multiclauses in which the multiplicity of each literal in the clause is 1. We have the following results concerning the relation of m-resolution to ordinary resolution. Theorem 2.1 : Suppose C3 is an ordinary resolvent of clauses CI and C2. Suppose Dl and D2 are m-clauses such that Set(Dl) = CI and Set(D2) = C2. Then there is an m-resolvent D3 of Dl and D2 such that Set(D3) = C3. Theorem 2.2 : Suppose clause C is derivable from set S of clauses by ordinary resolution. Then there is an m-clause D derivable from S by m-resolution such that Set(D) = C. (In the derivation of D, we consider the clauses of S to be m-clauses). Note that if C = NIL then D = NIL also. Theorem 2.3 : Suppose m-clause D3 is an m-resolvent of m-clauses Dl and D2. Then some ordinary resolvent of Set(Dl) and Set(D2) subsumes Set(D3). Theorem 2.4 : Suppose S is a set of clauses, and m-clause D is derivable from S by m-resolution. (For this derivation, we consider the clauses of S to be m-clauses.) Then there is an ordinary clause C -6- derivable from S by ordinary resolution, such that C subsumes Set(D). Definition : An m-abstraction is a mapping f from multi- clauses to (ordinary) sets of multiclauses , satisfying the following properties: 1. If C3 is an m-resolvent of CI and C2, and D3 e f(C3), then there exist Dl e f (CI ) and D2 e f(C2) such that D3 is an m-resolvent of Dl and D2. 2. f(NIL) = {NIL}. Notice how much simpler the properties of m-abstractions are than those of ordinary abstractions. The following two results, analogous to Theorems 2.1 and 2.2 of Part I for ordinary abstractions, show that m-abstractions are also easy to construct. Theorem 2.5 : Suppose is a mapping from literals to literals. Let us extend to a mapping from multiclauses to multiclauses as follows 0({n 1 *L r n 2 *L 2 , ..., n^}) = {n 1 *0(L 1 ), n 2 *0(L 2 ), ..., n k *0(L k )}. Thus |0(C)| = |C|, but need not be one-to-one. Suppose satisfies the following properties: 1. 0(L) = 0(L) for all literals L. 2. If the multiclause D is an instance of the multiclause C, then 0(D) is an instance of 0(C). Then the mapping f defined on multiclauses by f(C) = {0(C)} is an m-abstraction mapping. Proof : Similar to the proof of theorem 2.1 of Part I. -7- Theorem 2.6 : Suppose F is a set of mappings from literals to literals. For each e F, extend to a mapping from multiclauses to multiclauses as in the preceding theorem. Suppose that for all e F, 0(L) = 0(L) for all literals L. Suppose also that if multiclause D is an instance of multiclause C, then for all 02 e F there exists 0-j e F such that 02(D) is an instance of 0-,(C). Define mapping f on multiclauses by f(C) = {0(C) :0 e F}. Then f is an m-abstraction mapping. (Note that f(C) is an ordinary set of multiclauses.) Proof: Similar to the proof of Theorem 2.2 of Part I. If f is an m-abstraction as in this theorem, then we say f i s defined in terms of literal mappings . Theorem 2.7 : If f is an m-abstraction defined in terms of literal mappings, then f also satisfies the following property: For all multiclauses CI and C2, if CI subsumes C2 , then for all D2 e f(C2) there exists Dl E f (CI ) such that Dl subsumes D2. (For multiclauses, we say Dl subsumes D2 if there exists a substitution 6 such that Die c D2, that is, for all L e Die, mult(L, Die) <_mult(L, D2).) This result will be useful later on in obtaining strategies to test if an m-clause is a logical consequence of a set of m-clauses. 2.1 Examples o& M- AbA&UMitionA These m-abstractions are obtained from the abstractions pre- sented in Section 2.1 of Part I, by counting each literal the right number of times. -8- 1 . Tk then f(C) is {D} where D is the m-clause {L, ' , L ? ', ..., Lj/h and L. ' is obtained from L. by deleting all arguments of the predicate symbol. Thus if L. is P(t,, ..., t ) then L^ is P and if L. is P(t ] , ... , t ) then L. ' is P. Similarly, we can define m-abstractions based on renaming of predicate or function symbols, changing the signs of literals, changing the order of the arguments of various function or predicate symbols, or removing arguments from various function or predicate symbols. Note as before that the renaming of function and predicate symbols need not be 1 - 1. That is, the names of two distinct predicate symbols can be made the same, and similarly for function symbols. 3. A ^mantle m-abi traction. Suppose I is an interpretation of the set of clauses over some set of function and predicate symbols. Let V be the domain of the interpretation 7. With each ground literal L we associate a literal L' as in the definition of semantic abstraction from Part I. With a ground m-clause C = {L,, ..., L. } we associate the m-clause {L^ 1 , ..., I_ k ') where L. ' is associated with L. as indicated above. Note that \C \ = |C|. If CI is an arbitrary m-clause, then f (CI ) = {D:D is associated with C for some ground instance C of CI}. Thus if I is the usual interpretation of the integers, then {3 < 3, 3 < 3} ■9- is an m-abstraction of {x £ y , y <_ x). We call f the m-abstraction obtained from I. As before, semantic m-abstractions seem to be parti cularly useful when the domain V is finite, because then f(C) is a finite set of multiclauses for all C. We can define the composition f,fp of m-abstractions f. and fp, and show as before that it is an m-abstraction if f, and f ? are. Also, the union of two m-abstractions is an m-abstraction. Moreover, it is easy to show that if f-, and f ? are m-abstractions defined in terms of literal mappings, then the union and composition of f, and f ? are also defined in terms of literal mappings. Inverses of m-abstractions can be defined (if they exist). An m-abstraction which has an inverse really hasn't thrown away any information. Perhaps it should be called an m-isomorphism. 2.2 M- Ab6tAactloyi6 ofa M-ReJuoluution ?Kooli> We now indicate how m-abstractions can be used to guide the search for a proof of an m-clause C from a set S of m-clauses. We omit some details because the development is analogous to that for ordinary abstractions. The concepts of an m-abstraction proof, the depth of an m-abstraction proof, et cetera are defined in a way analogous to the way these concepts were defined for ordinary resolution. We denote the nodes of an m-resolution proof V by Nodes(V) as before, and denote the m-resolutions of V by MRes(V). An m-resolution of V is a triple < Nl , N2, N3> of nodes of V such that label (N3) is an m-resolvent of the m-clauses label (Nl) and label (N2). We require that if -10- e MRes(V) then e MRes(V), as before. Also, if Ml and M2 are two relations between multi clauses and VI and V2 are two m-resolution proofs, we define (Ml; M2)(V1, V2) as before. We abbreviate (M; M)(V1, V2) as M(V1 , V2). If f is an m-abstraction mapping and S is a set of m-clauses, we write f(S) to denote the set r u f(c). Note that f(S) is an ordinary set of multiclauses. Leo • Theorem 2.8 : Suppose V2 is an m-resolution proof of m-clause C from set S of multiclauses. Suppose f is an m-abstraction mapping, and D' e f(C). Let M(D, C) be the relation "D e f(C)". Then there is an m-resolution proof VI of D' from f(S) such that M(V1 , V2) is true, This is a much better result than for ordinary abstractions. Also, the depth of VI is the same as the depth of V2. This result relates to ordinary resolution in the following way: Suppose clause C is derivable from set S of clauses by ordinary resolution. Suppose f is an m-abstraction mapping. Then there exists an m-clause CI such that Set(Cl) = C, and such that for all D £ f(Cl), D is derivable from f(S) by m-resolution. Later we discuss how m-abstractions can help to find ordinary resolution proofs of clauses other than NIL. Examples 1. Consider the following m-resolution proof: (This is also an ordinary resolution proof) P(a), P(b), 0(c) P(a) \_ / P(b), R(d) P(b), Q(c) \ / Q(c), R(d) -11- This example is the same as Example 2 of Section 2.4 of Part I. If we use the propositional m-abstraction, we obtain the following m-abstracted proof: P.P.Q P \/ P,R P,Q \/ Q.R 2. Consider the following m-resolution proof, taken from Example 3 of Section 2.4 of Part I: (This is also an ordinary resolution proof. ) P(a), P(b), Q(c) P(a) \ / Q(c), Q(b) P(b), Q(c) . / P(b), Q(b) Using the propositional m-abstraction, we obtain the following m-abstracted m-resolution proof: P.P.Q P Q,Q P,Q \ / P,Q -12- 3. A COMPLETE STRATEGY FOR A SINGLE M-ABSTRACTION We define the procedure "ndfindm" analogous to "ndfind" of Part I but for mul ticlauses and m-resolution. This procedure uses m-abstracted proofs as a guide in the search for an m-resolution proof. Suppose f is an m-abstraction mapping. Let M(D, C) be the relation "D e f(C)". We are given an m-resolution proof V from f(S), and want to find all proofs V2 from S such that M(V, V2) is true. With each node N of V, we keep a set m-clauses(N) of m-clauses derived from S by m-resolution. procedure ndfindm(V, S, f); [[assume that m-clauses(N) = {C e S: label(N) e f(C)} for all initial nodes N of V, and m-clauses(N) = for all non-initial nodes N of V] loop while ( there exist nodes Nl , N2, N of V and m-clauses CI, C2, C such that 1. e MRes(V) 2. CI e m-clauses(Nl) and C2 e m-clauses(N2) 3. C is an m-resolvent of CI and C2 4. C £ m-clauses(N) 5. label(N) e f(C)); add C to m-clauses(N); re peat end ndfindm; It is not difficult to show that when "ndfindm" exists, then for all nodes N in V, m-clauses(N) will contain exactly the m-clauses C having the following property: -13- There exists a minimal proof VI from f(S) such that VI is an initial sub-proof of V, and such that N is the unique terminal node of VI, and there exists an m-resolution proof V2 from S such that M(V1, V2) is true, and such that C = Result(V2). See figure 1. Recall that M(D, C) is the relation "D E f(C)". In addition, if W is any m-resolution proof from S such that M(V1 , W) is true for some initial sub-proof VI of V, then W is isomorphic to an initial sub-proof of the m-resolution proof generated by "ndfindm". We could also define a depth-first search procedure analogous to the procedure "findclauses" of Part I. VI i f(S) M Clauses generated by "ndfindm" Figure 1 In order to analyze the procedure "ndfindm" and related procedures, we introduce the concept of the m-abstraction of an m-resolution proof. Definition : Suppose S is a set of multiclauses and T is an m-resolution proof from S. Suppose f is an m-abstraction mapping. Let M(D, C) be the relation "D e f(C)", as before. Then we say T t U -14- if U is an m-resolution proof from S such that M(U, T) is true. In Theorem 2.8 we stated that some such U exists. Possibly more than one such proof U will exist. Note that if T ~t U then the depth of U is the same as the depth of T. We have the following result: Theorem 3.1 : Suppose T is a minimal m-resolution proof of an m-clause C from a set S of m-clauses. Suppose f is an m-abstraction mapping. Then for every m-clause D' in f(C'), there exists an m-resolution proof U from f(S) such that T ~t U and such that Result(U) is defined and equal to D 1 . Suppose T is an m-resolution proof of m-clause C from set S of m-clauses. Suppose U is an m-resolution proof from f(S) such that T ~t U. Suppose U is an initial sub-proof of V. Then if ndfindm(V, S, f) is called, it will actually generate a proof of C. (In fact, it will generate a proof isomorphic to T.) Note that this is an improvement over the situation for ordinary abstractions. A similar result is true for the procedure "findclauses" , adapted to m-abstractions and m-resolutions Also, if T has depth d then U will have depth d. Therefore, if we want to see if a proof of C exists at depth d, we can choose some m-clause D' in f(C') and need only call ndfindm(V, S, f), where V contains all proofs U from f(S) such that U is of depth d and such that D' is the unique terminal clause of U. This idea is the basis of the following complete theorem proving strategy based on m-abstractions. The generation of V and VI in this procedure is similar to the generation of V and VI in "proofsearchl" of Part I, and notation is similar. In particular, nodes of V and VI are 15- of the form < Dl , d, >, where Dl is an m-abstraction of some m-clause and d, is an integer giving the depth of the node. If N = < Dl , d, > then we write label (N) = Dl and depth(N) = d, . The proof VI is con- structed so that if U is any minimal m-resolution proof of D' from f(S) such that U has depth d, then U is isomorphic to an initial sub-proof of VI. procedure proofsearch2(S, C , f); llattempt to construct a proof of C from S using m-abstraction mapping f. This is a complete theorem proving strategy. 1 choose D' in f (C ) ; SI +■ {(D, 0> (3C e S)D e f(C)}; for all (D, 0) e SI do m-clauses(< D, 0>) +■ {C e S: D e f(C)} od; for d = 1 to °° until C is generated from S do_ Hook for a proof of C from S of depth d] let V be the smallest m-resolution proof such that a) SI c Nodes(V) b) If < Bl , d, > e Nodes(V) and < B2, d > e Nodes(V) d 2 ); and d-, < d and d ? < d and B3 is an m-resolvent of Bl and B2 theh e Nodes(V) and < , , > e MRes(V) where d 3 = 1 + max(A 1 , let VI be the smallest sub-proof of V such that a) If < D' , d> e Nodes(V) then < D' , d> e Nodes(Vl) b) If e MRes(V) and N3 e Nodes(Vl) then Nl e Nodes(Vl) and N2 e Nodes(Vl) and < Nl , N2, N3) e MRes(Vl); II note: V can be found by exhaustive search and VI can be obtained by deleting nodes and m-resolutions from V. Possibly VI can be obtained by applying more levels of m-abstraction, also. J for all new non-initial nodes N of VI do m-clauses(N) +■ od; ffall initial nodes of VI will be in SI and so will have m-clauses assigned! ndfindm(V, S, f) Od; -16- Since m-abstracted m-clauses will usually be simpler than the original m-clauses, we would expect the construction of V to be easier than an exhaustive search for a proof of C from S. If the search for a proof of D 1 from f(S) is too complicated to do directly, another m-abstraction mapping can be applied to f(S) to direct the search for a proof of D'. Extending this idea, we can see that any number of "levels of m-abstraction" can be used together in the search for a proof. As before, we cannot do tautology deletion or subsumption dele- tion on m-clauses generated from f(S) by m-resolution. The only allowable deletion strategy is to delete variants of an m-clause that has already been derived. However, as with "proofsearchl ", any complete theorem proving strategy can be used in the original space, as long as the abstracted space is generated exhaustively. For example, we can restrict "ndfindm" in proofsearch2 so that it only generates resolvents from S according to some complete m-resolution strategy. Thus the search from S would be restricted both by the m-resolution strategy and by the abstracted search space. One promising strategy would be locking resolution, adapted to m-clauses in the appropriate way. It is also possible to restrict the abstracted search space according to some complete strategy, if the m-abstraction satisfies certain properties. For example, if the m-abstraction is defined in terms of literal mappings and preserves signs of literals, then the m-abstraction of a Pl-deduction [l ] will always be a Pl-deduction, and so we can use Pl-deduction in both the original space and in the abstracted space. Also, if the indices of the 17- literals are assigned properly, we can do Tocking resolution in both the original space and in the abstracted space, for m-abstractions defined in terms of literal mappings. Finally, if the m-abstraction is defined in terms of literal mappings such that the predicate symbol of 0(L) is the same as the predicate symbol of L, then we can do m-resolution with ordering of predicate symbols in the original space and in the abstracted space. That is, the predicate symbols are linearly ordered, and in each m-resolution, the literals resolved away must have predicate symbols that are maximal in each clause in the ordering. If the m-abstraction is defined in terms of literal mappings that preserve both signs and predicate symbols of literals, then various combinations of hyper-resolution [1] and ordering can be done in both the abstracted space and in the original space. The improvement to be gained by the use of such complete strategies is probably small compared to the improvement to be gained by the use of m-abstractions. However, even if the strategies only help by a factor of 2 or 3, that will be significant. Notice that the search space will tend to get smaller as the depth of inference approaches the maximum depth d. This is because the abstracted m-clauses near depth d will be restricted to m-clauses from which D' can be derived in a small number of steps. Thus the m-clauses derived from S at depths near d will also be restricted. This restriction of the search space near the maximum depth contrasts greatly with the behavior of most uniform proof procedures, for which the size of the search space gets larger and larger as the depth of inference increases. At -18- intermediate depths, the size of the search space will probably be the largest. The strategies "proofsearch3" and "proofsearch4", to be presented later, also restrict the search space as the depth of inference approaches its maximum value, as does the strategy "proofsearchl" presented in Part I Another property of strategies based on abstraction is that they automatically choose which m-clauses of S appear to be "relevant" to the problem at hand. That is, an m-clause C of S will not even be used at all unless some abstraction D of C appears in a depth d proof of D' from f(S). Therefore, strategies based on abstraction may be useful when there are many input clauses. We now discuss methods of using more than one m-abstraction at the same time in the search for a proof. -19- USING MORE THAN ONE M-ABSTRACTION AT THE SAME TIME Definition : Suppose M is a predicate on k-tuples of m-clauses. That is, if C, , Cp, ..., C, are m-clauses, then either M(C, , C ? , ..., C.) is true or M(C,, Cp, ..., C. ) is false. We extend M to a predicate on k-tuples of m-resolution proofs in the following way: Suppose U, , IL, ..., U. are m-resolution proofs. Then M(U, , U ? , ..., U.) is true iff all U. are of the same shape and there exist shape correspondences y between U. and U.j, such that for all nodes N, in U , , ..., N, in U. , if li + l 1 1 ' k k N ] * N 2 and Np £ N 3 and ... and N |( _ 1 k % N k then M(label(N,), label (Np), ..., label (N,)) is true. Note that if M, and Mp are relations such that M-j(C-|, ..., C k ) 3 M 2 ( C-. , ..., C.) for all m-clauses C-, , ..., C^, then M, (U,, ..., U.) D M 2 (U-|, ..., U.) for all m-resolution proofs U, , ..., U. . Let f be an m-abstraction mapping, and let M(D, C) be the relation "D e f(C)" on m-clauses. We know that if T t U then M(U, T) is true. Suppose f , , f ? , ..., f^ are m-abstraction mappings. Let U, , U 2 , ..., U. be m-abstraction proofs such that T ? U. for 1 < i < k. Let M'(D 1S D 2 , ..., D k ) be the relation (3C)[D e f^C) and ... and D k £ f k (C)]. Then it is not difficult to show that M'CU^ Up, ..., U k ) is true. This suggests a search strategy. Suppose we are looking for a proof of m-clause C from set S of m-clauses. Choose D . ' e f-(C) for 1 < i < k. Find proofs U. of D-' from f.(S) such that M' (U-, , Up, ..., U k ) is true. It seems unlikely that such proofs U. would exist unless a corresponding proof of C from S exists. If such proofs U. are found, use them to guide the search for a proof T of C from S. ■20- The relation M' may be too difficult to compute. However, there will often be other relations M, ' that are easy to compute, such that M'(D 1S D 2 , ..., D k ) implies M-j ' (D-j , D 2 , ..., D R ). We can then look for proofs U.. , ..., U, such that M ' (U, , ..., U.) is true. For example, M'(D,, ..., D.) can specify that |D, | = |D«| = ... = |D.|. This will work if all the f. are defined in terms of literal mappings. If the f . preserve numbers of various predicate symbols for 1 <_ i £ k, then M, ' (D-, , Dp, ..., D. ) can specify that all D. have the same number of literals with various predicate symbols. If the f. preserve signs and predicate symbols of literals, this can also be reflected in M, ' . If T + U. for 1 < i <_ k, then M-. * (U, , ..., U.) will be true. Therefore we can look for proofs U. of D. ' from f. (S) such that M, ' (U, , ..„, U.) is true, and use these proofs to guide the search for a proof of C from S. This will still yield a complete theorem proving strategy. Note that if T+ U. then the depth of the proof T is the same as the depth of lh for all i , 1 £ i £ k. This fact can be used to search for proofs T in order of increasing depth. As before, if the search for proofs D. ' from f. (S) is still too hard, more levels of abstraction can be used. 4.1 A StAatngy Without Mcutcking The following procedure uses more than one m-abstraction at the same time in the search for a proof. However, it does not match the m-abstracted proofs up with each other beforehand. That is, we do not test whether all the m-abstracted proofs have the same shape, and -21 satisfy the appropriate relation on proofs. This saves the effort needed to do the matching, but probably increases the size of the search space. Even so, this procedure should have a smaller search space than "proofsearch2" , which only uses one m-abstraction. procedure proofsearch3(S, C , {f, , f,,, ..., f }); II search for a Droof of C from S using the set {f-,, ..., f } of (not necessarily distinct) m-abstractions. This is a complete strategy.] for i = 1 to_ n do choose D. ' in f • (C ) od; for i - 1 to n do S. «- { : (3C e S) D e f.(C)} od; for d = 1 to °° unti 1 C is derived from S (to Hook for a proof of depth d] for i = 1 to n do V, 1 *- the smallest m-resolution proof such that a) S. c Nodes(V 1 1 ) and b) if e Nodes^ 1 ) and d, < d and d 2 < d and D3 is an m-resolvent of Dl and D2, then < D3, d 3 > E Nodes (V^) and << Dl , d ] >, < D2, d 2 >, ) e MRes(V i ) where d 3 = 1 + max(d.j, d 2 ); V 2 1 ^- the smallest m-resolution proof such that a) if (D. 1 , d> e NodestV^) then < D . ' , d> e Nodes(V 2 1 ) and b) if N3 e Nodes(V 2 1 ) and < Nl , N2, N3> e MRestV^) then Nl e Nodes(V 2 1 ) and N2 e Nodes(V 2 1 ) and e MRes^ 1 ) od; II Vp 1 represents the depth d proofs of D. ' from f.(S). These can be found by exhaustive search as indicated above, or by using more levels of m-abstraction. ] W «- S; -22- [If node N is of the form < Dl , d, > then we say label (N) = Dl and depth(N) = d r J loop while (C i W and there exist m-clauses CI , C2, and C3 such that a) CI e W and C2 e W and C3 I W b) C3 is an m-resolvent of CI and C2 c) for all i, 1 < i < n, there exists < Nl , N2, N3> e MRes(V 2 1 ) such that depth(Cl) = depth(Nl), depth(C2) = depth(N2), label (Nl ) e f^Cl), label(N2) e f i (C2), and label(N3) e f.(C3)) add C3 to W; II It may help to choose CI, C2, and C3 so that max(depth(Cl ) , depth(C2)) is as large as possible. 1 repeat ; od ; end proof search3; 4.2 A S£/Lcut&gy uxltk Matching We now present another, similar strategy which uses more than one m-abstraction at the same time. This strategy attempts to "match up" the m-abstracted proofs before looking for a proof from the original set of m-clauses. As before, if Ml and M2 are relations on k-tuples of m-clauses and T, , T„, ..., T. are m-resolution proofs, we define (Ml; M2)(T-|, T^, ..., T^), Here Ml specifies the relation on clauses at initial nodes and M2 specifies the relation on clauses at non-initial nodes. Suppose S, , S ? , ..., S, are sets of m-clauses. Suppose that V. is a set of m-resolutions from S.. The procedure "match" finds all k-tuples < T, , T„, ..., T^) of m-resolution proofs from S-. , S^, ..., S^, respectively, such that T. is an initial sub-proof of V. for 1 < i < k and such that -23- (Ml; M2)(T,, T~, ..., T.) is true. These k-tuples are not generated explicitly, but implicitly, in a manner to be described. Definition : A vector m-resolution is a triple < u, v, w> of nodes such that for some k, the labels of u, v, and w are k-tuples of m-clauses. We require that for all i, 1 <_ i <_ k, the i component of label (w) must be an m-resolvent of the i component of label (u) and the i component of label(v). Definition: A vector m-clause is a k-tuple of m-clauses, for some k. We define vector m-resolution proofs in the same way that m-resolution proofs and ordinary resolution proofs were defined. If V is a vector m-resolution proof, then we require that all the vector m-clauses in V must have the same number of components. We write VMRes(V) to indicate the set of vector m-resolutions of a vector m-resolution proof V. Suppose U is a k-tuple of m-clauses. We write D. to refer to 4. L. — _ the i component of D, and we write D as < D-, , Dp, ...» D. >. We use similar notation for k-tuples x of nodes. Definition : Let n.(D, C) be the relation specifying that D. is C. Here D is a vector of m-clauses and C is an m-clause. Definition : If V is a vector m-resolution proof and T is an ordinary m-resolution proof, then we write n. (V, T) if there is a shape correspondence ^ between V and T such that if Nl e Nodes(V) and N2 e Nodes(T) and Nl % N2 then i^. (label (Nl ) , label (N2)) is true. t h Thus if n.(V, T) is true, T is the "i component" of the proof V. We are using the usual definition of a relation between proofs here. The procedure "match(V 1 , V 2 , ..., V k , V, Ml, M2)" outputs a vector m-resolution proof V having the following property: Assume V, , V 2 , ..., V k are m-resolution proofs. Suppose T r 1 T k are initial sub-proofs of V ] , V ? , ..., V k , respectively. Also, suppose (Ml; M2)(T r T ? , ..., T R ) is true. Then there is an -24- initial sub-proof W of V such that n. (W, T.) is true, for 1 <_ i < k. Thus W has T. as its "i component", and W represents the matching up of the proofs T, , T«, ..., T.. The proof V therefore represents all possible ways of matching up initial sub-proofs of V, , V«, ..., V. . procedure match (V ] , V 2> ..., V k , V, Ml, M2); II returns with V a vector m-resolution proof such that for all T, , T ? , . . . , T, , if T. is an initial subproof of V. , 1 <^ i <_ k, and if (Ml; M2)(T,, T~, ..., T.) is true, then there is an initial sub-proof W of V such that n.(W, T . ) is true for 1 <_ i £ kj VMRes(V) + 0; Nodes (V) *• {: N1 is an initial node in V. and i Ml(label(Nl), label(N2), ..., label(Nk)) is true}; [for a node N of V of the form < Nl , N2, ..., Nk) we say label (N) = < label (Nl) , label(N2), ..., label(Nk) > U loop while( there exist nodes x and y of V such that x and y have not been resolved together yet); U resolve x and yj for all z such that < x i , y. , z.) e MRes(V.) for all i, 1 < i < k, and such that M2(label ( Z] ) , label(z 2 ), ..., label(z k )), do add z to Nodes (V); add (x, y, z) and to represent the set {< x, , x^, ..., x. >: x. e Q. for 1 <_ i < k} of nodes. We may use (( Q, , . . . , Q,>, < Q, ' , . . . , Q, ' >, > to refer to a set of vector m-resolutions in a similar way. Even such a representation might become cumbersome if k is larger than 3 or 4. We now show how the vector m-resolution proof generated by "match" can be used to guide the search for a proof in the original space, Suppose f -j , f~, ..., f k are m-abstraction mappings. Let R(x, C) be the following relation: x, e f-,(C) a x« e f~(C) a ... a x.e ^i < ( ( ')- Extend R to a relation between proofs in the usual way. Then it is easy to show that if T is an m-resolution proof, there exists a vector m-resolution proof W such that R(W, T) is true. Such a proof will satisfy n. (W, T.) for 1 <_ i <_ m, for some T. such that T ~t T. is true. Note that if T is a proof from S, and if R(W, T) is true, and if n^W, T-) is true for 1 < i < k, then (Rl; R2)(T-j, Tp, ..., T k ) will be true, where Rl and R2 are defined as follows: -26- Rl(D r D 2 , ..., D k ) is true iff (3C e S)(D i e f.(C), 1 < i < k). R2(D r D 2 , ..., D k ) is true iff (3C)(D i e f.(C), 1 < i < k). Suppose we are looking for a proof of m-clause C from S. Let D.' be arbitrary m-clauses such that D. ' e f. (C), 1 < i £ k. Let V. be an m-resolution proof from f.(S) such that V. contains isomorphic copies of all minimal depth d m-resolution proofs of D. ' from f-(S), for 1 < i < k. If there is a proof T of C from S such that T has depth d, then there are proofs T. of D. ' from f-(S), for 1 < i < k, such that T t T. , and such i that T. is an initial sub-proof of V.. Therefore (Rl; R2)(T, , ..., T.) will be true. Therefore "match(V,, V 2> ..., V k , V, Rl , R2)" will generate some proof W such that n. (W, T.) is true for 1 _< i <_ k. To be precise, W will be an initial sub-proof of the proof generated by "match". Note that R(W, T) will also be true. Therefore a reasonable search strategy is to call "match" to generate such a W, and to use "ndfindm" on W to obtain T. To do this, it is necessary to modify "ndfindm" to handle vector m-resolution proofs. This gives a theorem proving strategy "proofsearch4" which is entirely analogous to "proofsearch2" except that "proofsearch4" uses more than one m-abstraction at the same time. We now describe "proofsearch4". The procedure "proofsearch4" looks for proofs in order of increasing depth. The procedure uses a non-deterministic search analogous to "ndfindm" but for vectors of multiclauses. -27- procedure proofsearch4 (S, C, f , , fp, ..., f., D, ' , D ' . .., D,'); [look for a proof of C from S, using the not necessarily distinct m-abstraction mappings f , , f~, ..., f. and m-clauses D.' such that D.' t: f-(C') for 1 <_ i < k. This is a complete strategy. 1 let M1(D, , D ? , ..., D.) be the relation on m-clauses (3C e S)(D i e f^C) for 1 <_ i < k); let M2(D-,, ..., D, ) be some relation on m-clauses such that (3c)(D i e f^C) for 1 < i < k) implies M2(D r D 2 , ..., D k ); for d = 1 to °° unti 1 C is derived from S (to Hook for a proof of depth dl for i = 1 to k do V. <- an m-resolution proof containing as initial sub-proofs isomorphic copies of all minimal proofs T of D.' from f.(S) such that T has depth d; [generate V. as in "proofsearch2"J od ; match(V r V 2 , ..., V k , V, Ml, M2); for all N e Nodes (V) such that N is initial in V do m-clauses(N) «- {C e S: D. e f^C), 1 < i < k} where label (N) = < D, , D 2 , ..., D k > od; for all N e Nodes(V) such that N is non-initial in V do m-clauses(N) +■ od ; loop while (C has not been derived from S and there exists a vector m-resolution < Nl , N2, N3> in VMRes(V) and m-clauses CI , C2, C3 such that a) CI £ m-clauses(Nl ) and C2 e m-clauses(N2) b) C3 is an m-resolvent of CI and C2 c) C3 i m-clauses(N3) d) for all i , 1 < i < k, D i e f i (C3) where < D ] , Dp, . . . , D k > lflbel(N3n: -28- add C3 to m-clauses(N3) ; repeat od end proofsearch4; As with "proofsearchl", "proofsearch2", and "proofsearch3", if the abstracted spaces are all generated exhaustively, we can restrict the m-resolutions from S according to any complete theorem proving strategy and still obtain "proofsearch4" as a complete theorem proving strategy. Furthermore, if the m-abstractions satisfy suitable properties as indicated earlier, we can even restrict the abstracted search according to a complete theorem proving strategy. These combinations of m-abstraction and complete strategies restrict the possible ill- resolutions while maintaining a "global" theorem proving strategy. That is, the choice of which m-resolutions to do is influenced in a non- trivial way by the structure of the problem as a whole, rather than by which clauses can resolve according to certain criteria. If instead of looking for a proof of a particular m-clause C from a set S of m-clauses, we are looking for a proof from S of any one of a set SI of m-clauses, the procedure "proofsearch2" can be modified to do this. Let f be an m-abstraction mapping. Suppose we are looking for a proof at depth d; the general idea is to generate all minimal proofs T from f(S) such that T has depth d and such that (3C e Sl)(Result(T) e f(C)). In order to do this, we need to be able to test for an m-clause D whether there exists C e SI such that D e f(C). When all such proofs T have been generated, they can be used to guide the search for a proof from S. -29- If f and SI satisfy certain properties, then more efficient methods exist, and "proofsearch3" and "proofsearch4" can be used. Suppose for example that m-abstraction mapping f is defined in terms of a set F of literal mappings. Suppose S is a set of ordinary clauses. We are given an ordinary clause C and want to determine whether there is an m-resolution proof from S of an m-clause CI such that Set(Cl) = C. (For this derivation of CI, we consider the clauses in S to be m-clauses.) By Theorem 2.2, such an m-resolution proof exists if C is derivable from S by ordinary resolution. Suppose D e f(C), where we consider C as an m-clause for this purpose. Thus there exists a literal mapping e F such that D = 0(C). Now, if Set(Cl) = C, it follows that Set(0(Cl)) = Set(D). Therefore, if CI is any m-clause such that Set(Cl) = C , then there exists Dl E f (CI ) such that Set(Dl) = Set(D). Suppose T is a minimal m-resolution proof from S of some m-clause CI such that Set(Cl) = C. Then there is an m-resolution proof Y from f(S) such that T ^ Y and such that Result (-Y) = Dl . See figure 2. In order to search for such proofs T, then, it suffices to generate all proofs Y such that Set(Resul t(Y) ) = Set(D) and use them to guide the search for T. In this way, "proofsearch2" can be adapted to search for m-resolution proofs of any m-clause CI such that Set(Cl) = C Moreover, since such a proof Y exists for all m-abstractions D of f(C'), we can use more than one m-abstraction of C at the same time in the search for T. In this way, "proofsearch3" and "proofsearch4" can be used for this problem. Even if some m-clause CI such that Set(Cl) = C is -30- derived from S by m-resolution, it does not follow that C can be derived from S by ordinary resolution. All we know is that some clause subsuming C can be derived from S by ordinary resolution, by Theorem 2.4. CI Dl M-clauses and ordinary clauses Figure 2 This idea can be extended further. Suppose we are given a set S of ordinary clauses and an ordinary clause C We want to determine if C is a logical consequence of S by using m-abstraction search techniques. Now, C is a logical consequence of S iff there is a clause C" derivable from S by ordinary resolution such that C" subsumes C [2]. Also, if f is an m-abstraction mapping defined in terms of literal mappings, then by Theorem 2.7 it follows that for ewery D' e f(C), there exists D" e f(C") such that D" subsumes D'. If there is an ordinary resolution proof of C" from S, then there will be a minimal m-resolution proof T of CI from S for some CI such that Set(Cl) = C" 31- By reasoning as before, there will be an abstraction Dl of CI such that Set(Dl) subsumes Set(D'). Also, there will be an m-resolution proof Y from f(S) such that TtY and such that Dl = Result(Y). Therefore, to search for such a proof T, it suffices to search for proofs Y from f(S) such that Set(Result(Y)) subsumes Set(D'), and use these proofs to guide the search for T. In this way, "proofsearch2" can be adapted to test if an ordinary clause C is a logical consequence of a set S of ordinary clauses. Since such proofs Y exist for all D' e f(C') if C is a logical consequence of S, the procedures "proofsearch3" and "proofsearch4" can also be so adapted. Note that if some m-resolution proof T from S of some m-clause CI such that Set(Cl) subsumes C is found, then we know by Theorem 2.4 that some ordinary clause C2 such that C2 subsumes Set(Cl ) (hence C) is derivable from S by ordinary resolution. Thus C is a logical consequence of S iff such a proof T exists. -32- 5. BOUNDED M-CLAUSES One disadvantage of m-clauses is that there are so many of them. The set of ordinary clauses over k distinct predicate symbols is finite, but the set of m-clauses over k distinct predicate symbols is infinite. This could result in a larger search space for the various abstraction-based theorem proving strategies. We now show how to overcome this problem to some degree, while retaining the advantages of m-abstractions. The general idea is to keep less in- formation about how many occurrences of a literal there are in an m-clause. For example, we may specify that a certain literal occurs at least twice in an m-clause. Definition : A bounded multiset is a multiset in which the multiplicities of the elements may be 0, 1, 2, ..., b-1 , or °° for some bound b. A multiplicity of °° signifies that the element occurs at least b times. We call b the bound of the multiset. For practical purposes, an element with bound °° is considered to occur infinitely many times in the multiset. We only consider bounds b such that b >_ 1 Definition : If A is a bounded multiset, then Set(A) is the set {x: mult(x, A) > 0}. We define bounded addition + and bounded subtraction - of bounded integers as follows: K K x + oo = ) y/ ro and x + y < b x + b y = o> if x / », y / m and x + y > b x - y = x - y if x / » and y < x x - y = if x / » and(y = » or y > x) -33- - u = - - b x = {», b-1, b-2, b-x} if x f », x f b OO — CO = t», b-1, b-2, ..., 2, 1, 0} The meaning of the sets is that the operation can yield more than one possible outcome. Thus » - x can have any value between b-x and °° if x f °° and x f 0. These definitions are obtained as follows: Let 0,(x) be °° if x >_ b and 0,(x) = x if < x < b. Then if x + y = z for ordinary nonnegative integers x, y, and z, we say b (x) + h (y) = 0k( z ) If x - y = z for ordinary nonegative integers x, y, and z, we say 0.(x) - b (y) = ^h^ 2 ^* Here x " y 1S defined to be max(0, x-y). Definition : If A and B are bounded multisets with bound b, then A u B and A - B are defined as follows: mult(x, A u B) = mult(x, A) + mult(x, B) mult(x, A - B) = mult(x, A) - mult(x, B) Note that Set(A u B) = Set(A) u Set(B) and Set(A) - Set(B) c Set(A - B). Example : Suppose b = 2. Suppose A is {°°*P, 1*Q} and B is tl*P, 1*Q, 1*R}. Then A u B = {»*P, co*Q, 1*R} A - B = {oo*P} or {1*P} B - A = {1*R}. Given an ordinary multiset C, let b (C) be defined by mult(x, 0.(C)) = 0.(mult(x, C)). Thus h (C) is a bounded multiset, with bound b. -34- The bounded multiset operations are defined so that if CI and C2 are ordinary multisets, then b (Cl) u b (C2) = b (Cl w C2) and b (Cl) - b (C2) = b (Cl - C2). Note as before that set difference is a "nondeterministic" operation. Definition : If A is a bounded multiset and f is a function on elements of A, then f(A) is defined by mult(y, f(A)) = z mult(x, A) f(x)=y where bounded addition is used for the sum. In particular, if A is a bounded multiset of literals and a is a substitution, then Aa is defined in this way. Thus for bounded multisets with bound 2, {l*P(z), l*P(a), l*Q(z)Hz «- a} = (°°*P(a), l*Q(a)}. Here {z +■ a} is the substitution replacing z by a. Definition : A bounded m-clause is a bounded multiset of literals. 5.1 Bounded M-R&so lotion Definition : Suppose CI and C2 are bounded m-clauses. Suppose Al c CI and A2 c C2. Suppose al and a2 are most general substitutions such that there exists a literal L such that Set(Alal) = {L} and Set(A2a2) = {[}. Then (CI - Al)al u (C2 - A2)a2 is a bounded m-resolvent of CI and C2. Note that ordinary clauses can be viewed as bounded m-clauses, although the resolution operation is different. One reason for the usefulness of bounded m-resolution is that it "lifts" to ordinary m-resolution. That is, B3 is a bounded m-resolvent of Bl and B2 iff there exist ordinary m-clauses CI, C2, and C3 35- such that C3 is an m-resolvent of CI and C2, and such that 0. (CI ) = Bl , b (C2) = B2, and b (C3) = B3. Here b is the bound as usual. Examples : Suppose Bl = {1*P, 1*Q} and B2 = {oo*P} are bounded m-clauses with bound 2. Their bounded m-resolvents are the following clauses: {°o*P, 1*Q) {1*P, 1*Q} Suppose Bl = {1*P, 1*Q} and B2 = {1*P, 1*Q}, with bound 2 as before. Then the only bounded m-resolvent is {°°*Q}. Suppose Bl = {°°*P} and B2 = {°°*P, 1*Q} , with b = 2. Then the bounded m-resolvents are the following clauses: {oo*P, oo*P, l*Q} {co*P, 1*P, 1*Q} {°°*P, 1*Q) {1*P, oo*P, l*Q} {1*P, 1*P, 1*Q} {1*P, 1*Q) {co*P, l*Q} {1*P, 1*Q} {1*Q} Theorem 5.1 : Suppose S is a set of multiclauses and C is derivable from S by m-resolution. Let b (S) be (0 b (C) : C e S}. Thus b (S) is a set of bounded multiclauses with bound b. Then b (C) is derivable from h (S) by bounded m-resolution. 36- Corollary : Suppose S is a set of ordinary clauses and clause C is derivable from S by ordinary resolution. Then there is a clause C derivable from S using bounded m-resolution such that Set(C') = C. (Recall that the bound is greater than or equal to one.) Thus m-resolution proofs and ordinary resolution proofs can be transformed into bounded m-resolution proofs. In fact, this can be done so that the bounded m-resolution proof always has the same shape as the original one. In addition, we can show that a set S of clauses is inconsistent iff NIL (the empty clause) is derivable from S by bounded m-resolution. For this, we view ordinary clauses as bounded multi clauses with each literal having multiplicity one (or °° if b = 1). Furthermore, if C is derivable from set S of clauses by bounded m-resolution, then there is a clause C derivable from S by ordinary resolution such that C subsumes Set(C ). 5.2 Bounded M-Ab6&iac£Lon6 Definition : A bounded m-abstraction mapping is a function f mapping ordinary multiclauses into sets of bounded multiclauses, satisfying the following properties: 1. If C3 is an m-resolvent of CI and C2, and D3 e f(C3), then there exist Dl e f (CI ) and D2 e f(C2) such that D3 is a bounded m-resolvent of Dl and D2. 2. f(NIL) = {NIL}. Note that Dl , D2, D3 are bounded multiclauses and CI, C2, and C3 are ordinary multiclauses. Also, note that the function 0, is itself a bounded m-abstraction mapping with bound b. In addition, if f 37- is an ordinary m-abstraction mapping then 0. °f is a bounded m-abstraction mapping. In this way, we can get bounded m-abstraction mappings from all of the ordinary m-abstraction mappings described earlier. We could define abstraction mappings from bounded multiclauses to bounded multiclauses in the same way. Also, we could prove the appropriate theorems about the closure properties of bounded m-abstraction mappings under union and composition. All the search strategies for m-abstraction mappings can be applied to bounded m-abstraction mappings as well. For example, more than one bounded m-abstraction mapping can be used together in the search for a proof. Also, bounded m-abstractions can be used to test if a clause is a logical consequence of a set of clauses. Certain bounded m-abstractions are particularly useful. For example, if f is the propositi onal m-abstraction or a semantic m-abstraction with a finite domain, then 0. ° f is a bounded m-abstraction mapping with a finite range . That is, {D: (3C) D = (0.°f)(C)} is finite . Hence we can exhaustively list this set, as well as the set {< Dl , D2, D3> : D3 is a bounded m-resolvent of Dl and D2}. The various search strategies can use this information without having to recompute it for each depth. In addition, by appropriate hash coding or indexing schemes, this information can be compactly stored and efficiently retrieved. In this way, we get many of the benefits of multiclauses with the additional benefit of a finite abstracted space. Of course, the search strategy is less restrictive than with m-clauses, but this seems more than compensated for by the finiteness of the abstracted space. Increasing the bound will yield 38- a more restrictive search strategy, at the expense of increasing the size of the abstracted space. A bound near 2 would seem best for most applications. A bound of 1 is really too small, since this bound does not distinguish between one occurrence of a literal (the usual case) and more than one occurrence of a literal. -39- 6. INTERVAL MULTISETS We now define a concept of multisets more general than bounded multisets and ordinary multisets. In an interval multiset, we have a partition P of the integers (usually into intervals) and only keep information about which block of P the multiplicities occur in. In -this way, we can distinguish "many" occurrences of a literal from "few" occurrences without having to have a large number of mul ti pi i cities. Definition : Suppose P is a partition of the non-negative integers. Thus P is a set of disjoint "blocks" {I,, I ...} whose union is the non-negative integers. Then a bounded multiset is a set A together with a multiplicity mult(x, A) for each x in A. Also, mult(x, A) is a block of P for all x. We will assume that {0} is always one of the blocks of P. This seems to be a reasonable restriction. Definition : Suppose ^ and I 2 are sets of integers. Then ^ + I 2 = {x + y: x e I r y e y I-| * l 2 = {x - y: x e I ]f y e I £ } Here x -y is if x (C) must be a block of P containing the multiplicity P of x in C. Here C is an ordinary multi clause. Definition : Suppose CI and C2 are interval multiclauses with partition P. Then we say C3 is an interval m-resolvent of CI and C2 if there exist ordinary multiclauses Bl , B2, and B3 such that B3 is an m-resolvent of Bl and B2, and such that $ (Bl ) = CI , \\> (B2) = C2, and P P >)> (B3) = C3. We could also define interval m-resolvents as (CI - Al)al u r (C2 - A2)u2 but we choose the above approach for simplicity. It is easy to verify that if C is derivable from set S of m-clauses by m-resolution, then i> (C) is derivable from set $ (S) of P P -41 interval m-clauses by interval m-resolution. Hence if S is inconsistent, NIL (i.e., ^ (NIL) ) is derivable from ty (S) by interval m-resolution. The converse is also true, because {0} is one of the blocks of P. We could define interval m-abstractions in the usual way and prove the relevant theorems about closure of interval m-abstractions under union and composition. It appears that interval m-abstractions will be less useful than bounded m-abstractions, since we would not expect the number of occurrences of a literal in a multiclause to get very large. However, there may be applications in which large numbers of the same literal do occur in a multiclause. 7. PARTITIONED SEMANTIC ABSTRACTIONS Just as we obtained interval m-clauses from ordinary m-clauses by partitioning the multiplicities, so we can obtain new abstractions from semantic abstractions by partitioning the domain of the abstraction. The resulting proof technique resembles human use of reasoning with diagrams. In particular, partitioned semantic abstractions correspond to incompletely specified diagrams, the kind one may draw on the blackboard with dots or scribbles to indicate unspecified parts of the diagram. This seems to correspond to the kind of reasoning process that humans (at least the author) use to prove real theorems. Recall that a semantic abstraction maps clauses onto clauses of the form {L,, ..., L.} where each L. is of the form P(a, , ..., a ) or ~lP(a,, . . . , a ) and a. are elements of the domain V of the interpretation. 1 n l Suppose P is a partition of V. With the literal L we associate the -42- literal f (L) defined as follows: If L is of the form P(a,, . .., a ) then f (L) is P(A, , . .., A ), where a^ e A. and A. are blocks of the partition P. If L is of the form "IP (a, , . .., a ) then f (L) is ~IP(A, , ..., A ), with notation as above. Finally, with the clause C = {L,, ..., L.} we associate the clause f (C) = (L-, 1 , ..., L.'} where L.' is f (L.) for 1 < i < k. It is not difficult to show using Theorem 2.2 of Part I that if g is a semantic abstraction with domain £>, then f oq is also an abstraction. However, f og may be finite (that is, {f °g(C)} may be finite) P P even if g is not. In this way, finite abstractions can be obtained in a fairly natural way from semantic abstractions. We call f °g a partitioned semantic abstraction . We do not remember individual elements of the domain, but only which block of P they belong to. For example, we may remember only the congruence class of an integer modulo a prime. Or we may divide integers into "big" integers and "little" integers for reasoning about inequalities. Thus we get abstractions that correspond to incompletely specified diagrams. The significance of this result is not that we have a formalism for incompletely specified diagrams, but that the formalism is quite general and leads to a general theorem proving strategy. We can have partitioned semantic m-abstractions, in the usual way. Partitioned semantic bounded m-abstractions are also possibilities. 8. OTHER ABSTRACTIONS Suppose f is the ground abstraction. Let be any literal mapping ■43- such that 0(L) = 0(L). Let g be the abstraction defined by g(C) = {0(C)} for ground clauses C. (Here 0(C) = {0(L): L e C} as usual.) Then by Theorem 2.2 of Part I, gof is also an abstraction. In this way, we can show that semantic abstractions and partitioned semantic abstractions are abstractions. Suppose L is the ground literal P(t,, ..., t ). To obtain semantic abstractions, we define 0(L) to be P(a,, ..., a ), where a- is the value of t- in the given interpretation I. Also, we define so that 0(L) = 0(L). For partitioned semantic abstractions, 0(L) = P(A, , ..., A ) where a. e A. and A. is a block of the given partition 1 n 11 1 3 r of the domain of 7. Also, 0(L) = 0(L) as usual. We can extend this idea further. Suppose I, and I ? are two interpretations, with domains P, and Z?2> respectively. Let L be the ground literal P(t,, ..., t ), as above. Let a. and b. be the values of t. in I-, and I 2 , respectively. Let p be a new function symbol (representing "pairing"). Define by 0(L) = P(p(a r b^, ..., p(a n , b p )), and 0(L) = 0(1). This yields another abstraction, which is the "product" of two semantic abstractions, in a sense. We can also define 0(L) = P(p(A, , B-, ) , ..., p(A , B )) where the A. are blocks of some partition of V, and the B. are blocks of some partition of V~ and a . e A . , b . e B. for 1 i i £ n. We define 0(L) to be 0(L) as usual. Many more abstractions can be obtained in this way. For example, we can take the "product" of any number of semantic abstractions. In a similar way, we can obtain m-abstractions and bounded m-abstractions based on such literal mappings 0. Thus we can take the product of two semantic m-abstractions, and so on. It is clear that there are a great many possible ways in which abstractions and related concepts can be used to obtain complete theorem proving strategies. -44- 9. CONCLUSIONS The concepts of abstraction, m-abstraction, and bounded m- abstraction lead to a wide variety of new, complete uniform proof procedures for the first order predicate calculus. The same strategies probably apply to higher order logics with slight modification. These strategies all make use of a simplified proof from a simplified set of clauses (m-clauses, bounded m-clauses) to guide the search for a proof from the original set of clauses (m-clauses, bounded m-clauses). This is a much more "global" technique than current uniform proof procedures use. That is, each inference is controlled in a more meaningful way by the structure of the problem as a whole, rather than by properties local to the clauses involved in the inference. Also, near the end of the search, the abstracted clauses are more restricted than in the middle because an abstraction of the "goal clause" must be derivable from them in fewer steps. Thus the search space tends to get small as the depth of inference increases towards its maximum value. Furthermore, these methods permit depth-first search and subgoaling more naturally than most resolution strategies do. In fact, we are working on other methods which use abstractions together with backward reasoning, and which rely more heavily on semantics to decide which subgoals are achievable. The abstractions based on particular interpretations seem to be especially interesting, because they come close to formalizing the idea of proving a theorem for a particular example, a technique frequently used by humans. Abstractions corresponding to interpretations with a finite domain are promising, because they lead to a finite abstracted search space when used with bounded m-clauses. •45- Strategies based on "multiclauses" and abstraction turn out to be simpler and more elegant than strategies based on ordinary clauses and abstraction. (A multiclause is a multiset of literals). These multiclause strategies permit the use of several abstractions at the same time in a natural way. The combination of multiclauses and abstraction seems to be a significant new development. The use of more than one level of abstraction is another promising possibility which we do not explore. Structured programs are given to illustrate some of the strategies presented. Experience with implementations of these programs is necessary to determine the practical value of the techniques presented here. However, due to their basic underlying simplicity and elegance, these strategies should be relatively easy and straightforward to implement. More work remains to be done in extending the concept of abstraction to other systems of inference rules and to higher order logics. Can abstraction be applied to automatic program generation, for example? Perhaps abstraction could lead to fast theorem provers even for the propositional calculus. Also, it would be desirable to combine abstraction with a more meaningful use of semantics and with a strategy for equality. The compatibility of abstraction with conventional strategies such as locking resolution can also be explored. Finally, we plan to investigate combinations of abstraction with backward reasoning from a goal. The reason for hoping that abstraction will lead to better theorem provers is that it seems to be qualitatively different from the kinds of theorem proving strategies considered in the past, in restricting the search by use of global information about the problem to be solved. •46- The generality of this approach is also attractive, as well as the ability to use specialized knowledge concerning which abstractions are helpful for which problem domains. 10. REFERENCES 1. Robinson, J. A., Automatic deduction with hyper-resolution, Internat . J. Comput . Math 1 (1965) 227-234. 2. Kowalski, R. , The case for using equality axioms in automatic demonstration, Symp . Automatic Demonstration (Springer-Verlag, New York, 1970) 112-127. BIBLIOGRAPHIC DATA SHEET 1- Report No. IITlir.nrS-R-7q-QftS 4. Tu Ic .mj Suht itlc Theorem Proving with Abstraction, Part II 3. Recipient's Accession No. 5. Report Date March 1979 ■ David A. Plaisted 8. Performing Organization Rept. No. 9 rtorming Organization Name- and Address Department of Computer Science University of Illinois Urbana, Illinois 61801 10. Pro|ect/Task/Work Unit No. 11. Contract /Grant No. NSF MCS 77-22830 >nsoring Organization Name and Address National Science Foundation Washington, D. C. 13. Type of Report & Period Covered 14. 15. ^.;pplemcntary Notes 16. Abstra The concept of an abstraction was defined in Part I of this paper, and some theorem proving strategies based on abstraction were presented. The basic idea is to use the solution of a simple "abstracted" problem as a guide to the solution of a more compli- cated problem. This idea was formalized to yield a wide class of complete theorem proving strategies for the first-order predicate calculus. In part II, m-abstractions are defined, and their advantages are discussed. They operate on "multiclauses", which are multisets of literals. Several elegant strategies based on m-abstractions are presented. Next, bounded multiclauses are introduced, together with abstractions on them. These have most of the advantages of ordinary multiclauses, but restrict the size of the abstracted search space more. All strategies considered in Part II are complete. Finally, some new classes of abstraction and m-abstraction mappings are presented. 17. Key Uords and Document Analysis. 17a. Descriptors Theorem proving, abstraction, analogy, first-order predicate calculus, resolution, multisets. 17b icntifiers. Open-Ended Terms >->ATI Field/Croup ■ liability Statement FORM NTrJ-3) 110-701 19. Security Class (This Report ) UNCLASSIFIED 20. Security Class (This UNCLASS1FIKD 21. N<>. of I 22. Price USCOMM-DC 40329-P7I .** uni; 1 q I960