Logic-based processing of semantically complex natural language discourse

30
New Generation Computing, 9 (1991) 39-68 OHMSHA, LTD. and Springer-Verlag OHMSHA, LTD. 1991 Logic-Based Processing of Semantically Complex Natural Language Discourse John DINSMORE Department of Computer Science, Southern Illinois University at Carbondale, Carbondale, IL 62901, USA. Received 13 October 1988 Revised manuscript received 6 June 1990 Abstract A logic-based system of knowledge representation for natural language discourse has three primary advantages: It has adequate expressive power, it has a well-defined semantics, and it uses simple, sound, general rules of inference. On the other hand, a standard logic-based system has the following dis- advantages: It supports only an exceedingly complex mapping from surface discourse sentences to internal representations, and reasoning about the content of semantically complex discourses is difficult because of the incommodious complexity of the internalized formulas. Spaceprobe 5> is a non-standard logic-based system that supports a powerful model of discourse processing in which discourse content is distributed appropriately over multiple spaces, each representing some aspect of (a possible) reality, in accordance with the principles of partitioned representations. 6'1z) It retains the advantages of the standard logic-based representation, while overcoming the disadvantages. In addition, it can be used to account for a large number of discourse-level phenomena in a simple and uniform way. Among these are presupposition and the semantics of temporal expressions. This paper illustrates the superiority of the partitioned representations model over a standard logic-based model in processing semantically complex discourse. Keywords: Natural Language Processing, Knowledge Representation, Partitioned Representations, Context-Dependence.

Transcript of Logic-based processing of semantically complex natural language discourse

Page 1: Logic-based processing of semantically complex natural language discourse

New Generation Computing, 9 (1991) 39-68 OHMSHA, LTD. and Springer-Verlag

�9 OHMSHA, LTD. 1991

Logic-Based Processing of Semantically Complex Natural Language Discourse

John D I N S M O R E Department o f Computer Science, Southern Illinois University at Carbondale, Carbondale, IL 62901, USA.

Received 13 October 1988 Revised manuscript received 6 June 1990

Abstract A logic-based system of knowledge representation for natural language discourse has three primary advantages:

It has adequate expressive power, it has a well-defined semantics, and it uses simple, sound, general rules of inference.

On the other hand, a standard logic-based system has the following dis- advantages:

It supports only an exceedingly complex mapping from surface discourse sentences to internal representations, and reasoning about the content of semantically complex discourses is difficult because of the incommodious complexity of the internalized formulas.

Spaceprobe 5> is a non-standard logic-based system that supports a powerful model of discourse processing in which discourse content is distributed appropriately over multiple spaces, each representing some aspect of (a possible) reality, in accordance with the principles of partitioned representations. 6'1z) It retains the advantages of the standard logic-based representation, while overcoming the disadvantages. In addition, it can be used to account for a large number of discourse-level phenomena in a simple and uniform way. Among these are presupposition and the semantics of temporal expressions. This paper illustrates the superiority of the partitioned representations model over a standard logic-based model in processing semantically complex discourse.

Keywords: Natural Language Processing, Knowledge Representation, Partitioned Representations, Context-Dependence.

Page 2: Logic-based processing of semantically complex natural language discourse

dO J. Dinsmore

w Problems in Standard Logic-Based Discourse Processing In typical logic-based natural language understanding systems a surface

input sentence is mapped onto an internal representation that takes the form of an isolated predicate calculus formula or something close to it. 2~ The strengths of this model of semantic processing are that it potentially achieves an unambiguous and uniform representation that has a well-defined semantics and supports inferences using a small set of very general rules. I will refer to this model of internal representation as standard in order to distinguish it from the extended logic-based model described in this paper.

On the other hand, the standard model several profound weaknesses, which become painfully clear in semantically complex discourses like that of Fig. 1. Although this discourse is somewhat contrived in order to demonstrate several different problems in a short amount of space, its complexity can hardly be considered excessive. Nevertheless, discourses of even this complexity are rarely considered in discussions of models of natural language understanding.

Once upon a time, there was a tailor named Siegfried. Siegfried had once consulted a famous wizard. The wizard mistakenly thought Siegfried was

an alcoholic. Still, i f Siegfried would work hard, he wouM be very successful The wizard assumed that anyone who was rich was happy. Well, Siegfried would be rich, and would even stop drinking.

Now the tailor Siegfried did work hard and had in fac t become rich. But he was not happy, and he had actually become an alcoholic.

Fig. 1 The Siegfried story.

What we will discover about the use of a standard logic-based system is:

that it leads to very complex internal representations, that the mapping from surface discourse sentences to internal representa- tions is very indirect and leaves many discourse-level problems unac- counted for, and that the derivations of many inferences that, intuitively, should be very simple, are in fact prohibitively expensive.

I will use Fig. 1 to illustrate these three concerns, then show how the logic-based Spaceprobe system can be used to overcome these problems.

I. 1 Standard Internal Representations A reasonable standard logical representation for the discourse in the

Siegfried story (with a few simplifications not relevant to the present discussion) is found in Fig. 2. In Fig. 2, / = = > is used to represent the counterfactual condition ( " ~ ... were the case, then ..."). Otherwise, the syntax used should be self-explanatory.

The main observation to make about this standard internal representa- tion is that it is cumbersome, involving several layers of sentential embedding.

Page 3: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 41

(1) in(story_6, at(time_5, exist(siegfried) & taylor(siegfried))) (2) t ime7 ~ time_5 ~ in(story_6, at(time_7, consult(siegfried, wizard_8)

& wizard(wizard 8) & famous(wizard_8))) (3) in(story_6, at(time_7, believe(wizard_8, alcohollc(siegfried)))

& -- alcoholic(siegfried ) )) (4) in(story_6, at(time_7, believe(wizard_8,

work hard(siegfried) / = = > successful(siegfried)))) (5) in(story_6, at(time7, believe(wizard_8,

(rich(X) : : > happy(X))))) (6) in(story_6, at(time_7, believe(wizard_& work_hard(siegfried) /= = >

(rieh(siegfried) & stop(siegfried, drink(siegfried)))))) (7) in(story_6, at(time 5, work hard(siegfried) & rieh(siegfried))) (8) in(story_6, at(time_5,--happy(siegfried) & alcoholic(siegfried)))

Fig. 2 A standard logical representation of the Siegfried story.

Nevertheless, these layers are all necessary for representing the full semantics of the discourse. For instance, the embedding of everything within the syntactic context in(story_6 .... ) is required, in principle at least, because the discourse is f ict ional. If the system has any other function besides reading this one story, just as humans perform multiple functions like watching movies and buying gro- ceries, then the representation cannot be allowed to entail that the tailor Siegfried actually exists (or existed) or that there are (or were ever) real wizards.

It is largely the resulting incommodious bulk of these representations that is responsible for the problems standard logic-based systems have in getting from discourse sentences to internal representations, and in making reasonably fast inferences over those internal representations.

1 .2 Mapping to Standard Internal Representations The mapping from the surface sentence to the fully disambiguated inter-

nal representation in a standard logic-based system is often very indirect and difficult to account for. First, more levels of sentential embedding are found in the logical representation than in the surface sentence. In Fig. 2 the bold-face portions of the internal representations correspond roughly to the explicit content of the surface discourse sentences, while the italicized portions are implicit in the surface sentences, yet required to unambiguously express the full propositional content. Second, there are many lower-level details involved in mapping from surface discourse sentences to internal representations. Among these are determining referents for definite descriptions and satisfying presuppo- sitions. An example of the latter problem occurs in the penultimate sentence of Fig. 1: "s top" is supposed to be a presuppositional verb such that "Siegfried ...

would even stop drinking," should presuppose that Siegfried has drunk prior to that time.* Intuitively, the presupposition is satisfied, even though it is implied in the story that Siegfried did not drink prior to that time. Apparently this has

* Dinsmore 2> provides an overview of the problem of presupposition.

Page 4: Logic-based processing of semantically complex natural language discourse

42 J. Dinsmore

something to do with the preceding sentence, "The wizard mistakenly thought that Siegfried was an alcoholic," but the principles that underlie the satisfac- tion of the presupposition remain unclear, and appear to be impossible to formulate in terms of a standard logic-based representation.

