Knowledge-based programs as plans Jrme Lang (LAMSADE, Paris) & - - PowerPoint PPT Presentation

knowledge based programs as plans
SMART_READER_LITE
LIVE PREVIEW

Knowledge-based programs as plans Jrme Lang (LAMSADE, Paris) & - - PowerPoint PPT Presentation

Knowledge-based programs as plans Jrme Lang (LAMSADE, Paris) & Bruno Zanuttini (GREYC, Caen) ECAI-2012 + TARK 2013 Jrme Lang, Bruno Zanuttini Knowledge-based plans 1/35 A card game program Goal : pick some cards, maximum 5


slide-1
SLIDE 1

Knowledge-based programs as plans

Jérôme Lang (LAMSADE, Paris) & Bruno Zanuttini (GREYC, Caen)

ECAI-2012 + TARK 2013

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 1/35

slide-2
SLIDE 2

A card game program

Goal :

◮ pick some cards, maximum 5 ◮ try to obtain three cards of the same rank

Do pick a card c look at the rank of c Until three cards of the same rank or know it is impossible

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 2/35

slide-3
SLIDE 3

A diagnose-and-repair program

◮ three components 1,2,3 ; ◮ propositional symbol oki : component i is in working order ; ◮ action repair(i) : makes oki true ; ◮ action test(i) : returns the truth value of oki ; ◮ initial knowledge state : K((ok1 ↔ (ok2 ∧ ok3)) ∧ (¬ok1 ∨ ¬ok3)) ; ◮ Goal : to have the three components working without replacing more

components than necessary. While ¬K(ok1 ∧ ok2 ∧ ok3) do i := smallest integer such that ¬Koki ; If ¬K¬oki then test(i) endif ; If K¬oki then replace(i) endif Endwhile

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 3/35

slide-4
SLIDE 4

Outline

Knowledge-based programs :

◮ introduced by Fagin, Halpern, Moses and Vardi [1995] ◮ studied for behaviour specification in distributed environments

Our work :

◮ using knowledge-based programs as (single-agent) plans reaching

some goals described by epistemic formulas

◮ LOFT-12 / ECAI-12 : expressivity and complexity of plan verification ◮ TARK-13 : comparing the succinctness of KBPs to that of standard

plans + complexity of plan existence

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 4/35

slide-5
SLIDE 5

Plan

Knowledge-based programs Knowledge-based planning problems Succinctness KBP verification KBP existence Conclusion

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 5/35

slide-6
SLIDE 6

Knowledge-based programs Knowledge-based planning problems Succinctness KBP verification KBP existence Conclusion

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 6/35

slide-7
SLIDE 7

Syntax

Input

◮ set of propositional variables X = {x1, . . . , xn}

◮ Queen(c1), ok1 . . . ◮ state = truth assignment (unobservable)

◮ set of actions

Knowledge-based program π :

◮ action, or ◮ sequence π1; π2; . . . ; πn, or ◮ branching If Φ then π1 else π2, where Φ is a purely subjective S5

formula (Boolean combination of epistemic atoms Kϕ) ; or

◮ loop While Φ do π1, where Φ is a purely subjective S5 formula.

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 7/35

slide-8
SLIDE 8

Actions

Ontic action :

◮ changes the state of the world ◮ possibly nondeterministic + no feedback ◮ propositional symbol x → {x, x′} ;

◮ x before the action is performed ◮ x′ after the action is performed

◮ switch(xi) : Σ = (x′ i ↔ ¬xi) ∧ j=i(x′ j ↔ xj) ◮ xi ← 0 : Σ = (¬x′ i ) ◮ reinit(xi) : Σ = j=i(x′ j ↔ xj)

Epistemic action :

◮ does not change the state of the world ◮ sends back one of several possible observations ◮ test(xi ∨ xj) : observe xi ∨ xj or observe ¬(xi ∨ xj) ◮ ask-how-much-time-left : observe (t = 15mn) or observe (t = 10mn)

  • r observe (t = 5mn) or observe (t = 0)

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 8/35

slide-9
SLIDE 9

Executing a KBP

At every step :

◮ current state of variables st

◮ s0 = x1x2¯

x3

◮ current knowledge state Mt

◮ Mt = {x1x2x3, x1¯

x2x3, x1x2¯ x3}

◮ succinct representation O(x1 ∧ (x2 ∨ x3)) : all I know is x1 ∧ (x2 ∨ x3).

