Spatial representation and reasoning is an essential component of geographical information systems, cognitive robotics, spatial databases, document interpretation and digital forensics. Many tasks in these areas, such as satellite image retrieval, navigation of a robot to a destination, describing the location of an object, constructing digital maps involve dealing with spatial properties of the objects and the environment.
In some domains (e.g., exploration of an unknown territory), qualitative models are more suitable for representing and reasoning about spatial relations because quantitative data may not always be available due to uncertainty or incomplete knowledge. In cognitive systems, spatial information obtained through perception might be coarse or imperfect. Even if quantitative data is available, in some circumstances agents may prefer to use qualitative terms for the sake of sociable and understandable communication. For instance, humans express orientation and distance in words like left, right, front, back, north, near. Naval, air and space navigation typicaly involve geographical directions such as south, east, northwest. Although qualitative terms have less resolution in geometry than their quantitative counterparts, it is easier for people to communicate using them. It is more eloquent to say “The library is in front of the theater, near the cafeteria” rather than “The library is at 38.6 latitude and 27.1 longitude. This explains why driving instructions in GPS system are conducted in daily language.
As an illustrative scenario (depicted in Figure 1), suppose that a robot is assisting a parent to find her missing child in a shopping mall that is not completely known to the robot nor to the parents. The robot has received some sightings of the child (e.g., “to the south of Store A”). This information will be useful if the robot can understand the relative location of the child described qualitatively, figure out where the child might be, based on such qualitative direction constraints, and describe qualitatively in which direction (e.g., “to the north”) the parents should search for their child.
In another scenario depicted in Figure 2, a human user requests a service robot to prepare the kitchen table. The commonsense knowledge for a well-set table can be described using statements such as “The plate is in the middle of the table”, “Spoon is on the right and very near to the plate”, “Desert is between napkin and salad”, “Salad is on the left and near to the plate”, “Salt is adjacent to the napkin which is near to the top border”, “The cup is on the right or back and very near to the bottle.” The human might express his preferences as well: “It is better if the juice is placed on the right side of the plate, not far and not very near to it”. To set up the table, the robot should possess representation of these qualitative direction and distance relations between objects in order to understand the human and infer the setting. It is also beneficial if the robot can utilize commonsense knowledge to enhance the arrangement, for example “by default the fork is placed next to the spoon”.
With these motivations, our objective in this thesis is to develop a general framework to represent constraints, commonsense knowledge, preferences about qualitative directions and distances, to check consistency of these information, and to infer unknown spatial relations. We propose to develop this framework using Answer Set Programming (ASP).
2 Related Literature
Beginning with the seminal work of Allen on Interval Algebra , a multitude of qualitative calculi have been proposed in the literature focusing on different aspects of space. Some of these formalisms focus on topology (DIR9 , RCC8 ), direction (cone and projection based , LR , Double-cross , Dipole , SV , OPRA , Rectangle Algebra [3, 4], Cardinal Directional Calculus [21, 42]), distance [47, 32, 16, 22], size , and shape [13, 20, 45, 39, 12]. An overview of qualitative spatial and temporal calculus can be found in recent surveys [11, 8, 14].
As for direction, point objects [17, 33, 26], line segments and ternary relations [18, 34], and extended regions on the plane [4, 21] have been examined. These formalisms are designed for point objects; in this thesis we consider extended objects.
Rectangle Algebra  and Cardinal Directional Calculus [21, 42, 43] are widely used for reasoning about directions between extended objects on the plane. Rectangle Algebra (RA) is an extension of Allen’s Interval Algebra into 2-dimension. Objects are rectangles whose sides are parallel to axes of reference frame. An RA relation is identified by a pair of interval relation between sides of rectangles in horizontal and vertical axis. In Direction Relation Matrix , the space is divided into 9 tiles and the direction of the target object is represented by its intersection with the tiles in a 3x3 matrix. A more formal model was adapted by Skiadopoulos and Koubarakis [42, 43] in a manner that lower dimensional parts (points and lines) do not alter directional relations. Its new form is named Cardinal Directional Calculus (CDC). In this thesis, our studies regarding directions is based on CDC. Consistency checking in CDC and its computational complexity have been investigated in subsequent research [29, 30, 31, 40, 42, 43, 46]. Polynomial time complexity fragments of the problem have been identified [29, 31, 40, 46] and algorithms have been presented for them. Although consistency checking problem is proven to be NP-complete in general [29, 30, 31, 43], no solution method exists for these intractable problems in the literature.
There are also calculi that integrate different aspects such as topology and orientation , orientation and distance [9, 34, 37, 38], topology and size , topology, size and distance . These formalisms consider solely point objects for describing combined spatial relations. We aim to construct a formal framework for reasoning about directions and distance for extended planar objects in the thesis. We consider qualitative distance which includes symbolic relations with adjustable granularity.
In the literature, qualitative direction and distance are combined to define a qualitative position. Symbolic binary distance relation is augmented into cone-based cardinal directions with granularity . This model with four cone-based cardinal directions (north, south, east, west) and four interval-based distance relations has been further investigated .
As for other formalisms that combine direction with distance, in one study  LR calculus is enriched with a comparative distance relation. Orientation of a point is identified with respect to the directed line segment across the two reference objects and denoted by . In 
, the same LR calculus is augmented with an interval-based qualitative distance relation of arbitrary granularity. They encode qualitative spatial constraints in Prolog with CLP (Constraint Logic Programming). This model is also extended into 3D space.
In TPCC calculus , LR relations are made finer by further subdividing the 2-D space into four cones. To measure the distance, they draw a circle whose radius is the line segment across reference objects . Inside of the circle is designated as near and outside of it as far. In another model [37, 36], the planar space is partitioned into angular segments that are called distance orientation interval (DOI). In these calculi, a DOI is specified by four metric parameters and correspond to a qualitative position.
Another approach  for describing qualitative position suggests adding symbolic distance relations into calculus. The distance relation can be asymmetric hence the distance relation is specified by a pair of relations. The distance concept is similar to interval-based system  except that the borders of the intervals also constitute a separate distance relation.
Answer Set Programming, thanks to its efficient solvers for computationally hard problems, have been applied to qualitative spatial reasoning [5, 7, 27]. These approaches are based on path consistency and don’t involve nonmonotonicity. As shown in [31, 43], local algorithms such as path consistency or k-consistency are not sufficient to decide consistency of a CDC network. Encoding of a constraint network in IA and RCC8 has been developed . Their formulation can represent disjunctive constraints but not defaults. Likewise ASP has been utilized to check path consistency of a network in Trajectory Calculus . Unknown relations are nondeterminitically generated and path consistency is tested with a composition table. In another study, ASP programs for checking consistency of basic and disjunctive constraint networks in any qualitative calculus are presented . Specialized programs for IA and RCC8 are also provided.
Consistency problems that involve topology (part, whole, contact relations) and orientation (left, right, perpendicular, colinear relations) have been solved using ASP Modulo Theories (ASPMT) in . The benefit of ASPMT is that it permits formulas in first order logic and equations including real numbers. The authors consider point, line segment, circle and polygon as spatial entities. Constraint networks in Interval Algebra, Rectangle Algebra, LR, RCC8 can be encoded in their setting. Spatial constraints are written in terms of polynomial inequalities in ASPMT and then transformed into SAT Modulo Theories for the SMT solver. For consistency checking in CDC, objects can be instantiated at any shape and size; consequently this approach is not complete for solving the CDC consistency checking problem in this thesis. Moreover their formulation does not allow for disjunctive, nonmonotonic constraints or preferences.
3 Our Approach
We use Cardinal Directional Calculus introduced by Skiadopoulos and Koubarakis [21, 42] to define relative direction of objects with respect to each other. In CDC, direction between objects are denoted by binary relations. Objects are extended regions on a plane and they can be simple, connected or disconnected as shown in Figure 3(i). The minimum bounding rectangle of the reference object along the axes (Figure 3(ii)) divides the plane into nine regions (called tiles): north (N), south (S), east (E), west (W), northeast (NE), northwest (NW), southeast (SE), southwest (SW), on (O) as in Figure 3(iii). These nine atomic (single-tile) relations and their combinations constitute the set of basic relations. (e.g. see Figure 3(iv)) CDC also allows for disjunction of these basic relations.
Using these binary relations, relative directions of extended objects can be described in CDC as a set of constraints. In our studies, we formalize CDC using ASP and further extend it with a new form of constraints: Default CDC constraints. They can be used to express default assumptions like “The food truck is normally to the south of the movie theater”.
We define qualitative distance relations with adjustable granularity .
To examplify, for granularity , the set of basic distance relations are
One of the central problems in CDC and qualitative spatial reasoning literature is the consistency checking of a constraint network. The input of the consistency checking problem are a set of spatial variables (objects), the domain of objects, a constraint network and the set of CDC relations. The domain can be the set of connected regions or the set of possibly disconnected regions in . Then, the consistency checking problem asks for whether there exists an instantiation of objects in the domain which satisfy all constraints in the network. If such an instantiation exists, the output is Yes, otherwise it is No.
Based on our representation of direction and distance constraints in ASP, we propose a novel method to check consistency of a network of constraints. Note that consistency checking problem is defined over continuous domain. We discretize consistency checking problem in CDC, prove its equivalence with the continuous version, and introduce a solution using ASP. We also establish soundness and completeness of our ASP-based solution. Namely, the ASP program has an answer set if and only if the given network of constraints is consistent.
Our ASP formulation is elaboration tolerant in the sense that a few rules are added to the main ASP program in order to incorporate disjunctive, default, soft, negative constraints, or to ensure that the generated regions are connected.
4 Goal and Current Status of the Research
The objective of this thesis is to develop a generic formal framework to represent and reason about qualitative spatial relations. In the first step, we have studied directional relations and taken Cardinal Directional Calculus as a starting point. We have formulated CDC consistency checking problem in ASP. Then we have extended CDC with new sorts of constraints which involve defaults, preferences, negation using ASP . We call this extended version of CDC as nonmonotonic CDC (nCDC).
Currently, we are working on a further extension of nCDC with qualitative distance relation. We name this extension as nCDC+. Preferences, disjunctive and default constraints can also be expressed in nCDC+.
For CDC, nCDC, nCDC+, we aim to introduce a general framework to solve consistency checking problems, address composition and inversion of qualitative spatial relations, infer unknown or missing relations between objects, and find a suitable configuration of objects which fulfills the given spatial constraints in the inquiry.
We have illustrated benefits of our methods for reasoning over nCDC constraints in  with the example scenarios mentioned in the introduction. We have evaluated efficiency of our approach for consistency checking in nCDC with experiments on benchmark instances. For this purpose, a variety of problem instances over differents domain have been prepared. For every instance, grounding time, total computation time and program size have been recorded. Observed values are compared across input parameters and the domain. We plan to perform these applications and experiments for nCDC+ as well.
5 Future Work
Our agenda for future work consists of the following items:
Experimental evaluation for nCDC+ : We plan to create benchmark instances with nCDC+ networks that include directional, distance constraints, run experiments and evaluate the results with respect to computation time.
Applications of nCDC+: We plan to revise example scenarios in the introduction for nCDC+ and apply our ASP-based methods to solve them.
-  James F. Allen (1983): Maintaining Knowledge about Temporal Intervals. Commun. ACM 26(11), pp. 832–843, doi:http://dx.doi.org/10.1145/182.358434.
-  Philippe Balbiani, Jean-François Condotta & Luis Fariñas del Cerro (1998): A model for reasoning about bidemsional temporal relations. In: Proceedings of the Sixth International Conference on Principles of Knowledge Representation and Reasoning, Morgan Kaufmann Publishers Inc., pp. 124–130.
-  Philippe Balbiani, Jean-François Condotta & Luis Fariñas del Cerro (1999): A New Tractable Subclass of the Rectangle Algebra. In: Proc. of IJCAI, pp. 442–447.
-  George Baryannis, Ilias Tachmazidis, Sotiris Batsakis, Grigoris Antoniou, Mario Alviano, Timos Sellis & Pei-Wei Tsai (2018): A Trajectory Calculus for Qualitative Spatial Reasoning Using Answer Set Programming. Theory and Practice of Logic Programming 18(3-4), pp. 355–371, doi:http://dx.doi.org/10.1007/s10707-007-0023-2.
-  David Brageul & Hans W Guesgen (2007): A Model for Qualitative Spatial Reasoning Combining Topology, Orientation and Distance. In: FLAIRS Conference, pp. 653–658.
-  Christopher Brenton, Wolfgang Faber & Sotiris Batsakis (2016): Answer Set Programming for Qualitative Spatio-Temporal Reasoning: Methods and Experiments. In: OASIcs-OpenAccess Series in Informatics, 52, Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik.
Anthony G Cohn,
Jihong Ouyang &
(2015): A survey of qualitative spatial
The Knowledge Engineering Review30(1), pp. 106–136, doi:http://dx.doi.org/10.1016/j.artint.2011.10.003.
-  Eliseo Clementini, Paolino Di Felice & Daniel Hernández (1997): Qualitative representation of positional information. Artificial intelligence 95(2), pp. 317–356, doi:http://dx.doi.org/10.1016/S0004-3702(97)00046-5.
-  Anthony G Cohn, Brandon Bennett, John Gooday & Nicholas Mark Gotts (1997): Qualitative spatial representation and reasoning with the region connection calculus. GeoInformatica 1(3), pp. 275–316, doi:http://dx.doi.org/10.1023/A:1009712514511.
-  Anthony G Cohn & Jochen Renz (2008): Qualitative Spatial Representation and Reasoning. Handbook of Knowledge Representation, p. 551, doi:http://dx.doi.org/10.1016/S1574-6526(07)03013-1.
-  Christopher H Dorr & Reinhard Moratz (2014): Qualitative shape representation based on the qualitative relative direction and distance calculus eOPRAm. arXiv preprint arXiv:1412.6649.
-  Vincent Dugat, Pierre Gambarotto & Yannick Larvor (1999): Qualitative theory of shape and orientation. In: Proc. of the 16th Int. Joint Conference on Artificial Intelligence (IJCAI’99), Stockolm, Sweden, pp. 45–53.
-  Frank Dylla, Jae Hee Lee, Till Mossakowski, Thomas Schneider, André Van Delden, Jasper Van De Ven & Diedrich Wolter (2017): A survey of qualitative spatial and temporal calculi: algebraic and computational properties. ACM Computing Surveys (CSUR) 50(1), p. 7, doi:http://dx.doi.org/10.1145/3038927.
-  Max J Egenhofer & John Herring (1990): Categorizing binary topological relations between regions, lines, and points in geographic databases. The 9(94-1), p. 76.
-  Zoe Falomir, Lledó Museros, Vicent Castelló & Luis Gonzalez-Abril (2013): Qualitative distances and qualitative image descriptions for representing indoor scenes in robotics. Pattern Recognition Letters 34(7), pp. 731–743, doi:http://dx.doi.org/10.1016/j.patrec.2012.08.012.
-  A. U. Frank (1991): Qualitative Spatial Reasoning about Cardinal Directions. In: Proc. of Auto-Carto 10.
-  Christian Freksa (1992): Using orientation information for qualitative spatial reasoning, pp. 162–178. Springer Berlin Heidelberg.
-  Alfonso Gerevini & Jochen Renz (2002): Combining topological and size information for spatial reasoning. Artificial Intelligence 137(1-2), pp. 1–42, doi:http://dx.doi.org/10.1016/S0004-3702(02)00193-5.
-  Björn Gottfried (2005): Global feature schemes for qualitative shape descriptions. IJCAI-05 WS on spatial and temporal reasoning.
-  R Goyal & Max J Egenhofer (1997): The direction-relation matrix: A representation for directions relations between extended spatial objects. The annual assembly and the summer retreat of University Consortium for Geographic Information Systems Science 3, pp. 95–102.
-  Hans W Guesgen (2002): Reasoning about distance based on fuzzy sets. Applied Intelligence 17(3), pp. 265–270, doi:http://dx.doi.org/10.1023/A:1020024013757.
-  Jung-Hong Hong, Max Egenhofer & Andrew U Frank (1995): On the robustness of qualitative distance-and direction-reasoning. In: Autocarto Conference, pp. 301–310.
-  Lothar Hotz, Pascal Rost & Stephanie von Riegen: Combining Qualitative Spatial Reasoning and Ontological Reasoning for Supporting Robot Tasks.
-  Yusuf Izmirlioglu & Esra Erdem (2018): Qualitative Reasoning About Cardinal Directions Using Answer Set Programming. In: Proc. of AAAI.
-  Jae Hee Lee, Jochen Renz & Diedrich Wolter (2013): StarVars - Effective Reasoning about Relative Directions. In: Proc. of IJCAI, pp. 976–982.
-  Jason Jingshi Li (2012): Qualitative spatial and temporal reasoning with answer set programming. In: Tools with Artificial Intelligence (ICTAI), 2012 IEEE 24th International Conference on, 1, IEEE, pp. 603–609, doi:http://dx.doi.org/10.1109/ICTAI.2012.87.
-  Gérard F Ligozat (1993): Qualitative triangulation for spatial reasoning. In: European Conference on Spatial Information Theory, Springer, pp. 54–68.
-  Weiming Liu (2013): Qualitative constraint satisfaction problems: algorithms, computational complexity, and extended framework. Ph.D. thesis, University of Technology, Sydney.
-  Weiming Liu & Sanjiang Li (2011): Reasoning about cardinal directions between extended objects: The NP-hardness result. Artificial Intelligence 175(18), pp. 2155–2169, doi:http://dx.doi.org/10.1016/j.artint.2011.07.005.
-  Weiming Liu, Xiaotong Zhang, Sanjiang Li & Mingsheng Ying (2010): Reasoning about cardinal directions between extended objects. Artificial Intelligence 174(12-13), pp. 951–983, doi:http://dx.doi.org/10.1016/j.artint.2010.05.006.
-  M Teresa Escrig Monferrer & Francisco Toledo Lobo (1996): Enhancing qualitative relative orientation with qualitative distance for robot path planning. In: Tools with Artificial Intelligence, 1996., Proceedings Eighth IEEE International Conference on, IEEE, pp. 174–182.
-  Reinhard Moratz, Frank Dylla & Lutz Frommberger (2005): A relative orientation algebra with adjustable granularity. In: Proceedings of the Workshop on Agents in Real-Time and Dynamic Environments (IJCAI 05), 21, p. 22.
-  Reinhard Moratz, Bernhard Nebel & Christian Freksa (2002): Qualitative spatial reasoning about relative position. In: International Conference on Spatial Cognition, Springer, pp. 385–400.
-  Reinhard Moratz, Jochen Renz & Diedrich Wolter (2000): Qualitative spatial reasoning about line segments. In: ECAI, pp. 234–238.
-  Reinhard Moratz & Jan Oliver Wallgrün: Spatial Reasoning about Relative Orientation and Distance for Robot Exploration. In: Spatial Information Theory. Foundations of Geographic Information Science, doi:http://dx.doi.org/10.1007/BF00117601.
-  Reinhard Moratz & Jan Oliver Wallgrün (2003): Spatial reasoning about relative orientation and distance for robot exploration. In: International Conference on Spatial Information Theory, Springer, pp. 61–74.
-  Reinhard Moratz & Jan Oliver Wallgrün (2012): Spatial reasoning with augmented points: Extending cardinal directions with local distances. Journal of Spatial Information Science 2012(5), pp. 1–30.
-  Lledó Museros & M Teresa Escrig (2004): A qualitative theory for shape representation and matching for design. In: Proceedings of the 16th European Conference on Artificial Intelligence, IOS Press, pp. 858–862.
-  Isabel Navarrete, Antonio Morales & Guido Sciavicco (2007): Consistency Checking of Basic Cardinal Constraints over Connected Regions. In: Proc. of IJCAI, pp. 495–500. Available at http://dli.iiit.ac.in/ijcai/IJCAI-2007/PDF/IJCAI07-078.pdf.
-  Julio Pacheco, Mª Teresa Escrig & Francisco Toledo (2002): Qualitative spatial reasoning on three-dimensional orientation point objects. In: Proccedings of the QR2002. 16th International WorkShop on Qualitative Reasoning. Editors: Nuria Agell and.
-  Spiros Skiadopoulos & Manolis Koubarakis (2004): Composing cardinal direction relations. Artificial Intelligence 152(2), pp. 143–171, doi:http://dx.doi.org/10.1016/S0004-3702(03)00137-1.
-  Spiros Skiadopoulos & Manolis Koubarakis (2005): On the consistency of cardinal direction constraints. Artificial Intelligence 163(1), pp. 91–135, doi:http://dx.doi.org/10.1016/j.artint.2004.10.010.
-  Przemyslaw Andrzej Walega, Mehul Bhatt & Carl P. L. Schultz (2015): ASPMT(QS): Non-Monotonic Spatial Reasoning with Answer Set Programming Modulo Theories. In: Proc. of LPNMR, pp. 488–501.
-  Nico Van de Weghe, Guy De Tré, Bart Kuijpers & Philippe De Maeyer (2005): The double-cross and the generalization concept as a basis for representing and comparing shapes of polylines. In: OTM Confederated International Conferences” On the Move to Meaningful Internet Systems”, Springer, pp. 1087–1096.
-  Xiaotong Zhang, Weiming Liu, Sanjiang Li & Mingsheng Ying (2008): Reasoning with Cardinal Directions: An Efficient Algorithm. In: Proceedings of the Twenty-Third AAAI Conference on Artificial Intelligence, AAAI 2008, Chicago, Illinois, USA, July 13-17, 2008, pp. 387–392.
-  Kai Zimmermann & Christian Freksa (1996): Qualitative spatial reasoning using orientation, distance, and path knowledge. Applied intelligence 6(1), pp. 49–58, doi:http://dx.doi.org/10.1007/BF00117601.