1 .3 Inferences on Standard Internal Representations The internal representations in standard logic-based systems are often far

too complex to make the kind of inferencing required in human discourse processing practical. For instance, most people can make the following inference naturally and effortlessly in understanding the Siegfried story:

in(story_6, at(time_7, believe(wizard_8, work_hard(siegfried) / = = > happy(siegfried))))

The wizard believed that i f Siegfried would work hard he would be happy.

Yet, as the reader can determine, this is not easy to derive logically. This inference would require the use of several complicated axioms about the predicates in, at, believe, a n d / - - = > in a rather long derivation. The difficulty is that the complexity of the standard logical representations requires a lot of unpacking by appropriate axioms in order to derive inferences. What is missing in the representation is some structure that coherently represents in one place everything known about the possible situation that the wizard believed would exist if Siegfried were a hard worker.

Spaceprobe is a powerful logic-based system for representation and reasoning that overcomes these problems. Although it exhibits a clear semantic equivalence to standard logical representations, its representations are structured differently and its inference processes are defined in terms of these structural differences.

w Internal Representat ions in Spaceprobe Spaceprobe is a logic-based knowledge representation system based on

the principles of partitioned representations, described elsewhere. 6'8''z) A logic- based system of partit ioned representations requires a slightly more complex syntax than a standard logic-based system, as well as a couple of additional inference rules. Nonetheless, it has a well-defined semantics, it is able to perform inferences over complex knowledge efficiently, it supports a relatively direct mapping from surface sentences to internal representations, and it provides a good account of many discourse-level problems such as presupposition and aspect. This paper illustrates the use and advantages of Spaceprobe in providing a logic-based model of discourse processing as an alternative to the standard logic-based model just described.

Spaceprobe is designed to support reasoning in computational applica-

Page 5: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 43

tions in artificial intelligence such as language understanding in addition to general theorem proving. It handles incoming knowledge by distributing that knowledge over multiple coherent spaces and handles queries by allocating subqueries to the appropriate spaces.

2 .1 Partitioned Representations in Spaceprobe The knowledge representation scheme used in Spaceprobe differs from

that of standard logic-based systems most fundamentally in its use of spaces as a fixed structural component in knowledge representations. Spaces function as small, distinct, logically coherent knowledge bases within which normal rules of inference are observed. They represent such things as hypothetical realities, belief systems, quantified domains, fictions, and situations located in time and space. Knowledge within spaces tends to be very simple, but a proper distribu- tion of knowledge over multiple spaces can fully represent the knowledge that would be expressed in a standard logic in a set of complex formulas with high levels of embedding of the kind found in Fig. 2.

The Siegfried story makes use of at least the following spaces:

sp_0 A fiction space defined to represent the entire contents of the fictional story, story 6.

sp_l A temporal/si tuational space embedded within the fiction space sp_0. This represents the situation, at time_5, in which Siegfried is a rich, hard-working, but unhappy tailor.

sp_2 Another temporal/si tuational space embedded within the fiction space sp_0. This represents the situation, at time_7, in which Siegfried visits the wizard and in which the wizard has the various beliefs mentioned.

sp_3 The wizard's belief space embedded within the temporal/si tuational space sp_2. This represents the wizard's belief set at t ime 7, including the facts that Siegfried is an alcoholic and that rich people are happy.

sp_4 A counterfactual space embedded within the wizard's belief space sp_3. This represents the hypothesis that Siegfried is working hard and all consequences that hypothesis has in the wizard's belief system, such as the facts that Siegfried is successful, that he is rich, and that he stops drinking.

The statement is the basic unit of representation in Spaceprobe. It represents the truth of something relative to some space. In Spaceprobe syntax, a statement is of the form S ! P, where S is the name of a space, a space tag, and P is a sentence. Note that the ! used in statements is an infix operator declared in Spaceprobe with a large scope. A sentence is something like a Prolog fact, but is made relative to the space indicated by the space tag. Notice that a statement, not a sentence, is the minimal element that can be said to have an unqualified truth value. After the processing of the discourse of the Siegfried story, Space- probe would have internalized the something like the statements of Fig. 3.

Page 6: Logic-based processing of semantically complex natural language discourse

44 J. Dinsmore

Fig. 3 The

sp_l ! exist(siegfried) sp_l ! taylor(siegfried) sp_l ! work_hard(siegfried) sp_l ! rich(siegfried) sp_l ! --happy(siegfried) s p l I alcoholic(siegfried)

sp_2 I consult(siegfried, wizard_8) sp_2 I wizard(wizard_8) sp_2 ! famous(wizard_8) sp_2 I --alcoholic(siegfried)

sp_3 ! alcoholic(siegfried) sp_3 I rich(X) = = > happy(X)

sp_4 I work_hard(siegfried) sp_4 I successful(siegfried) sp_4 I rich(siegfried) sp_4 I stop(siegfried, drink(siegfried))

representation of the Siegfried story in Spaceprobe.

The c o m p u t a t i o n a l power o f p a r t i t i o n e d represen ta t ions comes from the

fact that a lmos t al l o f the work in p e r f o r m i n g inferences can be a l loca ted to

i n d i v i d u a l spaces, each o f which conso l i da t e s a small a m o u n t o f coheren t and

concrete i n fo rma t ion . Inferences pe r fo rmed loca l ly wi th in a single space are

ca l led parochial.

2 . 2 Context s and S e m a n t i c s This r ep resen ta t ion a lone does no t preserve the full semant ics o f the

discourse, since the mean ings or ro les o f the i n d i v i d u a l spaces are absent. It

would , for instance, be imposs ib le to recons t ruc t Fig. 2 f rom Fig. 3. This is

r emedied by assoc ia t ing each space wi th a context. The re levant contexts o f our

story are as in Fig . 4.

