Factored Planning: From Automata to Petri Nets Loïg Jezequel1 , Eric Fabre2 , Victor Khomenko3 ACSD, July 9, 2013 1 2 3 ENS Cachan Bretagne INRIA Rennes Newcastle University Introduction From automata to Petri nets Experimental results Conclusions Planning Factored planning Previous results Why Petri nets? Goal Find a : a sequence of actions (with minimal cost) moving the system from its initial state to one of its goal states plan 2 / 16 Introduction From automata to Petri nets Experimental results Conclusions Planning Factored planning Previous results Why Petri nets? Each component is a planning problem with its own resources and actions Goal Find a set of global plan compatible local plans: they can be interleaved into a 3 / 16 Introduction From automata to Petri nets Experimental results Conclusions Planning Factored planning Previous results Why Petri nets? Each component is a planning problem with its own resources and actions The components interact by resources and/or actions Goal Find a set of global plan compatible local plans: they can be interleaved into a 3 / 16 Introduction From automata to Petri nets Experimental results Conclusions Components ⇒ Automata Plans ⇒ Words Interaction ⇒ Synchronous product Planning Factored planning Previous results Why Petri nets? New goal Given A = A1 || . . . ||A , nd a in A by local computations n word 4 / 16 Introduction Planning From automata to Petri nets Factored planning Experimental results Previous results Conclusions Why Petri nets? Components ⇒ Automata Plans ⇒ Words Interaction ⇒ Synchronous product A possibility [Fabre et al. 10] New goal Given A = A1 || . . . ||A , nd a in A by local computations n word i Compute A0 = ΠΣ (A) for each without computing A i i Why? any word any word 1 2 w of A can be projected into a word w of ΠΣ (A) w of ΠΣ (A) is the projection of a word w of A i i i i ⇒ Easy extraction of a word from A by local searches 4 / 16 Introduction Planning From automata to Petri nets Factored planning Experimental results Previous results Conclusions A possibility [Fabre et al. 10] Why Petri nets? i Compute A0 = ΠΣ (A) for each without computing A i i How? Conditional independence like property ΠΣ 1 ∩Σ2 (A1 × A2 ) ≡L ΠΣ 1 ∩Σ2 (A1 ) × ΠΣ 1 ∩Σ2 (A2 ) Application: Σ1 ∩ Σ2 A1 ΠΣ (A) = 1 Σ2 ∩ Σ3 A2 A3 ΠΣ (A1 × A2 × A3 ) 1 ≡L ΠΣ (A1 ) × ΠΣ (A2 × A3 ) ≡L A1 × Π Σ ∩Σ2 (A2 × A3 ) ≡L A1 × Π Σ ∩Σ2 (A2 × ΠΣ 1 1 1 1 2 ∩Σ3 (A3 )) 5 / 16 Introduction Planning From automata to Petri nets Factored planning Experimental results Previous results Conclusions A possibility [Fabre et al. 10] Why Petri nets? i Compute A0 = ΠΣ (A) for each without computing A i i How? Conditional independence like property ΠΣ 1 ∩Σ2 (A1 × A2 ) ≡L ΠΣ 1 ∩Σ2 (A1 ) × ΠΣ 1 ∩Σ2 (A2 ) Application: A1 Σ1 ∩ Σ2 A2 × Σ2 ∩ Σ3 × ΠΣ1 ∩Σ2 ΠΣ (A) = 1 A3 ΠΣ2 ∩Σ3 ΠΣ (A1 × A2 × A3 ) 1 ≡L ΠΣ (A1 ) × ΠΣ (A2 × A3 ) ≡L A1 × Π Σ ∩Σ2 (A2 × A3 ) ≡L A1 × Π Σ ∩Σ2 (A2 × ΠΣ 1 1 1 1 2 ∩Σ3 (A3 )) 5 / 16 Introduction Planning From automata to Petri nets Factored planning Experimental results Previous results Conclusions A possibility [Fabre et al. 10] Why Petri nets? i Compute A0 = ΠΣ (A) for each without computing A i i How? Generalization Message passing algorithms : proceed by successive renements A1 ΠΣ 1 × A2 × ΠΣ ΠΣ A3 × A4 2 ΠΣ 3 A5 2 messages from root to leaves messages from leaves to root A1 ΠΣ 2 ΠΣ 3 × A3 × A2 ΠΣ 4 × A4 ΠΣ 5 A5 6 / 16 Introduction From automata to Petri nets Experimental results Conclusions Planning Factored planning Previous results Why Petri nets? Concurrency in factored planning problems Global concurrency: between components (private actions) Local concurrency: internal to a component Remark: local concurrency is not anecdotal p1 f4 p1 , f4 f1 f1 , p4 p4 p2 p2 , f3 f3 f2 p3 f2 , p3 7 / 16 Introduction From automata to Petri nets Experimental results Conclusions Planning Factored planning Previous results Why Petri nets? Concurrency in factored planning problems Global concurrency: between components (private actions) Local concurrency: internal to a component Concurrency in networks of automata Global concurrency: taken into account Local concurrency: ignored! 7 / 16 Introduction From automata to Petri nets Experimental results Conclusions Planning Factored planning Previous results Why Petri nets? Concurrency in factored planning problems Global concurrency: between components (private actions) Local concurrency: internal to a component Concurrency in networks of automata Global concurrency: taken into account Local concurrency: ignored! Networks of Petri nets Global concurrency: taken into account Local concurrency: taken into account 7 / 16 Introduction From automata to Petri nets Experimental results Conclusions Languages, automata, Petri nets Product of Petri nets Projection of Petri nets The real purpose of automata Implementation of product and projection of regular languages with nite objects Our goal More ecient implementation by taking local concurrency into account: product of languages ⇒ product of Petri nets projection of languages ⇒ projection of Petri nets 8 / 16 Introduction From automata to Petri nets Experimental results Conclusions p1 q1 p2 a a q2 a N1 Languages, automata, Petri nets Product of Petri nets Projection of Petri nets p1 b a N2 q1 a p2 N1 × N2 b q2 9 / 16 Introduction From automata to Petri nets Experimental results Conclusions N ΠΣ ( ): a two step procedure 1 2 Languages, automata, Petri nets Product of Petri nets Projection of Petri nets silent transitions Replace the transitions with label not in Σ by Remove silent transitions (optimisation purpose) 10 / 16 Introduction From automata to Petri nets Experimental results Conclusions N ΠΣ ( ): a two step procedure 1 2 Languages, automata, Petri nets Product of Petri nets Projection of Petri nets silent transitions Replace the transitions with label not in Σ by Remove silent transitions (optimisation purpose) How to remove silent transitions Use the reachability graph: no more concurrency Preservation of concurrency: for restricted class of nets only [Wimmel 04] Transition contraction: ecient in practice [André 82] [Vogler and Kangsah 07] 10 / 16 Introduction Languages, automata, Petri nets From automata to Petri nets Product of Petri nets Experimental results Projection of Petri nets Conclusions t Contraction of a silent transition , only when p1 q1 ( 1, b ε p2 p p2 ) q2 t ∩ t• = ∅ • q p2) ( 2, b p q1) ( 1, q q1) ( 2, 11 / 16 Introduction Languages, automata, Petri nets From automata to Petri nets Product of Petri nets Experimental results Projection of Petri nets Conclusions t Contraction of a silent transition , only when p1 q1 ( 1, b ε p2 p p2 ) t ∩ t• = ∅ • q2 q p2) ( 2, b p q1) q q1) ( 1, Language and safeness preserving contraction of ( 2, t t = 1, t = {t } and M p) = 0 with t • = {p} or |•t | = 1, •(t • ) = {t } and ∀p ∈ t • , M 0 (p ) = 0 or |•t | = 1 and (•t )• = {t } | •| •( • ) 0( 11 / 16 Introduction From automata to Petri nets Experimental results Conclusions Experimental setting Negative results Positive results Benchmark selection From Corbett96 Scale well (number of components vs. size of components) Tree shape (manually obtained) Benchmark set Dining philosophers Dining philosophers with a dictionary Divide and conquer Milner's cyclic scheduler Token-ring mutual exclusion protocol What we compare Times spent to compute updated automata/Petri nets 12 / 16 Introduction Experimental setting From automata to Petri nets Negative results Experimental results Positive results Conclusions Divide and conquer Dining philosophers 10000 Automata Petri nets 1000 1000 100 100 time (s) time (s) 10000 10 Automata Petri nets 10 1 1 0.1 0.1 0.01 0.01 20 40 60 80 100 120 140 number of tasks 160 180 200 20 40 60 80 100 120 140 number of philosophers 160 180 200 13 / 16 Introduction Experimental setting From automata to Petri nets Negative results Experimental results Positive results Conclusions Token-ring mutual exclusion protocol 10000 Automata Petri nets 1000 1000 100 100 time (s) time (s) 10000 10 10 1 1 0.1 0.1 0.01 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 number of users Petri nets 0.01 20 40 60 80 100 120 140 number of users 160 180 200 14 / 16 Introduction Experimental setting From automata to Petri nets Negative results Experimental results Positive results Conclusions Dining philosophers with a dictionary 10000 Automata Petri nets 1000 1000 100 100 time (s) time (s) 10000 10 10 1 1 0.1 0.1 0.01 3 4 5 6 7 0.01 8 9 10 11 12 13 14 15 16 17 18 19 number of philosophers Petri nets 20 40 60 80 100 120 140 number of philosophers 160 180 200 180 200 Milner's cyclic scheduler 10000 Automata Petri nets 1000 1000 100 100 time (s) time (s) 10000 10 10 1 1 0.1 0.1 0.01 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 number of schedulers Petri nets 0.01 20 40 60 80 100 120 140 number of schedulers 160 15 / 16 Introduction From automata to Petri nets Experimental results Conclusions Contribution Networks of automata ⇒ networks of Petri nets for planning Experimental comparison: Petri nets can bring an important eciency gain by handling local concurrency Extension to weighted systems (in the paper) 16 / 16 Introduction From automata to Petri nets Experimental results Conclusions Contribution Networks of automata ⇒ networks of Petri nets for planning Experimental comparison: Petri nets can bring an important eciency gain by handling local concurrency Extension to weighted systems (in the paper) Possible future work Compare transition contraction without and with weights Relax the conditions for transition contraction with weights 16 / 16