Π-representation: a clause representation for parallel search

25
ARTIFICIALINTELLIGENCE ][03 l-g-Representation: A Clause Representation for ParaHd Search Daniel H. Fishman Department of Computer and Information Science, University of Massachusetts, Amherst, Mass., U.S.A. and Jack Minker Department of Computer Science, Universityof Maryland, CollegePark, Md., U.S.A. Recommended by Bernard Meltzer ABSTRACT An extension to the clause form of the first-order predicate calculus is described which facilitates parallel search operations. This notation, called parallel representation (I1. representation), permits the representation of sets of clauses as single "l'l-clauses". Extensions to the operations of unification, factoring, and resolution which apply to this notation are also described, and the advantages of H-representation with respect to parallel searching, memory utilization, and the use of semantics ate discussed. 1. Introduction A question-answering system or any problem-solving system conducts a search in an attempt co answer a question or to solve a given problem. Two widely used search approaches, state-space search and problem-reduction search, are described in [15]. As noted by gowalski [10], these search ap- proaches also have analogs in the realm of mechanical theorem proving. During the conduct of a search one generates (or makes explicit) nodes in a search graph i~ an attempt to find a solution path from a starting node to some goal node. This process generally requires frequent backing up to previously generated nodes to explore alternate paths. The phenomenon of backtracking occurs very frequently in problem-solving systems as one does not always select the appropriate path to traverse. In some applications, the use of backtracking provides a fine systematic method for examining the Artificial Intelligence 6 (1975), 103-127 Copyright © 1975 by North-Holland Publishing Company

Upload: independent

Post on 23-Nov-2023

0 views

Category:

Documents


0 download

TRANSCRIPT

ARTIFICIAL INTELLIGENCE ][03

l-g-Representation: A Clause Representation for ParaHd Search

Daniel H. Fishman Department of Computer and Information Science, University of Massachusetts, Amherst, Mass., U.S.A.

and

Jack Minker Department of Computer Science, University of Maryland, College Park, Md., U.S.A.

Recommended by Bernard Meltzer

ABSTRACT An extension to the clause form o f the first-order predicate calculus is described which facilitates parallel search operations. This notation, called parallel representation (I1. representation), permits the representation of sets of clauses as single "l'l-clauses". Extensions to the operations o f unification, factoring, and resolution which apply to this notation are also described, and the advantages o f H-representation with respect to parallel searching, memory utilization, and the use of semantics ate discussed.

1. Introduction

A question-answering system or any problem-solving system conducts a search in an attempt co answer a question or to solve a given problem. Two widely used search approaches, state-space search and problem-reduction search, are described in [15]. As noted by gowalski [10], these search ap- proaches also have analogs in the realm of mechanical theorem proving. During the conduct of a search one generates (or makes explicit) nodes in a search graph i~ an attempt to find a solution path from a starting node to some goal node. This process generally requires frequent backing up to previously generated nodes to explore alternate paths. The phenomenon of backtracking occurs very frequently in problem-solving systems as one does not always select the appropriate path to traverse. In some applications, the use of backtracking provides a fine systematic method for examining the

Artificial Intelligence 6 (1975), 103-127

Copyright © 1975 by North-Holland Publishing Company

104 D. H. FISHMAN AND J. MINKER

nodes of the search space. A backtrack mechanism has been built into the control structure of PLANNER (Hewitt [9]) and is provided selectively in QA4 (Rulifson et al. [17]) through the use of the REPEAT statement. In other applications, the use of backtracking should be avoided i because the problem is too simple to warr~t the extra overhead associated With back- tracking mechanisms. In such :~es , simply looping through the various alternate successors of a node is adequate, Such looping mechanisms are provided in both CONNIVER (Sussman and McDermott [18]) and SAIL (Feld- man et al. [5]). In still other applications, the nature of the search space might be such that neither of the previous two approaches would have much chance for success over a large Set of pr0blems. In this paper we shall characterize this type of problem and describe an approach for dealing with it. The method will be couched in terms of resolution theorem proving, how- ever, it could just as well have been formulated in the context of problem- solving languages.

The kind of problem in which we are interested is the deductive retrieval of information from a large data base. In a practical application (or in one approaching practicality) one should expect to find thousands or even

• hundreds of thousands of facts in a data base represented as n,place relations (or fully-instantiated unit clauses). One would also find hundreds of general rules (general level clauses) which define and interrelate ~the predicates used in the data base as wellas any others which might ~be used. The methods we ~re pursuing for handling the deduction are b&~d Upon first.order logic. An experimental prototype system called MRPPS has been developed (Minker et al. [12-14]) and a number of experiments with MRPPS have been con- ducted (Fishman [7]) in the area of question-answering systems. In some of the experiments, successful searches were completed generally in less than five seconds to levels of eight and ten in the presence of approximately 500 facts and general axioms in the data base. TheeX~rimental results were therefore quite encouraging for data bases ofthis type. However, it is clear that as the size of the data base increases, the heuristics used in MRPPS Will be inadequate to limit the search to manageable proportions and that semantic information will b e required for search direction and pruning of the generated space. It is also clear that the backtracking onewould expect in a conventional theorem-proving or prOblem.solvingsystem Would pose a significant hardship on the system, rendering it virtuallyuseless in many eases.

The nature of the problem can be demonstrated by the following example : In a state space!interpretation of theorem proving, a given conjecture (clause) may beregarded as a state or problem containing subproblems (Sterals) all of which must be solved(resolved away) for the given problem to be solved (null clause deduced), The starting set of axioms, as well as inferred clauses (successor states), may be viewed as operators. Given a starting problem Artifccial Inteilioence 6 (1975),- 103,, 127

I~I.REPRF.$ENTATION 10.5

E~I:2EsE,, wh~re, say~ E, is P(x, y), we may very well havein the database. e.g., the axioms P(a, b~) , . . . , P~aj, b,l), where n l m a y equal I 0 or perhaps !000. In the latter case, nx = 10if0, weare in trouble using standardtech, niques, A t aminimum, a solution to this problem will require: a/search to depth four in the event that there are ~- four unit clauses in : thedata base which match the problem literals and all instantiations workout correctly.

a t each level i, there are n~ applicable unit operators, then the number of nodesinthe search space will be on the order of H~= l n~, where only n4 of th~se nodes ~ wiHbe solutions, For large values o f n, a search of this~space would be prohibitive by conventional methods .whether theorem-proving- based or A I language-based.

