ALL Formalizing Access Limited Reasoning

y

J M Crawford

Benjamin Kuip ers

Department of Computer Sciences

The University of Texas At Austin

Austin Texas

jccsutexasedu

kuip erscsutexasedu

May

Abstract

AccessLimited ALL is a language for knowledge representation which formalizes the access

Where a classical deductive metho d or logic limitations inherent in a networkstructured

programming language would retrieve all assertions that satisfy a given pattern an accesslimited logic

retrieves all assertions reachable by following an available access path The complexity of inference is thus

indep endent of the size of the knowledgebase and dep ends only on its lo cal connectivity AccessLimited

Logic though incomplete still has a well dened semantics and a weakened form of completeness Socratic

Completeness which guarantees that for any query which is a logical consequence of the knowledgebase

there exists a series of queries after which the original query will succeed This chapter presents an

overview of ALL and sketches the pro ofs of its So cratic Completeness and p olynomial time complexity

Intro duction

It has long b een a guiding principle in work on semantic networks that by imp osing a network structure

on large knowledge bases one can increase the eciency of reasoning Intuitively in a semantic network

related concepts are lo cated close together in the network and thus search and inference can b e guided by

the structure of the knowledgebase However formalisms for semantic networks have generally treated the

semantic network notation as a variant of predicate calculus and have regarded the access limitations inherent

indexing mechanisms In AccessLimited Logic ALL we incorp orate in a network to b e an extralogical

these access limitations directly into the logic One b enet of this approach is that we can assess the impact

of access limitations on the completeness and complexity of reasoning ALL is in fact not complete but it

is So cratically Complete that is for any query which is a logical consequence of the knowledgebase there

exists a series of queries after which the original query will succeed Further the complexity of inference in

of a knowledgebase and dep ends only on the size of the accessible p ortion ALL is indep endent of the size

of the knowledgebase

This work has taken place in the Qualitative Reasoning Group at the Articial Intelligence Lab oratory The University of

Texas at Austin Research of the Qualitative Reasoning Group is supp orted in part by NSF grants IRI IRI

and IRI by NASA grants NAG and NAG and by the Texas Advanced Research Program under grant no

This pap er app eared in John Sowa Ed Principles of Semantic Networks San Mateo CA Morgan Kaufmann

pp

y

Supp orted in part by a fellowship from GTE

OVERVIEW OF ACCESSLIMITED LOGIC

Reasoning is hard If a knowledge representation language is as expressive as rstorder predicate calculus

then the problem of deciding what an agent implicitly knows ie what an agent could logically deduce from

its knowledge is unsolvable Bo olos Jerey Thus a sound and decidable knowledge representation and

reasoning system must either give up expressive p ower or use a weak inference system with an incomplete set

of deduction rules or articial resource limits eg b ounds on the numb er of applications of modus ponens

However such inference systems tend to b e dicult to describ e semantically and tend to place unnatural

reasoning ability Levesque limits on an agents

As an example of nontrivial inference consider the following problem from Wylie

In a certain bank the p ositions of cashier manager and teller are held by Brown Jones and

Smith though not necessarily resp ectively The teller who was an only child earns the least

Smith who married Browns sister earns more than the manager

What p osition do es each man ll

A p erson lo oking at such a problem cannot come up with a solution immediately though the p ositions follow

from a fairly small amount of commonsense knowledge ab out families partial orders and coreference A

certain amount of conscious thought is required one has to ask oneself just the right questions Similarly

we do not exp ect our knowledgerepresentation system to b e able to solve such a problem immediately since

intuitively we exp ect it to b e able to reason only ab out as well as a p erson could reason without conscious

thought We do however exp ect it to b e able to solve such a problem after b eing given an appropriate set

of leading questions If we ask

If Smith were the manager then how could he earn more than the manager

If Smith were the teller then how could he earn more than the manager

If Brown were the teller then how could he have a sister

then one can see immediately that Smith must b e the cashier Brown the manager and Jones the teller

Similarly a knowledgerepresentation system after b eing ask by the user or heuristically generating such

a series of questions should b e able to determine which man holds which p osition We have translated this

problem into ALL and given it along with appropriate commonsense knowledge to our lisp implementation

Algernon Inference in Algernon is incomplete and Algernon fails initially to solve the problem However

after we ask it the questions given ab ove it is able to determine which p osition each man lls

1

More abstractly ALL has an imp ortant prop erty we call Socratic Completeness for any query of a

prop osition which is a consequence in predicate calculus of the knowledgebase there exists a preliminary

query after which the original query will succeed ALL also has a more technical weakened completeness

prop erty which we call Partitional Completeness Roughly Partitional Completeness says that if all facts

and rules needed to prove a query are lo cated close enough see section to the query then it will succeed

immediately

The rest of this chapter is organized as follows In section we discuss our general approach to knowledge

representation Section gives an overview of the formalization of ALL and the pro ofs of So cratic and

Partitional Completeness We outline the argument for the p olynomial time complexity of ALL in section

In section we briey discuss related work and section is our conclusion

Overview of AccessLimited Logic

In the broadest sense the study of knowledgerepresentation is the study of how to represent knowledge in

such a way that the knowledge can b e used by a machine From this vague denition we can conclude that

a knowledgerepresentation system must have the following prop erties

1

We have since discovered that the idea of So cratic Completeness is also used in Powers where it is referred to as

So cratic Adequacy

OVERVIEW OF ACCESSLIMITED LOGIC

It must have a reasonably compact syntax

It must have a well dened semantics so that one can say precisely what is b eing represented

It must have sucient expressive p ower to represent human knowledge

It must have an ecient p owerful and understandable reasoning mechanism

It must b e usable to build large knowledgebases

It has proved dicult however to achieve the third and forth prop erties simultaneously

Our approach in ALL b egins with the well known mapping b etween atomic prop ositions in predicate

stands in relation r to the ob ject b calculus and slots in frames the atomic prop osition that the ob ject a

can b e written logically as r a b or expressed in frames by including ob ject b in the r slot of ob ject a

Hayes

a

P

P a b

values f b g

We refer to the pair ha r i as a frameslot Thus r a b is equivalent to saying that the value b is in the

2

frameslot ha r i The frames directly accessible from a frameslot are those which app ear in the frameslot

Extending this idea we dene an access path in a network of frames as a sequence of frames such that each

is directly accessible from a frameslot of its predecessor It is useful to generalize this denition and allow

access paths to branch on all values in the frameslots A sequence of prop ositions denes an access path

if any variable app earing as the rst argument to a prop osition has app eared previously in the sequence

op erationally this means that retrieval always accesses a known frameslot For example Johns parents

sister can b e expressed in ALL as the path

entJ ohn x sister x y par

This denes an access path from the frame for J ohn to the frames for J ohns parents found by lo oking in

the frameslot hJ ohn par enti to J ohns parents sisters

F rom access paths we build the inference rules of ALL A rule is always asso ciated with a particular

slot in the network Backward chaining ifneeded rules are written in the form the structure of

and is discussed b elow and applied when a value for the slot is needed Forward chaining ifadded rules

and applied when a new value for the slot is inserted In either case the are written in the form

antecedent of a rule must dene an access path b eginning with the slot the rule is asso ciated with For

example using the access path ab ove we can write the ifneeded rule

aunt J ohn y par entJ ohn x sister x y

But we cannot write the logically equivalent rule

auntJ ohn y sister x y par entJ ohn x

3

