Decidability and complexity issues for subclasses of counter systems Lecture 2 E XP S PACE -hardness results for VASS Introduction to reversal-bounded CA St´ ephane Demri demri@lsv.ens-cachan.fr LSV, ENS Cachan, CNRS, INRIA Course 2.9 – MPRI – 2010/2011 “Verification of parametrized and dynamic systems”
Plan of the lecture • Previous lecture: VASS, VAS and the E XP S PACE upper bound for the covering problem (Rackoff’s proof). • Today’s lecture: • E XP S PACE -hardness of decision problems for VASS. • Introduction to reversal-bounded counter automata. • Exercises. 2
E XP S PACE -hardness 3
E XP S PACE -hard problems on VASS • Boundedness problem, covering problem, control state reachability problem. • Reduction from the halting problem for 2 2 nK -bounded counter automata to control state reachability problem. • Presentation mainly due to [Esparza, APN 98] from a result first shown in [Lipton, TR 76]. • Other problems can be shown E XP S PACE -hard with slight variations: e.g., reachability problem for VASS. • E XP S PACE -hardness is preserved for the reachability problem for reversible Petri nets. See e.g. [Cardoza & Lipton & Meyer, STOC’76] In a way, this is the best known lower bound. 4
Main steps of the E XP S PACE -hardness proof • Step I: From exponential-space Turing machines to 2 2 nK -bounded counter automata. (standard in computability theory). • Step II: From 2 2 n -bounded counter automata to recursive VASS (main technical part of the lecture). • Step III: From recursive VASS to VASS. • Recursive VASS is an intermediate model (a slight variant of VASS) that simplifies the presentation of the reduction. 5
From E XP S PACE TM to 2 2 nK -bounded CA • Nondeterministic Turing machine M = ( Q , q 0 , Σ , δ, q a ) : • Q : set of control states. • q 0 : initial state; q a : accepting state. • Σ : set of tape symbols (including a blank symbol or an end symbol). moves � �� � • Transition relation δ : Q × Σ → P ( Q × {− 1 , 0 , 1 } × Σ) . • Wlog, we can assume that TM start with an “empty” tape. • Halting problem for Turing machines is undecidable. [Turing, 1936] • Standard counter automaton ( Q , n , δ ) : transitions are of inc ( i ) dec ( i ) zero ( i ) the form either q → q ′ or q → q ′ or q → q ′ . − − − − − − − 6
Simulating a Turing machine (ideas only) • A Turing machine can be simulated by two stacks: the tape is cut in half. • E.g., moving the head left or right is equivalent to popping a bit from one stack and pushing it onto the other • A stack over a binary alphabet can be simulated by two counters. One counter contains the binary representation of the bits on the stack. • E.g., pushing a one is equivalent to doubling and adding 1, assuming that in the binary representation the least significant bit is on the top. • A stack over a binary alphabet of size bounded by 2 N K can be simulated by two 2 2 NK ′ -bounded counters. 7
Summary on simulations • 1-tape TM can be simulated by two stacks in real-time and linear space. • 1-stack can be simulated by two counters in space k · 2 k · n . See overview in [van Emde Boas, Hanbdook TCS 1990] • Consequently, 1-tape TM in space K 2 n K can be simulated by 4 counters with values bounded by 2 2 nK ′ . • Two counters suffice to simulate a TM (at the cost of one more exponential in space) [Minsky, 67]. • We show how to simulate a 2 2 n -bounded CA by a VASS (using a reduction that is polynomial in n ) – Step II. • Consequently, control state reachability problem for VASS is E XP S PACE -hard. 8
Intermediate model: recursive VASS • Recursive VASS is a sequence of labelled commands l: inc ( i ) l: dec ( i ) l: goto l 1 (unconditional jump) l: goto l 1 or goto l 2 (nondeterministic call) l: gosub l 1 (subroutine call) l: return (end of subroutine) l: halt • Recursive VASS are similar to deterministic counter automata except that • there are no zero-tests, • nondeterministic branching is possible, • there is possibility to transfer control to subroutine. • Recursive VASS is hierarchical: • it can be decomposed into a main program that only calls first-level subroutines, • subroutines of level i can only call subroutines of level i + 1. 9
Runs for recursive VASS 1: gosub 4; 2: gosub 4; 3: halt; 4: goto 5 or goto 6; 5: return; 6: return. gosub 4 goto 5 or goto 6 return gosub 4 goto 5 or goto 6 return 1 − − − − → 4 − − − − − − − − − → 5 − − → 2 − − − − → 4 − − − − − − − − − → 6 − − → 3 • Vectors of counter values are added too. • 1,2 and 3 in main program; 4,5 and 6 in subroutine (level 1). 10
From recursive VASS to VASS (“step III”) • Recursive VASS with n counters and N control states reduced to a VASS with O ( n + N ) counters, O ( N ) control states and updates are reduced to inc ( · ) and dec ( · ) . • All commands except subroutine calls and ends of subroutine have obvious translations. inc ( i new ) dec ( i new ) • We use q − → q ′ as a shortcut for q → q ′ where − − − − → · − − − − i new is a dummy counter used for this purpose. • Indeed, the number of new counters is bounded by twice the number of gosub instructions. 11
Two counters to encode subroutine call “ l : gosub l ′ ” • Counter i l equal to zero by default, but equal to 2 when entering in the subroutine at l ′ . • End of subroutine decrements counter i l (to distinguish distinct subroutine calls to l ′ ). • Counter i ′ l equal to one by default, but decremented to zero when entering in the subroutine at l ′ (no way to enter again to subroutine at l ′ before executing next command). • Executing the command after the command l , decrement counter i l and increment i ′ l . 12
Principles for encoding subroutine calls 1: gosub 4; 2: gosub 4; 3: halt; 4: goto 5 or goto 6; 5: return; 6: return. dec ( i 1 ); inc ( i ′ dec ( i 2 ); inc ( i ′ 1 ) 2 ) 1 2 3 inc ( i 1 ); inc ( i 1 ); dec ( i ′ 1 ) inc ( i 2 ); inc ( i 2 ); dec ( i ′ 2 ) dec ( i 1 ) dec ( i 2 ) dec ( i 2 ) 4 dec ( i 1 ) 5 6 13
Logspace reductions • Halting problem for recursive VASS reduces to control state reachability problem for VASS. • Reachability problem for recursive VASS reduces to reachability problem for VASS. • Boundedness problem for recursive VASS reduces to boundedness problem for VASS. • As an exercise, show these properties when the final commands are in the main program. 14
Comparison with sequential recursive Petri nets • See e.g. [Haddad & Poitrenaud, Acta Inf. 07]. • Some common features: 1 Subroutine calls. 2 Reachability problem can be reduced to instances of reachability for VASS. 3 Reachability problem for SRPN is decidable too ! • Some differences: 1 Each subroutine call starts a new copy of the system with a fixed initial configuration. 2 Ends of subroutine happen when the current configuration belongs to a semilinear set. 3 No sharing of counter values. 15
Step II: from 2 2 N -bounded counter automata to recursive VASS • 2 2 N -bounded deterministic CA S = ( Q , n , δ ) with |S| in O ( N ) . • Deterministic CA: q 1 dec ( i ) inc ( i ) q h q q q ′ or or q 2 zero ( i ) x ∈ N n such that ( q 0 ,� 0 ) ∗ → ( q h ,� x ) ? • Is there � − • S shall be simulated by a recursive VASS V with O ( N ) commands and O ( n + N ) counters. • Simulation is based on the following equivalence: • S halts, i.e. the unique run reaches q h , • there is a run of V from � 0 reaching q h . (i.e., V is nondeterministic) 16
Preliminary remarks • S has zero-tests whereas the target recursive VASS V has no zero-tests. • The control states in Q (from S ) are also commands of V but intermediate commands are introduced to simulate zero-tests and to initialize the counters. • Maintenance of constraints of the form ( j ∈ [ 0 , N ] ): x + x = 2 2 j for complement counters x and x. 17
Principles of the simulation • Each counter i in S is represented by two counters, say i and the complement counter i such that their sum is maintained equal to 2 2 N . • Increment on counter i is simulated by incrementing counter i followed by decrementing counter i . (So, counter i never exceeds 2 2 N .) • Decrement on counter i is simulated by decrementing counter i followed by incrementing counter i . • Zero-test on counter i is simulated by decrementing i by 2 2 N and then incrementing by 2 2 N (to restore the value). 18
Counting until a double-exponential value • If j th counter can count until K , then the ( j + 1 ) th counter can count until K 2 by using concentric loops. • O ( N ) counters allow to count until K 2 N . • Auxiliary counters with values 2 2 α with α ≤ N are needed and initialized by using concentric loops with 2 2 α − 1 × 2 2 α − 1 = 2 2 α (details will follow) 19
Recommend
More recommend