( Fie. 1. A parallel search.

In the following sections, we descTibe an approach which is intended to deal with this problem, The essence of the idea is to partition the axioms into subsets of syntactically similar clauses. We may then represent a set of clauses as a pair (C, ~), where C is an ordinary clause containing no con- stants, and ¢~ specifies the set of constants over which each variable in C may range, We call the pair (C, ¢P) a "II.clause', andeach H-clause may be applied as a "H-operator" to produce a successor "H-state" representing a whole set of clauses. This is depicted in Fig. 1. In this figure, each state represents a set of clauses while each operator represents a set of axioms. The H,clause associated with a given state represents all clauses which may

Arti~clal Intelligent# 6 (1975), 103-127

106 D . H . FISHMAN AND $.. MIIqKI~

be deduced from the predecessor state through the use of all syntactically similar operators. ~ Thus, there will never be any backtracking relative to the individual operators in a H-operation. There may, however, be backtracking relativeto the H, states, so that backtracking has not been totally eliminated.

The condensation of many branches of a low-level search space into a single branch of a higher level search space induced through the use of H-representation is quite analogous to the transformation on a problem's search space induced by the ARF interpreter in Fikes' REF-ARF system [6]. Fikes attacked the problem of translating a ~ondeterministic program(a REF problem statement) into a form which would permit methods more powerful than backtracking to handle the nondeterminism. The approach taken was to translate a problem statement into a heuristic search problem in which each state corresponds to a Boolean constraint satisfaction problem. This had the effect of greatly reducing the size of the search space, while powerful methods were brought to bear on the constraint satisfaction prob- lems. Each of the constraint satisfaction problems had a search space associated with it, and this also was pared down by capitalizing on the re- stricted range of variables. In H-resolution, the size of the search space is also reduced. However, this reduction does not induce other search prob- lems within the nodes. It does, however, introduce the need to form set intersections.

We will discuss the effects that H-representation has on the search prob- lem more thoroughly after we have described it more completely. This we attempt to do in the following sections.

2. Parallel. Clause Representation (H-Representation)

H.representation facilitates the representation of sets of first-order predicate calculus (fopc) clauses as a single "H-clause" in this notation. The represen- tation consists of two parts: an fopc clause containing no constants which serves as a template, and substitution sets in which sets of constants are specified over which variables in the template clause are universally quanti- fied. The set of tope clauses represented by this pair are those clauses which would be obtained by universal instantiation of the variables in the template clause by the constants contained in the sets over which the variables are quantified. Any variable occurring in the template clause which is not shown to be quantified over a particular set is understood to be universally quanti- fied without restriction. Below we introduce notation and provide examples to make this notion precise.

D~m~rlTION. A H.substitution component is an expression of the form Sly, where $ is a non-empty set of constants, and v is a variable. If al, .... , an are all the elements of S, we sometimes write a H-substitution component, Artificial Intelligence 6 (1975), 103-127

H-REPBESENTATION 107

showing the elements exOicitly, as [az , . . . , an]/v.A H-substitution com- ponent Sly indicates that the variable v is universally quantified over the set S. A H-substitution [a~, . . . , a,]/v may be thought of as representing n substitution components a~/v, . . ., adv.

DEFtm~ON. A H-substitution ~ is a possibly empty set of H-substitution components: dp = { S t / v t , . . . , S=/v=}. We denote the empty H-substitution bye.

Let $ -- { [ar t , . . . , a t , l ] / v l , . . . , [ a m , , . . , a=~=]/Vm}. Then ~ may be inter- pretexl as all possible cnmbinations (i.e., Hi% 1 ni) of substitutions

{at dot , azt/Vz, . . . . , , ~ d v , } , . . ., a z . , l v z , . . . . , a . d v . } .

D~m~mou. Given a clause C and a H-substitution $, the application of ~# to C, denoted C$, will be called a [I.instance of C. If ~ --- 8, then C$ = C, represents a set of clauses consisting of the single clause C. In general, if

----" { [ a l l , . . . , atnt]/Vt,.. . , [ a = l , . . . , atom]Iv=}, then C$ represents the set of l'I["= t n~ clauses

C{al t /v l , . . ., a=t/v=}, . . ., C{a t , Jv t , . . ., amdv=}.

These clauses need not all be distinct. EXAMPLE 1. Suppose $ = {[a, b]/x, [b, c, d]/y}, Then $ may be regarded as representing the six substitutions:

{a/x, b/y}, {a/x, c/y}, {a/x, d/y}, {b/x, b/y}, {b/x, c/y}, {b/x, d/y}. The application of ~ to the clause C = P(x , f ( z ) ) v Q(x, y) represents the six clauses:

P(a, f (z) ) v Q(a, b),

P(a, f (z) ) v Q(a, c),

P(a, f (z)) v Q(a, d),

P(b, f (z) ) v Q(b, b),

P(b, f (z) ) v Q(b, c),

P(b , f (z ) ) v Q(b,d).

DmmT[ON. A H-set • = {Or,- . . ,~ ,} is a finite non-empty set of H- substitutions. We note t h a t , may be a member of O. DmNmoN. A H-clause C is a pair (C, O), where C is a clause containing no constants, and • is a H-set, {Or,---, O,}- A H-clause C represents n sets of clauses C ~ t , . . . , C0,. If some ~ = 8, then C$1 represents the single clause C. A literal of a H-clause C - ( C , O ) will be called a H-literal when it is desired to emphasize the associated H-set, and will be denoted by L - (L, O). EXAMPLi3 2. The H-clause C - ( P ( x , f ( y ) ) v Q(f(x)) , {8}) represents the single clause P(x , f ( y ) ) v Q(f(x)) . EXAm'LE 3. The H-clause (P(x , f ( z ) ) v Q(x, y), {{[a, b]/x, [b, c, d]/y}}) rep- resents the six clauses given in Example 1.

The above example illustrates the storage economies which may be derived through the use of H.representation. The fact that it is possible to conveniently form inferences between H-clauses (as will be shown below)

Arffflelal Intelligence 6 (1975), 103-127

108 D.H. FISHMAN A ~ J .

further adds m its usefulness. That is, its use permits a parallel search to be performed in a natural way by incorporating it into the inference system, eliminating the iterative processes employed by other approaches, and thereby minimizing backtracking.

3. R-Unification and H-Resolntion

In fopc, the idea of a unifier to two literals is quite straightforward. It is simply a substitution which, when applied to each of the two literals, makes the resultant literals identical. That is, • is a unifier of literals LI and L2 if LI~--- L2~. The substitution • is a most general unifier (mgu) of L1 and Lz if, for any other unifier ~ o f L1 and L2, there is as a substitution ? such that LI~? = LI/~. A unifier of H-literals, which we shall call a H-unifier, must take into account not only the arguments of the literals but the elements of the corresponding H-sets, as well. For example, suppose we have two H-clauses

C, = (e(x), {{[a]/x}}), C2 ffi (e(y), {{[b]ly}}), and suppose we would like to find, if possible, a unifier for the H-literals of these H-clauses. Ignoring the H-sets for the moment, ~ = {xly} and ~2 = { y / x } would :both be mgu's for the literais P(x),P(y). But, in view of the H-sets, these H-literals represent the fopc literals P(a) and P(b), re- spectively, and these literals are not unifiable. Therefore, there should be no H-unifier for the given H-literals. In general, given two H-literals (P(x), {{$1/x}}), and (P(y), {{SI]y}}), there should be no H-unifier whenever S~ c~ $2 = 0; when there is a H-unifier, it applies only to those literals associated with the elements contained in the intersection.

As a further example, suppose we have the following two H-literals-

L, - (P(x,f(y)), {{[a, b]/x, [c,d]/y, [a, d]/z}}), L 2 • (P(u,f(v)), {{[d, el]v}}).

Then the H-literal Lx represents the four literals:

P(a,f(c)), P(a,f(d)), P(b,f(c)), P(b,f(d)), while L 2 represents the two literals:

P(u,f(d)), P(u,f(e)). In comparing these literals, we find that one of the literals fromL2, P(u,f(d)), is unifiable with the two literals from L,. which have f(d) as their second argument. The other literal from L2 is not unifiable with any of the literals from L,. The unifier of P(a,f(d))with P(u,f(d)) is {a]u}, while that of P(b,f(d)) with e(u,f(d)) is {b/u}. These together may be represented by a H-substitution {[a, b]/u}, Thus, the first arguments of L1 and Lz are unifiable when the range of u is restricted to the set [a, b]. To complete the unifying operation on the first arguments, it would be necessary to substitute either A~tij~cial Intellioence 6 (1975), 103-127

N-REPRESENTATION 109

