• No results found

Multi-pushdown systems

N/A
N/A
Protected

Academic year: 2022

Share "Multi-pushdown systems"

Copied!
48
0
0

Loading.... (view fulltext now)

Full text

(1)

Acceleration in multi pushdown systems

(TACAS’16)

Prakash Saivasan

Joint work with

Narayan Kumar K

Mohamed Faouzi Atig

(2)

Verification of concurrent programs with:

Programs with multiple threads Threads can have recursion

Finite data domain Shared memory

Motivation:

(3)

Formal models

Programs Model

Recursive Pushdown Systems

Concurrent

Recursive Multi-pushdown Systems

(4)

Multi-pushdown systems

(5)

Multi pushdown Systems

push1

push2 push3

pop2

State

Stacks Transitions

1 2 3

1 2 3

Stack Alphabets Configuration

1 1 2 3 2 1 2

Turing powerful

(6)

Existing underapproximations

Bounded Context Bounded Phase Ordered MPDS

Bounded Scope

(7)

Bounded context

1 2 3 2 1 2

1

Context is a sequence of operations restricted to a stack

Reachability is NP-Complete

S. Qadeer J. Rehof

(8)

Acceleration

(9)

Multi pushdown system Transitions

M

Set of configurations C

Acceleration problem is to compute

Set of sequences of transitions

{ c 0 | c ! c 0 , c 2 C , 2 ✓ }

(10)

INITIAL SET OF CONFIGURATION

FINITE REPRESENTATION REGULAR/RATIONAL

✓ ✓

ACCELERATED SET

(11)

INITIAL SET OF CONFIGURATION

Stability: Representation of initial configuration and the accelerated set are the same

Stability

(12)

Bounded context analysis as an

acceleration problem

(13)

Multi pushdown system Transitions

M

Set of configurations C

Set of sequences of transitions