Execution :

◮ branching condition / loop : evaluated in Mt ◮ ontic action : nondeterministic modification of st ◮ epistemic action :

◮ no modification of st ◮ reception of an observation ω Jérôme Lang, Bruno Zanuttini Knowledge-based plans 9/35

slide-10
SLIDE 10

Progression

Progression by an ontic action :

◮ Mt = {x1x2x3, ¯

x1¯ x2¯ x3} O((x1 ∧ x2 ∧ x3) ∨ (¬x1 ∧ ¬x2 ∧ ¬x3))

◮ progression of Mt by switch(x1) :

Mt+1 = {¯ x1x2x3, x1¯ x2¯ x3} O((¬x1 ∧ x2 ∧ x3) ∨ (x1 ∧ ¬x2 ∧ ¬x3))

◮ progression of Mt+1 by reinit(x1) :

Mt+2 = {x1x2x3, ¯ x1x2x3, x1¯ x2¯ x3, ¯ x1¯ x2¯ x3} O(x2 ↔ x3) Progression by an observation (received after some epistemic action) :

◮ action test(x1 ∧ x2), observation ¬(x1 ∧ x2) : ◮ progression of Mt+2 by observation ¬(x1 ∧ x2) :

Mt+3 = {¯ x1x2x3, x1¯ x2¯ x3, ¯ x1¯ x2¯ x3} O((x2 ↔ x3) ∧ ¬(x1 ∧ x2))

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 10/35

slide-11
SLIDE 11

Knowledge-based programs Knowledge-based planning problems Succinctness KBP verification KBP existence Conclusion

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 11/35

slide-12
SLIDE 12

Classical planning

◮ Set of initial states and goal states (described succinctly) ◮ Set of actions whose effects are described succinctly ◮ Output : standard plan (policy) :

◮ tree or DAG containing observations/actions ◮ branching on current state and observations Jérôme Lang, Bruno Zanuttini Knowledge-based plans 12/35

slide-13
SLIDE 13

Knowledge-based planning problems

◮ initial knowledge state initial M0 :

◮ possibly O⊤ ◮ must contain the true initial state

◮ goal G (purely subjective epistemic formula) ◮ π valid plan if

◮ terminates ◮ for every possible sequence of states s0 ∈ M0 . . . sfinal ∈ Mfinal

we have Mfinal | = G

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 13/35

slide-14
SLIDE 14

Example

◮ initial knowledge state : O((ok1 ↔ (ok2 ∧ ok3)) ∧ (¬ok1 ∨ ¬ok3)) ◮ goal knowledge state : K(ok1 ∧ ok2 ∧ ok3) ◮ actions : test(i), repair(i) for i = 1, 2, 3

Knowledge-based plan : While ¬K(ok1 ∧ ok2 ∧ ok3) do find the smallest i such that ¬Kok1 ; If ¬K¬oki then test(i) ; If K¬oki then replace(i) Endwhile

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 14/35

slide-15
SLIDE 15

Knowledge-based plans vs. standard policies

◮ A standard policy is a KBP in which the last action executed before

any branching condition if Φ or while Φ is an epistemic action a such that Φ is one of the possible observations for a.

◮ For every KBP π there exists a standard policy π′ “equivalent” to π

(π and π′ have the same execution traces). Expressivity :

◮ there exists a valid knowledge-based for a planning problem P iff

there exists a valid standard policy for P

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 15/35

slide-16
SLIDE 16

Knowledge-based plans vs. policies

KBP standard policy While ¬K(ok1 ∧ ok2 ∧ ok3) do find smallest i such that ¬Kok1 ; If ¬K¬oki then test(i) ; If K¬oki then replace(i) Endwhile replace(1) ; test(2) ; If

  • k(2)

then replace(3) else replace(2) ; test(3) ; If ok(2) then replace(3) else replace(2) ; test(3) ; If ¬ok(3) then replace(3) endif endif endif

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 16/35

slide-17
SLIDE 17

Knowledge-based plans vs. policies : reactivity

On-line execution :

◮ standard policy :

◮ move to the subtree corresponding to the observation and execute the

next action

◮ constant time

◮ knowledge-based plan :

◮ branching / loop condition : decide Mt |

= Φ

◮ NP-hard and coNP-hard, in ∆2P Jérôme Lang, Bruno Zanuttini Knowledge-based plans 17/35

