reasoning about space and change with answer set programming modulo … · with answer set...

2
Reasoning about Space and Change with Answer Set Programming Modulo Theories Przemysław Andrzej Wał ˛ ega University of Warsaw, Institute of Philosophy, Poland [email protected] Abstract The aim of my work is to establish a compu- tational framework for commonsense spatial rea- soning about dynamic domains. The work accom- plished so far consists of theoretical investigation of a framework based on a paradigm of Answer Set Programming Modulo Theories and its imple- mentation. The developed system enables to in- tegrate geometrical and qualitative spatial infor- mation, reason about indirect spatial effects and perform non-monotonic reasoning in a context of spatio-temporal contexts. In future it might be ap- plied to a wide range of dynamic domains such as cognitive robotics, computer-aided architecture de- sign, geographic information systems, etc. 1 Introduction The key requirements in a number of dynamic spatial do- mains (such as robotics or architecture design) are to perform non-monotonic and conterfactual reasoning, enable explana- tion and diagnosis as well as belief revision about spatial ob- jects and their change in time. Additionally, tasks like causal explanation and default reasoning often need to be considered mutually with spatial consistency. The abovementioned fea- tures are necessary in scenarios where spatial configuration of objects undergo a change as a result of interactions with phys- ical environment while the agents possess incomplete or un- certain knowledge and need to perform spatial reasoning and planning. A number of domain-independent approaches for modelling spatial change have been developed, e.g., Shana- han [Shanahan, 1995] integrated a first-order theory of shape with the situation calculus for describing common-sense laws of motion, whereas Bhatt and Loke [Bhatt and Loke, 2008] presented a framework for modelling dynamic spatial sys- tems by integrating qualitative spatial theories into the sit- uation calculus. Nevertheless, no systems currently exist that are capable of efficient and general nonmonotonic spatial rea- soning for dynamic domains. 2 Qualitative Space in ASPMT The joint work with M. Bhatt and C. Schultz accomplished so far amounts to devising the so called ASPMT(QS) frame- work for spatio-temporal reasoning under stable models se- mantics [Wał ˛ ega et al., 2015]. Our approach is based on An- swer Set Programming Modulo Theories (ASPMT) paradigm extended to spatial and spatio-temporal domains. Spatial rea- soning is performed in an analytic manner, i.e., the rela- tions are encoded as polynomial constraints. The main rea- soning task –determining whether a spatial configuration is consistent– is equivalent to determining whether a particular system of polynomial constraints is satisfiable. The reasoning method uses Satisfiability Modulo Theories (SMT) with real nonlinear arithmetic, and can be performed in a sound and complete manner. ASPMT(QS) 3D Mesh Operator Domain Model 3D Model Clasp Spatial Library ASPMT2SMT Spatially Consistent Answer Sets Gringo SMT Solver Geometric Constraint Solver Parametric Diagrams Figure 1: Extended ASPMT(QS) framework pipeline. Our implementation of ASPMT(QS) 1 is built on top of ASPMT2SMT [Bartholomew and Lee, 2014] – a compiler that translates a tight fragment of ASPMT into SMT instances. Then Z3 – an off the shelf SMT solver is used to compute spatially consistent answer sets. Recently, we have extended the approach as presented in Figure. 1. Now, a consistent spa- tial configuration is also generated (quantification), and the qualitative constraints corresponding to a particular answer set are encoded as geometric constraints in order to construct a 2D parametric diagram: spatial objects in the diagram can be manipulated (scaled, rotated, translated) and in response the geometric solver modifies other spatial objects to ensure that the qualitative spatial constraints are always satisfied. The finalised parametric diagram is sent to a polyhedra op- 1 A prototypical implementation of the system is available on- line publicly from Docker Hub, a cloud-based registry service for building and shipping applications: https://hub.docker.com/r/ spatialreasoning/aspmtqs/. It contains the core system, minimal working examples, short description and installation instructions. Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence (IJCAI-16) 4038

Upload: others

Post on 15-May-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Reasoning about Space and Change with Answer Set Programming Modulo … · with Answer Set Programming Modulo Theories Przemysław Andrzej Wałega˛ University of Warsaw, Institute

Reasoning about Space and Changewith Answer Set Programming Modulo Theories

Przemysław Andrzej WałegaUniversity of Warsaw, Institute of Philosophy, Poland

[email protected]

