Presentation is loading. Please wait.

Presentation is loading. Please wait.

Scope-Bounded Pushdown Languages Salvatore La Torre Università degli Studi di Salerno joint work with Margherita Napoli Università degli Studi di Salerno.

Similar presentations


Presentation on theme: "Scope-Bounded Pushdown Languages Salvatore La Torre Università degli Studi di Salerno joint work with Margherita Napoli Università degli Studi di Salerno."— Presentation transcript:

1 Scope-Bounded Pushdown Languages Salvatore La Torre Università degli Studi di Salerno joint work with Margherita Napoli Università degli Studi di Salerno Gennaro Parlato University of Southampton

2 Multi-stack Pushdown Automata (MPA) n stacks sharing a finite control – states: s,,,..........., – transitions : push one symbol onto stack i pop one symbol from stack i internal move: stacks stay unchanged, only control location is altered input is from a one-way read-only tape model of concurrency – captures the control flow of concurrent programs with shared memory and recursive procedure calls 1 2 n

3 Visible alphabets Alphabet is partitioned into: – calls (cause a push operation) – returns (cause a pop operation) – internals (stacks are not used) For n > 1 stacks, alphabet is also partitioned according to stacks – the stack to operate is uniquely identified by the input symbol (it is visible in the input)

4 What visibility gains for MPA? Stack usage is synchronized with the input – parallel simulation of multiple runs, cross product construction, subset-like constructions 1-stack (VPL): – intersection and determinization – universality, inclusion and equality n-stacks (MVPL): – just intersection – emptiness is undecidable: the runs of MPA are visible! – checking for emptiness of MVPL equals to decide reachability for MPA

5 Theme of the talk The formal language theory of visibly n- stack languages of k-scoped words (S MVPL ) Visible alphabet (retns) --st1: a, a’ st2: b, b’ internal: e a e b a a’ a’ b a b’ e b’ a’ scope of matching relation over S: max number of S-contexts between matching call/retn – scope is 2 for GREEN and 3 for RED matching relation (matching call/retn) word is 3-scoped

6 A few observations.... Interest for restrictions of MPA mainly comes from verification – bugs of concurrent programs are likely to occur within few context-switches [Musuvathi-Qadeer, PLDI ‘07] – efficient sequentializations of multithreaded programs [Lal-Reps,CAV’08] Robust automata theories are useful tools for other domains – Automata-theoretic approach to verification (model- checking) – Pattern matching problems – … K-scoped visibly languages indeed form a robust class…

7 k-scoped MVPA Closure under Boolean operations Det./nondet. models are equivalent Decidable emptiness [La Torre-Napoli, CONCUR’11], inclusion, equality, and universality Logical characterization (MSO with matching relations) Parikh theorem Sequentializable: computations can be simulated with one stack (rearranging order of inputs) Decidable temporal logic model-checking [La Torre-Napoli,TCS’12] [Atig-Bouajjani-Kumar-Saivasan, ATVA’12]

8 More related work Visibly pushdown languages [Alur-Madhusudan J. ACM'09] [Melhorn ICALP'80] Restricted MPAs: Emptiness/reachability/closure properties [Carotenuto et al. DLT’07] [Atig et al. DLT’08] [Seth,CAV’10] [LaTorre et al. LATIN'10] [LaTorre et al. MFCS'14] Model-checking [Atig, FSTTCS’10] [Bollig et al. MFCS’11] [Bollig et al. LICS’13] [Bansal-Demri, CSR’13] MSO of multiply nested words [Madhusudan-Parlato POPL'11] [Cyriac et al. CONCUR'12]............

9 Rest of the talk Determinization construction Brief comparison with the known MPA classes of languages Conclusions

10 MVPL are nondeterministic L = {(ab) i c j d i-j x j y i-j | i,j>0} is inherently nondeterministic for MPA [La Torre-Madhusudan-Parlato, LICS’07] – j is arbitrary and needs to be the same for both stacks – a guess is needed when pushing both stacks L is not S MVPL – For any j, (ab) k c j d k-j x j y k-j is (k+1)-scoped a b a b a b ……… a b c………… d x………… y

11 Determinization of SMPA Summaries of computations for SMPA – Linear interfaces – Switching masks PDA computing linear interfaces – linear interface automaton (LIA) Simulation of SMPA by deterministic composition of deterministic LIAs (using switching masks)

12 View of runs by stacks stack 1 stack 2 stack 3 g1g1 q1q1 q2q2 r1r1 q2q2 q3q3 g2g2 q3q3 q4q4 b1b1 q4q4 q5q5 r2r2 q5q5 q6q6 Input word (contexts) w = g 1 r 1 g 2 b 1 r 2 b 2 r 3 b 3 r 4 g 3 Run (without stacks) q 1 q 2 q 3 q 4 q 5 q 6 q 7 q 8 q 9 q 10 q 11 g3g3 q 10 q 11 r3r3 q7q7 q8q8 r4r4 q9q9 q 10 b2b2 q6q6 q7q7 b3b3 q8q8 q9q9 g1g1 g2g2 g3g3 r1r1 r2r2 r3r3 r4r4 b1b1 b2b2 b3b3

