Juggling using Temporal Logic Krzysztof Apt CWI & University of - - PowerPoint PPT Presentation

juggling using temporal logic
SMART_READER_LITE
LIVE PREVIEW

Juggling using Temporal Logic Krzysztof Apt CWI & University of - - PowerPoint PPT Presentation

Juggling using Temporal Logic Krzysztof Apt CWI & University of Amsterdam (joint work with Sebastian Brand) Juggling p. 1/1 Summary Qualitative reasoning abstracts from numeric quantities. Reasoning is carried out on the


slide-1
SLIDE 1

Juggling using Temporal Logic

Krzysztof Apt CWI & University of Amsterdam

(joint work with Sebastian Brand)

Juggling – p. 1/1

slide-2
SLIDE 2

Summary

◮ ◮ Qualitative reasoning abstracts from numeric quantities. ◮ ◮ Reasoning is carried out on the level of appropriate

abstractions.

◮ ◮ We show how infinite qualitative simulations can be realized

by combining qualitative reasoning with temporal reasoning.

◮ ◮ The implementation is realized by means of constraint

programming and uses bounded model checking.

Juggling – p. 2/1

slide-3
SLIDE 3

Qualitative Spatial Reasoning: RCC8

A B A B A B A B A B A B disjoint(A,B) meet(A,B) equal(A,B) covers(A,B) coveredby(B,A) contains(A,B) inside(B,A)

  • verlap(A,B)

Juggling – p. 3/1

slide-4
SLIDE 4

The composition table for RCC8

disjoint meet equal inside coveredby contains covers

  • verlap

disjoint RCC8 disjoint disjoint disjoint disjoint disjoint disjoint disjoint meet meet meet meet inside inside inside inside coveredby coveredby coveredby coveredby

  • verlap
  • verlap
  • verlap
  • verlap

meet disjoint disjoint meet inside meet disjoint disjoint disjoint meet meet coveredby inside meet meet contains equal

  • verlap

inside covers coveredby coveredby

  • verlap

covers

  • verlap
  • verlap

equal disjoint meet equal inside coveredby contains covers

  • verlap

inside disjoint disjoint inside inside inside RCC8 disjoint disjoint meet meet inside inside coveredby coveredby

  • verlap
  • verlap

coveredby disjoint disjoint coveredby inside inside disjoint disjoint disjoint meet coveredby meet meet meet contains equal

  • verlap

covers coveredby coveredby

  • verlap

covers

  • verlap
  • verlap

contains disjoint contains contains equal contains contains contains contains meet covers inside covers covers contains

  • verlap

coveredby

  • verlap
  • verlap

covers contains

  • verlap

covers

  • verlap

covers disjoint meet covers inside equal contains contains contains meet contains coveredby coveredby covers covers contains covers

  • verlap

covers

  • verlap

covers

  • verlap
  • verlap
  • verlap
  • verlap

disjoint disjoint

  • verlap

inside inside disjoint disjoint RCC8 meet meet coveredby coveredby meet meet contains contains

  • verlap
  • verlap

contains contains covers covers covers covers

  • verlap
  • verlap
  • verlap
  • verlap

Juggling – p. 4/1

slide-5
SLIDE 5

Reasoning using RCC8

◮ ◮ In total 193 entries. ◮ ◮ This table can be used to support spatial reasoning about

  • bjects.

◮ ◮ Examples: ◮ ◮ contains(A,B) ∧ covers(B,C) → contains(A,C). ◮ ◮ covers(A,B) ∧ covers(B,C) → covers(A,C) ∨ contains(A,C). ◮ ◮ Integrity constraints

Example: contains(A,B) ↔ inside(B,A).

Juggling – p. 5/1

slide-6
SLIDE 6

Examples of Qualitative Reasoning

◮ ◮ Spatial relations (RCC8) (Egenhofer ’91, Randell, Cui &

Cohn ’92).

◮ ◮ Temporal relations (Allen ’83): 13 temporal relations

between intervals: before, overlaps, . . .

◮ ◮ Cardinal directions (Frank ’92, Ligozat ’98): North, NorthWest, . . . ◮ ◮ Absolute directions (Skiadopoulos & Koubarakis ’01):

Example: in NYC, when facing Atlanta, Washington is to the right.

◮ ◮ Relative size (Gerevini & Renz ’02): <, =, >, ◮ ◮ . . .

Juggling – p. 6/1

slide-7
SLIDE 7

Constraint Programming

An approach to programming in which the programming process is limited to

◮ ◮ generation of requirements

(constraints); it results in a constraint satisfaction problem (CSP),

◮ ◮ solution of these requirements by ◮ ◮ specialized methods for domain specific problems

(constraint solvers),

◮ ◮ and/or general methods dealing with search space

reduction (constraint propagation) and search).

Juggling – p. 7/1

slide-8
SLIDE 8

Example: RCC8

◮ ◮ Requirements: variables Q[A, B] with domain DA,B ⊆ RCC8; A, B is an ordered pair of objects. ◮ ◮ Use the RCC8 composition table as a ternary relation S3. ◮ ◮ Example: contains(A,B), covers(B,C) implies contains(A,C), so (contains, covers, contains) ∈ S3. ◮ ◮ For each ordered triple Q[A, B], Q[B, C], Q[A, C] of variables

