TouIST: a friendly language for propositional logic and more - - PowerPoint PPT Presentation

touist a friendly language for propositional logic and
SMART_READER_LITE
LIVE PREVIEW

TouIST: a friendly language for propositional logic and more - - PowerPoint PPT Presentation

TouIST: a friendly language for propositional logic and more Application to planning with SAT or QBF solvers Frdric Maris Joint work with Olivier Gasquet, Dominique Longin and Mal Valais December 18 th , 2019 IRIT University of


slide-1
SLIDE 1

TouIST: a friendly language for propositional logic and more

Application to planning with SAT or QBF solvers

Frédéric Maris Joint work with Olivier Gasquet, Dominique Longin and Maël Valais December 18th, 2019

IRIT – University of Toulouse (France)

1/35

slide-2
SLIDE 2

TouIST

slide-3
SLIDE 3

Motivation for a new tool

Remark 1 : existing languages are not intuitive SAT solvers are very efficient but with a « low level » input language Formula Solver input (DIMACS) a → b ∨ ¬ (a → c) ∨ (c → ¬a) p cnf 5 4

  • 1 5 3 0
  • 1 -5 4 1 0
  • 1 -5 4 -2 0
  • 1 -3 -2 -1 0

2/35

slide-4
SLIDE 4

Motivation for a new tool

Remark 2 : existing languages are not compact SMT-LIB is much more expressive than DIMACS but with a lack of compacity Formula SMT-LIB example

  • i∈[1..1000]

xi (assert (and x1 (and x2 (and x3 (and x4 (and x5 (and x6 ... x1000 )))))))

3/35

slide-5
SLIDE 5

Motivation for a new tool

Technical goal : an intuitive language for modeling, well documented a user-friendly graphical interface Academic goal : teaching of logic research (comparison of solvers, encodings)

4/35

slide-6
SLIDE 6

Motivation for a new tool

History : Date Version Features 2010 SAToulouse SAT (integrated) mid 2015 TouIST 1.0 SAT end of 2016 TouIST 2.0 SAT, SMT mid 2017 TouIST 3.0 SAT, SMT, QBF

5/35

slide-7
SLIDE 7

Implementation aspects

TouIST (Toulouse Integrated Satisfiability Tool)

Graphical interface for writing logical formulas in a compact language and using different external solvers.

  • under MIT license, sources : github.com/touist/touist
  • graphical interface (Java)
  • translation to solver languages by a compiler (OCaml)
  • compatible with SAT, SMT and QBF

6/35

slide-8
SLIDE 8

Implementation aspects

Choosing the solver on the fly TouIST allows one to choose the solver to target. The input language adapts to each solver.

7/35

slide-9
SLIDE 9

Implementation aspects

Compatible solvers : Solver Formula TouIST input language SAT a ∧ b → c a and b => c SMT (QF-LIA) (x + y − z ≥ 4) ∨ b (x + y - z >= 4) or a SMT (QF-LRA) (x + y − z > 4.0) → c (x + y - z > 4.0) => c SMT (QF-IDL) (x − y > 2) ∧ c (x - y > 2) and c SMT (QF-RDL) (x − y > 1.0) ∧ c (x - y > 1.0) and c QBF ∀b.a ∧ b forall b: a and b

QF-LIA = Quantifier-Free Linear Integer Arithmetic QF-LRA = Quantifier-Free Linear Real Arithmetic QF-IDL = Quantifier-Free Integer Difference Logic QF-RDL = Quantifier-Free Real Difference Logic

8/35

slide-10
SLIDE 10

Implementation aspects

TouIST input language :

  • variables and sets

$N = 5 $Rows = [1..$N] $Countries = [France, Italy, Spain]

  • generalized connectors

in(France) and in(Italy) and in(Spain) bigand $c in $Countries: en($c) end

9/35

slide-11
SLIDE 11

Application to planning

slide-12
SLIDE 12

Classical Planning Problem

A planning problem is a tuple Π = F, O, I, G :

  • F is a set of fluents (atomic propositions)
  • O is a set of actions
  • I is the set of fluents in initial state
  • G is the set of required fluents to achieve the goal

An action is a tuple a = Cond(a), Add(a), Del(a) :

  • Cond(a) is the set of fluents required to execute a
  • Add(a) is a set of fluents added by the execution of a
  • Del(a) is a set of fluents deleted by the execution of a

10/35

slide-13
SLIDE 13

Algorithms for plan synthesis (state-spaces)

A : a → +b B : a → +c –a C : b c → +d

✄ ✂

a

A

  • B

✝ ☎ ✆

a b

A

  • B

c

✞ ✝ ☎ ✆

a b

✞ ✝ ☎ ✆

b c

C

✝ ☎ ✆

