These notes contain some of the reasoning behind the proposals of  to introduce contexts as formal objects. The present proposals are incomplete and tentative. In particular the formulas are not what we will eventually want, and we will feel free to use formulas in discussions of different applications that aren't always compatible with each other. This is an expanded and revised version of . An earlier version of this paper is the Stanford University Technical Note STAN-CS-TN-94-13. The current version contains new sections §7 and §13, as well as updated bibliographical remarks. Some of the results in this paper have been previously also published in one of the following: [15, 9, 10].
Our object is to introduce contexts as abstract mathematical entities with properties useful in artificial intelligence. Our attitude is therefore a computer science or engineering attitude. If one takes a psychological or philosophical attitude, one can examine the phenomenon of contextual dependence of an utterance or a belief. However, it seems to us unlikely that this study will result in a unique conclusion about what context is. Instead, as is usual in AI, various notions will be found useful.
One major AI goal of this formalization is to allow simple axioms for common sense phenomena, e.g. axioms for static blocks world situations, to be lifted to contexts involving fewer assumptions, e.g. to contexts in which situations change. This is necessary if the axioms are to be included in general common sense databases that can be used by any programs needing to know about the phenomenon covered but which may be concerned with other matters as well. Rules for lifting are described in section 4 and an example is given.
A second goal is to treat the context associated with a particular circumstance, e.g. the context of a conversation in which terms have particular meanings that they wouldn't have in the language in general.
The most ambitious goal is to make AI systems which are never permanently stuck with the concepts they use at a given time because they can always transcend the context they are in--if they are smart enough or are told how to do so. To this end, formulas are always considered as themselves asserted within a context, i.e. we have something like . The regress is infinite, but we will show that it is harmless.
The main formulas are sentences of the form
which are to be taken as assertions that the proposition p is true in the context c, itself asserted in an outer context c'. (We have adopted Guha's  notation rather than that of , because he built his into Cyc, and it was easy for us to change ours.) For now, propositions may be identified with sentences in English or in various logical languages, but we may later take them in the sense of  as abstractions with possibly different identity conditions. We will use both logical sentences and English sentences in the examples, according to whichever is more convenient.
Contexts are abstract objects. We don't offer a definition, but we will offer some examples. Some contexts will be rich objects, like situations in situation calculus. For example, the context associated with a conversation is rich; we cannot list all the common assumptions of the participants. Thus we don't purport to describe such contexts completely; we only say something about them. On the other hand, the contexts associated with certain microtheories are poor and can be completely described.
Here are some examples.
asserts that it is true in the context of the Sherlock Holmes stories that Holmes is a detective. We use English quotations here, because the formal notation is still undecided. Here c0 is considered to be an outer context. In the context , Holmes's mother's maiden name does not have a value. We also have
Since the outer context is taken to be the same as above, we will omit it in subsequent formulas until it becomes relevant again. In this context, Holmes's mother's maiden name has a value, namely Jackson, and it would still have that value even if no-one today knew it.
is the assertion that John McCarthy is at Stanford University in a context in which it is given that stands for the first author of this paper and that Stanford stands for Stanford University. The context c1 may be one in which the symbol at is taken in the sense of being regularly at a place, rather than meaning momentarily at the place. In another context c2, may mean physical presence at Stanford at a certain instant. Programs based on the theory should use the appropriate meaning automatically.
Besides the sentence , we also want the term where term is a term. For example, we may need , when c is a context that has a time, e.g. a context usable for making assertions about a particular situation. The interpretation of involves a problem that doesn't arise with . Namely, the space in which terms take values may itself be context dependent. However, many applications will not require this generality and will allow the domain of terms to be regarded as fixed.
Here's another example of the value of a term depending on context:
We can consider as a term for which the set of possible values depends on context. In the case of the Supreme Court justice, the set consists of real women, whereas in the Sherlock Holmes case, it consists of fictitious women.
The remainder of this paper is organized as follows. In §2 we give examples of some elementary relations among contexts. The basic operations of contextual reasoning, entering and exiting contexts, are introduced in §3. In §4 we focus on lifting axioms--axioms relating what is true in one context based on what is true in another context. Building on the basic notions of entering/exiting contexts and lifting axioms, §5 shows how contexts can be used to reason in the style of natural deduction. To illustrate short term applicability of contexts, §6 demonstrates how the context formalism aids in the integration of databases which were not originally intended to be used together. These techniques are not specific to databases and can be applied in integrating other objects, such as plans; see §7. In §8 we treat contexts associated with particular circumstances, namely those that come up in a conversation. The transcending of the outer context of a system, as is discussed in §9, might result in AI programs which are never permanently stuck with the concepts they use at a particular time. In §10, we argue that all sentences will always be context dependent, and thus it is not possible to define an absolute outermost context. Returning to applications, in §11 we sketch how contexts can be used to represent mental states and revise the beliefs of an agent. We conclude with a some remarks and conclusions in §12 and §13.