slide-18
SLIDE 18

Knowledge-based plans vs. policies : succinctness

Proposition : unless NP ⊆ P/poly (extremely unlikely), while-free KBPs with atomic branching conditions are exponentially more succinct than while-free standard policies. Proof sketch :

◮ for each n ∈ N we build a polysize KBP πn that “reads” a CNF

formula ϕ and either makes sure that it is unsatisfiable or else builds a model of it.

◮ if there is a family of standard policies π′ n for every n, of size

polynomial in |πn|, with πn equivalent to π′

n, then there is a (possibly

nonuniform) polytime algorithm for 3sat, yielding NP ⊆ P/poly.

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 18/35

slide-19
SLIDE 19

Knowledge-based plans vs. policies : succinctness

Proposition : KBPs (with loops) are more succinct than standard policies (with loops). Proof sketch :

◮ there is a polynomial pol and a collection of KBPs (πn)n such that

|πn| ≤ pol(n) and such that πn “counts” up to 22n − 1 (by going once through all knowledge states).

◮ we build a family of planning problems (Pn)n such that the only valid

plans for Pn are all equivalent to πn

◮ assume that for all n there is a standard policy π′ n for Pn and

|π′

n| ≤ pol(n)| ; then π′ n can manipulate only pol(n) variables, and can

have only 2pol(n).|π′

n| configurations (states + control points) ; then it

cannot count up to 22n − 1, contradiction.

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 19/35

slide-20
SLIDE 20

Knowledge-based plans vs. policies : succinctness

Proposition : KBPs are more succinct than while-free KBPs. Proof sketch : later

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 20/35

slide-21
SLIDE 21

Knowledge-based programs Knowledge-based planning problems Succinctness KBP verification KBP existence Conclusion

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 21/35

slide-22
SLIDE 22

KBP existence vs. KBP verification

KBP verification input P = (initial belief state, actions, goal) question is π valid for P ? KBP existence input P = (initial belief state, actions, goal) question is there a valid KBP π for P ? small KBP existence input P = + integer k encoded in unary question is there a valid KBP π for P such that |π| ≤ k ?

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 22/35

slide-23
SLIDE 23

KBP verification : overview of results

loop-free programs

◮ Π2P-complete (Π2P = coNPNP) ◮ remains Π2P-complete with each of the following

restrictions :

◮ ontic actions only ◮ epistemic actions only

◮ standard plan verification : coNP-complete

programs with loops

◮ EXPSPACE-complete ◮ remains EXPSPACE-complete even if we know that π

terminates

◮ standard plan verification : PSPACE-complete

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 23/35

slide-24
SLIDE 24

KBP verification : loop-free programs

◮ Π2P-complete (Π2P = coNPNP) ◮ hardness proof easy ◮ membership proof based on the following nondeterministic algorithm

that shows that a plan is not valid ;

◮ guess a sequence of observations ◮ at each step with a branching condition Φ, evaluate Φ [Needs a

polynomial number of NP oracles]

◮ check that the goal is not satisfied at the end of the execution Jérôme Lang, Bruno Zanuttini Knowledge-based plans 24/35

slide-25
SLIDE 25

KBP verification : general programs

◮ EXPSPACE-complete ◮ key point : a loop can be executed up to 22n − 2 times (visit all

possible belief states)

◮ membership easy ◮ hardness by reduction from nondeterministic unobservable

plan existence (Haslum and Jonsson, 99)

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 25/35

slide-26
SLIDE 26

Knowledge-based plans vs. policies : succinctness

Proposition : KBPs are more succinct than while-free KBPs. Proof sketch :

◮ verifying a KBP with loops is EXPSPACE-complete ; ◮ verifying a while-free KBP is Πp 2-complete ; ◮ Πp 2 ⊆ PSPACE ⊂ EXPSPACE (strict inclusion, Savitch’s theorem)

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 26/35

slide-27
SLIDE 27

KBB existence : overview of results

unbounded bounded general 2-EXPTIME-complete EXPSPACE-complete while-free 2-EXPTIME-complete Σp

3-complete

  • ntic

EXPSPACE-complete ? while-free, ontic EXPSPACE-complete Σp

2-complete

while-free, epistemic PSPACE-complete ? while-free, epistemic, positive goal coNP-complete Σp

2-complete

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 27/35

slide-28
SLIDE 28

KBP existence

