Session 3 Theorem Proving and Logic; I

THE Q* ALGORITHM - A SEARCH STRATEGY FOR A

DEDUCTIVE QUESTION-ANSWERING SYSTEM

Jack Minker Daniel H. Fishman James R. McSkimin The University of Computer Science Center College Park, Maryland 20742

Abstract An approach for bringing semantic, as well as which is a directed graph whose nodes (states) are syntactic, information to bear on the problem of (labeled by) clauses. The initial states are nodes theorem-proving search for Question-Answering

31 developing improved search strategies or using seman­ only if the null clause were in the starting set of tics for theorem-proving systems. (We have recently base clauses. It then successively attempts to gen­ learned that Reiter [1972]4 is attempting to incorporate erate (by selecting a clause from the base set, or by semantics with a theorem prover by the use of models.) inference) clauses into the sets A(0,1) , A(1,0) , Resolution theorem-proving programs typically use the A(0,2) , A{1,1) , A(2,0) , A(0,3) , etc. Any time a unit preference search strategy, developed by Vtos, et clause is generated, an attempt is made to recursively al. [1964]? in which the merit of a clause in the generate all of its successors and successors of its search is based on its length. While this is a useful successors which are of better merit than the current strategy for proving simple theorems, it is not nearly merit to which the algorithm has sequenced. powerful enough to successfully guide a search for even moderately deep mathematical proofs. Furthermore, r* While the above description of the l algorithm it is not adequate for use in question-answering is necessarily terse, the reader is referred to applications which consist largely of unit clauses, Kowalski [1970a, 1970b],7'8and to Minker, et al. since it gives preference to ail unit clauses without [1972, 1973]1'2for more detailed discussions. regard to their relevance to the query. 3. A View of Resolution Theorem-Proving Search Green [1969]6 in considering the application of as Problem-Reduction Search theorem-proving in question-answering systems, parti­ tioned clauses into two sets, active and passive. Ac­ Before describing the operation of the Q* al- tive clauses are inferred clauses and axioms selected gorithm, it will be useful to describe how resolution from the data base, whereas passive clauses are axioms theorem-proving search may be interpreted as problem- which have not yet been selected. Only active clauses reduction search. In a problem-reduction search, an may be used in inferences. A passive clause is made operator is applied to a problem P to reduce it to a active only if it resolves with an existing active set of subproblems such that solution of all the clause; preference is given to passive unit clauses. successor subproblems implies a solution to P . Green incorporated this search approach with the unit Equivalently, the conjunction of these subproblems may preference strategy in the QA3 system which employs, be considered a new problem which must be solved for essentially, set-of-support as its inference system. the given problem to be solved. This reduction pro­ cess is recursively applied to each generated subprob- Kowalski [1970a, 1970b]7,8 Separates the notions of lem until the oriqinal problem has been reduced to a an inference system and a search strategy and describes set of primitive subproblems which are trivial to their respective roles in the theorem-proving search solve. problem. In addition, he defines a class of "upwards diagonal" search strategies which may be applied to More precisely, a problem-reduction consists of arbitrary problem domains. These strategies simul­ three sets: taneously extend and refine the class of search stra­ tegies, which includes the A* algorithm described by (1) a set of starting problems; Hart, Nilsson and Raphael [1968]9 Kowalski also pre- (2) a set of operators that reduce a problem to sents a particular upwards diagonal search algorithm, a set of subproblems; and, which he calls the J algorithm. In the J* algorithm, (3) a set of final problems which are, by the passive/active clause concept is employed. In definition, solved. addition, the algorithm employs a clause merit evalua­ tion function in which both the length and level of a In the context of resolution theorem-proving, a clause are considered. Upwards diagonal search stra­ clause corresponds to a problem and a literal corres­ tegies could also be defined using heuristics other ponds to a subproblem. Thus, a clause is a conjunc• than length and level (see Minker, et al. [1972])1 tion of subproblems since all subproblems must be solved for the problem to be solved (i.e., all lit­ In the 2 algorithm, the merit f(C) of clause erals must be eliminated). C is a tuple, (i,j) , in which i = length(c) , and j = level(C) . Kowalski defines an ordering on this The startinq set of problems corresponds to a merit function which he terms "upwards diagonal merit," starting set of base clauses. The actual members of denoted by the symbol u . Given clauses C1 of this set will depend upon the inference system being merit (i, ,j1) and C2 of merit (i2,j2) tnen used. For instance, if the inference system is set- C1 £_u C, (I.e., C, is of better or equal upwards of-support, or if it includes set-of-support, the diagonal merit than C2) if starting set of problems corresponds to the clauses in the negation of the cruery. For other inference sys­ (i) i + j < i + j , or tems, it consists of the entire set of base clauses, 1 1 2 2 i.e., all of the axioms together with the query clauses. (ii) i1 + j1 = i2 + j2 and i1 < i2 .

