Decidable Problems for Counter Systems Day 3 Vector Addition Systems St´ ephane Demri demri@lsv.ens-cachan.fr LSV, ENS Cachan, CNRS, INRIA ESSLLI 2010, Copenhagen, August 2010
Plan of the talk • Previous lectures: • Classes of counter systems, Presburger arithmetic. • LTL-like dialects for counter systems. • VASS and FO2 over data words • Relationships between VASS, VAS and Petri nets • (Coverability graphs in a nutshell) • Covering problem in E XP S PACE 2
Recapitulation about VASS 0 1 − 1 0 B C B C 0 @ A 0 0 1 0 q 0 q 1 − 1 B C B C 1 @ A 0 0 1 0 0 B C B C 0 0 1 @ A 0 0 1 B C B C − 1 @ A 1 • VASS is a counter system with transitions of the form � b b ∈ Z n , which is a shortcut for q → q ′ with � − � i = x i + � b ( i ) x ′ i ∈ [ 1 , n ] • VAS = VASS with a unique control state. 3
VASS and a Logic on Data Words 4
Data words [Bouyer, IPL 02] • Timed word [Alur & Dill, TCS 94] a b c a a b 0 0 . 3 1 2 . 3 3 . 5 3 . 51 • Runs from counter systems q 0 q 2 q 3 q 2 q 3 q 2 0 0 1 2 3 4 • Integer arrays t [ 0 ] t [ 1 ] t [ 2 ] t [ 3 ] t [ 4 ] t [ 5 ] . . . • Extension to data trees (XML documents with values). 5
Specifying classes of data words • Register automata • Register automata [Kaminski & Francez, TCS 94] • Data automata [Bouyer & Petit & Th´ erien, IC 03] • See the survey [Segoufin, CSL 06] • Class automata [ Boja´ nczyk & Lasota, LICS’10] • First-order languages [Boja´ nczyk et al., LICS 06] • Temporal logics • Real-time logic TPTL [Alur & Henzinger, JACM 94] • LTL with registers [Demri & Lazi´ c & Nowak, TIME 05] • Many other formalisms • Rewriting systems with data [Bouajjani et al., FCT 07] • Hybrid logics [Schwentick & Weber, STACS 07] • . . . 6
First-order logic on data words • Data word: nonempty finite sequence of pairs from Σ × N . • Variable valuation v for a model σ : map from VAR ′ to the positions of σ . • Variables are interpreted as positions. • Formulae of the logic FO Σ ( ∼ , <, + 1 ) ( Σ is a finite alphabet) ϕ ::= a ( x ) | x ∼ y | x < y | x = y + 1 | ¬ ϕ | ϕ ∧ ϕ | ∃ x ϕ • Last position is labelled by the letter a ∈ Σ : ∃ x ( ¬∃ y x < y ) ∧ a ( x ) 7
Data words as first-order structures • Alphabet Σ = { a 1 , . . . , a N } and infinite domain N . • Data word σ = ( a i 1 , d 1 ) · · · ( a i K , d K ) is equivalent to ( { 1 , . . . , K } , <, ∼ , + 1 , P 1 , . . . , P N ) • For j , j ′ ∈ { 1 , . . . , K } , j ∼ j ′ iff d j = d j ′ . • For l ∈ { 1 , . . . , N } , P l def = { j ∈ { 1 , . . . , K } : a i j = a l } . • First-order logic can be naturally interpreted over such structures. 8
Semantics = v a ( x ) Σ( x ) = a def σ | ⇔ def σ | = v x ∼ y ⇔ N ( x ) = N ( y ) def σ | = v x < y ⇔ v ( x ) < v ( y ) def σ | = v x = y + 1 ⇔ v ( x ) = v ( y ) + 1 there is position i s.t. σ | def σ | = v ∃ x ϕ ⇔ = v [ x �→ i ] ϕ. • Satisfiability for FO ( ∼ , <, + 1 ) restricted to three individual variables is undecidable [Boja´ nczyk et al., LICS 06]. 9
Main decidability result • Theorem: Satisfiability problem for FO 2 ( ∼ , <, + 1 ) is decidable. [Boja´ nczyk et al., LICS 06]. • Proof in two steps: • Satisfiability is first reduced to nonemptiness for data automata (not defined in this course). • Nonemptiness for data automata is then reduced to the reachability problem for VASS. • Theorem: There is a polynomial-space reduction from the reachability problem for VASS to finitary satisfiability for FO 2 ( ∼ , <, + 1 ) . 10
Simplifying the instance • Transitions can be restricted to increments or decrements of a single counter. � � • Translation 2 can be encoded by 2 increments of the − 3 first counter followed by 3 decrements of the second counter. • Initial and final configurations have all the counters equal to zero. • ( q 0 , ) and ( q f , ) are reduced to ( q ′ � 2 � � 1 � � 0 � 0 , ) and 1 1 0 ( q ′ � 0 � f , ) by adding the transitions 0 inc ( 1 ) inc ( 1 ) inc ( 2 ) dec ( 1 ) dec ( 2 ) q ′ → q 1 → q 2 → q 0 q f → q 1 → q ′ − − − − − − − − − − f f 0 0 0 • All these reductions require only polynomial space. 11
Fixing a few more things (proof) • Instance: S = ( Q , n , δ ) , ( q i ,� 0 ) , ( q f ,� 0 ) . • Σ = Q ⊎ { inc ( i ) , dec ( i ) : i ∈ [ 1 , n ] } . (below a ∈ { inc ( i ) , dec ( i ) : i ∈ [ 1 , n ] } ) a K − 1 a 0 a 1 • The run ( q 0 , � x 0 ) → ( q 1 , � x 1 ) → ( q K , � x K ) encoded by − → · · · − − − a data word with projection q 0 a 0 q 1 a 1 · · · a K − 1 q K . • Run q 0 q 1 q 2 q 3 q 4 q 5 q 6 � 0 � � 1 � � 2 � � 2 � � 1 � � 0 � � 0 � 0 0 0 1 1 1 0 corresponds to data word q 0 inc ( 1 ) q 1 inc ( 1 ) q 2 inc ( 2 ) q 3 dec ( 1 ) q 4 dec ( 1 ) q 5 dec ( 2 ) q 6 k 1 k 2 k 3 k 1 k 2 k 3 ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ 12
Enforcing the projection on finite Σ • ϕ proj : conjunction of the formulae below. • The first letter is q i : ∃ x ( ¬∃ y y < x ) ∧ q i ( x ) • The last letter is q f : ∃ x ( ¬∃ y x < y ) ∧ q f ( x ) • Sequence of locations/actions respects the control graph: q ( x )) ⇒ (( ¬∃ y x < y ) ∨ � ∀ x ( q ∈ Q ( q ( x ) ∧ ( ∃ y y = x + 1 ∧ a ( y )) ∧ � a q − → q ′ ∈ δ ( ∃ y y = x + 1 ∧ ( ∃ x x = y + 1 ∧ q ′ ( x ))))) • Observe the nice (and standard) recycling of variables. 13
Constraints on data values • To encode counter values, each increment or decrement is attached to a datum. • A desirable data word: q 0 inc ( 1 ) q 1 inc ( 1 ) q 2 inc ( 2 ) q 3 dec ( 1 ) q 4 dec ( 1 ) q 5 dec ( 2 ) q 6 k 1 k 2 k 3 k 1 k 2 k 3 ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ ⋆ • ϕ : conjunction of ϕ proj and formulae below. • For i , j ∈ [ 1 , n ] , there are no two positions labelled by inc ( i ) and inc ( j ) having the same datum: ∀ x y ( x < y ∧ inc ( i )( x ) ∧ inc ( j )( y )) ⇒ ¬ ( x ∼ y ) . (recall that inc ( i ) and dec ( i ) are letters in Σ ) • Idem for dec ( i ) and dec ( j ) : ∀ x y ( x < y ∧ dec ( i )( x ) ∧ dec ( j )( y )) ⇒ ¬ ( x ∼ y ) . 14
Constraints on data values (II) • For i ∈ [ 1 , n ] , for every position labelled by dec ( i ) , there is a past position labelled by inc ( i ) with the same data value: ∀ x dec ( i )( x ) ⇒ ( ∃ y y < x ∧ x ∼ y ∧ inc ( i )( y )) • In the final configuration, any counter value is zero. So, for i ∈ [ 1 , n ] , for every position labelled by inc ( i ) , there is a future position labelled by dec ( i ) with same data value: ∀ x inc ( i )( x ) ⇒ ( ∃ y x < y ∧ x ∼ y ∧ dec ( i )( y )) • One can show ( q f ,� 0 ) is reachable from ( q i ,� 0 ) iff ϕ is satisfiable. 15
Petri nets and VASS 16
A few definitions on Petri nets Petri net N = ( S , T , W , m I ) • finite set of places S , • finite set of transitions T , • weight function W : ( S × T ) ∪ ( T × S ) → N , • initial marking m I : S → N . (marking m : S → N , specifying the nb. of tokens by place) S = { p A , p B , p C , p 1 } p A p B p C W ( p A , t 1 ) = 1 W ( t 1 , p A ) = 0 p 1 17
Reachable markings • Transition t ∈ T is m -enabled, whenever for all places p ∈ S , m ( p ) ≥ W ( p , t ) . • An m -enabled transition t may fire and produce the t marking m ′ , written m → m ′ , with for all places p ∈ S , − m ′ ( p ) = m ( p ) − W ( p , t ) + W ( t , p ) • Marking m ′ is reachable from m whenever there is a sequence of the form t k − 1 t 0 t 1 m 0 → m 1 → m k − − → · · · − t 0 ··· t k − 1 with m 0 = m and m k = m ′ (also written m → m ′ ). − − − − 18
Problems on Petri nets • Reachability problem for Petri nets: Input: a Petri net ( S , T , W , m I ) and a marking m . Question: is m reachable from m I ? • Covering problem for Petri nets: Input: a Petri net ( S , T , W , m I ) and a marking m . Question: is there a marking m ′ reachable from m I such that for all p ∈ S , we have m ′ ( p ) ≥ m ( p ) ? • Boundedness problem for Petri nets: Input: a Petri net ( S , T , W , m I ) . Question: is the set of markings reachable from m I infinite? 19
Questions • Is ( 0 , 0 , 1 , 1000 ) reachable from ( 1 , 0 , 0 , 0 ) (with implicit ordering of the places p A , p B , p C , p 1 ) ? • Is ( 1 , 0 , 1 , 2 ) reachable from ( 1 , 0 , 0 , 0 ) ? • Is the Petri net with initial marking ( 1 , 0 , 0 , 0 ) bounded? • Is there some marking m reachable from ( 1 , 0 , 0 , 0 ) such that ( 1 , 0 , 0 , 1000 ) � m ? p A p B p C p 1 20
From VASS to Petri nets A p A p B p C + 1 0 B − 1 0 C p 1 21
Systematic construction of Petri nets • VASS V = ( Q , n , δ ) + configuration ( q I , � x I ) . • The corresponding Petri net N V : • For q ∈ Q , we introduce a place p q . • For i ∈ [ 1 , n ] , we introduce a place p i . � b → q ′ ∈ δ , we consider a transition t that consumes a • For q − token in p q , produces a token in p q ′ and produces [resp. b ( i ) tokens in the place p i when � b ( i ) ≥ 0 [resp. consumes] � when � b ( i ) < 0]. • Initial marking m I contains one token in the place p q I and for i ∈ [ 1 , n ] , m I ( p i ) = � x I ( i ) . 22
Recommend
More recommend