Output Strictly Local (OSL) Functions #
A function f : List α → List β is k-Output Strictly Local when each
output block depends only on the last k - 1 output symbols plus the
current input symbol. OSL captures iterative processes where the output
already emitted at position i feeds forward to the decision at position
i + 1. The function-level subregular hierarchy at this layer is
ISL ⊊ OSL ⊊ Subsequential.
Main definitions #
OSLRule k α β: ak-OSL rule: a window-based output functionList β → α → List βconsuming the (k - 1)-symbol output context plus the current input symbol and emitting an output block.OSLRule.apply: the induced string function, threading the output window left-to-right.IsLeftOutputStrictlyLocal k f,IsRightOutputStrictlyLocal k f: witness predicates for each scan direction.IsOutputStrictlyLocal d k f: direction-parameterised umbrella.
Main results #
isRightOutputStrictlyLocal_iff_left_reverse: Right-OSL is the reverse-conjugate of Left-OSL.isLeftOutputStrictlyLocal_left_subsequential: Left-OSL ⊆ Left-Subsequential, viaOSLRule.toFinSubsequentialTransducer.
Implementation notes #
The witness style IsX k f := ∃ r : OSLRule k α β, r.apply = f mirrors
Subregular.IsLeftInputStrictlyLocal. Unlike ISL, whose window is
over input symbols and threads independently of what was emitted, the
OSL window is over already-emitted output — each step truncates
outputWindow ++ windowOutput outputWindow x to the last k - 1
symbols before recursing. The k parameter is a type-level annotation;
window-length truncation in applyAux is what enforces it semantically.
A k-Output-Strictly-Local rule over input alphabet α and
output alphabet β. The single field windowOutput consumes the
(k − 1)-symbol output context window plus the current input symbol and
emits an output block.
In contrast to ISLRule (whose window is over input symbols), the
window here is over already-emitted output symbols. This lets the
rule see what it has just produced and react accordingly — the
mechanism behind iterative output dependence.
The k parameter is a type-level annotation; semantic enforcement
happens in apply's window threading.
- windowOutput : List β → α → List β
Map from (output context window, current input symbol) to output block. The window argument has length at most
k - 1when called byOSLRule.apply.
Instances For
Apply the rule, threading a window of accumulated output symbols.
At each input position, emit r.windowOutput outputWindow x, then
extend the output window with the just-emitted block (truncated to keep
at most k − 1 symbols).
Equations
- r.applyAux x✝ [] = []
- r.applyAux x✝ (x_2 :: xs) = r.windowOutput x✝ x_2 ++ r.applyAux ((x✝ ++ r.windowOutput x✝ x_2).rtake (k - 1)) xs
Instances For
A function f : List α → List β is k-Left-Output-Strictly-Local
iff some k-OSL rule computes it via left-to-right scan.
Equations
- Subregular.IsLeftOutputStrictlyLocal k f = ∃ (r : Subregular.OSLRule k α β), r.apply = f
Instances For
A function f : List α → List β is k-Right-Output-Strictly-Local iff its
reverse-conjugate is k-Left-OSL — some k-OSL rule computes it via right-to-left
scan.
Equations
Instances For
ScanDirection-parameterised OSL predicate.
Equations
Instances For
Every OSL rule witnesses IsLeftOutputStrictlyLocal for the function
it computes.
Reverse-conjugation lemma: a function is k-Right-OSL iff its reverse-conjugate is k-Left-OSL — definitionally, with the conjugated class as primary.
OSL ⊆ Subsequential #
OSLRule.toFinSubsequentialTransducer projects an OSL rule into the sliding-window
transducer SubsequentialTransducer.ofWindow, with the bounded output window
(length ≤ k − 1) as state. Co-located on the source side because the dependency
direction (the transducer lives in Subsequential.lean; OSL projects into it) forces
both construction and cast into this file.
The output alphabet [Fintype β] constraint matches [Moh97]'s
finite-alphabet assumption — the state space (a bounded output window)
is finite precisely when the output alphabet is.
Every Left-OSL rule induces a window transducer tracking the last k − 1 output
symbols (the window accumulates what windowOutput emits), with empty finalOutput.
Equations
Instances For
OSLRule.applyAux is the canonical window recursion accumulating the output.
The window transducer induced by an OSL rule computes the same string function.
Left-OSL ⊆ Left-Subsequential (over a finite output alphabet).
The [Fintype β] matches [Moh97]'s finite-alphabet assumption
and lets the bounded output window serve as a finite state space.
A single-symbol left-OSL rule is Mealy-computable, with the bounded output window as the synchronous state.
Right-OSL ⊆ Right-Subsequential: the left inclusion at the reverse-conjugate,
since both right classes are the List.revConj-images of their left classes.
ScanDirection-parameterised OSL ⊆ Subsequential umbrella: in both scan directions, OSL functions are subsequential. Delegates to the Left- / Right- specialised theorems.