b c d

11/35

slide-14
SLIDE 14

SAT Encodings for Classical Planning

Several different encoding have been proposed :

  • State spaces encodings [Kautz and Selman, 1992],

[Rintanen et al., 2006], [Rintanen, 2012]

  • Plan spaces encodings ([Mali and Kambhampati, 1999])
  • Planning graph encodings [Kautz and Selman, 1999],

[Robinson et al., 2008], [Robinson et al., 2009] In the sequel, we present the state spaces encoding with explanatory frame-axioms [Kautz and Selman, 1992].

12/35

slide-15
SLIDE 15

SAT Encodings for Classical Planning

S0(Init) ◮ x1 ≡ S1 ◮ x2 ≡ S2 ◮ x3 ≡ S3 ◮ x4 ≡ S4 ◮ x5 ≡ S5 ◮ x6 ≡ S6 ◮ x7 ≡ S7 ◮S8(Goal)

Figure 1 – Transitions of an 8-step plan in SAT/SMT encoding

Each step i is associated with :

  • a set of propositional variables for actions {a1

i , a2 i . . . , am i }

  • a set of propositional variables for fluents {f 1

i , f 2 i , . . . , f n i }

13/35

slide-16
SLIDE 16

SAT Encoding : Initial State and Goal

Initial state :

  • f∈I

f0

  • f∈F\I

¬f0 Goal :

  • f∈G

flength

14/35

slide-17
SLIDE 17

SAT Encoding : Conditions and Effects of Actions

  • i∈[1..length]
  • a∈O

 ai ⇒    

  • f∈Conda

fi−1   ∧  

f∈Adda

fi   ∧  

f∈Dela

(¬fi)      

15/35

slide-18
SLIDE 18

SAT Encoding : Explanatory Frame-Axioms

  • i∈[1..length]
  • f∈F

   (¬fi−1 ∧ fi) ⇒    

  • a∈O

f∈Adda

ai        

  • i∈[1..length]
  • f∈F

   (fi−1 ∧ ¬fi) ⇒    

  • a∈O

f∈Dela

ai        

16/35

slide-19
SLIDE 19

SAT Encoding : Negative Interactions (Mutex)

  • i∈[1..length]
  • a1∈O
  • f∈Conda1
  • a2∈O

(a1=a2) (f∈Dela2)

(¬a1i ∨ ¬a2i)

goal goal removed by r ¬r p p ¬p condition for red blue Unexpected behaviour!

17/35

slide-20
SLIDE 20

SAT Encodings for Classical Planning

Several different encoding have been proposed :

  • State spaces encodings [Kautz and Selman, 1992],

[Rintanen et al., 2006], [Rintanen, 2012]

  • Plan spaces encodings ([Mali and Kambhampati, 1999])
  • Planning graph encodings [Kautz and Selman, 1999],

[Robinson et al., 2008], [Robinson et al., 2009] We propose a new encoding based on open conditions.

18/35

slide-21
SLIDE 21

SAT Encodings for Classical Planning

S0(Init) ◮ x1 ≡ S1 ◮ x2 ≡ S2 ◮ x3 ≡ S3 ◮ x4 ≡ S4 ◮ x5 ≡ S5 ◮ x6 ≡ S6 ◮ x7 ≡ S7 ◮S8(Goal)

Figure 2 – Transitions of an 8-steps plan in SAT/SMT encoding

Each step i is associated with :

  • a set of propositional variables for actions {a1

i , a2 i . . . , am i }

  • a set of propositional variables for open conditions

{openf 1,i, openf 2,i, . . . , openf n,i}

19/35

slide-22
SLIDE 22

SAT Encoding : open conditions. . .

  • i∈[1..length]
  • A∈O

 Ai ⇒

  • f∈CondA
  • penf,i

 

  • f∈G

   openf,length ∨

  • A∈O

f∈AddA

Alength    

20/35

slide-23
SLIDE 23

SAT Encoding : . . . then propagate or close

  • f∈F\I

¬openf,1

  • i∈[2..length]
  • f∈F

   openf,i ⇒    openf,i−1 ∨

  • A∈O

f∈AddA

Ai−1        

a f ∈ Cond(a)

  • penf

Si−1 Si propagate

  • penf

Si−k

  • penf

a′ f ∈ Add(a′)

Figure 3 – Causal link : action a′ produces f at step Si−k for action a which requires f at step Si.

21/35

slide-24
SLIDE 24

SAT Encoding : protect open conditions and prevent negative interactions (mutex)

  • i∈[2..length]
  • f∈F

   openf,i ⇒

  • A∈O

f∈DelA

¬Ai−1    

  • i∈[1..length]
  • A∈O
  • f∈(AddA∪CondA)
  • B∈O