AbstractThe aim of my work is to establish a compu-tational framework for commonsense spatial rea-soning about dynamic domains. The work accom-plished so far consists of theoretical investigationof a framework based on a paradigm of AnswerSet Programming Modulo Theories and its imple-mentation. The developed system enables to in-tegrate geometrical and qualitative spatial infor-mation, reason about indirect spatial effects andperform non-monotonic reasoning in a context ofspatio-temporal contexts. In future it might be ap-plied to a wide range of dynamic domains such ascognitive robotics, computer-aided architecture de-sign, geographic information systems, etc.

1 IntroductionThe key requirements in a number of dynamic spatial do-mains (such as robotics or architecture design) are to performnon-monotonic and conterfactual reasoning, enable explana-tion and diagnosis as well as belief revision about spatial ob-jects and their change in time. Additionally, tasks like causalexplanation and default reasoning often need to be consideredmutually with spatial consistency. The abovementioned fea-tures are necessary in scenarios where spatial configuration ofobjects undergo a change as a result of interactions with phys-ical environment while the agents possess incomplete or un-certain knowledge and need to perform spatial reasoning andplanning. A number of domain-independent approaches formodelling spatial change have been developed, e.g., Shana-han [Shanahan, 1995] integrated a first-order theory of shapewith the situation calculus for describing common-sense lawsof motion, whereas Bhatt and Loke [Bhatt and Loke, 2008]presented a framework for modelling dynamic spatial sys-tems by integrating qualitative spatial theories into the sit-uation calculus. Nevertheless, no systems currently exist thatare capable of efficient and general nonmonotonic spatial rea-soning for dynamic domains.

2 Qualitative Space in ASPMTThe joint work with M. Bhatt and C. Schultz accomplishedso far amounts to devising the so called ASPMT(QS) frame-

work for spatio-temporal reasoning under stable models se-mantics [Wałega et al., 2015]. Our approach is based on An-swer Set Programming Modulo Theories (ASPMT) paradigmextended to spatial and spatio-temporal domains. Spatial rea-soning is performed in an analytic manner, i.e., the rela-tions are encoded as polynomial constraints. The main rea-soning task –determining whether a spatial configuration isconsistent– is equivalent to determining whether a particularsystem of polynomial constraints is satisfiable. The reasoningmethod uses Satisfiability Modulo Theories (SMT) with realnonlinear arithmetic, and can be performed in a sound andcomplete manner.

Conceptual Parametrics: Integrated Framework

ASPMT(QS)

3D MeshOperator

DomainModel

3DModel

Clasp

SpatialLibrary

ASPMT2SMT

SpatiallyConsistent

Answer SetsGringo

SMTSolver

GeometricConstraint

SolverParametricDiagrams

Figure 1: Extended ASPMT(QS) framework pipeline.

Our implementation of ASPMT(QS) 1 is built on top ofASPMT2SMT [Bartholomew and Lee, 2014] – a compiler thattranslates a tight fragment of ASPMT into SMT instances.Then Z3 – an off the shelf SMT solver is used to computespatially consistent answer sets. Recently, we have extendedthe approach as presented in Figure. 1. Now, a consistent spa-tial configuration is also generated (quantification), and thequalitative constraints corresponding to a particular answerset are encoded as geometric constraints in order to constructa 2D parametric diagram: spatial objects in the diagram canbe manipulated (scaled, rotated, translated) and in responsethe geometric solver modifies other spatial objects to ensurethat the qualitative spatial constraints are always satisfied.The finalised parametric diagram is sent to a polyhedra op-

1A prototypical implementation of the system is available on-line publicly from Docker Hub, a cloud-based registry servicefor building and shipping applications: https://hub.docker.com/r/spatialreasoning/aspmtqs/. It contains the core system, minimalworking examples, short description and installation instructions.

Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence (IJCAI-16)

4038

Page 2: Reasoning about Space and Change with Answer Set Programming Modulo … · with Answer Set Programming Modulo Theories Przemysław Andrzej Wałega˛ University of Warsaw, Institute

erator module based on a mapping between the abstract spa-tial model and the 3D polyhedral model. The operator mod-ule is equipped with a set of primitive polyhedra operatorsthat are employed to transform the 3D model according tothe mapped abstract qualitative model. Every (spatially con-sistent) answer set is thus used to generate a qualitatively dis-tinct 3D model.