since the antecedent do es not dene an access path

2

Slots in ALL contain only frames and rules dened b elow

3

The restriction to access paths limits the syntax of ALL but is not a fundamental limit on its expressive p ower since one

could always add a new constant and make it the rst argument to every predicate This would amount to making the entire

knowledgebase a single frame

THE LOGICAL COHERENCE OF ALL

Where a classical deductive metho d or language would retrieve all known assertions

that satisfy a given pattern an accesslimited logic retrieves all assertions reachable by following an available

access path The use of access paths alone however is insucient to guarantee computational tractability in

very large knowledgebases The evaluation of a path can cause an explosive backchaining of rules which can

spread throughout the knowledgebase To prevent this ALL intro duces a second form of access limitation

The knowledgebase in ALL is divided up into partitions and backchaining is not allowed across partitions

facts in other partitions are simply retrieved When used together these two kinds of access limitations

can limit the complexity of inference to a p olynomial function of the size of the p ortion of the knowledgebase

accessible from the lo cal partition

The Logical Coherence of ALL

A price must b e paid for the eciency of access limitations Inference in ALL is weaker than inference in

predicate calculus since only lo cally accessible facts and rules can b e used in deductions However logical

coherence do es not necessarily require completeness Rather it is an informally dened collection of desirable

formal prop erties We have proven that a dialect of ALL has the following prop erties of a logically coherent

knowledge representation system

ALL has a well dened syntax and pro of theory

The semantics of ALL can b e dened by a purely syntactic mapping of ALL knowledgebases queries

and assertions to predicate calculus

In terms of this mapping inference in ALL is consistent So cratically Complete and Partitionally

Complete

These prop erties are stated more precisely in theorems b elow

We view these formal prop erties as necessary but not sucient conditions for logical coherence There

remains at least the less formal claim that knowledge can b e organized cleanly into partitions This claim

is discussed further in sections and

The rest of this section sketches the formal development of ALL The full account can b e found in

Crawford Kuip ers Our formal work in ALL generally lags several months b ehind our implementation

work and the results presented here only formalize a part of ALL Sp ecically our current formalism do es

not allow negation or quantication though our lisp implementation supp orts b oth see section

Basic Notation

In the metatheory of ALL we use the following notation Quantied expressions are written in the form

hQuantif ier ihV ar iabl e i hRang e i hE xpr ession i

Thus for example

x pr ed x pr ed x

1 2

is read For all x such that pr ed x pr ed x Similarly

1 2

x pr edx f oo x

where f oo is a set valued function denotes the union over all x such that pr edx of f oo x

We delineate lists with the usual and notate the empty list by nil If is a list then

head is the rst element in

r est is all but the rst element in

We dene append to b e the result of app ending the list to the b eginning of the list

1 2 1 2

THE LOGICAL COHERENCE OF ALL

Syntax of ALL

The syntax of ALL is quite similar to the syntax of logic programming Accordingly we develop the syntax

of ALL generally following the notation in Apt

Alphab ets Terms and Prop ositions

The alphabet of an AccessLimited Logic consists of countably innite sets of variables constants and

uer y and asser t A term is a constant or a variable relations the connectives and and the op erators q

4

r t t is a proposition i r is an nary relation and all t are terms A fact is a prop osition such that

1 n i

all t are constants For a term prop osition or list of prop ositions

i

v ar s is the set of variables app earing in

r el ations is the set of relations app earing in

constants is the set of constants app earing in

then is ground so a ground prop ositions is a fact If v ar s

Access Paths

An access path or simply a path is a pair hV i where is a list of prop ositions and V is a set of variables

In general the rst argument to each prop osition in must have o ccurred previously in The variables in

V are exceptions to this rule and may o ccur as the rst argument to prop ositions without having o ccurred

previously in The need for such exceptions will b ecome apparent when rules are dened b elow If V fg

then we omit it and say is a path A path of length one is a primitive path

Rules

Assume r t t is a prop osition and is a nonempty list of prop ositions r t t is an

1 n 1 n

ifneeded rule i b oth of the following hold

Either t is a constant and is a path or t is a variable and hft g i is a path

1 1 1

v ar sft t g v ar s

1 n

Intuitively the rst restriction ensures that when the rule is red ie when the consequent of the rule

has b een unied against a primitive path the antecedent is an access path The second restriction ensures

that any substitution which grounds the antecedent of a rule also grounds its consequent

r t t is an ifneeded rule we use the accessor functions K ey r t t If

1 n 1 n

C onseq r t t and Ant Intuitively the K ey of a rule is the prop osition the rule is

1 n

indexed under in the knowledgebase

Assume r t t is a prop osition and is a nonempty list of prop ositions r t t is an

1 n 1 n

ifadded rule i b oth of the following hold

hv ar shead i is a path

v ar sft t g v ar s

1 n

4

n place relations cause no problems in ALL Intuitively r t t corresp onds to putting the value t t in the r

n n

1 2

slot of t 1

THE LOGICAL COHERENCE OF ALL

As for ifneeded rules the rst restriction ensures that when the rule is red ie when the head of the

antecedent of the rule has b een unied against a fact b eing added to the knowledgebase the antecedent is

an access path The second restriction again ensures that any substitution which grounds the antecedent of

a rule also grounds its consequent

If r t t is an ifadded rule we again use the accessor functions K ey head

1 n

C onseq r t t and Ant

1 n

KnowledgeBases

If S is a set then s s is a partitioning of S i

1 n

i i n s S and

i

S

i i n s S

i

ledgeBase K is a sixtuple hC R N r Ar F P i where A Know

C A set of constants

R A set of relations

N r A set of ifneeded rules such that N r constants C r el ations R

Ar A set of ifadded rules such that Ar constants C r el ations R

F A set of facts such that f f F constantsf C r el ationsf R

R P A partitioning of C

If K hC R N r Ar F P Ai is a knowledgebase and is a prop osition list of prop ositions or a rule

then is al lowed in K i constants C r el ations R Finally the memb ers of P are referred to

as the partitions of K

Unless otherwise sp ecied a knowledgebase K should b e understo o d to have comp onents hC R N r Ar F P i

i i i

we subscript Ar and F b ecause as will b e seen they are the two comp onents which change when op erations

are p erformed

Op erations and Formulas

If is a path then q uer y is a query If is a primitive path then q uer y is a primitive query If

f is a fact then asser tf is an assertion assertions of paths are not currently allowed Any query or

assertion is an operation and any assertion or primitive query is a primitive op eration If O q uer y

or O asser t is an op eration and is allowed in a knowledgebase K then O is al lowed in K If an

op eration O is allowed in a knowledgebase K then O K is an ALL formula

Mapping ALL to Predicate Calculus

We dene the semantics of ALL by mapping ALL knowledgebases assertions and queries to rst order

predicate calculus An alternative approach would b e to dene a mo del theory for ALL in terms of which

ALL is complete This could b e done but we b elieve that since the mo del theory of predicate calculus is

well understo o d mapping to predicate calculus and appropriately weakening the notion of completeness

gives a more p erspicuous picture of the semantics of ALL Further we b elieve that consistency and So cratic

Completeness relative to predicate calculus or p erhaps an appropriate nonmonotonic logic are necessary

prop erties for any knowledge representation system

Mapping ALL to predicate calculus is straightforward Prop ositions do not change at all Paths b ecome

conjunctions Rules b ecome implications with all variables universally quantied Knowledgebases b ecome