base ! in(story_6, {{sp_0~) sp_0 I at(time_5, {{sp_l}}) sp_l I beforehand({ {sp_2}/) sp_2 I believe(wizard_8, { {sp_3} }) sp_3 ! work_hard(siegfried) / = = > { {sp_4~ sp_4 ! default({sp 3})

Fig. 4 Contexts used by Spaceprobe for the Siegfried story.

Here we can see tha t a context l o o k s l ike an o r d i n a r y s tatement , but

con ta ins a space term o f the form {{S}}, where S is the name o f some space. We

wil l see b e l o w tha t a second form o f contex t assumes a s l ight ly different form.

A context wi th {{S}}, a primary context, defines wha t a space is used for.

A space te rm is t rea ted as a k i n d o f va r i ab l e tha t s tands for any o f a set o f

sentences e m b e d d e d wi th in a larger sentence, which are found in the space named

in the space term. A n o t h e r way to l o o k at a contex t is as a func t ion tha t maps a

sentence true in one space on to a (more complex ) sentence true in ano the r space.

Page 7: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 45

For instance, the statement sp_4 ! successful(s iegfr ied) maps into sp_3 ! w o r k hard(siegfried)/= = > successful(siegfried), which in turn maps into sp_2 ! believes(wizard_& work_hard(siegfried) / = = > successful (siegfried)). This mapping process is called context climbing. Still another way to look at contexts is as channels o f communicat ion between spaces.

base is a special space that represents reality, i.e., a statement of the form base ! P has the same semantics as P alone would in a standard logic. Figure 2 can be reconstructed from Fig. 3 by iteratively applying context climbing to derive a set of statements tagged for base. This ensures that every Spaceprobe statement can be mapped into a formula of standard logic, and therefore that every Spaceprobe statement has a well-defined semantics.

A primary context is sufficient to represent the semantic role of any space. In addit ion to pr imary contexts, Spaceprobe makes use of secondary contexts. A secondary context works like a pr imary context, but uses a space term of the form {S}, and is derived logically from a primary context. The simplest kind of secondary context occurs in the internal representation of the following sen-

tence:

The coffee was on the table and it was possible that the coffee was hot.

This would correspond to a set of internal representations something like

sp_7 ! on(coffee_& table_4) s p 7 ! possible({ (sp_8} }) sp_8 ! hot(coffee_8) sp_8 ! (sp_7}

The possibility space sp_8 is used to model a hypothesis that is consistent with what is known about sp_7. It is like sp_7 except that it contains the assumption hot(coffee_8). Therefore everything that is true in s p T , such as on(coffee_8, table_4), should still be true in s p S . This is exactly what the context sp_8 ! {sp7} says. For instance, using this context we can derive sp_8 ! on(coffee_8, table_4) by context climbing. A context that expresses this kind of dependence of the contents of one space on the contents of another is known as a setting; it provides for the direct inheritance of knowledge from one space to another.

sp_4 ! default({sp_3}) is a slightly more complex kind of setting. It says that anything true in sp_3 can be assumed to be true in the counterfactual space sp_4 by default, i.e., unless it conflicts with anything known to be true in sp_4. For example, r ich(X) = = > happy(X) is inherited into sp_4. This is appropri- ate for a counterfactual space (Ginsberg 16~ discusses the properties of counter-

factuals in detail).

2 . 3 Formal Properties of Partitioned Representations Although this paper clarifies the structure of internal representations in

Page 8: Logic-based processing of semantically complex natural language discourse

d6 J. Dinsmore

Spaceprobe, and motivates it intuitively, a formal analysis of part i t ioned repre- sentations is actually beyond its scope. Elsewhere 6'12~ I introduce formally the principles of coherence and consolidation as constraints on the way spaces are set up and structured. Roughly, coherence requires that that a space represent a possible situation or reality such that it forms a meaningful domain for local- ized, what I call parochial, inference. For instance, although there are contexts o f forms S l ! believe(X, {{S2}}) and S1 ! P = = > { { S 2 } } , there can be none of the forms S l ! -- { { $2} } or S 1 ! { { $2} } = = > Q, specifically because parochial reasoning would be futile in such spaces: localized reasoning with context cl imbing on the latter forms of contexts would result in faulty inferences. Consol idat ion requires that all relevant information be available in single spaces where possible. For instance, there are no distinct spaces $2 or $3 with the contexts S1 ! P = = > {{$2}} and S1 ! P = = > {{$3}} since everything true in $2 would have to be true in $3 and vice versa.

A number of cognitive theories and intelligent knowledge representation systems can be seen to illustrate the f ramework of parti t ioned representations in some way or another. A few words about the relationship of Spaceprobe to these

systems are in order. In artificial intelligence, context-layered data bases 21) and belief

spaces 1'~9~ do what looks like normal logical inference in small domains, similar to our spaces, while backgrounding some implicit conditions, similar to our contexts, on the meanings of the inferences. Some of these systems make use of inheritance between space-like domains, similar to our secondary contexts. Each of these systems functions in a specific domain, but is easily implemented in the

more general Spaceprobe system. Johnson-Laird 's mental mode l s 17) bear a certain resemblance to Space-

probe's spaces al though the framework of mental models is specifically not logic-based and many of the mechanisms, such as secondary contexts, found in Spaceprobe, are missing in mental models. Fauconnier 's mental spaces 13) and Kamp's discourse representations ~8~ are also similar, al though they are motivated in terms of effective natural language processing, not as knowledge representa- t ion systems. In particular they do not develop the use of parochial inference, which is the pr imary functional motivat ion for Spaceprobe as general knowl- edge representation system.

It is a mistake to see in spaces, as many have, possible worlds or situa- tions (as in situation semantics). Spaces belong to the syntax of representations, not to the semantics. They are introduced as a means of structuring the knowl- edge base and have implications for the way inferences are made, but are not themselves associated with ontological claims or controversy in the way possible worlds and situations are. A more accurate correlation is found with techniques of natural deduction that introduce subproofs into logical derivations, 14) as discussed elsewhere. 9) A space corresponds to the scope of the subproof. The primary context of a space corresponds to the assumptions that justify the

Page 9: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse ,/7

subproof. Context climbing corresponds to the step that takes a result derived within a subproof and realizes some more global consequence (often called discharging the assumption). A secondary inheritance context corresponds to a rule (often called reiteration) that allows a sentence outside a subproof to be imported into the subproof. Spaceprobe provides a natural means of making use of subproofs computationally, effectively generalizing such methods to apply to things like belief.

w Processing in Spaceprobe Spaceprobe provides two interfaces: the application interface, used by a

larger application program, and the customization interface, used by the pro- grammer to adapt Spaceprobe to the specific requirements of the application program. The first supports two basic operations, the input of new knowledge and the retrieval of existing knowledge, that is, asserting and asking. This interface permits the application to shift naturally between a more standard logical representation and a partit ioned representation. Internally everything is generally maintained in a partit ioned form with the system providing the appropriate mapping.

The philosophy behind the implementation of the application interface dictates that spaces and contexts are automatically created in a data-directed manner, i.e., when a statement is input. Thus data is restructured into canonical partitioned forms. This restructuring is called digestion. Context-climbing, on the other hand, applies in a goal-directed manner, i.e., when a query is made.

The customization interface is used by the programmer of the larger application to tune Spaceprobe to the knowledge domain of the application program. In particular, digestion can be controlled by specifying restructure rules, which essentially state how semantic equivalences are to be used in establishing canonical forms. Restructure rules will, among other things, deter- mine how spaces are set up. Furthermore, parochial deductive inference can be controlled by specifying inference rules.

3.1 The Application Interface To input new knowledge a call is generally made of one of the following

two forms:

'~- digest_statement(P).

?- digest_statement(S ! P).

P itself can be as semantically complex as desired, like a sentence in standard logical form. If the space tag S is omitted, base is assumed, making the statement semantically equivalent to the corresponding standard logical form. In either case, the meaning of the statement S ! P or base ! P is then remembered by Spaceprobe. For instance, the call

Page 10: Logic-based processing of semantically complex natural language discourse

4/8 J. Dinsmore

?- digest s tatement(sp_8 ! believes(bif, spy(harry))).

might be used to add the content that Bif believes that Harry is a spy to sp_8. To retrieve knowledge deductively a call of one of the following forms is

made,

~- infer statement(P).

~- infer statement(S ! P).

Again, in the first case base is implicit. S ! P is a statement pattern. A statement pattern is like a statement but may contain variables that may acquire bindings by the call to infer_statement. For instance, after making the call to digest_ statement given as an example above, the following call,

~- infer_sta tement(sp 8 ! believes(bif, spy(X))).

meaning, "who does Bif believe is a spy?" would cause the variable X to be bound to harry. S may itself be a variable, in which case an attempt is made by the system to identify a space in which P matches a true proposition.

The names digest_statement and infer statement suggest that more is happening than simple storage and retrieval. When digest_statement(S ! P) is called, restructuring of P typically occurs. If P is semantically complex then this generally involves construction of a semantically equivalent partit ioned repre- sentation. A simpler procedure, intern_statement, which is used like digest_ statement, stores a statement without restructuring. When infer_s ta tement(S ! P) is called, deductive inference is typically required to find a result. These processes are not apparent at the application level. However, the programmer can control the application behavior of Spaceprobe at the customization level.

3 . 2 The Customization Interface The purpose of the customization level is to declare semantic equiva-

lences, and to specify preferences for the use of one syntactic form over another in the internal representation. The principles of partitioned representations dictate much of what can be done at this level. However, the vocabulary used in the knowledge domain of a particular application requires that these specifications be customized to the application.

In the simplest cases, the predicate digest_statement does nothing more than add something to the knowledge base (with some appropriate indexing, transparent to the programmer). In such a case, we say that a statement is interned. For example,

~- digest_statement(sp_l ! likes(george, mabel)).

would probably add likes(george, mabel) to the space sp_l in exactly that form. Internment happens when Spaceprobe fails to find a restructuring rule that matches the statement to be digested.

Page 11: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 49

More complex information, on the other hand, will generally match a restructuring rule, predeclared through the customization interface, and will accordingly be restructured before internment. Data-directed restructuring rules can technically reform the statement in unlimited ways. For the most part, they decompose statements into more modular canonical representations.

For instance,

?- digest_statement(sp_l ! believes(hagar, has eaten(siegfried, poison_apple_8) = = > dead(siegfried))).

might actually cause the following statements to be interned.

sp_l ! believes(hagar, { {sp_2} }) sp_2 ! has_eaten(siegfried, poison_apple_8) = = > { {sp_3} } sp_3! {sp 2~ sp_3 ! has_eaten(siegfried, poison_apple_8) sp_3 ! dead(siegfried)

Since the original statement can be reconstructed, by context climbing from this semantically equivalent set of statements, d i g e s t s t a t e m e n t does not store it explicitly.

Restructuring rules are declared by the customizer as Prolog facts of the form

restructure_rule(Pattern, Actions).

Pattern is a statement pattern, that is, it can potentially unify with a Spaceprobe statement. Actions is a sequence of Prolog procedure calls. The implementation of rule applications in Spaceprobe takes advantage of the metaprogramming capabilities in Prolog. The code for digest_statement looks roughly like this, where execute basically calls call for each action.

digest_statement(S ! P) : - res t ruc ture_ru le(S ! P, Actions), execute(Actions).

digest_statement(S ! P):-intern_statement(S ! P).

One of the simplest restructuring rules is:

restructure_rule(S ! P & Q, Edigest_statement(S ! P), digest_statement(S ! Q)~).

This expresses the logical rule of and-elimination and ensures that it will be performed in a data-directed manner whenever its preconditions are satisfied. The Actions associated with the first Pattern that unifies with S ! P in the call digest_statement(S ! P) are executed. Given the rule for &, if we call

~- digest s ta tement(sp_l ! doctor(bif) & zodiac_sign(bif, orion)).

Page 12: Logic-based processing of semantically complex natural language discourse

50 J. Dinsmore

The following will be interned in the absence of further relevant restructuring rules.

sp_l ! doctor(bif) sp_l ! zodiac_sign(bif, orion)

3 . 3 How Spaeeprobe Sets up Spaces This section gives an idea, through examples, of how knowledge is

distributed over multiple spaces as part of the digestion process. Partitioned representations are built in Spaceprobe through restructuring of input. For instance, digesting

sp_4 ! believes(fred, age(mabel, 25))

should result in interning something like

sp_4 ! believes(fred, {{sp_9} }) sp_9 ! age(mabel, 25)

Spaceprobe makes use of four procedures in the actions of restructure rules to build such representations. These are sp init, which sets up a new space and a corresponding context; sp_ident, which is used to set up secondary contexts; sp_aug, which injects information into an existing space; and sp_distr, which either sets up a new space or injects information into an existing space opportu- nistically.

Normally, creating and accessing spaces involves separating an embedded sentence, like age(mabel , 25), f rom its embedding context , like believes(fred, _ _ _ ) . To refer to the embedding context in restructure rules, Spaceprobe borrows from the lambda calculus. An embedding context is always of the form:

lambda( V):S

where V is a sentential variable, S is a sentence and V occurs in S. V is used to stand for the slot in S. For instance, instead of believes(fred, _ _ ) we use lambda( P): believes(fred, P).

The following restructuring rule actually sets up a new space with its context as part of the restructuring.

restructure_rule(S0 ! possible(P), [ sp_init(S0 ! possible(P), lambda(X):possible(X), C, S1 ! P),

digest statement(S1 ! P), sp_ident(S0, SO ! T), intern_statement(S1 ! T)]).

sp_init(space initialization) is one of only two procedures defined in Spaceprobe that can create a new space. (The other is sp_distr which conditionally calls

Page 13: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 51

sp_init.) It does this by splitting a statement SO ! P into context SO ! C and a simpler statement S1 t Q, such that S1 is a new space occurring as a space term in C.

For instance, the call

7_ s~ in i t ( sp_3 t possible(hot(coffee-6)), lambda(X): possible(X), NewContext, New_Statement).

will in effect split sp_3 ! possible(hot(eoffee-6)) into two parts, s p 3 ! possible({{sp_18}}), where sp_18 is a newly generated space name, and s p l 8 ! hot(coffee-6). These become the bindings of New Context and New_Statement respectively. The term lambda(X): possible(X) is a pattern that specifies how to get possible(hot(coffee-6)) in order to produce a context and a statement. A lambda expression is always used as the second argument to sp_init. The context s p 3 ! possible({ {sp_18} }) will be interned automatically in the call to sp init, but sp_18 ! hot(coffee-6) will not, since it is a candidate for further digestion. Notice that the restructuring rule goes on to digest New_Statement.

The procedure sp_ident(space identity) does something simple; in fact, it just saves a little typing and enhances readability. The call

7_ sp_ident(sp_3, Context).

binds Context to the identity context, sp_3 ! {sp_3}. The usefulness of an identity context is that it can be retagged to create a setting. The call to intern_ statement adds such a setting.

There are two reasons for automatically deriving settings as opposed to other secondary contexts as part of the restructuring process. First, experience suggests that initializing these contexts creates an environment under which many useful inferences can be derived immediately by simple applications of context climbing over settings in response to queries. For instance, in the example above, the context sp_18 ! {sp_3} allows any knowledge tagged for sp_3 to carry over directly to sp_18. Most of the knowledge relevant to local infer- ences in sp_18 will probably derive from sp_3 in this manner. Second, context climbing over settings is made especially efficient in the implementation of Spaceprobe through special transparent indexing mechanisms as discussed below.

As an example of the restructuring rule above, if the call

7_ digest_statement(sp_l ! possible(hot(coffee_6))).

is made, something like the following would be interned.

sp_ l !poss ib le ({{sp 18}}) s p l 8 t hot(coffee_6) sp_18 ! {sp_l}

An important thing to note about the restructuring rule for possible is that it

Page 14: Logic-based processing of semantically complex natural language discourse

52 J. Dinsmore

creates a new space every time another statement o f possibil i ty is digested. That is, it will not intern the embedded sentence in an already existing possibil i ty

space. This means that if we now call

? - digest_statement(sp_l ! possible(cold(coffee_6))).

something like the fo l lowing will be interned.

sp_l ! possible({ { sp_19} }) sp_19 ! cold(coffee 6) sp_19 ! {sp_l}

It is appropr ia te that we set up this second possibil i ty space in the interests o f coherence. I f we were to intern s p l 8 ! cold(coffee_6) this wou ld mean that

coffee 6 could be both hot and cold at the same time.

On the other hand, condi t ional spaces should not be so duplicated.

restructure_rule(S0 ! P - - = > Q, Esp_distr(S0 ! P - - - - > Q, lambda(X): P - - - - > X, C, S1 ! Q), digest_statement(S1 ! P),

digest_statement(S1 ! Q),

sp_ident(S0, SO ! T), intern_statement(S1 ! T)~).

The restrcturing rule for - - : > looks a lot like that for possible. The main

difference is that the procedure sp_distr(space distribution) is used instead o f sp_init(space init ial ization). Both procedures are called the same way but do

something slightly different. The call

~- sp_distr(sp 6 ! u n d e r - a t t a c k ( e n t e r p r i s e ) : - - > doomed(enterprise), lambda(X):P = -- > X, Context, New_Statement).

begins by look ing for an existing context o f the form sp_6 ! under- attack(enterprise) = = > X. I f it fails to find such a context, it has exactly the

same result as sp_init, that is, it creates such a context, a long with the new space. I f it does find such a context, it will not create a new context or space but will

add content to the existing space. In the latter case, Con t ex t will be b o u n d to the already existing context and N e w s t a t e m e n t will be b o u n d as in sp_init. The procedure sp dis t r is the pr imary means o f achieving consolidation in the

part i t ioned representat ions created by Spaceprobe. Not ice that the statement S1 ! P is digested. P is satisfied in $1, since

P = = > P is always satisfied in S0(or in any other space; it is a tautology) .

Not ice also that this rule sets up a setting, S1 ! T much like the rule for possible. N o w let's look at the effect o f the fol lowing two calls in sequence,

assuming that no similar call has been made previously.

? - d iges t_s ta tement ( sp_6 ! under_attack(enterprise)

Page 15: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 53

- - > enemy_agent(spock)).

~- digest_statement(sp 6 ! under attack(enterprise) - - > doomed(enterprise)).

The first call will intern something like

sp_6 ! under_attack(enterprise) - - - - > {{sp 18)} s p l 8 ! under_attack(enterprise) s p l 8 ! enemy_agent(spook) sp_18 ! {sp_6}

The second call will intern only

sp_18 ! doomed(enterprise)

The second call to d iges t_s ta tement will reuse the space and the context initiated by the first call. It makes sense that the consequents should be consoli- dated in this way, since if the enterprise is under attack then enemy_ agent(spock) and doomed(enterprise) should logically be satisfied together.

One final point for the alert reader: the setting sp_18 ! {sp_6} is not

created twice. This is because intern_statement does a redundancy check at the implementat ion level so that it will never intern a statement or context that has already been interned. As a result, the customizer never has to worry about such redundancies.

A couple more restructuring rules that are important in processing the

Siegfried story are:

restructure rule(S0 ! P / = = > Q, Esp distr(S0! P / = : > Q , l a m b d a ( X ) : P / : - - > X , _ , S1 ! Q),

digest_statement(S1 ! Q), sp_ident(S0, SO ! C), intern_statement(Sl ! default(C))~).

restructure_rule(S0 ! beforehand(P), Esp_init(S0 ! beforehand(P), lambda(X): beforehand(X), _ , S I ! Q ) ,

digest_statement(S1 ! Q)~).

Once an appropriate set of restructuring rules is declared, the content of each contextualized intermediate representation will be automatically and correctly distributed over multiple spaces by a simple call to digest_statement. The restructuring rules ensure that relevant parts o f the meanings of certain predicates occurring in the intermediate representations are properly represented in terms of parti t ioned structures in a way that maximizes coherence and consolidation.

Page 16: Logic-based processing of semantically complex natural language discourse

54 J. Dinsmore

3 . 4 How Spaceprohe Handles Queries The following call can be used to retrieve knowledge deductively in

Spaceprobe.

9_ infer_statement(S ! P).

infer statement is like Prolog call in that it will try to derive P, possibly binding variables in P in the process. However, the derivation is made locally for S and is accomplished in one of the following ways:

(1) By look-up, or (2) By backward chaining to make a parochial inference in S, or (3) By climbing a matching context and setting up a new query.

Parochial backward chaining can be customized. Look-up and climbing a matching context are options that are invoked by Spaceprobe in a fixed manner.

(13 Look-up This is possible if a statement that unifies with S ! P was interned. If S

is an unbound variable, infer_s ta tcment(S ! P) will locate, if possible, a space S in which P is satisfied. This can be used in contextualization, for instance, to locate a space quickly in which a definite description has a referent. At the implementation level Spaceprobe uses several transparent hash tables to index statements in way that allow efficient access through alternative search heuristics.

(2) Parochial inference Backward chaining is familiar from Prolog. The Spaceprobe analog of

the Prolog rule is the inference rule declared by the programmer to perform an inference locally within a space. An inference rule is declared by the program- mer as a Prolog fact of the following form.

inference_rule(Sentence Pattern, [Action, Action .. . . ]).

One of the rules in the Spaceprobe implementation of infer_s ta tement simply looks like this:

infer_statement(Question):- inference_rule(Question, Actions), execute(Actions).

The actions specify procedurally how a query matching Sen tence_Pa t t e rn can be answered. For instance,

inference_rule(P & Q, Einfer_statemcnt(P), infer statemcnt(Q)~).

In the recursive calls to infer_statement the space tag is normally omitted, as the current space in which the inference occurs parochially is understood by

Page 17: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 55

default. So, if

digest_statement(sp_18 ! enemy_agent(spock)) digest_statement(sp 18 ! doomed(enterprise))

are called, then

infer_statement(sp 18 ! enemy_agent(spock) & doomed(enterprise))

will succeed. Modus ponens can be declared as a general rule that applies locally

within spaces as follows.

inferencerule(Q, [infer_statement(P = = > Q), infer_state- ment(p)]).

If the following have been called,

digest_statement(sp_2 ! car salesman(X) = = > politics(X, repub- lican)) digest statement(sp_2 ! car salesman(bif))

then on the basis of the inference rule just given the call

infer_statement(sp 2 ! politics(bif, P))

will succeed and bind P to republican.

[33 Context climbing The third way in which infer_statement can infer a statement is by

context climbing, i.e., by locating a context that matches the query and making a recursive call to infer_statement for the appropriate query in the space referenced in the context. For instance, given

sp_l ! believes(george, { {sp_8} }). sp_8 ! phone(fred, 1234567) sp_8 ! phone(fred, X) = = ~ phone(mary, X)

processing the query

infer statemcut(sp 1 ! believes(george, phone(mary, N)))

will climb the context sp_l ! believes(george, {{sp_8}}) to submit the query

infer statement(sp_8 ! phone(mary, N))

Given an inference rule for modus ponens of the last section, this last query will find the binding 1234567 for N.

This last example demonstrates the relative ease with which certain inferences that are very difficult in traditional logic-based systems are handled in Spaceprobe. The knowledge used in this example would correspond to

Page 18: Logic-based processing of semantically complex natural language discourse

56 J. Dinsmore

something no simpler than believes(george, phone(fred, 1234567)), and believes(george, phone(fred, X) = = > phone(mary, X)) in a standard logic- based representation. (More typically there would be additional levels of embed- ding.) From these it is actually relatively difficult to infer believes(george, phone(mary, 1234567)).

As we have seen, the most common kind of secondary context is the setting of one of the forms

s2~ {s2) SI! default({S2})

The implementat ion of Spaceprobe has a special transparent optimization to handle context cl imbing for these cases quickly as direct instances of look-up. For each space S mentioned in the data base a list of spaces representing the spaces in the transitive closure of the setting relationship of S is stored. This list is automatically updated whenever a setting with S as a tag is added to the knowledge base. This is invisible to the customizer. With each space S1 on the list is an indication of whether or not it is in the default setting of S, i.e., whether or not a setting of the form $2 ! default({S3}) must be crossed to get from S to S1. When a query of the form S ! P is processed, S comes into focus and all sentences in the setting of S are made directly visible without the need to explicitly apply context climbing on the settings of S. The way in which visibility is implemented is similar to that of the inheritance mechanisms of CONNIVER. 2D As in CONNIVER, knowledge that would otherwise be visible from a default setting of S can be canceled invisible by explicitly removing it from S.

3.5 The Advantages of Spaceprobe The most immediate advantages Spaceprobe's representation are the

elimination of the recurrence of embedding contexts found in the standard logical representations, and the improvement in modulari ty and readability. In addition to this, two more profound advantages accrue:

(1) Inferences are easier to derive in Spaceprobe's representation. First, a given space consolidates a coherent description of a real or possible reality. Second, the sentences represented as true in a given space tend to be simple. As a result, most inferences can be localized to individual spaces, and the derivation of inferences within spaces is generally easy.

(2) Spaceprobe supports a more direct, more natural mapping from surface discourse sentence to internal representation. The next three sections develop a model of discourse understanding based on Spaceprobe and demonstrate the advantages of Spaceprobe's ret~resentation in providing a more direct semantic mapping.

Page 19: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 57 w Discourse Understanding: a Natural Application for Space-

probe Spaceprobe lends natural support to the model of semantic processing in

which distribution of knowledge over spaces plays a primary role, controlling other processes like lexical disambiguation and the determination of referents for definite descriptions. This model is represented graphically in Fig. 5.

@ parsing'[@2~in2s176

Fig. 5 A model of discourse processing.

Parsing translates a discourse sentence D into an intermediate representa- tion P and identifies a list of space cues Q. Contextualization tags P with a focus space S to produce a contextualized intermediate representation. Digestion produces from S ! P a set of internal representations S1 ! P1, 82 ! P2 ..... which then remain in the knowledge base. The main features that distinguish this model of semantic processing are the use of the focus space for contextualiza- tion, and the distribution of knowledge over various spaces starting at the focus space during digestion. We will see how this model succeeds in understanding semantically complex discourses like the Siegfried story.

4.1 Parsing Primarily, parsing builds an intermediate representation of the surface

discourse sentence. The intermediate representation is something like a standard predicate calculus representation, except that it's meaning is generally semantically ambiguous, that is, it depends on the current discourse state, which consists of the contents of the knowledge base plus the history of recent semantic processing. For instance, the following is a possible intermediate representation for "The wizard has a broom."

the(wizard(X), broom(obj_3) & has(X, obj_3))

The the construction in the intermediate representation will be replaced by a specific referent, e.g., wizard_8, in the digestion stage. Gradually this intermedi- ate representation will emerge as one or more fully specified and semantically unambiguous Spaceprobe statements.

Secondarily, parsing builds a list of space cues that occur in the discourse sentence. Space cues correspond to verb forms and certain adverbials, like "Once upon a time," that are useful in identifying the focus space for contextualization.

Page 20: Logic-based processing of semantically complex natural language discourse

58 J. Dinsmore

For instance, the space cues returned for the first sentence of Fig. 1 would be [onceupon a time, past~. Figure 6 represents the result of parsing for each sentence of the Siegfried story.

(1) exist(siegfried) & taylor(siegfried) (2) beforehand(wizard(wizard_8) & famous(wizard_8) &

consult(siegfried, wizard_8)) [past] (3) the(wizard(X), believe(X, alcoholic(siegfried)) [past] (4) work_hard(siegfried) / = = > successful(siegfried) [past] (5) the(wizard(X), believe(X, rich(X) = = > happy(X))) [past] (6) rich(siegfried) & stop(siegfried, drinks(siegfried)) [conditional] (7) the(tailor(X), X = siegfried & work_hard(X) & rich(X)) [now, past] (8) --happy(siegfried) & drink(siegfried) [past]

Fig. 6 Results of Parsing the Siegfried story.

Ionce_upon, past]

4 . 2 Contextualization This constructs a statement S ! P from the intermediate representation

and the current discourse state. S is the focus space and P is the intermediate representation itself. One can think of contextualization as the process of putting the intermediate representation into the focus space. The identification of the focus space therefore provides an associated context which allows the full ( truth-conditional) meaning of the discourse sentence to be realized. The nature of the contextualization step provides a key distinction between the current model and standard logic-based models.

Figure 7 shows the results of contextualizing the sentences of the Siegfried story. Notice how the focus space starts at sp_l then moves to sp_2, to sp_3, back to sp_2, to sp_4 and finally back to sp_l.

(1) sp_l ! exist(siegfried) & taylor(siegfried) (2) sp_l ! beforehand(wizard(wizard_8) & famous(wizard_8) &

consult(siegfried, wizard_8)) (3) sp_2 ! the(wizard(X), believe(X, alcoholic(siegfried)) (4) sp_3 ! work_hard(siegfried) / - - - - > successful(siegfried) (5) sp_2 ! the(wizard(X), believe(X, rich(X) = -- > happy(X))) (6) sp_4 ! rich(siegfried) & stop(siegfried, drink(siegfried)) (7) s p l ! the(tailor(X), X = siegfried & work_hard(X) & rich(X)) (8) sp_l ! --happy(siegfried) & drink(siegfried)

Fig. 7 Contextualized intermediate representations.

4 . 3 Digestion During digestion the contextualized intermediate representation is as-

similated into the knowledge base. New spaces and their associated contexts are set up, and existing contexts are used to access spaces for distribution informa- tion. At the same time, various pragmatic processes occur parochially, such as finding referents for definite descriptions and satisfying presuppositions.

Once an appropriate set of restructuring rules is declared, the content of

Page 21: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 59

each contextualized intermediate representation will be automatically and correctly distributed over multiple spaces by a simple call to digest_statement. The restructuring rules ensure that relevant parts of the meanings of certain predicates occurring in the intermediate representations are properly represented in terms of partitioned representations structures. Figure 8 shows the results of digesting each of the sentences in the Siegfried story. These are the ultimate internal representations, and are semantically equivalent to the standard repre-

(1) base ! sp_0 ! sp_l sp_l

(2) sp_l s p 2 sp_2 sp_2

(3) sp_2 sp_3 sp_2

(4) sp_3 sp_4 sp_4 sp_4

(5) sp_3 (6) sp_4

sp_4 (7) sp_l

sp_l (8) sp_l

sp_l

sentations in Fig. 2.

in(story_6, { { sp_0} } ) at(time_5, { { sp_l } }) exist(siegfried) taylor(siegfried) beforehand( { { sp_2} } ) consult(siegfried, wizard_8) wizard(wizard_8) famous(wizard_8) believe(wizard_8, { { sp_3} } ) alcoholic(siegfried) - alcoholic(siegfried) work_hard(siegfried)/ = = > { {sp_4} } default( { sp_3 }) work_hard(siegfried) successful(slegfried) rich(X) = = > happy(X) rich(siegfried) stop(siegfried, drink(siegfried)) work_hard(siegfried) rich(siegfried)

happy(siegfried) alcoholic(siegfried)

Fig. 8 Final representations after digestion.

The next two sections discuss aspects of contextualization and digestion in more detail.

w Contextualization in Spaceprobe The goal of contextualization is to assimilate an intermediate representa-

tion into a particular space, e.g., to get from Fig. 6 to Fig. 7. Identifying the focus space is highly dependent on pragmatic features of the discourse state, in particular on the history of recent semantic processing as well as on grammatical space cues. Figure 9 illustrates this process. This makes contextualization much more difficult to model than digestion. This section is intended to illustrate how a model of focus tracking can be developed in Spaceprobe. What will be described here is an algorithm that correctly tracks the focus space in the Siegfried discourse. Dinsmore 11"1z) discusses many problems in detail of what proves to be a complex phenomenon. No claim is made for general adequacy.

Observations over a number of discourses, including the Siegfried story, suggest that the focus space for each sentence tends to be:

Page 22: Logic-based processing of semantically complex natural language discourse

60 J. Dinsmore

•i•urse Sta~ @ "-

S ~ P

/ Fig. 9 The contextualization process.

(1) The most active space, (2) that is consistent with the space cues of the current discourse sentence,

and (3) that has a content conceptually consistent with the intermediate represen-

tation of the current discourse sentence.

Let's look at these features, then describe an algorithm for focus tracking*.

5 .1 Active Spaces Spaces are active to a degree dependent on how recently or how often

they have been used in recent discourse processing. Figures 7 and 8 reveal that except for (1) the focus space (tag) for every contextualized statement corre- sponds to a space in which something was interned shortly before the statement was contextualized. Spaces can become active as they are created and /o r refern- ced during digestion. For instance, in digestion (3) the belief space s p 3 is accessed, s p 3 becomes the focus space for the next sentence, (4). In digesting (4), the counterfactual space s p 4 is accessed, sp_4 becomes the focus space in (6).

Looking at Figs. 7 and 8 we also observe a tendency to return to a previous focus space, or to use the same focus space in successive contextualiza- tions. We can model this by assuming varying levels of activation, with the last focus space most active, and spaces that have not been focused or recently accessed least active. More active spaces are therefore the best candidates for focus, and, all else being equal, the most recent focus space will continue to be in focus.

Some readers will recognize a similarity between our focus spaces and Reichman's 241 focus spaces, which she too uses to structure and interpret discourses. An important distinction is that for her focus spaces serve a purely pragmatic function, while in Spaceprobe they become a permanent and meaningful part of the internal representation. Nevertheless, some of her ideas concerning focus tracking may carry over to contextualization, such as her proposal for a "grammar" that constrains allowable sequences of focus shifts.

Page 23: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 61

5 . 2 Space Cues English provides syntactic construct ions, which I call space cues, whose

funct ion seems to be to help identify the space into which informat ion is to be assimilated. As discussed above, the parser returns, in addi t ion to an intermedi-

ate representat ion o f the current discourse sentence, a list o f space cues, corre- sponding to certain words and structures that occur in the discourse sentence.

The most consistently present type o f cue seems to be associated with the form of the main verb o f the discourse sentence: past, present, or conditional.* For

instance, if the space cues include conditional, the focus space S must have a pr imary context o f the from SO ! P / = = { {S} }. sp_4 is the only space referenced in processing the Siegfried story that satisfies this condi t ion . Accordingly , the

focus space for (6) can only be sp_4, even though sp_2 is the most active when

the sentence o f (6) is contextualized. A number o f adverbials o f little apparent semantic content also seem to

play a role in determining the focus space. In the Siegfried story, "Once upon a

time, ..." wou ld seem actually to cause the ini t ial izat ion o f a new t empora l / si tuational space embedded within a story space. "Wel l " seems to indicate that

the focus space is different than that for the previous sentence. And finally,

" n o w " seems to indicate a return f rom a temporal ly pr ior focus space. "In f a c t "

indicates a non-counter fac tua l focus space.

5 . 3 Conceptual Consistency Ultimately, the current intermediate representat ion must assimilate easily

into the focus space. This means that its presupposi t ions should be satisfied

there, the objects it ment ions should exist there, and it should not contradict knowledge that is already stored there. In our simple model , checking for

conceptual consistency involves runn ing a few tests involving structures that can be found directly in the intermediate representat ion that indicate what objects

are referenced. In contextual iza t ion (3) in Figs. 7 and 8 we have sp_0, sp_l and sp_2 as

active spaces. A m o n g the space cues is past, which is compat ib le with any of

these spaces. Because the intermediate representat ion is o f the form the (wizard(X) .. . . ) we will need to locate a wizard in the focus space S(by making

the query i n f e r _ s t a t e m e n t ( S ! wizard(X) ). Since sp_2 ! wizard(wizard_8) has been interned, and no other statement o f the form S ! wiza rd (X) can be defined,

sp_2 mus t be the focus space.

5 . 4 An Algorithm for Contextualization Contextual iza t ion can be implemented as

Notice that the perfect form of the verb is being treated by means of a normal predicate beforehand, not as a space cue, such that at(time_l, beforehand(P)) is true if at(time_0, P) is true and time_0 < tlme 1. The past in past perfect sentences and the present in present perfect are space cues. This is consistent with my discussion elsewhere . 3'4'7'1~

Page 24: Logic-based processing of semantically complex natural language discourse

62 J. Dinsmore

contextualization(P, Q, S ! P):- activation_list(Activation_list), rm_cue_violations(Activation_list, Q, Candidate_list), first consistent_space(P, Q, Candidate_list, S).

contextualization(P, Q, S ! P) takes the intermediate representation P and the set of space cues Q returned from the parsing stage and, by binding S, returns the contextualized intemediate representation S ! P.

The call to activation_list binds Activation list to a single permanent data structure representing a history of the creation and access of spaces, or, to be exact, of primary contexts. This list is ordered by recency: whenever a primary context is used it is placed at the beginning of act ivat ion list. In this way activation list models the relative activation of spaces. The discourse state in Fig. 9 consists of activation_list along with the current state of the partitioned knowledge base itself.

The call rm_cue_violations(Activation_list , Q, Candidate_list) removes any contexts from Activation_list that are inconsistent with some member of the set of space cues Q, returning a possibly reduced Candidate list.

The call first consistent_space(P, Q, Candidate_list, S) finds the first space S defined in the ordered Candidate_list with which the sentence P is conceptually consistent. If there is no such space, then such a space is created by a call to sp_init with a minimally specified context that is consistent with the set of space cues Q. This last case typically arises at the beginnings of stories, as it does in the Siegfried story, when there are few if any active spaces.

w Pragmatic Factors in Understanding The restructuring rules described earlier suffice to distribute information

appropriately over multiple spaces, creating new spaces as required. Further restructuring rules can also handle a variety of details parochially. These include the determination of referents for definite descriptions, and checking to see if presuppositions are appropriately satisfied. They also include semantic disambi- guation. It is interesting to see how these low-level restructuring rules interact with the rules that distribute knowledge over spaces to correctly predict discourse-level phenomena that are otherwise difficult to account for. The projected character of that interaction is strong cognitive support for the proposed model of discourse processing.

A contextualized intermediate representation for " T h e wizard had a

broom" might be

sp_2 ! the(wizard(X), broom(obj_3) & have(X, obj_3))

A workable, though not entirely adequate, restructuring rule for definite descrip- tions like this is as follows:

restructure_rule(S ! the(D, P),

Page 25: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 63

[infer_statement(S ! D), digest_statement(P)] ).

This rule issues a query infer_s ta tement(S ! D), described in the next section, to find bindings for variables in D, normally binding variables in P at the same time. Then it digests P. For instance, if sp_2 ! wizard(wizard_8) is in the knowledge base, then digesting the statement above will first bind X to wizard_ 8, then will digest broom(ohj_3) & have(X, obj_3). This will cause the following to be interned (the restructuring rule for & will apply also).

sp_2 ! broom(obj 3) s p 2 ! have(wizard_8, obj_3)

Notice that the rule for the is able to find a unique referent as long as there is only one statement unifying with sp_2 ! wizard(X), regardless of how many wizards are represented in the knowledge base in various spaces. The partitioned representations is doing much of the work of disambiguation by defining a restricted domain of reference, whereas finding a unique referent is generally difficult in standard logic-based systems. TM

Another interesting interaction between the rule for the and partitioned representations occurs when we digest the following statement, paraphrased " I f Merlin has a broom, then the broom walks."

sp_8 ! (broom(obj 9) & has(merlin, obj_9)) = = > the(broom(X), walk(X))

Sentences of this kind have bothered logicians; 15) the problem is that "the broom" should refer to a broom, but the sentence makes no commitment to the existence of a broom for "the broom" to refer to. Kamp 18~ proposes that the rule of interpretation for "the" depends on a mental discourse model, largely equivalent to what emerges in partit ioned representations. In digesting this statement, the rule for = = > , and the rule for &, will first apply causing the following to be interned initially.

sp_8! (broom(obj_9) & has(merlin, obj_9)) = = > {{sp_12}} sp_12 ! hroom(obj_9) sp_12 ! has(merlin, obj_9)

At this point, the rule for = = > will try to digest the statement

sp_12 ! the(broom(X), walk(X))

The rule for the will call infer_statement(sp_12 ! broom(X)) binding X to obj_9, and so will digest s p l 2 ! walk(obj_9).

The satisfaction of presuppositions in semantically complex discourses are also predicted when viewed in terms of processing locally in spaces. "Sieg- fried would stop drinking" should presuppose "Siegfried has drunk." Disre-

Page 26: Logic-based processing of semantically complex natural language discourse

64 J. Dinsmore

garding the question of the actual function of presupposition in discourse, let' s introduce a kind of presupposition checker for stop in the following way.

restructure_rule(S ! stop(X, P), [infer statement(S ! beforehand(P)), intern_statement(S ! stop(X, P))~).

The effect of this rule will be to prevent digestion of the statement S ! stop(X, P) unless the presupposition is satisfied, i.e., unless infer_s ta tement succeeds. In the processing of the Siegfried story we have seen the following are interned before the sentence with "stop" is processed.

sp_3 ! alcoholic(siegfried) s p 4 ! default({sp_3})

At some point the system will try to digest the statement

sp 4 ! stop(siegfried, drink(siegfried))

The rule for stop will then cause the following call.

7_ infer_statement(sp 4 ! beforehand(drink(siegfried))).

This will in fact succeed by context-climbing on the setting sp_4 ! default({sp_ 3~) to set up the query

sp_3 ! beforehand(drink(siegfried))

which should be inferable from sp_3 ! alcoholic(siegfried) given appropriate inference rules relating drink to alcoholic. Dinsmore 2'121 and Ng 22) demonstrate that this basic model of discourse processing leads to very accurate, correct and very general predictions about the satisfaction of presuppositions in semantical- ly complex discourses.

In summary, digestion is concerned for the most part with logical manipulations that can be clearly specified in accordance with the principles of partitioned representations. It is also concerned with lower-level processing that must refer to the discourse state, normally by making calls to infer_statement. Because this lower-level processing is parochial, that is, operates in specific spaces, the domain of the processing is highly delimited and the formulation of explicit principles is much easier.

w Handl ing Queries in Discourse A final weakness of standard logical representations for natural language

discourse processing is that assuming that we have managed to map the dis- course onto a representation like that of Fig. 2, ' i t will nevertheless be very difficult to derive the kinds of inferences that humans find natural and effortless. Essentially, the internal representations, even when semantically correct, will be too large and cumbersome to be of much use. On the other hand, Spaceprobe's

Page 27: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 65

representation allows almost all inferencing to be localized to individual spaces of simple sentences. Processing complex queries involves simply using contexts to locate relevant spaces in which to perform such local inferences.

7 . 1 A query about Siegfried Let's briefly look at how Spaceprobe derives an inference, which we have

seen to be complex in a standard logic-based system. This is the inference that the wizard believes that if Siegfried would work hard then he would be happy. We will trace the (recursive) calls to infer_statement, beginning with the query:

(1) sp_2 ! believe(wizard8, work_hard(siegfried) / > happy (siegfried)).

(1) is solved by context climbing using the existing context sp_2 ! believe(wizard_8, { {sp_3} }) and then solving:

(2) sp_3 ! work_hard(siegfried) / = = > happy(siegfried).

(2) is solved by context-climbing using the context sp_3 ! work hard(siegfried) / = = > { {sp_4} } and then solving:

(3) sp_4 ! happy(siegfried).

(3) is solved by local inference using modus ponens and then solving both of the following:

(4) sp_4! P - - - - > happy(siegfried). (5) sp_4 ! P.

(4) is solved by look-up using the setting sp_4 ! default({sp_3}) and the existing statement sp_3 ! rich(X) = = > happy(X). This binds P in (4) to (siegfried). (5) is then solved immediately by look-up. This completes the inference. This inference is fast not only because it is relatively short, but also because there is little branching in the search space.

w Conclus ion In this paper I have shown how a kind of logic-based natural language

processing system can be implemented to deal with semantically complex discourse. I will conclude by summarizing the main features of the proposed model and highlight some important aspects of the model.

Spaceprobe is a logic-based implementation of the principles of par- titioned representations. It is used to distribute knowledge appropriately over an open-ended set of spaces. Each space functions independently as a small coher- ent knowledge base of relatively simple sentences over which normal inference processes are valid. Contexts represent the meanings of spaces and allow global consequences of local reasoning processes to be realized. Spaceprobe provides a procedurally efficient representation for knowledge of the complexity found in

Page 28: Logic-based processing of semantically complex natural language discourse

66 J. Dinsmore

typical natural language discourses. Essentially, many of the complex axioms and deductive steps required in standard logic-based systems are made implicit in the way Spaceprobe structures the knowledge base.

Spaceprobe supports a relatively direct mapping from discourse sentences to internal representations. The directness has two sources: First, the principled distribution of knowledge over spaces during digestion makes the semantic processing of lower-level syntactic structures, such as definite descriptions and presuppositional constructions, local to individual spaces. This restricts--appro- priately, it turns out - - the range of knowledge structures that play a role in lower-level semantic processing. Second, the assimilation of the content of a discourse sentence relative to a focus space during digestion means that no attempt is made to associate a discourse sentence directly with an unqualified truth-conditional element of the internal representation. The truth conditions of the discourse sentence emerge only indirectly using the contexts of the knowl- edge base.

Spaceprobe's approach to discourse processing offers a different perspec- tive on what semantic processing is all about. Let me give a brief example. Students of tense and aspect in natural language have generally assumed that the English present perfect is semantically equivalent to the English past and should therefore have the same internal representation. This is in view of sentence pairs like the following, which intuitively have identical truth conditions.

(1) Siegfried has smoked. (2) Siegfried smoked.

Spaceprobe's approach to discourse processing leads to quite different conclu- sions. (1) will correspond to an intermediate representation P1, and (2) to an intermediate representation P2. The truth conditional equivalence of (1) and (2) is independent of the semantic equivalence of P1 and P2, since statements and not sentences have truth conditions in Spaceprobe. When (1) is used in a discourse, it will be contextualized as S1 ! P1, for some space S1, and (2) will be contextualized as $2 ! P2. In fact, S1 and $2 cannot be the same spaces; the space cues present and past tell us that. The conclusion of semantic equivalence is the opposite of that reached in the present framework.*

I hope to have shown in this paper how the capabilities of logic-based natural language processing systems can be greatly amplified to deal with semantically complex discourse by incorporating the principles of partitioned representations. These principles provide a more heuristically motivated means of organizing the knowlede base. They also allow important principles to be formulated on which critical aspects of discourse understanding depend, princi- ples that would otherwise be missed.

,I, Dinsmore 4'~~ shows how the past and present perfect differ semantically. Dinsmore 7'a~ develops a detailed analysis of such sentences from the partitioned representations perspective.

Page 29: Logic-based processing of semantically complex natural language discourse

Logic-Based Processing of Semantically Complex Natural Language Discourse 67

References 1) Ballim, A. and Wilks Y., Artificial Believers, to appear. 2) Dinsmore, J., "Towards a Unified Theory of Presupposition," Journal of Pragmatics,

Vol. 5, pp. 335-363, 1981. 3) Dinsmore, J., "Tense Choice and Time Specification in English," Linguistics, Vol. 19,

pp. 475-494, 1981. 4) Dinsmore, J., "On the Semantic Nature of Reichenbach's Tense System," Glossa, Vol.

16, pp. 216-239, 1982. 5) Dinsmore, J., "Spaceprobe: A System for Representing Complex Knowledge," Proceed-

ings of the ACM SIGART International Symposium on Methodologies for Intelligent Systems, pp. 399-407, 1986.

6) Dinsmore J., "Mental Spaces from a Functional Perspective," Cognitive Science, Vol. 11, pp. 1-21, 1987.

7) Dinsmore J., "Discourse Models and the English Tense System," Proc. of 9th Conf. of Cognitive Science Society, pp. 934-937, 1987.

8) Dinsmore J., "Spaceprobe Users' Manual," Technical Report, 88-15, Department of Computer Science, Southern Illinois University at Carbondale, 1988.

