Documentation

CslibFrontier.Computability.Automata.MPDA.Underapprox

Context-, round-, scope- and phase-bounded sequences of multistack pushdown automata #

Reachability for multistack pushdown automata is undecidable, so verification focuses on restricted classes of runs. Section 2 of [AGKR20] recalls the classes that hole-bounded sequences generalize:

Main definitions #

Main results #

Implementation notes #

Positions are 0-indexed. The scope of a matched push and pop is measured by the number of contexts of the factor from the push to the pop: K context switches means K + 1 contexts.

References #

Contexts and rounds #

def Cslib.Automata.MPDA.Op.stack {n : ℕ} {Γ : Type u_1} :
Op n Γ → Option (Fin n)

The stack touched by an operation, if any.

def Cslib.Automata.MPDA.IsContextOf {n : ℕ} {Γ : Type u_1} {α : Type u_2} (i : Fin n) (w : List (α × Op n Γ)) :

Every operation of w touches stack i or no stack.

def Cslib.Automata.MPDA.IsContext {n : ℕ} {Γ : Type u_1} {α : Type u_2} (w : List (α × Op n Γ)) :

A context is a sequence of transitions that uses at most one stack.

def Cslib.Automata.MPDA.IsRound {n : ℕ} {Γ : Type u_1} {α : Type u_2} (w : List (α × Op n Γ)) :

A round is a sequence of contexts for stacks 0, …, n - 1, in this order. Each context may be empty.

def Cslib.Automata.MPDA.ContextBounded {n : ℕ} {Γ : Type u_1} {α : Type u_2} (K : ℕ) (w : List (α × Op n Γ)) :

At most K contexts.

def Cslib.Automata.MPDA.RoundBounded {n : ℕ} {Γ : Type u_1} {α : Type u_2} (K : ℕ) (w : List (α × Op n Γ)) :

At most K rounds.

theorem Cslib.Automata.MPDA.IsContext.of_isInfix {n : ℕ} {Γ : Type u_1} {α : Type u_2} {u w : List (α × Op n Γ)} (hu : u <:+: w) (h : IsContext w) :
theorem Cslib.Automata.MPDA.IsContextOf.wellNested {n : ℕ} {Γ : Type u_1} {α : Type u_2} {State : Type u_4} {M : MPDA n State α Γ} {c c' : Config n State Γ} {v : List (α × Op n Γ)} {i : Fin n} (hv : IsContextOf i v) (hrun : M.configLTS.MTr c v c') (hnet : net i v = 0) (hk : ∀ (k : ℕ), 0 ≤ net i (List.take k v)) :

A run that uses one stack, never goes below the initial height of that stack and returns to it is well-nested.

theorem Cslib.Automata.MPDA.RoundBounded.contextBounded {n : ℕ} {Γ : Type u_1} {α : Type u_2} {K : ℕ} {w : List (α × Op n Γ)} (h : RoundBounded K w) :

K rounds give at most K * n contexts.

Scope-bounded sequences #

def Cslib.Automata.MPDA.ScopeBounded {n : ℕ} {Γ : Type u_1} {α : Type u_2} (K : ℕ) (w : List (α × Op n Γ)) :

A sequence is K-scope-bounded if every push and its matching pop are separated by at most K context switches, that is, the factor from the push to the pop splits into at most K + 1 contexts.

theorem Cslib.Automata.MPDA.ContextBounded.scopeBounded {n : ℕ} {Γ : Type u_1} {α : Type u_2} {K : ℕ} {w : List (α × Op n Γ)} (h : ContextBounded K w) :

A sequence with at most K contexts is K-scope-bounded.

Phase-bounded sequences #

def Cslib.Automata.MPDA.IsPhase {n : ℕ} {Γ : Type u_1} {α : Type u_2} (w : List (α × Op n Γ)) :

A phase is a sequence of transitions that pops from at most one stack: any two of its pops use the same stack. It may push on any stack, and a sequence without pops is a phase.

def Cslib.Automata.MPDA.PhaseBounded {n : ℕ} {Γ : Type u_1} {α : Type u_2} (K : ℕ) (w : List (α × Op n Γ)) :

At most K phases.

theorem Cslib.Automata.MPDA.IsPhase.of_isInfix {n : ℕ} {Γ : Type u_1} {α : Type u_2} {u w : List (α × Op n Γ)} (hu : u <:+: w) (h : IsPhase w) :

Bounded acceptance #

def Cslib.Automata.MPDA.boundedLanguage {n : ℕ} {Γ : Type u_1} {State : Type u_4} {Symbol : Type u_5} (M : MPDA n State Symbol Γ) (P : List (Symbol × Op n Γ) → Prop) :
Language Symbol

The language of the words with an accepting run satisfying P: acceptance restricted to the runs of a bounded class, such as ScopeBounded K or HoleBounded K.