Equivalences of pushdown systems are hard Petr Janˇcar Dept of Computer Science ˇ Technical University Ostrava (FEI VSB-TUO), Czech Republic www.cs.vsb.cz/jancar
FoSSaCS’14, part of ETAPS 2014 Grenoble, 11 Apr 2014
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
1 / 73
Deterministic pushdown automata; language equivalence M = (Q, Σ, Γ, δ, q0 , Z0 ) finite control unit q
3 ∗ (5 + 7)
B A B ⊥
YES/NO (empty stack acceptance)
stack (LIFO)
?
Decidability of L(M1 ) = L(M2 ) was open since 1960s (Ginsburg, Greibach). First-order schemes (1970s, 1980s, ..., B. Courcelle, ....). Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
2 / 73
Solution S´enizergues G.: L(A)=L(B)? Decidability results from complete formal systems. Theoretical Computer Science 251(1-2): 1-166 (2001) odel prize 2002) (a preliminary version appeared at ICALP’97; G¨ Stirling C.: Decidability of DPDA equivalence. Theoretical Computer Science 255, 1-31, 2001 S´enizergues G.: L(A)=L(B)? A simplified decidability proof. Theoretical Computer Science 281(1-2): 555-608 (2002) Stirling C.: Deciding DPDA equivalence is primitive recursive. ICALP 2002, Lecture Notes in Computer Science 2380, 821-832, Springer 2002 (longer draft paper on the author’s web page) S´enizergues G.: The Bisimulation Problem for Equational Graphs of Finite Out-Degree. SIAM J.Comput., 34(5), 1025–1106 (2005) (a preliminary version appeared at FOCS’98) Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
3 / 73
Outline Part 1 Deterministic case is in TOWER. Equivalence of first-order schemes (or det-FO-grammars, or deterministic pushdown automata (DPDA)) is in TOWER, i.e. “close” to elementary. (The known lower bound is P-hardness.)
Part 2 Nondeterministic case is Ackermann-hard. Bisimulation equivalence of first-order grammars (or PDA with deterministic popping ε-moves) is Ackermann-hard, and thus not primitive recursive (but decidable).
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
4 / 73
Part 1
Equivalence of det-FO-grammars (or of DPDA) is in TOWER.
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
5 / 73
(Det-)labelled transition systems (LTSs); trace equivalence
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
6 / 73
(Det-)labelled transition systems (LTSs); trace equivalence
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
7 / 73
(Det-)labelled transition systems (LTSs); trace equivalence
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
8 / 73
(Det-)labelled transition systems (LTSs); trace equivalence
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
9 / 73
(Det-)labelled transition systems (LTSs); trace equivalence
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
10 / 73
a
FO-grammar G = (N , A, R) ... rules A(x1 , . . . , xm ) −→ E
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
11 / 73
a
FO-grammar G = (N , A, R) ... rules A(x1 , . . . , xm ) −→ E
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
12 / 73
a
FO-grammar G = (N , A, R) ... rules A(x1 , . . . , xm ) −→ E
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
13 / 73
a
FO-grammar G = (N , A, R) ... rules A(x1 , . . . , xm ) −→ E
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
14 / 73
(D)pda from a first-order term perspective Q = {q1 , q2 , q3 } configuration q2 ABA
a
(pushing) rule q2 A −→ q1 BC
b
(popping) rule q2 A −→ q2 Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
ε
q2 C −→ q3 Grenoble, 11 Apr 2014
15 / 73
Bounding lengths of witnesses (where EL keeps dropping) Theorem. There is an elementary function g such that for any det-FO grammar G = (N , A, R) and T 6∼ U of size n we have EL(T , U) ≤ tower (g (n)). tower (0) = 1 tower (n+1) = 2tower (n)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
16 / 73
Bounding lengths of witnesses (where EL keeps dropping) Theorem. There is an elementary function g such that for any det-FO grammar G = (N , A, R) and T 6∼ U of size n we have EL(T , U) ≤ tower (g (n)). tower (0) = 1 tower (n+1) = 2tower (n) Proof is based on two ideas:
Petr Janˇ car (TU Ostrava)
1
“Synchronize” the growth of lhs-terms and rhs-terms while not changing the respective eq-levels. (Hence no repeat.)
2
Derive a tower-bound on the size of terms in the (modified) sequence. Equivalences of pushdown systems
Grenoble, 11 Apr 2014
16 / 73
Congruence properties of ∼k and ∼
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
17 / 73
Congruence properties of ∼k and ∼
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
18 / 73
Balancing (the crucial tool for “synchronizing”)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
19 / 73
Balancing (the crucial tool for “synchronizing”)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
20 / 73
Balancing (the crucial tool for “synchronizing”)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
21 / 73
Balancing (the crucial tool for “synchronizing”)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
22 / 73
Balancing (the crucial tool for “synchronizing”)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
23 / 73
Balancing (the crucial tool for “synchronizing”)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
24 / 73
Balancing (the crucial tool for “synchronizing”)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
25 / 73
Balancing (the crucial tool for “synchronizing”)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
26 / 73
“Stair subsequence” of pairs (on balanced witness path)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
27 / 73
Stair subsequence of pairs (written horizontally)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
28 / 73
(ℓ, n)-(sub)sequences, with 2ℓ pairs
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
29 / 73
(ℓ, n)-(sub)sequences, with 2ℓ pairs
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
30 / 73
(ℓ, n)-(sub)sequences, with 2ℓ pairs
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
31 / 73
(ℓ, n)-(sub)sequences, with 2ℓ pairs
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
32 / 73
(ℓ, n)-(sub)sequences, with 2ℓ pairs
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
33 / 73
(ℓ, n)-(sub)sequences, with 2ℓ pairs
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
34 / 73
(ℓ, n)-(sub)sequences, with 2ℓ pairs
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
35 / 73
(ℓ, n)-(sub)sequences, with 2ℓ pairs
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
36 / 73
(ℓ, n)-(sub)sequences, with 2ℓ pairs
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
37 / 73
(ℓ, n)-(sub)sequences, with 2ℓ pairs
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
38 / 73
(ℓ, n)-(sub)sequences, with 2ℓ pairs
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
39 / 73
Final (conditional) step of the “TOWER-proof” Recall: There is no EL-decreasing (1, 0)-sequence.
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
40 / 73
Final (conditional) step of the “TOWER-proof” Recall: There is no EL-decreasing (1, 0)-sequence. Claim. Any EL-decreasing (ℓ+1, n+1)-sequence gives rise to an EL-decreasing (ℓ, n)-sequence.
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
40 / 73
Final (conditional) step of the “TOWER-proof” Recall: There is no EL-decreasing (1, 0)-sequence. Claim. Any EL-decreasing (ℓ+1, n+1)-sequence gives rise to an EL-decreasing (ℓ, n)-sequence. Corollary. There is no EL-decreasing (n+1, n)-sequence.
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
40 / 73
Final (conditional) step of the “TOWER-proof” Recall: There is no EL-decreasing (1, 0)-sequence. Claim. Any EL-decreasing (ℓ+1, n+1)-sequence gives rise to an EL-decreasing (ℓ, n)-sequence. Corollary. There is no EL-decreasing (n+1, n)-sequence. Recall that h(1) = 1 + q, h(j+1) = h(j) · (1 + q h(j) ) and that h(j) “stairs” gives rise to (j, n)-sequence (n being the “small” thickness).
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
40 / 73
Final (conditional) step of the “TOWER-proof” Recall: There is no EL-decreasing (1, 0)-sequence. Claim. Any EL-decreasing (ℓ+1, n+1)-sequence gives rise to an EL-decreasing (ℓ, n)-sequence. Corollary. There is no EL-decreasing (n+1, n)-sequence. Recall that h(1) = 1 + q, h(j+1) = h(j) · (1 + q h(j) ) and that h(j) “stairs” gives rise to (j, n)-sequence (n being the “small” thickness). Corollary. There are less than h(n+1) stairs, and h(n+1) ≤ tower (g (n)). Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
40 / 73
Repeating heads yield an “equation”
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
41 / 73
Repeating heads yield an “equation”
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
42 / 73
Repeating heads yield an “equation”
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
43 / 73
Repeating heads yield an “equation”
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
44 / 73
Repeating heads yield an “equation”
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
45 / 73
From (ℓ, n) to (ℓ−1, n−1) ... decreasing thickness
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
46 / 73
From (ℓ, n) to (ℓ−1, n−1) ... decreasing thickness
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
47 / 73
From (ℓ, n) to (ℓ−1, n−1) ... decreasing thickness
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
48 / 73
From (ℓ, n) to (ℓ−1, n−1) ... decreasing thickness
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
49 / 73
Bounding lengths of witnesses (End of Part 1) Theorem. There is an elementary function g such that for any det-FO grammar G = (N , A, R) and T 6∼ U of size n we have EL(T , U) ≤ tower (g (n)).
Proof is based on two ideas:
Petr Janˇ car (TU Ostrava)
1
“Synchronize” the growth of lhs-terms and rhs-terms while not changing the respective eq-levels. (Hence no repeat.)
2
Derive a tower-bound on the size of terms in the (modified) sequence. Equivalences of pushdown systems
Grenoble, 11 Apr 2014
50 / 73
Part 2
Bisimulation equivalence for FO-grammars is Ackermann-hard. Note: Benedikt M., G¨ oller S., Kiefer S., Murawski A.S.: Bisimilarity of Pushdown Automata is Nonelementary. LICS 2013 (no ε-transitions)
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
51 / 73
Ackermann function, class ACK, ACK-completeness Family f0 , f1 , f2 , . . . of functions: f0 (n) = n+1 (n+1) (n) fk+1 (n) = fk (fk (. . . fk (n) . . . )) = fk Ackermann function fA : fA (n) = fn (n).
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
52 / 73
Ackermann function, class ACK, ACK-completeness Family f0 , f1 , f2 , . . . of functions: f0 (n) = n+1 (n+1) (n) fk+1 (n) = fk (fk (. . . fk (n) . . . )) = fk Ackermann function fA : fA (n) = fn (n). ACK ... class of problems solvable in time fA (g (n)) where g is a primitive recursive function.
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
52 / 73
Ackermann function, class ACK, ACK-completeness Family f0 , f1 , f2 , . . . of functions: f0 (n) = n+1 (n+1) (n) fk+1 (n) = fk (fk (. . . fk (n) . . . )) = fk Ackermann function fA : fA (n) = fn (n). ACK ... class of problems solvable in time fA (g (n)) where g is a primitive recursive function. Ackermann-budget halting problem (AB-HP): Instance: Minsky counter machine M. Question: does M halt from the zero initial configuration within fA (size(M)) steps ? Fact. AB-HP is ACK-complete. Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
52 / 73
Control state reachability in reset counter machines Reset counter machines (RCMs). nonnegative counters c1 , c2 , . . . , cd , control states 1, 2, . . . , r , configuration (ℓ, (n1 , n2 , . . . , nd )), initial conf. (1, (0, 0, . . . , 0)), (nondeterministic) instructions of the types inc(ci )
ℓ −→ ℓ′ (increment ci ), dec(ci )
ℓ −→ ℓ′ (decrement ci , if ci > 0), reset(ci )
ℓ −→ ℓ′ (reset ci , i.e., put ci = 0).
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
53 / 73
Control state reachability in reset counter machines Reset counter machines (RCMs). nonnegative counters c1 , c2 , . . . , cd , control states 1, 2, . . . , r , configuration (ℓ, (n1 , n2 , . . . , nd )), initial conf. (1, (0, 0, . . . , 0)), (nondeterministic) instructions of the types inc(ci )
ℓ −→ ℓ′ (increment ci ), dec(ci )
ℓ −→ ℓ′ (decrement ci , if ci > 0), reset(ci )
ℓ −→ ℓ′ (reset ci , i.e., put ci = 0). CS-reach problem for RCM: Instance: an RCM M, a control state ℓfin . Question: is (1, (0, 0, . . . , 0)) −→∗ (ℓfin , (. . . )) ?
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
53 / 73
Control state reachability in reset counter machines Reset counter machines (RCMs). nonnegative counters c1 , c2 , . . . , cd , control states 1, 2, . . . , r , configuration (ℓ, (n1 , n2 , . . . , nd )), initial conf. (1, (0, 0, . . . , 0)), (nondeterministic) instructions of the types inc(ci )
ℓ −→ ℓ′ (increment ci ), dec(ci )
ℓ −→ ℓ′ (decrement ci , if ci > 0), reset(ci )
ℓ −→ ℓ′ (reset ci , i.e., put ci = 0). CS-reach problem for RCM: Instance: an RCM M, a control state ℓfin . Question: is (1, (0, 0, . . . , 0)) −→∗ (ℓfin , (. . . )) ? Fact. CS-reach problem for RCM is ACK-complete. (See [Schnoebelen, MFCS 2010].) Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
53 / 73
Bisimulation equivalence as a game a
Assume LTS L = (S, A, (−→)a∈A ). In a position (s, t), a
a
1
Attacker chooses either some s −→ s ′ or some t −→ t ′ .
2
Defender responses by some t −→ t ′ or some s −→ s ′ , respectively.
a
a
The new position is (s ′ , t ′ ).
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
54 / 73
Bisimulation equivalence as a game a
Assume LTS L = (S, A, (−→)a∈A ). In a position (s, t), a
a
1
Attacker chooses either some s −→ s ′ or some t −→ t ′ .
2
Defender responses by some t −→ t ′ or some s −→ s ′ , respectively.
a
a
The new position is (s ′ , t ′ ). These rounds are repeated. If a player is stuck, then (s)he loses. An infinite play is a win of Defender. We put s ∼ t (s, t are bisimulation equivalent) if Defender has a winning strategy from position (s, t).
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
54 / 73
Bisimulation equivalence as a game a
Assume LTS L = (S, A, (−→)a∈A ). In a position (s, t), a
a
1
Attacker chooses either some s −→ s ′ or some t −→ t ′ .
2
Defender responses by some t −→ t ′ or some s −→ s ′ , respectively.
a
a
The new position is (s ′ , t ′ ). These rounds are repeated. If a player is stuck, then (s)he loses. An infinite play is a win of Defender. We put s ∼ t (s, t are bisimulation equivalent) if Defender has a winning strategy from position (s, t). Observation. For deterministic LTSs, bisimulation equivalence coincides with trace equivalence.
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
54 / 73
Reduction of CS-reach for RCM to FO-bisimilarity Given an RCM M, i.e., counters c1 , c2 , . . . , cd , control states 1, 2, . . . , r , and instructions of the types inc(ci )
ℓ −→ ℓ′ (increment ci ), dec(ci )
ℓ −→ ℓ′ (decrement ci , if ci > 0), reset(ci )
ℓ −→ ℓ′ (reset ci , i.e., put ci = 0), and ℓfin , we construct G = (N , A, R) and E0 , F0 so that (1, (0, 0, . . . , 0)) −→∗ (ℓfin , (. . . ))
Petr Janˇ car (TU Ostrava)
iff E0 6∼ F0 .
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
55 / 73
CS-reachability as bisimulation game Example with counters c1 , c2 ; we start with the pair (A1 (⊥, ⊥, ⊥, ⊥, ), B1 (⊥, ⊥, ⊥, ⊥)). The pair after mimicking (1, (0, 0)) −→∗ (ℓ, (2, 1)) might be
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
56 / 73
Attacker’s win
Attacker wins in (Aℓfin (. . . ), Bℓfin (. . . )) a
due to the rule Aℓfin (x1 , x2 , x3 , x4 ) −→ . . . (while there is no rule for Bℓfin ).
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
57 / 73
Counter increment inc(c2 )
For ins = ℓ −→ ℓ′ we have rules ins Aℓ (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , I (x3 ), x4 ), ins
Bℓ (x1 , x2 , x3 , x4 ) −→ Bℓ′ (x1 , x2 , I (x3 ), x4 ),
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
58 / 73
Counter increment inc(c2 )
For ins = ℓ −→ ℓ′ we have rules ins Aℓ (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , I (x3 ), x4 ), ins
Bℓ (x1 , x2 , x3 , x4 ) −→ Bℓ′ (x1 , x2 , I (x3 ), x4 ),
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
59 / 73
Counter increment inc(c2 )
For ins = ℓ −→ ℓ′ we have rules ins Aℓ (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , I (x3 ), x4 ), ins
Bℓ (x1 , x2 , x3 , x4 ) −→ Bℓ′ (x1 , x2 , I (x3 ), x4 ),
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
60 / 73
Counter reset reset(c2 )
For ins = ℓ −→ ℓ′ we have rules ins Aℓ (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , ⊥, ⊥), ins
Bℓ (x1 , x2 , x3 , x4 ) −→ Bℓ′ (x1 , x2 , ⊥, ⊥),
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
61 / 73
Counter reset reset(c2 )
For ins = ℓ −→ ℓ′ we have rules ins Aℓ (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , ⊥, ⊥), ins
Bℓ (x1 , x2 , x3 , x4 ) −→ Bℓ′ (x1 , x2 , ⊥, ⊥),
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
62 / 73
Counter reset reset(c2 )
For ins = ℓ −→ ℓ′ we have rules ins Aℓ (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , ⊥, ⊥), ins
Bℓ (x1 , x2 , x3 , x4 ) −→ Bℓ′ (x1 , x2 , ⊥, ⊥),
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
63 / 73
Counter decrement dec(c2 )
For ins = ℓ −→ ℓ′ we have two phases; the first-phase rules are ins
ins
ins
ins
ins
Aℓ −→ A(ℓ′ ,2) , Aℓ −→ B(ℓ′ ,2,a) , Aℓ −→ B(ℓ′ ,2,b) , Bℓ −→ B(ℓ′ ,2,a) , Bℓ −→ B(ℓ′ ,2,b) ,
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
64 / 73
Counter decrement dec(c2 )
For ins = ℓ −→ ℓ′ we have two phases; the first-phase rules are ins
ins
ins
ins
ins
Aℓ −→ A(ℓ′ ,2) , Aℓ −→ B(ℓ′ ,2,a) , Aℓ −→ B(ℓ′ ,2,b) , Bℓ −→ B(ℓ′ ,2,a) , Bℓ −→ B(ℓ′ ,2,b) ,
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
65 / 73
Counter decrement dec(c2 )
For ins = ℓ −→ ℓ′ we have two phases; the first-phase rules are ins
ins
ins
ins
ins
Aℓ −→ A(ℓ′ ,2) , Aℓ −→ B(ℓ′ ,2,a) , Aℓ −→ B(ℓ′ ,2,b) , Bℓ −→ B(ℓ′ ,2,a) , Bℓ −→ B(ℓ′ ,2,b) ,
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
66 / 73
Counter decrement (option a) a
b
A(ℓ′ ,2) (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , x3 , I (x4 )), Aℓ′ ,2 (x1 , x2 , x3 , x4 ) −→ x3 , a B(ℓ′ ,2,a) (x1 , x2 , x3 , x4 ) −→ Bℓ′ (x1 , x2 , x3 , I (x4 )), b
B(ℓ′ ,2,a) (x1 , x2 , x3 , x4 ) −→ x3 ,
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
67 / 73
Counter decrement (option a) a
b
A(ℓ′ ,2) (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , x3 , I (x4 )), Aℓ′ ,2 (x1 , x2 , x3 , x4 ) −→ x3 , a B(ℓ′ ,2,a) (x1 , x2 , x3 , x4 ) −→ Bℓ′ (x1 , x2 , x3 , I (x4 )), b
B(ℓ′ ,2,a) (x1 , x2 , x3 , x4 ) −→ x3 ,
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
68 / 73
Counter decrement (option a) a
b
A(ℓ′ ,2) (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , x3 , I (x4 )), Aℓ′ ,2 (x1 , x2 , x3 , x4 ) −→ x3 , a B(ℓ′ ,2,a) (x1 , x2 , x3 , x4 ) −→ Bℓ′ (x1 , x2 , x3 , I (x4 )), b
B(ℓ′ ,2,a) (x1 , x2 , x3 , x4 ) −→ x3 ,
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
69 / 73
Counter decrement (option b) b
a
A(ℓ′ ,2) (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , x3 , I (x4 )), Aℓ′ ,2 (x1 , x2 , x3 , x4 ) −→ x3 , a B(ℓ′ ,2,b) (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , x3 , I (x4 )), b
B(ℓ′ ,2,b) (x1 , x2 , x3 , x4 ) −→ x4 , c
I (x1 ) −→ x1
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
70 / 73
Counter decrement (option b) b
a
A(ℓ′ ,2) (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , x3 , I (x4 )), Aℓ′ ,2 (x1 , x2 , x3 , x4 ) −→ x3 , a B(ℓ′ ,2,b) (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , x3 , I (x4 )), b
B(ℓ′ ,2,b) (x1 , x2 , x3 , x4 ) −→ x4 , c
I (x1 ) −→ x1
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
71 / 73
Counter decrement (option b) b
a
A(ℓ′ ,2) (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , x3 , I (x4 )), Aℓ′ ,2 (x1 , x2 , x3 , x4 ) −→ x3 , a B(ℓ′ ,2,b) (x1 , x2 , x3 , x4 ) −→ Aℓ′ (x1 , x2 , x3 , I (x4 )), b
B(ℓ′ ,2,b) (x1 , x2 , x3 , x4 ) −→ x4 , c
I (x1 ) −→ x1
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
72 / 73
Concluding remarks
We have shown (Trace) equivalence of deterministic first-order grammars is in TOWER. Bisimulation equivalence of first-order grammars is Ackermann-hard. Questions/problems/related results: more precise complexity bounds ... subcases (simple grammars, one-counter automata, ...) higher orders ... ....
Petr Janˇ car (TU Ostrava)
Equivalences of pushdown systems
Grenoble, 11 Apr 2014
73 / 73