9) Dinsmore J., "Generalized Natural Deduction," Technical Report, 89-07, Department of Computer Science, Southern Illinois University at Carbondale, 1989.

10) Dinsmore J., "The Use and Function of the English Past and Perfect," Essays in Honor of Yuki Kuroda (C. Georgopoulos and R. Ishihara, eds.), Kluwer, Dordrecht, 1991.

11) Dinsmore J., "A Model for Contextualizing Natural Language Discourse," Proc. of llth Conf. of Cognitive Science Society, pp. 597-604, 1~89.

12) Dinsmore J., Partitioned Representations: A Study in Mental Representation, Lan- guage Processing and Linguistic Structure, Kluwer, Dordrecht, 1991.

13) Fauconnier, G., Mental Spaces: Aspects of Meaning Construction in Natural Lan- guage, Bradford/MIT Press, Cambridge, MA, 1985.

14) Fitch, F., Symbolic Logic: An Introduction, Roland Press, New York, 1952. 15) Geach, P., Reference and Generality, Ithaca, 1952. 16) Ginsberg, M., "Counterfactuals," Artificial Intelligence, Vol. 30, pp. 35-79, 1986, 17) Johnson-Laird, P., Mental Models, Harvard University Press, Cambridge, MA, 1983. 18) Kamp, H., "A Theory of Truth and Semantic Representation," Formal Methods in the