the conjunction of their rules and facts We notate the Predicate Calculus equivalent of an ALL ob ject a

C a by P

THE LOGICAL COHERENCE OF ALL

Knowledge Theory

The knowledge theory of ALL denes the values of ALL formulas by dening the action of ALL op erations

ie queries and assertions Intuitively the assertion of a fact f adds f to a knowledgebase and returns the

resultant knowledgebase ie the knowledgebase after f is added all applicable ifadded rules are applied

and all ifadded rules are closed see section A query of q returns the substitutions needed to make

q true in the knowledgebase It also returns a new knowledgebase since pro cessing the query may change

the knowledgebase by invoking rules

tions Substitu

A substitution is a nite mapping from variables to terms

v t g fv t

1 n n 1

where the v i n are distinct variables If all t i n are constants then is ground Let the

i i

variables in the alphab et see section b e V A substitution is a renaming i it is a bijection ie a

onto mapping from V to V

If e is an expression and is a substitution then e is the result of applying to e simultaneously

replacing each o ccurrence in e of the variables in fv v g with the corresp onding term

1 n

If there exists a substitution such that then is more general than Intuitively if is more

general than then do es strictly less work than A unier of two primitive prop ositions q and q is

1 2

a substitution such that q q The most general unier of two primitive prop ositions q and q is a

1 2 1 2

unier of q and q such that for any other unier of q and q is more general than A unier of

1 2 1 2

q and q is relevant i it binds only variables in q and q and it maps to only variables in q and q We

1 2 1 2 1 2

5

r uq q It has b een shown in Apt that notate the most general relevant unier of q and q as mg

1 2 1 2

any prop ositions which are uniable have a most general relevant unier

The Partitions of ALL Op erations

Intuitively a partition of K corresp onds to a part of the knowledgebase which is somehow semantically

cohesive and distinct from the rest of the knowledgebase Facts and rules are often thought of as b eing in

partitions and op erations are thought of as taking place in subsets of C R unions of partitions The

intuition b ehind this comes from the frame view of ALL knowledgebases Recall that ALL constants can b e

thought of as frames and relations as slots in these frames eg the fact r c c is equivalent to having the

1 2

value c in the r slot of the frame c Thus a pair hr ci can b e thought of as a particular slot in a particular

2 1

frame in the knowledgebase Recall that we refer to such a pair as a frameslot Partitions are thus sets

of frameslots Further note that any primitive path by the denition of a path must reference exactly

one frameslot and thus can b e said to b e in a partition In fact since partitions can overlap it can b e in

several partitions and any op eration on is p erformed in the subset of C R formed by taking the union

of these partitions Intuitively this union denes the rules which are available to the op eration

More formally if K is a knowledgebase and r c t t is a primitive path ie c a constant and

1 n

all t i n are terms and p is a subset of C R eg a partition or the union of several partitions then

i

6

and O q uer y or O asser t then the union of partitions p i hc r i p If P fp p g

1 n

for O is

par O i i n p p

K i i

5

The use of most general relevant uniers instead of just most general uniers is necessary for technical reasons The basic

problem with most general uniers is that one can comp ose a most general unier with an arbitrary renaming and the result

is still a most general unier

6

Recall that a knowledgebase K is understo o d to have comp onents hC R N r Ar F P i Thus P is the set of partitions of

K

THE LOGICAL COHERENCE OF ALL

The Domain and Range of All Op erations

diering only in facts and Any given sets C R N r P dene a nite set of p ossible knowledgebases KB

ifadded rules and an innite set of ground substitutions binding variables in the alphab et to constants

7

in C For any op eration O allowed in the knowledgebases in KB note that an op eration allowed in any

knowledgebase in KB is allowed in all knowledgebases in KB



K B O KB

We notate these returned values with pairs h Set of Substitutions Knowledge Base i and use sub and

k b as accessors on the rst and second comp onents resp ectively

alues of ALL Op erations The V

Dening the values of ALL op erations is primarily a matter of formalizing the action of forward and backward

chaining rules We use the following basic notation for knowledgebases and substitutions

If K and K are knowledgebases diering only in their facts and ifadded rules then

1 2

K K hC R N r Ar Ar F F P i

1 2 1 2 1 2

If further f is a fact allowed in K then

1

f hC R N r Ar F ff g P i K

1 1 1

and f K i f F If and are substitutions then notates followed by If further is a set

1 1 1

of substitutions then f j g

1 1 1 1

For a primitive op eration O we dene O K p to b e the result of the op eration O on the knowledgebase

n

K in some subset of C R p with rule chaining cut o at depth n A certain amount of technical care is

required to formalize O as it requires carefully dening forward and backward rule chaining Details of

n

the denition are given in the app endix

We dene O to b e the union over all n of O in the partition of O The idea here is to cause O to

n

b e a xedp oint of rule applications We will eventually show in section that there is always an n after

which increasing the depth of rule chaining do es not aect the result Thus intuitively O chains just far

enough so that chaining any farther would have no aect one advantage of this approach is that recursive

rules eg rules of form q q do not cause problems in ALL or its lisp implementation

It will b e imp ortant that the knowledgebases resulting from ALL op erations are closed We guarantee

this by applying the function cl osur e to the knowledgebase which is to b e returned Closed knowledgebases

and cl osur e are discussed in the next subsection

We thus dene

O K par O n n O K cl osur e

n K

The result of a nonprimitive op eration can then b e dened in terms of the results of its constituent primitive

op erations If O is nonprimitive then it must b e a query see section Assume O q uer y for some

path Further assume q head and r est then

If subq uer y q K fg ie q uer y q failed

O K hfg K i

else q uer y q succeeded so we branch on all resultant substitutions and union the results

S

subq uer y q K h subq uer y K O K cl osur e

k bq uer y q K k bq uer y K i

Figure shows a query on a simple knowledgebase

7

but we generally omit the subscripts since they are clear from Technically we should write KB and

CRN r P CRN r P

context

THE LOGICAL COHERENCE OF ALL

Assume K is a knowledgebase such that

C fcg

R fr r g

1 2

N r fr c x r c xg

1 2

Ar fg

F fr c cg

2

P ffhc r i hc r igg

1 2

Consider q uer y r c xK where x is a variable This is a primitive op eration and

1

par r c x fhc r i hc r ig so we must rst compute

1 1 2

K

q uer y r c xK fhc r i hc r ig

0 1 1 2

Rule backchaining is cut o at depth zero so no rules apply and

q uer y r c xK fhc r i hc r ig hfg K i

0 1 1 2

an empty list of substitutions is returned since there is no known value of x for which the query

succeeds However when we calculate

q uer y r c xK fhc r i hc r ig

1 1 1 2

the ifneeded rule applies and

q uer y r c xK fhc r i hc r ig hffxcgg K r c ci

1 1 1 2 1

fxcg binds x to c As n is increased further there are no other rules to apply so

q uer y r c xK hffxcgg K r c ci

1 1

Figure A query on a simple knowledgebase

THE LOGICAL COHERENCE OF ALL

Assume K is a knowledgebase such that

C fcg

R fr r r g

1 2 3

N r fg

Ar fr x x r x x r x xg

1 2 3

F fr c cg

1

P ffhc r i hc r i hc r igg

1 2 3

Assume that we dene cl osur eK K Consider asser tr c cK After this op eration b oth

2

r c c and r c c will b e facts in the knowledgebase However q uer y r c cK will fail The

1 2 3

