The Tree-Width of
Decidable Problems
1
Gennaro Parlato(U. Southampton, UK)
joint work with: P. Madhusudan (UIUC, USA)
Salvatore La Torre (U. Salerno, Italy) Constantin Enea, Peter Habermehl (LIAFA, CNRS, U. Paris 7, France) Omar Inverso (U. Southampton, UK)
what is this talk about ?A new approach that explains several decidability results in a uniform way
P : decision problem
2
sear
ch sp
ace
what is this talk about ?A new approach that explains several decidability results in a uniform way
P : decision problem
3
sear
ch sp
ace
Integer Linear programming (ILP)
x1 + x2 + … + xn =
search space: N x N x … N (tuples of natural numbers)
a1 a2 an b
what is this talk about ?A new approach that explains several decidability results in a uniform way
P : decision problem
4
sear
ch sp
ace
Emptiness for automata: finite state a. pushdown a. multi-stack a. dist. automata with FIFO channels …
search space: init final
(runs: sequences of configurations)
what is this talk about ?A new approach that explains several decidability results in a uniform way
P : decision problem
sear
ch sp
ace
Representationdepends on the problem (ILP, Empt. …)
We proposeuniform repr. with labeled graphs
(finite set of labels)
search space = class of graphs that is MSO definable
(MSO=Monadic Second Order logic)
what is this talk about ?A new approach that explains several decidability results in a uniform way
P : decision problem
sear
ch sp
ace
finding a solution to P =>
exists a graph representing a solution =>
satisfiability of MSO on graphs
Satisfibility problem for MSO– undecidable in general– decidable for bounded tree-width
graphs (Courcelle/Seese’s theorem)
approach- MSO formula describing search space-show solutions have bounded tree-width
-algorithm for free! (Courcelle’s theorem)
Why•existing decision procedures intrinsically “compute” tree-decompositions•a new way to look at “old” decidable problems•derive new decidability results
outlineDefinitions
– MSO on graphs– tree-width
Applications– Emptiness automata with auxiliary storage– Integer Linear Programming
Conclusions
MSO on graphsFor a fixed alphabet , a -labeled graph is a structure (V, {Ea}a ) where
– V is a finite set of vertices – Ea V x V is a set of edges labeled by a
MSO is given by the following grammar
::= x=y | x X | E∈ a(x,y) | ∨ | ∧ | ¬ | x. (x) | X. (X) | x. ∀ (x) | X. ∀ (X)
where – x, y are first-order variables, X is a second-order variable– Ea(x,y) is an edge relation
MSO on graphs: examplesA bipartite graph is a graph whose vertices can be divided into two disjoint sets U and V such that every edge connects a vertex in U to one in V.
bipartite ≡ ∃ U,V. [ partition(U, V) ∧ ∀u,v. edge(u,v) ⇒ ((u∈U ∧ v∈V) ∨ (u∈V ∧ v∈U)) ]partition(U, V) ≡ ∀ z. (z∈U ∨ z∈V) ∧ ¬(z∈U ∧ z∈V)
Graph 3-Colorability: Given an undirected graph G does there exists a way to colour the nodes red, green, and blue so that no adjacent nodes have the same colour? 3-Colorability ≡ ∃ X,Y,Z. part(X, Y, Z) ∧ ∀ u,v. (u∈X ∧ edge(u,v)) ⇒ ¬(v∈X)
∧ ∀ u,v. (u∈Y ∧ edge(u,v)) ⇒ ¬(v∈Y) ∧ ∀ u,v. (u∈Z ∧ edge(u,v)) ⇒ ¬(v∈Z)
tree-width of graphsA tree decomposition of G=(V,E) is a pair (T, {bagz }z is a node of T ), where T is a tree and
bagz is a subset of G nodes, such that– every node of G is in some bag– every edge of G has both endpoints in some bag– for every node of G the set of bags that contain it form a sub-tree of T
The width of the tree decomposition is the maximum of |bagz|-1 over all T nodes z
The tree-width of a graph G, is the minimum such width over all tree decompositions of G
Tree width of a tree is 1
44
tree-decompositions (examples)1 2 3 4 Line graph: tw=1
1
2 3
4 5 6 7
Tree: tw=1
1 2 3 4
Cycle: tw=2
Clique with k nodes: tw= k-1
MSO on graphsSatisfiability problem for MSO on a class of graphs C:
– Given an MSO formula , is there a graph G in C that satisfies
?
• Over the class of all graphs, MSO is undecidable (even FO is undecidable)
• Satisfiability problem for MSO is decidable on the class of all graphs of tree width k, for any fixed k [Courcelle/Seese’s theorem]
outlineDefinitions
– MSO on graphs– tree-width
Applications– Emptiness automata with auxiliary storage– Integer Linear Programming
Conclusions
✔
Emptiness for Automata with auxiliary storage
-pushdown automata-multi-stack pushdown automata-distributed automata
15
pushdown automata
Finite Controlstack S
Stack alphabet
Finite set of states QInitial state q1 Final states F Q
transitions :• Internal moves: (q, q’) • Pop moves: (q, , q’)• Push moves: (q, , q’)
S
nested words (search space)(Alur-Madhusudan)
A nested word NW graph captures the behavior of a run– The stack is compiled down into the nested word (nesting edges)
push push push int int pop int pop int push int pop pop
q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14
finalinit
nested words (search space)(Alur-Madhusudan)
• The class of NWs is MSO definable– linear relation on black edges– nesting relation on matching edges
• the simulation of the automaton on nested word using MSO – a second order variable for each state– a second order variable for each symbol in the stack alphabet– check internal, push, and pop moves (local check)
• The class of NW has tree-width 2 (next slide)• Decidability from Courcelle’s theorem
q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14
finalγ2 γ3 γ4 γ11 q13 init
Nested words have bounded tree-width
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Tree decomposition of NW of tw 3
Bags: • u is un the bagu
• if (u,v) is an edge of NW add u to the bags of all nodes of the unique path in T from u to v
captures summaries of procedures
1
2
3
4
5
6
7
8
9
10
12
11
13
143, 2, 8,13
multistack pushdown automata
…
Finite ControlFinite number of stacks S1, …,Sn
Stack alphabet
Finite set of states QInitial state q0 Final states F Q
Transitions :• Internal move: (q, q’) • Pop move: (q, , stack_num, q’)• Push move: (q, , stack_num, q’)
S1 S2 Sn
Multiply Nested Words (MNW)
A MNW graph captures the behavior of a run– Stacks are compiled down into the graph (nesting edges)
The class MNWs is – MSO definable– Unbounded tree-width
push1 push1 push1
push2 push2
pop1
pop2
pop1 int
push1
pop2
pop1 pop1
decidable emptiness problem (Madhusudan, Parlato - POPL’11)
Multi-stack pushdown automata with– bounded context-switches (Rehof, Qadeer - TACAS’05)
– bounded-phases (La Torre, Madhusudan, Parlato - LICS’07)
– ordered (Breveglieri, Cherubini, Citrini, Crespi-Reghizzi - Int. J. Found. Comput. Sci.’95)
– bounded-scope (La Torre, Napoli - CONCUR’11) (La Torre, Parlato -
FSTTCS’12)
bounded context-switches• Emptiness decidable (Qadeer, Rehof - TACAS’05)
In a context only one stack can be used
The class of MNWs with k contexts is – MSO definable – tree-width: k + 1
…
distributed automata with queues
Distributed automata with queues– finite state processes– pushdown processes
process
FIFO channel
queue graphs (finite processes)P1:
P2:
P3:
A queue graph captures the behavior of a run– queues are compiled down into the graph (blue edges)
The class of queue graphs is MSO definable (linear orders for each process, FIFO edges)
Unbounded tree-width
stack-queue graphs (PD processes)P1:
P2:
P3:
• A stack-queue graph captures the behavior of a run– Stacks and queues are compiled down into the graph
• The class of stack-queue graphs is MSO definable• Unbounded tree-width
decidable emptiness problem (POPL’11)Multi-stack pushdown automata with
– bounded context-switches (Rehof, Qadeer - TACAS’05)
– bounded-phases (La Torre, Madhusudan, Parlato - LICS’07)
– ordered (Breveglieri, Cherubini, Citrini, Crespi-Reghizzi - Int. J. Found. Comput. Sci.’95)
– Bounded-Scope (La Torre, Napoli - CONCUR’11)
(La Torre, Parlato - FSTTCS’12)
Distributed automata with finite processes & FIFO queues– finite state processes with polyforest architecture – pushdown processes with forest architecture + well queuing (La Torre, Madhusudan, Parlato - TACAS’08)– Non-confluent architectures + eager runs (Heußner, Leroux, Muscholl, Sutre - FOSSACS’10)
(Heußner – CONCUR workshop’10)
outlineDefinitions
– MSO on graphs– tree-width
Applications– Emptiness automata– Integer Linear Programming
Conclusions
✔
✔
Integer Linear Programming (ILP)
SI is set of all solutions (s1,s2, …, sn)(tuple of natural numbers)
Feasibility problem: is SI empty ?
x1 + x2 + … + xn =
Instance I
a11
a21
.
.
.
am1
a12
a22
.
.
.
am2
a1n
a2n
.
.
.
amn
b1
b2
.
.
.
bm
plan• representing solutions with graphs rather than tuples of natural numbers
• the class of all solution graphs is MSO definable
• If there is a solution, there is a graph representing it of path-width 2n where n is the # of variables
• feasibility problem reduces to the satisfiability problem of MSO on the class of 2n path-width graphs
graph representation of a solutionExample 1: one constraint3x1 – 2x2 + 1x3 = 0 solution: x1=3, x2 = 5, x3=1
++
x1
-
x2 x3x1x1 x2 x2 x2 x2
graph representation of a solutionExample 2: (two constraints) 3 x1 – 2 x2 + x3 = 0 solution: x1=3, x2 = 5, x3=1
-2 x1 +1 x2 + 4 x3 = 3
++ x1- x2 x3x1x1 x2 x2 x2 x2 b+ +- -
constraint 1
constraint 2
graph representation of a solutionSolution graphs (logical characterization) is the class CI of all graphs G = (V, Lvar, {Lsign
i}i in [1,…m], {Ei}i in [1,m] )
•Lvar : V -> {x1, x2, …, xn, b } with exactly one node v with Lvar(v) = b
•Lsigni: V -> {+, -}
- if Lvar(v) = xj then Lsigni(v) = sign( aij )
- if Lvar(v) = b then Lsigni(v) = sign( -bi )
•degreei( v ) = |aij| if Lvar(v) = xj
•degreei( v ) = |bi| if Lvar(v) = b
•signi(u) ≠ signi(v) if (u,v) is an edge of Ei
All the above properties can be easily defined in MSO (ϕI)
Feasibility to satisfiability on graphs • Each graph G in CI corresponds to a solution:
( #nodes labeled x1, …, #nodes labeled xn )
• If s=(s1, …, sn) is a solution then there is one or more graphs G in CI s.t. G has exactly sj nodes labeled with variable xj
• If s=(s1, …, sn) is a solution then there is a graph G in CI of path-width 2n representing s
bounded path-widthLet s = (s1, …, sn) be a solution
intuition:we construct G and its path decomposition by adding a node labeled xj in a balanced way
Example: s=(x1=100, x2=50, x3=25)
•each 2 (=100/50) increments of x1, increment x2
•each 4 (=100/25) increments of x1, increment x3
bounded path-widthTwo sets of counters (initially set to 0)
cj (associated to var xj) operations:
- Increase(j) : cj= cj + smax
- Reduce(): cj = cj – sj for all j
ri (associated to i-th row of the matrix)
ri = SUMj (ai,j * # increase(j))
Invariant c1 ai,1 + … + cn ai,n
ri = --------------------------------
smax
by induction•after Increase(j) smax
ri’ = rj + ai,j = rj + ----- ai,j =
smax
c1 ai,1 + … + (cj+smax) + … + cn ai,n = --------------------------------------------- smax
•after Reduce
(c1 - s1) ai,1 + … + (cn- sn)
ri’ = ------------------------------------=
smax
s1 ai,1 + … + sn ai,n
= ri - ------------------------- = ri
smax
bounded path-widthTwo sets of counters (initially set to 0)
cj (associated to var xj) operations:
- Increase(j) : cj= cj + smax
- Reduce(): cj = cj – sj for all j
ri (associated to i-th row of the matrix)
ri = SUMj (ai,j * # increase(j) )
Algorithm:•Increase(max);•Reduce(), stop if ri=0 for all i
•Increase(j) for all j≠max s.t. cj < 0
goto (1)
Invariant
c1 ai,1 + … + cn ai,n
ri = --------------------------------
smax
along execution of Algorithm
|cj|
------- ≤ 1
smax
Therefore
SUM (ai,j) ≤ ri ≤ SUM (ai,j)
ai,j ≤0 ai,j ≥0
path-width decomposition- given a solution s- run algorithm according to slist of increase operations:increase( j1 ), …, increase( ji ), … increase(jt)
xj1xji xji xji
add a nodelabeled xji
-match edges-oldest nodes first-remove fully matched nodes
• size of the each bag ≤ SUMi |ri| ≤ SUMi,j |ai,j| • we can prove that this path-decomposition has width at most 2n
Conclusions
39
Conclusion/Future work
A general criterion that uniformly explains many decidability results for
• automata with auxiliary storage (stacks, queues) • Integer Linear Programming
Other decidable results?Several decidability results for automata are obtained using Parikh + Presburger
A Perfect Model for Bounded Verification [Esparza,Ganty, Majumdar, LICS’12]
Is this a general principle that governs decidability?
Future work (program verification)
Reasoning about Concurrent programs + Weak Memory models?
Automata with heap structures?- a concurrent/distributed program can be seen as as sequential program +
stacks/queues - what about lists, trees, …, graphs? Behavior graphs?
Can we exploit this new view to device (under-approximate) scalable solutions for the analysis of programs???
- sequentialization of programs … tree-decompositions can be seen as
a tree or a sequential programs with procedure calls - New SMT encodings (bounded model checking)
- Fixed point engines …
Open problem: “abab problem”
Open problem: “abab problem”Example w = aabababbaabb [ #a(a) = #b(w)]
Marking of w:aabababbaabb =waabababbaabb (mark a) aabababbaabb (mark b)aabababbaabb (mark a)aabababbaabb (mark b)aabababbaabb (mark a)aabababbaabb (mark b)aabababbaabb (mark a)aabababbaabb (mark b)aabababbaabb (mark a)aabababbaabb (mark b)aabababbaabb (mark a)aabababbaabb (mark b)
Marking Mw:row0 000000000000
row1 000100000000
row2 000100100000
row3 010100100000
row4 011100100000
row5 111100100000
row6 111100110000
row7 111100111000
row8 111110111000
row9 111111111000
row10 111111111010
row11 111111111110
row12 111111111111
Open problem: “abab problem”
Let w be any word over the alphabet {a,b}, with #a(w) = #b(w).
w is called balanced word.
A marking of w isa bit matrix Mw of dimension (n+1) x n (rows: 0 to n)
(columns: 1 to n ) •first row of M is all 0’s •for i>1, the i-th row is a copy of the (i-1)-th row except one position, say j, s. t. M[i-1, j]=0 and M[i, j]=1. Furthermore, if i is odd w[i]=a, otherwise w[i]=b
Open problem: “abab problem”Given a marking Mw of a balanced word w, we define the width of Mw as follows. The width of a row of Mw is the number of its 1-sequences. The width of Mw is the maximum width over all Mw rows.
Example:
The marking-width of a balanced word w, denoted marking-width(w), is the minimum width overall markings of w.
Marking Mw:row0 000000000000 width = 0
row1 000100000000 width = 1
row2 000100100000 width = 2
row3 010100100000 width = 3
row4 011100100000 width = 2
row5 111100100000 width = 2
row6 111100110000 width = 2
row7 111100111000 width = 2
row8 111110111000 width = 2
row9 111111111000 width = 1
row10 111111111010 width = 2
row11 111111111110 width = 1
row12 111111111111 width = 1 width(Mw)=3
Constantin Enea, Peter Habermehl, Gennaro Parlato
“abab problem”
Is there a constant k s. t. for every balanced word w,w has marking-width ≤ k ?
Top Related