unbounded bounded general 2-EXPTIME-complete EXPSPACE-complete while-free 2-EXPTIME-complete Σp

3-complete

  • ntic

EXPSPACE-complete ? while-free, ontic EXPSPACE-complete Σp

2-complete

while-free, epistemic PSPACE-complete ? while-free, epistemic, positive goal coNP-complete Σp

2-complete

Corollaries from known results in planning together with the fact that there exists a KBP for a planning problem off there exists a standard plan.

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 28/35

slide-29
SLIDE 29

KBP existence

unbounded bounded general 2-EXPTIME-complete EXPSPACE-complete while-free 2-EXPTIME-complete Σp

3-complete

  • ntic

EXPSPACE-complete ? while-free, ontic EXPSPACE-complete Σp

2-complete

while-free, epistemic PSPACE-complete ? while-free, epistemic, positive goal coNP-complete Σp

2-complete ◮ membership : guess π of size ≤ k and verify it ; plan verification

is in EXPSPACE and NEXPSPACE = EXPSPACE.

◮ hardness : reduction from plan verification. Build a planning

problem P′, and let k = |π|, such that every valid plan for P′ is equivalent to π.

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 29/35

slide-30
SLIDE 30

KBP existence

unbounded bounded general 2-EXPTIME-complete EXPSPACE-complete while-free 2-EXPTIME-complete Σp

3-complete

  • ntic

EXPSPACE-complete ? while-free, ontic EXPSPACE-complete Σp

2-complete

while-free, epistemic PSPACE-complete ? while-free, epistemic, positive goal coNP-complete Σp

2-complete ◮ membership : guess π and verify it ; plan verification is in Πp 2. ◮ hardness : reduction from qbf3, ∃.

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 30/35

slide-31
SLIDE 31

KBP existence

unbounded bounded general 2-EXPTIME-complete EXPSPACE-complete while-free 2-EXPTIME-complete Σp

3-complete

  • ntic

EXPSPACE-complete ? while-free, ontic EXPSPACE-complete Σp

2-complete

while-free, epistemic PSPACE-complete ? while-free, epistemic, positive goal coNP-complete Σp

2-complete ◮ branching is not necessary because we never get any feedback ; the

problem is equivalent to polynomially-bounded plan existence without branching, which is Σp

2-complete.

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 31/35

slide-32
SLIDE 32

KBP existence

unbounded bounded general 2-EXPTIME-complete EXPSPACE-complete while-free 2-EXPTIME-complete Σp

3-complete

  • ntic

EXPSPACE-complete ? while-free, ontic EXPSPACE-complete Σp

2-complete

while-free, epistemic PSPACE-complete ? while-free, epistemic, positive goal coNP-complete Σp

2-complete ◮ membership : because an epistemic action needs to be executed at

most once, if a planning problem has a valid KBP then it has a valid KBP of height bounded by the number of epistemic actions. + searching a polynomial-height tree can be done in PSPACE.

◮ hardness : reduction from qbf.

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 32/35

slide-33
SLIDE 33

KBP existence

unbounded bounded general 2-EXPTIME-complete EXPSPACE-complete while-free 2-EXPTIME-complete Σp

3-complete

  • ntic

EXPSPACE-complete ? while-free, ontic EXPSPACE-complete Σp

2-complete

while-free, epistemic PSPACE-complete ? while-free, epistemic, positive goal coNP-complete Σp

2-complete ◮ membership, unbounded : performing an epistemic action cannot

harm ; there exists a valid KBP iff the KBP consisting in performing all epistemic actions in any order is valid.

◮ membership, bounded : guess a set of k epistemic actions and

perform them ; verification is in coNP.

◮ hardness : reductions from unsat and qbf2, ∃.

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 33/35

slide-34
SLIDE 34

Knowledge-based programs Knowledge-based planning problems Succinctness KBP verification KBP existence Conclusion

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 34/35

slide-35
SLIDE 35

What next

◮ Generate knowledge-based programs using tools from planning and

controller synthesis

◮ multiple agents :

◮ verify/generate a plan for one agent in interaction with other agents ◮ mutual and common knowledge, strategic interactions

◮ probabilistic belief-based programs :

While Prob(rain) ∈ [.1, .6] do query a weather forecast website endwhile ; If Prob(rain) ≥ .25 then take-umbrella

Jérôme Lang, Bruno Zanuttini Knowledge-based plans 35/35