A=B∧f∈DelB

(¬Ai ∨ ¬Bi)

22/35

slide-25
SLIDE 25

QBF Classical Planning

Transition to QBF

X0

two states =

∀b

X0 X0

two different contexts

Propositional logic QBF

two different sets of variables

less memory used

sharing the same set of variables

∀ ∃ ∨ ∧ → ¬

Propositional logic

QBF =

+

quantifiers over

X1

propositions

23/35

slide-26
SLIDE 26

QBF Encodings for Classical Planning

Different encodings have been proposed :

  • Flat Encoding [Rintanen, 2001], [Cashmore, 2013]
  • Compact Tree Encoding (CTE) [Cashmore et al., 2012]

We propose a new CTE based on open conditions.

24/35

slide-27
SLIDE 27

QBF Compact Tree Encoding (CTE)

(a) S0(Init) ◮ x1 ≡ S1 ◮ x2 ≡ S2 ◮ x3 ≡ S3 ◮ x4 ≡ S4 ◮ x5 ≡ S5 ◮ x6 ≡ S6 ◮ x7 ≡ S7 ◮S8(Goal) (b) x2 ≡ S4

  • x1 ≡ S2
  • x′

1 ≡ S6

  • S0(Init)

◮ x0 ≡ S1

  • x′

0 ≡ S3

  • x′′

0 ≡ S5

  • x′′′

≡ S7 ◮S8(Goal)

Figure 4 – Transitions of an 8-steps plan in (a) SAT encoding and (b) QBF compact tree encoding (CTE)

25/35

slide-28
SLIDE 28

QBF Compact Tree Encoding (CTE)

xi

bi=⊥ bi=⊤

  • xi−1

bi−1=⊥ bi−1=⊤

xi−1

bi−1=⊥ bi−1=⊤

xi−2

bi−2=⊥ b{i−2,...,1}=⊤

xi−2

b{i−2,...,1}=⊥ bi−2=⊤

x0

  • x0

Figure 5 – Both possible transitions in a CTE following the branching structure of a QBF : X0 → Xi (from leaf to node on the left) and Xi → X0 (from node to leaf on the right). Note that i refers to any level (except for the leaf layer), not only the root.

26/35

slide-29
SLIDE 29

QBF Encoding : quantifiers

A∈O

Ak.∃

f ∈F

  • penf ,k.∀bk. ∃

A∈O

Ak−1.∃

f ∈F

  • penf ,k−1.∀bk−1.

. . . ∃

A∈O

A1.∃

f ∈F

  • penf ,1.∀b1. ∃

A∈O

A0.∃

f ∈F

  • penf ,0.

27/35

slide-30
SLIDE 30

QBF Encoding : open conditions. . .

  • i∈[0..depth]
  • A∈O

 Ai ⇒

  • f∈CondA
  • penf,i

 

  • i∈[1..depth]

bi ⇒

  • f∈G

   openf,0 ∨

  • A∈O

f∈AddA

A0    

28/35

slide-31
SLIDE 31

QBF Encoding : . . . then propagate and close

  • i∈[1..depth]

¬bi ⇒

  • f∈F\I

¬openf,0

  • i∈[1..depth]
  • f∈F

    openf,i ∧ ¬bi ∧

  • j∈[1..i−1]

bj   ⇒   openf,0 ∨

  • A∈O

f∈AddA

A0      

  • i∈[1..depth]
  • f∈F

    openf,0 ∧ bi ∧

  • j∈[1..i−1]

¬bj   ⇒   openf,i ∨

  • A∈O

f∈AddA

Ai      

29/35

slide-32
SLIDE 32

QBF Encoding : protect open conditions and prevent negative interactions (mutex)

  • i∈[1..depth]
  • f∈F

    openf,i ∧ ¬bi ∧

  • j∈[1..i−1]

bj   ⇒

  • A∈O

f∈DelA

¬A0   

  • i∈[1..depth]
  • f∈F

    openf,0 ∧ bi ∧

  • j∈[1..i−1]

¬bj   ⇒

  • A∈O

f∈DelA

¬Ai   

  • i∈[0..depth]
  • A∈O
  • f∈(AddA∪CondA)
  • B∈O

A=B∧f∈DelB

(¬Ai ∨ ¬Bi)

30/35

slide-33
SLIDE 33

QBF Encoding : Finding Optimal Plans

Step one : incrementally increase the depth until solver returns true

S6 S7 S5 S3 S1 S2 S4 S1

solver result

false

depth=1 depth=2

false

S3 S1 S2

depth=3

true

31/35

slide-34
SLIDE 34

QBF Encoding : Finding Optimal Plans

Step two : find optimal goal by dichotomy