rule r x x r x x r x x never applies b ecause r c c was added b efore r c c

1 2 3 1 2

Figure An example of ifadded incompleteness

The Problem of IfAdded Incompleteness

In ALL the application of an ifadded rule is triggered by the assertion of a fact which matches the K ey of

the rule One problem with this approach is that if one is not careful it can b e the case that rules whose

antecedents are entailed by the knowledgebase may never re Such a case is shown in the gure

Our solution to this problem is to close the ifadded rules in the knowledgebase Intuitively this means

that for any fact f and any ifadded rule q if there is some substitution mg r uf head then we

add to the knowledgebase the rule r est q For a knowledgebase K we notate by cl osur eK the

knowledgebase formed by closing all the ifadded rules in K We also use the shorthand cl osur ehK i for

hcl osur eK i

that the initial knowledgebase is not closed since it includes Consider the example in gure Note

the rule r x x r x x r x x and the fact r c c but not the rule r c c r c c Further if we

1 2 3 1 2 3

consider asser tr c ccl osur eK then the resultant knowledgebase do es include r c c

2 3

Implementation Note

There are three imp ortant dierences b etween the formal denitions of ALL op erations given here and our

lisp implementation First in the formalism when an op eration branches eg when several rules are applied

or when the evaluation of a path branches on several p ossible instantiations of its variables the branches

are computed separately in parallel and the results are unioned together In our implementation the

branches are computed serially ie one rule is applied and then the next rule is applied in the resultant

8

knowledgebase There are two advantages of the formalization presented here over a serial formalization

First the complexity analysis is considerably simplied and second the formalism given here would also

apply to a parallel implementation of ALL

The second dierence is that our implementation supp orts limits on the accessibility of rules which have

b een omitted for simplicity from the current formalization In our implementation a rule can b e asso ciated

with a frame f and only accessed from frames known to b e in an isa relation with f Intuitively such

0 0

9

rules apply only to memb ers of the set f

0

8

Since ALL op erations are monotonic the serial implementation returns knowledgebases which are sup ersets of those given

our completeness results carry over to the serial case by the formalism Hence

9

Such access limitations can b e formalized The key idea is that when a rule asso ciated with a set is translated to predicate

relation to its antecedent It should b e p ossible to show that calculus see section one must prep end an appropriate isa

the completeness results carry over some care must b e taken however when dening the closur e of a knowledgebase with

THE LOGICAL COHERENCE OF ALL

Our implementation of cl osur e demonstrates a useful application of rules asso ciated with sets One might

worry that closing a knowledgebase might add a large numb er of ifadded rules and thus slow the system

since we have to try to unify against all of them However we asso ciate these ifadded rules with very

small sets sets of size one and they are thus ignored except when they are needed Consider a rule added in

the closure of a knowledgebase It must b e of form r est q It follows from the denition of ifadded

rules that r est must b e a path This implies that headr est must b e of form r c t t Thus

1 n

in our implementation we simply asso ciate this rule with a set consisting of the single element frame c

creating such a set if it do es not exist

The third dierence is also related to our implementation of cl osur e Consider an assertion of a fact f

This assertion may trigger an ifadded rule which asserts a fact f into a partition p which is disjoint from

the partitions of f In our implementation f is queued in p and any ifadded rules for f are not applied

until attention is drawn to p by some op eration in p This ensures that the complexity of an op eration is

a function only of the rules in its partitions We have not yet incorp orated the notion of queuing assertions

into our formalism Thus facts are closed with resp ect to all ifadded rules in the knowledgebase and the

complexity of an op eration as will b e seen in section is a function of the set of all ifadded rules in the

knowledgebase

Consistency

Consistency is often intuitively thought of as Y ou cant derive a contradiction Consistency requires that

10

the substitutions returned by a query must b e semantic consequences of the old knowledgebase The

requirements on the new knowledge base are more subtle Consistency intuitively requires that prop ositions

do not suddenly b ecome true or in mo del theoretic terms that mo dels are not suddenly lost Thus any

mo del of the new knowledgebase must also b e a mo del of the old knowledge base and in an assertion a

mo del of the formula b eing asserted

of ALL For any know ledgebase K any path al lowed in K and any fact f Theorem Consistency

al lowed in K

subq uer y K PC K j PC

PC K j PC k bq uer y K

PC K P C f j PC k basser tf K

Pro of sketch The pro of of consistency is primarily a matter of carefully working through the denition

of O One inducts on n to show for all n that O is consistent One can then induct on the length of to

n

show that O is consistent

Completeness

Completeness can b e thought of as Any true fact is derivable Thus completeness requires that all sub

stitutions which are semantic consequences of the old knowledgebase are returned by query Completeness

also requires that true facts do not suddenly b ecome false In mo del theoretic terms this means that we do

not gain mo dels Thus any mo del of the old knowledgebase must also b e a mo del of the new knowledge

base Note that the requirements for completeness are essentially the requirements for consistency with their

implications reversed

resp ect to an isa relation

10

More precisely for any query of a path if is returned then P C must b e a consequence of the knowledgebase

THE LOGICAL COHERENCE OF ALL

Assume K hC R N r Ar F P i is a knowledgebase such that

C fcg

R fr r r g

1 2 3

N r fr c x r c xg

1 2

Ar fr c x r c xg

1 3

F fr c cg

2

P ffhc r i hc r i hc r igg

1 2 3

Consider q uer y r c xK This query must fail since it matches no facts in F and there are no

3

ifneeded rules for r c x But any mo del of PC K must b e a mo del of PC r c c by the two

3 3

rules and the fact that r c c is in F Hence inference in ALL is not complete

2

Figure A form of incompleteness in ALL

Conjecture Completeness of ALL For any know ledgebase K any path al lowed in K and any

fact f al lowed in K let be the set of al l ground substitutions binding al l and only variables in Then

PC K j PC subq uer y K

PC k bq uer y K j PC K

PC k basser tf K j PC K P C f

Unfortunately part one of this conjecture is false In some cases rules necessary for a query to succeed

cannot b e accessed Two such cases are shown in the gures and

Notice however that in the example in gure

q uer y r c xk bq uer y r c xK

3 1

would succeed since r c c is added to k bq uer y r c xK by the ifadded rule r c x r c x

3 1 1 3

Similarly in gure

q uer y r c xk bq uer y r c xK

1 2

succeeds This suggests the idea b ehind Socratic Completeness Informally the So cratic Completeness

Theorem says that for any query of which should succeed in a knowledgebase there exists a series of

preliminary queries after which a query of will succeed We also show a second typ e of weakened

completeness result Partitional Completeness Partitional Completeness says that if all information needed

to pro cess a query can b e lo cated by the ifneeded rules in the partitions of the query then the query will

succeed

So cratic Completeness

To state the So cratic Completeness theorem we need a shorthand for the result of a series of queries

If is a series of paths allowed in a knowledgebase K then let

q uer y nil K K

q uer y K q uer y headk bq uer y r estK

THE LOGICAL COHERENCE OF ALL

Assume K hC R N r Ar F P i is a knowledgebase such that

C fcg

R fr r r g

1 2 3

N r fr c x r c x r c x r c xg

1 2 2 3

Ar fg

F fr c cg

3

P ffhc r ig

1

fhc r i hc r igg

2 3

Consider q uer y r c xK This query must fail since the only rule for r c x dep ends on r c x

1 1 2

which matches no facts in F and is not in par r c x so no rules for r c x re But any