Thus, if the length and level of two clauses sum to Clauses may also be regarded as operators which the same value, it is better to generate the shorter are applied to problems by means of inference rules. clause, since the goal of the search strategy is to However, the set of operators that may be applied will generate a clause of length zero. It is thus advan­ vary depending on the inference rule used, e.g., fac­ tageous to discriminate between clauses in this manner toring, paramodulation, and various refinements of re­ rather than solely on the basis of the sum of the solution. For a resolution operation, two clauses are merit components, as is done in earlier search al­ involved. In general, the choice of which clause is gorithms such as the A* algorithm (Hart, et al. the problem and which is the operator is somewhat [1968] P. arbitrary. However, for certain inference systems, it seems natural to make a clearer distinction between Based on this merit function, Kowalski partitions the two. For instance, if input resolution is used, the search space into merit sets, called A-sets, into each clause of a linear chain may be regarded as a which clauses of equal merit are generated. The J* problem and all base clauses may be regarded as oper­ algorithm generates clauses into these merit sets in ators. For linear and SL resolution, ancestors of a increasing upwards diagonal order, It first tries to problem may also be considered as operators, in generate a clause into A(0,0) which would be possible addition to all the base clauses. 32 A clause may also be a final problem. In parti­ tained in Minker, et al. [1972, 1973]1,2.) cular, the null clause is the only such clause when one is attempting to refute a conjecture. Thus, when In using this merit function, it is hoped that a null clause is generated, we know that a starting clauses of better merit will be more useful to answer­ problem has been solved. Determining when a subprob- ing the query than those of worse merit. However, in lem is solved is more difficult. This may be seen by practice, it is extremely difficult to develop com- considering the process involved in solving a subprob- nonents of the merit function that adequately reflect lem. A subproblem P (which corresponds to a literal the relevance of clauses with respect to the query. in a clause), may be solved in either of two wavs: Most components used to date have been syntactic in 1) it may be solved in a single step bv applving an nature, rather than semantic, and have led to very in­ operator that refutes it (a unit clause); 2) alter­ efficient search strategies. (See Slagle and Farrell 11 1 nately, an operator may be applied to P that spawns [1971] and Minker, et al. [1972] for examples.) Con­ a set of subproblems such that P is solved if and sequently, theorem-provers using such a search stra­ only if all of the subproblems are solved. In prac­ tegy are often deluged with irrelevant clauses and tice, the determination of when a given subproblem has thus are inadequate for most applications. been solved may be quite difficult. Depending on the inference system used, subproblems are attacked in There are two ways to alleviate this problem. arbitrary order. Consequently, the bookkeeping re­ First, after a problem is generated by an inference quired to keep track of which literals of a given step, various deletion rules may be applied so that clause have been spawned by which subproblems may be the problem may be eliminated in case it is redundant quite involved. or semantically meaningless. Thus, tautologies, alphabetic variants and subsumed clauses may be However, one inference system, SL resolution eliminated. Furthermore, subproblems as well as prob­ {Kowalski and Kuehner [1971]},10 stands out as being lems mav be eliminated by predicate evaluation. This particularly well suited for this task. In the first mav be done bv referencing stored semantic information place, SL resolution requires that only one subproblem about the problem domain. For instance, let be attempted at a given level. Secondly, the required C v F(Mary, x) be a generated problem, where C is bookkeeping is built into the clause representation the remainder of the clause. If it is known that the used in SL resolution. In this representation, a first argument of the father predicate must be male, clause is referred to as a chain. In SL resolution, a and we know that Mary is female, then the literal subproblem to which a solution is sought is actually F(Marv, x) will never have a solution (i.e., no unit carried along (and duly tagged) in each of the success­ clause/ F{Mary, a) , can be true, for any person a). or chains. Such literals are called "A literals" in We can thus evaluate the literal F(Mary, x) as being the successor clauses. As new literals (called "B lit­ true relative to the interpretation given to the prob­ erals") are introduced in the attempt to solve a sub- lem domain and may eliminate the entire problem from problem, they are placed to the right of the A literal. the search space since it is unsolvable. With most When all such B literals have been resolved awav (re­ inference systems completeness should not be violated solution is only performed on rightmost B literals) and bv deleting the clause. On the other hand, if a lit­ an A literal is exposed on the right, then that con­ eral of a clause is evaluated as false, that literal stitutes a solution to the subnroblem from which that alone, mav be removed, since it corresponds to a sub- A literal descended. At this time, SL resolution re­ problem that is solved. quires that the exposed A literal be removed from the clause - an operation which is called truncation. Only at this time, (and not before as with other re­ Although predicate evaluation using semantic in­ finements of resolution) may a new subproblem from the formation about the problem domain will be useful in original problem be selected for solution. theorem-proving, it does not prevent irrelevant clauses from being generated and entered in the search snace. We thus feel that a more effective method by 4. The Q* Algorithm which to cut down the size of the search space is to avoid generating irrelevant clauses in the first The Q* algorithm is based upon the I algorithm place. In particular, this can be accomplished by of Kowalski together with the idea of Green to allow carefully selecting those operators that are most re­ only certain base clauses to enter the active clause levant to the search in progress and by inhibiting space. Both of these approaches have been extended in those which are irrelevant. This is the function of the current algorithm. The Q* algorithm is subdivided the base clause selection algorithm. into two major components: Depending on the inference system, the algorithm 1) the deduction algorithm which uses primarily treats one or all of the literals of a generated syntactic information; and, clause as a specification with which to select axioms. 2) the base clause selection algorithm which Thus, each literal is termed a "spec literal." (This uses primarily semantic information. mav be viewed as the selection of operators to apply to a subproblem.) In order to select axioms relevant The deduction algorithm generates new problems by to the querv, the Q* algorithm initially generates the application of operators to problems already in clauses from the negation of the query. Each spec the search space. Any operator that is applied must literal is used to locate those axioms which either itself have been previously generated either bv infer­ resolve with the generated clause on that literal, ence or by the selection of a base clause. or, in some cases, which possess a literal which will unify with the spec literal. The axioms that have Problems and operators are generated bv two major been located for a particular spec literal may be re­ subalgorithms, FILL and RECURSE, which are adaptations duced in number by filtering out those which are found of analogous subalgorithms of the £ algorithm. As a to be semantically inappropriate (e.g., because of in­ clause is generated, it is placed into an A-set corres­ compatible argument types). The remaining operators ponding to its merit. The algorithm uses a generalized for a given subproblem then become candidates for upwards diagonal merit function to calculate the merit generation and must be ordered so that "more promis­ of a clause, and generates clauses in approximately ing" operators are tried first. The list of candi­ upwards diagonal order. (Further details on this dates for a spec literal is placed on a list called function as well as on the deduction algorithm are con­ the SPECLIST, which is itself ordered by using various

33 heuristic criteria. Thus, the ordering of the SPECLIST the search strategy will not be hindered from finding reflects the judgment of the base clause algorithm as a refutation if one is attainable. to which subproblems from among all subproblems in all generated clauses should be attacked first. That is, 4.2 Semantic Filtering of Candidate Axioms from among all literals in all generated clauses that are eligible for resolving, the base clause selection Once the potential candidates for a given spec strategy picks the best one. literal are found, these may be subjected to semantic filtering, and only those which are semantically con­ As a result of the control maintained over the sistent with the spec literal and its host clause may base clauses by the base clause selection algorithm, become candidates. This filtering may be done on the the FILL operation of the deduction algorithm will not, basis of the class membership, or type, of a variable in general, acquire all base clauses of a given FILL or constant in the spec literal. For example, suppose merit. It obtains only those base clauses made avail­ the generated clause literal is ~PARENT (Dan, Brett) able to it by the base clause selection algorithm. As and it is known that Dan is a male, or the literal is a result, the base clauses that are selected will not ~PARENT (x, Brett) and, from context, it is known that necessarily be generated in merit order. Consenuently, x corresponds to a male. Suppose further that the and in contrast to the J* algorithm, the Q* algorithm two potential base clause candidates: is not admissible. However, as the exanples in Section 5 demonstrate, the loss of admissibility may be of (1) ~FATHER(u,v) V PARENT(u,v) , and only theoretical importance since it would seem to be (2) ~MOTHER (u,v) V PARENT (u,v) more important in practical QA amplications to find anv solution quickly rather than to find a simplest solu­ were found in the data base. Applying the filter, tion at great expense, at the risk of finding no solu­ axiom (2) would be found semantically inconsistent tion at all because of space and time considerations. with the spec literal since the variable u in the PARENT literal is found to be of type female from con­ The following sections describe the manner in text, (i.e., from its use in MOTHER literal), and which axioms are located, the way certain of these are what is necessary is a PARENT literal whose first filtered out, and the way those that remain are order­ argument is of type male. Thus, only (1) would be­ ed. Section 4.4 presents a discussion of a olanned come a candidate. extension of the search strategy in which the base clause algorithm may prune the search space and delete A further type of filtering may also be perform- certain candidates from the SPBCLIST upon the recogni­ ed. When all of the solutions to a subproblem are ex­ tion of certain events in the search process. plicit in the data base, it becomes unnecessary to generate any general axioms which might be used to de­ 4.1 Locating Candidate Axioms duce a solution to the subproblem. For example, let ~MOTHER(x, Emily) be a generated clause literal. As already indicated, the literals of generated Also assume that it is known that every individual has clauses are used to locate axioms which may become exactly one mother. If the axiom MoTHER(Roz, Emily) candidates for generation. The inference system that were found in the data base, then, since this com- is being used by the deduction algorithm will deter­ pletely solves the subproblem at hand, it would be- mine which generated clauses should be used for this come the only candidate. No other axioms that could purpose, and what criterion should be applied to resolve with ~MOTHER{x, Emily) would be entered to select the axioms. If the inference system in use is satisfy this subproblem. set-of-support, or if it incorporates set-of-support as does SL resolution, then only the literals of The filtering we have described can be seen to supported clauses will be used. Furthermore, the reduce the number of axioms which are generated into axioms which become candidates will be those which the search space. As a result, fewer clauses will be could resolve with the generated clause. On the other available to interact logically and so the total num- hand, if the inference system does not include set-of- ber of clauses which may be generated is thereby re­ support then all genera-ted clauses, including generat­ duced, clearly, the clauses of the implicit search ed axioms, will be used to locate axioms. In addition, space which have become ungeneratable as a result of the resolution criterion must be weakened, so that an this filtering could not have contributed to a refu­ axiom will potentially become a candidate if it con­ tation so that although the search algorithm fails to tains a literal which unifies with a literal of a gen­ be complete (in the sense of exhaustive), it remains erated clause. The weakening of the resolution refutation complete. criterion is necessary in order to assure the refuta­ tion completeness of the algorithm, e.g., in cases 4.3 Ordering of Candidate Axioms and Subproblems where the only refutations for a given ouery involves the use of a lemma, and the ouery is not used until Once the candidate axioms have been located and the lemma has been established. subjected to semantic filtering, they must be ordered so that the "more promising" ones will be generated Not only does the inference system dictate which first. As already noted, there is a two-level order­ clauses are to be used in locating axioms, it also ing that is performed: the candidates associated with dictates which literals should be used. Thus, in a particular spec literal must be ordered (this "single literal" inference systems such as SL resolu­ corresponds to the ordering of operators to be applied tion or A-ordering, only one designated literal of to a subproblem), and the lists of candidates for the each generated clause is used, while for other infer­ various spec literals are ordered with respect to one ence systems, all of the literals will be used for another (this corresponds to the ordering of subprob- this purpose. lems).

The approach to locating axioms which may enter In ordering the candidates for a particular spec into the search, may, for a given query, preclude the literal, two different approaches may be employed. In generation of certain axioms. That is, there may be one approach, they may be ordered according to a axioms which are completely unrelated to the ouery in Teooimendation by the user. This is analogous to the that they concern a different problem domain. But recommendation lists in PLANNER (Hewitt, [1971] )12. since these are completely irrelevant to the query, Another approach is to order candidates according to 34 the merit ordering, f , used by the deduction strategy, in the data axiom. making sure that data axioms (i.e., fully instantiated unit clauses) precede any general axioms. PERSON(JOHN, SMITH, ID475, MALE, FEMALE) .

With respect to ordering the subproblems, a Since such constants do not designate particular in­ heuristic guideline is applied when one or more con­ dividuals, and since they do occur throughout the data stants occur in literals of the query clauses. In base, thev will be of little value in directing the this event, the candidates located by using constant- search. Thus, for the purpose of ordering the carrying literals of generated clauses will precede in SPECLIST, spec literals containing these types of con­ the ordering those candidate axioms located by the use stants alone are treated as general literals. of general literals. The reasoning behind this heuris­ tic is that (1) constant-carrying literals will gen­ 4.4 Semantic Actions During the Search erally resolve (or unify) with fewer base clauses than will general literals, and (2) if a query is about a It was noted in Section 4.2 that some subproblems particular individual (constant), then the search may be comnletelv solved by data axioms stored in the mechanism will make more informed decisions about the data base, More generally, some subproblems have an relevance of candidate axioms if it concentrates on exact number of solutions while others have an in­ this individual, -and to others which are found to be definite number of solutions. If the number of solu­ related to it, rather than going off blindly on the tions to a given subproblem is known, then, during the basis of some general literal. In many cases, the course of the search, the progress of the search rela­ general literal may actually unify with a large subset tive to finding these solutions can be monitored. of the axioms in the data base while only a few of When all of the solutions have been found, that por­ these may be relevant. Furthermore, by pursuing this tion of the search graph which has been unnecessarily policy, literals which are uninstantiated at one level generated in the attempt to find these solutions can of the search may become instantiated at a subsequent be pruned. In addition, the candidate axioms located level. Thus, in this approach, it will often be the through the use of literals in the pruned clauses or case that clues (in the form of constants) to direct in clauses along the solution path will have their the search will be passed from one subproblem to candidate status removed. The effect of this pruning another as the search progresses. is to reduce the number of irrelevant clauses in the search space. Of even greater significance is that the potential successors of these clauses are effec­ Figure 1 illustrates a proof that was derived tively prevented from being generated. giving preference to those literals that contain con­ stants. In Figure 1, clause (l)yields two literals for the SPECLIST. The literal M(y, Sally) would be The bookkeeping required to apply these semantic given preference on this list since it contains a con­ actions would be quite complex when arbitrary infer­ stant. The axioms that can interact with the literal ence systems are employed, since, for a given clause M(y, Sally) are entered into the search before other (problem), attempts to solve all of the subpro- axioms that may apply to that_clause. Similarly, in blons are carried out simultaneously. However, clause (3), the constant in H(v, Rita) gives this SL resolution is particularly well suited for this literal preference. Although proofs can be found approach, since only one subproblem is attacked at a without using this heuristic, such proofs will tend to time and because the bookkeeping required to detect generate many unneeded clauses. the solution of a subproblem is built into the SL clause representation, as noted in Section 3. Seman­ It is reasonable to assume that in question- tic actions are taken when truncation occurs, since answering applications a large percentage of the truncation only occurs when a subproblem has been queries will contain constants. Even if constants solved. The semantic action taken is to increment a count and test it against the number of solutions appear in a given literal, it may be reasonable to sought. If this number is met, then pruning can be give preference to a literal containing only variables performed. based upon a lower estimate of potential candidates satisfying each of these literals. However, we would expect this to happen infrequently in question- The above approach does not require that all answering systems. solutions to a given subproblem be obtained before progressing to another subproblem. It would seem to There may be several subproblems (spec literals) be desirable, in some cases, to continue the search containing constants which must be ordered with re­ for additional solutions to the subproblem, while at spect to one another on the SPECLIST. In this case, the same time advancing to the next subproblem. the ordering of candidate lists by their spec literals is accomplished by using a prediction of the merit, f , 5. Example Runs With MRPPS of a resolvent between the spec literal's host clause and the first axiom in the ordered list of candidates The MRPPS system incorporates a preliminary ver­ from that literal. One consequence of this ordering sion of the Q* algorithm plus an option for selecting is that if a generated unit clause is contradicted by the algorithm. The current implementation of Q* a unit axiom, then this axiom surely will have become does not yet include the semantic filtering of candi­ a candidate, and it will be placed first in the order­ dates, and no mechanism has been included to take ing so that it will be the very next axiom to be gen­ semantic actions. The current version includes the erated. Each time an axiom is removed from the list deduction strategy as outlined, together with a base of candidates, the next candidate in the list is used clause selection strategy which locates and orders for a new prediction, and the corresponding SPBCLIST axioms essentially as described. All details concern­ entry is reinserted into an appropriate position of the ing the current implementation are described in list — it may remain on top of the list, or some other Minker, et al. [1972]l. The implementation of the £ subproblem may emerge as "most promising." algorithm uses the same deduction strategy as Q*, but the base clause selection strategy merely locates In some data bases, there may be certain constants axioms in merit order, that is to say, by length, which occur in a large number of the data axioms. without regard to other clauses generated by the Generally, these would be non-specific, class specify- search. ing types of constants such as MALE and SINGLE as used

35 We present comparative statistics for two differ­ of possible solutions to a subproblem is used. The Q* ent queries, in which set-of-support and SL resolution and 1 algorithms without the use of semantics gener- were the chosen inference systems, and the merit com­ ated the same number of inferences. However, £ ponents were clause length and level. Clause length brought in 381 axioms, only 6 of which were needed. and level bounds were both set at eleven, and an f Q* when not using semantics brought in 16 axioms, only value bound (= length + level) was set at eleven. The 6 of which were actually needed. Q* without semantics data base used contains 295 data axioms which expli­ performed better when using SL resolution than when citly state the (1) mother, (2) father, (3) birth date, using set-of-support as the inference mechanism. The and (4) birthplace of individuals in terms of their use of semantics for Q* shows its general utility. identification (i.d.) numbers, and (5) which relate The number of axioms entered were 7, while only 6 were the first and last name of each individual to their needed for the proof. Although there is a significant identification number. The data base also includes 88 decrease in the number of axioms generated using general axioms which define the various predicates in semantics, the one example should not be considered to terms of other predicates. be the type of improvement that one will always achieve using semantic considerations to restrict the Question 1. "What is the name of Brett Fishman's moth- search. However, it is indicative of the use of semantics. The trace of clauses generated by SL re­ solution and the proof are shown in Figure 2. The significant aspects of this simple question is that its negation in clause form is a unit clause con­ 6. Summary taining constants. With the data base used, it re­ quires four axioms and four levels of search to achieve We have described a search strategy for theorem- a refutation. orovinq which uses both svntactic and semantic infor­ mation to direct the search in a Question-Answering v* Both the l and Q* algorithms successfully com- System. Most theorem-proving systems have used pleted the search, however as the statistics in Table primarily syntactic information such as clause level 2 demonstrate, with considerably different levels of and clause length to direct the search. Others have work and resources required. Whereas the Q* algorithm attempted to use only refinements of resolution with a fortuitously generated the minimal number of base breadth-first search or an ad hoc use of heuristic clauses, the }* algorithm has to generate all axioms rules. Experience with such systems may have led some of length one (i.e., all the data axioms), two, and to speculate that means other than theorem-proving three and some axioms of length four before the re­ must be developed to perform deduction in question- quired general axiom (of length four) was obtained. answering, or in other problems (e.g., Anderson and Once this general axiom was resolved against the query Hayes [1972])13 The reason for this skepticism of clause, the resolvent, having support, could be resolv­ theorem-proving may stem from the inadequacy of search ed against many of the axioms already in A-sets, and strategies to limit the search to a "reasonable" num­ similarly for the resolvents obtained. As a con- ber of nodes in finding proofs. We agree that the use sequence, many more resolvents were generated. of only logical rules and syntactic heuristics will Furthermore, the presence of a large number of clauses not be sufficient for most systems. However, it is in A-sets required the use of a considerable amount of our hope that the introduction of semantic information free space to keep track of the clauses as well as a to aid in directing the search will be useful. significant increase in the search time required. We have tried to show where semantic information may be used in a theorem prover, and how it may coor­ Question 2. "Is there a person who is the grandfather dinate with the syntactic heuristics and logical de­ on the father's side of individual 67 and the grand­ duction. There are several places where semantics father on the mother's side of individual 7?" enter into the search process:

The negation of the Question in clause form is: (1) at the time a clause is generated, to deter­ mine whether it is semantically meaningful; FF(x, 67) V FM(x, 7) (2) in selecting a literal of a clause to ex­ where FF is the predicate "grandfather on the pand; father's side", and FM is the predicate "grandfather (3) in the filtering out of irrelevant oper­ on the mother's side." This question, which requires ators; and six levels of search requires the following six axioms from the set of 295 data axioms and 88 general axioms: (4) in taking actions when a literal is solved. There is, however, a tradeoff as to when semantics F(x, y) V M(y, z) v FM(x, z) should be applied. It may result that the attempt to F(x, y) V F{y, z) V FF(x, z) determine whether or not a clause is solvable could take more time than the solving of the problem. M(4, 7), F(6, 4), F(6, 63), and F(63, 67) . Hence, studies must be performed in this area to determine the various costs involved. Proofs were found using set-of-support and SL resolution as the inference mechanism. The statistics With an arbitrary inference system it is not for set-of-support indicate that the Q* algorithm was always easy to determine when a literal from some quite selective as compared to both with respect to clause has been solved. The bookkeeping that might be the number of resolvents and axioms generated. How­ involved could become unmanageable. However, as de- ever, 0* did obtain considerably more general axioms scribed previously, SL resolution minimizes the book- than actually needed. keeping problem. SL resolution has the additional advantage of providing the opportunity to select which The same question was tested using SL resolution subproblem to attack next. as the inference mechanism. The table shows statistics for the Q* algorithm as generated by the computer, it Some of the semantic information we use is gen- also shows statistics, generated by hand, for the Q* eral, e.g., the count of the number of solutions to a algorithm when the semantic rule of counting the number subproblem; if such information is supplied by the

36 user it could be used to advantage for any problem 10. Kowalski, R. and Kuehner, D. "Linear Resolution domain. A general framework for representing and with Selection Function." applying semantic information is needed. In addition, 2, 3/4, (1971), 221-260. our semantic considerations have been directed primarily at the meaning of constants, and not at the 11. Slagle, J.R. and Farrell, CD. "Experiments in meaning of functions and Skolem functions that may Automatic Learning for a Multipurpose Heuristic frequently occur in clauses. These must also be con­ Program." Ccmm. ACM 14, 2(Feb. 1971), 91-98. sidered. 12. Hewitt, C. "Procedural Embedding of Knowledge in We have presented a first version of the Q* al­ PLANNER." Proc. IJCAI, British Computer Society, gorithm that carbines syntactic and semantic consider­ London, England, 1971, 167-182. ations. Improvements must be made in the algorithm to handle parallel searching such as in CONNIVER (Sussman 13. Anderson, D. and Hayes, P.J. An Arraignment of and McDermott[1972])14 and to implement some of the Theorem-Proying or the Logician's Folly, Memo No. features that were described, but not incorporated in­ 54, Dept. of Computational Logic, School of A.I., to the first version. However, based on limited ex­ University of Edinburgh, Scotland, 1972 . perience with the current version of Q*, it has been observed that the search does restrict the generation 14. Sussman, G.J., and McDermott, D.V. "From PLANNER of clauses. to CONNIVER - A Genetic Approach." Proc. FJCC, AFIPS Press, Montvale, N.J., 1972, 1171-1179. The area of semantics and theorem-proving re­ quires considerably more research and experimentation. This paper has described a first step in exploring this area.

References 1. Minker, J., Fishman, D.H., and McSkimin, J.R. The Maryland Refutation Proof Procedure System (MKPPS). TR-208, Computer Science Center, University of Maryland, College Park, Md., 1972.

2. Minker, J., McSkimin, J.R. , 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.

3. Robinson, J.A. "A Machine Oriented Logic Based on the Resolution Principle." J.ACM 12, l(Jan. 1965), 23-41. 4. Reiter, R. The Use of Models in Automatic Theorem Proving, Technical Report 72-09, Department of' ' Computer Science, University of British Columbia, Vancouver B.C., Canada, September, 1972.

5. was, L.T., Carson, D.F., and Robinson, G.A. "The Unit Preference Strategy in Theorem Proving." Proc. FJCC, Thompson Book Co., , 1964, 6X5-621. 6. Green, C.C. "Theorem Proving by Resolution as a Basis for Question-Answeriiig Systems." In: Meltzer, B. and Michie, D. (Eds.), Machine Intelli- ence 4, American Elsevier, New York, 1969, 183- g05:— 7. Kowalski, R. Studies in the Completeness and Efficiency of Theorem-Proving by Resolution. Ph.D. Thesis, U. of Edinburgh, 1970a.

8. Kowalski, R. "Search Strategies for Theorem Proving." In: Meltzer, B. and Michie, D. (Eds.), Machine Intelligence 5, American Elsevier, Hew York, l970b, 181-266. 9. Hart, P., Nilsson, N., and Raphael, B. "A Formal Basis for the Heuristic Determination of Minimum Cost Paths." IEEE Trans. Sys. Sci. Cybernetics 4, 2(1968), 100-107.

37 Table 1

(1) Figures do not include the clause from the negation of the theorem (2) These calculations were performed by hand since the routines that are to handle semantics have not yet been implemented.

(3) Set-of-support (4) Linear resolution with selection function (5) Freespace refers to the storage needed by clauses formed by resolving or factoring

38 Figure 1. The use of constants to guide the search.

39 TRACE OF GENERATED CLAUSES PROOF