✓ = [

i1,··· ,ik2[1..n]

i1

.

i2

. . .

ik

{ c 0 | c ! c, c 2 C , 2 ✓ }

We are interested in the following set

(14)

Accelerated set is also regular Initial configuration

Regular

Bounded context acceleration

[

i1,··· ,ik2[1..n]

i1

.

i2

. . .

ik

(15)

Accelerated set is also rational Initial configuration

Rational

Bounded context acceleration

[

i1,··· ,ik2[1..n]

i1

.

i2

. . .

ik

(16)

Accelerating loop

(17)

Multi pushdown system Transitions

M

Set of configurations C

loop ✓ = { (q, op

1

, q

1

)(q

1

, op

2

, q

2

) · · · (q

m

, op

m

, q) }

{ c 0 | c ! c 0 , c 2 C , 2 ✓ }

(18)

Accelerated set is not regular but rational

Initial configuration Regular

✓ = { (q, op

1

, q

1

)(q

1

, op

2

, q

2

) · · · (q

m

, op

m

, q ) }

(19)

P op

1

P ush

2

P ush

3

Accelerating loop on regular set is not regular

(20)

Accelerating loop on regular set is rational

We will assume that we are given a set of finite state

automata one for each stack recognising the regular set of configurations

B

1

B

2

B

n

(21)

Accelerating loop on regular set is rational We will first examine the effect of a loop

on each stack

1 1 2 3 2 1 2

Stack-1 1 1 1

Stack-2 2 2 2

Stack-3 3

(22)

Accelerating loop on regular set is rational What is the effect of accelerating the loop

repeatedly?

1 1 2 3 2 1 2

Stack-1 1 1 1

Stack-2 2 Stack-3 3

1 2

3

1 2

3

1 1

(23)

Given a loop, its effect can be summarised as two words for each stack

The first word is what is removed from the stack at the end of execution of the loop

The second word is what is appended to the stack at the end of loop execution

1 1 2 3 2 1 2

Stack pop word push word

1

2

3

1 1

2

3

1

(24)

Stack pop push

1 u1 v1

2 u2 v2

3 u3 v3

Accelerating loop on regular set is rational

Acceleration is possible only if pop word is prefix of push word or push word is prefix of pop word.

u1 1 1

v1 1

CANNOT BE ACCELERATED MORE THAN ONCE

Accelerating loop once

amounts to removing pop word and adding push word to the stack, what about

accelerating multiple times?

(25)

Stack pop push 1

2 3

Accelerating loop on regular set is rational

u i < pre v i

v i < pre u i

u i = v i x i , y i = ✏ v i = u i y i , x i = ✏

u

1

v

1

v

2

u

2

u

3

v

3

(26)

Accelerating loop j+1 times

Stack pop push

1 2 3

u

1

x

j1

u 2 x j 2

u

3

x

j3

v

3

y

3j

v

2

y

2j

v

1

y

1j

(27)

Stack pop push

1 u1 v1

2 u2 v2

3 u3 v3

Accelerating loop on regular set is rational

We construct an 2n tape rational automata.

x1 x1

v1 u1

w1

w1 w2 w2 wn wn

y1 x2 y2 xn yn

y1 x2 y2 xn yn

u2 v2 un vn

(28)

x1 x1

v1 u1

w1

w1 w2 w2 wn wn

y1 x2 y2 xn yn

y1 x2 y2 xn yn

u2 v2 un vn

Accelerating loop on regular set is rational

B

1

B

2

B

n

⇥ ⇥ ⇥

(29)

Accelerating loop on rational set is not rational

P op

1

P ush

2

(30)

Constrained simple regular

expression

(31)

PRESBURGER FORMULA

w 1 w

2

· · · · · · w

n

CSRE is given by sequence of words and a

Presburger formula with one free variable per every word.

Constrained Simple Regular Expression (1-dim)

x

1

x

2

x

n

(32)

w 1 w 1 · · · w

2

w

2

· · · w

n

w

n

· · ·

i

n

i

1

i

2

i

1

, i

2

, · · · , i

n

| = (x

1

, · · · , x

n

)

Acceptance in CSRE

(33)

PRESBURGER FORMULA

· · · · · ·

Constrained Simple Regular Expression (m-dim)

· · · · · ·

w

11

w

12

w

1m

w

2m

w

21

w

22

w

n1

w

nm

· · · · · ·

·· · ··

· ··

·

·· ·

x

11

x

12

·· ·

x

21

x

22

x

1n

· · · · · ·

(34)

· · · · · · · · ·

w

11

w

11

w

12

w

12

w

1n

w

1n

i

n1

i

11

i

21

· · · · · · · · ·

i

1m

i

2m

w

mn

w

mn

w

m1

w

m1

i

nm

i

11

, i

21

, · · · , i

n1

, · · · , i

1m

, · · · , i

nm

| =

Acceptance in m-dim CSRE

(35)

Initial configuration CSRE

Accelerated set is also CSRE

STABLE

✓ = { (q, op

1

, q

1

)(q

1

, op

2

, q

2

) · · · (q

m

, op

m

, q ) }

(36)

Some properties of CSRE

CSRE are closed under intersection, union and concatenation Emptiness, membership and inclusion problems

are decidable.

CSRE is closed under left quotient.

(37)

Accelerating loop on CSRE

(38)

Accelerating loop j+1 times

Stack pop word push word

1 2 3

u

1

x

j1

u

2

x

j2

u

3

x

j3

v

3

y

3j

v

2

y

2j

v

1

y

1j

(39)

We first left quotient

u

1

, · · · , u

n

We concatenate

y

1j

, · · · , y

nj

We left quotient

x

j1

, · · · , x

jn

We concatenate

v

1

, · · · , v

n

Presburger formula is used to ensure

concatenation and left quotient is done same number of times

(40)

Context switch set

(41)

Loops are weak, cannot capture bounded context switch

We will introduce notion of context switch set

• ⌧ i

i

Subset of transitions operating on a stack Single transition

Context switch set

⇤ = ⌧ 1 12 2 · · · ⌧ n n

(42)

?? ??

⇤ = ⌧ 1 12 2 · · · ⌧ n n

Constrained Rational Language

Constrained Rational Language

(43)

Constrained Rational Automata

(44)

Multi tape automata

q

1

q

2

q

3

q

4

q

m

1

2

3

4

n

1

2

3

· · · ⌧

m

Presburger formula

t

1

t

2

t

3

t

m

Constrained Rational Automata (Parikh automata)

(45)

CRA are closed under concatenation, union but not under intersection

Emptiness and membership problems are decidable.

Some properties of Constrained Rational Automata (CRA)

(46)

Create a pushdown systems, one for each stack.

MPDS

PDS-1 PDS-2 PDS-n

1

2

n

(47)

Each of the pushdown system i simulates moves of stack-i

It further has jump transitions corresponding to 1

, · · · ,

n

It outputs number of times a jump transition was made.

{ (v, w, #

j

) | (q, v )

#

j

! (q, v

0

) }

The following language for any pushdown is rational

We can use Presburger formula to ensure that the number of jumps of each PDS match.

(48)

THANK YOU

References

Related documents

The set of weighted transducers are closed under the following operations [Mohri

The set of weighted transducers are closed under the following operations [Mohri

Cantor was the first person to define sets formally – finite sets as well as infinite sets, and prove important properties related to sets.. Let P be a property then he said

Cantor was the first person to define sets formally – finite sets as well as infinite sets, and prove important properties related to sets.. Let P be a property then he said

Erdös &amp; Tarski stated something more general in another context (without statement neither proof) But, the community of mathematicians (for instance Maurice Pouzet) says that

Run-time type testing via the IsA() macro Test if two nodes are equal: equal() Deep copy a node: copyObject().. Serialise a node to text: nodeToString() Deserialise a node from

1 Short-Beam Strength of Polymer Matrix Composites ASTM D 2344M 2 Tensile Properties of Polymer Matrix Composites ASTM D 3039M 3 Flexural Properties of Unreinforced

 At various levels: logic level, switch level, circuit level.. 