K 1 2

mo del of PC K must b e a mo del of PC r c c by the two rules and the fact that r c c is in

1 3

F

Figure Another form of incompleteness in ALL

Theorem So cratic Completeness For any know ledgebase K any path al lowed in K and any fact

f al lowed in K let be the set of al l ground substitutions binding al l and only variables in Then

PC K j PC

a ser ies of paths al l ow ed in K subq uer y k bq uer y K

PC k bq uer y K j PC K

PC k basser tf K j PC K P C f

Pro of sketch Parts and follow relatively easily from the denitions of O and PC Part is shown

by induction on the length of The tricky part is the base case We map K to an equivalent logic program

LP K One can then show that for any rule in K which would apply on the next iteration of T

LP (K )

where T is the immediate consequence op erator in logic programming see Crawford Kuip ers or

Apt there exists a path in ALL the query of which will cause the rule to re this result would not hold

for ifadded rules if we did not close our knowledgebases see section We know from the study of

logic programming see Apt that completeness with resp ect to the immediate consequence op erator

is sucient to guarantee completeness

Partitional Completeness

Intuitively Partitional Completeness says that if all information needed to prove a query is lo cated close

enough to the query then the query will succeed Formally close enough will mean that the information

is reachable using only ifneeded rules in the partitions of the query In order to state the Partitional

Completeness Theorem we rst have to dene which rules in the knowledgebase are considered part of

which partitions A rule is considered a part of a partition if it could b e triggered by queries to and assertions

into the frameslots in that partition Counterintuitively partitions limit access to rules not facts When

we sp eak of a fact as b eing in a partition we mean that the fact is queried or asserted using the rules in

that partition Theoretically a rule could access facts in every partition of the knowledgebase it is the use

of access paths not partitions which limits access to facts

COMPLEXITY

If K is a knowledgebase p C R and S is a set of rules from K then S n the restriction of S to p

p

is given by

S n f j S K ey r t t

p 1 n

t a constant ht r i p

1 1

t a v ar iabl e c C hc r i p ft cgg

1 1

Intuitively S n is the restriction of S to only the rules in p The knowledgebase K with its rules

p

restricted to only the ifneeded rules in p C R is given by

K n hC R N rn F fpgi

p p

Note that K n is never computed in the denition of ALL formula or in our lisp implementation of ALL

p

It is only a formal ob ject used to state the partitional completeness theorem

Theorem Partitional Completeness For any know ledgebase K and any primitive path q al lowed in

K let be the set of al l ground substitutions binding al l and only variables in q then

q

PC K n j PC q subq uer y q K

q

par (q )

K

Pro of sketch The pro of of this theorem again relies on results from the study of logic programming

Let g r oundq b e the set of all variable free instantiations of q Further for any logic program pg and any

let set of facts I

I I T

pg

T n I T T nI

pg pg pg

The key lemma is that for any p C R and for all n

g r oundq n k bq uer y q K p T

