On the Decidability of Connectedness Constraints in 2D and 3D Euclidean Spaces
Roman Kontchakov, Yavor Nenov, Ian Pratt-Hartmann, Michael Zakharyaschev
aa r X i v : . [ c s . L O ] A p r On the Decidability of Connectedness Constraints in 2D and 3D Euclidean Spaces
Roman Kontchakov , Yavor Nenov , Ian Pratt-Hartmann and Michael Zakharyaschev Department of Computer Scienceand Information SystemsBirkbeck College London, U.K. School of Computer ScienceUniversity of Manchester, U.K.
Abstract
We investigate (quantifier-free) spatial constraintlanguages with equality, contact and connectednesspredicates, as well as Boolean operations on re-gions, interpreted over low-dimensional Euclideanspaces. We show that the complexity of reasoningvaries dramatically depending on the dimension ofthe space and on the type of regions considered. Forexample, the logic with the interior-connectednesspredicate (and without contact) is undecidable overpolygons or regular closed sets in R , E XP T IME -complete over polyhedra in R , and NP-completeover regular closed sets in R . A central task in Qualitative Spatial Reasoning is that of de-termining whether some described spatial configuration is ge-ometrically realizable in 2D or 3D Euclidean space. Typi-cally, such a description is given using a spatial logic—a for-mal language whose variables range over (typed) geometricalentities, and whose non-logical primitives represent geomet-rical relations and operations involving those entities. Wherethe geometrical primitives of the language are purely topolog-ical in character, we speak of a topological logic ; and wherethe logical syntax is confined to that of propositional calculus,we speak of a topological constraint language .Topological constraint languages have been intensivelystudied in Artificial Intelligence over the last two decades.The best-known of these,
RCC and RCC , employvariables ranging over regular closed sets in topologicalspaces, and a collection of eight (respectively, five) bi-nary predicates standing for some basic topological re-lations between these sets [Egenhofer and Franzosa, 1991;Randell et al. , 1992; Bennett, 1994; Renz and Nebel, 2001].An important extension of RCC , known as BRCC , ad-ditionally features standard Boolean operations on regularclosed sets [Wolter and Zakharyaschev, 2000].A remarkable characteristic of these languages is their in sensitivity to the underlying interpretation. To show thatan RCC -formula is satisfiable in n -dimensional Euclideanspace, it suffices to demonstrate its satisfiability in any topo-logical space [Renz, 1998]; for BRCC -formulas, satisfiabil-ity in any connected space is enough. This inexpressiveness yields (relatively) low computational complexity: satisfiabil-ity of BRCC -, RCC - and RCC -formulas over arbitrarytopological spaces is NP-complete; satisfiability of BRCC -formulas over connected spaces is PS PACE -complete.However, satisfiability of spatial constraints by arbi-trary regular closed sets by no means guarantees realiz-ability by practically meaningful geometrical objects, where connectedness of regions is typically a minimal require-ment [Borgo et al. , 1996; Cohn and Renz, 2008]. (A con-nected region is one which consists of a ‘single piece.’) It iseasy to write constraints in
RCC that are satisfiable by con-nected regular closed sets over arbitrary topological spacesbut not over R ; in BRCC we can even write formulas satis-fiable by connected regular closed sets over arbitrary spacesbut not over R n for any n . Worse still: there exist verysimple collections of spatial constraints (involving connect-edness) that are satisfiable in the Euclidean plane, but onlyby ‘pathological’ sets that cannot plausibly represent the re-gions occupied by physical objects [Pratt-Hartmann, 2007].Unfortunately, little is known about the complexity of topo-logical constraint satisfaction by non-pathological objectsin low-dimensional Euclidean spaces. One landmark re-sult [Schaefer et al. , r003] in this area shows that satisfiabilityof RCC -formulas by disc-homeomorphs in R is still NP-complete, though the decision procedure is vastly more intri-cate than in the general case. In this paper, we investigate thecomputational properties of more general and flexible spatiallogics with connectedness constraints interpreted over R and R .We consider two ‘base’ topological constraint languages.The language B features = as its only predicate, but has func-tion symbols + , − , · denoting the standard operations of fu-sion, complement and taking common parts defined for regu-lar closed sets, as well as the constants and for the entirespace and the empty set. Our second base language, C , ad-ditionally features a binary predicate, C , denoting the ‘con-tact’ relation (two sets are in contact if they share at least onepoint). The language C is a notational variant of BRCC (andthus an extension of RCC ), while B is the analogous exten-sion of RCC . We add to B and C one of two new unary pred-icates: c , representing the property of connectedness, and c ◦ ,representing the (stronger) property of having a connected in-terior . We denote the resulting languages by B c , B c ◦ , C c and C c ◦ . We are interested in interpretations over ( i ) the regularlosed sets of R and R , and ( ii ) the regular closed poly-hedral sets of R and R . (A set is polyhedral if it can bedefined by finitely many bounding hyperplanes.) By restrict-ing interpretations to polyhedra we rule out satisfaction bypathological sets and use the same ‘data structure’ as in GISs.When interpreted over arbitrary topological spaces, thecomplexity of reasoning with these languages is known: sat-isfiability of B c ◦ -formulas is NP-complete, while for theother three languages, it is E XP T IME -complete. Likewise,the 1D Euclidean case is completely solved. For the spaces R n ( n ≥ ), however, most problems are still open. Allfour languages contain formulas satisfiable by regular closedsets in R , but not by regular closed polygons; in R , theanalogous result is known only for B c ◦ and C c ◦ . The sat-isfiability problem for B c , C c and C c ◦ is E XP T IME -hard (inboth polyhedral and unrestricted cases) for R n ( n ≥ ); how-ever, the only known upper bound is that satisfiability of B c ◦ -formulas by polyhedra in R n ( n ≥ ) is E XP T IME -complete.(See [Kontchakov et al. , 2010b] for a summary.)This paper settles most of these open problems, reveal-ing considerable differences between the computational prop-erties of constraint languages with connectedness predi-cates when interpreted over R and over abstract topologi-cal spaces. Sec. 3 shows that B c , B c ◦ , C c and C c ◦ are allsensitive to restriction to polyhedra in R n ( n ≥ ). Sec. 4establishes an unexpected result: all these languages are un-decidable in 2D, both in the polyhedral and unrestricted cases([Dornheim, 1998] proves undecidability of the first-order versions of these languages). Sec. 5 resolves the open issue ofthe complexity of B c ◦ over regular closed sets (not just poly-hedra) in R by establishing an NP upper bound. Thus, Qual-itative Spatial Reasoning in Euclidean spaces proves muchmore challenging if connectedness of regions is to be takeninto account. We discuss the obtained results in the contextof spatial reasoning in Sec. 6. Omitted proofs can be found inthe appendix. Let T be a topological space. We denote the closure of any X ⊆ T by X − , its interior by X ◦ and its boundary by δX = X − \ X ◦ . We call X regular closed if X = X ◦− , and denoteby RC ( T ) the set of regular closed subsets of T . Where T isclear from context, we refer to elements of RC ( T ) as regions . RC ( T ) forms a Boolean algebra under the operations X + Y = X ∪ Y , X · Y = ( X ∩ Y ) ◦− and − X = ( T \ X ) − .We write X ≤ Y for X · ( − Y ) = ∅ ; thus X ≤ Y iff X ⊆ Y .A subset X ⊆ T is connected if it cannot be decomposed intotwo disjoint, non-empty sets closed in the subspace topology; X is interior-connected if X ◦ is connected.Any ( n − -dimensional hyperplane in R n , n ≥ , boundstwo elements of RC ( R n ) called half-spaces . We denote by RCP ( R n ) the Boolean subalgebra of RC ( R n ) generated bythe half-spaces, and call the elements of RCP ( R n ) (regularclosed) polyhedra . If n = 2 , we speak of (regular closed) polygons . Polyhedra may be regarded as ‘well-behaved’ or, intopologists’ parlance, ‘ tame .’ In particular, every polyhedronhas finitely many connected components, a property which isnot true of regular closed sets in general. The topological constraint languages considered here allemploy a countably infinite collection of variables r , r , . . . The language C features binary predicates = and C , togetherwith the individual constants , and the function symbols + , · , − . The terms τ and formulas ϕ of C are given by: τ ::= r | τ + τ | τ · τ | − τ | | ,ϕ ::= τ = τ | C ( τ , τ ) | ϕ ∧ ϕ | ¬ ϕ . The language B is defined analogously, but without the pred-icate C . If S ⊆ RC ( T ) for some topological space T , an interpretation over S is a function · I mapping variables r toelements r I ∈ S . We extend · I to terms τ by setting I = ∅ , I = T , ( τ + τ ) I = τ I + τ I , etc. We write I | = τ = τ iff τ I = τ I , and I | = C ( τ , τ ) iff τ I ∩ τ I = ∅ . We read C ( τ , τ ) as ‘ τ contacts τ .’ The relation | = is extended tonon-atomic formulas in the obvious way. A formula ϕ is sat-isfiable over S if I | = ϕ for some interpretation I over S .Turning to languages with connectedness predicates, wedefine B c and C c to be extensions of B and C with the unarypredicate c . We set I | = c ( τ ) iff τ I is connected in the topo-logical space under consideration. Similarly, we define B c ◦ and C c ◦ to be extensions of B and C with the predicate c ◦ ,setting I | = c ◦ ( τ ) iff ( τ I ) ◦ is connected. Sat ( L , S ) is the setof L -formulas satisfiable over S , where L is one of B c , C c , B c ◦ or C c ◦ (the topological space is implicit in this notation,but will always be clear from context). We shall be concernedwith Sat ( L , S ) , where S is RC ( R n ) or RCP ( R n ) for n = 2 , .To illustrate, consider the B c ◦ -formulas ϕ k given by ^ ≤ i ≤ k (cid:0) c ◦ ( r i ) ∧ ( r i = 0) (cid:1) ∧ ^ i
Theorem 2
There is a C c -formula satisfiable over RC ( R n ) , n ≥ , but not by regions with finitely many components. Proof.
Let ϕ ∞ be as above. To simplify the presentation, weignore the difference between variables and the regions theystand for, writing, for example, a i instead of a I i . We constructa sequence of disjoint components X i of d ⌊ i ⌋ and open sets V i connecting X i to X i +1 (Fig. 3). By the first conjunct of (4), let X be a component of d containing points in a . Suppose X i has been constructed. By (5) and (6), X i is in contact with a ⌊ i +1 ⌋ . Using (7) and the fact that R n is locally connected,one can find a component X i +1 of d ⌊ i +1 ⌋ which has pointsin a i +1 , and a connected open set V i such that V i ∩ X i and V i ∩ X i +1 are non-empty, but V i ∩ d ⌊ i +2 ⌋ is empty. . . .X X X X V V V Figure 3: The sequence { X i , V i } i ≥ generated by ϕ ∞ . ( S i +1 and R i +1 are the ‘holes’ of X i +1 containing X i and X i +2 .)To see that the X i are distinct, let S i +1 and R i +1 be thecomponents of − X i +1 containing X i and X i +2 , respectively.It suffices to show S i +1 ⊆ S ◦ i +2 . Note that the connected set V i must intersect δS i +1 . Evidently, δS i +1 ⊆ X i +1 ⊆ d ⌊ i +1 ⌋ .Also, δS i +1 ⊆ − X i +1 ; hence, by (3) and (7), δS i +1 ⊆ d i ∪ d ⌊ i +2 ⌋ . By Lemma 1, δS i +1 is connected, and therefore,by (7), is entirely contained either in d ⌊ i ⌋ or in d ⌊ i +2 ⌋ . Since V i ∩ δS i +1 = ∅ and V i ∩ d ⌊ i +2 ⌋ = ∅ , we have δS i +1 d ⌊ i +2 ⌋ ,so δS i +1 ⊆ d i . Similarly, δR i +1 ⊆ d i +2 . By (7), then, δS i +1 ∩ δR i +1 = ∅ , and since S i +1 and R i +1 are componentsof the same set, they are disjoint. Hence, S i +1 ⊆ ( − R i +1 ) ◦ ,and since X i +2 ⊆ R i +1 , also S i +1 ⊆ ( − X i +2 ) ◦ . So, S i +1 lies in the interior of a component of − X i +2 , and since δS i +1 ⊆ X i +1 ⊆ S i +2 , that component must be S i +2 . ❑ Now we show how the C c -formula ϕ ∞ can be transformedto C c ◦ - and B c -formulas with similar properties. Note firstthat all occurrences of c in ϕ ∞ have positive polarity. Let ϕ ◦∞ be the result of replacing them with the predicate c ◦ .In Fig. 2, the connected regions mentioned in (5) are infact interior-connected; hence ϕ ◦∞ is satisfiable over RC ( R n ) .Since interior-connectedness implies connectedness, ϕ ◦∞ en-tails ϕ ∞ , and we obtain: Corollary 3
There is a C c ◦ -formula satisfiable over RC ( R n ) , n ≥ , but not by regions with finitely many components. To construct a B c -formula, we observe that all occurrencesof C in ϕ ∞ are negative. We eliminate these using the pred-icate c . Consider, for example, the formula ¬ C ( a i , t ) in (6).By inspection of Fig. 2, one can find regions r , r satisfying c ( r ) ∧ c ( r ) ∧ ( a i ≤ r ) ∧ ( t ≤ r ) ∧ ¬ c ( r + r ) . (8)On the other hand, (8) entails ¬ C ( a i , t ) . By treating all othernon-contact relations similarly, we obtain a B c -formula ψ ∞ that is satisfiable over RC ( R n ) , and that entails ϕ ∞ . Thus: Corollary 4
There is a B c -formula satisfiable over RC ( R n ) , n ≥ , but not by regions with finitely many components. Obtaining a B c ◦ analogue is complicated by the fact thatwe must enforce non-contact constraints using c ◦ (rather than c ). In the Euclidean plane, this can be done using planarityconstraints ; see Appendix A. Theorem 5
There is a B c ◦ -formula satisfiable over RC ( R ) ,but not by regions with finitely many components. heorem 2 and Corollary 4 entail that, if L is B c or C c ,then Sat ( L , RC ( R n )) = Sat ( L , RCP ( R n )) for n ≥ . The-orem 5 fails for RC ( R n ) with n ≥ (Sec. 5). However, weknow from (2) that Sat ( B c ◦ , RC ( R n )) = Sat ( B c ◦ , RCP ( R n )) for all n ≥ . Theorem 2 fails in the 1D case; moreover, Sat ( L , RC ( R )) = Sat ( L , RCP ( R )) only in the case L = B c or B c ◦ [Kontchakov et al. , 2010b]. Let L be any of B c , C c , B c ◦ or C c ◦ . In this section, we show,via a reduction of the Post correspondence problem (PCP),that
Sat ( L , RC ( R )) is r.e.-hard, and Sat ( L , RCP ( R )) is r.e.-complete. An instance of the PCP is a quadruple w =( S, T, w , w ) where S and T are finite alphabets, and each w i is a word morphism from T ∗ to S ∗ . We may assume that S = { , } and w i ( t ) is non-empty for any t ∈ T . The in-stance w is positive if there exists a non-empty τ ∈ T ∗ suchthat w ( τ ) = w ( τ ) . The set of positive PCP-instances isknown to be r.e.-complete. The reduction can only be givenin outline here: full details are given in Appendix B.To deal with arbitrary regular closed subsets of RC ( R ) ,we use the technique of ‘wrapping’ a region inside two big-ger ones. Let us say that a is a triple a = ( a, ˙ a, ¨ a ) ofelements of RC ( R ) such that = ¨ a ≪ ˙ a ≪ a , where r ≪ s abbreviates ¬ C ( r, − s ) . It helps to think of a = ( a, ˙ a, ¨ a ) as consisting of a kernel, ¨ a , encased in two protective lay-ers of shell. As a simple example, consider the sequenceof 3-regions a , a , a depicted in Fig. 4, where the inner-most regions form a sequence of externally touching poly-gons. When describing arrangements of 3-regions, we use a a a ˙ a ˙ a ˙ a ¨ a ¨ a ¨ a Figure 4: A chain of 3-regions satisfying stack ( a , a , a ) .the variable r for the triple of variables ( r, ˙ r, ¨ r ) , taking theconjuncts ¨ r = 0 , ¨ r ≪ ˙ r and ˙ r ≪ r to be implicit. As withordinary variables, we often ignore the difference between 3-region variables and the 3-regions they stand for.For k ≥ , define the formula stack ( a , . . . , a k ) by ^ ≤ i ≤ k c ( ˙ a i + ¨ a i +1 + · · · + ¨ a k ) ∧ ^ j − i> ¬ C ( a i , a j ) . Thus, the triple of 3-regions in Fig. 4 satisfies stack ( a , a , a ) . This formula plays a crucial role inour proof. If stack ( a , . . . , a k ) holds, then any point p inthe inner shell ˙ a of a can be connected to any point p k in the kernel ¨ a k of a k via a Jordan arc γ · · · γ k whose i thsegment, γ i , never leaves the outer shell a i of a i . Moreover,each γ i intersects the inner shell ˙ a i +1 of a i +1 , for ≤ i < k .This technique allows us to write C c -formulas whose sat-isfying regions are guaranteed to contain various networks ofarcs, exhibiting almost any desired pattern of intersections. Now recall the construction of Sec. 3, where constraints onthe variables d , . . . , d were used to enforce ‘cyclic’ patternsof components. Using stack ( a , . . . , a k ) , we can write a for-mula with the property that the regions in any satisfying as-signment are forced to contain the pattern of arcs having theform shown in Fig. 5. These arcs define a ‘window,’ contain- ζ η ζ η ζ η ζ n η n Figure 5: Encoding the PCP: Stage 1.ing a sequence { ζ i } of ‘horizontal’ arcs ( ≤ i ≤ n ), eachconnected by a corresponding ‘vertical arc,’ η i , to some pointon the ‘top edge.’ We can ensure that each ζ i is included in aregion a ⌊ i ⌋ , and each η i ( ≤ i ≤ n ) in a region b ⌊ i ⌋ , where ⌊ i ⌋ now indicates i mod . By repeating the construction, asecond pair of arc-sequences, { ζ ′ i } and { η ′ i } ( ≤ i ≤ n ′ ) canbe established, but with each η ′ i connecting ζ ′ i to the ‘bottomedge.’ Again, we can ensure each ζ ′ i is included in a region a ′⌊ i ⌋ and each η ′ i in a region b ′⌊ i ⌋ ( ≤ i ≤ n ′ ). Further, wecan ensure that the final horizontal arcs ζ n and ζ ′ n ′ (but noothers) are joined by an arc ζ ∗ lying in a region z ∗ . The cru- ζ ′ η ′ ζ ′ η ′ ζ ′ η ′ ζ ′ n η ′ n ζ ∗ Figure 6: Encoding the PCP: Stage 2.cial step is to match up these arc-sequences. To do so, wewrite ¬ C ( a ′ i , b j ) ∧ ¬ C ( a i , b ′ j ) ∧ ¬ C ( b i + b ′ i , b j + b ′ j + z ∗ ) ,for all i , j ( ≤ i, j < , i = j ). A simple argument basedon planarity considerations then ensures that the upper andlower sequences of arcs must cross (essentially) as shown inFig. 6. In particular, we are guaranteed that n = n ′ (withoutspecifying the value n ), and that, for all ≤ i ≤ n , ζ i isconnected by η i (and also by η ′ i ) to ζ ′ i .Having established the configuration of Fig. 6, we write ( b i ≤ l + l ) ∧ ¬ C ( b i · l , b i · l ) , for ≤ i < , ensuringthat each η i is included in exactly one of l , l . These inclu-sions naturally define a word σ over the alphabet { , } . Next,we write C c -constraints which organize the sequences of arcs { ζ i } and { ζ ′ i } (independently) into consecutive blocks. Theseblocks of arcs can then be put in 1–1 correspondence using es-sentially the same construction used to put the individual arcsin 1–1 correspondence. Each pair of corresponding blockscan now be made to lie in exactly one region from a collec-tion t , . . . , t ℓ . We think of the t j as representing the letters ofthe alphabet T , so that the labelling of the blocks with theseelements defines a word τ ∈ T ∗ . It is then straightforwardto write non-contact constraints involving the arcs ζ i ensur-ing that σ = w ( τ ) and non-contact constraints involving thercs ζ ′ i ensuring that σ = w ( τ ) . Let ϕ w be the conjunctionof all the foregoing C c -formulas. Thus, if ϕ w is satisfiableover RC ( R ) , then w is a positive instance of the PCP. On theother hand, if w is a positive instance of the PCP, then onecan construct a tuple satisfying ϕ w over RCP ( R ) by ‘thick-ening’ the above collections of arcs into polygons in the ob-vious way. So, w is positive iff ϕ w is satisfiable over RC ( R ) iff ϕ w is satisfiable over RCP ( R ) . This shows r.e.-hardnessof Sat ( C c, RC ( R )) and Sat ( C c, RCP ( R )) . Membership ofthe latter problem in r.e. is immediate because all polygonsmay be assumed to have vertices with rational coordinates,and so may be effectively enumerated. Using the techniquesof Corollaries 3–4 and Theorem 5, we obtain: Theorem 6
For
L ∈ {B c ◦ , B c, C c ◦ , C c } , Sat ( L , RC ( R )) isr.e.-hard, and Sat ( L , RCP ( R )) is r.e.-complete. The complexity of
Sat ( L , RC ( R )) remains open for thelanguages L ∈ {B c, C c ◦ , C c } . However, as we shall see inthe next section, for B c ◦ it drops dramatically. B c ◦ in 3D In this section, we consider the complexity of satisfying B c ◦ -constraints by polyhedra and regular closed sets in three-dimensional Euclidean space. Our analysis rests on an im-portant connection between geometrical and graph-theoreticinterpretations. We begin by briefly discussing the resultsof [Kontchakov et al. , 2010a] for the polyhedral case.Recall that every partial order ( W, R ) , where R is a transi-tive and reflexive relation on W , can be regarded as a topo-logical space by taking X ⊆ W to be open just in case x ∈ X and xRy imply y ∈ X . Such topologies are called Aleksan-drov spaces . If ( W, R ) contains no proper paths of lengthgreater than 2, we call ( W, R ) a quasi-saw (Fig. 8). If, in ad-dition, no x ∈ W has more than two proper R -successors, wecall ( W, R ) a -quasi-saw . The properties of 2-quasi-saws weneed are as follows [Kontchakov et al. , 2010a]:– satisfiability of B c -formulas in arbitrary topologicalspaces coincides with satisfiability in 2-quasi-saws, andis E XP T IME -complete;– X ⊆ W is connected in a 2-quasi-saw ( W, R ) iff it isinterior-connected in ( W, R ) .The following construction lets us apply these results to theproblem Sat ( B c ◦ , RCP ( R )) . Say that a connected partition in RCP ( R ) is a tuple X , . . . , X k of non-empty polyhedrahaving connected and pairwise disjoint interiors, which sumto the entire space R . The neighbourhood graph ( V, E ) ofthis partition has vertices V = { X , . . . , X k } and edges E = {{ X i , X j } | i = j and ( X i + X j ) ◦ is connected } (Fig. 7).One can show that every connected graph is the neighbour-hood graph of some connected partition in RCP ( R ) . Fur-thermore, every neighbourhood graph ( V, E ) gives rise toa 2-quasi-saw, namely, ( W ∪ W , R ) , where W = V , W = { z x,y | { x, y } ∈ E } , and R is the reflexive closureof { ( z x,y , x ) , ( z x,y , y ) | { x, y } ∈ E } . From this, we seethat ( i ) a B c ◦ -formula ϕ is satisfiable over RCP ( R ) iff ( ii ) ϕ is satisfiable over a connected -quasi-saw iff ( iii ) the B c -formula ϕ • , obtained from ϕ by replacing every occurrence X X X X X X X X X X X X Figure 7: A connected partition and its neighbourhood graph.of c ◦ with c , is satisfiable over a connected 2-quasi-saw. Thus, Sat ( B c ◦ , RCP ( R )) is E XP T IME -complete.The picture changes if we allow variables to range over RC ( R ) rather than RCP ( R ) . Note first that the B c ◦ -formula(2) is not satisfiable over 2-quasi-saws, but has a quasi-sawmodel as in Fig. 8. Some extra geometrical work will show x x x z R R R W = depth 1 W = depth 0 Figure 8: A quasi-saw model I of (2): r I i = { x i , z } .now that ( iv ) a B c ◦ -formula is satisfiable over RC ( R ) iff ( v )it is satisfiable over a connected quasi-saw. And as shownin [Kontchakov et al. , 2010a], satisfiability of B c ◦ -formulasin connected spaces coincides with satisfiability over con-nected quasi-saws, and is NP-complete. Theorem 7
The problem Sat ( B c ◦ , RC ( R )) is NP -complete. Proof.
From the preceding discussion, it suffices to show that( v ) implies ( iv ) for any B c ◦ -formula ϕ . So suppose A | = ϕ ,with A based on a finite connected quasi-saw ( W ∪ W , R ) ,where W i contains all points of depth i ∈ { , } (Fig. 8).Without loss of generality we will assume that there is a spe-cial point z of depth 1 such that z Rx for all x of depth 0.We show how A can be embedded into RC ( R ) .Take pairwise disjoint closed balls B x , for x of depth 0, andpairwise disjoint open balls D z , for all z of depth 1 except z (we assume the D z are disjoint from the B x ). Let D z be theclosure of the complement of all B x and D z .We expand the B x to sets B x in such a way that(A) the B x form a connected partition in RC ( R ) , that is,they are regular closed and sum up to R , and their inte-riors are non-empty, connected and pairwise disjoint;(B) every point in D z is either in the interior of some B x with zRx , or on the boundary of all of the B x with zRx .The required B x are constructed as follows. Let q , q , . . . be an enumeration of all the points in the interiors of D z with rational coordinates. For x ∈ W , we set B x to be the closureof the infinite union S ∞ k =1 ( B kx ) ◦ , where the regular closedsets B kx are defined inductively as follows (Fig. 9). Assumingthat the B kx are defined, let q i be the first point in the list q , q , . . . that is not in any B kx yet. So, q i is in the interiorof some D z . Take an open ball C q i in the interior of D z centred in q i and disjoint from the B kx . For each x ∈ W with Rx , expand B kx by a closed ball in C q i and a closed ‘rod’connecting it to B x in such a way that the ball and the rodare disjoint from the rest of the B kx ; the result is denoted by B k +1 x . Consider a function f that maps regular closed sets B x B x B x D z C q q Figure 9: Filling D z with B x i , for z Rx i , i = 1 , , . X ⊆ W to RC ( R ) so that f ( X ) is the union of all B x , for x of depth in X . By (A), f preserves + , · , − , and .Define an interpretation I over RC ( R ) by r I = f ( r A ) . Toshow that I | = ϕ , it remains to prove that X ◦ is connected iff ( f ( X )) ◦ is connected (details are in Appendix C). ❑ The remarkably diverse computational behaviour of B c ◦ over RC ( R ) , RCP ( R ) and RCP ( R ) can be explained asfollows. To satisfy a B c ◦ -formula ϕ in RC ( R ) , it sufficesto find polynomially many points in the regions mentioned in ϕ (witnessing non-emptiness or non-internal-connectednessconstraints), and then to ‘inflate’ those points to (possibly in-ternally connected) regular closed sets using the technique ofFig. 9. By contrast, over RCP ( R ) , one can write a B c ◦ -formula analogous to (8) stating that two internally connectedpolyhedra do not share a 2D face. Such ‘face-contact’ con-straints can be used to generate constellations of exponen-tially many polyhedra simulating runs of alternating Tur-ing machines on polynomial tapes, leading to E XP T IME -hardness. Finally, over
RCP ( R ) , planarity considerationsendow B c ◦ with the extra expressive power required to en-force full non-contact constructs (not possible in higher di-mensions), and thus to encode the PCP as sketched in Sec. 4. This paper investigated topological constraint languages fea-turing connectedness predicates and Boolean operations onregions. Unlike their less expressive cousins,
RCC and RCC , such languages are highly sensitive to the spacesover which they are interpreted, and exhibit more challeng-ing computational behaviour. Specifically, we demonstratedthat the languages C c , C c ◦ and B c contain formulas satisfi-able over RC ( R n ) , n ≥ , but only by regions with infinitelymany components. Using a related construction, we provedthat the satisfiability problem for any of B c , C c , B c ◦ and C c ◦ ,interpreted either over RC ( R ) or over its polygonal subal-gebra, RCP ( R ) , is undecidable . Finally, we showed thatthe satisfiability problem for B c ◦ , interpreted over RC ( R ) , isNP-complete, which contrasts with E XP T IME -completenessfor
RCP ( R ) . The complexity of satisfiability for B c , C c and C c ◦ over RC ( R n ) or RCP ( R n ) for n ≥ remains open. Theobtained results rely on certain distinctive topological prop-erties of Euclidean spaces. Thus, for example, the argument of Sec. 3 is based on the property of Lemma 1, while Sec. 4similarly relies on planarity considerations. In both cases,however, the moral is the same: the topological spaces ofmost interest for Qualitative Spatial Reasoning exhibit spe-cial characteristics which any topological constraint languageable to express connectedness must take into account.The results of Sec. 4 pose a challenge for Qualitative Spa-tial Reasoning in the Euclidean plane. On the one hand, therelatively low complexity of RCC over disc-homeomorphssuggests the possibility of usefully extending the expressivepower of RCC without compromising computational prop-erties. On the other hand, our results impose severe limitson any such extension. We observe, however, that the con-structions used in the proofs depend on a strong interactionbetween the connectedness predicates and the Boolean opera-tions on regular closed sets. We believe that by restricting thisinteraction one can obtain non-trivial constraint languageswith more acceptable complexity. For example, the exten-sion of RCC with connectedness constraints is still in NPfor both RC ( R ) and RCP ( R ) [Kontchakov et al. , 2010b]. Acknowledgments.
This work was partially supported bythe U.K. EPSRC grants EP/E034942/1 and EP/E035248/1.
References [Bennett, 1994] B. Bennett. Spatial reasoning with proposi-tional logic. In
Proc. of KR , pages 51–62. 1994.[Borgo et al. , 1996] S. Borgo, N. Guarino, and C. Masolo. Apointless theory of space based on strong connection andcongruence. In
Proc. of KR , pages 220–229. 1996.[Cohn and Renz, 2008] A. Cohn and J. Renz. Qualitativespatial representation and reasoning. In
Handbook of Kno-wledge Representation , pages 551–596. Elsevier, 2008.[Dornheim, 1998] C. Dornheim. Undecidability of plane po-lygonal mereotopology. In
Proc. of KR . 1998.[Egenhofer and Franzosa, 1991] M. Egenhofer and R. Fran-zosa. Point-set topological spatial relations.
InternationalJ. of Geographical Information Systems , 5:161–174, 1991.[Kontchakov et al. , 2010a] R. Kontchakov, I. Pratt-Hartmann, F. Wolter, and M. Zakharyaschev. Spatiallogics with connectedness predicates.
Logical Methods inComputer Science , 6(3), 2010.[Kontchakov et al. , 2010b] R. Kontchakov, I. Pratt-Hart-mann, and M. Zakharyaschev. Interpreting topologicallogics over Euclidean spaces. In
Proc. of KR . 2010.[Newman, 1964] M.H.A. Newman.
Elements of the Topol-ogy of Plane Sets of Points . Cambridge, 1964.[Pratt-Hartmann, 2007] I. Pratt-Hartmann. First-order mere-otopology. In
Handbook of Spatial Logics , pages 13–97.Springer, 2007.[Randell et al. , 1992] D. Randell, Z. Cui, and A. Cohn. Aspatial logic based on regions and connection. In
Proc. ofKR , pages 165–176. 1992.[Renz and Nebel, 2001] J. Renz and B. Nebel. Efficientmethods for qualitative spatial reasoning.
J. Artificial In-telligence Research , 15:289-318, 2001.Renz, 1998] J. Renz. A canonical model of the region con-nection calculus. In
Proc. of KR ,‘pages 330–341. 1998.[Schaefer et al. , r003] M. Schaefer, E. Sedgwick, andD. ˇStefankoviˇc. Recognizing string graphs in NP.
J. ofComputer and System Sciences , 67:365–380, 2003.[Wolter and Zakharyaschev, 2000] F. Wolter and M. Za-kharyaschev. Spatial reasoning in
RCC with Boolean re-gion terms. In Proc. of ECAI , pages 244–248. 2000.
Regions with infinitely many components
First we give detailed proofs of Lemma 1 and Theorem 2.
Theorem 8 ([Newman, 1964]) If X is a connected subset of R n , then every connected component of R n \ X has a con-nected boundary. Lemma 1. If X ∈ RC ( R n ) is connected, then every compo-nent of − X has a connected boundary. Proof.
Let Y be a connected component of − X . Supposethat the boundary β of Y is not connected, and let β and β be two sets separating β : β and β are disjoint, non-empty,closed subsets of β whose union is β . We will show that Y isnot connected. We have Y = ( S i ∈ I Z i ) − , for some index set I , where the Z i are distinct connected components of R n \ X .By Theorem 8,‘the boundaries α i of Z i are connected subsetsof β , for each i ∈ I . Hence, either α i ⊆ β or α i ⊆ β ,for otherwise α i ∩ β and α i ∩ β would separate α i . Let I j = { i ∈ I | α i ⊆ β j } and Y j = ( S i ∈ I j Z i ) − , for j = 1 , .Clearly, Y and Y are closed, and Y = Y ∪ Y . Hence, itsuffices to show that Y and Y are disjoint. We know that,for j = 1 , , Y j = ( [ i ∈ I j α i ) − ∪ [ i ∈ I j Z i . Clearly, S i ∈ I Z i and S i ∈ I Z i are disjoint. We also knowthat ( S i ∈ I α i ) − and ( S i ∈ I α i ) − are disjoint, as subsets of β and β , respectively. Finally, ( S i ∈ I j α i ) − and S i ∈ I k Z i are disjoint, for j, k = 1 , , as subsets of the boundary andthe interior of Y , respectively. So, Y is not connected, whichis a contradiction. ❑ Theorem 2. If I is an interpretation over RC ( R n ) such that I | = ϕ ∞ , then every d I i has infinitely many components. Proof.
To simplify presentation, we ignore the difference be-tween variables and the regions they stand for, writing, forexample, a i instead of a I i . We also set b i = d i · ( − a i ) .We construct a sequence of disjoint components X i of d ⌊ i ⌋ and open sets V i connecting X i to X i +1 (Fig. 3). By thefirst conjunct of (4), let X be a component of d containingpoints in a . Suppose X i has been constructed, for i ≥ .By (5) and (6), there exists a point q ∈ X i ∩ a ⌊ i +1 ⌋ . Since q / ∈ b ⌊ i +1 ⌋ ∪ d ⌊ i +2 ⌋ ∪ d ⌊ i +3 ⌋ , and because R n is locallyconnected, there exists a connected neighbourhood V i of q such that V i ∩ ( b ⌊ i +1 ⌋ ∪ d ⌊ i +2 ⌋ ∪ d ⌊ i +3 ⌋ ) = ∅ , and so,by (3), V i ⊆ d ⌊ i ⌋ + a ⌊ i +1 ⌋ . Further, since q ∈ a ⌊ i +1 ⌋ , V i ∩ a ⌊ i +1 ⌋ ◦ = ∅ . Take X ′ i +1 to be a component of a ⌊ i +1 ⌋ that intersects V i and X i +1 the component of d ⌊ i +1 ⌋ contain-ing X ′ i +1 .To see that the X i are distinct, let S i +1 and R i +1 be thecomponents of − X i +1 containing X i and X i +2 , respectively.It suffices to show S i +1 ⊆ S ◦ i +2 . Note that the connected set V i must intersect δS i +1 . Evidently, δS i +1 ⊆ X i +1 ⊆ d ⌊ i +1 ⌋ .Also, δS i +1 ⊆ − X i +1 ; hence, by (3) and (7), δS i +1 ⊆ d i ∪ d ⌊ i +2 ⌋ . By Lemma 1, δS i +1 is connected, and therefore,by (7), is entirely contained either in d ⌊ i ⌋ or in d ⌊ i +2 ⌋ . Since V i ∩ δS i +1 = ∅ and V i ∩ d ⌊ i +2 ⌋ = ∅ , we have δS i +1 d ⌊ i +2 ⌋ ,so δS i +1 ⊆ d i . Similarly, δR i +1 ⊆ d i +2 . By (7), then, δS i +1 ∩ δR i +1 = ∅ , and since S i +1 and R i +1 are componentsof the same set, they are disjoint. Hence, S i +1 ⊆ ( − R i +1 ) ◦ ,and since X i +2 ⊆ R i +1 , also S i +1 ⊆ ( − X i +2 ) ◦ . So, S i +1 lies in the interior of a component of − X i +2 , and since δS i +1 ⊆ X i +1 ⊆ S i +2 , that component must be S i +2 . ❑ Now we extend the result to the language C c ◦ . All occur-rences of c in ϕ ∞ have positive polarity. Let ϕ ◦∞ be the resultof replacing them with the predicate c ◦ . In the configura-tion of Fig. 2, all connected regions mentioned in ϕ ∞ are infact interior-connected; hence ϕ ◦∞ is satisfiable over RC ( R n ) .Since interior-connectedness implies connectedness, ϕ ◦∞ en-tails ϕ ∞ in a common extension of C c ◦ and C c . Hence: Corollary 3.
There is a C c ◦ -formula satisfiable over RC ( R n ) , n ≥ , but not by regions with finitely many compo-nents. a b a b a b a b a b a b a b t. . .s Figure 10: Satisfying ϕ c ¬ C ( a , b , s, t ) and ϕ c ¬ C ( a , b , s, t ) .To extend Theorem 2 to the language B c , notice that all oc-currences of C in ϕ ∞ are negative. We shall eliminate theseusing only the predicate c . We use the fact that, if the sumof two connected regions is not connected, then they must bedisjoint. Consider the formula ϕ c ¬ C ( r, s, r ′ , s ′ ) := c ( r + r ′ ) ∧ c ( s + s ′ ) ∧¬ c (( r + r ′ ) + ( s + s ′ )) . Note that ϕ c ¬ C ( r, s, r ′ , s ′ ) implies ¬ C ( r, s ) . We replace ¬ C ( a i , t ) with ϕ c ¬ C ( a i , t, a + a + a + a , t ) , which isclearly satisfiable by the regions on Fig. 2. Further, we re-place ¬ C ( a i , b ⌊ i +1 ⌋ ) with ϕ c ¬ C ( a i , b ⌊ i +1 ⌋ , s, t ) . As shownon Fig. 10, there exists a region s satisfying this formula. In-stead of dealing with ¬ C ( d i , d i +2 ) , we consider the equiva-lent: ¬ C ( a i , b ⌊ i +2 ⌋ ) ∧ ¬ C ( b i , a ⌊ i +2 ⌋ ) ∧¬ C ( a i , a ⌊ i +2 ⌋ ) ∧ ¬ C ( b i , b ⌊ i +2 ⌋ ) . We replace ¬ C ( a i , b ⌊ i +2 ⌋ ) by ϕ c ¬ C ( a i , b ⌊ i +2 ⌋ , s, t ) , whichis satisfiable by the regions depicted on Fig. 10. Weignore ¬ C ( b i , a ⌊ i +2 ⌋ ) , because it is logically equivalentto ¬ C ( a i , b ⌊ i +2 ⌋ ) , for different values of i . We replace ¬ C ( a i , a ⌊ i +2 ⌋ ) by ϕ c ¬ C ( a i , a ⌊ i +2 ⌋ , a ′ i , a ′⌊ i +2 ⌋ ) , which is sat-isfiable by the regions depicted on Fig. 11. The fourth con-junct is then treated symmetrically. Transforming ϕ ∞ in theway just described, we obtain a B c -formula ϕ c ∞ , which im-plies ϕ ∞ (in the language C c ) and which is satisfiable by thearrangement of RC ( R n ) . Hence, we obtain the following: . . a b a ′ a b a b a ′ a b a b a ′ a b a b a ′ a b a b a ′ t. . . Figure 11: Satisfying ϕ c ¬ C ( a , a , a ′ , a ′ ) . Corollary 4.
There is a B c -formula satisfiable over RC ( R n ) , n ≥ , but not by regions with finitely many compo-nents. The only remaining task in this section is to prove Theo-rem 5. The construction is similar to the one developed inSec. 4, and as such uses similar techniques. We employ thefollowing notation. If α is a Jordan arc, and p , q are points on α such that q occurs after p , we denote by α [ p, q ] the segmentof α from p to q . Consider the formula stack ◦ ( a , . . . , a n ) given by: ^ ≤ i
Lemma 9
Suppose that the condition stack ◦ ( a , . . . , a n ) obtains, n > . Then every point p ∈ a ◦ can be connectedto every point p n ∈ a ◦ n by a Jordan arc α = α · · · α n − suchthat for all i ( ≤ i < n ) , each segment α i ⊆ ( a i + a i +1 ) ◦ isa non-degenerate Jordan arc starting at some point p i ∈ a ◦ i . Proof. By c ◦ ( a + · · · + a n ) , let α ′ ⊆ ( a + · · · + a n ) ◦ be a Jordan arc connecting p to p n (Fig. 12). By the non-contact constraints, α ′ has to contain points in a ◦ . Let p ′ beone such point. For ≤ i < n we suppose α , . . . , α i − , α ′ i − and p ′ i to have been defined, and proceed as follows. By c ◦ ( a i + · · · + a n ) , let α ′′ i ⊆ ( a i + · · · + a n ) ◦ be a Jordanarc connecting p ′ i to p n . By the non-contact constraints, α ′′ i can intersect α · · · α i − α ′ i − only in its final segment α ′ i − .Let p i − be the first point of α ′ i − lying on α ′ i ; let α i − bethe initial segment of α ′ i − ending at p i − ; and let α ′ i be thefinal segment of α ′′ i starting at p i − . It remains only to define α n − , and to this end, we simply set α n − := α ′ n − . To seethat p i , ≤ i < n , are as required, note that p i ∈ α i ∩ α i − .By the disjoint constraints p i must be in a i . If p i was in δ ( a i ) ,it would also have to be in δ ( a i − ) and δ ( a i +1 ) , which isforbidden by the disjoint constraints. Hence p i ∈ a ◦ i , ≤ i ≤ n . Given a i · a i +1 = 0 , ≤ i < n , this also guaranteesthat the arcs α i are non-degenerate. ❑ p p α α ′ p ′ α ′′ α ′ α . . . α n − p n − p n − ′ α ′ n − α ′′ n − p n α n − Figure 12: The constraint stack ◦ ( a , . . . , a n ) ensures the ex-istence of a Jordan arc α = α · · · α n − which connects apoint p ∈ a ◦ to a point p n ∈ a ◦ n .Consider now the formula frame ◦ ( a , . . . , a n − ) given by: ^ ≤ i
Let n ≥ , and suppose frame ◦ ( a , . . . , a n − ) .Then there exist Jordan arcs α , . . . , α n − such that α . . . α n − is a Jordan curve lying in the interior of a + · · · + a n − , and α i ⊆ ( a i + a ⌊ i +1 ⌋ ) ◦ , for all i , ≤ i < n . Proof.
For all i ( ≤ i < n ), pick p ′ i ∈ a ◦ i , and pick aJordan arc α ′ i ⊆ ( a i + a ⌊ i +1 ⌋ ) ◦ from p i to p ⌊ i +1 ⌋ . For all i ( ≤ i ≤ n ), let p ⌊ i ⌋ be the first point of α i − lying on α ⌊ i ⌋ , and let p ′′ be the first point of α ′ lying on α ′ . For all i ( ≤ i < n ), let α i = α ′ i [ p i , p i +1 ] , let α ′′ = α ′ [ p ′′ , p ] , andlet α ′′ denote the section of α ′ (in the appropriate direction)from p to p ′′ . Now let p be the first point of α ′′ lying on α ′′ ,let α = α ′′ [ p , p ] , and let α = α ′′ [ p , p ] . It is routine toverify that the arcs α , . . . , α n − have the required properties. ❑ We will now show how to separate certain types of regionsin the language B c ◦ . We make use of Lemma 10 and thefollowing fact. Lemma 11 [Newman, 1964, p. 137] Let F , G be disjoint,closed subsets of R such that R \ F and R \ G are con-nected. Then R \ ( F ∪ G ) is connected. M P µ P µ P µ τ τ τ n n n Figure 13: The Jordan curve
Γ = τ τ τ separating m from m .We say that a region r is quasi-bounded if either r or − r isbounded. We can now prove the following. emma 12 There exists a B c ◦ -formula η ∗ ( r, s, ¯ v ) with thefollowing properties: ( i ) η ∗ ( r, s, ¯ v ) entails ¬ C ( r, s ) over RC ( R ) ; ( ii ) if the regions r and s can be separated by a Jor-dan curve, then there exist polygons ¯ v such that η ∗ ( τ , τ , ¯ v ) ; ( iii ) if r , s are disjoint polygons such that r is quasi-boundedand R \ ( r + s ) is connected, then there exist polygons ¯ v suchthat η ∗ ( τ , τ , ¯ v ) . Proof.
Let ¯ v be the tuple of variables ( t , . . . , t , m , m ) ,and let η ∗ ( r, s, ¯ v ) be the formula frame ◦ ( t , . . . , t ) ∧ r ≤ m ∧ s ≤ m ∧ ( t + . . . + t ) · ( m + m ) = 0 ∧ ^ i =1 , , j =1 , c ◦ ( t i + m j ) . Property ( i ) follows by a simple planarity argument. By frame ◦ ( t , . . . , t ) and Lemma 10, let α i , for ≤ i ≤ ,be such that Γ = α · · · α is a Jordan curve included in ( t + · · · + t ) ◦ . Further, let τ i = α i α i +1 , ≤ i ≤ (Fig.13). Note that all points in a i +1 , ≤ i ≤ , thatare on Γ are on τ i . By c ◦ ( t i +1 + m ) , ≤ i ≤ , let µ i ⊆ ( m + t i +1 ) ◦ be a Jordan arc with endpoints M ∈ m ◦ and T i ∈ τ i ∩ t ◦ i +1 . We may assume that these arcs inter-sect only at their common endpoint M , so that they dividethe residual domain of Γ which contains M into three sub-domains n i , for ≤ i ≤ . The existence of a point M ∈ m in any n i , ≤ i ≤ , will contradict c ◦ ( t i +1 + m ) . So, m must be contained entirely in the residual domain of Γ notcontaining M . Similarly, all points in m must lie in theresidual domain of Γ containing M . It follows that m and m are disjoint, and by r ≤ m and s ≤ m , that r and s aredisjoint as well. For Property ( ii ), let Γ be a Jordan curve sep-arating r and s . Now thicken Γ to form an annular element of RCP ( R ) , still disjoint from r and s , and divide this annulusinto the three regions t , . . . , t as shown (up to similar situa-tion) in Fig. 14. Choose m and m to be the connected com-ponents of − ( t + · · · + t ) containing r and s , respectively.For Property ( iii ), it is routine using Lemma 11 to show thatthere exists a piecewise linear Jordan curve Γ in R \ ( r + s ) separating r and s . ❑ r rr s st t t t t t Γ m m Figure 14: Separating disjoint polygons by an annulus.
Lemma 13
There exists a B c ◦ -formula η ( r, s, ¯ v ) with thefollowing properties: ( i ) η ( r, s, ¯ v ) entails ¬ C ( r, s ) over RC ( R ) ; ( ii ) if r , s are disjoint quasi-bounded polygons, thenthere exist polygons ¯ v such that η ( τ , τ , ¯ v ) . Proof.
Let η ( r, s, ¯ v ) be the formula r = r + r ∧ s = s + s ∧ ^ ≤ i ≤ ≤ j ≤ η ∗ ( r i , s j , ¯ u i,j ) , where η ∗ is the formula given in Lemma 12. Property ( i ) isthen immediate. For Property ( ii ), it is routine to show thatthere exist polygons r , r such that r = r + r and R \ r i is connected for i = 1 , ; let s , s be chosen analogously.Then for all i ( ≤ i ≤ ) and j ( ≤ j ≤ ) we have r i ∩ s j = ∅ and, by Lemma 11, R \ ( r i + s j ) connected. ByLemma 12, let ¯ u i,j be such that η ∗ ( r i , s j , ¯ u i,j ) . ❑ We are now ready to prove:
Theorem 5.
There is a B c ◦ -formula satisfiable over RC ( R ) , but only by regions with infinitely many components. Proof.
We first write a C c ◦ -formula, ϕ ∗∞ with the requiredproperties, and then show that all occurrences of C can beeliminated. Note that ϕ ∗∞ is not the same as the formula ϕ ◦∞ constructed for the proof of Corollary 3.Let s , s ′ , a , a ′ , b , b ′ , a i,j and b i,j ( ≤ i < , ≤ j ≤ )be variables. The constraints frame ◦ ( s, s ′ , b, b ′ , a, a ′ ) (9) stack ◦ ( s, b i, , b i, , b i, , b ) (10) stack ◦ ( b ⌊ i − ⌋ , , a i, , a i, , a i, , a ) (11) stack ◦ ( a ⌊ i − ⌋ , , b i, , b i, , b i, , b ) (12)are evidently satisfied by the arrangement of Fig. 15. b , b , b , a , a , a , b , b , b , a , a , a , b , b , b , a , a , a , ss ′ a ′ b b ′ a Figure 15: A tuple of regions satisfying (9)–(12): the patternof components of the a i,j and b i,j repeats forever.Let ϕ ∗∞ be the conjunction of (9)–(12) as well as all con-juncts r · r ′ = 0 , (13)where r and r ′ are any two distinct regions depicted onFig. 15. Note that the regions a i,j and b i,j have infinitelymany connected components. We will now show that this istrue for every satisfying tuple of ϕ ∗∞ .By (9), we can use Lemma 10 to construct a Jordan curve Γ = σσ ′ ββ ′ αα ′ whose segments are Jordan arcs lying inthe respective sets ( s + s ′ ) ◦ , ( s ′ + b ) ◦ , ( b + b ′ ) ◦ , ( b ′ + a ) ◦ , ( a + a ′ ) ◦ , ( a ′ + s ) ◦ . Further, let σ = σσ ′ , β = ββ ′ and α = αα ′ (Fig. 16a). Note that all points in s , a and b thatare on Γ are on σ , α and β , respectively. Let o ′ ∈ σ ∩ ◦ , and let q ∗ ∈ β ∩ b ◦ . By (10) and Lemma 9 we canconnect o ′ to q ∗ by a Jordan arc β ′ , β , β ′ , whose segmentslie in the respective sets ( s + b , ) ◦ , ( b , + b , + b , ) ◦ and ( b + b , ) ◦ (Fig. 16b). Let o be the last point on β ′ , that ison σ and let β , be the final segment of β ′ , starting at o .Similarly, let q be the first point on β ′ , that is on β and let β , be the initial segment of β ′ , ending at q . Hence, thearc β , β , β , divides one of the regions bounded by Γ intotwo sub-regions. We denote the sub-region whose boundaryis disjoint from α by U , and the other sub-region we denoteby U ′ . Let β := β , β [ q , r ] ⊆ ( b + b , + b , ) ◦ . qp rσ β α (a) The arcs α , β and σ . o ′ o q ∗ q β , β , β , U U ′ (b) The regions U and U ′ . U e ′ e p ∗ p α , α , α , V W (c) The regions V and W . q p o e U V α , W β α (d) The regions redrawn. o ′ o q ∗ q β , V U U ′ α (e) The regions U and U ′ . U e ′ e p ∗ p α , α , α , V W (f) The regions V and W . Figure 16: Establishing infinite sequences of arcs.We will now construct a cross-cut α , α , α , in U ′ . Let e ′ ∈ β , ∩ b , ◦ and p ∗ ∈ α ∩ a ◦ . By (11) and Lemma 9we can connect e ′ to p ∗ by a Jordan arc α ′ , α , α ′ , whose segments lie in the respective sets ( b , + a , ) ◦ , ( a , + a , + a , ) ◦ and ( a + a , ) ◦ (Fig. 16c). Let e bethe last point on α ′ , that is on β , and let α , be the fi-nal segment of α ′ , starting at e . Similarly, let p be thefirst point on α ′ , that is on α and let α , be the initialsegment of α ′ , ending at p . By the non-overlapping con-straints, α , α , α , does not intersect the boundaries of U and U ′ except at its endpoints, and hence it is a cross-cut inone of these regions. Moreover, that region has to be U ′ since the boundary of U is disjoint from α . So, α , α , α , divides U ′ into two sub-regions. We denote the sub-regionwhose boundary contains β by W , and the other sub-regionwe denote by V . Let α := α , α [ p , r ] (Fig 16d). Notethat α ⊆ ( a + a , + a , ) ◦ .We can now forget about the region U , and start con-structing a cross-cut β , β , β , in W . As before, let β ′ , β , β ′ , be a Jordan arc connecting a point o ′ ∈ α , ∩ a ◦ , to a point q ∗ ∈ β ∩ b ◦ i such that its seg-ments are contained in the respective sets ( a , + b , ) ◦ , ( b , + b , + b , ) ◦ and ( b + b , ) ◦ . As before, we choose β , ⊆ β ′ , and β , ⊆ β ′ , so that the Jordan arc β , β , β , with its endpoints removed is disjoint from theboundaries of V and W . Hence β , β , β , has to be across-cut in V or W , and since the boundary of V is dis-joint from β it has to be a cross-cut in W (Fig. 16e). So, β , β , β , separates W into two regions U and U ′ sothat the boundary of U is disjoint from α . Let β := β , β [ q , r ] ⊆ ( b + b , + b , ) ◦ . Now, we can ignore theregion V , and reasoning as before we can construct a cross-cut α , α , α , in U ′ dividing it into two sub-regions V and W . b , a , b , a , ss ′ a ′ b b ′ a Figure 17: Separating a , from b , by a Jordan curve.Evidently, this process continues forever. Now, note thatby construction and (13), W i contains in its interior β i +1 , together with the connected component c of b , which con-tains β i +1 , . On the other hand, W i +2 is disjoint from c ,and since W i ⊆ W j , i > j , b , has to have infinitely manyconnected components.So far we know that the C c ◦ -formula ϕ ∗∞ forces infinitelymany components. Now we replace every conjunct in ϕ ∗∞ ofthe form ¬ C ( r, s ) by η ∗ ( r, s, ¯ v ) , where ¯ v are fresh variableseach time. The resulting formula entails ϕ ∗∞ , so we only haveto show that it is still satisfiable. By Lemma 12 ( ii ), it sufficesto separate by Jordan curves every two regions on Fig. 15 thatare required to be disjoint. It is shown on Fig. 17 that thereexists a curve which separates the regions b , and a , . Allother non-contact constraints are treated analogously. ❑ B Undecidability of B c and C c in theEuclidean plane In this section, we prove the undecidability of the problems
Sat ( L , RC ( R )) and Sat ( L , RCP ( R )) , for L any of B c , C c , c ◦ or C c ◦ . We begin with some technical preliminaries,again employing the notation from the proof of Theorem 5: if α is a Jordan arc, and p , q are points on α such that q occursafter p , we denote by α [ p, q ] the segment of α from p to q .For brevity of exposition, we allow the case p = q , treating α [ p, q ] as a (degenerate) Jordan arc.Our first technical preliminary is to formalize our earlierobservations concerning the formula stack ( a , . . . , a n ) , de-fined by: ^ ≤ i ≤ n c ( ˙ a i + ¨ a i +1 + · · · + ¨ a n ) ∧ ^ j − i> ¬ C ( a i , a j ) . Lemma 14
Let a , . . . , a n be 3-regions satisfying stack ( a , . . . , a n ) , for n ≥ . Then, for every point p ∈ ˙ a and every point p n ∈ ¨ a n , there exist points p , . . . , p n − and Jordan arcs α , . . . , α n such that :( i ) α = α · · · α n is a Jordan arc from p to p n ;( ii ) for all i ( ≤ i < n ) , p i ∈ ˙ a i +1 ∩ α i ; and ( iii ) for all i ( ≤ i ≤ n ) , α i ⊆ a i . Proof.
Since ˙ a + ¨ a + · · · + ¨ a n is a connected subset of ( a + ˙ a + · · · + ˙ a n ) ◦ , let β be a Jordan arc connecting p to p n in ( a + ˙ a + · · · + ˙ a n ) ◦ . Since a is disjoint from allthe a i except a , let p be the first point of β lying in ˙ a ,so β [ p , p ] ⊆ a ◦ ∪ { p } , i.e., the arc β [ p , p ] is eitherincluded in a ◦ , or is an end-cut of a ◦ . (We do not rule out p = p .) Similarly, let β ′ be a Jordan arc connecting p to p n in ( a + ˙ a + · · · + ˙ a n ) ◦ , and let q be the last pointof β ′ lying on β [ p , p ] . If q = p , then set v = p , α = β [ p , p ] , and β = β ′ . so that the endpoints of β are v and p n . Otherwise, we have q ∈ a ◦ . We can nowconstruct an arc γ ⊆ a ◦ ∪ { p } from p to a point v on β ′ [ q , p n ] , such that γ intersects β [ p , p ] and β ′ [ q , p n ] only at its endpoints, p and v (upper diagram in Fig. 18).Let α = β [ p , p ] γ , and let β = β ′ [ v , p n ] .Since β contains a point p ∈ ˙ a , we may iterate thisprocedure, obtaining α , α , . . . α n − , β n . We remark that α i and α i +1 have a single point of contact by construction,while α i and α j ( i < j − ) are disjoint by the constraint ¬ C ( a i , a j ) . Finally, we let α n = β n (lower diagram inFig. 18). ❑ In fact, we can add a ‘switch’ w to the formula stack ( a , . . . , a n ) , in the following sense. If w is a regionvariable, consider the formula stack w ( a , . . . , a n ) ¬ C ( w · ˙ a , ( − w ) · ˙ a ) ∧ stack (( − w ) · a , a , . . . , a n ) , where w · a denotes the 3-region ( w · a, w · ˙ a, w · ¨ a ) . The firstconjunct of stack w ( a , . . . , a n ) ensures that any componentof ˙ a is either included in w or included in − w . The sec-ond conjunct then has the same effect as stack ( a , . . . , a n ) for those components of ˙ a included in − w . That is, if p ∈ ˙ a · ( − w ) , we can find an arc α · · · α n starting at p ,with the properties of Lemma 14. However, if p ∈ ˙ a · w , nosuch arc need exist. Thus, w functions so as to ‘de-activate’the formula stack w ( a , . . . , a n ) for any component of ˙ a in-cluded in it. p q v p β β β β ′ β ′ γ β v n − q n − v n − p n − p n β n − β n − β n − β ′ n β ′ n γ n − β n Figure 18: Proof of Lemma 14.As a further application of Lemma 14, consider the formula frame ( a , . . . , a n ) given by: stack ( a , . . . , a n − ) ∧ ¬ C ( a n , a + . . . + a n − ) ∧ c ( ˙ a n ) ∧ ˙ a · ˙ a n = 0 ∧ ¨ a n − · ˙ a n = 0 . (14)This formula allows us to construct Jordan curves in theplane, in the following sense: Lemma 15
Let n ≥ , and suppose frame ( a , . . . , a n ) . Thenthere exist Jordan arcs γ , . . . , γ n such that γ . . . γ n is aJordan curve, and γ i ⊆ a i , for all i , ≤ i ≤ n . Proof. By stack ( a , . . . , a n − ) , let α , . . . , α n − be Jordanarcs in the respective regions a , . . . , a n − such that, α = α · · · α n − is a Jordan arc connecting a point p ′ ∈ ˙ a · ˙ a n to a point q ′ ∈ ¨ a n − · ˙ a n (see Fig. 19). Because ˙ a n is aconnected subset of the interior of a n , let α n ⊆ a ◦ n be anarc connecting p ′ and q ′ . Note that α n does not intersect α i ,for ≤ i < n − . Let p be the last point on α that is on α n (possibly p ′ ), and q be the first point on α n − that is on α n (possibly q ′ ). Let γ be the final segment of α startingat p . Let γ i := α i , for ≤ i ≤ n − . Let γ n − be theinitial segment of α n − ending at q . Finally, take γ n to bethe segment of α n between p and q . Evidently, the arcs γ i , ≤ i ≤ n , are as required. ❑ p ′ α α . . .q ′ α n − α n − p ′ pγ γ = α . . .q ′ qγ n − γ n − = α n − γ n Figure 19: Establishing a Jordan curve.Our final technical preliminary is a simple device for la-belling arcs in diagrams.
Lemma 16
Suppose r , t , . . . , t ℓ are regions such that ( r ≤ t + · · · + t ℓ ) ∧ ^ ≤ i For L ∈ {B c ◦ , B c, C c ◦ , C c } , Sat ( L , RC ( R )) isr.e.-hard, and Sat ( L , RCP ( R )) is r.e.-complete. We have already established the upper bounds; we considerhere only the lower bounds, beginning with an outline of ourproof strategy. Let a PCP-instance w = ( { , } , T, w , w ) be given, where T is a finite alphabet, and w i : T ∗ → { , } ∗ a word-morphism ( i = 1 , ). We call the elements of T tiles ,and, for each tile t , we call w ( t ) the lower word of t , and w ( t ) the upper word of t . Thus, w asks whether there isa sequence of tiles (repeats allowed) such that the concate-nation of their upper words is the same as the concatenationof their lower words. We shall henceforth restrict all (upperand lower) words on tiles to be non-empty. This restrictionsimplifies the encoding below, and does not affect the unde-cidability of the PCP.We define a formula ϕ w consisting of a large conjunctionof C c -literals, which, for ease of understanding, we introducein groups. Whenever conjuncts are introduced, it can be read-ily checked that—provided w is positive—they are satisfiableby elements of RCP ( R ) . (Figs. 20 and 22 depict part of asatisfying assignment; this drawing is additionally useful asan aid to intuition throughout the course of the proof.) Themain object of the proof is to show that, conversely, if ϕ w issatisfied by any tuple in RC ( R ) , then w must be positive.Thus, the following are equivalent:1. w is positive;2. ϕ w is satisfiable over RCP ( R ) ;3. ϕ w is satisfiable over RC ( R ) .This establishes the r.e.-hardness of Sat ( L , RC ( R )) and Sat ( L , RCP ( R )) for L = C c ; we then extend the result tothe languages B c , C c ◦ and B c ◦ .The proof proceeds in five stages. Stage 1. In the first stage, we define an assemblage of arcsthat will serve as a scaffolding for the ensuing construction.Consider the arrangement of polygonal 3-regions depictedin Fig. 20, assigned to the 3-region variables s , . . . , s , s ′ , . . . , s ′ , d , . . . , d as indicated. It is easy to verify thatthis arrangement can be made to satisfy the following formu-las: frame ( s , s , . . . , s , s , s ′ , . . . , s ′ ) , (16) ( s ≤ ˙ t ) ∧ ( s ≤ ¨ t ) , (17) stack ( d , . . . , d ) . (18) s ′ s ′ s ′ s s s ′ s ′ s ′ s ′ s s s s s s s s ′ s d d d d d d d Figure 20: A tuple of 3-regions satisfying (16)–(18). The 3-regions d and d are shown in dotted lines. γ γ ′ γ ˜ o o γ ′ γ ′ γ γ γ γ , . . . , γ γ ′ , . . . , γ ′ ˜ q γ o ˜ o χ χ χ p ∗ q ∗ Figure 21: The arcs γ , . . . , γ and χ , . . . χ .And trivially, the arrangement can be made to satisfy any for-mula ¬ C ( r, r ′ ) (19)for which the corresponding 3-regions r and r ′ are drawn asnot being in contact. (Remember, r is the outer-most shell ofthe 3-region r , and similarly for r ′ .) Thus, for example, (19)includes ¬ C ( s , d ) , but not ¬ C ( s , d ) of ¬ C ( d , d ) .Now suppose s , . . . , s , s ′ , . . . , s ′ , d , . . . , d is any collection of 3-regions (not necessarily polygo-nal) satisfying (16)–(19). By Lemma 15 and (16),let γ , . . . , γ , γ ′ , . . . , γ ′ be Jordan arcs included inthe respective regions s , . . . , s , s ′ , . . . , s ′ , such that Γ = γ · · · γ · γ ′ · · · γ ′ is a Jordan curve (note that γ ′ i and γ i have opposite directions). We select points ˜ o on γ and ˜ o on γ (see Fig. 21). By (17), ˜ o ∈ ˙ t and ˜ o ∈ ¨ t . ByLemma 14 and (18), let ˜ χ , χ , ˜ χ be Jordan arcs in therespective regions ( d + d ) , ( d + d + d ) , ( d + d ) such that ˜ χ χ ˜ χ is a Jordan arc from ˜ o to ˜ o . Let o be thelast point of ˜ χ lying on Γ , and let χ be the final segmentof ˜ χ , starting at o . Let o be the first point of ˜ χ lyingon Γ , and let χ be the initial segment of ˜ χ , ending at o .By (19), we see that the arc χ = χ χ χ intersects Γ only inits endpoints, and is thus a chord of Γ , as shown in Fig. 21.A word is required concerning the generality of this dia-gram. The reader is to imagine the figure drawn on a spheri-cal canvas, of which the sheet of paper or computer screen infront of him is simply a small part. This sphere represents the , a , a , b , b , b , b , b , b , a , a , a , b , b , b , a , a , a , a , b , b , b , a , a , b , b , a , a , a , a , b , b , b , a , a , b , s ′ s s a b d Figure 22: A tuple of 3-regions satisfying (20)–(22). Thearrangement of components of the a i,j and b i,j repeats anindeterminate number of times. The 3-regions a , b and onecomponent of a , are shown in dotted lines. The 3-regions s , s , s ′ and d are as in Fig 22, but not drawn to scale.plane with a ‘point’ at infinity, under the usual stereographicprojection. We do not say where this point at infinity is, otherthan that it never lies on a drawn arc. In this way, a diagramin which the spherical canvas is divided into n cells repre-sents n different configurations in the plane—one for each ofthe cells in which the point at infinity may be located. Forexample, Fig .21 represents three topologically distinct con-figurations in R , and, as such, depicts the arcs γ , . . . , γ , γ ′ , . . . , γ ′ , χ , χ , χ and points o , o in full generality.All diagrams in this proof are to be interpreted in this way.We stress that our ‘spherical diagrams’ are simply a conve-nient device for using one drawing to represent several pos-sible configurations in the Euclidean plane: in particular, weare interested only in the satisfiability of of C c -formulas over RCP ( R ) and RC ( R ) , not over the regular closed algebra ofany other space! For ease of reference, we refer to the the tworectangles in Fig .21 as the ‘upper window’ and ‘lower win-dow’, it being understood that these are simply handy labels:in particular, either of these ‘windows’ (but not both) may beunbounded. Stage 2. In this stage, we we construct two sequences ofarcs, { ζ i } , { η i } of indeterminate length n ≥ , such that themembers of the former sequence all lie in the lower window.Here and in the sequel, we write ⌊ k ⌋ to denote k modulo 3.Let a , b , a i,j and b i,j ( ≤ i < , ≤ j ≤ ) be 3-regionvariables, let z be an ordinary region-variable, and considerthe formulas ( s ≤ ¨ a ) ∧ ( s ′ ≤ ¨ b ) ∧ ( s ≤ ˙ a , ) , (20) stack z ( a ⌊ i − ⌋ , , b i, , . . . , b i, , b ) , (21) stack ( b i, , a i, , . . . , a i, , a ) . (22)The arrangement of polygonal 3-regions depicted in Fig. 22(with z assigned appropriately) is one such satisfying assign-ment. We stipulate that (19) applies now to all regions de-picted in either Fig 20 or Fig 22. Again, these additionalconstraints are evidently satisfiable.It will be convenient in this stage to rename the arcs γ and γ ′ as λ and µ , respectively. Thus, λ forms the bottomedge of the lower window, and µ the top edge of the upper window. Likewise, we rename γ as α , forming part of theleft-hand side of the lower window. Let ˜ q , be any point of α , p ∗ any point of λ , and q ∗ any point of µ (see Fig. 21).By (20), then, ˜ q , ∈ ˙ a , , p ∗ ∈ ¨ a , and q ∗ ∈ ¨ b . Adding theconstraint ¬ C ( s , z ) , further ensures that ˜ q , ∈ − z . By Lemma 14 and (21), wemay draw an arc ˜ β from ˜ q , to q ∗ , with successive segments ˜ β , , β , , . . . , β , , ˜ β , lying in the respective regions a , + b , , b , , . . . , b , , b , + b ; further, we can guarantee that β , contains a point ˜ p , ∈ ˙ b , . Denote the last point of β , by q , . Also, let q , be the last point of ˜ β lying on α , and q , the first point of ˜ β lying on µ Finally, let β be the segmentof ˜ β between q , and q , ; and we let µ be the segment of ˜ β from q , to q , followed by the final segment of µ from q , . (Fig. 23a). By repeatedly using the constraints in (19),it is easy to see that that β together with the initial segmentof µ up to q , form a chord of Γ . Adding the constraints c ( b , + d ) , and taking into account the constraints in (19) ensures that β and χ lie in the same residual domain of Γ , as shown. Thewiggly lines indicate that we do not care about the exact po-sitions of ˜ q , or q ∗ ; otherwise, Fig. 23a) is again completelygeneral. Note that µ lies entirely in b , + b , and hence cer-tainly in the region b ∗ = b + b , + b , + b , . Recall that ˜ p , ∈ ˙ b , , and p ∗ ∈ ¨ a . By Lemma 14and (22), we may draw an arc ˜ α from ˜ p , to p ∗ , with succes-sive segments ˜ α , , α , , . . . , α , , ˜ α , lying in the respec-tive regions b , + a , , a , , . . . , a , a , + a ; further, wecan guarantee that the segment lying in a , contains a point ˜ q , ∈ ˙ a , . Denote the last point of α , by p , . Also, let p , be the last point of ˜ α lying on β , and p , the first pointof ˜ α lying on λ . From (19), these points must be arrangedas shown in Fig. 23b. Let α be the segment of ˜ α between p , and p , . Noting that (19) entails ¬ C ( a ,k , s + s + d + · · · + d ) 1 ≤ k ≤ , we can be sure that α lies entirely in the ‘lower’ window,whence β crosses the central chord, χ , at least once. Let o be the first such point (measured along χ from left to right).Finally, let λ be the segment of ˜ α between p , and p , ,followed by the final segment of λ from p , . Note that λ lies entirely in a , + a , and hence certainly in the region a ∗ = a + a , + a , + a , . We remark that, in Fig. 23b, the arcs β and µ have beenslightly re-drawn, for clarity. The region marked S may nowbe forgotten, and is suppressed in Figs. 23c and 23d.By construction, the point ˜ q , lies in some component of ˙ a , , and, from the presence of the ‘switching’ variable z in (22), that component is either included in z or includedin − z . Suppose the latter. Then we can repeat the aboveconstruction to obtain an arc ˜ β from ˜ q , to q ∗ , with succes-sive segments ˜ β , , β , , . . . , β , , ˜ β , lying in the respective , µ q ∗ q , S χβ µ ˜ q , q , (a) The arc β . µ q , β q , ˜ p , λ α p , λ S p , p ∗ p , ˜ q , R q , (b) The arc α . q , p , p , q , q , q , ˜ q , µ R S p , β λ µ (c) The arc β . µ q , p , λ S q , R χ p , β α ˜ q , p , (d) The arc α . Figure 23: Construction of the arcs { α i } and { β i } α β β β α α α n β n Figure 24: The sequences of arcs { α i } and { β i } .regions a , + b , , b , , . . . , b , , b , + b ; further, we canguarantee that β , contains a point ˜ p , ∈ ˙ b , . Denote thelast point of β , by q , . Also, let q , be the last point of ˜ β lying on α , and q , the first point of ˜ β lying on µ . Again,we let β be the segment of ˜ β between q , and q , ; and welet µ be the segment of ˜ β from q , to q , , followed by thefinal segment of µ from q , . Note that µ lies in the set b ∗ .It is easy to see that β must be drawn as shown in Fig. 23c:in particular, β cannot enter the interior of the region marked R . For, by construction, β can have only one point of con-tact with α , and the constraints (19) ensure that β cannotintersect any other part of δR ; since q ∗ ∈ a is guaranteed tolie outside R , we evidently have β ⊆ − R . This observa-tion having been made, R may now be forgotten.Symmetrically, we construct the arc ˜ α ⊆ b , + a , + · · · + a , + a , and points p , , p , , p , , together with thearcs arcs α and λ , as shown in Fig. 23d (where the region R has been suppressed and the region S slightly re-drawn).Again, we know from (19) that α lies entirely in the ‘lower’window, whence β must cross the central chord, χ , at leastonce. Let o be the first such point (measured along χ fromleft to right).This process continues, generating arcs β i ⊆ a ⌊ i − ⌋ , + b ⌊ i ⌋ , + · · · + b ⌊ i ⌋ , and α i ⊆ b ⌊ i ⌋ , + a ⌊ i ⌋ , + · · · + a ⌊ i ⌋ , ,as long as α i contains a point ˜ q i, ∈ − z . That we even-tually reach a value i = n for which no such point existsfollows from (19). For the conjuncts ¬ C ( b i,j , d k ) ( j = 5 )together entail o i ∈ b ⌊ i ⌋ , , for every i such that β i is defined;and these points cycle on χ through the regions b , , b , and b , . If there were infinitely many β i , the o i would have anaccumulation point, lying in all three regions, contradicting,say, ¬ C ( b , , b , ) . The resulting sequence of arcs and pointsis shown, schematically, in Fig. 24.We finish this stage in the construction by ‘re-packaging’the arcs { α i } and { β i } , as illustrated in Fig. 25. Specifically,for all i ( ≤ i ≤ n ), let ζ i be the initial segment of β i upto the point p i, followed by the initial segment of α i up tothe point q i +1 , ; and let η i be the final segment of β i from thepoint p i, : ζ i = β i [ q i, , p i, ] α i [ p i, , q i +1 , ] η i = β i [ p i, , q i, ] . The final segment of α i from the point q i +1 may be forgotten.Defining, for ≤ i < , i, q i +1 , p i, η i q i, χ χβ i p i, α i q i +1 , q i, q i, p i, ζ i Figure 25: ‘Re-packaging’ of α i and β i into ζ i and η i : beforeand after. a i = a − i, + b i, + · · · + b i, + a i, + · · · + a i, b i = b i, + · · · + b i, , the constraints (19) guarantee that, for ≤ i ≤ n , ζ i ⊆ a ⌊ i ⌋ η i ⊆ b ⌊ i ⌋ . Observe that the arcs ζ i are located entirely in the ‘lower win-dow’, and that each arc η i connects ζ i to some point q i, ,which in turn is connected to a point q ∗ ∈ λ by an arc in b ∗ . Stage 3. We now repeat Stage 2 symmetrically, with the‘upper’ and ‘lower’ windows exchanged. Let a ′ i,j , b ′ i,j be 3-region variables (with indices in the same ranges as for a i,j , b i,j ). Let a ′ = b , b ′ = a ; and let a ′ i = a ′ − i, + b ′ i, + · · · + b ′ i, + a ′ i, + · · · + a ′ i, b ′ i = b ′ i, + · · · + b ′ i, , for ≤ i < . The constraints ( s ′ ≤ ˙ a ′ , ) stack z ( a ′⌊ i − ⌋ , , b ′ i, , . . . , b ′ i, , b ′ ) , stack ( b ′ i, , a ′ k, , . . . , a ′ i, , a ′ ) c ( b ′ , + d ) then establish sequences of arcs { ζ ′ i } , { η ′ i } , ( ≤ i ≤ n ′ )satisfying ζ ′ i ⊆ a ′⌊ i ⌋ η ′ i ⊆ b ′⌊ i ⌋ for ≤ i ≤ n ′ . The arcs ζ ′ i are located entirely in the ‘upperwindow’, and each arc η ′ i connects ζ ′ i to a point p i, , which inturn is connected to a point p ∗ by an arc in the region b ∗′ = b ′ + b ′ , + b ′ , + b ′ , . Our next task is to write constraints to ensure that n = n ′ ,and that, furthermore, each η i (also each η ′ i ) connects ζ i to ζ ′ i ,for ≤ i ≤ n = n ′ . Let z ∗ be a new region-variable, andwrite ¬ C ( z ∗ , s + · · · + s + s ′ + · · · + s ′ + d + · · · + d + d ) . Note that d does not appear in this constraint, which ensuresthat the only arc depicted in Fig. 21 which z may intersect is ζ n η ′ n ′ ζ ∗ ζ ′ ζ ′ ζ ζ η n ζ ′ n ′ χ χ Figure 26: The arc ζ ∗ . χ . Recalling that α n and α ′ n ′ contain points q n, and q ′ n ′ , ,respectively, both lying in z , the constraints c ( z ) ∧ ¬ C ( z, − z ∗ ) ensure that q n, and q ′ n ′ , may be joined by an arc, say ζ ∗ ,lying in ( z ∗ ) ◦ , and also lying entirely in the upper and lowerwindows, crossing χ only in χ . Without loss of generality,we may assume that ζ ∗ contacts ζ n and ζ ′ n ′ in just one point.Bearing in mind that the constraints (19) force η n and η ′ n ′ tocross χ in its central section, χ , writing ¬ C ( b i,j , z ) ∧ ¬ C ( b ′ i,j , z ) (23)for all i ( ≤ i < ) and j ( ≤ i ≤ ) ensures that ζ ∗ is (essentially) as shown in Fig. 26. Now consider the arc η .Recalling that η µ joins ζ to the point q ∗ (on the upper edgeof the upper window), crossing χ , we see by inspection ofFig. 26 that (23) together with ¬ C ( a ′ i , b ∗ ) for ≤ i < forces η to cross one of the arcs ζ ′ j ′ ( ≤ j ′ ≤ n ′ ); and the constraints ¬ C ( a ′ i , b j ) for ≤ i < , ≤ j < , i = j , ensure that j ′ ≡ modulo3. We write the symmetric constraints ¬ C ( a i , b ′ j ) (24)for ≤ i < , ≤ j < , i = j , together with ¬ C ( b i , b ′ j ) (25)for ≤ i < j ≤ . Now suppose j ′ ≥ . The arc η ′ λ ′ mustconnect ζ ′ to the point p ∗ on the bottom edge of the lowerwindow, which is now impossible without η ′ crossing either ζ or η —both forbidden by (24)–(25). Thus, η intersects ζ ′ j if and only if j = 1 . Symmetrically, η ′ intersects ζ j if andonly if j = 1 . And the reasoning can now be repeated for η , η ′ , η , η ′ . . . , leading to the 1–1 correspondence depicted inFig. 27. In particular, we are guaranteed that n = n ′ . Stage 4. Recall the given PCP-instance, w =( { , } , T, w , w ) . We think of T as a set of ‘tiles’, and themorphisms w , w as specifying, respectively, the ‘lower’ and‘upper’ strings of each tile. In this stage, we shall ‘label’ thearcs ζ , . . . , ζ n , with elements of { , } , thus defining a word σ over this alphabet. Using a slightly more complicated la-belling scheme, we shall label the arcs η , . . . , η n so as to ζ ∗ ζ n η n η η ζ ζ ζ Figure 27: The 1–1 correspondence between the ζ i and the ζ ′ i established by the η i and the η ′ i .define a word τ (of length m ≤ n ) over the alphabet T ; like-wise we shall label the arcs η ′ , . . . , η ′ n so as to define anotherword τ ′ (of length m ′ ≤ n ) over T .We begin with the ζ i . Consider the constraints b i ≤ l + l ∧ ¬ C ( b i · l , b i · l ) ( i = 0 , . By Lemma 16, in any satisfying assignment over RC ( R ) ,every arc η i ( ≤ i ≤ n ) is included in (‘labelled with’)exactly one of the regions l or l , so that the sequence ofarcs η , . . . , η n defines a word σ ∈ { , } ∗ , with | w | = n .Turning our attention now to the ζ i , let us write T = { t , . . . , t ℓ } . For all j ( ≤ j ≤ ℓ ), we shall write σ j = w ( t j ) and σ ′ j = w ( t j ) ; further, we denote | σ j | by u ( j ) and | σ ′ j | by u ′ ( j ) . (Thus, by assumption, the u ( j ) and u ′ ( j ) areall positive.)Now let t j,k ( ≤ j ≤ ℓ , ≤ k ≤ u ( j ) ) and t ′ j,k ( ≤ j ≤ ℓ , ≤ k ≤ u ′ ( j ) ) be fresh region variables.We think of t j,k as standing for the k th letter in the word σ j , and likewise think of t ′ j,k as standing for the k th letterin the word σ ′ j . By Lemma 16, we may write constraintsensuring that each component of either a , a or a —andhence each of the arcs ζ , . . . , ζ n —is ‘labelled with’ one ofthe t j,k , in the by-now familiar sense. Further, we can en-sure that these labels are organized into (contiguous) blocks, E , . . . , E m such that, in the h th block, E h , the sequence oflabels reads t j, , . . . , t j,u ( j ) , for some fixed j ( ≤ j ≤ ℓ ).This amounts to insisting that: ( i ) the very first arc, ζ , mustbe labelled with t j, for some j ; ( ii ) if, ζ i is labelled with t j,k ,where i < n and k < u ( j ) , then the next arc, namely ζ i +1 ,must be labelled with the next letter of σ j , namely t j,k +1 ;( iii ) if ζ i ( i < n ) is labelled with the final letter of w j , thenthe next arc must be labelled with the initial letter of somepossibly different word σ j ′ ; and ( iv ) ζ n must be labelled withthe final letter of some word. To do this we simply write: ¬ C ( t j,i , s ) ( if i = 1) ¬ C ( a k · t j,i , a ⌊ k +1 ⌋ · t j ′ ,i ′ ) ( i < u ( j ) and either j ′ = j or i ′ = i + 1 ) ¬ C ( a k · t j,u ( j ) , a ⌊ k +1 ⌋ · t j ′ ,i ′ ) ( if i ′ = 1) ¬ C ( t j,i , z ∗ ) ( if i = u ( j )) , where ≤ j, j ′ ≤ ℓ , ≤ i ≤ u ( j ) and ≤ i ′ ≤ u ( j ′ ) .Thus, within each block E h , the labels read t ′ j, , . . . , t ′ j,u ′ ( j ) , for some fixed j ; we write j ( h ) to de-note the common subscript j . The sequence of indices j (1) , . . . , j ( m ) corresponding to the successive blocks thusdefines a word τ = t j (1) , . . . t j ( m ) ∈ T ∗ . Using corresponding formulas, we label the arcs ζ ′ i ( ≤ i ≤ n ) with the alphabet { t ′ j,k | ≤ j ≤ ℓ, ≤ k ≤ u ′ ( j ) } ,so that, in any satisfying assignment over RC ( R ) , every arc ζ ′ i ( ≤ i ≤ n ) is labelled with exactly one of the regions t ′ j,k .Further, we can ensure that these labels are organized into(say) m ′ contiguous blocks, E ′ , . . . , E ′ m ′ such that in the h thblock, E ′ h , the sequence of labels reads t ′ j, , . . . , t ′ j,u ′ ( j ) , forsome fixed j . Again, writing j ′ ( h ) for the common value of j ,the sequence of of indices j ′ (1) , . . . , j ′ ( m ′ ) corresponding tothe successive blocks defines a word τ ′ = t j ′ (1) , . . . t j ′ ( m ′ ) ∈ T ∗ . Stage 5. The basic job of the foregoing stages was to definethe words σ ∈ { , } ∗ and τ, τ ′ ∈ T ∗ . In this stage, weenforce the equations σ = w ( τ ) , σ = w ( τ ′ ) and τ = τ ′ .That is: the PCP-instance w = ( { , } , T, w , w ) is positive.We first add the constraints ¬ C ( l h , t j,k ) the k ’th letter of σ j is not h ¬ C ( l h , t ′ j,k ) the k ’th letter of σ ′ j is not h. Since η i is in contact with ζ i for all i ( ≤ i ≤ n ), the string σ ∈ { , } ∗ defined by the arcs η i must be identical to thestring σ j (1) · · · σ j ( m ) . But this is just to say that σ = w ( τ ) .The equation w ( τ ′ ) = σ may be secured similarly.It remains only to show that τ = τ ′ . That is, we must showthat m = m ′ and that, for all h ( ≤ h ≤ m ), j ( h ) = j ′ ( h ) .The techniques required have in fact already been encoun-tered in Stage 3. We first introduce a new pair of variables, f , f , which we refer to as ‘block colours’, and with whichwe label the arcs ζ i in the fashion of Lemma 16, using theconstraints: ( a + a + a ) ≤ ( f + f ) ¬ C ( f · a i , f · a i ) , (0 ≤ i < . We force all arcs in each block E j to have a uniform blockcolour, and we force the block colours to alternate by writing,for ≤ h < , ≤ j, j ′ ≤ ℓ , ≤ k < u ( j ) and ≤ i < : ¬ C ( f h · t j,k , f ⌊ h +1 ⌋ · t j,k +1 ) , ¬ C ( f h · t j,u ( j ) · a i , f h · t ′ j ′ , · a ⌊ i +1 ⌋ ) Thus, we may speak unambiguously of the colour ( f or f )of a block: if E is coloured f , then E will be coloured f , E coloured f , and so on. Using the the same variables f and f , we similarly establish a block structure E ′ , . . . , E ′ m ′ on the arcs η ′ i . (Note that there is no need for primed versionsof f and f .)Now we can match up the blocks in a 1–1 fashion just aswe matched up the individual arcs. Let g , g , g ′ and g ′ be new 3-regions variables. We may assume that every arc ζ i contains some point of ˙ b ⌊ i ⌋ , . We wish to connect anysuch arc that starts a block E h (i.e. any ζ i labelled by t j, for some j ) to the top edge of the upper window, with theconnecting arc depending on the block colour. Setting w k = − ( f k · P i = ℓi =1 t j, ) ( ≤ k < ), we can do this using theconstraints: stack w k ( b i, , g k , a ) (1 ≤ k < , ≤ i < . ′ m θ ′ θ m θ θ ′ θ E ′ E E ′ E E ′ m ζ ∗ E ′ m Figure 28: The 1–1 correspondence between the E h and the E ′ h established by the θ i and the θ ′ i .Specifically, the first arc in each block E h ( ≤ h ≤ m ) isconnected by an arc θ h ˜ θ h to some point on the upper edgeof the upper window, where θ h ⊆ b i, + g i and ˜ θ h ⊆ a .Similarly, setting w ′ k = − ( f k · P i = ℓi =1 t ′ j, ) ( ≤ k < ), theconstraints stack w ′ k ( b ′ i, , g ′ k , b ) (1 ≤ k < , ≤ i < ensure that the first arc in each block E h ′ ( ≤ h ′ ≤ m ′ )is connected by an arc θ ′ h ′ ˜ θ ′ h ′ to some point on the bottomedge of the lower window, where θ h ′ ⊆ b ′ i, + g ′ i and ˜ θ ′ h ′ ⊆ b . Furthermore, from the arrangement of the ζ i , ζ ′ i and ζ ∗ (Fig. 26) we can easily write non-contact constraints forcingeach θ h to intersect one of the arcs ζ ′ i ( ≤ i ≤ n ), and each θ ′ h to intersect one of the arcs ζ i ′ ( ≤ i ′ ≤ n ).We now write the constraints ¬ C ( g k , f − k ) ∧ ¬ C ( g ′ k , f − k ) (0 ≤ k < . Thus, any θ h included in g k must join some arc ζ i in a blockwith colour f k to some arc ζ ′ i ′ also in a block with colour f k ;and similarly for the θ ′ h . Adding ¬ C ( g + g ′ , g + g ′ ) then ensures, via reasoning exactly similar to that employedin Stage 3, that θ connects the block E to the block E ′ , θ connects E to E ′ , and so on; and similarly for the θ ′ h (as shown, schematically, in Fig. 28). Thus, we have a 1–1correspondence between the two sets of blocks, whence m = m ′ .Finally, we let d , . . . , d ℓ be new regions variables la-belling the components of g and of g , and hence the arcs θ , . . . , θ m : g i ≤ X ≤ j ≤ ℓ d j ∧ ^ ≤ j ≤ ℓ C ( d j · g i , ( − d j ) · g i ) for ≤ i < . Adding the constraints ¬ C ( p j,k , d j ′ ) ( j = j ′ ) ¬ C ( p ′ j,k , d j ′ ) ( j = j ′ ) where ≤ j ≤ ℓ , ≤ k ≤ u ( j ) and ≤ j ′ ≤ ℓ , instantlyensures that the sequences of tile indices j (1) , . . . , j ( m ) and j ′ (1) , . . . , j ′ ( m ) are identical. In other words, τ = τ ′ . Thiscompletes the proof that w is a positive instance of the PCP.We have established the r.e.-hardness of Sat ( C c, RC ( R )) and Sat ( C c, RCP ( R )) . We must now extend these results to the other languages considered here. We deal with the lan-guages C c ◦ and B c as in Sec. 3. Let ϕ ◦ w be the C c ◦ formulaobtained by replacing all of occurrences of c in ϕ w with c ◦ .Since all occurrences of c in ϕ w are positive, ϕ ◦ w entails ϕ w .On the other hand, the connected regions satisfying ϕ w arealso interior-connected, and thus satisfy ϕ ◦ w as well.For the language B c , observe that, as in Sec. 3, all con-juncts of ϕ w featuring the predicate C are negative . (Remem-ber that there are additional such literals implicit in the use of3-region variables; but let us ignore these for the moment.)Recall from Sec. A that ϕ c ¬ C ( r, s, r ′ , s ′ ) := c ( r + r ′ ) ∧ c ( s + s ′ ) ∧¬ c (( r + r ′ ) + ( s + s ′ )) , and consider the effect of replacing any literal ¬ C ( r, s ) from (19) with the B c -formula ϕ c ¬ C ( r, s, r ′ , s ′ ) where r ′ and s ′ are fresh variables, and let the formula obtained be ψ . It iseasy to see that ψ entails ϕ w ; hence if ψ is satisfiable, then w is a positive instance of the PCP. To see that ψ is satisfiable,consider the satisfying tuple of ϕ w . Note that if r and s are3-regions whose outer-most elements r and s are disjoint (forexample: r = a , , s = a , ), then r and s have finitelymany connected components and have connected comple-ments. Hence, it is easy to find r ′ and s ′ in RCP ( R ) sat-isfying the corresponding formula ϕ c ¬ C ( r, s, r ′ , s ′ ) . Fig. 29represents the situation in full generality. (As usual, we as-sume a spherical canvas, with the point at infinity not lyingon the boundary of any of the depicted regions.) We maytherefore assume, that all such literals involving C have beeneliminated from ϕ w . r r ′ r . . . r r ′ rs s ′ s . . . s s ′ s Figure 29: Satisfying ϕ c ¬ C ( r, s, r ′ , s ′ ) We are not quite done, however. We must show that we canreplace the implicit non-contact constraints that come withthe use of 3-region variables by suitable B c -formulas. For ex-ample, a 3-region variable r involves the implicit constraints ¬ C (¨ r, − ˙ r ) and ¬ C ( ˙ r, − r ) . Since the two conjuncts are iden-tical in form, we only show how to deal with ¬ C ( ˙ r, − r ) . Be-cause the complement of − r is in general not connected, adirect use of ϕ c ¬ C will result in a formula which is not sat-isfiable. Instead, we represent − r as the sum of two regions s and s with connected complements, and then proceed asbefore. In particular, we replace ¬ C ( ˙ r, − r ) by: − r = s + s ∧ ϕ c ¬ C ( ˙ r, s , r , s ) ∧ ϕ c ¬ C ( ˙ r, s , r , s ) . For i = 1 , , ˙ r + r i is a connected region that is disjoint from s i . So, ˙ r is disjoint from s and s , and hence disjoint fromtheir sum − r := s + s . Fig 30 shows regions s i , r i , for i =1 , , which satisfy the above formula. Let ψ w be the resultof replacing all the conjuncts (explicit or implicit) containingthe predicate C , as just described. We have thus shown that,if ψ w is satisfiable over RC ( R ) , then w is positive, and that, s ˙ r ˙ r ˙ r (a) The region − r is the sum of s and s . s ˙ r ˙ r ˙ rr (b) The mutually disjoint connected regions ˙ r + r and s . s ˙ r ˙ r ˙ rr (c) The mutually disjoint connected regions ˙ r + r and s . Figure 30: Eliminating the conjuncts of the form ¬ C ( − r, ˙ r ) .if w is positive, then ψ w is satisfiable over RCP ( R ) . Thiscompletes the proof.The final case we must deal with is that of B c ◦ . We use ther.e.-hardness results already established for C c ◦ , and proceed,as before, to eliminate occurrences of C . Since all the poly-gons in the tuple satisfying ϕ ◦ w are quasi-bounded, we caneliminate all occurrences of C from ϕ ◦ w using Lemma 12 ( iii ).This completes the proof of Theorem 6. C B c ◦ in 3D Denote by ConRC the class of all connected topologi-cal spaces with regular closed regions. As shown in[Kontchakov et al. , 2010b], every B c ◦ -formula satisfiableover ConRC can be satisfied in a finite connected quasi-sawmodel and the problem Sat ( B c ◦ , ConRC ) is NP-complete. Theorem 17 The problems Sat ( B c ◦ , RC ( R n )) , n ≥ , coin-cide with Sat ( B c ◦ , ConRC ) , and so are all NP -complete. Proof. It suffices to show that every B c ◦ -formula ϕ satisfiableover connected quasi-saws can also be satisfied over any of RC ( R n ) , for n ≥ . So suppose that ϕ is satisfied in a model A based on a finite connected quasi-saw ( W, R ) . Denote by W i the set of points of depth i in ( W, R ) , for i = 0 , . Withoutloss of generality we may assume that there exists a point z ∈ W with z Rx for all x ∈ W . Indeed, if this is notthe case, take the interpretation B obtained by extending A with such a point z and setting z ∈ r B iff x ∈ r A for some x ∈ W . Clearly, we have A | = ( τ = τ ′ ) iff B | = ( τ = τ ′ ) ,for any terms τ , τ ′ . To see that A | = c ◦ ( τ ) iff B | = c ◦ ( τ ) ,recall that ( W, R ) is connected, and so τ ◦ is disconnected in A iff there are two distinct points x, y ∈ τ A ∩ W connectedby at least one path in ( W, R ) and such that no such path lies entirely in ( τ A ) ◦ . It follows that if ( τ A ) ◦ is disconnectedthen W \ τ A = ∅ , and so z / ∈ ( τ B ) ◦ . Thus, by adding z to ( W, R ) we cannot make a disconnected open set in A connected in B .We show now how A can be embedded into R n , for any n ≥ . First we take pairwise disjoint closed balls B x for all x ∈ W . We also select pairwise disjoint open balls D z for z ∈ W \ { z } , which are disjoint from all of the B x , andtake D z to be the complement of [ x ∈ W ( B x ) ◦ ∪ [ z ∈ W \{ z } D z . (Note that D z ◦ is connected for each z ∈ W ; all D z , for z ∈ W \ { z } , are open, while D z is closed). We thenexpand every B x to a set B x in such a way that the followingtwo properties are satisfied:(A) the B x , for x ∈ W , form a connected partition in RC ( R n ) in the sense that the B x are regular closed setsin R n , whose interiors are non-empty, connected andpairwise disjoint, and which sum up to the entire space;(B) every point in D z , z ∈ W , is either– in the interior of some B x with zRx , or– on the boundary of all of the B x for which zRx .The required sets B x are constructed as follows. Let q , q , . . . be an enumeration of all the points in S z ∈ W D z ◦ with rational coordinates. For x ∈ W , we set B x to bethe closure of the infinite union S k ∈ ω ( B kx ) ◦ , where the reg-ular closed sets B kx are defined inductively as follows (seeFig. 31):– Assuming that the B kx are already defined, let q i be thefirst point in the list q , q , . . . such that q i / ∈ B kx , forall x ∈ W . Suppose q i ∈ D z ◦ for z ∈ W . Takean open ball C q i $ D z ◦ of radius < /k centred in q i and disjoint from the B kx . For each x ∈ W with zRx , expand B kx by a closed ball in C q i and a closedrod connecting it to B x in such a way that the ball andthe rod are disjoint from the rest of the B kx . The resultingset is denoted by B k +1 x .Let RC ( W, R ) be the Boolean algebra of regular closed setsin ( W, R ) and let RC ( R n ) be the Boolean algebra of regularclosed sets in R n . Define a map f from RC ( W, R ) to RC ( R n ) by taking f ( X ) = [ x ∈ X ∩ W B x , for X ∈ RC ( W, R ) . By (A), f is an isomorphic embedding of RC ( W, R ) into RC ( R n ) , that is, f preserves the operations + , · and − and theconstants and . Define an interpretation I over RC ( R n ) bytaking r I = f ( r A ) . To show that I | = ϕ , it remains to provethat, for every X ∈ RC ( W, R ) , X ◦ is connected if, and onlyif, ( f ( X )) ◦ is connected. This equivalence follows from thefact that ( f ( X )) ◦ = [ x ∈ X ∩ W B ◦ x ∪ [ z ∈ X ∩ W , V z ⊆ X D z , where V z ⊆ W is the set of all R -successors of z of depth 0,which in turn is an immediate consequence of (B). ❑ x B x B x D z C q q Figure 31: The first two stages of filling D z with B x i , for z Rx i , i = 1 , , . (In R , the sets B x and B x2