Zero-visible tails of operational characteristic spines #
An OperationalSpine deliberately retains a grammar rule in its generic
descend constructor. This file normalizes that rule to one of the five
nonbase characteristic-rule shapes and, at the same time, records the hidden
outer stack context of the active occurrence.
The normalized trace makes the important dichotomy syntactic. A read or a
split-right descent appends one visible symbol to the prehandle. Start,
epsilon, and split-left descents leave the prehandle unchanged. The latter
three constructors form ZeroVisibleTail. Along such a tail, split-left is
the only constructor that changes the hidden context, and it does so by
prepending the saved replacement tail.
A normalized operational spine carrying the outer stack context of its
active occurrence. At start the context index is a harmless []
convention; every other constructor has its literal zipper meaning.
- root {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} : ConcreteOperationalSpine M [] PDA_to_CFG.N.start [] [] []
- read {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {suffix preWord : List T} {context : List (StackSymbol M)} {q target next : State M} {a : T} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (parent : ConcreteOperationalSpine M p (PDA_to_CFG.N.single q Z target) suffix preWord context) (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) : ConcreteOperationalSpine M (p ++ [symbol.terminal a]) (PDA_to_CFG.N.list next gamma target) suffix (preWord ++ [a]) context
- epsilon {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {suffix preWord : List T} {context : List (StackSymbol M)} {q target next : State M} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (parent : ConcreteOperationalSpine M p (PDA_to_CFG.N.single q Z target) suffix preWord context) (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) : ConcreteOperationalSpine M p (PDA_to_CFG.N.list next gamma target) suffix preWord context
- splitLeft {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {suffix preWord z : List T} {context : List (StackSymbol M)} {q middle target : State M} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (parent : ConcreteOperationalSpine M p (PDA_to_CFG.N.list q (Z :: gamma) target) suffix preWord context) (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)) : ConcreteOperationalSpine M p (PDA_to_CFG.N.single q Z middle) (z ++ suffix) preWord (gamma ++ context)
- splitRight {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {suffix preWord leftWord : List T} {context : List (StackSymbol M)} {q middle target : State M} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (parent : ConcreteOperationalSpine M p (PDA_to_CFG.N.list q (Z :: gamma) target) suffix preWord context) (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) (hleft : (characteristicGrammar M).DerivesRightmost [symbol.nonterminal (PDA_to_CFG.N.single q Z middle)] (List.map symbol.terminal leftWord)) : ConcreteOperationalSpine M (p ++ [symbol.nonterminal (PDA_to_CFG.N.single q Z middle)]) (PDA_to_CFG.N.list middle gamma target) suffix (preWord ++ leftWord) context
- start {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {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) : ConcreteOperationalSpine M [] (PDA_to_CFG.N.list (emptyStackPDA M).initial_state [(emptyStackPDA M).start_symbol] target) [] [] []
Instances For
Exact-context version of Focused. Unlike Focused, the outer context
is an index, so consumers can relate it to the context carried by a concrete
spine without recovering an unrelated existential witness.
- start {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} : FocusedExact M PDA_to_CFG.N.start [] [] []
- single {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} (q target : State M) (Z : StackSymbol M) (preWord postWord : List T) (context : List (StackSymbol M)) (final : State M) (prefixPath : PDA.Reaches { state := (emptyStackPDA M).initial_state, input := preWord, stack := [(emptyStackPDA M).start_symbol] } { state := q, input := [], stack := Z :: context }) (continuation : PDA.Reaches { state := target, input := postWord, stack := context } { state := final, input := [], stack := [] }) : FocusedExact M (PDA_to_CFG.N.single q Z target) preWord postWord context
- list {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} (q target : State M) (gamma : List (StackSymbol M)) (preWord postWord : List T) (context : List (StackSymbol M)) (final : State M) (prefixPath : PDA.Reaches { state := (emptyStackPDA M).initial_state, input := preWord, stack := [(emptyStackPDA M).start_symbol] } { state := q, input := [], stack := gamma ++ context }) (continuation : PDA.Reaches { state := target, input := postWord, stack := context } { state := final, input := [], stack := [] }) : FocusedExact M (PDA_to_CFG.N.list q gamma target) preWord postWord context
Instances For
Forgetting the exact context index gives the ordinary zipper invariant.
The context index of a normalized concrete spine has its exact operational zipper meaning.
Forgetting normalization and the hidden-context index recovers the original operational spine.
Normalize every generic operational spine and recover its literal hidden outer context.
Direct normalization interface for an active spine and a chosen terminal completion of its visible prefix.
Reachability-specialized normalization interface.
State component of the operational cut represented by an active characteristic nonterminal.
Equations
- DPDA_to_LR.spineCutState M PDA_to_CFG.N.start = (DPDA_to_LR.emptyStackPDA M).initial_state
- DPDA_to_LR.spineCutState M (PDA_to_CFG.N.single q a a_1) = q
- DPDA_to_LR.spineCutState M (PDA_to_CFG.N.list q a a_1) = q
Instances For
Stack component of the operational cut. The root convention agrees with
the initial configuration of emptyStackPDA.
Equations
- DPDA_to_LR.spineCutStack M PDA_to_CFG.N.start x✝ = [(DPDA_to_LR.emptyStackPDA M).start_symbol]
- DPDA_to_LR.spineCutStack M (PDA_to_CFG.N.single a Z a_1) x✝ = Z :: x✝
- DPDA_to_LR.spineCutStack M (PDA_to_CFG.N.list a gamma a_1) x✝ = gamma ++ x✝
Instances For
A suffix of a normalized spine containing no visible descent. Its only proper constructors are exactly start, epsilon, and split-left. The complete syntactic witnesses are retained, so downstream arguments can distinguish a literal epsilon transition from a context-only split.
- refl {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {preWord : List T} {anchor : Nonterminal M} {anchorSuffix : List T} {anchorContext : List (StackSymbol M)} : ZeroVisibleTail M p preWord anchor anchorSuffix anchorContext anchor anchorSuffix anchorContext
- start {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {preWord : List T} {anchor : Nonterminal M} {anchorSuffix : List T} {anchorContext : List (StackSymbol M)} {target : State M} (previous : ZeroVisibleTail M p preWord anchor anchorSuffix anchorContext PDA_to_CFG.N.start [] []) (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) : ZeroVisibleTail M p preWord anchor anchorSuffix anchorContext (PDA_to_CFG.N.list (emptyStackPDA M).initial_state [(emptyStackPDA M).start_symbol] target) [] []
- epsilon {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {preWord : List T} {anchor : Nonterminal M} {anchorSuffix : List T} {anchorContext : List (StackSymbol M)} {suffix : List T} {context : List (StackSymbol M)} {q target next : State M} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (previous : ZeroVisibleTail M p preWord anchor anchorSuffix anchorContext (PDA_to_CFG.N.single q Z target) suffix context) (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) : ZeroVisibleTail M p preWord anchor anchorSuffix anchorContext (PDA_to_CFG.N.list next gamma target) suffix context
- splitLeft {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {preWord : List T} {anchor : Nonterminal M} {anchorSuffix : List T} {anchorContext : List (StackSymbol M)} {suffix z : List T} {context : List (StackSymbol M)} {q middle target : State M} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (previous : ZeroVisibleTail M p preWord anchor anchorSuffix anchorContext (PDA_to_CFG.N.list q (Z :: gamma) target) suffix context) (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)) : ZeroVisibleTail M p preWord anchor anchorSuffix anchorContext (PDA_to_CFG.N.single q Z middle) (z ++ suffix) (gamma ++ context)
Instances For
Hidden contexts along a zero-visible tail are obtained only by prepending blocks to the anchor context.
The zero-visible tail is also a literal same-input PDA computation between its endpoint cuts. Start and split-left merely change the grammar view of the same physical configuration; epsilon contributes its one transition step.
The node immediately before a maximal zero-visible tail. It is either the root or the child of the last visible event (read or split-right).
- root {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} : VisibleSpineAnchor M [] PDA_to_CFG.N.start [] [] []
- read {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {suffix preWord : List T} {context : List (StackSymbol M)} {q target next : State M} {a : T} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (parent : ConcreteOperationalSpine M p (PDA_to_CFG.N.single q Z target) suffix preWord context) (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) : VisibleSpineAnchor M (p ++ [symbol.terminal a]) (PDA_to_CFG.N.list next gamma target) suffix (preWord ++ [a]) context
- splitRight {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {p : List (symbol T (Nonterminal M))} {suffix preWord leftWord : List T} {context : List (StackSymbol M)} {q middle target : State M} {Z : StackSymbol M} {gamma : List (StackSymbol M)} (parent : ConcreteOperationalSpine M p (PDA_to_CFG.N.list q (Z :: gamma) target) suffix preWord context) (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) (hleft : (characteristicGrammar M).DerivesRightmost [symbol.nonterminal (PDA_to_CFG.N.single q Z middle)] (List.map symbol.terminal leftWord)) : VisibleSpineAnchor M (p ++ [symbol.nonterminal (PDA_to_CFG.N.single q Z middle)]) (PDA_to_CFG.N.list middle gamma target) suffix (preWord ++ leftWord) context
Instances For
A visible anchor is itself a concrete normalized spine.
Extending a concrete anchor by a zero-visible tail reconstructs a concrete spine at the endpoint.
Every concrete spine factors at the last visible event into a visible anchor followed by a maximal tail of start/epsilon/split-left descents.