180 likes | 294 Views
The Language Theory of Bounded Context-Switching. Gennaro Parlato (U. of Illinois, U.S.A.) Joint work with: Salvatore La Torre (U. of Salerno, Italy) P. Madhusudan (U. of Illinois, U.S.A.). What is this talk about?.
E N D
The Language Theory of Bounded Context-Switching Gennaro Parlato (U. of Illinois, U.S.A.) Joint work with: Salvatore La Torre (U. of Salerno, Italy) P. Madhusudan (U. of Illinois, U.S.A.)
What is this talk about? • Our work is motivated by the verification of concurrent programs with recursive procedures communicating through shared variables • Reachability/Emptiness is undecidable for such programs • Restricted reachability has gained a lot of attention in the literature for programs with variable ranging over finite domain • Reachability within a fixed number of context-switches is decidable • Many errors manifest themselves within few context-switches • We undertake a language- and automata-theoretic study of concurrent programs under bounded context-switches • Multi-stack Pushdown Automata are a natural model for such programs
Multi-stack Visibly Pushdown Automata (MVPAs) VISIBLE ALPHABET Each stack has its own alphabet - Pushi, Popi, Inti (disjoint sets) • ∑ i = (Pushi UPopi UInti) is the alphabet of stack i • Symbols describe the behavior of the automaton • ∑ i and ∑ j are pairwise disjoint for ij • ∑ = ∑ 1U∑ 2 U … U ∑ n is the input alphabet Finite Control … • Finite number of states • - including an initial state & set of final states • Moves only the symbol a • - Internal move for stack i if aInti • - Push move onto stack i if aPushi • Pop move from stack i if aPopi • The symbol of ∑ determines the kind of move to make stack-1 stack-2 stack-n
Bounded round executions • We consider only executions going through k rounds • A round is a word in the language Round = ∑ 1+. ∑ 2+. … ∑ n+ • Roundkis the set of all k-round words • A k-round word can be seen as a matrix • A row is a round • The concatenation of the word on column i is the stack i projection of the input word w round 1w11w12w13 … w1n round 2w21w22w23 … w2n … … … … … round kwk1wk2 wk3 … wkn w= w11w12w13 … w1n w21w22w23 …w2n …. wk1wk2 wk3 … wkn
q’1n q’11 q’12 q’2n q’22 q’21 q1n q12 q’32 q’31 q’3n q22 q2n q32 q3n q’k2 q’k1 q’kn qkn qk2 A k-round execution can be seen as w1n round 1 w11 w12 q11 w2n round 2 w21 w22 q21 w3n round 3 w31 w32 q31 wkn round k wk1 wk2 qk1 stack 1 stack 2 stack n
Example: a language recognized by a 2-round MVPA • L= { ai xj bi yj | i,j > 0 } • Push $ onto stack 1 reading a • Push @ onto stack 2 reading x • Pop $ form stack 1 reading b • Pop @ from stack2 reading y (The first symbol pushed onto each stack is encoded differently to check later whether the stack is empty) • L can be accepted by a 2-round MVPA • L is not context-free language • All recognized languages are context-sensitive (La Torre, Madhusudan, Parlato, LICS’07)
Bounded-round MVPLs Class of languages accepted by bounded-round MVPAs • A sub-class of context-sensitive languages • Visibily implies closure under • Union • Intersection • Nondeterministic and deterministic versions are equivalent • Closed under complement (through Determinizability) • Decidable Emptiness and Membership problems • Universality and inclusion problems are decidable • closure under Boolean operations • decidability of the emptiness problem
Related Work • Visibly pushdown automata (Alur, Madhusudan, STOC’04) • Bounded-phase multi-stack visibly push-down automata (not determinizable) (La Torre, Madhusudan, Parlato, LICS’07) • Visibly ordered pushdown automata (NOT determinizable, wrong determinizability proof is given) (Carotenuto, Murano, Peron, DLT’07)
Determinization (main technical result)
Deterministic bounded-round VMPAs • A VMPA is deterministic if • for any state, and • for any input symbol at most one move is allowed • Bounded-round VMPAs are determinizable: If A is a k-round MVPA, then there exists a k-round MVPA ADsuch that L(A)=L(AD) • Boundedness of the number of rounds is crucial for our proof • The class of MVPAs is not closed under determinization (La Torre, Madhusudan, Parlato, LICS’07) • Determinization construction …
q’12 q’11 q’1n q’21 q’22 q’2n q1n q12 q’32 q’31 q’3n q22 q2n q3n q32 q’k1 q’kn q’k2 qkn qk2 A run can be seen as … w1n round 1 w11 w12 q11 w2n round 2 w21 w22 q21 w3n round 3 w31 w32 q31 … … … … … … wkn round k wk1 wk2 qk1 stack 1 stack 2 stack n
q’1i q’2ii q1i q’3i q2i q3i q’ki qki Interfaces • An interface of stack i Is definded • w.r.t. a word of stack i • w1i #w2i #w3i# … #wki • (# represents a context-switch) • It corresponds to the pair (INi, OUTi) where • Ini = ( q1j, q2j, q3j, … qkj ) • OUTi = ( q’1j, q’2j, q’3j, … q’kj ) • Interfaces of stack i can be computed by a • non deterministic VPA Ai • STATES: (q, Interface, round) • q is any A state • Interface is an encoding of the interface • computed until now • round tracks the round under simulation • MOVES: • All A’s moves on stack i symbols • internal moves on the fresh symbol # • -update q with any q’(guess the state at next round) • -update Interface storing q and q’ • -increment round round 1 w1j round 2 w2j round 3 w3j … … … … round k wkj INi OUTi
q’12 q’11 q’1n q’21 q’22 q’2n q1n q12 q’32 q’31 q’3n q22 q2n q3n q32 q’k1 q’kn q’k2 qkn qk2 Why consider interfaces Theorem (accepting condition): A k-round word w is accepted by A iff there is an interface Inti, one for each stack i on the word wi, such that • Int1composesInt2composes … composesIntn • Intnwraps Int1 • q11 is the initial state & q’kn is a final state w1n round 1 w11 w12 q11 w2n round 2 w21 w22 q21 w3n round 3 w31 w32 q31 … … … … … … wkn round k wk1 wk2 qk1 stack 1 stack 2 stack n
Construction of a deterministic MVPA AD • Ai can be determinized (AiD) (Alur, Madhusudan, STOC’04) • Every AiD state encodes the set of all possible interfaces on any k-round word wi (wi is the subword of w composed only by symbols of stack i) • The deterministic automaton ADsimulates in parallel all the AiD independently, switching from one to another reading the input word • It does not care if interfaces compose/wrap • Composition and wrapping is checked only at the end of the computation for acceptance (see accepting condition)
q’12 q’11 q’1n q’21 q’22 q’2n q1n q12 q’32 q’31 q’3n q22 q2n q3n q32 q’k1 q’kn q’k2 qkn qk2 Idea of the simulation • Reading a symbol of wij, except the first one, simulate AjD • Reading the first symbol of wij, simulate in parallel (# is not in ∑) • Aj-1D on the symbol #, and • AjD on the first symbol of wij AD is deterministic w1n round 1 w11 w12 q11 w2n round 2 w21 w22 q21 w3n round 3 w31 w32 q31 … … … … … … wkn round k wk1 wk2 qk1 stack 1 stack 2 stack n
… going back to the construction of AD • Ai can be determinized (AiD) (Alur, Madhusudan, STOC’04) • Every AiD state encodes the set of all possible interfaces on the k-round word wi • The deterministic automaton ADsimulates in parallel all the AiD switching from one AiD to another reading the input word • After reading w every AiD has computed the set of all possible interfaces on wi • Final states: AD accepts a word w iff there is a set of interfaces, one for each stack, that satisfy the accepting condition
Conclusion • We have defined a robust sub-class of context-sensitive languages • Determinazable • (we conjecture that finding a larger class in terms of patterns is unlikely) • Closed under all Boolean operations • Decidable emptiness, universality and inclusion problems • MSO characterization, Parikh theorem (La Torre, Madhusudan, Parlato, LICS’07) • Same results if we consider bounded context-switch words instead of bounded round words