n

) LP (K n

p

Intuitively this says that if a fact is an instantiation of q and is in the knowledgebase pro duced by n

iterations of the immediate consequence op erator then it is in the knowledgebase pro duced by q uer y q

n

From this lemma the result again follows by the observation from the study of logic programming see

Apt that completeness with resp ect to the immediate consequence op erator is sucient to guarantee

completeness

Complexity

In this subsection we show that a primitive ALL op eration can b e computed in time p olynomial in the size

of the p ortion of the knowledgebase accessible to it We fo cus on primitive op erations since nonprimitive

op erations are dened as sequences of primitive op erations equation

To discuss the complexity of ALL it is useful to return to the view of an ALL knowledgebase as a

collection of frames and slots This view was intro duced in section and discussed further in section

The basic idea is that constants are thought of as frames and relations are thought of as slots The fact

r c c is equivalent to putting c in the r slot of the frame c Recall that if c is a frame and r is a slot then

1 2 2 1

we refer to the pair hc r i as a frameslot Recall also that partitions are simply collections of frameslots

The denition of the accessible p ortion of a knowledgebase is fairly technical and is given in Crawford Kuip ers

In this section we simply give the intuitions b ehind the denitions

For a knowledgebase K and p C R we rst dene r ul esp Ar N rn Now consider a primitive

p

op eration O allowed in a knowledgebase K and assume O q uer y q or O asser tq We dene

the r each q p to include all frameslots which can b e accessed in the calculation of O in p with rule

n n

COMPLEXITY

backchaining cut o at depth n and chang e q p to include all frameslots which can b e changed in the

n

calculation of O in p with rule backchaining cut o at depth n We dene f r ames q p to include all

n n

frames which O can access with rule backchaining cut o at depth n f r ames q p includes the frames

n n

app earing in frameslots in r each q p plus the frames app earing explicitly in rules in r ul esp or in q

n

O to include all facts and rules which could p otentially b e added to itself Finally we dene cl osur e

&r f

the knowledgebase by O

We dene ops O to include all op erations that O p otentially dep ends on These include all queries

n n

of frameslots in r each q par O and all assertions of frames in f r ames q par O into frameslots

n K n K

in chang e q par O some amount of care is required to prove that ops includes all the assertions and

n K

queries which O dep ends on for details and a formal denition of the set of all op erations which O

n

dep ends on see Crawford Kuip ers

We then dene

r eachq p n n r each q p

n

chang eq p n n chang e q p

n

f r amesq p n n f r ames q p

n

opsO n n ops O

n

Figures and show r each chang e and ops for two simple queries

Theorem If O q uer y q or O asser tq is a primitive operation al lowed in a closed know ledgebase

K then let

nopsO j opsO j

nf r O j f r amesq par O j

K

nr ul esO j r ul espar O j

K

Final ly let ma be the maximum arity of any relation in R mv ar sO be the maximum number of variables in

any rule in r ul espar O and l en be the maximum length of the antecedent of any rule in r ul espar O

k K

O K can be computed in time of order

ar s(O )+ma 5 2 5 5mv

l en nopsO nr ul esO nf r O

Pro of sketch O is dened as an innite union of O s thus it is not obvious how it can b e computed

n

However one can show that if there is an n at which all the op erations which O dep ends on ie all

op erations in opsO return the same value they returned at n then O K O K par O

n K

One can further show that such an n exists and can compute a b ound for it Consider the vector of all

op erations in opsO There are

nopsO

such op erations As we increase n the knowledgebases returned by these op erations may not shrink Further

if we ever reach a p oint where none of them grow then we can quit Any ALL op eration can only add a

fact or complete an ifadded rule there are no op erations for example which create an entirely new frame

The facts and rules which can b e added must b e in the set cl osur e O and one can show that the size

f &r

mv ar s(O )

of this set is b ounded by l en nr ul es O nf r O Each iteration may increase at worst one

knowledgebase in the set of knowledgebases returned by the op erations in opsO Thus if n is greater

than or equal to

mv ar s(O )

nopsO l en nr ul es O nf r O

COMPLEXITY

Recall the knowledgebase K from gure

C fcg

R fr r g

1 2

N r fr c x r c xg

1 2

Ar fg

F fr c cg

2

P ffhc r i hc r igg

1 2

Consider O q uer y r c x where x is a variable Let q r c x and p par O then

1 1 K

r each q p fhc r ig

0 1

r each q p fhc r i hc r ig

1 1 2

r each q p fhc r i hc r ig

2 1 2

r each q p fhc r i hc r ig

n 1 2

r eachq p fhc r i hc r ig

1 2

Thus

chang eq p fhc r ig

1

opsO fq uer y r c x q uer y r c x q uer y r c c

1 2 1

q uer y r c c asser tr c cg

2 1

Figure The accessible frameslots and dep endent op erations for a simple query

COMPLEXITY

Recall the knowledgebase K from gure

C fcg

R fr r r g

1 2 3

N r fr c x r c x r c x r c xg

1 2 2 3

Ar fg

F fr c cg

3

P ffhc r ig

1

fhc r i hc r igg

2 3

Consider O q uer y r c x where x is a variable Let q r c x and p par O then

1 1 K

r each q p fhc r ig

0 1

r each q p fhc r i hc r ig

1 1 2

r each q p fhc r i hc r ig

2 1 2

r each q p fhc r i hc r ig

n 1 2

r eachq p fhc r i hc r ig

1 2

Thus

chang eq p fhc r ig

1

opsO fq uer y r c x q uer y r c x q uer y r c c

1 2 1

q uer y r c c asser tr c cg

2 1

Figure The accessible frameslots and dep endent op erations for a query in a knowledgebase with

two partitions

RELATED WORK

then all knowledgebases must b e full

Thus it only remains to nd the time to calculate the result of a primitive op eration O given the results

n

We may have to apply at most of all op erations O

1 n

nr ul esO

rules Each rule may branch on all values in f r amesq par O for all variables Thus we may have

K

mv ar s(O )

nf r O

branches the results of which must b e unioned together Finding the result of each branch involves taking

at most l en unions and closures There are thus order

l en

unions and closures p er branch Each union is done on a knowledgebase of form K S where S is of size

j cl osur e O j or smaller Thus each union can b e done in time of order

f &r

mv ar s (O )

l en nr ul es O nf r O

Finally one can show that each closure can b e computed in time

2

2 2mv ar s(O )+ma

l en nr ul es O nf r O

Multiplying these b ounds together gives the time b ound in the theorem

Related Work

ALL draws from several diverse elds We attempt only to sketch in general terms the elds from which it

draws and discuss a few particularly relevant past approaches

ALL draws from semantic networks Brachman et al Bobrow Winograd Findler Quillian

Shapiro Vilain the intuition that retrieval and reasoning can b e guided and limited by the structure

of the network This has long b een a key intuition b ehind semantic networks the knowledge required

to p erform an intellectual task generally lies in the semantic vicinity of the concepts involved in the task

Schub ert In particular ALL draws from semantic networks its frame based data structures Minsky

and the idea of access paths Our use of access paths is closely related to previous work on path based infer

ence Path based inference can b e traced back at least to Raphael and later to Schwarcz et al and

Shapiro Wo o dmansee A go o d discussion of path based and no de based inference b oth of which are

partially subsumed by inference in ALL and would b e totally subsumed if ALL supp orted full quantication

see section is given in Shapiro

One dierence b etween ALL and much recent careful work on knowledge representation is that ALL along

with rstorder logic and the original work on semantic networks allows the knowledgebase designer to name

the relations used in the knowledgebase After Wo o ds inuential Whats in a Link pap er Wo o ds

many knowledge representation languages restricted the allowable relations to a small set which were given

a precise syntax and semantics Brachman Shapiro Our approach in ALL is to dene our semantics

by b orrowing the mo del theory of predicate calculus by mapping ALL knowledgebases to statements in

predicate calculus and proving consistency and weakened completeness results and to allow relations to b e

given any names The meanings of the relations are thus restricted only by the contents of the knowledgebase

as in predicate calculus

ALL also diers from past formal work on semantic networks in that it uses a single general purp ose

mechanism which is guided by the structure of the network Past work has generally retrievalreasoning

CONCLUSION

used the structure of the network only for sp ecial purp ose reasoning spreading activation classication

etc and has relied on a rstorder logic theorem prover Brachman et al Schub ert et al or a

weaker deduction system Levesque PatelSchneider Vilain for general reasoning

A notable exception to this generalization is the recent work of Haan and Schub ert Schub ert

Haan Schub ert ALL and the networks of Schub ert share several features including the use of ac

cess limitations to guide reasoning The most obvious way to use the structure of a semantic network to

limit access would b e to p erform deduction with facts not more than a few say mayb e two no des away in the

network The problem with this strategy is that some no des eg the no de for your sp ouse may have a large

numb er of links many of which are irrelevant to the problem at hand The solution used in ECOSYSTEM

is to maintain a taxonomy of knowledge and use this taxonomy to guide reasoning Haan Schub ert

The dierence in ALL is that access is limited to known access paths which access facts many no des away

in the network but do so in a controlled fashion Thus in ALL it is the structure of the knowledge itself or

more sp ecically the structure of the access paths in the rules which controls access and reasoning

Another relevant line of research is the work on vivid knowledgebases Etherington et al A vivid

knowledgebase trades accuracy for sp eed Etherington et al by constructing a complete

of ground facts from facts that may b e presented in a more expressive language This approach has some of

the same goals as ALL particularly in the area of eciency but takes a much dierent approach and

makes dierent tradeos At a very high level the principal dierences are

ALL represents all the knowledge that has b een asserted though not all of it may b e accessible at a

given time while a vivid knowledgebase is an approximation of the asserted knowledge thus weakened

completeness results such as So cratic Completeness do not hold for vivid reasoning

To obtain increased eciency ALL trades completeness for sp eed while a vivid approach trades b oth

consistency and completeness for sp eed

The design of the inference mechanism in ALL has b een heavily inuenced by logic programming In fact

any functionfree logic program without negation can b e written in ALL Further the notation and results

from the pro of of the completeness of logic programming Apt Lloyd have b een used extensively in

the completeness pro ofs for ALL In a sense our use of accesspaths is a strategy for ordering conjunctive

In fact if queries and as such is related to the more elab orate approach given in Smith Genesereth

11

one follows a discipline of avoiding frameslots containing a large numb er of frames then the use of access

paths enforces an ordering on conjunctive queries much like that discussed in Smith Genesereth

Conclusion

Given a knowledge representation system with a mo del theory and a knowledgebase one may divide the

set of all p ossible queries in several ways For example one can distinguish the queries which succeed from

those which fail If this set is exactly equal to the set of all queries which are mo del theoretic consequences of

the knowledgebase then the knowledge representation system is consistent and complete In ALL we divide

the set of all queries into three sets

Those which succeed immediately

Those which will succeed after some appropriate series of preliminary queries

Those which will never succeed without additional assertions

11

s is very large then one would like to avoid lling the slot member s with all the memb ers of thing s Eg if the set thing

rather the preferred representation in ALL for f is a thing would b e to put thing s in the isa slot of f

CONCLUSION

So cratic Completeness then gives a precise characterization of the second and third sets the second set is

equal to the set of all queries which are mo del theoretic consequences of the knowledgebase and the third

set is equal to the set of all queries which are not mo del theoretic consequences Partitional Completeness

gives a partial characterization of the rst set a query will succeed immediately if all the information

needed to prove it is lo cated close enough to the query in the knowledgebase

out So cratic Completeness Ab

12

One of the questions asked ab out our work was What go o d is So cratic Completeness when So crates is

dead Meaning that the hard part of reasoning has simply b een pushed o to the problem of p osing the right

questions The rst answer to this question is that in a system with the expressive p ower of rstorder logic

the incomputability never go es away our approach decomp oses the problem of reasoning into two parts

the tractable problem of computing the results of queries and the intractable problem of deciding what

queries to ask Past work has made other divisions eg the Tb ox and Ab ox of Brachman et al

The second answer is that our goal is to develop a knowledge representation system with understandable

inferential p ower To this end So cratic Completeness is a necessary but not yet sucient prop erty So cratic

Completeness guarantees that there is some hop e of eventually nding the right questions by guaranteeing

that the questions exist

These answers suggest two directions for future work rst enco ding in the knowledgebase common

sense knowledge ab out what general typ es of queries are useful for solving common typ es of complex reasoning

problems and second the identication of other weakened completeness prop erties which like Partitional

Completeness dene what queries should immediately succeed

So cratic Completeness is also a step toward a formal sp ecication of what inferential p ower a knowledge

representation system should provide Due to its intractability full logical completeness is to o strong a sp ec

ication but provides an upp er b ound in the search for an appropriate sp ecication So cratic Completeness

is a fairly weak sp ecication but is arguably a necessary prop erty Thus it provides a lower b ound on the

space of appropriate sp ecications

Ab out Partitional Completeness

Partitioning the knowledgebase is not a new idea Minskys original prop osal Minsky for frames envi

sioned a structure on the knowledgebase consisting of groups of related frames Hayes Naive Physics Man

ifesto Hayes also viewed commonsense knowledge as consisting of clusters of closely related concepts

lo osely related to each other Closer to the implementation level blackb oard architectures HayesRoth

also group inference metho ds into weakly interacting partitions While these intuitions ab out the mo dularity

of knowledge are p ersuasive it must b e admitted that it has not yet b een empirically demonstrated that the

contents of largescale commonsense knowledgebases divide naturally into partitions

If we accept the intuition that knowledge can b e meaningfully divided into partitions or p erhaps b efore

we commit to accepting this intuition we would like to know what eect partitions have on reasoning

Intuitively one would exp ect that the rules in the partition of a query would somehow b e more easily

accessible to the query The Partitional Completeness Theorem gives a partial formalization of this intuition

by saying that if a query is a logical consequence of the ifneeded rules in its partitions then the query will

succeed immediately The theorem also gives us an empirical way to test a partitioning of a large knowledge

base if simple queries dep end on many rules in other partitions and thus require many preliminary queries

b efore they succeed then the partitions are not well chosen

12

By Rich Thomason at the Workshop on Formal Asp ects of Semantic Networks

CONCLUSION

Ab out the Complexity Results

The expression given in theorem for the complexity of inference in ALL involves to o many variables to b e

easily comprehended In a typical knowledgebase one might exp ect that

nf r O nr ul esO

ma

nopsO nf r O

Let n nf r O If we further assume that l en is small then ALL op erations can b e computed in time of

order

3ma+5+5mv ar s(O )

n

Certainly a tighter b ound could b e computed with somewhat more work In general we have found

that our examples run much faster than the worst case b ound However the complexity analysis is still a

useful exercise Our implementation of ALL originally used an algorithm which was exp onential in the worst

case Replacing it with an algorithm similar to the one given here greatly improved its run time Further

the complexity result gives some guidance in the design of knowledgebases For example it suggests that

while the length of rules makes little dierence rules with many variables should b e avoided

Implem enting ALL

Our lisp implementation of ALL is considerably more p owerful than the formalism presented in this pap er

and can express denite descriptions full negation some typ es of defaults and quantication Beyond

simple examples of forward and backwardchaining we have investigated some standard examples of default

inheritance essentially implementing the inferential distance rule of Touretzky the Yale sho oting

problem Hanks McDermott several examples which involve reasoning ab out sets of similar ob jects

and some examples of reasoning from quantied information eg From Every man loves a woman conclude

g e loves We have also solved the bank problem mentioned in that there must b e some woman that Geor

the intro duction Our most recent work involves the use of ALL to express the ideas of Qualitative Pro cess

Theory Forbus The result Crawford Farquhar Kuip ers is a system which compiles qualitative

descriptions of physical situations into qualitative dierential equations which can b e simulated by QSIM

13

Kuip ers

Ultimately we are working towards a formal theory which has the expressive p ower of predicate calculus

and is consistent and So cratically Complete but is still computationally tractable It is straightforward to

add to ALL the ability to express full classic negation ie not negation by failure but then inference in

ALL using rules alone is no longer So cratically Complete We are currently working to formalize in ALL

eductio Ad Absurdum used in our implementation Reasoning by Reductio Ad the notion of reasoning by R

Absurdum involves adding assumptions to the knowledgebase and then reasoning ab out their consequences

and if the consequences of an assumption include false concluding the negation of the assumption We

b elieve that such a mechanism will allow So cratically Complete reasoning in the presence of classic nega

tion Further the queries determine what assumptions are made so the complexity of ALL should still b e

p olynomial though some hard problems may require an exp onential numb er of preliminary queries

There is also no way to express existential quantication in our current formalism We have incorp orated

denite descriptions which dene a typ e of existential quantication into the implementation of ALL but

their formalization is not straightforward as they do not seem to translate naturally into predicate calculus

Our most recent work has b een on adding to the implementation the ability to represent and do some

kinds of reasoning with arbitrarily nested quantied expressions Our approach to nested quantication is

based on the idea of arbitrary ob jects Fine One may for example reason ab out a large class of ob jects

by reasoning ab out an arbitrary ob ject having the prop erties common to all ob jects in the group Future

pap ers will discuss this work in more detail

13

This is joint work with Adam Farquhar

ACKNOWLEDGMENTS

Acknowledgments

The authors would like to thank Len Schub ert Rich Thomason and Charles Petrie for careful readings and

useful comments on various versions and drafts of this pap er

Formal Denition of O A App endix

n

In this app endix we give the formal denition of O This amounts to dening with great care the familiar

n

b ehavior of forward and backward chaining rules in a knowledgebase This is a nontrivial exercise but it is

necessary in order to carefully prove the theorems Further a careful formulation of forward and backward

chaining reveals at least one interesting and unexp ected problem the problem of ifadded incompleteness

discussed in section

Formally for any n and any op eration O allowed in the knowledgebases of KB

R C 

O KB K B

n

We dene O in the following cases In all cases assume K is a knowledgebase a nonempty path

n

allowed in K q a primitive path allowed in K f a fact allowed in K and p a subset of C R We use the

shorthand

l ook upq K f jf K mg r uq f g

Base case O is a primitive op eration and O p or n Case

If O q uer y q then

O K p hl ook upq K K i

n

else O asser tf and

O K p hffgg cl osur eK f i

n

Case O is a primitive op eration n and O p

First we nd the rules which apply Let b e a renaming which maps variables in rules in N r to

variables not used in O or K this must b e p ossible since the alphab et contains a countably innite

numb er of variables

If O q uer y q then

R f j N r mg r uK ey q g

Else O asser tf and

R f j Ar mg r uK ey f g

If R then let

K k bO K p

n1

Otherwise we apply the rules and union the results Applying a rule consists of querying its antecedent

and then asserting its consequent The consequent is asserted with all substitutions under which the

antecedent succeeds

If O q uer y q then

R k bq uer y AntK p cl osur e K

n1

subq uer y AntK p

n1

k basser t C onseq K p

n1

REFERENCES

O K p hl ook upq K K i

n

Else O asser tf and

K cl osur e R k bq uer y AntK f p

n1

subq uer y AntK f p

n1

k basser t C onseq K f p

n1

O K p hffgg K i

n

Case Nonprimitive queries O q uer y where a path of length greater than Assume head q

and r est If subq uer y q K p fg ie q uer y q failed

n n

O K p hfg K i

n

else q uer y q succeeded so we branch on all resultant substitutions and union the results

n

S

O K p cl osur e subq uer y q K p

n n

h subq uer y K p

n

k bq uer y q K p k bq uer y K p i

n n

References

Allen Allen J F Giuliano M and Frisch A M The HORNE Reasoning System TR

Computer Science Department University of Ro chester Ro chester NY

Apt Apt Krzysztof R Intro duction to logic programming revised and extended version

Technical Rep ort TR Department of Computer Science University of Texas at Austin Austin

Texas To app ear in Handbook of Theoretical Computer Science J van Leeuwen Managing Editor

NorthHolland

Brachman Brachman R J Whats in a concept structural foundations for semantic networks

Int J ManMachine Studies

Brachman Brachman R J On the epistemological status of semantic networks In Findler

Reprinted in Brachman Levesque pp

Brachman et al Brachman RJ FikesR E and Levesque H J Krypton A functional ap

proach to knowledge representation FLAIR Technical Rep ort No Fairchild Lab oratory for Articial

Intelligence Research Palo Alto CA May revised version in IEEE Computer

Reprinted in Brachman Levesque pp

Brachman Levesque Brachman Ronald J and Levesque Hector J Readings in Know ledge Repre

sentation Morgan Kaufmann Los Altos Cal

Bobrow Winograd Bobrow Daniel G and Winograd Terry An overview of KRL a knowl

edge representation language Cognitive Science Reprinted in Brachman Levesque

pp

ogic Cambridge Uni Bo olos Jerey Bo olos George S and Jerey Richard C and L

versity Press New York

REFERENCES

Crawford Kuip ers Crawford J M and Kuip ers B Towards a theory of accesslimited logic

for knowledge representation Proceedings of the First International Conference on Principles of Know l

edge Representation and Reasoning Morgan Kaufmann Los Altos California

Crawford Kuip ers Crawford J M and Kuip ers B Towards a Formalization of Access Limited

Logic Technical Rep ort AI TR University of Texas at Austin

Crawford Farquhar Kuip ers Crawford J Farquhar A and Kuip ers B QPC A Compiler

from Physical Mo dels into Qualitative Dierential Equations AAAI

Etherington et al Etherington David W Borgida Alex Brachman Ronald J and Kautz Henry

pp Vivid knowledge and tractable reasoning preliminary rep ort IJCAI

Fagin Halp ern Ronald Fagin and Joseph Y Halp ern Belief awareness and limited reasoning

Articial Intel ligence

Findler Findler NV Associative Networks Representation and Use of Know ledge by Computer Aca

demic Press New York

Fine Fine Kit Reasoning With Arbitrary Objects Aristotelian So ciety Series Volume Basil Black

well Oxford

Forbus K D Forbus Qualitative pro cess theory Articial Intel ligence

Haan Schub ert Haan J and Schub ert L K Inference in a topically organized semantic net

AAAI pp

Hanks McDermott Hanks Steve and McDermott Drew Default reasoning nonmonotonic

and the frame problem AAAI pp

Hayes Hayes Patrick J The second naive physics manifesto In Formal Theories of the Com

monsense World ed Hobbs Jerry R and Mo ore Rob ert C Ablex Publishing Co New Jersey pp

Hayes Hayes Patrick J The logic of frames In Frame Conceptions and Text Understanding ed

D Metzing Walter de Gruyter and Co Berlin pp Reprinted in Brachman Levesque

pp

HayesRoth HayesRoth B A blackb oard architecture for control Articial Intel ligence Jour

nal

Hintikka Hintikka J Know ledge and Belief Cornell University Press Ithaca NY

Kay Kay M The MIND system In Natural Language Processing ed R Rustin Algorithmics

Press New York

Kuip ers Kuip ers B J Mo deling spatial knowledge Cognitive Science

Kuip ers Kuip ers B J On representing commonsense knowledge In Findler

Kuip ers B J Kuip ers Qualitative simulation Articial Intel ligence

Lenat et al Doug Lenat Mayank Prakash and Mary Shepard Using common sense

knowledge to overcome brittleness and knowledge acquisition b ottlenecks AI Magazine VI Winter

REFERENCES

Levesque Levesque H J Knowledge representation and reasoning In Ann Rev Comput Sci

Annual Reviews Inc Palo Alto California

pp Levesque Levesque HJ A logic of implicit and explicit b elief AAAI

Lloyd Lloyd JW Foundations of Logic Programming SpringerVerlag New York

McCarthy McCarthy J Generality in articial intelligence CACM

Minsky Minsky Marvin A framework for representing knowledge In The Psychology

of Computer Vision ed PH Winston McGrawHill New York A later version reprinted in

Brachman Levesque pp

Mo ore Mo ore R Reasoning ab out Knowledge and Action MIT PhD thesis

PatelSchneider PatelSchneider P A decidable rstorder logic for knowledge representation

IJCAI

Palamidessi Palamidessi Catuscia Algebraic Prop erties of Idemp otent Substitutions Univer

sity of Pisa manuscript

I No Powers Powers L H Knowledge by deduction The Philosophical Review LXXXVI

pp

Quillian Quillian M Ross Word concepts A theory and simulation of some basic semantic

capabilities Behavioral Science Reprinted in Brachman Levesque pp

Raphael Raphael B SIR semantic information retrieval In Semantic Information Processing

ed M Minsky MIT Press Cambridge MA pp

Schub ert Schub ert LK RG Go eb el and NJ Cercone The structure and organization of a

semantic net for comprehension and inference In Findler pp

Schub ert et al Schub ert LK Papalaskaris MA and Taugher J Determining typ e part

color and time relationships IEEE Computer

Schub ert Hwang Schub ert LK and Hwang CH An Episo dic Knowledge Representation for

Narrative Texts Proceedings of the First International Conference on Principles of Know ledge Repre

sentation and Reasoning Morgan Kaufmann Los Altos California

Schwarcz et al Schwarcz RM Burger JF and Simmons RF A deductive question

answerer for natural language inference CACM March

Shapiro Shapiro SC Pathbased and no debased inference in semantic networks Tinlap

Theoretical Issues in Natural Languages Processing ed D Waltz ACM New York

Shapiro Shapiro SC and the SNePS Implementation Group SNePS Users Manual Depart

ment of Computer Science SUNY at Bualo pp

Shapiro Wo o dmansee Shapiro SC and Wo o dmansee GH A net structure based relational

question answerer description and examples IJCAI The MITRE Corp Bedford MA pp

Smith Genesereth Smith David E and Genesereth Michael R Ordering conjunctive queries

Articial Intel ligence

Touretzky Touretzky David S The Mathematics of Inheritance Systems Morgan Kaufmann Los Altos California

REFERENCES

Treitel Genesereth Treitel Richard and Genesereth Michael R Cho osing directions for rules

Journal of

Vilain Vilain M The restricted language architecture of a hybrid representation system IJCAI

pp

Wo o ds Wo o ds W Whats in a link foundations for semantic networks In Representation and

Understanding Studies in Cognitive Science ed Bobrow D and Collins A Academic New York

pp

Logic Dover Publications Inc Mineola New York Wylie Wylie CR Jr Puzzles in Thought