u/x or x/u. Suppose we do the former. Then, the original H-literals, L1 and L2, after one step of the unifying process, would be converted to L~. and Hz, respectively,

L'I - (P(u, fO')), {{[a, b]/u, It, d]/y, [a, d]/z}}), L'2 = (P(u,f(v)), {{[a, b]/u, [d, el/v}}).

Notice that in applying the substitution to the literal, we must also .apply it to the H-substitution. With respect to thesecond arguments, these are unifiable only when both y and v are restricted to the set [d] = [c, d] c~ [d, el. In addition, the substitutiony/v, or v[y, would: complete the uni- fication of the second argument. The further restriction of the variables y and v in the H-sets and the application of v/y to the literals yield the unified literals L~ and L[,

L'~ -- (P(u,f(v)), {{[a, bllu, [dllv, [a, dllz}}), L[ = (P(u,f(v)), {{[a, b]/u, [d]/v}}).

We may observe from the above examples that the process of unifying H-literals, which we call H.unification, may involve the restriction of vari- ables in either one or both of the H.sets associated with the H-literals. The restriction of a variable will be to the intersection of two sets: the set over which it i ~, (universally) quantified and the set over which the variable it is in disagreement with is quantified. The two variables in disagreement will be "made the same" by the mgu, and both must be restricted to the same inters¢:tion. If this intersection is empty, then H-unification is not possible (as demonstrated by the first example). In addition to restricting variables, unification involves the fopc process of constructing the mgu so that the literals themselves are made identical. Thus, H-unification is identical to unification with respect to finding the mgu when variables involved in su~ stitutions do not occur in a H-substitt, ti,'m. However, an algorithm for H-unification must also check H-substitutions, and form appropriate set intersections to further restrict the variables as required. Notice that some variables in a il-substitution may not be affected at all, e.g., the variable z in the above example. This is because the variable was not in disagreement with any other variable during the u~:tfication process. (In fact, this variable did not even occur in the literals.)

In the above example, both H-sets contained only a single H-substitution. However, in general, the H-sets may each contain any number, say m and n, of H-substitutions. This greatly complicates the process, since it is then necessary to take into account each of the mn pairs of H-substitutions, and to determine the restrictions on variables that are necessary for each pair. This is because each member of the pair represents a set of instantiations of the template literal, and it is necessary to determine which literais of these sets are pair-wise unifiable, restricting variables in disagreement to the

Artificial intellioence 6 (1975), 103-127

110 D.H. FISHMAN AND J. MINKER

b.ppropriate sets of constants. These considerations are incorporated into the algorithm to be described.

From the above discussion it would appear that a unification algorithm for H-clauses should produce a pair (#, R) where cr is an mgu of the "template literals" and R is a set of rules each of which specifies what restrictions are to be made to variables in each of the mn pairs of H-substitutions. Although this approach would certainly be possible, it would require additional notation to define the various rales as well ~,s the establishment of an ordering or some other means for keeping track of the pairings of the II-substitutions. Rather than introducing this additional machinery which would neither aid in the understanding of the process nor in its implementation, we have chosen an alternative approach. Since the purpose of the unification process is to facilitate i~nfere-nce making, we have chosen to incorporate the con- structive process of building a H-set (if unification is possible) which is to be part of the II-clavse deduced from the givenH-clause(s) by H-factoring or H-resolving (to be defined below) on the unified literals. In the case of rI- resolution, the algorithm forms the pairwise union of the. H-substitutions of the given II-sets, and operates on these unions during the unification process. The algorithm given below, augments, in the way we have just described, Robinson's unification algorithm [16] as rest.ated by Chang and Lee [3].

Algorithm (H-unification):

Let the H-clauses involved be Cx - (C1, AI) and C2 - (C2, A2) (C1-and C2 need not be distinct); consider the literals L1 of C1 and L 2 of C 2. Suppose A1 = {611,..., 61o} and Az = {621, • •., 82m}- It is assumed that if C1 and U, are distinct H-clauses, then their variables have been standardized apart, that is, the names of variables have been changes so that those in C1 are distinct fror.l those in C 2.

( 1) [Initialization. ]

Form the set W - {L~, L~}, where L~ and L~ are unnegated instances of LI and L2, respectively. Set k ,-- 0 , Wt , - -W,¢ ~ F and Ct ~ 6.

(1.1) [Form initial H-set for a II-resolvent.]

If C1 and Cz are non-distinct, then go to (1.2), otherwise form the set

(]D/g = {611 U 821,611 U 6 2 2 , . . . , {~ln U 62,m_1, 61n t., 62m ) ~--" {¢/Jl,"" ",On.m}, consisting of the pairwise union of elements from A, a n d A2, respectively. Go to (2).

(1.2) [Form initial H-set for a H-factor.] Form the set ~ - Al.

(2) [Test for completion.]

If W~, is a singleton, then terminate with success: o is the mgu, and Arti/icial Intelligence 6 (1975), 103-127

HoREPItESENTATION I I I

• = Ok is the H-set of a H-clause which may be inferred from C1 and C2 on the literals Ll and L,. Otherwise, in a left-to,right scan of the literals in W~, find the first pair of terms which are not identical (i.e., which are in disagreement). Place these in the (disagreement)set D~.

(3) [Resolve the disagreement.] Suppose the elements of Dk are t~ ~J from Lt and t~ ) from Lz, respectively.

(3.1) If t~ k) and t~ k) are both non-variables, then terminate with failure.

(3.2) If t[ ~ is not a function, then go to (3.3). Otherwise, set ¢k *- {t[~)/t~)}, and delete from Ok every Ol contaim'ng the variable t[ k). If O~ is emptied, then terminate with failure, Otherwise go to (4).

(3.3) If t~z h) is not a function, then go to (3.4). Otherwise, set ck *- s,~)~,c~>~ and delete from O~ every Ol containing the variable t[ k). I,.+2 /~1 Jp

If Ok is emptied, then terminate with failure, otherwise go to (4). (3.4) [tp ) and t~ k) both variables.] Set ,~ , - {tp)/t[k~}. Let 0 be the first member of O~, where O~ is assumed to

be an ordered set, and go to (3.6). (3.5) If all members of O~ have been considered, then go to (4), other-

wise, let 0 be the next member of Ok. (3.6) If t~ ~) does not occur in 0, then go to (3.5). (3.7) If tp ) does not occur in 0, while t~ k) does, say as vj in Sj/vj, then

replace Sj/vj with Sj/tp ), and go to (3.5). (3.8) If tp ) is a variable v~ occurring in SJv~ of 0 and t[ ~) is a variable

vj occurring in Sj/vj of 0, then form S = St c~ Sj. If S ffi 0, then delete 0 from O~; if O~ is thereby emptied, then terminate with failure; other- wise go to 0.5). If S # 0, then remove S~/v+ and $~/v:~ from 0 a n d insert into 0 the H-substitution component S/tp), and go to (3.5).

(4) Let W++l <-- W++cr+,O~+l <-- O+, cx +--~o +~, k +- k + l , and go to (2).

Before showing that the algorithm does what we want it to do, namely, to find the mgu of the given template literals and the H-set which is to be associated with a H-resolvent or H-factor of the given H-clauses, we illustrate the use of the algorithm by means o fan example.

Example of H-unification. Suppose we are given the H-clauses = (Q(u, v, w) v P(u, 0(h(v)), w), {{Ec, all~v, [b, c, d]/w}, 8}),