13 b1b1 b2b2 b3b3 r1r1 r2r2 r3r3 r4r4 g3g3 g2g2 g1g1 Linear Interface (LI) stack 1stack 2stack 3 q1q1 q2q2 q2q2 q3q3 q3q3 q4q4 q4q4 q5q5 q5q5 q6q6 q 10 q 11 q7q7 q8q8 q9q9 q6q6 q7q7 q8q8 q9q9 q 10 k-LI for a stack S just summarizes starting and ending control states for k consecutive contexts of S in a run (starting from stack S empty) 3-LI for stack 1 2-LI for stack 2

14 b1b1 b2b2 b3b3 r1r1 r2r2 r3r3 r4r4 g3g3 g2g2 g1g1 Switching Mask (SM) stack 1 stack 2stack 3 q1q1 q2q2 q2q2 q3q3 q3q3 q4q4 q4q4 q5q5 q5q5 q6q6 q 10 q 11 q7q7 q8q8 q9q9 q6q6 q7q7 q8q8 q9q9 q 10 a tuple of LI, one for each stack a function Nxt that links contexts of LI’s Switching mask Nxt function given by purple arrows

15 Control state (h, M) h: current stack M: switching mask Move within a context: just update LI of stack h Es: M: h=3 MPA transition from q 5 to p 5 on stack-3 symbol (h is not changed) Simulating MPA with SMs (1) b1b1 r1r1 g2g2 g1g1 q1q1 q2q2 q2q2 q3q3 q3q3 q4q4 q4q4 q5q5 q1q1 q2q2 q2q2 q3q3 q3q3 q4q4 q4q4 p5p5 q5q5

16 Simulating MPA with SMs (2) Context-switch 1 (accumulated stack content needed): add a new context to an existing LI Es: h=3, and MPA moves from q 5 to p 5 on a stack-2 symbol M: then h=2 and the SM is b1b1 r1r1 g2g2 g1g1 q1q1 q2q2 q2q2 q3q3 q3q3 q4q4 q4q4 q5q5 q1q1 q2q2 q2q2 q3q3 q3q3 q4q4 q4q4 q5q5 q5q5 p5p5

17 Simulating MPA with SMs (3) Context-switch 2 (accumulated stack content no longer needed): start a new LI Es: h=3, and MPS moves from q 5 to p 5 on a stack-2 symbol M: then h=2 and the SM is b1b1 r1r1 g2g2 g1g1 q1q1 q2q2 q2q2 q3q3 q3q3 q4q4 q4q4 q5q5 q1q1 q2q2 q3q3 q4q4 q4q4 q5q5 q5q5 p5p5

18 PDA accumulating LIs Given a PDA P over an alphabet , symbols , #  a k linear interface automaton (k-LIA) for P is a PDA s.t. input is over   { , # } w 11 # w 12 #........# w 1i 1  w 21 # w 22 #........# w 2i 2 .... control states are h-LIs of P for h  k on , simulates P on the last state of the LI on #, a new context is appended to the current LI (provided that it is a h-LI with h  k-1) on , a new LI is started and stack is reset (a bottom-of-the-stack symbol is pushed onto the stack to avoid the use of previously pushed symbols)

19 (  k)-LIs suffice for SMPA Theorem. By restricting to k-scoped inputs, h-LIs with h  k suffice to simulate the behavior of an MPA with switching masks Thus, for each stack of an SMPA, we can restrict to k-LIAs

20 Determinization of SMPA (1) For an SMPA A construct the LIA A h for each stack h construct D h by determinizing each A h as in [Alur-Madhusudan, STOC’04] construct the deterministic SMPA D (equiv. to A) – cross product of the D h ‘s – parallel simulation of A with all the generated SMs (subset construction)

21 Determinization of SMPS (2) a state of D is of the form (h, Q 1,...,Q n,  ) where – h is the current stack – Q 1,...,Q n is a state of the cross product –  is a set of switching masks within a context of stack h, D simulates D h (the Q h –component and all the switching masks in  gets updated accordingly) on context-switching from stack h to stack i (a call/return of stack i is read), D simulates in parallel – D h on either # or  – D i on the input symbol the size of D is exp in the size of A and 2exp in the number of stacks and the bound k

22 Comparisons CSL S MVPL R MVPL [LPM10] P MVPL [LMP07] VPL [AM04] O MVPL [BCCC96] [MCP07] [ABH08] CFL T MVPL [LNP14]

23 Decision Problems VPL CFL R MVPL S MVPL T MVPL P MVPL O MVPL CSL

24 Conclusions S MVPL form a robust theory of visibly languages (the largest among those closed under determinization) Sequentialization is nice for analysis purposes – Computations of MPA can be analyzed via computations of PDA – used in software verification Scope-bounded words meaningfully extends to  – words – Describe infinite on-going interaction among different threads

25 Theory on infinite words? Little it is known on MPS over  –words visibly pushdown Büchi automata [Alur-Madhusudan,J. ACM, 2009] - the model is not determinizable emptiness for k-scoped Büchi MPA is PSPACE- complete [La Torre-Napoli,TCS’12] closure under union and intersection are simple


Download ppt "Scope-Bounded Pushdown Languages Salvatore La Torre Università degli Studi di Salerno joint work with Margherita Napoli Università degli Studi di Salerno."

Similar presentations


Ads by Google