To be presented at the ECAI-94 Spatial and Temporal Reasoning Workshop.
Conceptual Neighbourhoods in Temporal and Spatial Reasoning J M Gooday and A G Cohn Division of Arti cial Intelligence School of Computer Studies University of Leeds, Leeds LS2 9JT, England. Telephone: (+44) 532 335430 Email: fgooday,
[email protected]
Abstract In this paper we examine Freksa's conceptual neighbourhood-based reasoning technique for interval calculus (Freksa 1992) and show how this may be extended and applied to the spatial calculi of Randell, Cui and Cohn (1992). Our analysis suggests that Freksa's criteria for choosing a suitable set of conceptual neighbourhoods with which to reason may be innapropriate and we suggest an alternative scheme that yields even more compact neighbourhood-based composition tables.
1 Introduction Representing and manipulating knowledge about time and space is recognised as a crucially important part of commonsense reasoning. If we are ever to construct a truly autonomous AI system then practical ways of reasoning about these two domains must be found. Over the last decade Allen's (1981) interval calculus has enjoyed much success as a formalism for temporal reasoning in AI. More recently, spatial region calculi similar to Allen's system have gained popularity. In all of these systems composition table look-up forms an integral part of the reasoning process. This paper examines how Freksa's (1992) conceptual neighbourhood-based method for compacting Allen's temporal interval calculus composition table can be applied to more complex spatial calculi. We further show how Freksa's approach can be improved upon to yield signi cantly smaller conceptual neighbourhood-based tables. We nish by brie y describing related research on constructing conceptual neighbourhood graphs directly from the information in composition tables.
2 Spatial and temporal calculi Over the last decade Allen's interval calculus (Allen 1981) has become an increasingly popular formalism for reasoning about the relationships between time intervals. Interval calculus makes use of the thirteen basic dyadic relations that can hold between two time intervals (Allen does not allow time points1 ) shown in gure 1. Transitivity properties can be used to determine which relations may hold between pairs of intervals. For example, given that interval i1 is before i2 and also that i2 meets i3 it can be inferred that i1 is before i3 . Allen encoded all such transitivity information in a 13 13 composition table thus making the task of reasoning in interval calculus a simple matter of table look-up. The support of the SERC under grant no. GR/G36852 and GR/H 78955 is gratefully acknowledged. The authors would like to thank Brandon Bennett and Nick Gotts whose comments have greatly improved this paper. 1 See (Allen and Hayes 1989) for a discussion on how to incorporate time points into the calculus.
AA
A
B
‘A before B’ ‘B after A’
AmB B mi A
A
B
‘A meets B’ ‘B met-by A’
AoB B oi A
A
A si B BsA
A
‘A overlaps B’ ‘B overlapped-by A’
B
‘A started-by B’ ‘B starts A’
B A di B BdA
A
A fi B BfA
A
‘A contains B’ ‘B during A’
B
‘A ended-by B’ ‘B ends A’ B
A A=B
‘A equals B’ B
Figure 1: Allen's 13 interval-interval relations Randell et al. (1992) have developed interval calculus-like formalisms for the spatial domain based on Clarke's logic of connection (Clarke 1981, Clarke 1985). The basic RCC formal theory assumes a primitive dyadic relation: C(x; y ) read as `x connects with y' which is de ned on non-null regions. C is re exive and symmetric. In terms of points incident in regions, C(x; y ) holds when regions x and y share a common boundary point. Using the relation C, a set of 8 mutually exhaustive and pairwise disjoint \base relations" are de ned (in a sorted rst order logic (Cohn 1987)). These relations, shown in gure 2, are: DC (is disconnected from), EC (is externally connected with), PO (partially overlaps), TPP (is a tangential proper part of), NTPP (is a nontangential proper part of), TPPI (inverse of TPP), NTPPI (inverse of NTPP) and EQUAL. This set of base relations will be called RCC-8. In fact, more general relations such as DR (distinct region) are also de ned in the general RCC theory, but these are expressible in terms of disjunctions of the basic relations (e.g. DR is equivalent to EC _ DC). A more expressive calculus may be produced by introducing an additional primitive function conv(x) `the convex hull of x', which is axiomatised and used to de ne further dyadic relations not expressible in terms of C alone. These additional relations are used to describe regions that are either inside, partially inside or outside other regions. In particular a set of base relations RCC-15 is de ned, in which EC and DC are replaced by nine more specialised relations: DR(O,O), DR(P,O), DR(O,P), DR(I,O), DR(O,I), DR(P,P), DR(I,P), DR(P,I), DR(I,I). Here, DR(P,O)(x,y) denotes that x and y are Distinct Regions, x is Partially overlaps conv(y), and y is Outside conv(x). Just as in Allen's interval calculus, composition tables for the relation sets RCC-8 and RCC-15 can be determined and used to reason about spatial relationships. Moreover, many more relations making ner grained distinctions can be de ned e.g. (Cohn, Randell and Cui 1994, Gotts 1994).
3 Compact composition tables In the real, dynamic world spatial and temporal relationships between objects may change from one situation to the next. For example, in 2-dimensions the spatial region occupied by a pebble on a beach
A
B
A
DC(A,B) ‘A disconnected from B’
A B
B
A
B
EC(A,B) ‘A externally connected to B’
PO(A,B) ‘A partially overlapping B’
B A
AB
TPP(A,B) ‘A tangential proper part of B’
NTPP(A,B) ‘A nontangential proper-part of B’
TPPI(B,A) ‘B has tangential proper part A’
NTPPI(B,A) ‘B has nontangential proper-part A’
EQUALS(A,B) ‘A equal to B’
Figure 2: RCC-8 region-region relations (we denote the pebble by P ) will be disconnected from the region occupied by the sea (S ) at low tide. As the tide rises S expands and its boundary approaches P until the two regions touch i.e. S and P become externally connected. As the tide continues to rise the regions partially overlap and then P becomes rst a tangential proper part and then a nontangential proper part of S . We can directly represent this process as a sequence of RCC-8 relations: (
DC S; P
) ) E C (S; P ) ) P O(S; P ) ) T P P (S; P ) ) N T P P (S; P )
One can easily imagine alternative RCC-8 sequences that could be used to represent other real world processes. However, it is not the case that a direct transition exists between every pair of relations. For example, in the physical world, two initially disconnected regions cannot subsequently overlap unless they have rst come into external contact i.e. there can be no direct transitions from DC to PO. We call the graph of all possible direct transitions from one relation to another the transition graph. Connected pairs in this graph are called conceptual neighbours, a term rst used by Freksa (1992) with respect to Allen's interval calculus. A conceptual neighbourhood is de ned as any connected subgraph of the transition graph (including single nodes and the full graph itself). It has become apparent that the relationship between conceptual neighbourhoods and composition tables is very strong. Freksa (1992) has pointed out that every entry in the composition table for Allen's interval calculus de nes a conceptual neighbourhood. Furthermore, although there are 169 table entries only 29 of these are dierent. This is a surprising result considering that the transition graph for Allen's calculus gives rise to 1255 dierent conceptual neighbourhoods. Similar properties hold for the RCC-8 composition table { here we nd only 21 dierent entries, all of which also form conceptual neighbourhoods. Freksa has investigated the possibility of replacing the interval calculus composition table by one that describes transitivity properties between conceptual neighbourhoods (where at least some of these neighbourhoods are non singletons). He argued that as conceptual neighbourhoods tend to be disjunctions of basic relations they capture the uncertainty prevalent in the everyday world. The main diculty in constructing such neighbourhood-based tables is how to select an appropriate set of neighbourhoods upon which to base the table. The interval calculus contains 1255 dierent conceptual neighbourhoods so it is impractical to investigate all possible combinations in search of the `best' set. Freksa recognised this problem and suggested plausible criteria that might be used to reduce the search space (Freksa 1993). 1. Each of the basic relations in the original calculus should be readily obtainable, either by their direct inclusion in the new set or from the intersection of two of its elements. This
ensures that it is possible to use the new table to reason about basic relations with a minimum of computational overheads. 2. The set should consist only of neighbourhoods that are also entries from the original transitivity table. The justi cation for this is that these neighbourhoods are in some way more important than others as they freely occur even in the original table. The second criterion limits the search to the 29 neighbourhoods that occur in Allen's table, drastically reducing the search space. Freksa identi ed a set of 10 neighbourhoods from these that also satis ed the rst criterion (shown as the rst entry in table 1). The resulting composition table based on these contained only 10 10 entries | a 40% reduction in size compared with Allen's original. We have formally veri ed that Freksa's solution is minimal and have obtained an additional eight minimal solutions (last eight entries of table 1). However, it is hard to say which, if any, of the solutions is the 1 2 3 4 5 6 7 8 9
fg
fsi; =; sg fsi; =; sg fsi; =; sg fsi; =; sg fsi; =; sg fsi; =; sg fsi; =; sg fsi; =; sg fsi; =; sg
ffi; =; f g ffi; =; f g ffi; =; f g ffi; =; f g ffi; =; f g ffi; =; f g ffi; =; f g ffi; =; f g ffi; =; f g
fo; fi; dig fg fdi; si; oig fg fo; fi; dig fo; fi; dig
fo; s; dg fdi; si; oig fo; s; dg fo; s; dg fo; fi; di g fdi; si; oig fo; fi; di g fdi; si; oig fo; s; dg
fd; f; oig fo; s; dg fd; f; oig fd; f; oig fdi; si; oig fo; s; dg fd; f; oig fd; f; oig fd; f; oig
Table 1: Minimal sets of conceptual neighbourhoods for Allen's interval calculus best. Freksa's solution has the property that it uses the smallest conceptual neighbourhoods (each contains three or less disjuncts) but this is not necessarily an advantage as larger neighbourhoods may capture more general information about uncertainty. Furthermore, none of the solutions appear to be any less `cognitively plausible' than others. We have recently applied Freksa's technique to RCC-8 and RCC-15 in an attempt to produce reduced tables. Using a low-level C language program in which neighbourhoods were expressed (and manipulated) as bit vectors we were able to perform an exhaustive analysis of RCC-8. Our results showed that Freksa's approach does not produce a compact neighbourhood-based table for this formalism, which seems surprising considering the similarity between this and Allen's interval calculus (A generalized form of Allen's calculus can easily be obtained from RCC-8 by introducing the notion of direction). The main reason for failure is that Freksa's second criterion rules out a great number of conceptual neighbourhoods that would otherwise be considered as viable candidates. Those that remain are simply too few in number and not suciently dierent to one another to yield a smaller table in accordance with the rst criterion. RCC-15 has a very much larger composition table than both RCC-8 and Allen's interval calculus { 225 entries, of which 66 are unique. Even after applying Freksa's second criterion it is not possible to exhaustively check each potentially suitable set of neighbourhoods against the rst criterion as there are 1014 sets with 15 or less elements. Fortunately, the conceptual neighbourhood structure of RCC-15 lends itself readily to simpli cation. Figure 3 shows how RCC-15 can be viewed as consisting of two separate conceptual neighbourhoods { one for the DR relations (vertical plane) and one for PO,TPP, TPPI, NTPP, NTPPI and EQUAL (horizontal plane) { that connect through PO (PO is connected to every DR relation). We applied Freksa's technique to each of these separately and combined the resulting minimal solutions. This yielded a set of 13 neighbourhoods which could be used as the basis of a 169 entry neighbourhood-based composition table. Although this represents a 25% reduction in table size compared with the original, it is still small compared with the 40% reduction Freksa obtained with Allen's interval calculus. The results of applying Freksa's approach to RCC-8 and RCC-15 led us to question Freksa's second criterion: neighbourhoods used as relations in the new tables can only be chosen from those that appear as entries in the original composition table. We discovered that by removing this criterion we could obtain 24 alternative eight-neighbourhood solutions for RCC-15, each representing a 75% reduction in table size! One such solution is illustrated in gure 4. Similarly, a number of 6 6
DR(O,O) DR(O,P)
DR(P,O) DR(O,I) TPP NTPP
DR(P,P)
DR(I,O)
PO EQUAL
TPPI DR(P,I) NTPPI DR(I,P) DR(I,I)
Figure 3: Transition graph for RCC-15 solutions can be obtained for RCC-8, representing a 44% reduction in table size. Freksa's motivation for producing conceptual neighbourhood based tables was that these might somehow be more cognitively plausible than the originals. However, our main motivation is increased computational eciency resulting from reduced table size. Compacted composition tables are ideal for use in a multi-processor environment. Although the tables are much smaller than the non-compacted originals, it is often necessary to perform more look-up operations with the new tables. For example, the table entry for two basic relations can be obtained via a single look-up operation using a non-compacted table. However, for the compact table basic relations are generally obtained by intersecting two of the neighbourhood relations upon which the table is based, so four look-ups are required. However, if a number of simple processing elements are available, the look-ups can be performed simultaneously leading to a considerable improvement in eciency overall. This is particularly noticeable with large tables and such an approach will make implementation of an enhanced spatial calculus (with at least a 100 100 composition table) described in (Cohn, Randell and Cui 1994) practical. Yet larger relation calculi could easily be generated by considering, e.g., orientation information (Zimmermann and Freksa 1993).
4 Further work and conclusions We intend to apply compaction techniques to a wider variety of spatial and temporal calculi | there are many possibilities in the literature e.g. (Zimmermann and Freksa 1993, Cohn, Randell and Cui 1994) | with a view to con rming the utility of these techniques in logics with a large number of base relations. Decidable calculi to model these languages also need to be developed (Bennett 1994). Another related piece of research we are currently conducting is the automatic generation of transition graphs from composition tables (Cohn, Gooday and Bennett 1994). One approach to constructing transition graphs is to generate all possible graphs and test these for suitability against constraints derived from the composition table. We know that every composition table entry forms a conceptual
Figure 4: Conceptual neighbourhood set for RCC-15 compact table neighbourhood. Conceptual neighbourhoods can be viewed as representing path linked nodes in the transition graph and this enables us to test potential solutions to ensure that they only contain paths corresponding to these and that all such paths are represented. Unfortunately, for all but the simplest calculi it is infeasible to generate and test every possible graph. A practical alternative is to use constraint-based reasoning techniques to prune the search space. We start by labelling a node with each relation (singleton entry in the composition table). Next, we take each two-relation composition table entry in turn and connect the corresponding nodes. For each three-relation entry, if the relations are not path connected then we connect the appropriate nodes. This process is continued for fourrelation entries etc. If we apply this technique to RCC-8 we obtain an almost complete transition graph (in fact, the graph corresponds to what Freksa calls the B and C neighbourhoods).
References Allen, J. F.: 1981, An interval-based representation of temporal knowledge, Proceedings 7th IJCAI. Allen, J. F. and Hayes, P. J.: 1989, Moments and points in an interval-based temporal logic, Computational Intelligence 5, 225{238. Bennett, B.: 1994, Spatial reasoning with propositional logics, in J. Doyle, E. Sandewall and P. Torasso (eds), Principles of Knowledge Representation and Reasoning: Proceedings of the 4th International Conference (KR94), Morgan Kaufmann, San Francisco, CA. Clarke, B. L.: 1981, A calculus of individuals based on connection, Notre Dame Journal of Formal Logic 23(3), 204{218. Clarke, B. L.: 1985, Individuals and points, Notre Dame Journal of Formal Logic 26(1), 61{75. Cohn, A. G.: 1987, A more expressive formulation of many sorted logic, Journal of Automated Reasoning 3, 113{200. Cohn, A. G., Gooday, J. M. and Bennett, B.: 1994, A comparison of structures in spatial and temporal logics, in R. Casati, B. Smith and G. White (eds), Philosophy and the Cognitive Sciences: Proceedings of the 16th International Wittgenstein Symposium, Holder-Pichler-Tempsky, Vienna. To appear.
Cohn, A. G., Randell, D. A. and Cui, Z.: 1994, Taxonomies of logically de ned qualitative spatial relations, in N. Guarino and R. Poli (eds), Formal Ontology in Conceptual Analysis and Knowledge Representation, Kluwer. To appear. Freksa, C.: 1992, Temporal reasoning based on semi-intervals, Arti cial Intelligence 54, 199{227. Freksa, C.: 1993, Personnal communication. Gotts, N. M.: 1994, How far can we `c'? de ning a `doughnut' using connection alone, in J. Doyle, E. Sandewall and P. Torasso (eds), Principles of Knowledge Representation and Reasoning: Proceedings of the 4th International Conference (KR94), Morgan Kaufmann, San Francisco, CA. Randell, D. A., Cui, Z. and Cohn, A. G.: 1992, A spatial logic based on regions and connection, Proceedings 3rd International Conference on Knowledge Representation and Reasoning, Morgan Kaufmann, San Mateo, pp. 165{176. Zimmermann, K. and Freksa, C.: 1993, Enhancing spatial reasoning by the concept of motion, in A. Sloman (ed.), Prospects for Arti cial Intelligence, IOS Press, pp. 140{147.