C2 = (R(x, y) v p0r(x), 0(y), x), {{[a, b, c]/x}, {[a, b]ly}, 8}), and it is desired to H-unify the second literals of these H-clauses. Below we provide the sequence of working sets Wk, and of H-sets Ok which would be formed during the execution of the H-unification algorithm. Below these sequences we discuss the various stages of the algorithm.

Artificial Intelligence 6 (1975), 103-127

112 D. H. FISHMAN AND J . MINKER

Wo -- {e(u, g(h(v)), w), e(f(x), gO'), x)}, W1 -- {P(f(x), g(h(v)), w), P( f (x ) , O(Y), x)}, w,_ = {Pbr(x) , g(h(v)), w), P(f(x), g(h(v)), x)} , w3 = {e(f(x), o(h(v)), w), eft(x) , g(h(v)), W)}, (I)o = {~bl, ~b2, ~Ps, (P4, ~bs, ~P6}, where

~, - {It, dl/v, [b, c, dyw} u {[a, b, el~x} = {[e, d]/v, [b, e, d]lw, [a, b, el~x}, ~, - {[e, d]/v, [b, c, d]/w} u {[a, bl/y} - {[e, dl /v , [b, e, d]/w, [a, hi~y}, ~ s = {[c, d]/v, [b, c, d]/w} u ~ = {It, dl/v, [b, c, d]/w}, ~, = 8 u {[a, b, c]/x} = {[a, b, el~x}, .Os = 8 u {[a, b]/y} - {[a, b]/y}, ~b6= 8 u s = e, O; = 0 o , 02 -- {0~, 03, 04, Oe}, where each Ot is defined above; % -- {{[c, d]/v, [b, c]/w}, {It, d]/v, [b, c, d]/w}, {[a, b, c]/w}, 8}.

= = t (°) = f (x) . Step (3.3) applies, ao {](x)/u} is Stage O: k O. t(~ °) u, 2 - - "

formed, and since u does not occur in any member of (I)o, (I)o becomes (I)~ without any change, ao is applied to Wo to arrive at Wz.

cr = e, o {f(x)/u} = {f(x)/u}.

Stage 1: k = 1. t[ l) = h(v), t (1) = y. Step (3.2) applies, al = {h(v)[y} is formed, and since y occurs in two members (~2 and ~bs) of(Ih, these members of (I)~ are deleted in arriving at (I) 2. ¢z is applied to W~ to arrive at W2.

a = {f(x)/u} o {h(v)/y} = {f(x)/u, h(v)/y}.

Stage 2: k = 2. t(z 2) = w, t~ 2) = x. Since both terms are variables, a2 = {w/x} is formed in Step (3.4). In considering ~1, Step 0.8) appfies since both variables occur in ~ . The set [b, c] = [b, c, d] ~ [a, b, c] is formed; the H-substitution components [b, c, d]/w and [a, b, c]/x are deleted from ~1 ~nd replaced by [b, c]/w. In considering ~3, it is found in Step 0.6) that t(2 z) = x does not occur in ~bs, so ~b3 is left unchanged. In considering ~4, it is found in Step (3.6) that t(z 2) -- x does occur in ~4, and it is found in Step (3.7) that t[ 2) = w does not occur in ~4. Thus, in Step (3.7), the II- substitution component [a, b, c]/x of O4 is changed to [a, b, c]/w. In consider- ing 0 6 = e, it is found in Step (3.6) that t[ 2) = x does not occur in ¢e, so this H-substitution is left unchanged. The effect of this stage is that 02 is trans- formed into O3 as shown above. Also, a~ is applied to W2 to arrive a tW3.

¢ = {f(x)/u, h(v)/y} o {w/x} = {f(w)/u, h(v)/y, w/x}.

Stage 3: k = 3. In Step (2) it is found that W3 is a singleton, so the algorithm terminates with

- {f(w)/u, h(v)/y, w/x}, • = {{[c, d]/v, [b, c]/w}, {[e, d]/v, [b, c, dl/w}, {[a, b, c]/w}, e}.

Artificial Intelligence 6 (1975), 103--127

H-REPRESENTATION 113

We note that C~ given in the above example represents a set of seven clauses while Cz represents a set of six clauses. If one were to resolve all possible pairs of clauses from the respective sets, one would obtain fourteen resolvents:

Q(f(.), v, . ) v R(. , h(v)), Q(f(a), v, a) v R(a,h(v)),

.

2. 3. Q(f(b), v, b) 4. Q.(f(c), v, c) 5. Q(f(b), c, b) 6. Q(f(b), c, b) 7. p.(f(c), c, c)

Observe that these clause

v R(b, h(v)), v R(c, h(v)), v R(b, h(c)), v R(b, h(c)), v R(c, h(c)),

8. Q(f(c), c, c) v R(c, h(c)), 9. Q(f(d), c, d) v R(d, h(c)),

10. Q(f(b), d, b ) v R(b, h(d)), 11. Q(f(b), d, b ) v R(b, h(d)), t2. Q(f(c), d, c) v R(c, h(d)), 13. Q(f(c), d, c) v R(c, h(d)), 14. Q(f(d), d, d) v R(d, h(d)).

fourteen clauses may be represented by the single 1"I-

c - (QO'(w), v, w) v R(w~ h(v)),~), where • - O3 is the H-set produced in the above example (see Stage 3). Notice that four of the fourteen resolvents are actually duplicate~, so that only ten of the resolvents are unique. I t is a common occurrence in resolution theorem-proving to generate duplicate clauses (or "alphabetic variants" which are identical to each other up to the names of variables) and editing procedures are normally employed to delete them. It may also ['e noted that the first H-substitution of • applied to the template clause of C represents a set of four clauses which is properly contaim~ in the set of six clauses represented by the second member of O applied to the template clause. Thus, the deletion of the tormer H-substitution from q3 has the effect of eliminating the duplicate resolvents. The representation makes it easy to detect such alphabetic variants, • r

From the above example, we see that the' algorithm produces a H-set which may properly be associate :l with a H-resolvent. "/'he following theorem assures u,. that this Will be the case in general,:

TtW.OP.EM 1. Let C: = (Ct, A~) and C2 = (C2, A2) be distinct II-clauses, where AI = {6:1, •., 61,} and A2 - {6zl,- •., 62,}. Assume that C1 and Cz have no variables in common, for i f this were not the case they could be made to have no variables in common. Suppose that the H.clauses C~ and C2 are presented to the H-unification aloorithm for an attempt to H-unify the literals L~ of Ct andL2 of C2, where L~ and Lz are opposite in sign but have the same predicate symbol. I f the algorithm terminates in Step (2) with substitution o and H-set ep, then o and (p are such that

(1) o is a most general unifier of {Ll, L2}, and (2) the H - c l ~ e C ffi (C, ~), where C ffi ( C I - Ll)cr u ( C z - L2)o, represents

the set of all resolve~:ts which may be obtained by exhaustively resolving each

Artificial Intelligence 6 (1975), 103--127

114 D.H. FISHMAN AND J. MINKEit

of the clauses represented by CI against each of the clauses represented by C2. We shall call C a H-resolvent of CI and C2.

In case the algorithm terminates with failure, then no resolvents can be produced by the pairwise resolution of members of the sets of clauses represented by C1 and C2, respectively.

The proof of Theorem l is given in the Appendix. We state the basic theorem on factoring without proof, The proof is quite similar to that of Theorem 1 (see Fishman [7]),~

THEORI~M 2. Let D = (D, A) be a H-clause. Suppose that D is presented to the H-unification algorithm for an attempt to H-unify the literals Ll :and L2, where L1 and L2 have the same sign and predicate symbol. I f the algorithm terminates in Step (2) with substitution ¢ and H-set O, then ¢ and • are such that

(1) tx/s a most general unifier of {LI, L2}, and (2) the H-clause C ffi (C, O), where C - (D-Ll)o ' , represents the set of

all factors which may be obtained by factoring all o f the clauses represented by D on instances of LI and L2. We shall call C a H.factor of D.

In case the algorithm terminates with failure, then none of the clauses represented by D can be factored on instances of Ll and L2.

As an example of H-factoring, given the H-clause D ffi (P(x) v e(y), {{[a, b]/x, [b, el/y}, {[d]/x, JellY}, {[a,, a2]/.v}}),

we obtain the H-factor C ffi (P(x), {{[b]/x}, {[al,a 1J/x}}). It is easily verified that ~he three factors represented by C are the only factors obtainable by factoring the seven clauses represented by D.

4. Advantages of a Parallel Reselution Based System

The clause representation and related logical operations which have been introduced above should prove quite useful intheorem-proving-based QA systems. Its usefulness may be realized in the following three ways: (I) it is a natural means for performing a parallel search; (2) it provides for more economical storage utilization than does fopc clause form; and (3) it lends itself to semantic considerations. We discuss these three factors in the subsections below.

4.1. Utility of the paralld search

As we have shown, deductions which are made with H-clauses are equivalent ~o sets of deductions made with fopc clauses. The notation therefore provides the search strategy with the capability to explore in a single path what would take several path explorations in fopc. In Fig. 2, there is depicted a con- densation of n fopc inferences involving the clause C = L(x, y) ~, F(a, y) Artificial Intelligence 6 (1975), 103-I 27

I']'REPRESENTATION 115

and the n t> 1 clauses F(a, bz), i - 1 , . . . , n, into a single H-resolution in- volving the H.clauses

c = (L-Cx, y) v ~-(u, y)), {{[a]/u}}), D = (F(s, t), {{[a]/s, [ b , . . . , b~]/t}}).

Thus, rather than making n deductions of the clauses L(x, bt), i = 1 , . . . , n, a single H-deduction of D2 - ([~(x, y), {{Ibm,..., b,]/y}}) is made.

In an implemer~ation of H,resolution it would be desirable to store the constant sets separately from the H-clauses, maintaining only pointers to these sets with the H-clauses. Then, during the deduction process, the only time it is necessary to refer to the sets is when two restricted variables are found to be in disagreement* during unification. At such time, it is necessary to execute a set intersection function. However, every other kind of disagree, meat can be processed without specific reference to these sets. Thus, in some cases, it will be possible to effectively form the resolvents of large numbers of structurally s~milar clauses with little additionalwork over that required in a single fopc inference. Such a case is depicted in Fig. 3, where s~ and s2 are

~¢~,y) v ~¢a~y) ~¢a,~) 7¢a,b z) . . . ~¢a.b u)

£opc

~'¢,.,,b:t) 'C'¢.,,b 2) . . . 'c'¢,.,!,,,,,~

(if(z,7), v Y(u,y), {{[a]lu}}) (tea.t), {([a]l,, [b1,....bn]/t)))

ff.o,,y). ~c[t ,~ , . . . ,Nl lTm Fio. 2. foix: parallel search vs H-search.

pointers to possibly large sets of constants, St and $2, respectively. In this example, the H-resolvent represents IS11" 1521 fopc resolvents.

The worst case occurs in resolving the disagreement between two restricted variables. This must be handled by forming the intersection of the two sets involved. 1 While forming this intersection may be computationally costly if

1 It should be noted that in standard (non-inferential) information retrieval operations, it is quite customary to perform set intersections in searching for a set of items satisfying some Boolean combinations of index relations.

Artificial Intelligence 6 (1975), 103--127

116 D . H . FISHMAHAND J. MINKER

the sets are large,, it will certainly be less costly than processing the individual fopc clauses, if all the processes were done at once. Furthermore, if the processing were done one at a time with intervening search, then the added cost of backing up must also be considered in the comparative costs since all of ~is backtracking is e ;lhninated in the H-inference.

If one were interested in just a single solution to a problem and ifperfect heuristics were available, then it would be necessary to traverse just a single p a ~ and backup would be Unnecessary. In this event, it is clear that II- resolution would be the less effective approach since it would make many

.

irrelevant deductions which would not otherwisebe made. However, even with perfect hem'istics, the utility of H-resolution improves in those appli- cations where ;,t is desirable to find all solutions to a g iv~ problem. In such cases, there would be no backtracking relative to the H-states and all solutions would be cr~ried along simultaneously. It would be .moot to carry this argument fvxther since the problem of search vanishes altogether in the presence of perfect heuristics.

' v a(e,v). {(,m21v)})

~'¢z.v) v xCz.,). {(h.lz. ,2Iv}})

Fla. 3. H, infm~,noe requiring no inspection of sets; -~

The difficulty of a search using H, resolution is identlcal" to that for fopc when no structural similarity exists in the starting set S0f ~ioms..In this event, all variables would be unrestricted and". all H-sets would contain only 8. On the .other hand, as axioms are added to SW.~ch arestructurally similar toaxioms already in S, the fopc.searc-h space . increases exponentially in size, while the size-of m e H=search sp~ace remabts .constant. Thus,. if little or no-structural similarity.exists ,the. axiomatization of some problem domain,, th~n.fopc should perform, marginally better (that is, unless the variable restrictions were used for semantic, considerations as di~ussed..in. Section 4.3). However, as the degree of structural simi!~ity increases in an a,xiomatization, then H'resolution takes on increased utility.

A good heuristic in theorem proving is to attempt to resolve on litemls, Artift¢ial Intelligence 6(1975), 1~.~-127.

H-REPRESENTATION 117-

containing instantiated variables (see Minker et al. [13]). This would also be a good heuristic in H-resolution. It could be extended to give preference to H-inferences involving the smallest restriction sets thereby assuring the production.of the fewest number of irrelevant deductions. This heuristic could have the effect of successively refining the substitution sets one starts out with at the start of a search, Other heuristics which axe good in folg theorem proverslare likely to be good for H-resolution as well, A heuristic which favors the use of one axiom over another at some point in a search is probably distinguishing between structurally different axioms, Clearly, the same heuristic is applicable in H-search. It suggests generating a particular H-state over some rother one. Heuristics useful for distinguishing between, structurally similar axioms willmost likely be based upon the constants in these axioms as compared with those in a given problem. The value of this heuristic is essentially submerged in the heuristics mentioned at the start of this paragraph.

An example which compares H-resolution with ordinary resolution may be derived relative to the family graph shown in Fig. 4. In this graph, individuals are designated by numbe~, and mother (M) and father (F) relationships which apply, to these individuals are shown explicitly. All of the facts, in terms of mother and father relationships, represented in the graph may be represented by the following two H-clauses:

(1) (M(x, y), {{$~/x, S,/y}, {S2/x, $3/"}, {Sdx, Ssly}, {Sdx, S,]y}, {sdx, sgiy} }),

(2) (F(x, y), {(S, olx, S ly}, {S,,lx, {S,21x, Ss/y}, {S, tx, S,/y}, {S, dx, sg,/y}}),

where the meml~ership of sets St through St4 are given below" .St ~rt60], SS = [136], .;S~, - - [5 ] , . • S , - [ 3 1 1 , . . . , 3191,

$, [63, 631, 639, 62, 4] ffi -- . . . , , S lo [61], "i s , f f i [4] , . s , , [6],

Ss " [971, . . , 979, 7, 9, 10], S,= - - [8] ,

- .$6 [65] , $ ,3 [63],

... 5 ' , - [64, 66, 67, 671, . . . , 679], S , , - [631]. We observe that to represent the same set of facts using folg clauses would require 78 ¢lam~'s. Given such a set of facts, one might ask the question "6 is the grandfather of whom?", whose negation as ~ H-clause might be represented as

(3) (GF(u, v), {{[6]lu}}). Since grandfatl~ers are not shown explicitly in the family graph, this relation- ship would have to be deduced through the use of axioms, such as"

Artificial Intelligence 6 (1975). 103-127

118 D . S . HSI-IMAN AND 3. MINK~

Q

h

Z

N

Artificial Intelligence 6 (1975), 103-127

.<

r: 4

I'I-REPRESENTATION t.t9

m m °

(4) (F(r,s) v F ( s , t ) v GF(r, t), {8}), -- - ,

(5) (F(r,s) v M(s,t) v GF(r, t), {8}). A refutation of (3) is shown in Fig. 5. In this figure, the literal used' in each inference is underlined. H-clauses (3) and (6)both represent Single clause, however, II-clause (7) represents .12 clauses ($a contains 12 individuals). Therefore, in lope, to deduce the Clauses represented by (7) would require twelve inferences at that stage. The refutation is achieved at the next level in H-clause (8). :By examining the H,set of (8), we observe that the indi- viduals 63 and 631 are instances of y for which resolution was possible. Thus, of the 12 clauses represented by (7), two of them could be used in inferences at the next level. If 63 were substituted for y, then twelve inferences were

(3) ('~%.v). (([e]/u)D

(s)

(7)

(¥(u.,) v ¥( , .v) . {{[6J/u)})

2 '

(Y(y.v), (([6]lu,S31Y]) )

(8) ( O . (([6]lu,[63]lY,S71v], ([611u,[631]ly,S91v)) ~

FJo. 5. A refutation of (OF(u, v), {{[6]/u)}).

possible, i.e,, with the twelve clauses represented by (F(r, s), {{[63]/r, ST~s}}). If 631 were substituted for y, then nine inferences were possible. Thus, clause (8) represents a null clause which would have been derived by twenty-o,e different folg inferences. Therefore, the four inferences involving rl-clauses shown in Fig, 5 is a condensation of thirty-three in~'evences which would have been performed ifall paths had been followed in an fopc search. The ability to carry all solutions along in parallel minimized backtracking that would be required were one to use an fopc refutation approach.

Again referring to Fig. 5, we note that in the search represented there, many of the grandchildren of individual 6 have been "found", That is, if an

Artificial Intelligence 6 (1975), 103-127

120 D.H. FISHMAN AND $. MINKElt

answer recovery device such as Green's [8] answer predicate ANS were employed, or if the approach by Luckham and Nilsson [11] were used, it would be found that the individuals in sets Sv and S9 answer the question as to who is (are)grandchildren of individual 6. In Fig 6, we show how the

(3')

(6')

(UP'(u.v) v ~s(v), (([6]/u)))

(v'Cu.,) v Y(,.v) v tss(v). (¢(6]/u)})

(7') t { [6) /u, ss/y)))

(2)

(8') (.~S(v), {{[611u, 163]/y, S7/v), {[611u, [6311/y, S9/v}}) Fro. 6. Deriving the answers.

ANS predicate would b~ used. We note that a deduction of the ANS literal by itself is regarded as a deduction of I'-I. Thus, rather than finding a single grandchild of individual 6, the search has found twenty-one of his grand- children in a single deduction path. The use of H-resolution is seen to give some assistance to the problem of answering "how many" type questions. Once the ANS literal is deduced by itself, it is then possible to count the individuals in the union of the sets of which an answer variable is restricted. However, H-resolution offers only a partial solution to this problem, since, as may be noted in the given example, the individuals found are notaH of the grandchildren, they are only the paternal grandchildren. The maternal grandchildren can be found only in a refutation in which axiom (5) was used. Therefore, while H-representation makes an advance with respect to parallel search problems, and as a by-product, to the counting problem, it does not completely solve these problems. It makes the advancewith respect to clauses which are identical up to the instantiations of the variables. However, to make an analogous advance with respect to clauses which are identical up to the names of predicates (i.e., so that axioms (4)and (5) could be handled uniformly) would require an extension to a second-order ,Artificial Intelligence 6 (1975), 103-127

rI-REPRF~ENTATION 121

logic, or would require that an iteration technique (such as that of Darlington [4]) be used to continue the search.

4.2. Storage economies realized

A second advantage of rl-representation is in tl~ storage economies it affords. In a first-order QA system, it is likely that a great majority of the axioms in the data base will be in the form of fully-instantiated unit clauses. Also. siz~a~,'~e subsets of these unit clauses will have a common predicate. Thus, each of these su~-~t~ can be represented by a single H-clause. On a gross level, the number of fopc clauses represented by a collection of rl- clauses may be too great to store in main memory. An fopc theorem prover would find it extremely die, cult, if not impossible, to deal with such a lazge ~ t of clauses. On the oth~r h ~ d , usin~ H-resolution, the sets of constants referred te~ in the H-clauses, though quite large, could be stored on an ex- ternal ste~age medium with just the pointers to them stored internally. When it is necessary to operate on the sets, well developed techniques for storing, retrieving, and searching lists (~ets) of items on external storage media may be employed.

On a finer level, l,i-representation may be seen to require less space than standard clause form to represent a data base of the sort described. Con- sider the H-clause representing n unit clauses (having a common predicate) found in such adata base. Then n - 1 occurrences of the predicate would be eliminated. Furthermore~ it is likely that there will be unit clauses present of the form

Q ( a , - . . . , k .

The clauses of this form can be represented by a single H-substitution in the H-set of the H-clause. Thus, k - 1 occurrences of the constant a would be eliminated. Contrast the storage required bythe H-clauses (1) and (2) above compared to the 78 clauses they represent. Further, the savings that are realized in representing the data base will be magnified in terms of representing the clauses generated during a search, and this is where the savings are iikely to be most significant since theorem-proving programs generally have their search space limited to main memory. To take advantage of these savings, Anguston and Minker [1] have developed a data structure which permit.,~ a single l'i-clause to be unified in parallel against all other clauses in the data base.

4.3. Amenability to semantic considerations A further advantage of ~1-representation is that it lends itself to semantic considerations. The restriction of variables to sets can be regarded as a typing of ~he variables iavolved. Thus, for example, rather than using an

Artificial Intellioence 6 (1975), 103-127

122 D . H . FISHMAN AND J. MINKEIt

axiom which makes the statement that for all x and y, if x is the father of y, then x is a parent of y, a stronger statement could be used which requires that x be an individual in the set of all males (MALE), as in the H-axiom"

C = (FATHER(x, y) v PARENT(x, y),{{MALE/x}}). C may be interpreted as "x is the father of y implies that x is a parent of y with the restriction that x belongs to the set of males". Attempts to resolve C with a clause

DI = (PARENT(u, v), {{FEMALE/u}}),

or with a clause D2 - (PARENT(u, v), {{[Roz]/u, [Brett, Emily]/v}}),

Or with a clause D3 - (PARENT(u, v), {{[Roz, Dan]/u, [Brett, Emily]/v}})

will meet with the following success: (1) no resolvent will be formed with DI provided that MALE ra FEMALE

ffi 0 ;

(2) no resolvent will be formed with D2 provided that [Roz] • MALE -- 0; and

(3) the resolvent /)4 - (FATHER(x, y), { {[Dan]/x, [Brett, Emily]/y}})

will be formed provided that [Roz, Dan] r~ MALE ffi [Dan]. Although considerably more work is required to incorporate semantics

into theorem-proving, the mechanisms required to form set intersections to facilitate this use of semantic information may be implemented. Bledsoe et al. [2] have shown that the typing of variables led to considerable im- provement in the performance of a theorem-prover applied to limit theorems of elementary calculus. The use of the H-sets for semantic considerations, e.g., as constraints o n variables, is somewhat analogous to the constraints placed on variables in Fikes' REF-ARF system: Although in REF-ARF more powerful constraints were available (variables could be made to satisfy a set of Boolean conditions), the net effect is the same; in both cases a reduction in the number of valid instantiations of variables is obtained. This, in turn, reduces the size of the search space. Furthermore, since the sets may be implicitly defined in H-representation, there is no reason why set membership could not be specified by a Boolean constraint equatien, as in REF-ARF, or by any other means for specifying a set.

5. Summary and Conclusions

We have develope~l a modified representation of a clause within the first- order predicate cal,~ulus, called H-representation. H-representation permits Arti]icial Intell!gen¢¢ 6 (1975), 103-127

H-REPRESENTATION 123

a saving in space over the fopc representation of the corresponding clauses. Furthermore, using H-representation, a unification algorithm h a s been developed which can save considerable t ime over what i s required in the fopc representation: This was illustrated in Section 4,1. Specifically, in the same time that it took the conventional unification algorithm to be applied once to unify two literals in the fopc representation, H-unification produced IStl" Is21 unifiers, where ]St[ and IS2[ are the respective number' of literals represented by the two H-literals. This is significant, as the unification algorithm is the most frequently used subroutine in a theorem-prover.

In the extension to H-resolution, all of the logical properties of resolution have been retained. For example, giventwo H-clauses, C1 and C2, a H- resolvent of Ct and C2 logically follows from Ct and C2. Furthermore, given any refinement o f resolution, such as linear resolution, set.of-support, semantic resolution, SL resolution, and others which are complete ant! sound, then use of these refinements with K-resolution is complete and sound. Similarly, given any search strategy in the sense of Kowalski [10] then all of the results with regard to search strategies for fopc extend to that of H- resolution in an obvious manner . . . . .

Although we have described our work in the context of resolution-based theorem prowng, the same ideas are applicable to AI procedural language developments. Instead of unification, workers in AI procedural languages refer to a pattern-matching, For the most part, pattern matching is really nothing more "than the unification algorithm. More general data structures are also allowed for the pattern matching operation. Instead of matching individuai patterns, a pattern can be generalized to have a specific form and various substitutions may be permitted to instantiate the pattern. Hence one can develop the concept of a H-pattern. Now, instead of achieving parallel operations through looping operations as in CONNIVER and SA~, it can be achieved through set operations by performing H-pattern matches in much the same way as one performs II-unification.

We believe that H-resolution will be useful particularly for large data bases. This is so since with a single template one can represent many clauses and thereby save space. Furthermore, H-unification uses set intersection and set union operations which are natural to data base problems. On the other hand, it is not clear that for problems of a mathematical nature that there will be any advantage to the use of H-resolution. Indeed, such a system might be quite cumbersome, and require a great deal of bookkeeping and over- head to preclude its use in mathematical theorem proving. Hence, it will be useful to experiment with a systzm based on these principles, and to compare it with a conventional system based on theorem.proving in the fopc. The MRPPS system at Maryland (Minker et al. [12].) is being revised to handle H-resolution. Both versions of MRPPS, with and without H-resolution,

Artificial Intelligence 6 (1975), 103-127

124 D.H. FISHMAN AND J. MINKER

can then be tested against the same problem. Experiments should be con- ducted using the same data base as used by Fishman [7] so that comparable data may be obtained for the same queries with both versions of MRPPS. We expect that through both experimentation and analysis, rl-representa- tion will be shown to have an advantage over an fopc representation of the same problem in the area of large data bases and possibly in some mathematical domains.

Appaaix. Preef of Tbeerem 1

Part (1) of the theorem must be correct since the II-unification algorithm is modeled closely after Robinson's unification algorithm as given by Chang and Lee [3]. Robinson has shown that his algorithm does indeed find the mgu.

We now consider part (2) of the theorem. Recall that the H-clause Ct represents the n sets of clauses C1611,..., C161,, while C2 represents the m sets of clauses C26zl, • •., C262m. In order to form all the resolvents between clauses represented by Cx with those represented by Cz, it is necessary to form the resolvents between all tun pairs of sets Cx6tt and Cz62j, for i - 1 , . . . , n and j - I , . . . , m. The H-set Oo created in Step (1.1) has nm members, each of which is the union of one of the mn pairs of H-substitutions from Al and Az, respe~ive!y. We will show that if H.unification is successful (i.e., if termination occurs in Step (2), and if ~ is a member of • where

- 61~ u 62j or ~ is a restricted form of this union which resulted from the algorithm, then C~ represents the set of all resolvents which may be derived by the pairwise resolution of members of Ci6~ with members of Cz6~j on instances of LI and Lz, respectively. It will also be shown that ifO~ or a re- stricted form of ~ is deleted from Ot at some stage of the algorithm, then there are no resolvents which may be produced by resolving the members of C16j~ against those of C26z~.

Suppose that ~ = 6tt u 6~ ¢<bo is not modified bythe algorithm, so that ¢~. This means that every clause in C~6~ may be su~s f td ly resolved

against every clause in C~621, with mgu ¢r in everycase. Clearly, C - {C~ -- Lx}~r U {C 2 - L2}o" is the correct template clause describing this set of resolvents. Furthermore, the clauses in this set are such that the instances of the set of literals which de~:nded from Ct6~t occur in all possible combinations with the instances of the set of literals descended from C26~j. Since C~ and C2 contain no common variables, the set of resolvents is correctly represented by C~.

Before continuing the proof, we make the following observation. Suppose is a member of¢,t. If~ = 6ll u 6zj,, where, as above, 6~z f A~ and 6zsE A2,

then C , ~ = C~6~. This is the case since any H-substitution components Artiy~cial ln~ellt~em~e 6 (1975), 103-127

H-REPRESENTATION 125

contributed to ~ by 621 do not have any variables in common with C1. Simi- larly, C , O - C262j. On the other hand, if ~ is the result of various trans- formations performed by the algorithm, such as changing the name of a variable as in Step (3.7), or restricting the quantification set of one variable and deleting the H-substitution component of another, as is done in Step (3.8), then it is clear that CtO ~- C161i and C2~ -= C262j. These facts are used below.

We continue the proof by justifying separately the ~tions taken by the algorithm in processing the various types of disagreements between terms t~ t~ and t~2 k) which may be discovered in Step (2).

Case 1" t~ t) and t~ h) are both functions. This case is handled in Step (3.1). Since unification is impossible, II-unification is also impossible.

Case 2: t~ t) or t~ k) is a function and the other is a variable. Without loss of generality, assume that t~ t~ is a variable. Let ~ be a member of Ok. If

- 8, or if ~ is any non-empty H-substitution which does not contain an occurrenc~ of t~), then irk = {t~t)/t| k)} should be formed and ~ should remain unchanged since all occurrences of t~ t) in instances of Lt in clauses of C~O are unified by ~ with all occurrences of t¢2 t) in instances of L2 in clauses of C2~. On theuther-hand, suppose t ~ does occur in ~. Then all instances of Lt in C~O have a constant in the position of t~ t), whereas, the occurrences of L 2 in C2~ have the function t2 ok) in this position. Hence the clauses in these sets will yield no resolvents, which means that ~ should be deleted from Or. If Ok is thereby emptied, then no resolutions are possible between clauses represented by C~ and C2, respectively. The actions justified for this case are precisely those taken by the algorithm in Steps (3.3) and (3.4).

Case 3: t~ t~ and t¢2 k) are both variables. This case is handled in Steps (3.4)-(3.8). The algorithm arbitrarily forms ~t -i-1;'~)/'~)~-2 j, and examines, in turn, each member of ~ . Let ~b be a (possibly empty) member of ~t- There are four possibilities which must be considered" (a) neither t¢t k) nor t<2 t) occurs in ~; (b) t~ ~) occurs in ~, but t~ ) does not; (c) t~ ~) occurs in ~ but t~ t) does not; and (d) both t~ ~) and t~ ~) occur in ~. For possibilities (a) and (b), it is clear that all (uninstantiated for (a), or instantiated for (b)) occur- rences of t~ t) in instances of L~ in clauses of C ~ areunified by ¢rt with all occurrences of the variable t¢2 ~) in instances of L 2 in clauses of C2~. Thus, since this disagreement does not affect the resolvability of clauses in Ct~ with those in C2~, ~b should be retained unmodified in ~ as is done by the algorithm. The same conclusion would hold for possibility (c) if tr t were set equal to {t~)/t|~)}. But, it is necessary to have one ~ which works for all members of ~t, and for a given ~t, it is possible for both possibilities to arise. We are able to use ~t - {t~k)/t¢2t)} by making the following observation. In the set of resolvents produced from Ct~ and C2~, where there were formerly

Artificial Intelligence 6 (1975), 103-127

126 D.H. FISHMAN AND J. MINKER

occurrences of the variable t(t k), there are now instances of ther constants which also instantiate t(2 k). Thus, in a template clause for these resolvents, the same variable m u s t occur in the positions where formerly t(tt) appeared, as well as in the positions where t(2~) appeared, In general, the name of the variable is unimportant. What is necessary is that whatever variable is used in the template, that variable must also be used in the H-substitution which, taken together with the template clause, represents the set of resolvents. The sub- stitution ~l, = {t(tt)/t(2k)}causes the occurrences of t2 (~) to be replaced by occurrences of tt~),Therefore, as is done in Step (3.7), we must change the occurrence of t(2 k) in ~ to an occurrence o f t(tkL In dealing with possibility (d), we observe that the only instances of Li in the clauses of C1~ which will unify with instances of L2 in C ,~ are those in which the instanti~ions of t(x ~) and t~ ~) are equal. Suppose ~ contains Sll t[ t) and S2/t [k). If St ~ 52 ----'0, then, since no instances of Lj and L~ in C1~ and C2~, respectively, may be unified, ~ should be removed from cgk, as is done in Step (3.8). If ~b was the only (remaining) member o f ~ , then, as notedabove, the algorithm must terminate unsuccessfully. On the other hand, suppose S ffi $1 c~ $2 ~-0. Then, a template clause associated with the set of resolvents must have an

• occurrence of a single variable in the positions descended from both t[ ~) and t~2 ), and this variable must be restricted to S in the associated H-sub- stitution. Since this is precisely the effect of the algorithm, this completes the discussion of Case 3, and the proof of Theorem 1,

ACKNOWLEDGMENTS

.The work reported herein was supported by the National Science Foundation under Grant NSF GJ-31456, and by the National Aeronautics and Space Administration under NASA NGR 21.002-270, both to the Computer Science Center of the University of Maryland. Additional support for the preparation of this paper was received from the Department of Computer and Information Science, University of Massachusetts. We also wish to acknowled~ the many thoughtful comments and suggestions of the referees.

REFERENCES

I. Auguston, J . G. and:Minker, J, Global parallel unification for large question- answering systems. TR-307, Department of Computer Science, University of Mary- land, CoHegePark, Md. (1974).

2. Bledsoe, W. W., Boyer, R. 5. and Henneman, W. H. Computer proofs of limit theorems. Artificial Intellioence 3 (1) (Spring 1972), 27-60.

3. Chang, C. L. and Lee, R. C. T. Symbolic Logic and Mechanical Theorem Provino. Academic Press, New York (1973).

4. Darlington, J, L. Theorem provers as question answerers (unpublished). Abstract in: Prec. IJCAI, D. E. Walker and L. M. Norton (eds.), The MITRE COrp., Bedford, Mass. (1969), 317.

5. Feldman, J. A, Low, J. R., Swinehart, D. E. and Taylor, R. H. Recent developments in SAn.--An AtC, OL-based language for artificial intelligence. Prec. FJCC, AFIPS Press, Montvale, N.J. (1972), 1193--1202.

Artificial Intelligence 6 (19753, 103-127

H-REPRESENTATION 127

6. Fikes, R. E. REF-ARF: A system for solving problems stated as procedures. Arti- ficial Intelligence I (1970), 27-120.

7. Fishman, D. H. Experiments with a resolution-based deductive question-answering system and a proposed clause representation for parallel search. Ph.D. Thesis, Department of Computer Science, University of Maryland, College Park, Md. (19?3); also published as TR-280, Computer Science Center, University of Marjland (1973).

8. Green, C. C. Theorem proving by resolution as a basis for question answering systems. Machine Intellige:zce 4, B. Meitzer and D. Michie (eds.), American El~vier, New York (1969), 183-205.

9. Hewitt, C. Description and theoretical analysis (using schemata) of PLANNER: A language for proving theorems and manipulating models in robots. Ph.D. Thesis, Department of Mathematics, MIT, Cambridge, Mass. (1972).

10. Kowalski, R. Search strategies for theorem proving. Machine Intelligence 5, B, Meltzer and D. Michie (eds.), American Elsevier, New York (1970), 181-200.

11. Luckham, D. and Nilsson, N. Extracting information from resolution-proof trees. Artificial Intelligence 2 (1) (Spring 1971), 27-54.

12. Minker, J., Fishman, D. H. and McSkimin, J. R. rhe Maryland refutation proof procedure system (MRPPS). TR-208, Computer Science Center, University of Mary. land, College Park, Md. (1972).

13. Minke~, J., Fishman, D. H. and McSkimin, J. R. The Q* algorithmbA search strategy for a deductive question-answering system. Artificial intelligence 4 (3/4) (Winter 1973), 225-243.

14. Minker, J., McSkimin, J. R. and Fishman, D. H. MRPPS--An interactive refutation proof procedure system for question-answering. TR-228, Computer Science Center, University of Maryland, College Park, Md. (1973).

15. Nilsson, N. J. Problem-Solving Methods in Artificial Intelligence. McGraw-Hill, New York (1971).

16. Robinson, J. A. A machine oriented logic based on the resolution principle. J. ACM 12 (1) (January 1965), 23-41.

17. Rulifson, J. F., Derkson, J. A. and Waldinger, R. J. QA4: A procedural calculus for intuitive reasoning. Tech. Note 73, Stanford Research Institute, Menlo Park, Calif. (1972).

18. Sussman, G. J. and McDermott, D. U. From P L a ~ tO cosmvelt---A genetic approach. Prac. F.YCC, AFIPS Press, Montvale, N.J. (1972), 1171-1179.

Received 14 February 1974; revised version received 15 October 1974.

Artificial Intelligence 6 (1975), 103-127