Semantics and alignment of visible spine anchors #
This file is the small, ancestry-preserving interface between normalized spines and paired synchronization. It exposes the exact operational cut of a visible anchor, classifies zero-visible tails according to whether they contain a genuine epsilon transition, and aligns the last visible event of two anchors with the same prefix.
Exact-context zipper semantics of a visible anchor.
The concrete cut of a visible anchor is reached after exactly its completed visible-prefix word.
A list-valued visible anchor retains an accepting continuation beginning at exactly its indexed outer context.
Combined exact prefix and continuation semantics for a list anchor.
Stable physical source cuts before a read #
Two concrete single parents at the same visible/completed prefix which can both read the same next terminal represent the same complete physical source cut, including their saved outer stack contexts.
Epsilon-free and epsilon-bearing zero tails #
A zero-visible tail built without an epsilon constructor.
- 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)} : EpsilonFreeZeroVisibleTail 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 : EpsilonFreeZeroVisibleTail 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) : EpsilonFreeZeroVisibleTail M p preWord anchor anchorSuffix anchorContext (PDA_to_CFG.N.list (emptyStackPDA M).initial_state [(emptyStackPDA M).start_symbol] target) [] []
- 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 : EpsilonFreeZeroVisibleTail 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)) : EpsilonFreeZeroVisibleTail M p preWord anchor anchorSuffix anchorContext (PDA_to_CFG.N.single q Z middle) (z ++ suffix) (gamma ++ context)
Instances For
A zero-visible tail whose retained history contains an epsilon constructor.
- 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) : EpsilonBearingZeroVisibleTail M p preWord anchor anchorSuffix anchorContext (PDA_to_CFG.N.list next gamma target) suffix context
- 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 : EpsilonBearingZeroVisibleTail 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) : EpsilonBearingZeroVisibleTail M p preWord anchor anchorSuffix anchorContext (PDA_to_CFG.N.list (emptyStackPDA M).initial_state [(emptyStackPDA M).start_symbol] target) [] []
- 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 : EpsilonBearingZeroVisibleTail 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)) : EpsilonBearingZeroVisibleTail M p preWord anchor anchorSuffix anchorContext (PDA_to_CFG.N.single q Z middle) (z ++ suffix) (gamma ++ context)
Instances For
An epsilon-free zero tail only changes the grammar view of its physical cut.
The epsilon step in an epsilon-bearing tail makes its exact cut path nonempty.
Structural classification of a zero-visible tail by the presence of an epsilon constructor.
Operational form of the zero-tail dichotomy: either its endpoints are literally the same physical cut, or a nonempty PDA path connects them.
A zero-visible tail from a visible anchor can reach a single node only
by a final split-left constructor.
A zero-visible tail from a visible anchor to an empty-list node is either already at that anchor, or ends in the exact split-left/epsilon pair which performs the empty return.
Pure alignment of the last visible event #
Two visible anchors with the same visible prefix have the same kind of last visible event. Read/read pairs share their predecessor prefix and last terminal. Split-right/split-right pairs share their predecessor prefix and the complete displayed single marker; their hidden replacement tails, targets, contexts, and left completions remain explicit and may differ.
- root {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} : PairedVisibleAnchors M [] [] PDA_to_CFG.N.start [] [] PDA_to_CFG.N.start [] []
- read {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {base : List (symbol T (Nonterminal M))} {beforeWord suffix₁ suffix₂ : List T} {context₁ context₂ : List (StackSymbol M)} {q₁ target₁ next₁ q₂ target₂ next₂ : State M} {a : T} {Z₁ Z₂ : StackSymbol M} {gamma₁ gamma₂ : List (StackSymbol M)} (parent₁ : ConcreteOperationalSpine M base (PDA_to_CFG.N.single q₁ Z₁ target₁) suffix₁ beforeWord context₁) (transition₁ : (next₁, gamma₁) ∈ (emptyStackPDA M).transition_fun q₁ a Z₁) (rule₁ : (PDA_to_CFG.N.single q₁ Z₁ target₁, [symbol.terminal a, symbol.nonterminal (PDA_to_CFG.N.list next₁ gamma₁ target₁)]) ∈ (characteristicGrammar M).rules) (parent₂ : ConcreteOperationalSpine M base (PDA_to_CFG.N.single q₂ Z₂ target₂) suffix₂ beforeWord context₂) (transition₂ : (next₂, gamma₂) ∈ (emptyStackPDA M).transition_fun q₂ a Z₂) (rule₂ : (PDA_to_CFG.N.single q₂ Z₂ target₂, [symbol.terminal a, symbol.nonterminal (PDA_to_CFG.N.list next₂ gamma₂ target₂)]) ∈ (characteristicGrammar M).rules) : PairedVisibleAnchors M (base ++ [symbol.terminal a]) (beforeWord ++ [a]) (PDA_to_CFG.N.list next₁ gamma₁ target₁) suffix₁ context₁ (PDA_to_CFG.N.list next₂ gamma₂ target₂) suffix₂ context₂
- splitRight {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] {M : DPDA Q T S} {base : List (symbol T (Nonterminal M))} {completedWord beforeWord₁ leftWord₁ beforeWord₂ leftWord₂ suffix₁ suffix₂ : List T} {context₁ context₂ : List (StackSymbol M)} {q middle target₁ target₂ : State M} {Z : StackSymbol M} {gamma₁ gamma₂ : List (StackSymbol M)} (parent₁ : ConcreteOperationalSpine M base (PDA_to_CFG.N.list q (Z :: gamma₁) target₁) suffix₁ beforeWord₁ context₁) (length₁ : ↑(Z :: gamma₁).length ≤ PDA_to_CFG.max_push (emptyStackPDA M)) (rule₁ : (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) (left₁ : (characteristicGrammar M).DerivesRightmost [symbol.nonterminal (PDA_to_CFG.N.single q Z middle)] (List.map symbol.terminal leftWord₁)) (parent₂ : ConcreteOperationalSpine M base (PDA_to_CFG.N.list q (Z :: gamma₂) target₂) suffix₂ beforeWord₂ context₂) (length₂ : ↑(Z :: gamma₂).length ≤ PDA_to_CFG.max_push (emptyStackPDA M)) (rule₂ : (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) (left₂ : (characteristicGrammar M).DerivesRightmost [symbol.nonterminal (PDA_to_CFG.N.single q Z middle)] (List.map symbol.terminal leftWord₂)) (word₁ : completedWord = beforeWord₁ ++ leftWord₁) (word₂ : completedWord = beforeWord₂ ++ leftWord₂) : PairedVisibleAnchors M (base ++ [symbol.nonterminal (PDA_to_CFG.N.single q Z middle)]) completedWord (PDA_to_CFG.N.list middle gamma₁ target₁) suffix₁ context₁ (PDA_to_CFG.N.list middle gamma₂ target₂) suffix₂ context₂
Instances For
Equal visible prefixes align the final visible events of two anchors.