Well-nested runs of multistack pushdown automata #
A sequence of transitions is well-nested when every push has a matching pop later in the sequence,
every pop has a matching push earlier in the sequence, and matching pairs do not cross. Following
Section 3 of [AGKR20], well-nested sequences are generated by
sequences of nop transitions, by surrounding a well-nested sequence with a matching push and pop
on the same stack and with the same symbol, and by concatenation.
Well-nested runs are the building block of the reachability algorithm of
[AGKR20]. Its first phase computes the relation WR of control
states joined by a well-nested run, by saturation; Lemma 1 of the paper states that the
saturation computes exactly this relation.
Main definitions #
MPDA.WellNested: well-nested sequences of transition labels.MPDA.WellNestedReach: the least relation on control states that contains the identity, is closed under prefixingnoptransitions, and under prefixing a matching push/pop pair around a related pair to a related pair.
Main results #
MPDA.WellNested.append: well-nested sequences are closed under concatenation.MPDA.WellNested.configLTS_mTr_iff: a well-nested sequence labels a run on configurations exactly when it labels a run of the control, and then the stacks are left unchanged.MPDA.wellNestedReach_iff: Lemma 1 of [AGKR20].MPDA.accepts_of_wellNestedReach: if an accepting state is well-nested reachable from an initial state, the MPDA accepts some word.
Implementation notes #
WellNestedReach is the relation computed by WellNestedReach (Algorithm 2, Appendix B of
[AGKR20]), given as an inductive definition instead of a fixed-point
computation. Algorithm 2 starts from the identity pairs and the nop transitions; the description
in the main text (Section 3, item 1) mentions only the nop transitions. The identity pairs
account for the empty well-nested run.
References #
- [S. Akshay, P. Gastin, S. Krishna, S. Roychowdhury, Revisiting Underapproximate Reachability for Multipushdown Systems] [AGKR20]
A sequence of transition labels is well-nested if it is generated by the empty sequence,
prefixing a nop, and surrounding a well-nested sequence by a matching push and pop, followed
by another well-nested sequence.
- nil {n : ℕ} {Symbol : Type u_2} {Γ : Type u_3} : WellNested []
- nop {n : ℕ} {Symbol : Type u_2} {Γ : Type u_3} {a : Symbol} {w : List (Symbol × Op n Γ)} : WellNested w → WellNested ((a, Op.nop) :: w)
- pushPop {n : ℕ} {Symbol : Type u_2} {Γ : Type u_3} {a b : Symbol} {i : Fin n} {γ : Γ} {w w' : List (Symbol × Op n Γ)} : WellNested w → WellNested w' → WellNested ((a, Op.push i γ) :: (w ++ (b, Op.pop i γ) :: w'))
Well-nested sequences are closed under concatenation.
A well-nested run on configurations leaves the stacks unchanged.
A well-nested run of the control lifts to a run on configurations that starts and ends with the same, arbitrary, stack contents.
A well-nested sequence labels a run on configurations exactly when it labels a run of the control, and then the stacks are left unchanged.
Well-nested reachability between control states: the least relation containing the identity
and closed under prefixing a nop transition, and under pushPop: a push, a related pair, the
matching pop, and then a second, independently related pair. The suffix gives concatenation, so
two consecutive matched pairs are related. This is the inductive characterization of the relation
WR that the procedure WellNestedReach (Algorithm 2, Appendix B of
[AGKR20]) computes by iterating on a finite table until it
stabilizes; that finite computation and its termination are not formalized here.
- refl {n : ℕ} {State : Type u_1} {Symbol : Type u_2} {Γ : Type u_3} {M : MPDA n State Symbol Γ} (s : State) : M.WellNestedReach s s
- nop {n : ℕ} {State : Type u_1} {Symbol : Type u_2} {Γ : Type u_3} {M : MPDA n State Symbol Γ} {s₁ s₂ s₃ : State} {a : Symbol} : M.Tr s₁ (a, Op.nop) s₂ → M.WellNestedReach s₂ s₃ → M.WellNestedReach s₁ s₃
- pushPop {n : ℕ} {State : Type u_1} {Symbol : Type u_2} {Γ : Type u_3} {M : MPDA n State Symbol Γ} {s₁ s₂ s₃ s₄ s₅ : State} {a b : Symbol} {i : Fin n} {γ : Γ} : M.Tr s₁ (a, Op.push i γ) s₂ → M.WellNestedReach s₂ s₃ → M.Tr s₃ (b, Op.pop i γ) s₄ → M.WellNestedReach s₄ s₅ → M.WellNestedReach s₁ s₅
Lemma 1 in Section 3 of [AGKR20] (arXiv:2002.05950v2): a pair of
control states is in WR exactly when there is a well-nested run of the control from the first
to the second.
If an accepting state is well-nested reachable from an initial state, the MPDA accepts some word. This is the soundness of the first check of the emptiness procedure (Algorithm 1, Section 3 of [AGKR20]).