Active derivation spines of the characteristic grammar #
Focused records the operational meaning of an active characteristic
nonterminal, but intentionally hides the partial derivation tree which led to
that occurrence. Handle-collision arguments need that tree path: in
particular, an empty-list occurrence has forgotten the return state of its
parent unless the introducing edge is retained.
ActiveSpine is the minimal such path. Every descent remembers the parent
active occurrence, the exact retained rule, the position of the child in its
right-hand side, and the terminal completion of the part to the child's
right. Its indices are exactly the visible prehandle prefix and terminal
suffix.
The root-to-active-node path in a partial rightmost derivation tree.
- root {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} : ActiveSpine M [] (characteristicGrammar M).initial []
- descend {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p₀ alpha beta : List (symbol T (Nonterminal M))} {parent child : Nonterminal M} {t z : List T} {r : Nonterminal M × List (symbol T (Nonterminal M))} (parentSpine : ActiveSpine M p₀ parent t) (hr : r ∈ (characteristicGrammar M).rules) (hlhs : r.1 = parent) (hrhs : r.2 = alpha ++ [symbol.nonterminal child] ++ beta) (hbeta : (characteristicGrammar M).DerivesRightmost beta (List.map symbol.terminal z)) : ActiveSpine M (p₀ ++ alpha) child (z ++ t)
Instances For
A stored spine reconstructs its visible reachable prehandle.
Counted completeness of the active-spine representation.
Every reachable characteristic prehandle has a canonical active-node ancestry spine (up to proof irrelevance).
Reachability and existence of an active derivation spine are equivalent.
Normalized final edges #
One characteristic rule edge on the active tree spine, normalized to its semantic rule shape. The indices record both the parent and child visible prehandles.
- read {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {t : List T} {q target next : State M} {a : T} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (htransition : (next, gamma) ∈ (emptyStackPDA M).transition_fun q a Z) (hrule : (PDA_to_CFG.N.single q Z target, [symbol.terminal a, symbol.nonterminal (PDA_to_CFG.N.list next gamma target)]) ∈ (characteristicGrammar M).rules) : ActiveEdge M p (PDA_to_CFG.N.single q Z target) t (p ++ [symbol.terminal a]) (PDA_to_CFG.N.list next gamma target) t
- epsilon {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {t : List T} {q target next : State M} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (htransition : (next, gamma) ∈ (emptyStackPDA M).transition_fun' q Z) (hrule : (PDA_to_CFG.N.single q Z target, [symbol.nonterminal (PDA_to_CFG.N.list next gamma target)]) ∈ (characteristicGrammar M).rules) : ActiveEdge M p (PDA_to_CFG.N.single q Z target) t p (PDA_to_CFG.N.list next gamma target) t
- splitLeft {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {t z : List T} {q middle target : State M} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (hlength : ↑(Z :: gamma).length ≤ PDA_to_CFG.max_push (emptyStackPDA M)) (hrule : (PDA_to_CFG.N.list q (Z :: gamma) target, [symbol.nonterminal (PDA_to_CFG.N.single q Z middle), symbol.nonterminal (PDA_to_CFG.N.list middle gamma target)]) ∈ (characteristicGrammar M).rules) (hright : (characteristicGrammar M).DerivesRightmost [symbol.nonterminal (PDA_to_CFG.N.list middle gamma target)] (List.map symbol.terminal z)) : ActiveEdge M p (PDA_to_CFG.N.list q (Z :: gamma) target) t p (PDA_to_CFG.N.single q Z middle) (z ++ t)
- splitRight {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {t : List T} {q middle target : State M} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (hlength : ↑(Z :: gamma).length ≤ PDA_to_CFG.max_push (emptyStackPDA M)) (hrule : (PDA_to_CFG.N.list q (Z :: gamma) target, [symbol.nonterminal (PDA_to_CFG.N.single q Z middle), symbol.nonterminal (PDA_to_CFG.N.list middle gamma target)]) ∈ (characteristicGrammar M).rules) : ActiveEdge M p (PDA_to_CFG.N.list q (Z :: gamma) target) t (p ++ [symbol.nonterminal (PDA_to_CFG.N.single q Z middle)]) (PDA_to_CFG.N.list middle gamma target) t
- start {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {t : List T} {target : State M} (hrule : (PDA_to_CFG.N.start, [symbol.nonterminal (PDA_to_CFG.N.list (emptyStackPDA M).initial_state [(emptyStackPDA M).start_symbol] target)]) ∈ (characteristicGrammar M).rules) : ActiveEdge M p PDA_to_CFG.N.start t p (PDA_to_CFG.N.list (emptyStackPDA M).initial_state [(emptyStackPDA M).start_symbol] target) t