Study of Language: Part 1, (J. A. G. Groenendijk, T. M. V. Janssen and M. B. J. Stokhhof, eds.), Mathematisch Centrum, Amsterdam, pp. 277-322, 1980.

19) Maida, A., "Selecting a Humanly Understandable Knowledge Representation for Reasoning about Knowledge," International Journal o f Man-Machine Studies, VoL 22, pp. 151-161, 1985.

20) McCord, M., "Using Slots and Modifiers in Logic Grammars for Natural Language," Artificial Intelligence, Vol. 18, pp. 327-367, 1982.

21) McDermott, D. and Sussman, G. J., "The Conniver Reference Manual," Technical Report Memo 259, MIT, 1972.

22) Ng, K. H., "A Computational Model of Presupposition in Natural Language Dis- course," MS Thesis, Department of Computer Science, Southern Illinois University at Carbondale, 1989.

23) Pereira, F. and Warren, D. H. D., "Definite Clause Grammars for Language Analysis-- A Survey of the Formalism and a Comparison with Augmented Transition Networks," Artificial Intelligence, Vol. 13, pp. 231-278, 1980.

24) Reichman, R., Getting Computers to Talk Like You and Me, Bradford/MIT Press,

Page 30: Logic-based processing of semantically complex natural language discourse

68 J. Dinsmore

25) Cambridge, MA, 1985. Walker, A. (ed.), Knowledge Systems and Prolog, Addison-Wesley, Reading, MA, 1978.