Since ASPMT(QS) uses polynomial encodings of spatialrelations it has a great expressiveness; it is able to express anumber of relations from the well-known qualitative spatialreasoning approaches. The following Proposition 1 has beenproved in [Wałega et al., 2015].

Proposition 1. Each relation of Interval Algebra, Rectangle

Algebra, Left-Right Algebra, Region Connection Calculus-5

in the domain of convex polygons with a finite number of ver-

tices and Cardinal Direction Calculus may be expressed in

ASPMT(QS).

In what follows we give examples of reasoning tasks that maybe performed in the framework.

Euclid Constructions. ASPMT(QS) enables to perform, fa-mous Euclid constructions such as bisecting an angle (Propo-sition 9, Book 1) by means of a ’ruler and compass method’.Given three distinct points p, pa, pb such that pa, pb areequidistant to p, the task is to bisect the angle formed by thepoints. The famous Euclid method consist of constructing cir-cles ca and cb and a point pc coincident to them (Figure 2).The claim is that the segment from p to pc bisects the angle.

p pb

pac

ca

cb

pc

p

c

p pb

pac

cb

ca

pc

p

c pa

pb

c

ca

cbpb

pa

p pb

pac

cb

ca

pc

p

c pa

pb

c

ca

cbpb

pa

p

Figure 2: Euclid’s method for bisecting the angle pa, p, pb.

ASPMT(QS) enables to check if the construction is: (i) con-

sistent, i.e., if the constructed segment bisects the angle, and(ii) sufficient, i.e., if the method always leads to the construc-tion of a segment bisecting the angle.

Architecture Design. ASPMT(QS) can be combined withComputer Aided Design systems (e.g., FreeCAD) in orderto determine qualitatively consistent relations, and instan-tiate them by creating an architectural design. As a resultASPMT(QS) may be used in the early-phase conceptual de-sign of buildings. Given a set of constraints the system en-ables to compute a spatial graph (i.e., desired qualitative rela-tions between areas of the building) and its instantiation, i.e.,a complete floor plant layout (Figure 3).

Spatio-Temporal Histories. ASPMT(QS) is capable of han-dling space-time histories, i.e., regions with both spatial andtemporal components and their mutual interactions. Considera scenario (Figure 4) in which a robot with a limited range ofmotion is asked to get the cup of coffee without hitting thelaptop or the risk of spilling the coffee on in.

properpart

room

personal hygienezone

lounge area

bathroom toilet

properpart

externalcontact

part of part of

adjacent

...

adjacent

...toilet

bathroom

loungearea personal

hygiene zone

room 302

Figure 3: A floor plan computed by ASPMT(QS).

Cf1(H4)

L

H

C

L

L’

L’

L’3

t3 t4 t5

f1(H3)

z

x

f1(H4)

f2(H4)

H ’3 L’4

H ’4

Figure 4: ASMPT(QS) solution to the manipulation task.

ASPMT(QS) enables to plan robot’s movements and checkthat all required relations between spatio-temporal objects(hand, laptop and coffee) are satisfied.

3 Future WorkThe future work consists of further development of the frame-work, in particular optimising the encodings in order to beable to perform more complex spatio-temporal reasoning.Furthermore the system will be applied to practical problems,such as navigation of mobile robots and dynamic geographicinformation systems.

AcknowledgementsThe author is supported by the Polish National Science Centregrant DEC-2011/02/A/HS1/00395.

References[Bartholomew and Lee, 2014] Michael Bartholomew and

Joohyung Lee. System aspmt2smt: Computing ASPMTTheories by SMT Solvers. In Logics in Artificial Intelli-

gence, pages 529–542. Springer, 2014.[Bhatt and Loke, 2008] Mehul Bhatt and Seng Loke. Mod-

elling dynamic spatial systems in the situation calculus.Spatial Cognition & Computation, 8(1-2):86–130, 2008.

[Shanahan, 1995] Murray Shanahan. Default reason-ing about spatial occupancy. Artificial Intelligence,74(1):147–163, 1995.

[Wałega et al., 2015] Przemysław Wałega, Mehul Bhatt, andCarl Schultz. ASPMT(QS): Non-monotonic spatial rea-soning with answer set programming modulo theories. InLPNMR: Logic Programming and Nonmonotonic Reason-

ing - 13th International Conference, Lexington, KY, USA,2015.

4039