add the constraint CA,B,C on Q[A, B], Q[B, C], Q[A, C]:

CA,B,C := S3 ∩ (DA,B × DB,C × DA,C). ◮ ◮ So S3 removes the impossible relationships between A,B,C. ◮ ◮ Each problem is uniquely determined by a qualitative array Q

and integrity constraints.

Juggling – p. 8/1

slide-9
SLIDE 9

Simulations

◮ ◮ Discrete linear time; t = 0, 1, . . . ◮ ◮ Each qualitative variable has now a time index: Q[A, B, t]. ◮ ◮ Simulation: a sequence of closely related CSPs. ◮ ◮ Each stage t of a simulation: a CSP uniquely determined by

the qualitative array Qt and the integrity constraints.

◮ ◮ Inter-state constraints link the stages of the simulation. ◮ ◮ Temporal logic for specifying simulations: φ

eventually,

φ

next time,

φ

from now on,

ψ U φ

until.

Juggling – p. 9/1

slide-10
SLIDE 10

From Formulas to Constraints

Assume simulation of finite length tmax. Evaluate formula at time t.

Translation

Principle: unravel iteratively to simple constraints.

Q[A, B] ∈ Rels at t

is

Q[A, B, t] ∈ Rels φ at t

is

  • φ at t + 1

if t < tmax

?

if t = tmax

φ

is

φ ∨ φ

Final outcome: Boolean constraints, arithmetic constraints and simple constraints on Q.

Juggling – p. 10/1

slide-11
SLIDE 11

Infinite Simulations

◮ ◮ Loop paths used, as in bounded model checking (Biere et

  • al. ’03)

◮ ◮ (k − ℓ)-loop:

b

Q1

b

Q2 . . .

b

Qℓ . . .

b

Qk

◮ ◮ Theorem (Biere et al. ’03)

If a path exists that satisfies φ, then a (k − ℓ)-loop exists that satisfies φ.

◮ ◮ Translation: φ at tmax

is

φ at ℓ ◮ ◮ Given a specification (a set of temporal formulas Φ) our

program repeatedly tries to construct a (k − ℓ)-loop, incrementing tmax when needed.

◮ ◮ Each (k − ℓ)-loop can be finitely represented using k

qualitative arrays.

Juggling – p. 11/1

slide-12
SLIDE 12

Case Study: Juggling

Qualitative formulation of juggling

Objects: O := Hands ∪ Balls, Hands := {left-hand, right-hand}, Balls := { balli | i ∈ [1..3] }. Relations: meet

(in hand)

disjoint

(in air)

Juggling – p. 12/1

slide-13
SLIDE 13

Specifications: Examples

◮ ◮ From some time on, at most one ball is not in the air: (∀b ∈ Balls. ∀h ∈ Hands. Q[b, h] = meet → ∀b2 ∈ Balls. b = b2 → ∀h2 ∈ Hands. Q[b2, h2] = disjoint). ◮ ◮ A ball thrown from one hand remains in the air until it lands in

the other hand:

(∀b ∈ Balls. ∀h1, h2 ∈ Hands. h1 = h2 ∧ Q[h1, b] = meet → Q[h1, b] = meet U (Q[h1, b] = disjoint ∧ Q[h2, b] = disjoint ∧ (Q[h1, b] = disjoint U Q[h2, b] = meet))).

Juggling – p. 13/1

slide-14
SLIDE 14

Specifications, ctd

◮ ◮ Initial formulation was incomplete: ◮ ◮ several balls could be thrown at the same time instance, ◮ ◮ balls could “overtake” each other in the air. ◮ ◮ Repaired using additional temporal constraints.

Juggling – p. 14/1

slide-15
SLIDE 15

Remaining constraints

◮ ◮ the hands are always apart, ◮ ◮ a ball is never in both hands at the same time, ◮ ◮ two balls touch if and only if they are in the same hand, ◮ ◮ a ball in the air will land before any other ball that is currently

in a hand,

◮ ◮ no two balls are thrown at the same time, ◮ ◮ a hand can interact with only one ball at a time.

For the resulting specifications our program finds infinite simulation of 8 steps, with a backward loop.

Juggling – p. 15/1

slide-16
SLIDE 16

Juggling

Result:

State 1 State 2 State 3 State 4 State 5 State 6 State 7 State 8

1 2 3 1 2 3 3 1 2 2 3 1 2 1 3 1 3 2 3 2 1 2 1 3

Juggling – p. 16/1

slide-17
SLIDE 17

References

◮ ◮ K.R. Apt,

Principles of Constraint Programming, Cambridge University Press (2003).

◮ ◮ K.R. Apt and S. Brand,

Constraint-Based Qualitative Simulation,

  • Proc. 12th International Symposium on Temporal

Representation and Reasoning (TIME ’05).

◮ ◮ K.R. Apt and S. Brand,

Infinite Qualitative Simulations by means of Constraint Programming,

  • Proc. 12th International Conference on Principles and

Practice of Constraint Programming (CP 2006).

Juggling – p. 17/1