reversal bounded counter machines part 2
play

Reversal-Bounded Counter Machines (part 2) St ephane Demri - PowerPoint PPT Presentation

Reversal-Bounded Counter Machines (part 2) St ephane Demri (demri@lsv.fr) November 6th, 2015 Slides and lecture notes http://www.lsv.fr/demri/notes-de-cours.html https://wikimpri.dptinfo.ens-cachan.fr/doku. php?id=cours:c-2-9-1 Plan of


  1. Reversal-Bounded Counter Machines (part 2) St´ ephane Demri (demri@lsv.fr) November 6th, 2015

  2. Slides and lecture notes http://www.lsv.fr/˜demri/notes-de-cours.html https://wikimpri.dptinfo.ens-cachan.fr/doku. php?id=cours:c-2-9-1

  3. Plan of the lecture ◮ Previous lecture: ◮ The Presburger sets and the semilinear sets coincide. ◮ Application: Parikh image of regular languages. ◮ Introduction to reversal-bounded counter machines. ◮ Runs in normal form. ◮ Reachability sets are computable Presburger sets. ◮ Decidable and undecidable extensions. ◮ Repeated reachability problems.

  4. The previous lecture in 4 slides (1/4) ◮ A linear set X is defined by a basis b ∈ N d and by P = { p 1 , . . . , p m } ⊆ N d : m � X = { b + λ i p i : λ 1 , . . . , λ m ∈ N } i = 1 ◮ Semilinear sets are finite unions of linear sets. ◮ Semilinear sets and Presburger sets coincide. ◮ { n 2 | n ∈ N } and { 2 n | n ∈ N } are not Presburger sets. ◮ Simple vector addition systems with states (VASS) have reachability sets that are not Presburger sets.

  5. The previous lecture in 4 slides (2/4) � 3 � ◮ Parikh image of a b a a b is . 2 ◮ L ⊆ Σ ∗ is bounded and regular iff it is a finite union of languages of the form u 0 v ∗ 1 u 1 · · · v ∗ k u k ◮ The Parikh images of bounded and regular languages are Presburger sets. ◮ For every regular language L , there is a bounded and regular language L ′ such that 1. L ′ ⊆ L , 2. Π( L ′ ) = Π( L ) .

  6. The previous lecture in 4 slides (3/4) x-- q 2 x = 0 ? x-- q 1 q 3 x++ � q 1 , 0 � � q 1 , 1 � � q 1 , 2 � � q 1 , 3 � � q 1 , 4 � � q 2 , 0 � � q 2 , 1 � � q 2 , 2 � � q 2 , 3 � � q 3 , 0 � ◮ Reversal: Alternation from nonincreasing mode to nondecreasing mode and vice-versa. ◮ A run is r -reversal-bounded whenever the number of reversals of each counter is less or equal to r .

  7. The previous lecture in 4 slides (4/4) ◮ Notion of extended path for which no reversal occurs and satisfaction of the guards remains constant. π 0 S 1 π 1 · · · S α π α ◮ Runs in normal form. ◮ I.e., any finite r -reversal-bounded run can be generated by a small sequence of small such extended paths.

  8. Guards and intervals ◮ Transition labelled by � g , a � with a ∈ Z d and g is a guard: g ::= ⊤ | ⊥ | x ∼ k | g ∧ g | g ∨ g | ¬ g where ∼∈ {≤ , ≥ , = } and k ∈ N . ◮ Linear ordering on I (for non-empty intervals): [ k 1 , k 1 ] ≤ [ k 1 + 1 , k 2 − 1 ] ≤ [ k 2 , k 2 ] ≤ [ k 2 + 1 , k 3 − 1 ] ≤ [ k 2 , k 2 ] ≤ . . . . . . ≤ [ k K , k K ] ≤ [ k K + 1 , + ∞ ) } ◮ Interval map im : C → I and symbolic satisfaction relation im ⊢ g . ◮ Guarded mode gmd = � im , md � where im is an interval map and md ∈ { INC , DEC } d .

  9. Small extended path compatible with gmd ◮ Extended path P : π 0 S 1 π 1 · · · S α π α ◮ Small extended path: 1. π 0 and π α have at most 2 × card ( Q ) transitions, 2. π 1 , . . . , π α − 1 have at most card ( Q ) transitions, 3. for each q ∈ Q , there is at most one set S containing simple loops on q . � g , a � → q ′ : ◮ For every transition t = q − − 1. im ⊢ g , 2. for every i ∈ [ 1 , d ] , ◮ md ( i ) = INC implies a ( i ) ≥ 0, ◮ md ( i ) = DEC implies a ( i ) ≤ 0.

  10. Normal forms ◮ r -reversal-bounded run ρ = � q 0 , x 0 � · · · � q ℓ , x ℓ � . ◮ ρ can be divided as a sequence ρ = ρ 1 · ρ 2 · · · ρ L ′ such that ◮ each ρ i respects a small extended path P i compatible with some guarded mode gmd i . ◮ L ′ ≤ (( d × r ) + 1 ) × 2 Kd .

  11. Reachability Sets are Presburger Sets

  12. ◮ Small extended path P compatible with gmd = � im , md � 1 , . . . , sl n 1 π 0 { sl 1 1 } π 1 · · · { sl 1 α , . . . , sl n α α } π α where q 0 is the first control state in π 0 and q f is the last control state in π α ( = π ′ α · t ). ◮ There is ϕ ( x , y ) of exponential size in |M| such that � ϕ � = {� x 0 , y � : there is a run � q 0 , x 0 � ∗ − → � q f , y � respecting P } ◮ ϕ states the following properties: 1. x 0 belong to the right intervals induced by im , 2. the counter values for the penultimate configuration � q ′ f , y ′ � belong to the right intervals induced by im , 3. the values for ¯ y are obtained from ¯ x by considering the effects of the paths π i plus a finite amount of times the effects of each simple loop occurring in P .

  13. Arghhhh !!!!! ∃ z 1 1 , . . . , z n 1 1 , . . . , z 1 α , . . . , z n α α ( z 1 1 ≥ 1 ) ∧ · · · ∧ ( z n 1 1 ≥ 1 ) ∧ · · · ∧ ( z 1 α ≥ 1 ) ∧ · · · ∧ ( z n α α ≥ 1 ) ∧ � z j i ef ( sl j (¯ y = ¯ x + ef ( π 0 ) + · · · + ef ( π α ) + i )) ∧ i , j � � ( x c ∼ k ) ∧ ( ¬ ( x c ∼ k )) ∧ im ⊢ x c ∼ k not im ⊢ x c ∼ k � ( ( x j ∈ im ( x j ) ∧ ( y j ∈ im ( x j ))) ∧ j ∈ [ 1 , d ] � � z j i ef ( sl j ( x c + ef ( π 0 )( c )+ · · · + ef ( π α − 1 )( c )+ ef ( π ′ ( α )( c )+ i )( c )) ∼ k ) ∧ im ⊢ x c ∼ k i , j � � z j i ef ( sl j ¬ ( x c + ef ( π 0 )( c )+ · · · + ef ( π α − 1 )( c )+ ef ( π ′ ( α )( c )+ i )( c ) ∼ k )) not im ⊢ x c ∼ k i , j ‘z j ∈ [ l , l ′ ] ’ stands for l ≤ z j ∧ z j ≤ l ′ and z j ∈ [ k K + 1 , + ∞ ) stands for k K + 1 ≤ z j .

  14. One more step ◮ Sequence of small extended paths P 1 · · · P L ′ . ◮ There is ϕ (¯ x , ¯ y ) such that � ϕ � = {� x , y � : there is a run � q 0 , x � ∗ − → � q f , y � respecting P 1 · · · P L ′ } ◮ ϕ i (¯ x , ¯ y ) for each P i . ∃ ¯ z 0 , . . . , ¯ z L ′ (¯ x = ¯ z 0 ) ∧ (¯ y = ¯ z L ′ ) ∧ ϕ 1 ( ¯ z 0 , ¯ z 1 ) ∧ ϕ 2 ( ¯ z 1 , ¯ ¯ ¯ z L ′ − 1 , ¯ ¯ z 2 ) ∧ · · · ϕ L ′ − 1 ( z L ′ − 2 , z L ′ − 1 ) ∧ ϕ L ′ ( z L ′ ) .

  15. ◮ r -reversal-bounded �M , � q , x �� that is for some r ≥ 0. ◮ For each q ′ ∈ Q , the set { y ∈ N d : � q , x � ∗ → � q ′ , y �} − is a computable Presburger set. ◮ Formula ϕ (¯ y ) : � � ∃ x ( x ( i ) = x i ) ∧ ϕ σ (¯ x , ¯ y ) i ∈ [ 1 , d ] small seq . σ = P 1 ··· P L ′ ending by q ′ ◮ Assuming that M is uniformly r -reversal-bounded for some r ≥ 0. For all q , q ′ , one can compute ϕ (¯ x , ¯ y ) such that � ϕ � = {� x , y � ∈ N 2 d : � q , x � ∗ → � q ′ , y �} −

  16. Time to reap the rewards! ◮ Reachability problem with bounded number of reversals. Input: a CM M , r ∈ N , � q 0 , x 0 � and � q f , x f � . Question: Is there a run from � q 0 , x 0 � to � q f , x f � such that each counter has at most r reversals? ◮ When �M , � q 0 , x 0 �� is r ′ -reversal-bounded for some r ′ ≤ r , we get an instance of the reachability problem with initial configuration � q 0 , x 0 � . ◮ The reachability problem with bounded number of reversals is decidable. ◮ Next, a proof that abstracts away from small sequences of small extended paths (but still these are implicitly used).

  17. Proof (1/3) ◮ M = � Q , T , C � , r ∈ N , � q 0 , x 0 � and � q f , x f � . ◮ M ′ = � Q ′ , T ′ , C � with Q ′ = Q × { DEC , INC } d × [ 0 , r ] d ◮ New control states record the type of phase and the current number of reversals (with a bound on r ). ◮ By construction, �M ′ , �� q 0 , INC , 0 � , x 0 �� is r -reversal-bounded.

  18. Proof (2/3) � g , a � � g , a � → q ′ ∈ T and → � q ′ , md ′ , ♯ alt ′ � ∈ T ′ def ◮ � q , md , ♯ alt � − − ⇔ q − − ♯ alt ′ ( i ) md ′ ( i ) md ( i ) a a ( i ) < 0 ♯ alt ( i ) DEC DEC a ( i ) < 0 ♯ alt ( i ) + 1 and ♯ alt ( i ) < r INC DEC a ( i ) > 0 ♯ alt ( i ) INC INC a ( i ) > 0 ♯ alt ( i ) + 1 and ♯ alt ( i ) < r DEC INC a ( i ) = 0 DEC DEC ♯ alt ( i ) a ( i ) = 0 INC INC ♯ alt ( i ) ◮ Equivalence between: ◮ there is a run of M from � q 0 , x 0 � to � q f , x f � such that each counter has at most r reversals, ◮ �� q f , md , ♯ alt � , x f � is reachable from �� q 0 , INC , 0 � , x 0 � in M ′ for some md , ♯ alt .

  19. Proof (3/3) ◮ The number of distinct pairs � md , ♯ alt � is bounded by 2 d × ( r + 1 ) d . ◮ We have seen that X � md ,♯ alt � = { x ′ ∈ N d : �� q 0 , INC , 0 � , x 0 � ∗ → �� q f , md , ♯ alt � , x ′ �} − is a computable Presburger set. ◮ x ∈ X � md ,♯ alt � amounts to check the satisfiability status of d � ( x i = x ( i )) ∧ ϕ � md ,♯ alt � . i = 1 ◮ It amounts to checking satisfiability of a a disjunctive formula with at most 2 d ( r + 1 ) d disjuncts.

  20. Complexity ◮ The reachability problem with bounded number of reversals is NP-complete, assuming that all the natural numbers are encoded in binary except the number of reversals. ◮ The problem is NE XP T IME -complete assuming that all the natural numbers are encoded in binary. [Gurari & Ibarra, ICALP’81; Howell & Rosier, JCSS 87] ◮ NE XP T IME -hardness as a consequence of the standard simulation of Turing machines. [Minsky, 67]

Recommend


More recommend