S6 S7 S5 S3 S4 S6 S5 S7 S1 S2 S4 S4 S5 S7

still true false

S4

still true best

S4

true

true

  • ptimal goal

in here Find optimal goal by dichotomy:

32/35

slide-35
SLIDE 35

Experimental Trials : Plan Decision Time

y = 0.4843x y = x 500 1000 1500 2000 2500 3000 3500 1000 2000 3000 Time in seconds (CTE-EFA) Time in seconds (CTE-NOOP) y = 0.5953x y = x 500 1000 1500 2000 2500 3000 3500 1000 2000 3000 Time in seconds (CTE-OPEN) Time in seconds (CTE-NOOP)

Figure 6 – Plan decision time (EFA/OPEN vs NOOP).

33/35

slide-36
SLIDE 36

Experimental Trials : Plan Extraction Time

y = x y = 0.4583x 500 1000 1500 2000 2500 3000 3500 1000 2000 3000 Time in seconds (CTE-EFA) Time in seconds (CTE-NOOP) y = x y = 0.6944x 500 1000 1500 2000 2500 3000 3500 1000 2000 3000 Time in seconds (CTE-OPEN) Time in seconds (CTE-NOOP)

Figure 7 – Plan extraction time (EFA/OPEN vs NOOP).

34/35

slide-37
SLIDE 37

Thank you

35/35

slide-38
SLIDE 38

Cashmore, M. (2013). Planning as quantified Boolean formulae. PhD thesis, University of Strathclyde, Glasgow, UK. Cashmore, M., Fox, M., and Giunchiglia, E. (2012). Planning as quantified boolean formula. In Raedt, L. D., Bessière, C., Dubois, D., Doherty, P., Frasconi, P., Heintz, F., and Lucas, P. J. F., editors, ECAI 2012 - 20th European Conference on Artificial Intelligence. Including Prestigious Applications of Artificial Intelligence (PAIS-2012) System Demonstrations Track, Montpellier, France, August 27-31 , 2012, volume 242 of Frontiers in Artificial Intelligence and Applications, pages 217–222. IOS Press. Kautz, H. (2004). Satplan’04 : Planning as satisfiability.

35/35

slide-39
SLIDE 39

In Abstracts of the 4th International Planning Competition, IPC-04. Kautz, H. and Selman, B. (1992). Planning as satisfiability. In ECAI-92, pages 359–363. Kautz, H. and Selman, B. (1999). Unifying SAT-based and Graph-based planning. In Proc. IJCAI-99, pages 318–325. Kautz, H., Selman, B., and Hoffmann, J. (2006). Satplan’06 : Planning as satisfiability. In Abstracts of the 5th International Planning Competition, IPC-06. Mali, A. D. and Kambhampati, S. (1999). On the utility of plan-space (causal) encodings.

35/35

slide-40
SLIDE 40

In Hendler, J. and Subramanian, D., editors, Proceedings of the Sixteenth National Conference on Artificial Intelligence and Eleventh Conference on Innovative Applications of Artificial Intelligence, July 18-22, 1999, Orlando, Florida, USA., pages 557–563. AAAI Press / The MIT Press. Rintanen, J. (2001). Partial implicit unfolding in the davis-putnam procedure for quantified boolean formulae. In Nieuwenhuis, R. and Voronkov, A., editors, Logic for Programming, Artificial Intelligence, and Reasoning, 8th International Conference, LPAR 2001, Havana, Cuba, December 3-7, 2001, Proceedings, volume 2250 of Lecture Notes in Computer Science, pages 362–376. Springer. Rintanen, J. (2012). Planning as satisfiability : Heuristics.

35/35

slide-41
SLIDE 41
  • Artif. Intell., 193 :45–86.

Rintanen, J., Heljanko, K., and Niemelä, I. (2006). Planning as satisfiability : parallel plans and algorithms for plan search.

  • Artif. Intell., 170(12-13) :1031–1080.

Robinson, N., Gretton, C., Pham, D. N., and Sattar, A. (2008). A compact and efficient SAT encoding for planning. In Rintanen, J., Nebel, B., Beck, J. C., and Hansen, E. A., editors, Proceedings of the Eighteenth International Conference

  • n Automated Planning and Scheduling, ICAPS 2008, Sydney,

Australia, September 14-18, 2008, pages 296–303. AAAI. Robinson, N., Gretton, C., Pham, D. N., and Sattar, A. (2009).

35/35

slide-42
SLIDE 42

Sat-based parallel planning using a split representation of actions. In Gerevini, A., Howe, A. E., Cesta, A., and Refanidis, I., editors, Proceedings of the 19th International Conference on Automated Planning and Scheduling, ICAPS 2009, Thessaloniki, Greece, September 19-23, 2009. AAAI.

35/35