Std.Regex.Runtime (Cure Standard Library v0.37.2)

View Source

Executable Regex machine, evidence VM, typed compiler, and combinators.

Examples

use Std.Regex.Runtime

ascii_digit('7')          # => true
ascii_word('_')           # => true
ascii_space(' ')          # => true
default_options()
use Std.Regex.Runtime

compile_regex(concatenate(digit_class(false), word_class(false)))

Summary

Types

One winner slot per encountered intrinsic active state plus one accepted-state bit. Traversal is left-to-right, so setting a slot preserves the first (highest priority) thread and discards every later duplicate without rescanning the growing winner list. Bounded(n) structurally indexes the slot spine: no unchecked Nat conversion enters the machine and the erased bound need not be materialized at runtime.

A named commitment decision keeps the control invariant visible at every search boundary: a commit at the current scope or an enclosing scope blocks the remaining siblings, while a commit strictly inside the current scope escapes to the caller so an outer alternative may still run.

The runtime search never compares scope depths with an unchecked Boolean. This finite decision relation carries the proof that a commit is either at-or-inside the current scope (so siblings are blocked) or strictly deeper than it (so the commit belongs to an inner scope and outer siblings remain eligible). The evidence fields are erased after the branch has been selected.

Runtime-only atomic plan. Ordinary Pattern values and their Thompson proofs stay unchanged; this parallel tree carries only the commitment scopes needed by the ordered runtime search.

Atomic commitment is runtime control state, not part of the ordinary proof-carrying search result. A commit failure stops siblings at the scope that closed, while an outer scope may still propagate it.

The conditional guard consumes an indexed decision produced from the destination epsilon routine. This is the finite participation fact used by named conditionals; it is deliberately separate from capture text and cannot be manufactured by replaying an unrelated slot.

Named capture metadata is additive. It never enters ShapeCode or the ordinary Match tuple, so existing typed regex APIs remain unchanged.

Option is a Type-level family, so it cannot hold a RegexProgram(result): a family INDEXED by Type lives one universe up (level: 1), exactly as an Agda data … : Set → Set₁ does. Cure has no universe polymorphism, so the large case needs its own carrier rather than a Type-level Option.

A single winning NFA path through the evidence VM. Both the starting thread and final evidence are indices: AcceptingNow can close only at an accepted thread carrying exactly that evidence, while AcceptingNext can advance only to a member of step_evidence_thread. Consequently a path cannot invent a state, skip an input character, or claim evidence different from the VM thread it reaches.

Thompson's evidence proof reasons over one NFA-independent instruction stream. Observe records the consumed character (and advances open capture frames); Regular embeds the existing VM instruction language.

The generalized Thompson proof uses an NFA-independent stream. Observe advances capture input; Regular embeds the evidence VM language.

Intrinsic list membership. The witness is erased at every accepting-run boundary; its only purpose is to make every path edge name a destination that the checked transition relation actually produced.

Nested assertion decisions are existentially packaged because each child machine has its own state-count index. They are proof metadata attached to a parent path; the path constructors erase the list after checking.

A decision is the only value consumed by an assertion constraint. A satisfied branch now carries an existential package containing the finite child path. Refuted branches still record the finite-search outcome (or an explicit resource/history boundary). The search refutation retains the complete child and sibling traversal tree; the remaining work is to prove its soundness and completeness against the machine semantics.

Internal result for a destination-list traversal. Unlike the public result above, this carries the full destination list as a parameter, so recursive tail failures cannot escape as an unconstrained existential.

Lookaround compilation is a runtime-only parallel IR. It preserves the same finite Thompson constructors as the ordinary proof IR, but adds an explicit atomic scope so assertion operands cannot silently erase ordered commitment when they cross an assertion boundary. The ordinary typed proof remains over ThompsonCompilation; this tree is consumed only by the checked finite assertion evaluator.

Resource and history guards fail before a machine traversal exists. They retain the compact terminal witness used by the public decision types; ordinary search failures use the complete trees above.

Capture-free assertion paths carry state reachability plus an erased list of the nested decisions used by each accepted transition. The depth index is the same guard used by the evaluator: each nested assertion consumes one level and zero fuel cannot manufacture a child path. A failed path records the complete finite traversal below one thread. Destination failures retain the child rejection and the tail rejection; the only terminal constructor is reached with a structurally exhausted MachineStateMembers witness. The capture context is indexed because nested capture-condition checks must be refuted in the same environment that produced the destination list.

Capture-aware assertion replay uses the same ordered commitment relation as atomic_lookaround_accepts, but returns the selected finite routine. The routine is replayed only by the named-capture side channel; the typed matcher continues to consume the checked assertion path and never derives a result from this replay value.

A complete failed start-list traversal. A start cannot be dropped from a refutation: the corresponding child path failure and the tail failure are both required before the terminal member proof can be returned.

A candidate list whose every element is paired with erased evidence that it belongs to the original transition result. State and proof are introduced by the same constructor, so dependent pattern refinement never has to relate two sibling scrutinees.

Match positions are zero-based Unicode-scalar offsets, not UTF-8 byte offsets. start and length are native Int values so large subjects do not allocate unary Nat structures at runtime.

A named replay is deliberately separate from the evidence VM. The ordinary certificate still proves the typed evidence; this effect-free interpreter replays the same certified routine and records only slot participation/text. No host regex engine or second language semantics is involved.

Erasure certificate: every named compilation has exactly the ordinary Thompson compilation obtained by dropping slot IDs. This is the bridge used by the typed proof path; capture metadata cannot alter language.

Runtime-only search for named machines. The ordinary search above is indexed by the evidence theorem and intentionally has no capture-guard parameter. Named search carries only the replay routine, while preserving the same ordered destination traversal and boundary calculations.

The public result type and the checked Thompson shape are independent: conversions may expose Option, List, or a simplified tuple while the machine still carries its constructor-preserving shape. Keep the machine shape as an explicit index instead of letting it unify accidentally with the public result (which would reject optional/one-or-more captures).

Named compilation is constructor-for-constructor parallel to the checked Thompson tree. Only group nodes differ: they carry the explicit slot ID used by the capture ledger. Erasing the IDs recovers the ordinary compilation, so language proofs can remain independent of names.

Public typed combinator layer. Mapped is the semantic bridge from a structurally extracted Pattern value to the user-facing result type. It is one-way: regex parsing does not imply an unparser.

Elixir-compatible literal modifiers, in i m s x u f U order. Repeated letters are idempotent and modifier order is irrelevant. No accepted flag is metadata-only: each one must affect parsing or machine execution.

A staged literal carries its checked machine and the erased equality that relates that machine to the canonical Thompson construction. The wrapper is indexed by the public shape (rather than by the dependent compilation itself) because that is the representation the constructor elaborator can refine without introducing an existential dependent constructor.

Constructor-preserving Thompson IR. Both runtime compilation and the evidence theorem consume this same tree, so proof code never reconstructs machine provenance from a function-valued transition table.

Functions

Return true if an active thread at state has already been recorded in slots.

Advance a Position by consuming a list of characters with the default policy.

Match left or right, tagging the winning branch in a Choice.

Constant predicate returning true for every character.

Regex matching any single character (including newlines).

Concatenate two lists of MachineState values with explicit state bound n.

Concatenate two lists of MachineState values with the same state bound.

Alias for captured: match regex and return the matched substring.

Return true if char is an ASCII letter or digit.

Return true if char is an ASCII letter (A-Z or a-z).

Return true if char is an ASCII space or horizontal tab.

Return true if char is an ASCII control character.

Return true if char is an ASCII decimal digit (0-9).

Return true if char is a visible ASCII graphical character (0x21..0x7E).

Return true if char is a printable ASCII character (0x20..0x7E).

Return true if char is an ASCII punctuation character.

Return true if char is an ASCII whitespace character.

Return true if char is an ASCII word character ([A-Za-z0-9_]).

Construct an ASCII word-boundary (\b / \B) constraint.

Decide whether an atomic commit at commit prunes a sibling at current depth.

Compare two atomic nesting depths as less-than, equal, or greater-than.

Return the maximum of two Nat atomic nesting depths.

Annotate accepting destinations with an atomic-commit instruction.

Atomic assertion search is the same finite ordered search as the ordinary assertion path, but every destination is first passed through the depth-aware lookaround constraint filter. This is what makes an assertion inside an atomic scope observable without introducing a host backtracking stack or rebuilding a child machine per attempt.

The capture replay evaluator mirrors the atomic lookaround search above. It is deliberately separate from the Boolean evaluator: preserving the selected routine must not alter the acceptance authority used by typed extraction. Every successful branch prepends the observed character and epsilon routine in the same order as the certified extended path. prefix changes only the acceptance point: a prefix search may close as soon as the ordered machine reaches ThreadAccepted, even when input remains. The machine's start/destination order still chooses the path, so lazy repeats and ordered alternation are preserved by the same DFS. reversed_prefix records exactly the characters consumed on that path; the result also carries the unconsumed suffix so callers never reconstruct it by retrying every possible endpoint.

Wrap a PatternMachine in an atomic group scope with enter/commit markers.

Extract the underlying ThompsonCompilation from an AtomicRuntimePattern.

Extract the underlying Pattern from an AtomicRuntimePattern.

Compute the atomic nesting depth remaining after executing routine.

Compute the net atomic-scope depth change and commit depth of an instruction routine.

Compute the maximum atomic nesting depth reached while executing routine.

Accumulate the maximum atomic nesting depth across routine starting from current.

Atomic scopes preserve every ordinary machine state, but mark entry and every accepting exit in the routine stream. The ordered search consumes these markers to discard lower-priority siblings after the first exit; transition construction itself remains the same finite Thompson machine.

Construct the zero-state PatternMachine guarded by a single BoundaryConstraint.

Match regex at least min_count times with optional lazy preference.

Return true if two Bounded(n) state indices are equal.

Match regex at most max_count times with optional lazy preference.

Pointwise correctness of the row compiler. This is intentionally a smaller theorem than function extensionality: every concrete bounded source state reduces to the row installed for that state, so callers can transport an edge without changing the existing PatternMachine proof indices.

Construct a constraint requiring capture group index to be absent.

Convert a CaptureCondition into its corresponding BoundaryConstraint.

Initialize an empty named-capture ledger from a NamedCaptureLayout.

Initialize an empty named-capture ledger from a list of CaptureSlots.

Construct a constraint requiring capture group index to have participated.

Extract only capture-slot markers from a selected assertion routine. The child emits its own characters and evidence, but those must not be merged into the surrounding typed result; only participation markers cross the assertion boundary for later conditionals.

Match regex and return the matched substring as a String.

Compare two characters for case-insensitive equality under options.

Test whether char matches any enabled shorthand class in kinds under options.

Test whether char matches a character class of literals and ranges.

Curried predicate for a character class of literals and ranges.

Compile a typed Regex(result) AST into an executable CompiledRegex(result).

Compile a PatternMachine's transition function into an indexed TransitionRows table.

Sequence two regexes, returning both results as a Tuple.

Test whether a BoundaryConstraint holds at boundary.

Test whether a BoundaryConstraint holds at boundary given the current capture routine.

Return true if every BoundaryConstraint in constraints holds at boundary.

Return true if target appears in the character list chars.

Return true if target matches any character in chars under options.

Return true if policy recognizes CRLF pairs as a single line break.

Return the default RegexOptions (case-sensitive, single-line, ASCII mode).

Regex matching an ASCII digit (\d) or non-digit (\D when negated).

Test whether char matches \d / \D under options.

Wrapper function applying group_pattern_machine for congruence proofs.

Wrapper applying repeat_pattern_machine with fixed lazy flag for congruence proofs.

Discard a matched Char and return Unit.

Conversion values used by the literal emitter's staged IR. Keeping these small adapters here lets generated literals publish a first-order Thompson tree without rebuilding a Regex/Pattern wrapper at runtime.

Match left then right, returning only right's result.

Match left then right, returning only left's result.

Deduplicate EvidenceThreads by state, keeping the highest-priority thread per state.

Return true if char matches . under options.

Curried predicate for . under options.

Test whether char matches . given dotall and policy.

Regex matching . under options.

Regex matching the empty string and producing Unit.

Construct a Conversion turning Unit into an empty List(a).

Shape-indexed adapters keep generated bounded-literal conversions fully inferable. The emitter knows the inner shape, while the polymorphic convenience form above has no expected type at the generated call site.

Transition function for a zero-state empty or boundary machine.

Return an empty List(MachineState(n)).

Construct the zero-state PatternMachine accepting the empty string.

Transform Unit into an empty List(a) for zero-count repetitions.

Create an empty ThreadWinnerTable for deduplicating active and accepted threads.

Enable a single ClassKind flag in a ClassKinds set.

Zero-width anchor matching the end of subject or line.

Zero-width end anchor respecting multiline and newline options.

Erase named capture slots from a NamedThompsonCompilation to a ThompsonCompilation.

Return true if actual equals expected.

Curried character predicate testing equality with expected.

Regex matching the exact character expected and returning Unit.

Regex matching expected under options and returning Unit.

Run a typed Conversion to transform raw Sem(shape) evidence into a result value.

Evidence execution deliberately forgets ExtendedExecution.current. Observe still advances every open capture frame, while the current character is observational bookkeeping and cannot affect evidence.

Execute a single EvidenceInstruction against the evidence stack and capture frame stack.

Execute a sequence of EvidenceInstructions, returning the final stack and captures.

Extract the resulting capture frame stack from an executed routine state.

Extract the resulting Evidence stack from an executed routine state.

Extract the capture frame stack from an extended execution state.

Extract the current character buffer from an extended execution state.

Extract the Evidence stack from an extended execution state.

Named machines may carry capture-participation constraints on their destination states. Those constraints are checked against the regular evidence already executed on the path plus the destination's epsilon routine: a group that participated contributes its EndCaptureSlot instruction before the guarded branch is entered. Observe instructions are intentionally erased from this view; they only advance capture text. Ordinary machines deliberately continue through machine_destinations, whose indexed proof contract does not mention capture conditions.

Keep only MachineState values whose boundary constraints hold at boundary.

Filter MachineState values at the boundary derived from position and remaining.

Append the default capture-end instruction to every accepting state in states.

Append a pair-completion instruction to every accepting state in states.

Return the evidence stack of the first accepting thread in threads, if any.

Return true if char matches [low, high] under case folding.

Return the empty destination list for a group machine.

Apply capture-end framing to a list of destination states.

Look up the offset-th previous character in reverse history.

Return true if reverse history contains at least width characters.

Histories are newest-first and bounded to one scalar beyond the eight- scalar assertion limit. The extra scalar supplies the boundary context immediately before a fixed-width lookbehind window.

Take up to limit characters from a reverse character history list.

Regex matching horizontal whitespace (\h or \H when negated).

Test whether char is horizontal whitespace (\h / \H).

Curried predicate for horizontal whitespace (\h / \H).

An active thread cannot have an accepting path over an empty input. Keeping this contradiction at the typed path boundary prevents a later refutation proof from accidentally treating an unconsumed active state as terminally accepted.

Return true if char falls in any inclusive (low, high) range in ranges.

Compute the Boundary at the start of remaining given an already-consumed prefix.

Create an initial EvidenceThread from a starting MachineState.

Create initial EvidenceThreads for all starting MachineStates.

Regex matching a line break (\R) under the default newline policy.

Return true if char can end a two-character CRLF line break under policy.

Test whether char is \n (end of a CRLF line break).

Return true if char can start a two-character CRLF line break under policy.

Test whether char is \r (start of a CRLF line break).

Return true if char is a single-character line break under policy.

Test whether char is a single-character line break under policy.

Regex matching a line break (\R) under an explicit NewlinePolicy.

Construct a line-end ($) boundary constraint with the default newline policy.

Construct a line-end ($) boundary constraint with an explicit newline policy.

Determine whether a position is at a line end given previous, current, and policy.

Construct a line-start (^) boundary constraint with the default newline policy.

Construct a line-start (^) boundary constraint with an explicit newline policy.

Determine whether a position is at a line start given previous, current, and policy.

Return the maximum lookbehind history window retained during matching.

Assertions are staged as ordinary zero-state boundary nodes. The child machine is closed over once here; each boundary check only supplies the current finite subject context, so no source parser or machine rebuild is performed during matching.

Lookaround child evaluation reuses the checked Thompson machine and has a context-aware, finite search loop. The Boolean path records only the existence of an accepting child path; the named sidecar below replays the selected child routine when assertion-local captures are requested.

Package a LookaroundCompilation into an existentially quantified PatternMachine.

A successful positive assertion can publish capture participation to the parent's ordinary finite machine. The Boolean decision remains the admission check; the capture-aware routine supplies only slot markers.

Capture-aware boundary evaluation returns the selected child routine for a positive assertion. A negative assertion succeeds with an empty routine: its private capture frame is intentionally discarded. The Boolean path above remains the acceptance authority; this side channel only preserves the witness needed by named replay.

Construct a LookaroundExhaustion witness from a list of failed member states.

Turn a structurally enumerated candidate list into the compact erased exhaustion witness used by assertion refutations. The recursive call is the only way to obtain the Nil remainder, so callers cannot manufacture a certificate for a list whose traversal has not terminated.

Assertion operands are validated as depth-bounded before emission. Their child machine can therefore recurse only through the explicit finite fuel; using this separate filter keeps Boolean child evaluation outside the parent constraint evaluator's ordinary totality SCC.

The empty start list has no accepting path. This is the base case used by the eventual refutation-tree soundness proof: every search-path constructor carries a membership witness in starts, so starts = [] is eliminated constructively rather than treated as an unchecked claim.

Build the finite child machine once. Atomic scopes are represented by the same BeginAtomic/EndAtomic routine markers used by the ordinary runtime plan, so nested assertion evaluation can apply one commitment invariant rather than maintaining a second backtracking mechanism.

Construct a path-failure witness for an accepting destination rejected by boundary constraints.

lookaround_path_destination_active_rejected(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, destinations: List(MachineState(n)), destination: Bounded(n), routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), edge: ListMember(MachineState(n), Active(destination, routine, constraints), destinations), child_destinations: List(MachineState(n)), child_remaining_destinations: List(MachineState(n)), child_failure: LookaroundPathFailure(depth, n, machine, rest, after_input, ThreadActive(destination), history_push_bounded(history, char), append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations), remaining_destinations: List(MachineState(n)), tail: LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, source, history, capture_context, policy, destinations, remaining_destinations), members: MachineStateMembers(n, destinations, Cons(Active(destination, routine, constraints), remaining_destinations)), destinations_equivalent: Equivalent(List(MachineState(n)), destinations, lookaround_machine_destinations(depth, n, machine, source, char, rest, after_input, history, capture_context, policy))) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, source, history, capture_context, policy, destinations, Cons(Active(destination, routine, constraints), remaining_destinations))

Construct a path-failure witness for an active destination rejected by boundary constraints.

Apply positive or negative lookaround polarity to a match boolean.

Return the total number of states in a LookaroundCompilation.

Extract the last width characters from reverse history in forward order.

Return true if any state in states is accepting.

Build the reflexive MachineStateMembers witness for a list of states.

Extract the evidence instruction routine attached to a MachineState.

Transform the typed result of regex using transform.

Append a branch-choice marker instruction to every state in states.

Construct a ListMember witness pointing to the head of a cons list.

Look up the captured text for slot in a named-capture ledger.

Finalize a named-capture ledger into NamedCapture entries ordered by layout.

Finalize a named-capture ledger into NamedCapture entries ordered by slots.

Named replay for a lookaround-aware compilation uses the same checked finite machine as assertion acceptance. Unlike the typed path, the returned routine is retained long enough to replay capture slots, including slots opened and closed inside a positive assertion.

Return the total number of states in a NamedThompsonCompilation.

Negate a boolean result when negated is true.

Return true if char is a line-break character under policy.

Return true if the next character in remaining is an ASCII word character.

Return true if the next character in remaining is a Unicode word character.

Return an empty List(Char).

Return an empty ClassKinds bitset with all shorthand classes disabled.

Regex matching any character in chars (or outside it if negated).

Match one or more occurrences of regex, returning OneOrMore(a).

One-or-more regex parameterized by lazy quantifier preference.

Return true if an Option(Char) is Some ASCII word character.

Apply optional negation to a character-class match result.

Return true if char is a digit under options (ASCII or Unicode).

Test whether actual matches expected under options (case folding if enabled).

Curried character predicate testing equality with expected under options.

Return the first element of a list as Option, or None() if empty.

Return true if an Option(Char) equals expected.

Return the second element of a list as Option, or None() if fewer than two elements.

Return true if char is whitespace under options (ASCII or Unicode).

Return true if an Option(Char) is Some Unicode word character.

Return true if char is a word character under options (ASCII or Unicode).

Match zero or one occurrence of regex, returning Option(a).

Optional regex parameterized by lazy quantifier preference.

Greedy optional regex returning Choice(a, Unit).

Match left or right when both branches produce the same result type.

Compile and run a Pattern on input, returning whether it matches the full string.

Compile and run a Pattern on input, returning its winning evidence stack.

Find the shortest (lazy: true) or longest (lazy: false) matching prefix of input.

Greedy one-or-more regex returning List(a).

Advance a Position by a single character using the default newline policy.

Advance a Position by a single character using an explicit newline policy.

Construct a Boundary from a reverse character history, remaining input, and policy.

Test whether position followed by remaining is at a line end under policy.

Return true when remaining is empty (strict subject end).

Test whether position followed by remaining is at the subject end under policy.

Test whether char satisfies a (possibly negated) PosixClassMatch.

Test whether char belongs to a PosixClass under options.

Return true if char satisfies any entry in a list of PosixClassMatches.

Regex matching a single character that satisfies test.

Construct the accepting destination state after matching a single character.

Return the accepting destination when test(char) holds, or empty otherwise.

Construct the single start state of a predicate PatternMachine.

Return the singleton start-state list for a predicate machine.

Construct a one-state PatternMachine matching characters satisfying test.

Construct a Conversion prepending an optional (Choice(a, Unit)) element onto a list.

Prepend a Choice(a, Unit) element onto a repetition result list if present.

Construct a Conversion consing a repeated element onto a result list.

Cons a matched element onto a repetition result list.

Regex matching any character in the inclusive range [low, high].

Return true if char lies inclusively between low and high.

Curried predicate testing inclusion in [low, high].

Mark state as visited in the active-thread winner set slots.

Append char to every open named-capture frame on the active stack.

Record a thread's state in table so lower-priority duplicates are pruned.

Check whether a routine executes cleanly to a valid evidence stack.

Match zero or more occurrences of regex, collecting results in a List.

Compute start states for a repetition machine, respecting lazy preference.

Construct the PatternMachine for greedy or lazy repetition of a submachine.

Zero-or-more regex parameterized by lazy quantifier preference.

Replay an ExtendedRoutine against a NamedCaptureLayout to extract named captures.

Return true if two CaptureSlot identifiers refer to the same slot.

Compare two List(Char) values for exact equality.

Return true if two EvidenceThreads occupy the same machine state.

Predicate testing membership in chars, optionally negated.

Wrap regex with a compile-time shape simplification pass.

Regex matching ASCII whitespace (\s) or non-whitespace (\S when negated).

Test whether char matches \s / \S under options.

Construct the empty TransitionRows table for a boundary constraint pattern.

Construct the empty TransitionRows table for an empty pattern.

Staged literals use a row-backed machine. The transition rows are built from the direct staged machine seed below, rather than reconstructing a canonical Thompson machine for every child closure.

Construct the closure machine once per Thompson subtree. Let-binding the child results is important: starts and next are two projections of the same child value, not two independent recursive reconstructions.

Compatibility reference retained for differential checking. It preserves the original row formulas while the active machine below uses the direct staged rows; this keeps the comparison path independent of the optimized construction.

Zero-width anchor matching the start of subject or line.

Zero-width start anchor respecting multiline and newline options.

Zero-width anchor matching strictly at the end of the subject (\z).

Construct a strict subject-end (\z) boundary constraint with the default newline policy.

Construct a strict subject-end (\z) boundary constraint with an explicit newline policy.

Construct a subject-end (\Z) boundary constraint with the default newline policy.

Construct a subject-end (\Z) boundary constraint with an explicit newline policy.

Determine whether a position is at the subject end (allowing a trailing newline) under policy.

Construct the starting Position at the beginning of a subject.

Construct a subject-start (\A) boundary constraint with the default newline policy.

Construct a subject-start (\A) boundary constraint with an explicit newline policy.

Return true if remaining consists solely of a single terminal line break under policy.

Package a ThompsonCompilation into an existentially quantified PatternMachine.

Canonical constructor. The reference copy above is deliberately kept separate so transition-row implementations can be compared without changing the proof theorem's original definitional equations.

Return the total number of states in a ThompsonCompilation.

Return true if a thread's state has already been visited in table.

Compute the Boundary immediately after consuming char at position.

Compute the Boundary before consuming char, incorporating trailing after_input.

Convert a transition's EvidenceInstruction list into an ExtendedRoutine.

A table-backed machine exposes the same indexed machine interface as the reference closure machine. The only runtime closure is this single row lookup adapter; transition construction itself is performed once when the table is built, not by recursively rebuilding Thompson combinators for each input character.

Look up transitions for state and char in a compiled TransitionRows table.

Return true if char is a Unicode letter or decimal digit.

Return true if char is a Unicode alphabetic character.

Return true if category appears in the list categories.

Return true if char is a visible Unicode graphical character.

Return true if char is a printable Unicode character.

Regex matching a single UnicodeProperty (\p{...} / \P{...}).

Test whether char satisfies a (possibly negated) UnicodePropertyMatch.

Test whether char satisfies a UnicodeProperty.

Return true if char satisfies any entry in a list of UnicodePropertyMatches.

Curried predicate for a UnicodeProperty with optional negation.

Construct a Unicode word-boundary (\b / \B) constraint.

Regex matching vertical whitespace (\v or \V when negated).

Test whether char is vertical whitespace (\v / \V).

Curried predicate for vertical whitespace (\v / \V).

Zero-width word-boundary anchor (\b or negated \B) respecting options.

Regex matching an ASCII word character (\w) or non-word (\W when negated).

Test whether char matches \w / \W under options.

Types

type AcceptingFrom(n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), current_evidence: List(Evidence), captures: List(CaptureFrame), final_evidence: List(Evidence), extended_routine: List(ExtendedInstruction))

 type AcceptingFrom(n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), current_evidence: List(Evidence), captures: List(CaptureFrame), final_evidence: List(Evidence), extended_routine: List(ExtendedInstruction))
   AcceptingNow : AcceptingFrom(n, machine, Nil(), after_input, ThreadAccepted(), evidence, captures, evidence, Nil())
   AcceptingNextActive : (destination: Bounded(n)) -> (regular: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (destination_evidence: List(Evidence)) -> (destination_captures: List(CaptureFrame)) -> (suffix_routine: List(ExtendedInstruction)) -> (edge: ListMember(MachineState(n), Active(destination, regular, constraints), machine_destinations(n, machine, state, char, transition_boundary_before(char, rest, after_input)))) -> (execution: RoutineExecution(regular, current_evidence, record_capture_char(captures, char), destination_evidence, destination_captures)) -> (suffix: AcceptingFrom(n, machine, rest, after_input, ThreadActive(destination), destination_evidence, destination_captures, final_evidence, suffix_routine)) -> AcceptingFrom(n, machine, Cons(char, rest), after_input, state, current_evidence, captures, final_evidence, append_extended_routines(transition_routine(char, regular), suffix_routine))
   AcceptingNextAccepted : (regular: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (destination_evidence: List(Evidence)) -> (destination_captures: List(CaptureFrame)) -> (suffix_routine: List(ExtendedInstruction)) -> (edge: ListMember(MachineState(n), Accepted(regular, constraints), machine_destinations(n, machine, state, char, transition_boundary_before(char, rest, after_input)))) -> (execution: RoutineExecution(regular, current_evidence, record_capture_char(captures, char), destination_evidence, destination_captures)) -> (suffix: AcceptingFrom(n, machine, rest, after_input, ThreadAccepted(), destination_evidence, destination_captures, final_evidence, suffix_routine)) -> AcceptingFrom(n, machine, Cons(char, rest), after_input, state, current_evidence, captures, final_evidence, append_extended_routines(transition_routine(char, regular), suffix_routine))

type AcceptingSearch(n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), current_evidence: List(Evidence), captures: List(CaptureFrame))

 type AcceptingSearch(n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), current_evidence: List(Evidence), captures: List(CaptureFrame))
   NoAcceptingPath : AcceptingSearch(n, machine, input, after_input, state, current_evidence, captures)
   AcceptingPath : (final_evidence: List(Evidence)) -> (extended_routine: List(ExtendedInstruction)) -> (routine_certificate: CertifiedPathRoutine(extended_routine, current_evidence, captures, final_evidence)) -> (@erased path : AcceptingFrom(n, machine, input, after_input, state, current_evidence, captures, final_evidence, extended_routine)) -> AcceptingSearch(n, machine, input, after_input, state, current_evidence, captures)

enum ActiveWinnerSlots

 enum ActiveWinnerSlots
   NoWinnerSlots
   ActiveWinnerSlot

One winner slot per encountered intrinsic active state plus one accepted-state bit. Traversal is left-to-right, so setting a slot preserves the first (highest priority) thread and discards every later duplicate without rescanning the growing winner list. Bounded(n) structurally indexes the slot spine: no unchecked Nat conversion enters the machine and the erased bound need not be materialized at runtime.

type AtomicCommitDisposition indices (current: Nat, commit: Nat)

 type AtomicCommitDisposition indices (current: Nat, commit: Nat)
   AtomicCommitBlocks : (@erased proof : AtomicDepthAtLeast(current, commit)) -> AtomicCommitDisposition(current, commit)
   AtomicCommitEscapes : (@erased proof : AtomicDepthBelow(current, commit)) -> AtomicCommitDisposition(current, commit)

A named commitment decision keeps the control invariant visible at every search boundary: a commit at the current scope or an enclosing scope blocks the remaining siblings, while a commit strictly inside the current scope escapes to the caller so an outer alternative may still run.

type AtomicDepthAtLeast indices (left: Nat, right: Nat)

 type AtomicDepthAtLeast indices (left: Nat, right: Nat)
   AtomicDepthAtLeastZero : AtomicDepthAtLeast(Z(), Z())
   AtomicDepthAtLeastFromZero : AtomicDepthAtLeast(S(left), Z())
   AtomicDepthAtLeastStep : (@erased prior : AtomicDepthAtLeast(left, right)) -> AtomicDepthAtLeast(S(left), S(right))

The runtime search never compares scope depths with an unchecked Boolean. This finite decision relation carries the proof that a commit is either at-or-inside the current scope (so siblings are blocked) or strictly deeper than it (so the commit belongs to an inner scope and outer siblings remain eligible). The evidence fields are erased after the branch has been selected.

type AtomicDepthBelow indices (left: Nat, right: Nat)

 type AtomicDepthBelow indices (left: Nat, right: Nat)
   AtomicDepthBelowZero : AtomicDepthBelow(Z(), S(right))
   AtomicDepthBelowStep : (@erased prior : AtomicDepthBelow(left, right)) -> AtomicDepthBelow(S(left), S(right))

type AtomicDepthComparison indices (left: Nat, right: Nat)

 type AtomicDepthComparison indices (left: Nat, right: Nat)
   AtomicDepthStops : (@erased proof : AtomicDepthAtLeast(left, right)) -> AtomicDepthComparison(left, right)
   AtomicDepthPasses : (@erased proof : AtomicDepthBelow(left, right)) -> AtomicDepthComparison(left, right)

type AtomicRuntimePattern indices (shape: ShapeCode)

 type AtomicRuntimePattern indices (shape: ShapeCode)
   AtomicRuntimeLeaf : (pattern: Pattern(shape)) -> AtomicRuntimePattern(shape)
   AtomicRuntimeConcat : (left: AtomicRuntimePattern(left_shape)) -> (right: AtomicRuntimePattern(right_shape)) -> AtomicRuntimePattern(PairC(left_shape, right_shape))
   AtomicRuntimeGroup : (inner: AtomicRuntimePattern(inner_shape)) -> AtomicRuntimePattern(StringC)
   AtomicRuntimeAlternate : (left: AtomicRuntimePattern(left_shape)) -> (right: AtomicRuntimePattern(right_shape)) -> (prefer_right: Bool) -> AtomicRuntimePattern(ChoiceC(left_shape, right_shape))
   AtomicRuntimeScope : (inner: AtomicRuntimePattern(inner_shape)) -> AtomicRuntimePattern(inner_shape)
   AtomicRuntimeRepeat : (inner: AtomicRuntimePattern(inner_shape)) -> (lazy: Bool) -> AtomicRuntimePattern(ListC(inner_shape))

Runtime-only atomic plan. Ordinary Pattern values and their Thompson proofs stay unchanged; this parallel tree carries only the commitment scopes needed by the ordered runtime search.

enum AtomicScopeEffect

 enum AtomicScopeEffect
   AtomicScopeEffect

Atomic commitment is runtime control state, not part of the ordinary proof-carrying search result. A commit failure stops siblings at the scope that closed, while an outer scope may still propagate it.

enum AtomicSearchResult

 enum AtomicSearchResult
   AtomicSearchNo
   AtomicSearchCommit
   AtomicSearchYes

enum CaptureLayout

 enum CaptureLayout
   CaptureLayout

type CaptureParticipationDecision indices (slot: Nat, routine: List(EvidenceInstruction))

 type CaptureParticipationDecision indices (slot: Nat, routine: List(EvidenceInstruction))
   CaptureParticipatedByRoutine : CaptureParticipationDecision(slot, routine)
   CaptureAbsentByRoutine : CaptureParticipationDecision(slot, routine)

The conditional guard consumes an indexed decision produced from the destination epsilon routine. This is the finite participation fact used by named conditionals; it is deliberately separate from capture text and cannot be manufactured by replaying an unrelated slot.

enum CaptureSlot

 enum CaptureSlot
   CaptureSlot

Named capture metadata is additive. It never enters ShapeCode or the ordinary Match tuple, so existing typed regex APIs remain unchanged.

type CertifiedPathRoutine indices (routine: List(ExtendedInstruction), input_evidence: List(Evidence), input_captures: List(CaptureFrame), output_evidence: List(Evidence))

 type CertifiedPathRoutine indices (routine: List(ExtendedInstruction), input_evidence: List(Evidence), input_captures: List(CaptureFrame), output_evidence: List(Evidence))
   PathRoutineDone : CertifiedPathRoutine(Nil(), evidence, captures, evidence)
   PathRoutineTransition : (char: Char) -> (regular: List(EvidenceInstruction)) -> (suffix_routine: List(ExtendedInstruction)) -> (destination_evidence: List(Evidence)) -> (destination_captures: List(CaptureFrame)) -> (regular_execution: ExtendedEvidenceRoutineExecution(regular_routine(regular), source_evidence, record_capture_char(source_captures, char), destination_evidence, destination_captures)) -> (suffix: CertifiedPathRoutine(suffix_routine, destination_evidence, destination_captures, final_evidence)) -> CertifiedPathRoutine(append_extended_routines(transition_routine(char, regular), suffix_routine), source_evidence, source_captures, final_evidence)
   PathRoutineInitial : (regular: List(EvidenceInstruction)) -> (suffix_routine: List(ExtendedInstruction)) -> (initial_evidence: List(Evidence)) -> (initial_captures: List(CaptureFrame)) -> (regular_execution: ExtendedEvidenceRoutineExecution(regular_routine(regular), Nil(), Nil(), initial_evidence, initial_captures)) -> (suffix: CertifiedPathRoutine(suffix_routine, initial_evidence, initial_captures, final_evidence)) -> CertifiedPathRoutine(append_extended_routines(regular_routine(regular), suffix_routine), Nil(), Nil(), final_evidence)

type CertifiedPrefixSearch(n, machine) indices (position: InitialPosition)

 type CertifiedPrefixSearch(n, machine) indices (position: InitialPosition)
   NoCertifiedPrefix : CertifiedPrefixSearch(n, machine, position)
   CertifiedPrefixPath : (matched_input: List(Char)) -> (remaining_input: List(Char)) -> (final_evidence: List(Evidence)) -> (extended_routine: List(ExtendedInstruction)) -> (@erased acceptance : MachineAcceptance(n, machine, position, matched_input, remaining_input, final_evidence, extended_routine)) -> CertifiedPrefixSearch(n, machine, position)

type CertifiedRoutineExecution indices (routine: List(EvidenceInstruction), input_evidence: List(Evidence), input_captures: List(CaptureFrame))

 type CertifiedRoutineExecution indices (routine: List(EvidenceInstruction), input_evidence: List(Evidence), input_captures: List(CaptureFrame))
   CertifiedRoutineExecuted : (output_evidence: List(Evidence)) -> (output_captures: List(CaptureFrame)) -> (certificate: RoutineExecution(routine, input_evidence, input_captures, output_evidence, output_captures)) -> (extended_certificate: ExtendedEvidenceRoutineExecution(regular_routine(routine), input_evidence, input_captures, output_evidence, output_captures)) -> CertifiedRoutineExecution(routine, input_evidence, input_captures)

enum CharacterRange

 enum CharacterRange
   CharacterRange

enum ClassKind

 enum ClassKind
   DigitKind
   NotDigitKind
   WordKind
   NotWordKind
   SpaceKind
   NotSpaceKind
   HorizontalKind
   NotHorizontalKind
   VerticalKind
   NotVerticalKind

enum ClassKinds

 enum ClassKinds
   ClassKinds

type CompilationHint indices (shape: ShapeCode)

 type CompilationHint indices (shape: ShapeCode)
   NoCompilationHint : CompilationHint(shape)
   StagedCompilationHint : StagedMachine(shape) -> CompilationHint(shape)

type CompiledRegex indices (result: Type)

 type CompiledRegex indices (result: Type)
   NoProgram : CompiledRegex(result)
   SomeProgram : RegexProgram(result) -> CompiledRegex(result)

Option is a Type-level family, so it cannot hold a RegexProgram(result): a family INDEXED by Type lives one universe up (level: 1), exactly as an Agda data … : Set → Set₁ does. Cure has no universe polymorphism, so the large case needs its own carrier rather than a Type-level Option.

type Conversion indices (raw: Type, result: Type)

 type Conversion indices (raw: Type, result: Type)
   IdentityConversion : Conversion(value, value)
   ApplyConversion : Function(raw, result) -> Conversion(raw, result)
   ComposedConversion : Conversion(raw, middle) -> Conversion(middle, result) -> Conversion(raw, result)
   PairConversion : Conversion(left_raw, left_result) -> Conversion(right_raw, right_result) -> Conversion(Tuple(left_raw, right_raw), Tuple(left_result, right_result))
   ChoiceConversion : Conversion(left_raw, left_result) -> Conversion(right_raw, right_result) -> Conversion(Choice(left_raw, right_raw), Choice(left_result, right_result))
   ListConversion : Conversion(raw, result) -> Conversion(List(raw), List(result))
   LeftPairConversion : Conversion(left_raw, left_result) -> Conversion(right_raw, right_result) -> Conversion(Tuple(left_raw, right_raw), left_result)
   RightPairConversion : Conversion(left_raw, left_result) -> Conversion(right_raw, right_result) -> Conversion(Tuple(left_raw, right_raw), right_result)
   SameChoiceConversion : Conversion(left_raw, result) -> Conversion(right_raw, result) -> Conversion(Choice(left_raw, right_raw), result)
   OptionalConversion : Conversion(raw, result) -> Conversion(Choice(raw, Unit), Option(result))
   OneOrMoreConversion : Conversion(raw, result) -> Conversion(Tuple(raw, List(raw)), OneOrMore(result))
   PrependConversion : Conversion(raw, result) -> Conversion(Tuple(raw, List(raw)), List(result))
   SimplifyConversion : (shape: ShapeCode) -> Conversion(Sem(shape), Sem(Simplify(shape)))

type DistinctThreadResult indices (n: Nat)

 type DistinctThreadResult indices (n: Nat)
   DistinctThreadResult : ThreadWinnerTable -> List(EvidenceThread(n)) -> DistinctThreadResult(n)

type EvidenceStep(n, machine) indices (char: Char, boundary: Boundary, source_state: ThreadState(n), source_evidence: List(Evidence), source_captures: List(CaptureFrame), destination_state: ThreadState(n), destination_evidence: List(Evidence), destination_captures: List(CaptureFrame))

 type EvidenceStep(n, machine) indices (char: Char, boundary: Boundary, source_state: ThreadState(n), source_evidence: List(Evidence), source_captures: List(CaptureFrame), destination_state: ThreadState(n), destination_evidence: List(Evidence), destination_captures: List(CaptureFrame))
   EvidenceStepActive : (destination: Bounded(n)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (edge: ListMember(MachineState(n), Active(destination, routine, constraints), machine_destinations(n, machine, source_state, char, boundary))) -> (execution: RoutineExecution(routine, source_evidence, record_capture_char(source_captures, char), result_evidence, result_captures)) -> EvidenceStep(n, machine, char, boundary, source_state, source_evidence, source_captures, ThreadActive(destination), result_evidence, result_captures)
   EvidenceStepAccepted : (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (edge: ListMember(MachineState(n), Accepted(routine, constraints), machine_destinations(n, machine, source_state, char, boundary))) -> (execution: RoutineExecution(routine, source_evidence, record_capture_char(source_captures, char), result_evidence, result_captures)) -> EvidenceStep(n, machine, char, boundary, source_state, source_evidence, source_captures, ThreadAccepted(), result_evidence, result_captures)

A single winning NFA path through the evidence VM. Both the starting thread and final evidence are indices: AcceptingNow can close only at an accepted thread carrying exactly that evidence, while AcceptingNext can advance only to a member of step_evidence_thread. Consequently a path cannot invent a state, skip an input character, or claim evidence different from the VM thread it reaches.

Boundary filtering is part of the indexed edge, including the exact suffix used by the runtime boundary calculation. This covers zero-width boundary constraints without adding an unchecked side condition to the theorem. One evidence-preserving transition. It separates machine reachability from routine execution: edge proves the destination came from the checked bounded transition relation, and execution proves that destination's routine produced exactly the evidence/capture state named by the result.

type ExtendedEvidenceRoutineExecution indices (routine: List(ExtendedInstruction), input_evidence: List(Evidence), input_captures: List(CaptureFrame), output_evidence: List(Evidence), output_captures: List(CaptureFrame))

 type ExtendedEvidenceRoutineExecution indices (routine: List(ExtendedInstruction), input_evidence: List(Evidence), input_captures: List(CaptureFrame), output_evidence: List(Evidence), output_captures: List(CaptureFrame))
   ExtendedEvidenceDone : {input_evidence: List(Evidence)} -> {input_captures: List(CaptureFrame)} -> ExtendedEvidenceRoutineExecution(Nil(), input_evidence, input_captures, input_evidence, input_captures)
   ExtendedEvidenceObserve : (char: Char) -> {input_captures: List(CaptureFrame)} -> (suffix: ExtendedEvidenceRoutineExecution(rest, input_evidence, record_capture_char(input_captures, char), output_evidence, output_captures)) -> ExtendedEvidenceRoutineExecution(Cons(Observe(char), rest), input_evidence, input_captures, output_evidence, output_captures)
   ExtendedEvidenceRegular : (instruction: EvidenceInstruction) -> {input_evidence: List(Evidence)} -> {input_captures: List(CaptureFrame)} -> (suffix: ExtendedEvidenceRoutineExecution(rest, executed_evidence(execute_instruction(instruction, input_evidence, input_captures)), executed_captures(execute_instruction(instruction, input_evidence, input_captures)), output_evidence, output_captures)) -> ExtendedEvidenceRoutineExecution(Cons(Regular(instruction), rest), input_evidence, input_captures, output_evidence, output_captures)

enum ExtendedExecution

 enum ExtendedExecution
   ExtendedExecution

Thompson's evidence proof reasons over one NFA-independent instruction stream. Observe records the consumed character (and advances open capture frames); Regular embeds the existing VM instruction language.

enum ExtendedInstruction

 enum ExtendedInstruction
   Regular
   Observe

The generalized Thompson proof uses an NFA-independent stream. Observe advances capture input; Regular embeds the evidence VM language.

type ExtendedRoutineExecution indices (routine: List(ExtendedInstruction), input_current: Option(Char), input_evidence: List(Evidence), input_captures: List(CaptureFrame), output_current: Option(Char), output_evidence: List(Evidence), output_captures: List(CaptureFrame))

 type ExtendedRoutineExecution indices (routine: List(ExtendedInstruction), input_current: Option(Char), input_evidence: List(Evidence), input_captures: List(CaptureFrame), output_current: Option(Char), output_evidence: List(Evidence), output_captures: List(CaptureFrame))
   ExtendedRoutineExecuted : ExtendedRoutineExecution(routine, input_current, input_evidence, input_captures, extended_current(execute_extended_routine(routine, input_current, input_evidence, input_captures)), extended_evidence(execute_extended_routine(routine, input_current, input_evidence, input_captures)), extended_captures(execute_extended_routine(routine, input_current, input_evidence, input_captures)))

type InitialEvidenceStep(n, machine) indices (position: InitialPosition, input: List(Char), after_input: List(Char), destination_state: ThreadState(n), destination_evidence: List(Evidence), destination_captures: List(CaptureFrame))

 type InitialEvidenceStep(n, machine) indices (position: InitialPosition, input: List(Char), after_input: List(Char), destination_state: ThreadState(n), destination_evidence: List(Evidence), destination_captures: List(CaptureFrame))
   InitialEvidenceActive : (destination: Bounded(n)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (edge: ListMember(MachineState(n), Active(destination, routine, constraints), initial_machine_destinations(n, machine, position, input, after_input))) -> (execution: RoutineExecution(routine, Nil(), Nil(), result_evidence, result_captures)) -> InitialEvidenceStep(n, machine, position, input, after_input, ThreadActive(destination), result_evidence, result_captures)
   InitialEvidenceAccepted : (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (edge: ListMember(MachineState(n), Accepted(routine, constraints), initial_machine_destinations(n, machine, position, input, after_input))) -> (execution: RoutineExecution(routine, Nil(), Nil(), result_evidence, result_captures)) -> InitialEvidenceStep(n, machine, position, input, after_input, ThreadAccepted(), result_evidence, result_captures)

type ListMember(a) indices (value: a, values: List(a))

 type ListMember(a) indices (value: a, values: List(a))
   ListMemberHere : ListMember(a, value, Cons(value, rest))
   ListMemberThere : (prior: ListMember(a, value, rest)) -> ListMember(a, value, Cons(other, rest))

Intrinsic list membership. The witness is erased at every accepting-run boundary; its only purpose is to make every path edge name a destination that the checked transition relation actually produced.

type LookaheadDecision(n, machine) indices ()

 type LookaheadDecision(n, machine) indices ()
   LookaheadSatisfied : (witness: LookaheadWitness(n, machine)) -> LookaheadDecision(n, machine)
   LookaheadRefuted : (certificate: LookaheadRefutation(n, machine)) -> LookaheadDecision(n, machine)

type LookaheadDecisionEvidence

 type LookaheadDecisionEvidence

Nested assertion decisions are existentially packaged because each child machine has its own state-count index. They are proof metadata attached to a parent path; the path constructors erase the list after checking.

type LookaheadRefutation(n, machine) indices ()

 type LookaheadRefutation(n, machine) indices ()
   LookaheadSearchExhausted : {starts: List(MachineState(n))} -> (@erased depth : Nat) -> (input: List(Char)) -> (after_input: List(Char)) -> (history: List(Char)) -> (policy: NewlinePolicy) -> (@erased failure : LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)) -> LookaheadRefutation(n, machine)
   LookaheadDepthExhausted : (depth: Nat) -> (input: List(Char)) -> (history: List(Char)) -> (policy: NewlinePolicy) -> (@erased exhaustion : LookaroundExhaustion(n)) -> LookaheadRefutation(n, machine)

A decision is the only value consumed by an assertion constraint. A satisfied branch now carries an existential package containing the finite child path. Refuted branches still record the finite-search outcome (or an explicit resource/history boundary). The search refutation retains the complete child and sibling traversal tree; the remaining work is to prove its soundness and completeness against the machine semantics.

type LookaheadWitness(n, machine) indices ()

 type LookaheadWitness(n, machine) indices ()
   LookaheadWitnessPacked : {starts: List(MachineState(n))} -> {depth: Nat} -> {input: List(Char)} -> {after_input: List(Char)} -> {history: List(Char)} -> {policy: NewlinePolicy} -> (path: LookaroundPrefixSearchPath(depth, n, machine, starts, input, after_input, history, policy)) -> LookaheadWitness(n, machine)

type LookaroundAcceptingMembersResult(depth, n, machine, destinations, current) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))

 type LookaroundAcceptingMembersResult(depth, n, machine, destinations, current) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))
   LookaroundAcceptingMembersRejected : (failure: LookaroundPathFailure(depth, n, machine, input, after_input, state, history, capture_context, policy, destinations, current)) -> LookaroundAcceptingMembersResult(depth, n, machine, destinations, current, input, after_input, state, history, policy, capture_context)
   LookaroundAcceptingMembersFound : (path: LookaroundAcceptingPath(depth, n, machine, input, after_input, state, history, policy)) -> LookaroundAcceptingMembersResult(depth, n, machine, destinations, current, input, after_input, state, history, policy, capture_context)

Internal result for a destination-list traversal. Unlike the public result above, this carries the full destination list as a parameter, so recursive tail failures cannot escape as an unconstrained existential.

type LookaroundAcceptingPath(depth, n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy)

 type LookaroundAcceptingPath(depth, n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy)
   LookaroundAcceptedNow : LookaroundAcceptingPath(depth, n, machine, Nil(), after_input, ThreadAccepted(), history, policy)
   LookaroundAcceptedNextActive : (source: Bounded(n)) -> (char: Char) -> (rest: List(Char)) -> (destination: Bounded(n)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (capture_context: List(EvidenceInstruction)) -> (@erased nested_decisions : List(LookaroundNestedDecision)) -> (edge: ListMember(MachineState(n), Active(destination, routine, constraints), lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy))) -> (@erased suffix : LookaroundAcceptingPath(depth, n, machine, rest, after_input, ThreadActive(destination), history_push_bounded(history, char), policy)) -> LookaroundAcceptingPath(depth, n, machine, Cons(char, rest), after_input, ThreadActive(source), history, policy)
   LookaroundAcceptedNextAccepted : (source: Bounded(n)) -> (char: Char) -> (rest: List(Char)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (capture_context: List(EvidenceInstruction)) -> (@erased nested_decisions : List(LookaroundNestedDecision)) -> (edge: ListMember(MachineState(n), Accepted(routine, constraints), lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy))) -> (@erased suffix : LookaroundAcceptingPath(depth, n, machine, rest, after_input, ThreadAccepted(), history_push_bounded(history, char), policy)) -> LookaroundAcceptingPath(depth, n, machine, Cons(char, rest), after_input, ThreadActive(source), history, policy)

type LookaroundAcceptingPathResult(depth, n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))

 type LookaroundAcceptingPathResult(depth, n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))
   LookaroundAcceptingPathRejected : {remaining_destinations: List(MachineState(n))} -> (failure: LookaroundPathFailure(depth, n, machine, input, after_input, state, history, capture_context, policy, destinations, remaining_destinations)) -> LookaroundAcceptingPathResult(depth, n, machine, input, after_input, state, history, policy, capture_context)
   LookaroundAcceptingPathFound : (path: LookaroundAcceptingPath(depth, n, machine, input, after_input, state, history, policy)) -> LookaroundAcceptingPathResult(depth, n, machine, input, after_input, state, history, policy, capture_context)

type LookaroundCompilation indices (shape: ShapeCode)

 type LookaroundCompilation indices (shape: ShapeCode)
   LookaroundPredicate : (test: ((Char) -> Bool)) -> LookaroundCompilation(CharC)
   LookaroundEmpty : LookaroundCompilation(UnitC)
   LookaroundBoundary : (constraint: BoundaryConstraint) -> LookaroundCompilation(UnitC)
   LookaroundConcat : (left: LookaroundCompilation(left_shape)) -> (right: LookaroundCompilation(right_shape)) -> LookaroundCompilation(PairC(left_shape, right_shape))
   LookaroundGroup : (inner: LookaroundCompilation(inner_shape)) -> LookaroundCompilation(StringC)
   LookaroundGroupSlot : (slot: Nat) -> (inner: LookaroundCompilation(inner_shape)) -> LookaroundCompilation(StringC)
   LookaroundAlternate : (left: LookaroundCompilation(left_shape)) -> (right: LookaroundCompilation(right_shape)) -> (prefer_right: Bool) -> LookaroundCompilation(ChoiceC(left_shape, right_shape))
   LookaroundRepeat : (inner: LookaroundCompilation(inner_shape)) -> (lazy: Bool) -> LookaroundCompilation(ListC(inner_shape))
   LookaroundAtomic : (inner: LookaroundCompilation(inner_shape)) -> LookaroundCompilation(inner_shape)
   LookaroundGuard : (slot: Nat) -> (participated: Bool) -> (inner: LookaroundCompilation(inner_shape)) -> LookaroundCompilation(inner_shape)

Lookaround compilation is a runtime-only parallel IR. It preserves the same finite Thompson constructors as the ordinary proof IR, but adds an explicit atomic scope so assertion operands cannot silently erase ordered commitment when they cross an assertion boundary. The ordinary typed proof remains over ThompsonCompilation; this tree is consumed only by the checked finite assertion evaluator.

type LookaroundExhaustion(n) indices ()

 type LookaroundExhaustion(n) indices ()
   LookaroundExhausted : (@erased whole : List(MachineState(n))) -> (@erased members : MachineStateMembers(n, whole, Nil())) -> (token: Unit) -> LookaroundExhaustion(n)

Resource and history guards fail before a machine traversal exists. They retain the compact terminal witness used by the public decision types; ordinary search failures use the complete trees above.

enum LookaroundNestedDecision

 enum LookaroundNestedDecision
   LookaheadNestedDecision
   LookbehindNestedDecision

type LookaroundPathFailure(depth, n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, destinations: List(MachineState(n)), remaining_destinations: List(MachineState(n)))

 type LookaroundPathFailure(depth, n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, destinations: List(MachineState(n)), remaining_destinations: List(MachineState(n)))
   LookaroundPathExhausted : (source: Bounded(n)) -> (@erased members : MachineStateMembers(n, destinations, Nil())) -> (@erased destinations_equivalent : Equivalent(List(MachineState(n)), destinations, empty_machine_states(n))) -> LookaroundPathFailure(depth, n, machine, Nil(), after_input, ThreadActive(source), history, capture_context, policy, destinations, Nil())
   LookaroundPathStepExhausted : (char: Char) -> (rest: List(Char)) -> (source: Bounded(n)) -> (@erased members : MachineStateMembers(n, destinations, Nil())) -> (@erased destinations_equivalent : Equivalent(List(MachineState(n)), destinations, lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy))) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, ThreadActive(source), history, capture_context, policy, destinations, Nil())
   LookaroundPathAcceptedWithInput : LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, ThreadAccepted(), history, capture_context, policy, Nil(), Nil())
   LookaroundPathDestinationActiveRejected : {remaining_destinations: List(MachineState(n))} -> (char: Char) -> (rest: List(Char)) -> (destination: Bounded(n)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (edge: ListMember(MachineState(n), Active(destination, routine, constraints), destinations)) -> (@erased current_edge : ListMember(MachineState(n), Active(destination, routine, constraints), Cons(Active(destination, routine, constraints), remaining_destinations))) -> (@erased members : MachineStateMembers(n, destinations, Cons(Active(destination, routine, constraints), remaining_destinations))) -> (@erased child : LookaroundPathFailure(depth, n, machine, rest, after_input, ThreadActive(destination), history_push_bounded(history, char), append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations)) -> (@erased tail : LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, state, history, capture_context, policy, destinations, remaining_destinations)) -> (@erased destinations_equivalent : Equivalent(List(MachineState(n)), destinations, lookaround_machine_destinations(depth, n, machine, source, char, rest, after_input, history, capture_context, policy))) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, state, history, capture_context, policy, destinations, Cons(Active(destination, routine, constraints), remaining_destinations))
   LookaroundPathDestinationAcceptedRejected : {remaining_destinations: List(MachineState(n))} -> (char: Char) -> (rest: List(Char)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (edge: ListMember(MachineState(n), Accepted(routine, constraints), destinations)) -> (@erased current_edge : ListMember(MachineState(n), Accepted(routine, constraints), Cons(Accepted(routine, constraints), remaining_destinations))) -> (@erased members : MachineStateMembers(n, destinations, Cons(Accepted(routine, constraints), remaining_destinations))) -> (@erased child : LookaroundPathFailure(depth, n, machine, rest, after_input, ThreadAccepted(), history_push_bounded(history, char), append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations)) -> (@erased tail : LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, state, history, capture_context, policy, destinations, remaining_destinations)) -> (@erased destinations_equivalent : Equivalent(List(MachineState(n)), destinations, lookaround_machine_destinations(depth, n, machine, source, char, rest, after_input, history, capture_context, policy))) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, state, history, capture_context, policy, destinations, Cons(Accepted(routine, constraints), remaining_destinations))

Capture-free assertion paths carry state reachability plus an erased list of the nested decisions used by each accepted transition. The depth index is the same guard used by the evaluator: each nested assertion consumes one level and zero fuel cannot manufacture a child path. A failed path records the complete finite traversal below one thread. Destination failures retain the child rejection and the tail rejection; the only terminal constructor is reached with a structurally exhausted MachineStateMembers witness. The capture context is indexed because nested capture-condition checks must be refuted in the same environment that produced the destination list.

type LookaroundPrefixMembersResult(depth, n, machine, destinations, current) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))

 type LookaroundPrefixMembersResult(depth, n, machine, destinations, current) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))
   LookaroundPrefixMembersRejected : (failure: LookaroundPathFailure(depth, n, machine, input, after_input, state, history, capture_context, policy, destinations, current)) -> LookaroundPrefixMembersResult(depth, n, machine, destinations, current, input, after_input, state, history, policy, capture_context)
   LookaroundPrefixMembersFound : (path: LookaroundPrefixPath(depth, n, machine, input, after_input, state, history, policy)) -> LookaroundPrefixMembersResult(depth, n, machine, destinations, current, input, after_input, state, history, policy, capture_context)

type LookaroundPrefixPath(depth, n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy)

 type LookaroundPrefixPath(depth, n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy)
   LookaroundPrefixAccepted : LookaroundPrefixPath(depth, n, machine, input, after_input, ThreadAccepted(), history, policy)
   LookaroundPrefixNextActive : (source: Bounded(n)) -> (char: Char) -> (rest: List(Char)) -> (destination: Bounded(n)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (capture_context: List(EvidenceInstruction)) -> (@erased nested_decisions : List(LookaroundNestedDecision)) -> (edge: ListMember(MachineState(n), Active(destination, routine, constraints), lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy))) -> (@erased suffix : LookaroundPrefixPath(depth, n, machine, rest, after_input, ThreadActive(destination), history_push_bounded(history, char), policy)) -> LookaroundPrefixPath(depth, n, machine, Cons(char, rest), after_input, ThreadActive(source), history, policy)
   LookaroundPrefixNextAccepted : (source: Bounded(n)) -> (char: Char) -> (rest: List(Char)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (capture_context: List(EvidenceInstruction)) -> (@erased nested_decisions : List(LookaroundNestedDecision)) -> (edge: ListMember(MachineState(n), Accepted(routine, constraints), lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy))) -> (@erased suffix : LookaroundPrefixPath(depth, n, machine, rest, after_input, ThreadAccepted(), history_push_bounded(history, char), policy)) -> LookaroundPrefixPath(depth, n, machine, Cons(char, rest), after_input, ThreadActive(source), history, policy)

type LookaroundPrefixPathResult(depth, n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))

 type LookaroundPrefixPathResult(depth, n, machine) indices (input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))
   LookaroundPrefixPathRejected : {remaining_destinations: List(MachineState(n))} -> (failure: LookaroundPathFailure(depth, n, machine, input, after_input, state, history, capture_context, policy, destinations, remaining_destinations)) -> LookaroundPrefixPathResult(depth, n, machine, input, after_input, state, history, policy, capture_context)
   LookaroundPrefixPathFound : (path: LookaroundPrefixPath(depth, n, machine, input, after_input, state, history, policy)) -> LookaroundPrefixPathResult(depth, n, machine, input, after_input, state, history, policy, capture_context)

type LookaroundPrefixSearchMembersResult(depth, n, machine, starts) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))

 type LookaroundPrefixSearchMembersResult(depth, n, machine, starts) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))
   LookaroundPrefixSearchMembersRejected : (failure: LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)) -> LookaroundPrefixSearchMembersResult(depth, n, machine, starts, input, after_input, history, policy, capture_context)
   LookaroundPrefixSearchMembersFound : (path: LookaroundPrefixSearchPath(depth, n, machine, starts, input, after_input, history, policy)) -> LookaroundPrefixSearchMembersResult(depth, n, machine, starts, input, after_input, history, policy, capture_context)

type LookaroundPrefixSearchPath(depth, n, machine, starts) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy)

 type LookaroundPrefixSearchPath(depth, n, machine, starts) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy)
   LookaroundPrefixSearchFoundActive : (state: Bounded(n)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (@erased member : ListMember(MachineState(n), Active(state, routine, constraints), starts)) -> (@erased path : LookaroundPrefixPath(depth, n, machine, input, after_input, ThreadActive(state), history, policy)) -> LookaroundPrefixSearchPath(depth, n, machine, starts, input, after_input, history, policy)
   LookaroundPrefixSearchFoundAccepted : (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (@erased member : ListMember(MachineState(n), Accepted(routine, constraints), starts)) -> (@erased path : LookaroundPrefixPath(depth, n, machine, input, after_input, ThreadAccepted(), history, policy)) -> LookaroundPrefixSearchPath(depth, n, machine, starts, input, after_input, history, policy)

type LookaroundPrefixSearchResult(depth, n, machine) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))

 type LookaroundPrefixSearchResult(depth, n, machine) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))
   LookaroundPrefixSearchResultRejected : {starts: List(MachineState(n))} -> (failure: LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)) -> LookaroundPrefixSearchResult(depth, n, machine, input, after_input, history, policy, capture_context)
   LookaroundPrefixSearchResultFound : {starts: List(MachineState(n))} -> (path: LookaroundPrefixSearchPath(depth, n, machine, starts, input, after_input, history, policy)) -> LookaroundPrefixSearchResult(depth, n, machine, input, after_input, history, policy, capture_context)

enum LookaroundRoutineSearchResult

 enum LookaroundRoutineSearchResult
   LookaroundRoutineSearchNo
   LookaroundRoutineSearchCommit
   LookaroundRoutineSearchYes

Capture-aware assertion replay uses the same ordered commitment relation as atomic_lookaround_accepts, but returns the selected finite routine. The routine is replayed only by the named-capture side channel; the typed matcher continues to consume the checked assertion path and never derives a result from this replay value.

type LookaroundSearchFailure(depth, n, machine) indices (input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)))

 type LookaroundSearchFailure(depth, n, machine) indices (input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)))
   LookaroundSearchExhausted : (@erased members : MachineStateMembers(n, starts, Nil())) -> LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)
   LookaroundSearchActiveRejected : {remaining_starts: List(MachineState(n))} -> (state: Bounded(n)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (member: ListMember(MachineState(n), Active(state, routine, constraints), starts)) -> (@erased members : MachineStateMembers(n, starts, Cons(Active(state, routine, constraints), remaining_starts))) -> (@erased child : LookaroundPathFailure(depth, n, machine, input, after_input, ThreadActive(state), history, append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations)) -> (@erased tail : LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)) -> LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)
   LookaroundSearchAcceptedRejected : {remaining_starts: List(MachineState(n))} -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (member: ListMember(MachineState(n), Accepted(routine, constraints), starts)) -> (@erased members : MachineStateMembers(n, starts, Cons(Accepted(routine, constraints), remaining_starts))) -> (@erased child : LookaroundPathFailure(depth, n, machine, input, after_input, ThreadAccepted(), history, append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations)) -> (@erased tail : LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)) -> LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)

A complete failed start-list traversal. A start cannot be dropped from a refutation: the corresponding child path failure and the tail failure are both required before the terminal member proof can be returned.

type LookaroundSearchMembersResult(depth, n, machine, starts) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))

 type LookaroundSearchMembersResult(depth, n, machine, starts) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))
   LookaroundSearchMembersRejected : (failure: LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)) -> LookaroundSearchMembersResult(depth, n, machine, starts, input, after_input, history, policy, capture_context)
   LookaroundSearchMembersFound : (path: LookaroundSearchPath(depth, n, machine, starts, input, after_input, history, policy)) -> LookaroundSearchMembersResult(depth, n, machine, starts, input, after_input, history, policy, capture_context)

type LookaroundSearchPath(depth, n, machine, starts) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy)

 type LookaroundSearchPath(depth, n, machine, starts) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy)
   LookaroundSearchFoundActive : (state: Bounded(n)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (@erased member : ListMember(MachineState(n), Active(state, routine, constraints), starts)) -> (@erased path : LookaroundAcceptingPath(depth, n, machine, input, after_input, ThreadActive(state), history, policy)) -> LookaroundSearchPath(depth, n, machine, starts, input, after_input, history, policy)
   LookaroundSearchFoundAccepted : (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (@erased member : ListMember(MachineState(n), Accepted(routine, constraints), starts)) -> (@erased path : LookaroundAcceptingPath(depth, n, machine, input, after_input, ThreadAccepted(), history, policy)) -> LookaroundSearchPath(depth, n, machine, starts, input, after_input, history, policy)

type LookaroundSearchResult(depth, n, machine) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))

 type LookaroundSearchResult(depth, n, machine) indices (input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, capture_context: List(EvidenceInstruction))
   LookaroundSearchResultRejected : {starts: List(MachineState(n))} -> (failure: LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)) -> LookaroundSearchResult(depth, n, machine, input, after_input, history, policy, capture_context)
   LookaroundSearchResultFound : {starts: List(MachineState(n))} -> (path: LookaroundSearchPath(depth, n, machine, starts, input, after_input, history, policy)) -> LookaroundSearchResult(depth, n, machine, input, after_input, history, policy, capture_context)

type LookbehindDecision(n, machine) indices ()

 type LookbehindDecision(n, machine) indices ()
   LookbehindSatisfied : (witness: LookbehindWitness(n, machine)) -> LookbehindDecision(n, machine)
   LookbehindRefuted : (certificate: LookbehindRefutation(n, machine)) -> LookbehindDecision(n, machine)

type LookbehindDecisionEvidence

 type LookbehindDecisionEvidence

type LookbehindRefutation(n, machine) indices ()

 type LookbehindRefutation(n, machine) indices ()
   LookbehindSearchExhausted : {starts: List(MachineState(n))} -> (@erased depth : Nat) -> (input: List(Char)) -> (after_input: List(Char)) -> (history: List(Char)) -> (policy: NewlinePolicy) -> (@erased failure : LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)) -> LookbehindRefutation(n, machine)
   LookbehindDepthExhausted : (depth: Nat) -> (input: List(Char)) -> (history: List(Char)) -> (policy: NewlinePolicy) -> (@erased exhaustion : LookaroundExhaustion(n)) -> LookbehindRefutation(n, machine)
   LookbehindHistoryUnavailable : (width: Nat) -> (history: List(Char)) -> (policy: NewlinePolicy) -> (@erased exhaustion : LookaroundExhaustion(n)) -> LookbehindRefutation(n, machine)

type LookbehindWitness(n, machine) indices ()

 type LookbehindWitness(n, machine) indices ()
   LookbehindWitnessPacked : {starts: List(MachineState(n))} -> {depth: Nat} -> {input: List(Char)} -> {after_input: List(Char)} -> {history: List(Char)} -> {policy: NewlinePolicy} -> (path: LookaroundSearchPath(depth, n, machine, starts, input, after_input, history, policy)) -> LookbehindWitness(n, machine)

type MachineAcceptance(n, machine) indices (position: InitialPosition, input: List(Char), after_input: List(Char), final_evidence: List(Evidence), extended_routine: List(ExtendedInstruction))

 type MachineAcceptance(n, machine) indices (position: InitialPosition, input: List(Char), after_input: List(Char), final_evidence: List(Evidence), extended_routine: List(ExtendedInstruction))
   MachineAccepted : (destination: MachineState(n)) -> (initial_evidence: List(Evidence)) -> (initial_captures: List(CaptureFrame)) -> (path_routine: List(ExtendedInstruction)) -> (edge: ListMember(MachineState(n), destination, initial_machine_destinations(n, machine, position, input, after_input))) -> (execution: RoutineExecution(machine_state_routine(n, destination), Nil(), Nil(), initial_evidence, initial_captures)) -> (routine_certificate: CertifiedPathRoutine(append_extended_routines(regular_routine(machine_state_routine(n, destination)), path_routine), Nil(), Nil(), final_evidence)) -> (path: AcceptingFrom(n, machine, input, after_input, machine_state_thread(n, destination), initial_evidence, initial_captures, final_evidence, path_routine)) -> MachineAcceptance(n, machine, position, input, after_input, final_evidence, append_extended_routines(regular_routine(machine_state_routine(n, destination)), path_routine))

type MachineAcceptingSearch(n, machine) indices (position: InitialPosition, input: List(Char), after_input: List(Char))

 type MachineAcceptingSearch(n, machine) indices (position: InitialPosition, input: List(Char), after_input: List(Char))
   MachineNoAcceptingPath : MachineAcceptingSearch(n, machine, position, input, after_input)
   MachineAcceptingPath : (final_evidence: List(Evidence)) -> (extended_routine: List(ExtendedInstruction)) -> (@erased acceptance : MachineAcceptance(n, machine, position, input, after_input, final_evidence, extended_routine)) -> MachineAcceptingSearch(n, machine, position, input, after_input)

type MachineStateMembers(n) indices (whole: List(MachineState(n)), remaining_values: List(MachineState(n)))

 type MachineStateMembers(n) indices (whole: List(MachineState(n)), remaining_values: List(MachineState(n)))
   MachineStateMembersNil : MachineStateMembers(n, whole, Nil())
   MachineStateMembersActive : (state: Bounded(n)) -> (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (member: ListMember(MachineState(n), Active(state, routine, constraints), whole)) -> (remaining: MachineStateMembers(n, whole, values)) -> MachineStateMembers(n, whole, Cons(Active(state, routine, constraints), values))
   MachineStateMembersAccepted : (routine: List(EvidenceInstruction)) -> (constraints: List(BoundaryConstraint)) -> (member: ListMember(MachineState(n), Accepted(routine, constraints), whole)) -> (remaining: MachineStateMembers(n, whole, values)) -> MachineStateMembers(n, whole, Cons(Accepted(routine, constraints), values))

A candidate list whose every element is paired with erased evidence that it belongs to the original transition result. State and proof are introduced by the same constructor, so dependent pattern refinement never has to relate two sibling scrutinees.

enum Match

 enum Match
   Match

Match positions are zero-based Unicode-scalar offsets, not UTF-8 byte offsets. start and length are native Int values so large subjects do not allocate unary Nat structures at runtime.

enum NamedCapture

 enum NamedCapture
   NamedCapture

enum NamedCaptureExecution

 enum NamedCaptureExecution
   NamedCaptureExecution

enum NamedCaptureFrame

 enum NamedCaptureFrame
   NamedCaptureFrame

A named replay is deliberately separate from the evidence VM. The ordinary certificate still proves the typed evidence; this effect-free interpreter replays the same certified routine and records only slot participation/text. No host regex engine or second language semantics is involved.

enum NamedCaptureLedgerEntry

 enum NamedCaptureLedgerEntry
   NamedCaptureLedgerEntry

type NamedCompilationErasure indices (shape: ShapeCode, named: NamedThompsonCompilation(shape), ordinary: ThompsonCompilation(shape))

 type NamedCompilationErasure indices (shape: ShapeCode, named: NamedThompsonCompilation(shape), ordinary: ThompsonCompilation(shape))
   NamedPredicateErasure : NamedCompilationErasure(CharC, NamedThompsonPredicate(test), ThompsonPredicate(test))
   NamedEmptyErasure : NamedCompilationErasure(UnitC, NamedThompsonEmpty(), ThompsonEmpty())
   NamedBoundaryErasure : NamedCompilationErasure(UnitC, NamedThompsonBoundary(constraint), ThompsonBoundary(constraint))
   NamedConcatErasure : {left_shape: ShapeCode} -> {right_shape: ShapeCode} -> {left_named: NamedThompsonCompilation(left_shape)} -> {right_named: NamedThompsonCompilation(right_shape)} -> {left_ordinary: ThompsonCompilation(left_shape)} -> {right_ordinary: ThompsonCompilation(right_shape)} -> (@erased left : NamedCompilationErasure(left_shape, left_named, left_ordinary)) -> (@erased right : NamedCompilationErasure(right_shape, right_named, right_ordinary)) -> NamedCompilationErasure(PairC(left_shape, right_shape), NamedThompsonConcat(left_named, right_named), ThompsonConcat(left_ordinary, right_ordinary))
   NamedCaptureErasure : {inner_shape: ShapeCode} -> {inner_named: NamedThompsonCompilation(inner_shape)} -> {inner_ordinary: ThompsonCompilation(inner_shape)} -> (@erased inner : NamedCompilationErasure(inner_shape, inner_named, inner_ordinary)) -> NamedCompilationErasure(StringC, NamedThompsonCapture(inner_named), ThompsonGroup(inner_ordinary))
   NamedGroupErasure : {inner_shape: ShapeCode} -> {inner_named: NamedThompsonCompilation(inner_shape)} -> {inner_ordinary: ThompsonCompilation(inner_shape)} -> (slot: Nat) -> (@erased inner : NamedCompilationErasure(inner_shape, inner_named, inner_ordinary)) -> NamedCompilationErasure(StringC, NamedThompsonGroup(slot, inner_named), ThompsonGroup(inner_ordinary))
   NamedGuardErasure : {inner_shape: ShapeCode} -> {inner_named: NamedThompsonCompilation(inner_shape)} -> {inner_ordinary: ThompsonCompilation(inner_shape)} -> (slot: Nat) -> (participated: Bool) -> (@erased inner : NamedCompilationErasure(inner_shape, inner_named, inner_ordinary)) -> NamedCompilationErasure(inner_shape, NamedThompsonGuard(slot, participated, inner_named), inner_ordinary)
   NamedAlternateErasure : {left_shape: ShapeCode} -> {right_shape: ShapeCode} -> {left_named: NamedThompsonCompilation(left_shape)} -> {right_named: NamedThompsonCompilation(right_shape)} -> {left_ordinary: ThompsonCompilation(left_shape)} -> {right_ordinary: ThompsonCompilation(right_shape)} -> (@erased left : NamedCompilationErasure(left_shape, left_named, left_ordinary)) -> (@erased right : NamedCompilationErasure(right_shape, right_named, right_ordinary)) -> (prefer_right: Bool) -> NamedCompilationErasure(ChoiceC(left_shape, right_shape), NamedThompsonAlternate(left_named, right_named, prefer_right), ThompsonAlternate(left_ordinary, right_ordinary, prefer_right))
   NamedRepeatErasure : {inner_shape: ShapeCode} -> {inner_named: NamedThompsonCompilation(inner_shape)} -> {inner_ordinary: ThompsonCompilation(inner_shape)} -> (@erased inner : NamedCompilationErasure(inner_shape, inner_named, inner_ordinary)) -> (lazy: Bool) -> NamedCompilationErasure(ListC(inner_shape), NamedThompsonRepeat(inner_named, lazy), ThompsonRepeat(inner_ordinary, lazy))

Erasure certificate: every named compilation has exactly the ordinary Thompson compilation obtained by dropping slot IDs. This is the bridge used by the typed proof path; capture metadata cannot alter language.

enum NamedMachineSearch

 enum NamedMachineSearch
   NamedMachineNoPath
   NamedMachinePath

Runtime-only search for named machines. The ordinary search above is indexed by the evidence theorem and intentionally has no capture-guard parameter. Named search carries only the replay routine, while preserving the same ordered destination traversal and boundary calculations.

enum NamedMatch

 enum NamedMatch
   NamedMatch

enum NamedParse

 enum NamedParse
   NamedParse

enum NamedPrefixCapture

 enum NamedPrefixCapture
   NamedPrefixCapture

enum NamedPrefixSearch

 enum NamedPrefixSearch
   NamedNoPrefix
   NamedPrefixPath

type NamedRegex(result) indices (shape: ShapeCode)

 type NamedRegex(result) indices (shape: ShapeCode)
   NamedRegex : Regex(result) -> NamedThompsonCompilation(shape) -> LookaroundCompilation(shape) -> CaptureLayout -> Bool -> NewlinePolicy -> NamedRegex(result, shape)

The public result type and the checked Thompson shape are independent: conversions may expose Option, List, or a simplified tuple while the machine still carries its constructor-preserving shape. Keep the machine shape as an explicit index instead of letting it unify accidentally with the public result (which would reject optional/one-or-more captures).

type NamedThompsonCompilation indices (shape: ShapeCode)

 type NamedThompsonCompilation indices (shape: ShapeCode)
   NamedThompsonPredicate : (test: ((Char) -> Bool)) -> NamedThompsonCompilation(CharC)
   NamedThompsonEmpty : NamedThompsonCompilation(UnitC)
   NamedThompsonBoundary : (constraint: BoundaryConstraint) -> NamedThompsonCompilation(UnitC)
   NamedThompsonConcat : (left: NamedThompsonCompilation(left_shape)) -> (right: NamedThompsonCompilation(right_shape)) -> NamedThompsonCompilation(PairC(left_shape, right_shape))
   NamedThompsonCapture : (inner: NamedThompsonCompilation(inner_shape)) -> NamedThompsonCompilation(StringC)
   NamedThompsonGroup : (slot: Nat) -> (inner: NamedThompsonCompilation(inner_shape)) -> NamedThompsonCompilation(StringC)
   NamedThompsonGuard : (slot: Nat) -> (participated: Bool) -> (inner: NamedThompsonCompilation(inner_shape)) -> NamedThompsonCompilation(inner_shape)
   NamedThompsonAlternate : (left: NamedThompsonCompilation(left_shape)) -> (right: NamedThompsonCompilation(right_shape)) -> (prefer_right: Bool) -> NamedThompsonCompilation(ChoiceC(left_shape, right_shape))
   NamedThompsonRepeat : (inner: NamedThompsonCompilation(inner_shape)) -> (lazy: Bool) -> NamedThompsonCompilation(ListC(inner_shape))

Named compilation is constructor-for-constructor parallel to the checked Thompson tree. Only group nodes differ: they carry the explicit slot ID used by the capture ledger. Erasing the IDs recovers the ordinary compilation, so language proofs can remain independent of names.

enum OneOrMore

 enum OneOrMore
   OneOrMore

Public typed combinator layer. Mapped is the semantic bridge from a structurally extracted Pattern value to the user-facing result type. It is one-way: regex parsing does not imply an unparser.

enum PosixClass

 enum PosixClass
   PosixAlnum
   PosixAlpha
   PosixAscii
   PosixBlank
   PosixCntrl
   PosixDigit
   PosixGraph
   PosixLower
   PosixPrint
   PosixPunct
   PosixSpace
   PosixUpper
   PosixWord
   PosixXdigit

enum PosixClassMatch

 enum PosixClassMatch
   PosixClassMatch

type Regex indices (result: Type)

 type Regex indices (result: Type)
   FromPattern : (shape: ShapeCode) -> Pattern(shape) -> Regex(Sem(shape))
   StagedRegex : (shape: ShapeCode) -> Pattern(shape) -> ThompsonCompilation(shape) -> StagedMachine(shape) -> Conversion(Sem(shape), result) -> Regex(result)
   Mapped : Function(a, b) -> Regex(a) -> Regex(b)
   Concatenated : Regex(a) -> Regex(b) -> Regex(Tuple(a, b))
   Alternated : Regex(a) -> Regex(b) -> Regex(Choice(a, b))
   Repeated : Regex(a) -> Regex(List(a))
   MatchedText : Regex(a) -> Regex(String)
   KeptRight : Regex(a) -> Regex(b) -> Regex(b)
   KeptLeft : Regex(a) -> Regex(b) -> Regex(a)
   SameAlternative : Regex(a) -> Regex(a) -> Regex(a)
   OptionalRegex : Regex(a) -> Regex(Option(a))
   OneOrMoreRegex : Regex(a) -> Regex(OneOrMore(a))
   SimplifiedRegex : (shape: ShapeCode) -> Regex(Sem(shape)) -> Regex(Sem(Simplify(shape)))
   OptionalPattern : Regex(a) -> Regex(Choice(a, Unit))
   PlusPattern : Regex(a) -> Regex(List(a))
   RepeatedPattern : Regex(a) -> Bool -> Regex(List(a))
   OneOrMorePattern : Regex(a) -> Bool -> Regex(List(a))
   OptionalLiteral : Regex(a) -> Bool -> Regex(Choice(a, Unit))
   ConfiguredRegex : RegexOptions -> Regex(a) -> Regex(a)
   StartAnchor : Bool -> Regex(Unit)
   EndAnchor : Bool -> Regex(Unit)
   StrictEndAnchor : Regex(Unit)

enum RegexOptions

 enum RegexOptions
   RegexOptions

Elixir-compatible literal modifiers, in i m s x u f U order. Repeated letters are idempotent and modifier order is irrelevant. No accepted flag is metadata-only: each one must affect parsing or machine execution.

type RegexProgram indices (result: Type)

 type RegexProgram indices (result: Type)
   BuiltRegex : (shape: ShapeCode) -> Pattern(shape) -> Conversion(Sem(shape), result) -> CompilationHint(shape) -> RegexProgram(result)

type RoutineExecution indices (routine: List(EvidenceInstruction), input_evidence: List(Evidence), input_captures: List(CaptureFrame), output_evidence: List(Evidence), output_captures: List(CaptureFrame))

 type RoutineExecution indices (routine: List(EvidenceInstruction), input_evidence: List(Evidence), input_captures: List(CaptureFrame), output_evidence: List(Evidence), output_captures: List(CaptureFrame))
   RoutineDone : {evidence: List(Evidence)} -> {captures: List(CaptureFrame)} -> RoutineExecution(Nil(), evidence, captures, evidence, captures)
   RoutineStep : (instruction: EvidenceInstruction) -> {input_evidence: List(Evidence)} -> {input_captures: List(CaptureFrame)} -> (suffix: RoutineExecution(rest, executed_evidence(execute_instruction(instruction, input_evidence, input_captures)), executed_captures(execute_instruction(instruction, input_evidence, input_captures)), output_evidence, output_captures)) -> RoutineExecution(Cons(instruction, rest), input_evidence, input_captures, output_evidence, output_captures)

enum SplitInclusion

 enum SplitInclusion
   ExcludeSeparators
   IncludeSeparators

enum SplitLimit

 enum SplitLimit
   UnlimitedSplit
   AtMostSplitParts

enum SplitOptions

 enum SplitOptions
   SplitOptions

enum SplitTrimming

 enum SplitTrimming
   KeepEmptyParts
   TrimEmptyParts

type StagedMachine indices (shape: ShapeCode)

 type StagedMachine indices (shape: ShapeCode)
   StagedMachineValue : (compilation: ThompsonCompilation(shape)) -> StagedMachine(shape)
   StagedAtomicPatternValue : (plan: AtomicRuntimePattern(shape)) -> StagedMachine(shape)
   StagedLookaroundValue : (pattern: Pattern(shape)) -> (compilation: LookaroundCompilation(shape)) -> (policy: NewlinePolicy) -> StagedMachine(shape)

A staged literal carries its checked machine and the erased equality that relates that machine to the canonical Thompson construction. The wrapper is indexed by the public shape (rather than by the dependent compilation itself) because that is the representation the constructor elaborator can refine without introducing an existential dependent constructor.

type StagedRows(n) indices ()

 type StagedRows(n) indices ()
   StagedRowsValue : (starts: List(MachineState(n))) -> (rows: TransitionRows(n)) -> StagedRows(n)

type ThompsonCompilation indices (shape: ShapeCode)

 type ThompsonCompilation indices (shape: ShapeCode)
   ThompsonPredicate : (test: ((Char) -> Bool)) -> ThompsonCompilation(CharC)
   ThompsonEmpty : ThompsonCompilation(UnitC)
   ThompsonBoundary : (constraint: BoundaryConstraint) -> ThompsonCompilation(UnitC)
   ThompsonConcat : (left: ThompsonCompilation(left_shape)) -> (right: ThompsonCompilation(right_shape)) -> ThompsonCompilation(PairC(left_shape, right_shape))
   ThompsonGroup : (inner: ThompsonCompilation(inner_shape)) -> ThompsonCompilation(StringC)
   ThompsonAlternate : (left: ThompsonCompilation(left_shape)) -> (right: ThompsonCompilation(right_shape)) -> (prefer_right: Bool) -> ThompsonCompilation(ChoiceC(left_shape, right_shape))
   ThompsonRepeat : (inner: ThompsonCompilation(inner_shape)) -> (lazy: Bool) -> ThompsonCompilation(ListC(inner_shape))

Constructor-preserving Thompson IR. Both runtime compilation and the evidence theorem consume this same tree, so proof code never reconstructs machine provenance from a function-valued transition table.

enum ThreadWinnerTable

 enum ThreadWinnerTable
   ThreadWinnerTable

enum UnicodeProperty

 enum UnicodeProperty
   PropertyAny
   PropertyLetter
   PropertyLowercaseLetter
   PropertyUppercaseLetter
   PropertyTitlecaseLetter
   PropertyModifierLetter
   PropertyOtherLetter
   PropertyMark
   PropertySpacingMark
   PropertyEnclosingMark
   PropertyNonspacingMark
   PropertyNumber
   PropertyDecimalNumber
   PropertyLetterNumber
   PropertyOtherNumber
   PropertyPunctuation
   PropertyConnectorPunctuation
   PropertyDashPunctuation
   PropertyClosePunctuation
   PropertyFinalPunctuation
   PropertyInitialPunctuation
   PropertyOtherPunctuation
   PropertyOpenPunctuation
   PropertySymbol
   PropertyCurrencySymbol
   PropertyModifierSymbol
   PropertyMathSymbol
   PropertyOtherSymbol
   PropertySeparator
   PropertyLineSeparator
   PropertyParagraphSeparator
   PropertySpaceSeparator
   PropertyOther
   PropertyControl
   PropertyFormat
   PropertyUnassigned
   PropertyPrivateUse
   PropertySurrogate

enum UnicodePropertyMatch

 enum UnicodePropertyMatch
   UnicodePropertyMatch

Functions

active_winner_seen(n: Nat, slots: ActiveWinnerSlots, index: Bounded(n)) -> Bool

 fn active_winner_seen(n: Nat, slots: ActiveWinnerSlots, index: Bounded(n)) -> Bool

Return true if an active thread at state has already been recorded in slots.

advance_initial_position(position: InitialPosition, input: List(Char)) -> InitialPosition

 fn advance_initial_position(position: InitialPosition, input: List(Char)) -> InitialPosition

Advance a Position by consuming a list of characters with the default policy.

advance_initial_position_with_policy(position: InitialPosition, input: List(Char), policy: NewlinePolicy) -> InitialPosition

 fn advance_initial_position_with_policy(position: InitialPosition, input: List(Char), policy: NewlinePolicy) -> InitialPosition

Advance a Position by a list of characters using an explicit newline policy.

alternate(a: Type, b: Type, left: Regex(a), right: Regex(b)) -> Regex(Choice(a, b))

 fn alternate(a: Type, b: Type, left: Regex(a), right: Regex(b)) -> Regex(Choice(a, b))

Match left or right, tagging the winning branch in a Choice.

alternate_left_injection_is_widening(left_count: Nat, right_count: Nat, state: Bounded(left_count)) -> Equivalent(Bounded(plus(left_count, right_count)), inject_alternate_left(left_count, right_count, state), inject_left_at(left_count, right_count, state))

 fn alternate_left_injection_is_widening(left_count: Nat, right_count: Nat, state: Bounded(left_count)) -> Equivalent(Bounded(plus(left_count, right_count)), inject_alternate_left(left_count, right_count, state), inject_left_at(left_count, right_count, state))

Proof that inject_alternate_left equals widen_left.

alternate_left_states(left_count: Nat, right_count: Nat, states: List(MachineState(left_count)), marker: EvidenceInstruction) -> List(MachineState(plus(left_count, right_count)))

 fn alternate_left_states(left_count: Nat, right_count: Nat, states: List(MachineState(left_count)), marker: EvidenceInstruction) -> List(MachineState(plus(left_count, right_count)))

Inject left-branch states into an alternation and tag them with marker.

alternate_left_widening_is_injection(left_count: Nat, right_count: Nat, state: Bounded(left_count)) -> Equivalent(Bounded(plus(left_count, right_count)), inject_left_at(left_count, right_count, state), inject_alternate_left(left_count, right_count, state))

 fn alternate_left_widening_is_injection(left_count: Nat, right_count: Nat, state: Bounded(left_count)) -> Equivalent(Bounded(plus(left_count, right_count)), inject_left_at(left_count, right_count, state), inject_alternate_left(left_count, right_count, state))

Proof that widen_left equals inject_alternate_left.

alternate_machine_next(left_count: Nat, right_count: Nat, left_next: Function(Bounded(left_count), Function(Char, List(MachineState(left_count)))), right_next: Function(Bounded(right_count), Function(Char, List(MachineState(right_count)))), state: Bounded(plus(left_count, right_count)), char: Char) -> List(MachineState(plus(left_count, right_count)))

 fn alternate_machine_next(left_count: Nat, right_count: Nat, left_next: Function(Bounded(left_count), Function(Char, List(MachineState(left_count)))), right_next: Function(Bounded(right_count), Function(Char, List(MachineState(right_count)))), state: Bounded(plus(left_count, right_count)), char: Char) -> List(MachineState(plus(left_count, right_count)))

Transition function for an alternation of two submachines.

alternate_machine_next_from_side(left_count: Nat, right_count: Nat, left_next: Function(Bounded(left_count), Function(Char, List(MachineState(left_count)))), right_next: Function(Bounded(right_count), Function(Char, List(MachineState(right_count)))), side: BoundedSum(left_count, right_count), char: Char) -> List(MachineState(plus(left_count, right_count)))

 fn alternate_machine_next_from_side(left_count: Nat, right_count: Nat, left_next: Function(Bounded(left_count), Function(Char, List(MachineState(left_count)))), right_next: Function(Bounded(right_count), Function(Char, List(MachineState(right_count)))), side: BoundedSum(left_count, right_count), char: Char) -> List(MachineState(plus(left_count, right_count)))

Dispatch an alternation transition after classifying the state as left or right.

alternate_machine_starts(left_count: Nat, right_count: Nat, left_starts: List(MachineState(left_count)), right_starts: List(MachineState(right_count)), prefer_right: Bool) -> List(MachineState(plus(left_count, right_count)))

 fn alternate_machine_starts(left_count: Nat, right_count: Nat, left_starts: List(MachineState(left_count)), right_starts: List(MachineState(right_count)), prefer_right: Bool) -> List(MachineState(plus(left_count, right_count)))

Compute the combined start states of an alternation submachine.

alternate_pattern_machine(left_count: Nat, left_machine: PatternMachine(left_count), right_count: Nat, right_machine: PatternMachine(right_count), prefer_right: Bool) -> PatternMachine(plus(left_count, right_count))

 fn alternate_pattern_machine(left_count: Nat, left_machine: PatternMachine(left_count), right_count: Nat, right_machine: PatternMachine(right_count), prefer_right: Bool) -> PatternMachine(plus(left_count, right_count))

Construct the PatternMachine for alternating two submachines.

alternate_right_injection_is_inject_right(left_count: Nat, right_count: Nat, state: Bounded(right_count)) -> Equivalent(Bounded(plus(left_count, right_count)), inject_alternate_right(left_count, right_count, state), inject_right_at(left_count, right_count, state))

 fn alternate_right_injection_is_inject_right(left_count: Nat, right_count: Nat, state: Bounded(right_count)) -> Equivalent(Bounded(plus(left_count, right_count)), inject_alternate_right(left_count, right_count, state), inject_right_at(left_count, right_count, state))

Proof that inject_alternate_right equals inject_right.

alternate_right_states(left_count: Nat, right_count: Nat, states: List(MachineState(right_count)), marker: EvidenceInstruction) -> List(MachineState(plus(left_count, right_count)))

 fn alternate_right_states(left_count: Nat, right_count: Nat, states: List(MachineState(right_count)), marker: EvidenceInstruction) -> List(MachineState(plus(left_count, right_count)))

Inject right-branch states into an alternation and tag them with marker.

alternate_starts_order(n: Nat, left: List(MachineState(n)), right: List(MachineState(n)), prefer_right: Bool) -> List(MachineState(n))

 fn alternate_starts_order(n: Nat, left: List(MachineState(n)), right: List(MachineState(n)), prefer_right: Bool) -> List(MachineState(n))

Order left and right alternation start states according to prefer_right.

always(_char: Char) -> Bool

 fn always(_char: Char) -> Bool

Constant predicate returning true for every character.

any_char() -> Regex(Char)

 fn any_char() -> Regex(Char)

Regex matching any single character (including newlines).

append_branch_marker(routine: List(EvidenceInstruction), marker: EvidenceInstruction) -> List(EvidenceInstruction)

 fn append_branch_marker(routine: List(EvidenceInstruction), marker: EvidenceInstruction) -> List(EvidenceInstruction)

Append a branch marker instruction to the end of an evidence routine.

append_characters(left: List(Char), right: List(Char)) -> List(Char)

 fn append_characters(left: List(Char), right: List(Char)) -> List(Char)

Concatenate two List(Char) values.

append_constraints(left: List(BoundaryConstraint), right: List(BoundaryConstraint)) -> List(BoundaryConstraint)

 fn append_constraints(left: List(BoundaryConstraint), right: List(BoundaryConstraint)) -> List(BoundaryConstraint)

Concatenate two lists of BoundaryConstraint values.

append_extended_routines(left: List(ExtendedInstruction), right: List(ExtendedInstruction)) -> List(ExtendedInstruction)

 fn append_extended_routines(left: List(ExtendedInstruction), right: List(ExtendedInstruction)) -> List(ExtendedInstruction)

Concatenate two ExtendedRoutine instruction lists.

append_machine_states(n: Nat, left: List(MachineState(n)), right: List(MachineState(n))) -> List(MachineState(n))

 fn append_machine_states(n: Nat, left: List(MachineState(n)), right: List(MachineState(n))) -> List(MachineState(n))

Concatenate two lists of MachineState values with explicit state bound n.

append_routine(left: List(EvidenceInstruction), right: List(EvidenceInstruction)) -> List(EvidenceInstruction)

 fn append_routine(left: List(EvidenceInstruction), right: List(EvidenceInstruction)) -> List(EvidenceInstruction)

Concatenate two EvidenceInstruction routines in execution order.

append_states(n: Nat, left: List(MachineState(n)), right: List(MachineState(n))) -> List(MachineState(n))

 fn append_states(n: Nat, left: List(MachineState(n)), right: List(MachineState(n))) -> List(MachineState(n))

Concatenate two lists of MachineState values with the same state bound.

append_threads(n: Nat, left: List(EvidenceThread(n)), right: List(EvidenceThread(n))) -> List(EvidenceThread(n))

 fn append_threads(n: Nat, left: List(EvidenceThread(n)), right: List(EvidenceThread(n))) -> List(EvidenceThread(n))

Concatenate two lists of EvidenceThreads.

as_string(a: Type, regex: Regex(a)) -> Regex(String)

 fn as_string(a: Type, regex: Regex(a)) -> Regex(String)

Alias for captured: match regex and return the matched substring.

ascii_alnum(actual: Char) -> Bool

 fn ascii_alnum(actual: Char) -> Bool

Return true if char is an ASCII letter or digit.

ascii_alpha(actual: Char) -> Bool

 fn ascii_alpha(actual: Char) -> Bool

Return true if char is an ASCII letter (A-Z or a-z).

ascii_blank(actual: Char) -> Bool

 fn ascii_blank(actual: Char) -> Bool

Return true if char is an ASCII space or horizontal tab.

ascii_control(actual: Char) -> Bool

 fn ascii_control(actual: Char) -> Bool

Return true if char is an ASCII control character.

ascii_digit(char: Char) -> Bool

 fn ascii_digit(char: Char) -> Bool

Return true if char is an ASCII decimal digit (0-9).

ascii_graph(actual: Char) -> Bool

 fn ascii_graph(actual: Char) -> Bool

Return true if char is a visible ASCII graphical character (0x21..0x7E).

ascii_print(actual: Char) -> Bool

 fn ascii_print(actual: Char) -> Bool

Return true if char is a printable ASCII character (0x20..0x7E).

ascii_punct(actual: Char) -> Bool

 fn ascii_punct(actual: Char) -> Bool

Return true if char is an ASCII punctuation character.

ascii_space(char: Char) -> Bool

 fn ascii_space(char: Char) -> Bool

Return true if char is an ASCII whitespace character.

ascii_word(char: Char) -> Bool

 fn ascii_word(char: Char) -> Bool

Return true if char is an ASCII word character ([A-Za-z0-9_]).

ascii_word_constraint(expected: Bool) -> BoundaryConstraint

 fn ascii_word_constraint(expected: Bool) -> BoundaryConstraint

Construct an ASCII word-boundary (\b / \B) constraint.

atomic_commit_disposition(current: Nat, commit: Nat) -> AtomicCommitDisposition(current, commit)

 fn atomic_commit_disposition(current: Nat, commit: Nat) -> AtomicCommitDisposition(current, commit)

Decide whether an atomic commit at commit prunes a sibling at current depth.

atomic_depth_comparison(left: Nat, right: Nat) -> AtomicDepthComparison(left, right)

 fn atomic_depth_comparison(left: Nat, right: Nat) -> AtomicDepthComparison(left, right)

Compare two atomic nesting depths as less-than, equal, or greater-than.

atomic_depth_max(left: Nat, right: Nat) -> Nat

 fn atomic_depth_max(left: Nat, right: Nat) -> Nat

Return the maximum of two Nat atomic nesting depths.

atomic_destination_states(n: Nat, states: List(MachineState(n))) -> List(MachineState(n))

 fn atomic_destination_states(n: Nat, states: List(MachineState(n))) -> List(MachineState(n))

Annotate accepting destinations with an atomic-commit instruction.

atomic_lookaround_accepting_from(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, scope_depth: Nat) -> AtomicSearchResult

 fn atomic_lookaround_accepting_from(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, scope_depth: Nat) -> AtomicSearchResult

Atomic assertion search is the same finite ordered search as the ordinary assertion path, but every destination is first passed through the depth-aware lookaround constraint filter. This is what makes an assertion inside an atomic scope observable without introducing a host backtracking stack or rebuilding a child machine per attempt.

atomic_lookaround_accepting_members(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source_state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, scope_depth: Nat, destinations: List(MachineState(n))) -> AtomicSearchResult

 fn atomic_lookaround_accepting_members(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source_state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, scope_depth: Nat, destinations: List(MachineState(n))) -> AtomicSearchResult

Search lookaround destination states with atomic-group commit pruning.

atomic_lookaround_accepts(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Bool

 fn atomic_lookaround_accepts(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Bool

Return true if an atomic lookaround machine accepts input.

atomic_lookaround_initial_member(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, blocked_depth: Option(Nat), head: MachineState(n), remaining: List(MachineState(n))) -> AtomicSearchResult

 fn atomic_lookaround_initial_member(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, blocked_depth: Option(Nat), head: MachineState(n), remaining: List(MachineState(n))) -> AtomicSearchResult

Search a single lookaround initial state with atomic-group commit pruning.

atomic_lookaround_initial_members(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, blocked_depth: Option(Nat), starts: List(MachineState(n))) -> AtomicSearchResult

 fn atomic_lookaround_initial_members(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, blocked_depth: Option(Nat), starts: List(MachineState(n))) -> AtomicSearchResult

Search lookaround initial states with atomic-group commit pruning.

atomic_lookaround_routine_accepting_from(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, scope_depth: Nat, prefix_mode: Bool, reversed_prefix: List(Char)) -> LookaroundRoutineSearchResult

 fn atomic_lookaround_routine_accepting_from(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, scope_depth: Nat, prefix_mode: Bool, reversed_prefix: List(Char)) -> LookaroundRoutineSearchResult

The capture replay evaluator mirrors the atomic lookaround search above. It is deliberately separate from the Boolean evaluator: preserving the selected routine must not alter the acceptance authority used by typed extraction. Every successful branch prepends the observed character and epsilon routine in the same order as the certified extended path. prefix changes only the acceptance point: a prefix search may close as soon as the ordered machine reaches ThreadAccepted, even when input remains. The machine's start/destination order still chooses the path, so lazy repeats and ordered alternation are preserved by the same DFS. reversed_prefix records exactly the characters consumed on that path; the result also carries the unconsumed suffix so callers never reconstruct it by retrying every possible endpoint.

atomic_lookaround_routine_accepts(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(ExtendedInstruction))

 fn atomic_lookaround_routine_accepts(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(ExtendedInstruction))

Run an atomic lookaround machine and return the winning ExtendedRoutine on acceptance.

atomic_lookaround_routine_initial_member(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), position: InitialPosition, history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, blocked_depth: Option(Nat), head: MachineState(n), remaining: List(MachineState(n)), prefix_mode: Bool, reversed_prefix: List(Char)) -> LookaroundRoutineSearchResult

 fn atomic_lookaround_routine_initial_member(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), position: InitialPosition, history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, blocked_depth: Option(Nat), head: MachineState(n), remaining: List(MachineState(n)), prefix_mode: Bool, reversed_prefix: List(Char)) -> LookaroundRoutineSearchResult

Search a single atomic lookaround initial state while recording its ExtendedRoutine.

atomic_lookaround_routine_initial_members(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), position: InitialPosition, history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, blocked_depth: Option(Nat), starts: List(MachineState(n)), prefix_mode: Bool, reversed_prefix: List(Char)) -> LookaroundRoutineSearchResult

 fn atomic_lookaround_routine_initial_members(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), position: InitialPosition, history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, blocked_depth: Option(Nat), starts: List(MachineState(n)), prefix_mode: Bool, reversed_prefix: List(Char)) -> LookaroundRoutineSearchResult

Search atomic lookaround initial states while recording the winning ExtendedRoutine.

atomic_lookaround_routine_members(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source_state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, scope_depth: Nat, prefix_mode: Bool, reversed_prefix: List(Char), destinations: List(MachineState(n))) -> LookaroundRoutineSearchResult

 fn atomic_lookaround_routine_members(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source_state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, scope_depth: Nat, prefix_mode: Bool, reversed_prefix: List(Char), destinations: List(MachineState(n))) -> LookaroundRoutineSearchResult

Search atomic lookaround destinations while recording the winning ExtendedRoutine.

atomic_lookaround_routine_prefix(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), _greedy: Bool, history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char), List(ExtendedInstruction)))

 fn atomic_lookaround_routine_prefix(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), _greedy: Bool, history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char), List(ExtendedInstruction)))

Find the winning prefix and ExtendedRoutine for an atomic lookaround machine.

atomic_pattern_machine(n: Nat, machine: PatternMachine(n)) -> PatternMachine(n)

 fn atomic_pattern_machine(n: Nat, machine: PatternMachine(n)) -> PatternMachine(n)

Wrap a PatternMachine in an atomic group scope with enter/commit markers.

atomic_plan_compilation(shape: ShapeCode, plan: AtomicRuntimePattern(shape)) -> ThompsonCompilation(shape)

 fn atomic_plan_compilation(shape: ShapeCode, plan: AtomicRuntimePattern(shape)) -> ThompsonCompilation(shape)

Extract the underlying ThompsonCompilation from an AtomicRuntimePattern.

atomic_plan_pattern(shape: ShapeCode, plan: AtomicRuntimePattern(shape)) -> Pattern(shape)

 fn atomic_plan_pattern(shape: ShapeCode, plan: AtomicRuntimePattern(shape)) -> Pattern(shape)

Extract the underlying Pattern from an AtomicRuntimePattern.

atomic_runtime_accepting_from(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), evidence: List(Evidence), captures: List(CaptureFrame), depth: Nat) -> AtomicSearchResult

 fn atomic_runtime_accepting_from(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), evidence: List(Evidence), captures: List(CaptureFrame), depth: Nat) -> AtomicSearchResult

Search for an accepting match from a single state with atomic-group commit pruning.

atomic_runtime_accepting_members(n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source_state: ThreadState(n), source_evidence: List(Evidence), source_captures: List(CaptureFrame), depth: Nat, destinations: List(MachineState(n))) -> AtomicSearchResult

 fn atomic_runtime_accepting_members(n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source_state: ThreadState(n), source_evidence: List(Evidence), source_captures: List(CaptureFrame), depth: Nat, destinations: List(MachineState(n))) -> AtomicSearchResult

Search candidate destination states in order, pruning alternatives on atomic commit.

atomic_runtime_accepts(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char)) -> Bool

 fn atomic_runtime_accepts(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char)) -> Bool

Run an atomic-aware PatternMachine on input and return whether it accepts.

atomic_runtime_first_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> Option(Tuple(List(Char), List(Char)))

 fn atomic_runtime_first_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> Option(Tuple(List(Char), List(Char)))

Find the shortest prefix accepted by an atomic-aware PatternMachine.

atomic_runtime_first_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char)) -> Option(Tuple(List(Char), List(Char)))

 fn atomic_runtime_first_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char)) -> Option(Tuple(List(Char), List(Char)))

Recursive helper for atomic_runtime_first_prefix.

atomic_runtime_initial_member(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), blocked_depth: Option(Nat), head: MachineState(n), remaining: List(MachineState(n))) -> AtomicSearchResult

 fn atomic_runtime_initial_member(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), blocked_depth: Option(Nat), head: MachineState(n), remaining: List(MachineState(n))) -> AtomicSearchResult

Search a single initial start state under atomic-group semantics.

atomic_runtime_initial_members(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), starts: List(MachineState(n))) -> AtomicSearchResult

 fn atomic_runtime_initial_members(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), starts: List(MachineState(n))) -> AtomicSearchResult

Search initial start states with atomic-group commit semantics.

atomic_runtime_initial_members_with_commit(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), blocked_depth: Option(Nat), starts: List(MachineState(n))) -> AtomicSearchResult

 fn atomic_runtime_initial_members_with_commit(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), blocked_depth: Option(Nat), starts: List(MachineState(n))) -> AtomicSearchResult

Search initial start states while propagating an active atomic commit depth.

atomic_runtime_last_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> Option(Tuple(List(Char), List(Char)))

 fn atomic_runtime_last_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> Option(Tuple(List(Char), List(Char)))

Find the longest prefix accepted by an atomic-aware PatternMachine.

atomic_runtime_last_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: Option(Tuple(List(Char), List(Char)))) -> Option(Tuple(List(Char), List(Char)))

 fn atomic_runtime_last_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: Option(Tuple(List(Char), List(Char)))) -> Option(Tuple(List(Char), List(Char)))

Recursive helper for atomic_runtime_last_prefix.

atomic_runtime_machine_from_plan(shape: ShapeCode, plan: AtomicRuntimePattern(shape)) -> PatternMachine(thompson_state_count(atomic_plan_compilation(plan)))

 fn atomic_runtime_machine_from_plan(shape: ShapeCode, plan: AtomicRuntimePattern(shape)) -> PatternMachine(thompson_state_count(atomic_plan_compilation(plan)))

Build the executable PatternMachine for an AtomicRuntimePattern.

atomic_runtime_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), greedy: Bool) -> Option(Tuple(List(Char), List(Char)))

 fn atomic_runtime_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), greedy: Bool) -> Option(Tuple(List(Char), List(Char)))

Find the shortest (lazy: true) or longest (lazy: false) prefix accepted by an atomic-aware machine.

atomic_scope_depth_after(routine: List(EvidenceInstruction), depth: Nat) -> Nat

 fn atomic_scope_depth_after(routine: List(EvidenceInstruction), depth: Nat) -> Nat

Compute the atomic nesting depth remaining after executing routine.

atomic_scope_effect(routine: List(EvidenceInstruction), depth: Nat) -> AtomicScopeEffect

 fn atomic_scope_effect(routine: List(EvidenceInstruction), depth: Nat) -> AtomicScopeEffect

Compute the net atomic-scope depth change and commit depth of an instruction routine.

atomic_scope_max_depth(routine: List(EvidenceInstruction), depth: Nat) -> Nat

 fn atomic_scope_max_depth(routine: List(EvidenceInstruction), depth: Nat) -> Nat

Compute the maximum atomic nesting depth reached while executing routine.

atomic_scope_max_depth_with(routine: List(EvidenceInstruction), depth: Nat, maximum: Nat) -> Nat

 fn atomic_scope_max_depth_with(routine: List(EvidenceInstruction), depth: Nat, maximum: Nat) -> Nat

Accumulate the maximum atomic nesting depth across routine starting from current.

atomic_start_states(n: Nat, states: List(MachineState(n))) -> List(MachineState(n))

 fn atomic_start_states(n: Nat, states: List(MachineState(n))) -> List(MachineState(n))

Atomic scopes preserve every ordinary machine state, but mark entry and every accepting exit in the routine stream. The ordered search consumes these markers to discard lower-priority siblings after the first exit; transition construction itself remains the same finite Thompson machine.

boundary_pattern_machine(constraint: BoundaryConstraint) -> PatternMachine(Z())

 fn boundary_pattern_machine(constraint: BoundaryConstraint) -> PatternMachine(Z())

Construct the zero-state PatternMachine guarded by a single BoundaryConstraint.

bounded_at_least_pattern(a: Type, regex: Regex(a), minimum: Nat, lazy: Bool) -> Regex(List(a))

 fn bounded_at_least_pattern(a: Type, regex: Regex(a), minimum: Nat, lazy: Bool) -> Regex(List(a))

Match regex at least min_count times with optional lazy preference.

bounded_between_pattern(a: Type, regex: Regex(a), minimum: Nat, maximum: Nat, lazy: Bool) -> Regex(List(a))

 fn bounded_between_pattern(a: Type, regex: Regex(a), minimum: Nat, maximum: Nat, lazy: Bool) -> Regex(List(a))

Match regex between min_count and max_count times.

bounded_exact_pattern(a: Type, regex: Regex(a), count: Nat) -> Regex(List(a))

 fn bounded_exact_pattern(a: Type, regex: Regex(a), count: Nat) -> Regex(List(a))

Match regex exactly count times.

bounded_same(n: Nat, left: Bounded(n), right: Bounded(n)) -> Bool

 fn bounded_same(n: Nat, left: Bounded(n), right: Bounded(n)) -> Bool

Return true if two Bounded(n) state indices are equal.

bounded_up_to_pattern(a: Type, regex: Regex(a), maximum: Nat, lazy: Bool) -> Regex(List(a))

 fn bounded_up_to_pattern(a: Type, regex: Regex(a), maximum: Nat, lazy: Bool) -> Regex(List(a))

Match regex at most max_count times with optional lazy preference.

build_transition_rows(remaining: Nat, total: Nat, inject: Function(Bounded(remaining), Bounded(total)), next: Function(Bounded(total), Function(Char, List(MachineState(total))))) -> TransitionRowsFrom(remaining, total)

 fn build_transition_rows(remaining: Nat, total: Nat, inject: Function(Bounded(remaining), Bounded(total)), next: Function(Bounded(total), Function(Char, List(MachineState(total))))) -> TransitionRowsFrom(remaining, total)

Materialize transition rows for remaining states using inject into next.

build_transition_rows_equivalent(remaining: Nat, total: Nat, inject: Function(Bounded(remaining), Bounded(total)), next: Function(Bounded(total), Function(Char, List(MachineState(total)))), state: Bounded(remaining), char: Char) -> Equivalent(List(MachineState(total)), transition_rows_from_next(build_transition_rows(remaining, inject, next), state, char), next(inject(state), char))

 fn build_transition_rows_equivalent(remaining: Nat, total: Nat, inject: Function(Bounded(remaining), Bounded(total)), next: Function(Bounded(total), Function(Char, List(MachineState(total)))), state: Bounded(remaining), char: Char) -> Equivalent(List(MachineState(total)), transition_rows_from_next(build_transition_rows(remaining, inject, next), state, char), next(inject(state), char))

Pointwise correctness of the row compiler. This is intentionally a smaller theorem than function extensionality: every concrete bounded source state reduces to the row installed for that state, so callers can transport an edge without changing the existing PatternMachine proof indices.

capture_absent_constraint(slot: Nat) -> BoundaryConstraint

 fn capture_absent_constraint(slot: Nat) -> BoundaryConstraint

Construct a constraint requiring capture group index to be absent.

capture_condition_constraint(slot: Nat, participated: Bool) -> BoundaryConstraint

 fn capture_condition_constraint(slot: Nat, participated: Bool) -> BoundaryConstraint

Convert a CaptureCondition into its corresponding BoundaryConstraint.

capture_condition_holds(condition: Option(CaptureCondition), routine: List(EvidenceInstruction)) -> Bool

 fn capture_condition_holds(condition: Option(CaptureCondition), routine: List(EvidenceInstruction)) -> Bool

Evaluate a CaptureCondition against the executed capture routine.

capture_ledger_from_layout(layout: CaptureLayout) -> List(NamedCaptureLedgerEntry)

 fn capture_ledger_from_layout(layout: CaptureLayout) -> List(NamedCaptureLedgerEntry)

Initialize an empty named-capture ledger from a NamedCaptureLayout.

capture_ledger_from_slots(slots: List(CaptureSlot)) -> List(NamedCaptureLedgerEntry)

 fn capture_ledger_from_slots(slots: List(CaptureSlot)) -> List(NamedCaptureLedgerEntry)

Initialize an empty named-capture ledger from a list of CaptureSlots.

capture_participated_constraint(slot: Nat) -> BoundaryConstraint

 fn capture_participated_constraint(slot: Nat) -> BoundaryConstraint

Construct a constraint requiring capture group index to have participated.

capture_participation_decision(slot: Nat, routine: List(EvidenceInstruction)) -> CaptureParticipationDecision(slot, routine)

 fn capture_participation_decision(slot: Nat, routine: List(EvidenceInstruction)) -> CaptureParticipationDecision(slot, routine)

Decide whether capture group target has participated in routine.

capture_slot_markers_from_extended(routine: List(ExtendedInstruction)) -> List(EvidenceInstruction)

 fn capture_slot_markers_from_extended(routine: List(ExtendedInstruction)) -> List(EvidenceInstruction)

Extract only capture-slot markers from a selected assertion routine. The child emits its own characters and evidence, but those must not be merged into the surrounding typed result; only participation markers cross the assertion boundary for later conditionals.

captured(a: Type, regex: Regex(a)) -> Regex(String)

 fn captured(a: Type, regex: Regex(a)) -> Regex(String)

Match regex and return the matched substring as a String.

caseless_same(expected: Char, actual: Char, unicode: Bool) -> Bool

 fn caseless_same(expected: Char, actual: Char, unicode: Bool) -> Bool

Compare two characters for case-insensitive equality under options.

certify_extended_routine(routine: List(ExtendedInstruction), input_current: Option(Char), input_evidence: List(Evidence), input_captures: List(CaptureFrame)) -> ExtendedRoutineExecution(routine, input_current, input_evidence, input_captures, extended_current(execute_extended_routine(routine, input_current, input_evidence, input_captures)), extended_evidence(execute_extended_routine(routine, input_current, input_evidence, input_captures)), extended_captures(execute_extended_routine(routine, input_current, input_evidence, input_captures)))

 fn certify_extended_routine(routine: List(ExtendedInstruction), input_current: Option(Char), input_evidence: List(Evidence), input_captures: List(CaptureFrame)) -> ExtendedRoutineExecution(routine, input_current, input_evidence, input_captures, extended_current(execute_extended_routine(routine, input_current, input_evidence, input_captures)), extended_evidence(execute_extended_routine(routine, input_current, input_evidence, input_captures)), extended_captures(execute_extended_routine(routine, input_current, input_evidence, input_captures)))

Execute an ExtendedRoutine and return a certified ExtendedExecution witness.

certify_named_compilation(shape: ShapeCode, compilation: NamedThompsonCompilation(shape)) -> NamedCompilationErasure(shape, compilation, erase_named_thompson(compilation))

 fn certify_named_compilation(shape: ShapeCode, compilation: NamedThompsonCompilation(shape)) -> NamedCompilationErasure(shape, compilation, erase_named_thompson(compilation))

Certify compilation of a NamedPattern into a NamedThompsonCompilation.

certify_thompson(shape: ShapeCode, pattern: Pattern(shape)) -> ThompsonCompilation(shape)

 fn certify_thompson(shape: ShapeCode, pattern: Pattern(shape)) -> ThompsonCompilation(shape)

Compile a Pattern into a certified ThompsonCompilation.

character_class(chars: List(Char), ranges: List(CharacterRange), negated: Bool) -> Regex(Char)

 fn character_class(chars: List(Char), ranges: List(CharacterRange), negated: Bool) -> Regex(Char)

Regex matching a character class of literals and ranges.

character_class_with_options(chars: List(Char), ranges: List(CharacterRange), negated: Bool, caseless: Bool, unicode: Bool) -> Regex(Char)

 fn character_class_with_options(chars: List(Char), ranges: List(CharacterRange), negated: Bool, caseless: Bool, unicode: Bool) -> Regex(Char)

Regex matching an option-aware character class.

class_kinds_match(kinds: ClassKinds, actual: Char, unicode: Bool) -> Bool

 fn class_kinds_match(kinds: ClassKinds, actual: Char, unicode: Bool) -> Bool

Test whether char matches any enabled shorthand class in kinds under options.

class_predicate(chars: List(Char), ranges: List(CharacterRange), negated: Bool, actual: Char) -> Bool

 fn class_predicate(chars: List(Char), ranges: List(CharacterRange), negated: Bool, actual: Char) -> Bool

Test whether char matches a character class of literals and ranges.

class_test(chars: List(Char), ranges: List(CharacterRange), negated: Bool) -> Function(Char, Bool)

 fn class_test(chars: List(Char), ranges: List(CharacterRange), negated: Bool) -> Function(Char, Bool)

Curried predicate for a character class of literals and ranges.

close_named_capture_frame(frames: List(NamedCaptureFrame), entries: List(NamedCaptureLedgerEntry)) -> NamedCaptureExecution

 fn close_named_capture_frame(frames: List(NamedCaptureFrame), entries: List(NamedCaptureLedgerEntry)) -> NamedCaptureExecution

Close the top named-capture frame and commit its text to the ledger.

compile_pattern(shape: ShapeCode, pattern: Pattern(shape)) -> Sigma(n: Nat, PatternMachine(n))

 fn compile_pattern(shape: ShapeCode, pattern: Pattern(shape)) -> Sigma(n: Nat, PatternMachine(n))

Compile a Pattern into a Sigma-packaged PatternMachine.

compile_regex(result: Type, regex: Regex(result)) -> CompiledRegex(result)

 fn compile_regex(result: Type, regex: Regex(result)) -> CompiledRegex(result)

Compile a typed Regex(result) AST into an executable CompiledRegex(result).

compile_transition_rows(n: Nat, machine: PatternMachine(n)) -> TransitionRows(n)

 fn compile_transition_rows(n: Nat, machine: PatternMachine(n)) -> TransitionRows(n)

Compile a PatternMachine's transition function into an indexed TransitionRows table.

concat_machine_next(left_count: Nat, right_count: Nat, left_next: Function(Bounded(left_count), Function(Char, List(MachineState(left_count)))), right_starts: List(MachineState(right_count)), right_next: Function(Bounded(right_count), Function(Char, List(MachineState(right_count)))), state: Bounded(plus(left_count, right_count)), char: Char) -> List(MachineState(plus(left_count, right_count)))

 fn concat_machine_next(left_count: Nat, right_count: Nat, left_next: Function(Bounded(left_count), Function(Char, List(MachineState(left_count)))), right_starts: List(MachineState(right_count)), right_next: Function(Bounded(right_count), Function(Char, List(MachineState(right_count)))), state: Bounded(plus(left_count, right_count)), char: Char) -> List(MachineState(plus(left_count, right_count)))

Transition function for a concatenated pair of submachines.

concat_machine_next_from_side(left_count: Nat, right_count: Nat, left_next: Function(Bounded(left_count), Function(Char, List(MachineState(left_count)))), right_starts: List(MachineState(right_count)), right_next: Function(Bounded(right_count), Function(Char, List(MachineState(right_count)))), side: BoundedSum(left_count, right_count), char: Char) -> List(MachineState(plus(left_count, right_count)))

 fn concat_machine_next_from_side(left_count: Nat, right_count: Nat, left_next: Function(Bounded(left_count), Function(Char, List(MachineState(left_count)))), right_starts: List(MachineState(right_count)), right_next: Function(Bounded(right_count), Function(Char, List(MachineState(right_count)))), side: BoundedSum(left_count, right_count), char: Char) -> List(MachineState(plus(left_count, right_count)))

Dispatch a concatenation transition after classifying the state as left or right.

concat_pattern_machine(left_count: Nat, left_machine: PatternMachine(left_count), right_count: Nat, right_machine: PatternMachine(right_count)) -> PatternMachine(plus(left_count, right_count))

 fn concat_pattern_machine(left_count: Nat, left_machine: PatternMachine(left_count), right_count: Nat, right_machine: PatternMachine(right_count)) -> PatternMachine(plus(left_count, right_count))

Construct the PatternMachine for sequential concatenation of two submachines.

concat_pattern_machine_next_equation(left_count: Nat, left_machine: PatternMachine(left_count), right_count: Nat, right_machine: PatternMachine(right_count), state: Bounded(plus(left_count, right_count)), char: Char) -> Equivalent(List(MachineState(plus(left_count, right_count))), pattern_machine_next_at(concat_pattern_machine(left_count, left_machine, right_count, right_machine), state, char), concat_machine_next(left_count, pattern_machine_next(left_machine), pattern_machine_starts(right_machine), pattern_machine_next(right_machine), state, char))

 fn concat_pattern_machine_next_equation(left_count: Nat, left_machine: PatternMachine(left_count), right_count: Nat, right_machine: PatternMachine(right_count), state: Bounded(plus(left_count, right_count)), char: Char) -> Equivalent(List(MachineState(plus(left_count, right_count))), pattern_machine_next_at(concat_pattern_machine(left_count, left_machine, right_count, right_machine), state, char), concat_machine_next(left_count, pattern_machine_next(left_machine), pattern_machine_starts(right_machine), pattern_machine_next(right_machine), state, char))

Equivalence unfolding pattern_machine_next_at for concat_pattern_machine.

concatenate(a: Type, b: Type, left: Regex(a), right: Regex(b)) -> Regex(Tuple(a, b))

 fn concatenate(a: Type, b: Type, left: Regex(a), right: Regex(b)) -> Regex(Tuple(a, b))

Sequence two regexes, returning both results as a Tuple.

configured(a: Type, options: RegexOptions, regex: Regex(a)) -> Regex(a)

 fn configured(a: Type, options: RegexOptions, regex: Regex(a)) -> Regex(a)

Apply RegexOptions to a sub-regex.

constraint_holds(constraint: BoundaryConstraint, boundary: Boundary) -> Bool

 fn constraint_holds(constraint: BoundaryConstraint, boundary: Boundary) -> Bool

Test whether a BoundaryConstraint holds at boundary.

constraint_holds_with_routine(constraint: BoundaryConstraint, boundary: Boundary, routine: List(EvidenceInstruction)) -> Bool

 fn constraint_holds_with_routine(constraint: BoundaryConstraint, boundary: Boundary, routine: List(EvidenceInstruction)) -> Bool

Test whether a BoundaryConstraint holds at boundary given the current capture routine.

constraints_hold(constraints: List(BoundaryConstraint), boundary: Boundary) -> Bool

 fn constraints_hold(constraints: List(BoundaryConstraint), boundary: Boundary) -> Bool

Return true if every BoundaryConstraint in constraints holds at boundary.

constraints_hold_with_routine(constraints: List(BoundaryConstraint), boundary: Boundary, routine: List(EvidenceInstruction)) -> Bool

 fn constraints_hold_with_routine(constraints: List(BoundaryConstraint), boundary: Boundary, routine: List(EvidenceInstruction)) -> Bool

Return true if all constraints hold at boundary with capture routine.

contains_char(chars: List(Char), actual: Char) -> Bool

 fn contains_char(chars: List(Char), actual: Char) -> Bool

Return true if target appears in the character list chars.

contains_char_with_options(chars: List(Char), actual: Char, caseless: Bool, unicode: Bool) -> Bool

 fn contains_char_with_options(chars: List(Char), actual: Char, caseless: Bool, unicode: Bool) -> Bool

Return true if target matches any character in chars under options.

continue_last_machine_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: CertifiedPrefixSearch(n, machine, position)) -> CertifiedPrefixSearch(n, machine, position)

 fn continue_last_machine_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: CertifiedPrefixSearch(n, machine, position)) -> CertifiedPrefixSearch(n, machine, position)

Advance search_last_machine_prefix_loop while retaining the best certified match.

continue_with_right(left_count: Nat, right_count: Nat, left_states: List(MachineState(left_count)), right_starts: List(MachineState(right_count))) -> List(MachineState(plus(left_count, right_count)))

 fn continue_with_right(left_count: Nat, right_count: Nat, left_states: List(MachineState(left_count)), right_starts: List(MachineState(right_count))) -> List(MachineState(plus(left_count, right_count)))

Route accepting left-submachine states into right_starts while keeping active left states.

crlf_policy(policy: NewlinePolicy) -> Bool

 fn crlf_policy(policy: NewlinePolicy) -> Bool

Return true if policy recognizes CRLF pairs as a single line break.

default_options() -> RegexOptions

 fn default_options() -> RegexOptions

Return the default RegexOptions (case-sensitive, single-line, ASCII mode).

destination_thread(n: Nat, destination: MachineState(n), evidence: List(Evidence), captures: List(CaptureFrame)) -> EvidenceThread(n)

 fn destination_thread(n: Nat, destination: MachineState(n), evidence: List(Evidence), captures: List(CaptureFrame)) -> EvidenceThread(n)

Advance an EvidenceThread with char into a destination MachineState.

destination_threads(n: Nat, destinations: List(MachineState(n)), evidence: List(Evidence), captures: List(CaptureFrame)) -> List(EvidenceThread(n))

 fn destination_threads(n: Nat, destinations: List(MachineState(n)), evidence: List(Evidence), captures: List(CaptureFrame)) -> List(EvidenceThread(n))

Advance an EvidenceThread with char into every destination in destinations.

digit_class(negated: Bool) -> Regex(Char)

 fn digit_class(negated: Bool) -> Regex(Char)

Regex matching an ASCII digit (\d) or non-digit (\D when negated).

digit_class_with_options(negated: Bool, unicode: Bool) -> Regex(Char)

 fn digit_class_with_options(negated: Bool, unicode: Bool) -> Regex(Char)

Regex matching \d / \D under options.

digit_option_predicate(negated: Bool, unicode: Bool, char: Char) -> Bool

 fn digit_option_predicate(negated: Bool, unicode: Bool, char: Char) -> Bool

Test whether char matches \d / \D under options.

digit_options_test(negated: Bool, unicode: Bool) -> Function(Char, Bool)

 fn digit_options_test(negated: Bool, unicode: Bool) -> Function(Char, Bool)

Curried predicate for \d / \D under options.

direct_pattern_machine_next_congruence(n: Nat, left: PatternMachine(n), right: PatternMachine(n), state: Bounded(n), char: Char, equality: Equivalent(PatternMachine(n), left, right)) -> Equivalent(List(MachineState(n)), pattern_machine_next_at(left, state, char), pattern_machine_next_at(right, state, char))

 fn direct_pattern_machine_next_congruence(n: Nat, left: PatternMachine(n), right: PatternMachine(n), state: Bounded(n), char: Char, equality: Equivalent(PatternMachine(n), left, right)) -> Equivalent(List(MachineState(n)), pattern_machine_next_at(left, state, char), pattern_machine_next_at(right, state, char))

Congruence lifting PatternMachine equality to pattern_machine_next_at.

direct_pattern_machine_starts_congruence(n: Nat, left: PatternMachine(n), right: PatternMachine(n), equality: Equivalent(PatternMachine(n), left, right)) -> Equivalent(List(MachineState(n)), pattern_machine_starts(left), pattern_machine_starts(right))

 fn direct_pattern_machine_starts_congruence(n: Nat, left: PatternMachine(n), right: PatternMachine(n), equality: Equivalent(PatternMachine(n), left, right)) -> Equivalent(List(MachineState(n)), pattern_machine_starts(left), pattern_machine_starts(right))

Congruence lifting PatternMachine equality to pattern_machine_starts.

direct_staged_alternate_left_machine_function(left_count: Nat, right_count: Nat, right_machine: PatternMachine(right_count), prefer_right: Bool) -> Function(PatternMachine(left_count), PatternMachine(plus(left_count, right_count)))

 fn direct_staged_alternate_left_machine_function(left_count: Nat, right_count: Nat, right_machine: PatternMachine(right_count), prefer_right: Bool) -> Function(PatternMachine(left_count), PatternMachine(plus(left_count, right_count)))

Wrapper fixing the right submachine of alternate_pattern_machine for congruence proofs.

direct_staged_alternate_right_machine_function(left_count: Nat, right_count: Nat, left_machine: PatternMachine(left_count), prefer_right: Bool) -> Function(PatternMachine(right_count), PatternMachine(plus(left_count, right_count)))

 fn direct_staged_alternate_right_machine_function(left_count: Nat, right_count: Nat, left_machine: PatternMachine(left_count), prefer_right: Bool) -> Function(PatternMachine(right_count), PatternMachine(plus(left_count, right_count)))

Wrapper fixing the left submachine of alternate_pattern_machine for congruence proofs.

direct_staged_concat_left_machine_function(left_count: Nat, right_count: Nat, right_machine: PatternMachine(right_count)) -> Function(PatternMachine(left_count), PatternMachine(plus(left_count, right_count)))

 fn direct_staged_concat_left_machine_function(left_count: Nat, right_count: Nat, right_machine: PatternMachine(right_count)) -> Function(PatternMachine(left_count), PatternMachine(plus(left_count, right_count)))

Wrapper fixing the right submachine of concat_pattern_machine for congruence proofs.

direct_staged_concat_right_machine_function(left_count: Nat, right_count: Nat, left_machine: PatternMachine(left_count)) -> Function(PatternMachine(right_count), PatternMachine(plus(left_count, right_count)))

 fn direct_staged_concat_right_machine_function(left_count: Nat, right_count: Nat, left_machine: PatternMachine(left_count)) -> Function(PatternMachine(right_count), PatternMachine(plus(left_count, right_count)))

Wrapper fixing the left submachine of concat_pattern_machine for congruence proofs.

direct_staged_group_machine_function(n: Nat) -> Function(PatternMachine(n), PatternMachine(n))

 fn direct_staged_group_machine_function(n: Nat) -> Function(PatternMachine(n), PatternMachine(n))

Wrapper function applying group_pattern_machine for congruence proofs.

direct_staged_machine_seed_equivalent(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> Equivalent(PatternMachine(thompson_state_count(compilation)), staged_machine_seed_from_compilation(compilation), thompson_machine(compilation))

 fn direct_staged_machine_seed_equivalent(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> Equivalent(PatternMachine(thompson_state_count(compilation)), staged_machine_seed_from_compilation(compilation), thompson_machine(compilation))

Proof that a DirectStagedCompilation's seed machine equals thompson_machine.

direct_staged_repeat_machine_function(n: Nat, lazy: Bool) -> Function(PatternMachine(n), PatternMachine(n))

 fn direct_staged_repeat_machine_function(n: Nat, lazy: Bool) -> Function(PatternMachine(n), PatternMachine(n))

Wrapper applying repeat_pattern_machine with fixed lazy flag for congruence proofs.

direct_staged_rows_transition_equivalent(shape: ShapeCode, compilation: ThompsonCompilation(shape), state: Bounded(thompson_state_count(compilation)), char: Char) -> Equivalent(List(MachineState(thompson_state_count(compilation))), transition_rows_next(direct_staged_rows_values_from_compilation(compilation), state, char), pattern_machine_next_at(thompson_machine(compilation), state, char))

 fn direct_staged_rows_transition_equivalent(shape: ShapeCode, compilation: ThompsonCompilation(shape), state: Bounded(thompson_state_count(compilation)), char: Char) -> Equivalent(List(MachineState(thompson_state_count(compilation))), transition_rows_next(direct_staged_rows_values_from_compilation(compilation), state, char), pattern_machine_next_at(thompson_machine(compilation), state, char))

Pointwise equivalence showing direct-staged rows match thompson_machine transitions.

direct_staged_rows_values_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> TransitionRows(thompson_state_count(compilation))

 fn direct_staged_rows_values_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> TransitionRows(thompson_state_count(compilation))

Extract the underlying TransitionRowsFrom table from a DirectStagedCompilation.

direct_staged_starts_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> List(MachineState(thompson_state_count(compilation)))

 fn direct_staged_starts_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> List(MachineState(thompson_state_count(compilation)))

Extract the start-state list from a DirectStagedCompilation.

discard_char(_char: Char) -> Unit

 fn discard_char(_char: Char) -> Unit

Discard a matched Char and return Unit.

discard_char_conversion() -> Conversion(Char, Unit)

 fn discard_char_conversion() -> Conversion(Char, Unit)

Conversion values used by the literal emitter's staged IR. Keeping these small adapters here lets generated literals publish a first-order Thompson tree without rebuilding a Regex/Pattern wrapper at runtime.

discard_left(a: Type, b: Type, left: Regex(a), right: Regex(b)) -> Regex(b)

 fn discard_left(a: Type, b: Type, left: Regex(a), right: Regex(b)) -> Regex(b)

Match left then right, returning only right's result.

discard_right(a: Type, b: Type, left: Regex(a), right: Regex(b)) -> Regex(a)

 fn discard_right(a: Type, b: Type, left: Regex(a), right: Regex(b)) -> Regex(a)

Match left then right, returning only left's result.

distinct_threads(n: Nat, threads: List(EvidenceThread(n))) -> List(EvidenceThread(n))

 fn distinct_threads(n: Nat, threads: List(EvidenceThread(n))) -> List(EvidenceThread(n))

Deduplicate EvidenceThreads by state, keeping the highest-priority thread per state.

distinct_threads_with(n: Nat, threads: List(EvidenceThread(n)), table: ThreadWinnerTable) -> DistinctThreadResult(n)

 fn distinct_threads_with(n: Nat, threads: List(EvidenceThread(n)), table: ThreadWinnerTable) -> DistinctThreadResult(n)

Deduplicate EvidenceThreads against an existing ThreadWinnerTable.

dot_predicate(dotall: Bool, char: Char) -> Bool

 fn dot_predicate(dotall: Bool, char: Char) -> Bool

Return true if char matches . under options.

dot_test(dotall: Bool) -> Function(Char, Bool)

 fn dot_test(dotall: Bool) -> Function(Char, Bool)

Curried predicate for . under options.

dot_test_with_policy(dotall: Bool, policy: NewlinePolicy) -> Function(Char, Bool)

 fn dot_test_with_policy(dotall: Bool, policy: NewlinePolicy) -> Function(Char, Bool)

Test whether char matches . given dotall and policy.

dot_with_options(dotall: Bool) -> Regex(Char)

 fn dot_with_options(dotall: Bool) -> Regex(Char)

Regex matching . under options.

dot_with_policy(dotall: Bool, policy: NewlinePolicy) -> Regex(Char)

 fn dot_with_policy(dotall: Bool, policy: NewlinePolicy) -> Regex(Char)

Regex matching . given dotall and policy.

empty() -> Regex(Unit)

 fn empty() -> Regex(Unit)

Regex matching the empty string and producing Unit.

empty_list_conversion(a: Type) -> Conversion(Unit, List(a))

 fn empty_list_conversion(a: Type) -> Conversion(Unit, List(a))

Construct a Conversion turning Unit into an empty List(a).

empty_list_conversion_for(shape: ShapeCode) -> Conversion(Unit, List(Sem(shape)))

 fn empty_list_conversion_for(shape: ShapeCode) -> Conversion(Unit, List(Sem(shape)))

Shape-indexed adapters keep generated bounded-literal conversions fully inferable. The emitter knows the inner shape, while the polymorphic convenience form above has no expected type at the generated call site.

empty_machine_next(n: Nat, _state: Bounded(n), _char: Char) -> List(MachineState(n))

 fn empty_machine_next(n: Nat, _state: Bounded(n), _char: Char) -> List(MachineState(n))

Transition function for a zero-state empty or boundary machine.

empty_machine_states(n: Nat) -> List(MachineState(n))

 fn empty_machine_states(n: Nat) -> List(MachineState(n))

Return an empty List(MachineState(n)).

empty_pattern_machine() -> PatternMachine(Z())

 fn empty_pattern_machine() -> PatternMachine(Z())

Construct the zero-state PatternMachine accepting the empty string.

empty_repetition_transform(a: Type, _: Regex(a)) -> Function(Unit, List(a))

 fn empty_repetition_transform(a: Type, _: Regex(a)) -> Function(Unit, List(a))

Transform Unit into an empty List(a) for zero-count repetitions.

empty_thread_winners() -> ThreadWinnerTable

 fn empty_thread_winners() -> ThreadWinnerTable

Create an empty ThreadWinnerTable for deduplicating active and accepted threads.

enable_class_kind(kind: ClassKind, kinds: ClassKinds) -> ClassKinds

 fn enable_class_kind(kind: ClassKind, kinds: ClassKinds) -> ClassKinds

Enable a single ClassKind flag in a ClassKinds set.

end_anchor() -> Regex(Unit)

 fn end_anchor() -> Regex(Unit)

Zero-width anchor matching the end of subject or line.

end_anchor_with_options(multiline: Bool) -> Regex(Unit)

 fn end_anchor_with_options(multiline: Bool) -> Regex(Unit)

Zero-width end anchor respecting multiline and newline options.

enter_repeat(n: Nat, routine: List(EvidenceInstruction), starts: List(MachineState(n))) -> List(MachineState(n))

 fn enter_repeat(n: Nat, routine: List(EvidenceInstruction), starts: List(MachineState(n))) -> List(MachineState(n))

Prepend a loop-entry routine onto repetition body start states.

enter_repeat_with_constraints(n: Nat, routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), starts: List(MachineState(n))) -> List(MachineState(n))

 fn enter_repeat_with_constraints(n: Nat, routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), starts: List(MachineState(n))) -> List(MachineState(n))

Prepend a loop-entry routine and constraints onto repetition body start states.

enter_right(left_count: Nat, right_count: Nat, left_routine: List(EvidenceInstruction), right_starts: List(MachineState(right_count))) -> List(MachineState(plus(left_count, right_count)))

 fn enter_right(left_count: Nat, right_count: Nat, left_routine: List(EvidenceInstruction), right_starts: List(MachineState(right_count))) -> List(MachineState(plus(left_count, right_count)))

Prepend a left routine onto right-submachine start states.

enter_right_with_constraints(left_count: Nat, right_count: Nat, left_routine: List(EvidenceInstruction), left_constraints: List(BoundaryConstraint), right_starts: List(MachineState(right_count))) -> List(MachineState(plus(left_count, right_count)))

 fn enter_right_with_constraints(left_count: Nat, right_count: Nat, left_routine: List(EvidenceInstruction), left_constraints: List(BoundaryConstraint), right_starts: List(MachineState(right_count))) -> List(MachineState(plus(left_count, right_count)))

Prepend a left routine and constraints onto right-submachine start states.

erase_named_thompson(shape: ShapeCode, compilation: NamedThompsonCompilation(shape)) -> ThompsonCompilation(shape)

 fn erase_named_thompson(shape: ShapeCode, compilation: NamedThompsonCompilation(shape)) -> ThompsonCompilation(shape)

Erase named capture slots from a NamedThompsonCompilation to a ThompsonCompilation.

exact_predicate(expected: Char, actual: Char) -> Bool

 fn exact_predicate(expected: Char, actual: Char) -> Bool

Return true if actual equals expected.

exact_test(expected: Char) -> Function(Char, Bool)

 fn exact_test(expected: Char) -> Function(Char, Bool)

Curried character predicate testing equality with expected.

exactly(expected: Char) -> Regex(Unit)

 fn exactly(expected: Char) -> Regex(Unit)

Regex matching the exact character expected and returning Unit.

exactly_with_options(expected: Char, caseless: Bool, unicode: Bool) -> Regex(Unit)

 fn exactly_with_options(expected: Char, caseless: Bool, unicode: Bool) -> Regex(Unit)

Regex matching expected under options and returning Unit.

execute_conversion(raw: Type, result: Type, conversion: Conversion(raw, result), value: raw) -> result

 fn execute_conversion(raw: Type, result: Type, conversion: Conversion(raw, result), value: raw) -> result

Run a typed Conversion to transform raw Sem(shape) evidence into a result value.

execute_extended_evidence_instruction(instruction: ExtendedInstruction, evidence: List(Evidence), captures: List(CaptureFrame)) -> EvidenceExecution

 fn execute_extended_evidence_instruction(instruction: ExtendedInstruction, evidence: List(Evidence), captures: List(CaptureFrame)) -> EvidenceExecution

Evidence execution deliberately forgets ExtendedExecution.current. Observe still advances every open capture frame, while the current character is observational bookkeeping and cannot affect evidence.

execute_extended_evidence_routine(routine: List(ExtendedInstruction), evidence: List(Evidence), captures: List(CaptureFrame)) -> EvidenceExecution

 fn execute_extended_evidence_routine(routine: List(ExtendedInstruction), evidence: List(Evidence), captures: List(CaptureFrame)) -> EvidenceExecution

Execute an ExtendedRoutine and return the final evidence stack if valid.

execute_extended_instruction(instruction: ExtendedInstruction, current: Option(Char), evidence: List(Evidence), captures: List(CaptureFrame)) -> ExtendedExecution

 fn execute_extended_instruction(instruction: ExtendedInstruction, current: Option(Char), evidence: List(Evidence), captures: List(CaptureFrame)) -> ExtendedExecution

Execute a single ExtendedInstruction against an extended evidence state.

execute_extended_routine(routine: List(ExtendedInstruction), current: Option(Char), evidence: List(Evidence), captures: List(CaptureFrame)) -> ExtendedExecution

 fn execute_extended_routine(routine: List(ExtendedInstruction), current: Option(Char), evidence: List(Evidence), captures: List(CaptureFrame)) -> ExtendedExecution

Execute an ExtendedRoutine, returning the updated stack, captures, and current buffer.

execute_instruction(instruction: EvidenceInstruction, evidence: List(Evidence), captures: List(CaptureFrame)) -> EvidenceExecution

 fn execute_instruction(instruction: EvidenceInstruction, evidence: List(Evidence), captures: List(CaptureFrame)) -> EvidenceExecution

Execute a single EvidenceInstruction against the evidence stack and capture frame stack.

execute_left_choice_conversion(left_raw: Type, left_result: Type, right_raw: Type, right_result: Type, left: Conversion(left_raw, left_result), _right: Conversion(right_raw, right_result), value: left_raw) -> Choice(left_result, right_result)

 fn execute_left_choice_conversion(left_raw: Type, left_result: Type, right_raw: Type, right_result: Type, left: Conversion(left_raw, left_result), _right: Conversion(right_raw, right_result), value: left_raw) -> Choice(left_result, right_result)

Wrap a converted left-branch result in ChoseLeft.

execute_list_conversion(raw: Type, result: Type, conversion: Conversion(raw, result), values: List(raw)) -> List(result)

 fn execute_list_conversion(raw: Type, result: Type, conversion: Conversion(raw, result), values: List(raw)) -> List(result)

Map a Conversion over every element of a list.

execute_named_extended_instruction(instruction: ExtendedInstruction, frames: List(NamedCaptureFrame), entries: List(NamedCaptureLedgerEntry)) -> NamedCaptureExecution

 fn execute_named_extended_instruction(instruction: ExtendedInstruction, frames: List(NamedCaptureFrame), entries: List(NamedCaptureLedgerEntry)) -> NamedCaptureExecution

Execute an ExtendedInstruction while tracking named-capture frames.

execute_named_extended_routine(routine: List(ExtendedInstruction), frames: List(NamedCaptureFrame), entries: List(NamedCaptureLedgerEntry)) -> NamedCaptureExecution

 fn execute_named_extended_routine(routine: List(ExtendedInstruction), frames: List(NamedCaptureFrame), entries: List(NamedCaptureLedgerEntry)) -> NamedCaptureExecution

Execute an ExtendedRoutine while tracking named-capture frames and ledger.

execute_named_instruction(instruction: EvidenceInstruction, frames: List(NamedCaptureFrame), entries: List(NamedCaptureLedgerEntry)) -> NamedCaptureExecution

 fn execute_named_instruction(instruction: EvidenceInstruction, frames: List(NamedCaptureFrame), entries: List(NamedCaptureLedgerEntry)) -> NamedCaptureExecution

Execute a single EvidenceInstruction while tracking named-capture frames.

execute_right_choice_conversion(left_raw: Type, left_result: Type, right_raw: Type, right_result: Type, _left: Conversion(left_raw, left_result), right: Conversion(right_raw, right_result), value: right_raw) -> Choice(left_result, right_result)

 fn execute_right_choice_conversion(left_raw: Type, left_result: Type, right_raw: Type, right_result: Type, _left: Conversion(left_raw, left_result), right: Conversion(right_raw, right_result), value: right_raw) -> Choice(left_result, right_result)

Wrap a converted right-branch result in ChoseRight.

execute_routine(routine: List(EvidenceInstruction), evidence: List(Evidence), captures: List(CaptureFrame)) -> EvidenceExecution

 fn execute_routine(routine: List(EvidenceInstruction), evidence: List(Evidence), captures: List(CaptureFrame)) -> EvidenceExecution

Execute a sequence of EvidenceInstructions, returning the final stack and captures.

execute_routine_certified(routine: List(EvidenceInstruction), input_evidence: List(Evidence), input_captures: List(CaptureFrame)) -> CertifiedRoutineExecution(routine, input_evidence, input_captures)

 fn execute_routine_certified(routine: List(EvidenceInstruction), input_evidence: List(Evidence), input_captures: List(CaptureFrame)) -> CertifiedRoutineExecution(routine, input_evidence, input_captures)

Execute an evidence routine and return a certified RoutineExecution witness.

executed_captures(execution: EvidenceExecution) -> List(CaptureFrame)

 fn executed_captures(execution: EvidenceExecution) -> List(CaptureFrame)

Extract the resulting capture frame stack from an executed routine state.

executed_evidence(execution: EvidenceExecution) -> List(Evidence)

 fn executed_evidence(execution: EvidenceExecution) -> List(Evidence)

Extract the resulting Evidence stack from an executed routine state.

extended_captures(execution: ExtendedExecution) -> List(CaptureFrame)

 fn extended_captures(execution: ExtendedExecution) -> List(CaptureFrame)

Extract the capture frame stack from an extended execution state.

extended_character_class(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, negated: Bool, caseless: Bool, unicode: Bool) -> Regex(Char)

 fn extended_character_class(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, negated: Bool, caseless: Bool, unicode: Bool) -> Regex(Char)

Regex matching an extended character class.

extended_class_predicate(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, negated: Bool, caseless: Bool, unicode: Bool, actual: Char) -> Bool

 fn extended_class_predicate(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, negated: Bool, caseless: Bool, unicode: Bool, actual: Char) -> Bool

Test whether char matches an extended character class (literals, ranges, kinds, POSIX).

extended_class_test(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, negated: Bool, caseless: Bool, unicode: Bool) -> Function(Char, Bool)

 fn extended_class_test(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, negated: Bool, caseless: Bool, unicode: Bool) -> Function(Char, Bool)

Curried predicate for an extended character class.

extended_current(execution: ExtendedExecution) -> Option(Char)

 fn extended_current(execution: ExtendedExecution) -> Option(Char)

Extract the current character buffer from an extended execution state.

extended_evidence(execution: ExtendedExecution) -> List(Evidence)

 fn extended_evidence(execution: ExtendedExecution) -> List(Evidence)

Extract the Evidence stack from an extended execution state.

extended_property_class_predicate(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, properties: List(UnicodePropertyMatch), posix: List(PosixClassMatch), negated: Bool, caseless: Bool, unicode: Bool, actual: Char) -> Bool

 fn extended_property_class_predicate(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, properties: List(UnicodePropertyMatch), posix: List(PosixClassMatch), negated: Bool, caseless: Bool, unicode: Bool, actual: Char) -> Bool

Test whether char matches an extended class that also includes Unicode properties.

extended_property_class_test(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, properties: List(UnicodePropertyMatch), posix: List(PosixClassMatch), negated: Bool, caseless: Bool, unicode: Bool) -> Function(Char, Bool)

 fn extended_property_class_test(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, properties: List(UnicodePropertyMatch), posix: List(PosixClassMatch), negated: Bool, caseless: Bool, unicode: Bool) -> Function(Char, Bool)

Curried predicate for an extended character class with Unicode properties.

extended_regular_instructions(routine: List(ExtendedInstruction)) -> List(EvidenceInstruction)

 fn extended_regular_instructions(routine: List(ExtendedInstruction)) -> List(EvidenceInstruction)

Named machines may carry capture-participation constraints on their destination states. Those constraints are checked against the regular evidence already executed on the path plus the destination's epsilon routine: a group that participated contributes its EndCaptureSlot instruction before the guarded branch is entered. Observe instructions are intentionally erased from this view; they only advance capture text. Ordinary machines deliberately continue through machine_destinations, whose indexed proof contract does not mention capture conditions.

extended_unicode_property_class(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, properties: List(UnicodePropertyMatch), posix: List(PosixClassMatch), negated: Bool, caseless: Bool, unicode: Bool) -> Regex(Char)

 fn extended_unicode_property_class(chars: List(Char), ranges: List(CharacterRange), kinds: ClassKinds, properties: List(UnicodePropertyMatch), posix: List(PosixClassMatch), negated: Bool, caseless: Bool, unicode: Bool) -> Regex(Char)

Regex matching an extended character class with Unicode properties.

filter_accepted_decision(n: Nat, keep: Bool, routine: List(EvidenceInstruction), rest: List(MachineState(n)), boundary: Boundary) -> List(MachineState(n))

 fn filter_accepted_decision(n: Nat, keep: Bool, routine: List(EvidenceInstruction), rest: List(MachineState(n)), boundary: Boundary) -> List(MachineState(n))

Classify an accepting MachineState against boundary as kept or rejected.

filter_active_decision(n: Nat, keep: Bool, state: Bounded(n), routine: List(EvidenceInstruction), rest: List(MachineState(n)), boundary: Boundary) -> List(MachineState(n))

 fn filter_active_decision(n: Nat, keep: Bool, state: Bounded(n), routine: List(EvidenceInstruction), rest: List(MachineState(n)), boundary: Boundary) -> List(MachineState(n))

Classify an active MachineState against boundary as kept or rejected.

filter_boundary_states(n: Nat, states: List(MachineState(n)), boundary: Boundary) -> List(MachineState(n))

 fn filter_boundary_states(n: Nat, states: List(MachineState(n)), boundary: Boundary) -> List(MachineState(n))

Keep only MachineState values whose boundary constraints hold at boundary.

filter_boundary_states_with_routine(n: Nat, states: List(MachineState(n)), boundary: Boundary, prior_routine: List(EvidenceInstruction)) -> List(MachineState(n))

 fn filter_boundary_states_with_routine(n: Nat, states: List(MachineState(n)), boundary: Boundary, prior_routine: List(EvidenceInstruction)) -> List(MachineState(n))

Filter MachineStates whose boundary constraints hold with capture routine.

filter_machine_states(n: Nat, states: List(MachineState(n)), boundary: Boundary) -> List(MachineState(n))

 fn filter_machine_states(n: Nat, states: List(MachineState(n)), boundary: Boundary) -> List(MachineState(n))

Filter MachineState values at the boundary derived from position and remaining.

finish_capture(n: Nat, states: List(MachineState(n))) -> List(MachineState(n))

 fn finish_capture(n: Nat, states: List(MachineState(n))) -> List(MachineState(n))

Append the default capture-end instruction to every accepting state in states.

finish_capture_with(n: Nat, end_instruction: EvidenceInstruction, states: List(MachineState(n))) -> List(MachineState(n))

 fn finish_capture_with(n: Nat, end_instruction: EvidenceInstruction, states: List(MachineState(n))) -> List(MachineState(n))

Append end_instruction to every accepting state in states.

finish_pair(n: Nat, states: List(MachineState(n))) -> List(MachineState(n))

 fn finish_pair(n: Nat, states: List(MachineState(n))) -> List(MachineState(n))

Append a pair-completion instruction to every accepting state in states.

first_accepted_evidence(n: Nat, threads: List(EvidenceThread(n))) -> Option(List(Evidence))

 fn first_accepted_evidence(n: Nat, threads: List(EvidenceThread(n))) -> Option(List(Evidence))

Return the evidence stack of the first accepting thread in threads, if any.

folded_range_match(first: Char, last: Char, actual: Char, unicode: Bool) -> Bool

 fn folded_range_match(first: Char, last: Char, actual: Char, unicode: Bool) -> Bool

Return true if char matches [low, high] under case folding.

group_empty_output(n: Nat) -> List(MachineState(n))

 fn group_empty_output(n: Nat) -> List(MachineState(n))

Return the empty destination list for a group machine.

group_machine_next(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> List(MachineState(n))

 fn group_machine_next(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> List(MachineState(n))

Wrap inner transition destinations with capture-end instructions for a group.

group_machine_next_equation(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), group_machine_next(next, state, char), group_next_output(next(state, char)))

 fn group_machine_next_equation(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), group_machine_next(next, state, char), group_next_output(next(state, char)))

Equivalence unfolding group_machine_next to group_next_output.

group_machine_next_with(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), end_instruction: EvidenceInstruction, state: Bounded(n), char: Char) -> List(MachineState(n))

 fn group_machine_next_with(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), end_instruction: EvidenceInstruction, state: Bounded(n), char: Char) -> List(MachineState(n))

Wrap inner transition destinations with a custom capture-end instruction.

group_next_output(n: Nat, destinations: List(MachineState(n))) -> List(MachineState(n))

 fn group_next_output(n: Nat, destinations: List(MachineState(n))) -> List(MachineState(n))

Apply capture-end framing to a list of destination states.

group_next_output_equivalent(n: Nat, left_next: Function(Bounded(n), Function(Char, List(MachineState(n)))), right_next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char, equality: Equivalent(List(MachineState(n)), left_next(state, char), right_next(state, char))) -> Equivalent(List(MachineState(n)), group_machine_next(left_next, state, char), group_machine_next(right_next, state, char))

 fn group_next_output_equivalent(n: Nat, left_next: Function(Bounded(n), Function(Char, List(MachineState(n)))), right_next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char, equality: Equivalent(List(MachineState(n)), left_next(state, char), right_next(state, char))) -> Equivalent(List(MachineState(n)), group_machine_next(left_next, state, char), group_machine_next(right_next, state, char))

Congruence lifting transition equivalence through group_next_output.

group_pattern_machine(n: Nat, starts: List(MachineState(n)), next: Function(Bounded(n), Function(Char, List(MachineState(n))))) -> PatternMachine(n)

 fn group_pattern_machine(n: Nat, starts: List(MachineState(n)), next: Function(Bounded(n), Function(Char, List(MachineState(n))))) -> PatternMachine(n)

Wrap a PatternMachine in a standard capture group.

group_pattern_machine_next_equation(n: Nat, starts: List(MachineState(n)), next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), pattern_machine_next_at(group_pattern_machine(n, starts, next), state, char), group_machine_next(next, state, char))

 fn group_pattern_machine_next_equation(n: Nat, starts: List(MachineState(n)), next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), pattern_machine_next_at(group_pattern_machine(n, starts, next), state, char), group_machine_next(next, state, char))

Equivalence unfolding pattern_machine_next_at for group_pattern_machine.

group_pattern_machine_with_slot(n: Nat, starts: List(MachineState(n)), next: Function(Bounded(n), Function(Char, List(MachineState(n)))), slot: Nat) -> PatternMachine(n)

 fn group_pattern_machine_with_slot(n: Nat, starts: List(MachineState(n)), next: Function(Bounded(n), Function(Char, List(MachineState(n)))), slot: Nat) -> PatternMachine(n)

Wrap a PatternMachine in a named capture group identified by slot.

guard_pattern_machine(n: Nat, constraint: BoundaryConstraint, machine: PatternMachine(n)) -> PatternMachine(n)

 fn guard_pattern_machine(n: Nat, constraint: BoundaryConstraint, machine: PatternMachine(n)) -> PatternMachine(n)

Guard all start states of a PatternMachine with a CaptureCondition.

guard_states(n: Nat, constraint: BoundaryConstraint, states: List(MachineState(n))) -> List(MachineState(n))

 fn guard_states(n: Nat, constraint: BoundaryConstraint, states: List(MachineState(n))) -> List(MachineState(n))

Attach a leading BoundaryConstraint to every state in states.

history_at(history: List(Char), index: Nat) -> Option(Char)

 fn history_at(history: List(Char), index: Nat) -> Option(Char)

Look up the offset-th previous character in reverse history.

history_has_width(history: List(Char), width: Nat) -> Bool

 fn history_has_width(history: List(Char), width: Nat) -> Bool

Return true if reverse history contains at least width characters.

history_push_bounded(history: List(Char), char: Char) -> List(Char)

 fn history_push_bounded(history: List(Char), char: Char) -> List(Char)

Histories are newest-first and bounded to one scalar beyond the eight- scalar assertion limit. The extra scalar supplies the boundary context immediately before a fixed-width lookbehind window.

history_take_limit(values: List(Char), limit: Nat) -> List(Char)

 fn history_take_limit(values: List(Char), limit: Nat) -> List(Char)

Take up to limit characters from a reverse character history list.

horizontal_class(negated: Bool) -> Regex(Char)

 fn horizontal_class(negated: Bool) -> Regex(Char)

Regex matching horizontal whitespace (\h or \H when negated).

horizontal_predicate(negated: Bool, char: Char) -> Bool

 fn horizontal_predicate(negated: Bool, char: Char) -> Bool

Test whether char is horizontal whitespace (\h / \H).

horizontal_test(negated: Bool) -> Function(Char, Bool)

 fn horizontal_test(negated: Bool) -> Function(Char, Bool)

Curried predicate for horizontal whitespace (\h / \H).

impossible_lookaround_empty_active_path(depth: Nat, n: Nat, machine: PatternMachine(n), after_input: List(Char), source: Bounded(n), history: List(Char), policy: NewlinePolicy, result: Type, path: LookaroundAcceptingPath(depth, n, machine, Nil(), after_input, ThreadActive(source), history, policy)) -> result

 fn impossible_lookaround_empty_active_path(depth: Nat, n: Nat, machine: PatternMachine(n), after_input: List(Char), source: Bounded(n), history: List(Char), policy: NewlinePolicy, result: Type, path: LookaroundAcceptingPath(depth, n, machine, Nil(), after_input, ThreadActive(source), history, policy)) -> result

An active thread cannot have an accepting path over an empty input. Keeping this contradiction at the typed path boundary prevents a later refutation proof from accidentally treating an unconsumed active state as terminally accepted.

in_ranges(ranges: List(CharacterRange), actual: Char) -> Bool

 fn in_ranges(ranges: List(CharacterRange), actual: Char) -> Bool

Return true if char falls in any inclusive (low, high) range in ranges.

in_ranges_with_options(ranges: List(CharacterRange), actual: Char, caseless: Bool, unicode: Bool) -> Bool

 fn in_ranges_with_options(ranges: List(CharacterRange), actual: Char, caseless: Bool, unicode: Bool) -> Bool

Return true if char falls in any range in ranges under options.

initial_machine_destinations(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char)) -> List(MachineState(n))

 fn initial_machine_destinations(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char)) -> List(MachineState(n))

Compute boundary-filtered initial states for machine at position.

initial_position_boundary(position: InitialPosition, input: List(Char)) -> Boundary

 fn initial_position_boundary(position: InitialPosition, input: List(Char)) -> Boundary

Compute the Boundary at the start of remaining given an already-consumed prefix.

initial_thread(n: Nat, destination: MachineState(n)) -> EvidenceThread(n)

 fn initial_thread(n: Nat, destination: MachineState(n)) -> EvidenceThread(n)

Create an initial EvidenceThread from a starting MachineState.

initial_threads(n: Nat, starts: List(MachineState(n))) -> List(EvidenceThread(n))

 fn initial_threads(n: Nat, starts: List(MachineState(n))) -> List(EvidenceThread(n))

Create initial EvidenceThreads for all starting MachineStates.

inject_alternate_left(left_count: Nat, right_count: Nat, state: Bounded(left_count)) -> Bounded(plus(left_count, right_count))

 fn inject_alternate_left(left_count: Nat, right_count: Nat, state: Bounded(left_count)) -> Bounded(plus(left_count, right_count))

Inject a left-branch bounded state index into an alternation's sum state space.

inject_alternate_right(left_count: Nat, right_count: Nat, state: Bounded(right_count)) -> Bounded(plus(left_count, right_count))

 fn inject_alternate_right(left_count: Nat, right_count: Nat, state: Bounded(right_count)) -> Bounded(plus(left_count, right_count))

Inject a right-branch bounded state index into an alternation's sum state space.

inject_left_states(left_count: Nat, right_count: Nat, states: List(MachineState(left_count))) -> List(MachineState(plus(left_count, right_count)))

 fn inject_left_states(left_count: Nat, right_count: Nat, states: List(MachineState(left_count))) -> List(MachineState(plus(left_count, right_count)))

Widen machine states from the left submachine into a combined sum state space.

inject_right_states(left_count: Nat, right_count: Nat, states: List(MachineState(right_count))) -> List(MachineState(plus(left_count, right_count)))

 fn inject_right_states(left_count: Nat, right_count: Nat, states: List(MachineState(right_count))) -> List(MachineState(plus(left_count, right_count)))

Shift machine states from the right submachine into a combined sum state space.

line_break() -> Regex(String)

 fn line_break() -> Regex(String)

Regex matching a line break (\R) under the default newline policy.

line_break_pair_end_policy(policy: NewlinePolicy) -> Bool

 fn line_break_pair_end_policy(policy: NewlinePolicy) -> Bool

Return true if char can end a two-character CRLF line break under policy.

line_break_pair_end_test(policy: NewlinePolicy, char: Char) -> Bool

 fn line_break_pair_end_test(policy: NewlinePolicy, char: Char) -> Bool

Test whether char is \n (end of a CRLF line break).

line_break_pair_start_policy(policy: NewlinePolicy) -> Bool

 fn line_break_pair_start_policy(policy: NewlinePolicy) -> Bool

Return true if char can start a two-character CRLF line break under policy.

line_break_pair_start_test(policy: NewlinePolicy, char: Char) -> Bool

 fn line_break_pair_start_test(policy: NewlinePolicy, char: Char) -> Bool

Test whether char is \r (start of a CRLF line break).

line_break_pair_test(policy: NewlinePolicy, expected: Char) -> Function(Char, Bool)

 fn line_break_pair_test(policy: NewlinePolicy, expected: Char) -> Function(Char, Bool)

Test whether char starts a CRLF pair under policy.

line_break_scalar_policy(policy: NewlinePolicy, char: Char) -> Bool

 fn line_break_scalar_policy(policy: NewlinePolicy, char: Char) -> Bool

Return true if char is a single-character line break under policy.

line_break_scalar_test(policy: NewlinePolicy, expected: Char) -> Function(Char, Bool)

 fn line_break_scalar_test(policy: NewlinePolicy, expected: Char) -> Function(Char, Bool)

Test whether char is a single-character line break under policy.

line_break_with_policy(policy: NewlinePolicy) -> Regex(String)

 fn line_break_with_policy(policy: NewlinePolicy) -> Regex(String)

Regex matching a line break (\R) under an explicit NewlinePolicy.

line_end_constraint() -> BoundaryConstraint

 fn line_end_constraint() -> BoundaryConstraint

Construct a line-end ($) boundary constraint with the default newline policy.

line_end_constraint_with_policy(policy: NewlinePolicy) -> BoundaryConstraint

 fn line_end_constraint_with_policy(policy: NewlinePolicy) -> BoundaryConstraint

Construct a line-end ($) boundary constraint with an explicit newline policy.

line_end_for(policy: NewlinePolicy, next_char: Option(Char), after_next_char: Option(Char)) -> Bool

 fn line_end_for(policy: NewlinePolicy, next_char: Option(Char), after_next_char: Option(Char)) -> Bool

Determine whether a position is at a line end given previous, current, and policy.

line_start_constraint() -> BoundaryConstraint

 fn line_start_constraint() -> BoundaryConstraint

Construct a line-start (^) boundary constraint with the default newline policy.

line_start_constraint_with_policy(policy: NewlinePolicy) -> BoundaryConstraint

 fn line_start_constraint_with_policy(policy: NewlinePolicy) -> BoundaryConstraint

Construct a line-start (^) boundary constraint with an explicit newline policy.

line_start_for(policy: NewlinePolicy, previous_char: Option(Char), next_char: Option(Char)) -> Bool

 fn line_start_for(policy: NewlinePolicy, previous_char: Option(Char), next_char: Option(Char)) -> Bool

Determine whether a position is at a line start given previous, current, and policy.

literal_history_limit() -> Nat

 fn literal_history_limit() -> Nat

Return the maximum lookbehind history window retained during matching.

lookahead_constraint(shape: ShapeCode, compilation: LookaroundCompilation(shape), positive: Bool, policy: NewlinePolicy) -> BoundaryConstraint

 fn lookahead_constraint(shape: ShapeCode, compilation: LookaroundCompilation(shape), positive: Bool, policy: NewlinePolicy) -> BoundaryConstraint

Assertions are staged as ordinary zero-state boundary nodes. The child machine is closed over once here; each boundary check only supplies the current finite subject context, so no source parser or machine rebuild is performed during matching.

lookahead_decision_holds(n: Nat, machine: PatternMachine(n), positive: Bool, decision: LookaheadDecision(n, machine)) -> Bool

 fn lookahead_decision_holds(n: Nat, machine: PatternMachine(n), positive: Bool, decision: LookaheadDecision(n, machine)) -> Bool

Return true if a LookaheadDecision succeeded.

lookahead_witness(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, starts: List(MachineState(n)), path: LookaroundPrefixSearchPath(depth, n, machine, starts, input, after_input, history, policy)) -> LookaheadWitness(n, machine)

 fn lookahead_witness(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, starts: List(MachineState(n)), path: LookaroundPrefixSearchPath(depth, n, machine, starts, input, after_input, history, policy)) -> LookaheadWitness(n, machine)

Wrap a prefix search path into a LookaheadWitness.

lookaround_accepting_members_path(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source: Bounded(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, current: List(MachineState(n)), members: MachineStateMembers(n, lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy), current)) -> LookaroundAcceptingMembersResult(depth, n, machine, lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy), current, Cons(char, rest), after_input, ThreadActive(source), history, policy, capture_context)

 fn lookaround_accepting_members_path(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source: Bounded(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, current: List(MachineState(n)), members: MachineStateMembers(n, lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy), current)) -> LookaroundAcceptingMembersResult(depth, n, machine, lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy), current, Cons(char, rest), after_input, ThreadActive(source), history, policy, capture_context)

Search for an accepting path across a list of member MachineStates.

lookaround_accepting_path(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaroundAcceptingPathResult(depth, n, machine, input, after_input, state, history, policy, capture_context)

 fn lookaround_accepting_path(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaroundAcceptingPathResult(depth, n, machine, input, after_input, state, history, policy, capture_context)

Search for an accepting path from a single MachineState over input.

lookaround_accepting_path_now(depth: Nat, n: Nat, machine: PatternMachine(n), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaroundAcceptingPathResult(depth, n, machine, Nil(), after_input, ThreadAccepted(), history, policy, capture_context)

 fn lookaround_accepting_path_now(depth: Nat, n: Nat, machine: PatternMachine(n), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaroundAcceptingPathResult(depth, n, machine, Nil(), after_input, ThreadAccepted(), history, policy, capture_context)

Check whether a single MachineState accepts immediately with no remaining input.

lookaround_child_lookahead(depth: Nat, n: Nat, machine: PatternMachine(n), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaheadDecision(n, machine)

 fn lookaround_child_lookahead(depth: Nat, n: Nat, machine: PatternMachine(n), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaheadDecision(n, machine)

Lookaround child evaluation reuses the checked Thompson machine and has a context-aware, finite search loop. The Boolean path records only the existence of an accepting child path; the named sidecar below replays the selected child routine when assertion-local captures are requested.

lookaround_child_lookbehind(depth: Nat, n: Nat, machine: PatternMachine(n), width: Nat, boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookbehindDecision(n, machine)

 fn lookaround_child_lookbehind(depth: Nat, n: Nat, machine: PatternMachine(n), width: Nat, boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookbehindDecision(n, machine)

Evaluate a nested lookbehind constraint inside a lookaround at the remaining depth.

lookaround_compiled(shape: ShapeCode, compilation: LookaroundCompilation(shape)) -> Sigma(n: Nat, PatternMachine(n))

 fn lookaround_compiled(shape: ShapeCode, compilation: LookaroundCompilation(shape)) -> Sigma(n: Nat, PatternMachine(n))

Package a LookaroundCompilation into an existentially quantified PatternMachine.

lookaround_condition_capture_context(depth: Nat, condition: Option(LookaroundCondition), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(EvidenceInstruction))

 fn lookaround_condition_capture_context(depth: Nat, condition: Option(LookaroundCondition), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(EvidenceInstruction))

A successful positive assertion can publish capture participation to the parent's ordinary finite machine. The Boolean decision remains the admission check; the capture-aware routine supplies only slot markers.

lookaround_condition_holds(depth: Nat, condition: Option(LookaroundCondition), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Bool

 fn lookaround_condition_holds(depth: Nat, condition: Option(LookaroundCondition), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Bool

Evaluate a LookaroundCondition at the current position and recursion depth.

lookaround_condition_routine(depth: Nat, condition: Option(LookaroundCondition), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(ExtendedInstruction))

 fn lookaround_condition_routine(depth: Nat, condition: Option(LookaroundCondition), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(ExtendedInstruction))

Evaluate a LookaroundCondition and return its resulting ExtendedRoutine if satisfied.

lookaround_constraint_capture_context(depth: Nat, constraint: BoundaryConstraint, boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(EvidenceInstruction))

 fn lookaround_constraint_capture_context(depth: Nat, constraint: BoundaryConstraint, boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(EvidenceInstruction))

Extract the capture context needed to evaluate a lookaround BoundaryConstraint.

lookaround_constraint_nested_decisions(depth: Nat, constraint: BoundaryConstraint, boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> List(LookaroundNestedDecision)

 fn lookaround_constraint_nested_decisions(depth: Nat, constraint: BoundaryConstraint, boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> List(LookaroundNestedDecision)

Collect nested lookaround decisions produced while checking a single constraint.

lookaround_constraint_routine(depth: Nat, constraint: BoundaryConstraint, boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(ExtendedInstruction))

 fn lookaround_constraint_routine(depth: Nat, constraint: BoundaryConstraint, boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(ExtendedInstruction))

Evaluate a lookaround BoundaryConstraint and return any captured routine.

lookaround_constraints_capture_context(depth: Nat, constraints: List(BoundaryConstraint), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(EvidenceInstruction))

 fn lookaround_constraints_capture_context(depth: Nat, constraints: List(BoundaryConstraint), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(EvidenceInstruction))

Extract capture contexts for a list of lookaround BoundaryConstraints.

lookaround_constraints_routine(depth: Nat, constraints: List(BoundaryConstraint), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(ExtendedInstruction))

 fn lookaround_constraints_routine(depth: Nat, constraints: List(BoundaryConstraint), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Option(List(ExtendedInstruction))

Capture-aware boundary evaluation returns the selected child routine for a positive assertion. A negative assertion succeeds with an empty routine: its private capture frame is intentionally discarded. The Boolean path above remains the acceptance authority; this side channel only preserves the witness needed by named replay.

lookaround_exhaustion_from_list(n: Nat, values: List(MachineState(n))) -> LookaroundExhaustion(n)

 fn lookaround_exhaustion_from_list(n: Nat, values: List(MachineState(n))) -> LookaroundExhaustion(n)

Construct a LookaroundExhaustion witness from a list of failed member states.

lookaround_exhaustion_from_members(n: Nat, whole: List(MachineState(n)), values: List(MachineState(n)), members: MachineStateMembers(n, whole, values)) -> LookaroundExhaustion(n)

 fn lookaround_exhaustion_from_members(n: Nat, whole: List(MachineState(n)), values: List(MachineState(n)), members: MachineStateMembers(n, whole, values)) -> LookaroundExhaustion(n)

Turn a structurally enumerated candidate list into the compact erased exhaustion witness used by assertion refutations. The recursive call is the only way to obtain the Nil remainder, so callers cannot manufacture a certificate for a list whose traversal has not terminated.

lookaround_filter_boundary_states(depth: Nat, n: Nat, states: List(MachineState(n)), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> List(MachineState(n))

 fn lookaround_filter_boundary_states(depth: Nat, n: Nat, states: List(MachineState(n)), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> List(MachineState(n))

Assertion operands are validated as depth-bounded before emission. Their child machine can therefore recurse only through the explicit finite fuel; using this separate filter keeps Boolean child evaluation outside the parent constraint evaluator's ordinary totality SCC.

lookaround_first_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), history: List(Char), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char)))

 fn lookaround_first_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), history: List(Char), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char)))

Find the shortest (first) prefix of input accepted by a lookaround machine.

lookaround_first_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), history: List(Char), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char)))

 fn lookaround_first_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), history: List(Char), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char)))

Recursive helper for lookaround_first_prefix accumulating matched characters.

lookaround_impossible_list_member(item_type: Type, item: item_type, result: Type, membership: ListMember(item_type, item, Nil())) -> result

 fn lookaround_impossible_list_member(item_type: Type, item: item_type, result: Type, membership: ListMember(item_type, item, Nil())) -> result

The empty start list has no accepting path. This is the base case used by the eventual refutation-tree soundness proof: every search-path constructor carries a membership witness in starts, so starts = [] is eliminated constructively rather than treated as an unchecked claim.

lookaround_last_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), history: List(Char), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char)))

 fn lookaround_last_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), history: List(Char), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char)))

Find the longest (last) prefix of input accepted by a lookaround machine.

lookaround_last_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: Option(Tuple(List(Char), List(Char))), history: List(Char), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char)))

 fn lookaround_last_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: Option(Tuple(List(Char), List(Char))), history: List(Char), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char)))

Recursive helper for lookaround_last_prefix tracking the latest match.

lookaround_machine(shape: ShapeCode, compilation: LookaroundCompilation(shape)) -> PatternMachine(lookaround_state_count(compilation))

 fn lookaround_machine(shape: ShapeCode, compilation: LookaroundCompilation(shape)) -> PatternMachine(lookaround_state_count(compilation))

Build the finite child machine once. Atomic scopes are represented by the same BeginAtomic/EndAtomic routine markers used by the ordinary runtime plan, so nested assertion evaluation can apply one commitment invariant rather than maintaining a second backtracking mechanism.

lookaround_machine_acceptance_path(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaroundSearchResult(depth, n, machine, input, after_input, history, policy, capture_context)

 fn lookaround_machine_acceptance_path(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaroundSearchResult(depth, n, machine, input, after_input, history, policy, capture_context)

Search for a full acceptance path of a lookaround machine on input.

lookaround_machine_accepts(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Bool

 fn lookaround_machine_accepts(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Bool

Return true if a lookaround machine accepts input.

lookaround_machine_destinations(depth: Nat, n: Nat, machine: PatternMachine(n), state: ThreadState(n), char: Char, rest: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> List(MachineState(n))

 fn lookaround_machine_destinations(depth: Nat, n: Nat, machine: PatternMachine(n), state: ThreadState(n), char: Char, rest: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> List(MachineState(n))

Compute filtered destination states for a lookaround machine step.

lookaround_machine_raw_destinations(n: Nat, machine: PatternMachine(n), state: ThreadState(n), char: Char) -> List(MachineState(n))

 fn lookaround_machine_raw_destinations(n: Nat, machine: PatternMachine(n), state: ThreadState(n), char: Char) -> List(MachineState(n))

Compute unfiltered destination states for a lookaround machine step.

lookaround_nested_decisions(depth: Nat, constraints: List(BoundaryConstraint), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> List(LookaroundNestedDecision)

 fn lookaround_nested_decisions(depth: Nat, constraints: List(BoundaryConstraint), boundary: Boundary, remaining: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> List(LookaroundNestedDecision)

Collect nested lookaround decisions across a list of constraints.

lookaround_path_accepted_with_input(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, ThreadAccepted(), history, capture_context, policy, Nil(), Nil())

 fn lookaround_path_accepted_with_input(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, ThreadAccepted(), history, capture_context, policy, Nil(), Nil())

Construct a path-failure witness when an accepting state still has remaining input.

lookaround_path_destination_accepted_rejected(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, destinations: List(MachineState(n)), routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), edge: ListMember(MachineState(n), Accepted(routine, constraints), destinations), child_destinations: List(MachineState(n)), child_remaining_destinations: List(MachineState(n)), child_failure: LookaroundPathFailure(depth, n, machine, rest, after_input, ThreadAccepted(), history_push_bounded(history, char), append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations), remaining_destinations: List(MachineState(n)), tail: LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, source, history, capture_context, policy, destinations, remaining_destinations), members: MachineStateMembers(n, destinations, Cons(Accepted(routine, constraints), remaining_destinations)), destinations_equivalent: Equivalent(List(MachineState(n)), destinations, lookaround_machine_destinations(depth, n, machine, source, char, rest, after_input, history, capture_context, policy))) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, source, history, capture_context, policy, destinations, Cons(Accepted(routine, constraints), remaining_destinations))

 fn lookaround_path_destination_accepted_rejected(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, destinations: List(MachineState(n)), routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), edge: ListMember(MachineState(n), Accepted(routine, constraints), destinations), child_destinations: List(MachineState(n)), child_remaining_destinations: List(MachineState(n)), child_failure: LookaroundPathFailure(depth, n, machine, rest, after_input, ThreadAccepted(), history_push_bounded(history, char), append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations), remaining_destinations: List(MachineState(n)), tail: LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, source, history, capture_context, policy, destinations, remaining_destinations), members: MachineStateMembers(n, destinations, Cons(Accepted(routine, constraints), remaining_destinations)), destinations_equivalent: Equivalent(List(MachineState(n)), destinations, lookaround_machine_destinations(depth, n, machine, source, char, rest, after_input, history, capture_context, policy))) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, source, history, capture_context, policy, destinations, Cons(Accepted(routine, constraints), remaining_destinations))

Construct a path-failure witness for an accepting destination rejected by boundary constraints.

lookaround_path_destination_active_rejected(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, destinations: List(MachineState(n)), destination: Bounded(n), routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), edge: ListMember(MachineState(n), Active(destination, routine, constraints), destinations), child_destinations: List(MachineState(n)), child_remaining_destinations: List(MachineState(n)), child_failure: LookaroundPathFailure(depth, n, machine, rest, after_input, ThreadActive(destination), history_push_bounded(history, char), append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations), remaining_destinations: List(MachineState(n)), tail: LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, source, history, capture_context, policy, destinations, remaining_destinations), members: MachineStateMembers(n, destinations, Cons(Active(destination, routine, constraints), remaining_destinations)), destinations_equivalent: Equivalent(List(MachineState(n)), destinations, lookaround_machine_destinations(depth, n, machine, source, char, rest, after_input, history, capture_context, policy))) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, source, history, capture_context, policy, destinations, Cons(Active(destination, routine, constraints), remaining_destinations))

 fn lookaround_path_destination_active_rejected(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, destinations: List(MachineState(n)), destination: Bounded(n), routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), edge: ListMember(MachineState(n), Active(destination, routine, constraints), destinations), child_destinations: List(MachineState(n)), child_remaining_destinations: List(MachineState(n)), child_failure: LookaroundPathFailure(depth, n, machine, rest, after_input, ThreadActive(destination), history_push_bounded(history, char), append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations), remaining_destinations: List(MachineState(n)), tail: LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, source, history, capture_context, policy, destinations, remaining_destinations), members: MachineStateMembers(n, destinations, Cons(Active(destination, routine, constraints), remaining_destinations)), destinations_equivalent: Equivalent(List(MachineState(n)), destinations, lookaround_machine_destinations(depth, n, machine, source, char, rest, after_input, history, capture_context, policy))) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, source, history, capture_context, policy, destinations, Cons(Active(destination, routine, constraints), remaining_destinations))

Construct a path-failure witness for an active destination rejected by boundary constraints.

lookaround_path_exhausted(depth: Nat, n: Nat, machine: PatternMachine(n), after_input: List(Char), source: Bounded(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, destinations: List(MachineState(n)), members: MachineStateMembers(n, destinations, Nil()), destinations_equivalent: Equivalent(List(MachineState(n)), destinations, empty_machine_states(n))) -> LookaroundPathFailure(depth, n, machine, Nil(), after_input, ThreadActive(source), history, capture_context, policy, destinations, Nil())

 fn lookaround_path_exhausted(depth: Nat, n: Nat, machine: PatternMachine(n), after_input: List(Char), source: Bounded(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, destinations: List(MachineState(n)), members: MachineStateMembers(n, destinations, Nil()), destinations_equivalent: Equivalent(List(MachineState(n)), destinations, empty_machine_states(n))) -> LookaroundPathFailure(depth, n, machine, Nil(), after_input, ThreadActive(source), history, capture_context, policy, destinations, Nil())

Construct a path-failure witness when no candidate destinations remain.

lookaround_path_step_exhausted(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source: Bounded(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, destinations: List(MachineState(n)), members: MachineStateMembers(n, destinations, Nil()), destinations_equivalent: Equivalent(List(MachineState(n)), destinations, lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy))) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, ThreadActive(source), history, capture_context, policy, destinations, Nil())

 fn lookaround_path_step_exhausted(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source: Bounded(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, destinations: List(MachineState(n)), members: MachineStateMembers(n, destinations, Nil()), destinations_equivalent: Equivalent(List(MachineState(n)), destinations, lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy))) -> LookaroundPathFailure(depth, n, machine, Cons(char, rest), after_input, ThreadActive(source), history, capture_context, policy, destinations, Nil())

Construct a path-failure witness when all successor states fail.

lookaround_polarity_holds(positive: Bool, result: Bool) -> Bool

 fn lookaround_polarity_holds(positive: Bool, result: Bool) -> Bool

Apply positive or negative lookaround polarity to a match boolean.

lookaround_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), greedy: Bool, history: List(Char), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char)))

 fn lookaround_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), greedy: Bool, history: List(Char), policy: NewlinePolicy) -> Option(Tuple(List(Char), List(Char)))

Find either the shortest (lazy: true) or longest (lazy: false) prefix accepted by a lookaround machine.

lookaround_prefix_filtered_starts(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> List(MachineState(n))

 fn lookaround_prefix_filtered_starts(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> List(MachineState(n))

Filter a lookaround machine's start states at the current boundary.

lookaround_prefix_machine_accepts(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Bool

 fn lookaround_prefix_machine_accepts(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> Bool

Return true if a lookaround machine matches any prefix of input.

lookaround_prefix_members_path(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source: Bounded(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, current: List(MachineState(n)), members: MachineStateMembers(n, lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy), current)) -> LookaroundPrefixMembersResult(depth, n, machine, lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy), current, Cons(char, rest), after_input, ThreadActive(source), history, policy, capture_context)

 fn lookaround_prefix_members_path(depth: Nat, n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source: Bounded(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, current: List(MachineState(n)), members: MachineStateMembers(n, lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy), current)) -> LookaroundPrefixMembersResult(depth, n, machine, lookaround_machine_destinations(depth, n, machine, ThreadActive(source), char, rest, after_input, history, capture_context, policy), current, Cons(char, rest), after_input, ThreadActive(source), history, policy, capture_context)

Search for a prefix-accepting path across a list of member MachineStates.

lookaround_prefix_path(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaroundPrefixPathResult(depth, n, machine, input, after_input, state, history, policy, capture_context)

 fn lookaround_prefix_path(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaroundPrefixPathResult(depth, n, machine, input, after_input, state, history, policy, capture_context)

Search for a prefix-accepting path from a single MachineState over input.

lookaround_prefix_search_decision(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaheadDecision(n, machine)

 fn lookaround_prefix_search_decision(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookaheadDecision(n, machine)

Decide a lookahead assertion and return a certified LookaheadDecision.

lookaround_prefix_search_path(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n))) -> LookaroundPrefixSearchResult(depth, n, machine, input, after_input, history, policy, capture_context)

 fn lookaround_prefix_search_path(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n))) -> LookaroundPrefixSearchResult(depth, n, machine, input, after_input, history, policy, capture_context)

Run a certified prefix lookaround search from machine's start states.

lookaround_prefix_search_path_members(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)), current: List(MachineState(n)), members: MachineStateMembers(n, starts, current)) -> LookaroundPrefixSearchMembersResult(depth, n, machine, starts, input, after_input, history, policy, capture_context)

 fn lookaround_prefix_search_path_members(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)), current: List(MachineState(n)), members: MachineStateMembers(n, starts, current)) -> LookaroundPrefixSearchMembersResult(depth, n, machine, starts, input, after_input, history, policy, capture_context)

Run a certified prefix lookaround search across explicit start-state members.

lookaround_search_accepted_rejected(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)), routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), member: ListMember(MachineState(n), Accepted(routine, constraints), starts), child_destinations: List(MachineState(n)), child_remaining_destinations: List(MachineState(n)), child_failure: LookaroundPathFailure(depth, n, machine, input, after_input, ThreadAccepted(), history, append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations), remaining_starts: List(MachineState(n)), tail: LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts), members: MachineStateMembers(n, starts, Cons(Accepted(routine, constraints), remaining_starts))) -> LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)

 fn lookaround_search_accepted_rejected(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)), routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), member: ListMember(MachineState(n), Accepted(routine, constraints), starts), child_destinations: List(MachineState(n)), child_remaining_destinations: List(MachineState(n)), child_failure: LookaroundPathFailure(depth, n, machine, input, after_input, ThreadAccepted(), history, append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations), remaining_starts: List(MachineState(n)), tail: LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts), members: MachineStateMembers(n, starts, Cons(Accepted(routine, constraints), remaining_starts))) -> LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)

Construct a search-failure witness for a rejected accepting start state.

lookaround_search_active_rejected(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)), state: Bounded(n), routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), member: ListMember(MachineState(n), Active(state, routine, constraints), starts), child_destinations: List(MachineState(n)), child_remaining_destinations: List(MachineState(n)), child_failure: LookaroundPathFailure(depth, n, machine, input, after_input, ThreadActive(state), history, append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations), remaining_starts: List(MachineState(n)), tail: LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts), members: MachineStateMembers(n, starts, Cons(Active(state, routine, constraints), remaining_starts))) -> LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)

 fn lookaround_search_active_rejected(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)), state: Bounded(n), routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), member: ListMember(MachineState(n), Active(state, routine, constraints), starts), child_destinations: List(MachineState(n)), child_remaining_destinations: List(MachineState(n)), child_failure: LookaroundPathFailure(depth, n, machine, input, after_input, ThreadActive(state), history, append_routine(capture_context, routine), policy, child_destinations, child_remaining_destinations), remaining_starts: List(MachineState(n)), tail: LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts), members: MachineStateMembers(n, starts, Cons(Active(state, routine, constraints), remaining_starts))) -> LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)

Construct a search-failure witness for a rejected active start state.

lookaround_search_decision(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookbehindDecision(n, machine)

 fn lookaround_search_decision(depth: Nat, n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy) -> LookbehindDecision(n, machine)

Decide a lookbehind assertion and return a certified LookbehindDecision.

lookaround_search_exhausted(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)), members: MachineStateMembers(n, starts, Nil())) -> LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)

 fn lookaround_search_exhausted(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)), members: MachineStateMembers(n, starts, Nil())) -> LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, starts)

Construct a search-failure witness when no start states remain.

lookaround_search_failure_excludes_empty_starts(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, result: Type, failure: LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, Nil()), path: LookaroundSearchPath(depth, n, machine, Nil(), input, after_input, history, policy)) -> result

 fn lookaround_search_failure_excludes_empty_starts(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, result: Type, failure: LookaroundSearchFailure(depth, n, machine, input, after_input, history, capture_context, policy, Nil()), path: LookaroundSearchPath(depth, n, machine, Nil(), input, after_input, history, policy)) -> result

Eliminate an impossible lookaround search failure from an empty start list.

lookaround_search_path(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n))) -> LookaroundSearchResult(depth, n, machine, input, after_input, history, policy, capture_context)

 fn lookaround_search_path(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n))) -> LookaroundSearchResult(depth, n, machine, input, after_input, history, policy, capture_context)

Run a certified full-input lookaround search from machine's start states.

lookaround_search_path_excludes_empty_starts(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, result: Type, path: LookaroundSearchPath(depth, n, machine, Nil(), input, after_input, history, policy)) -> result

 fn lookaround_search_path_excludes_empty_starts(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, result: Type, path: LookaroundSearchPath(depth, n, machine, Nil(), input, after_input, history, policy)) -> result

Eliminate an impossible lookaround search path from an empty start list.

lookaround_search_path_members(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)), current: List(MachineState(n)), members: MachineStateMembers(n, starts, current)) -> LookaroundSearchMembersResult(depth, n, machine, starts, input, after_input, history, policy, capture_context)

 fn lookaround_search_path_members(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), capture_context: List(EvidenceInstruction), policy: NewlinePolicy, starts: List(MachineState(n)), current: List(MachineState(n)), members: MachineStateMembers(n, starts, current)) -> LookaroundSearchMembersResult(depth, n, machine, starts, input, after_input, history, policy, capture_context)

Run a certified full-input lookaround search across explicit start-state members.

lookaround_state_count(shape: ShapeCode, compilation: LookaroundCompilation(shape)) -> Nat

 fn lookaround_state_count(shape: ShapeCode, compilation: LookaroundCompilation(shape)) -> Nat

Return the total number of states in a LookaroundCompilation.

lookaround_transition_boundary(char: Char, rest: List(Char), after_input: List(Char), policy: NewlinePolicy) -> Boundary

 fn lookaround_transition_boundary(char: Char, rest: List(Char), after_input: List(Char), policy: NewlinePolicy) -> Boundary

Compute the Boundary after a lookaround machine consumes char.

lookbehind_constraint(shape: ShapeCode, compilation: LookaroundCompilation(shape), positive: Bool, width: Nat, policy: NewlinePolicy) -> BoundaryConstraint

 fn lookbehind_constraint(shape: ShapeCode, compilation: LookaroundCompilation(shape), positive: Bool, width: Nat, policy: NewlinePolicy) -> BoundaryConstraint

Construct a lookbehind boundary constraint with polarity, width, and compiled machine.

lookbehind_decision_holds(n: Nat, machine: PatternMachine(n), positive: Bool, decision: LookbehindDecision(n, machine)) -> Bool

 fn lookbehind_decision_holds(n: Nat, machine: PatternMachine(n), positive: Bool, decision: LookbehindDecision(n, machine)) -> Bool

Return true if a LookbehindDecision succeeded.

lookbehind_initial_position(boundary: Boundary, history: List(Char), width: Nat, policy: NewlinePolicy) -> InitialPosition

 fn lookbehind_initial_position(boundary: Boundary, history: List(Char), width: Nat, policy: NewlinePolicy) -> InitialPosition

Compute the starting Position for a lookbehind window of length width.

lookbehind_window(history: List(Char), width: Nat) -> Option(List(Char))

 fn lookbehind_window(history: List(Char), width: Nat) -> Option(List(Char))

Extract the last width characters from reverse history in forward order.

lookbehind_witness(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, starts: List(MachineState(n)), path: LookaroundSearchPath(depth, n, machine, starts, input, after_input, history, policy)) -> LookbehindWitness(n, machine)

 fn lookbehind_witness(depth: Nat, n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), history: List(Char), policy: NewlinePolicy, starts: List(MachineState(n)), path: LookaroundSearchPath(depth, n, machine, starts, input, after_input, history, policy)) -> LookbehindWitness(n, machine)

Wrap a full search path into a LookbehindWitness.

machine_accepts_chars(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), input: List(Char), current: List(MachineState(n))) -> Bool

 fn machine_accepts_chars(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), input: List(Char), current: List(MachineState(n))) -> Bool

Execute a PatternMachine on a character list and return whether any thread accepts.

machine_destinations(n: Nat, machine: PatternMachine(n), state: ThreadState(n), char: Char, boundary: Boundary) -> List(MachineState(n))

 fn machine_destinations(n: Nat, machine: PatternMachine(n), state: ThreadState(n), char: Char, boundary: Boundary) -> List(MachineState(n))

Compute boundary-filtered transitions for machine from state on char.

machine_has_accept(n: Nat, states: List(MachineState(n))) -> Bool

 fn machine_has_accept(n: Nat, states: List(MachineState(n))) -> Bool

Return true if any state in states is accepting.

machine_state_members(n: Nat, values: List(MachineState(n))) -> MachineStateMembers(n, values, values)

 fn machine_state_members(n: Nat, values: List(MachineState(n))) -> MachineStateMembers(n, values, values)

Build the reflexive MachineStateMembers witness for a list of states.

machine_state_routine(n: Nat, state: MachineState(n)) -> List(EvidenceInstruction)

 fn machine_state_routine(n: Nat, state: MachineState(n)) -> List(EvidenceInstruction)

Extract the evidence instruction routine attached to a MachineState.

machine_step(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), char: Char, current: List(MachineState(n))) -> List(MachineState(n))

 fn machine_step(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), char: Char, current: List(MachineState(n))) -> List(MachineState(n))

Step a list of active MachineState values on char via machine.

machine_step_one(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), char: Char, current: MachineState(n)) -> List(MachineState(n))

 fn machine_step_one(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), char: Char, current: MachineState(n)) -> List(MachineState(n))

Step a single active MachineState on char via machine.

map(a: Type, b: Type, regex: Regex(a), transform: Function(a, b)) -> Regex(b)

 fn map(a: Type, b: Type, regex: Regex(a), transform: Function(a, b)) -> Regex(b)

Transform the typed result of regex using transform.

mark_branch(n: Nat, states: List(MachineState(n)), marker: EvidenceInstruction) -> List(MachineState(n))

 fn mark_branch(n: Nat, states: List(MachineState(n)), marker: EvidenceInstruction) -> List(MachineState(n))

Append a branch-choice marker instruction to every state in states.

member_here(a: Type, value: a, rest: List(a)) -> ListMember(a, value, Cons(value, rest))

 fn member_here(a: Type, value: a, rest: List(a)) -> ListMember(a, value, Cons(value, rest))

Construct a ListMember witness pointing to the head of a cons list.

member_there(a: Type, head: a, value: a, rest: List(a), member: ListMember(a, value, rest)) -> ListMember(a, value, Cons(head, rest))

 fn member_there(a: Type, head: a, value: a, rest: List(a), member: ListMember(a, value, rest)) -> ListMember(a, value, Cons(head, rest))

Lift a ListMember witness past the head of a cons list.

named_capture_value(slot: Nat, entries: List(NamedCaptureLedgerEntry)) -> Option(String)

 fn named_capture_value(slot: Nat, entries: List(NamedCaptureLedgerEntry)) -> Option(String)

Look up the captured text for slot in a named-capture ledger.

named_captures_from_layout(layout: CaptureLayout, entries: List(NamedCaptureLedgerEntry)) -> List(NamedCapture)

 fn named_captures_from_layout(layout: CaptureLayout, entries: List(NamedCaptureLedgerEntry)) -> List(NamedCapture)

Finalize a named-capture ledger into NamedCapture entries ordered by layout.

named_captures_from_slots(slots: List(CaptureSlot), entries: List(NamedCaptureLedgerEntry)) -> List(NamedCapture)

 fn named_captures_from_slots(slots: List(CaptureSlot), entries: List(NamedCaptureLedgerEntry)) -> List(NamedCapture)

Finalize a named-capture ledger into NamedCapture entries ordered by slots.

named_continue_last_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: NamedPrefixSearch) -> NamedPrefixSearch

 fn named_continue_last_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: NamedPrefixSearch) -> NamedPrefixSearch

Advance named_search_last_prefix_loop while retaining the best match seen so far.

named_filter_initial(n: Nat, starts: List(MachineState(n)), position: InitialPosition, input: List(Char), after_input: List(Char)) -> List(MachineState(n))

 fn named_filter_initial(n: Nat, starts: List(MachineState(n)), position: InitialPosition, input: List(Char), after_input: List(Char)) -> List(MachineState(n))

Filter initial states of a named-capture machine against boundary constraints.

named_full_capture(shape: ShapeCode, compilation: NamedThompsonCompilation(shape), input: String, layout: CaptureLayout) -> Option(List(NamedCapture))

 fn named_full_capture(shape: ShapeCode, compilation: NamedThompsonCompilation(shape), input: String, layout: CaptureLayout) -> Option(List(NamedCapture))

Match a NamedRegex against the full input string and return all named captures.

named_lookaround_full_capture(shape: ShapeCode, compilation: LookaroundCompilation(shape), input: String, layout: CaptureLayout, policy: NewlinePolicy) -> Option(List(NamedCapture))

 fn named_lookaround_full_capture(shape: ShapeCode, compilation: LookaroundCompilation(shape), input: String, layout: CaptureLayout, policy: NewlinePolicy) -> Option(List(NamedCapture))

Named replay for a lookaround-aware compilation uses the same checked finite machine as assertion acceptance. Unlike the typed path, the returned routine is retained long enough to replay capture slots, including slots opened and closed inside a positive assertion.

named_lookaround_prefix_capture_at(shape: ShapeCode, compilation: LookaroundCompilation(shape), input: List(Char), greedy: Bool, position: InitialPosition, history: List(Char), layout: CaptureLayout, policy: NewlinePolicy) -> Option(NamedPrefixCapture)

 fn named_lookaround_prefix_capture_at(shape: ShapeCode, compilation: LookaroundCompilation(shape), input: List(Char), greedy: Bool, position: InitialPosition, history: List(Char), layout: CaptureLayout, policy: NewlinePolicy) -> Option(NamedPrefixCapture)

Match a lookaround-capable NamedRegex prefix at position and return its named captures.

named_machine_destinations(n: Nat, machine: PatternMachine(n), state: ThreadState(n), char: Char, boundary: Boundary, prior_routine: List(EvidenceInstruction)) -> List(MachineState(n))

 fn named_machine_destinations(n: Nat, machine: PatternMachine(n), state: ThreadState(n), char: Char, boundary: Boundary, prior_routine: List(EvidenceInstruction)) -> List(MachineState(n))

Compute boundary-filtered transitions for a named-capture machine with routine.

named_prefix_capture_at(shape: ShapeCode, compilation: NamedThompsonCompilation(shape), input: List(Char), greedy: Bool, position: InitialPosition, layout: CaptureLayout) -> Option(NamedPrefixCapture)

 fn named_prefix_capture_at(shape: ShapeCode, compilation: NamedThompsonCompilation(shape), input: List(Char), greedy: Bool, position: InitialPosition, layout: CaptureLayout) -> Option(NamedPrefixCapture)

Match a NamedRegex prefix starting at position and return its named captures.

named_search_accepting_from(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), current_routine: List(ExtendedInstruction)) -> NamedMachineSearch

 fn named_search_accepting_from(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), current_routine: List(ExtendedInstruction)) -> NamedMachineSearch

Search for an accepting run from a single named-capture MachineState.

named_search_accepting_members(n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), current_routine: List(ExtendedInstruction), destinations: List(MachineState(n))) -> NamedMachineSearch

 fn named_search_accepting_members(n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), current_routine: List(ExtendedInstruction), destinations: List(MachineState(n))) -> NamedMachineSearch

Search candidate destination states of a named-capture machine.

named_search_first_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> NamedPrefixSearch

 fn named_search_first_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> NamedPrefixSearch

Find the shortest prefix accepted by a named-capture machine.

named_search_first_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char)) -> NamedPrefixSearch

 fn named_search_first_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char)) -> NamedPrefixSearch

Recursive helper for named_search_first_prefix.

named_search_initial_members(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), starts: List(MachineState(n))) -> NamedMachineSearch

 fn named_search_initial_members(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), starts: List(MachineState(n))) -> NamedMachineSearch

Search initial member states of a named-capture machine for an accepting run.

named_search_last_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> NamedPrefixSearch

 fn named_search_last_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> NamedPrefixSearch

Find the longest prefix accepted by a named-capture machine.

named_search_last_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: NamedPrefixSearch) -> NamedPrefixSearch

 fn named_search_last_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: NamedPrefixSearch) -> NamedPrefixSearch

Recursive helper for named_search_last_prefix.

named_search_machine_acceptance(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char)) -> NamedMachineSearch

 fn named_search_machine_acceptance(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char)) -> NamedMachineSearch

Search for an accepting match of a named-capture machine on input.

named_staged(result: Type, shape: ShapeCode, ordinary: Regex(result), compilation: NamedThompsonCompilation(shape), lookaround: LookaroundCompilation(shape), layout: CaptureLayout, firstline_only: Bool, policy: NewlinePolicy) -> NamedRegex(result, shape)

 fn named_staged(result: Type, shape: ShapeCode, ordinary: Regex(result), compilation: NamedThompsonCompilation(shape), lookaround: LookaroundCompilation(shape), layout: CaptureLayout, firstline_only: Bool, policy: NewlinePolicy) -> NamedRegex(result, shape)

Package a NamedPattern, its Conversion, and its NamedCaptureLayout into a NamedRegex.

named_staged_checked(result: Type, shape: ShapeCode, ordinary: Regex(result), compilation: NamedThompsonCompilation(shape), lookaround: LookaroundCompilation(shape), layout: CaptureLayout, firstline_only: Bool, policy: NewlinePolicy, _proof: NamedCompilationErasure(shape, compilation, erase_named_thompson(compilation))) -> NamedRegex(result, shape)

 fn named_staged_checked(result: Type, shape: ShapeCode, ordinary: Regex(result), compilation: NamedThompsonCompilation(shape), lookaround: LookaroundCompilation(shape), layout: CaptureLayout, firstline_only: Bool, policy: NewlinePolicy, _proof: NamedCompilationErasure(shape, compilation, erase_named_thompson(compilation))) -> NamedRegex(result, shape)

Package a NamedRegex after verifying its layout matches the pattern.

named_thompson_machine(shape: ShapeCode, compilation: NamedThompsonCompilation(shape)) -> PatternMachine(named_thompson_state_count(compilation))

 fn named_thompson_machine(shape: ShapeCode, compilation: NamedThompsonCompilation(shape)) -> PatternMachine(named_thompson_state_count(compilation))

Build the executable PatternMachine from a NamedThompsonCompilation.

named_thompson_state_count(shape: ShapeCode, compilation: NamedThompsonCompilation(shape)) -> Nat

 fn named_thompson_state_count(shape: ShapeCode, compilation: NamedThompsonCompilation(shape)) -> Nat

Return the total number of states in a NamedThompsonCompilation.

negate_test(test: Function(Char, Bool)) -> Function(Char, Bool)

 fn negate_test(test: Function(Char, Bool)) -> Function(Char, Bool)

Negate a boolean result when negated is true.

newline_char(policy: NewlinePolicy, char: Char) -> Bool

 fn newline_char(policy: NewlinePolicy, char: Char) -> Bool

Return true if char is a line-break character under policy.

next_ascii_word(input: List(Char)) -> Bool

 fn next_ascii_word(input: List(Char)) -> Bool

Return true if the next character in remaining is an ASCII word character.

next_for_thread(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: ThreadState(n), char: Char) -> List(MachineState(n))

 fn next_for_thread(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: ThreadState(n), char: Char) -> List(MachineState(n))

Evaluate the next destination states for an active thread on char.

next_unicode_word(input: List(Char)) -> Bool

 fn next_unicode_word(input: List(Char)) -> Bool

Return true if the next character in remaining is a Unicode word character.

no_characters() -> List(Char)

 fn no_characters() -> List(Char)

Return an empty List(Char).

no_class_kinds() -> ClassKinds

 fn no_class_kinds() -> ClassKinds

Return an empty ClassKinds bitset with all shorthand classes disabled.

one_of(chars: List(Char)) -> Regex(Char)

 fn one_of(chars: List(Char)) -> Regex(Char)

Regex matching any character in chars (or outside it if negated).

one_or_more(a: Type, regex: Regex(a)) -> Regex(OneOrMore(a))

 fn one_or_more(a: Type, regex: Regex(a)) -> Regex(OneOrMore(a))

Match one or more occurrences of regex, returning OneOrMore(a).

one_or_more_pattern(a: Type, regex: Regex(a), lazy: Bool) -> Regex(List(a))

 fn one_or_more_pattern(a: Type, regex: Regex(a), lazy: Bool) -> Regex(List(a))

One-or-more regex parameterized by lazy quantifier preference.

option_ascii_word(previous: Option(Char)) -> Bool

 fn option_ascii_word(previous: Option(Char)) -> Bool

Return true if an Option(Char) is Some ASCII word character.

option_class_negated(test: Function(Char, Bool), negated: Bool, char: Char) -> Bool

 fn option_class_negated(test: Function(Char, Bool), negated: Bool, char: Char) -> Bool

Apply optional negation to a character-class match result.

option_class_predicate(chars: List(Char), ranges: List(CharacterRange), negated: Bool, caseless: Bool, unicode: Bool, actual: Char) -> Bool

 fn option_class_predicate(chars: List(Char), ranges: List(CharacterRange), negated: Bool, caseless: Bool, unicode: Bool, actual: Char) -> Bool

Test whether char matches a character class with shorthand kinds and options.

option_class_test(chars: List(Char), ranges: List(CharacterRange), negated: Bool, caseless: Bool, unicode: Bool) -> Function(Char, Bool)

 fn option_class_test(chars: List(Char), ranges: List(CharacterRange), negated: Bool, caseless: Bool, unicode: Bool) -> Function(Char, Bool)

Curried predicate for an option-aware character class.

option_digit(char: Char, unicode: Bool) -> Bool

 fn option_digit(char: Char, unicode: Bool) -> Bool

Return true if char is a digit under options (ASCII or Unicode).

option_exact_predicate(expected: Char, caseless: Bool, unicode: Bool, actual: Char) -> Bool

 fn option_exact_predicate(expected: Char, caseless: Bool, unicode: Bool, actual: Char) -> Bool

Test whether actual matches expected under options (case folding if enabled).

option_exact_test(expected: Char, caseless: Bool, unicode: Bool) -> Function(Char, Bool)

 fn option_exact_test(expected: Char, caseless: Bool, unicode: Bool) -> Function(Char, Bool)

Curried character predicate testing equality with expected under options.

option_head(input: List(Char)) -> Option(Char)

 fn option_head(input: List(Char)) -> Option(Char)

Return the first element of a list as Option, or None() if empty.

option_is_char(value: Option(Char), expected: Char) -> Bool

 fn option_is_char(value: Option(Char), expected: Char) -> Bool

Return true if an Option(Char) equals expected.

option_second(input: List(Char)) -> Option(Char)

 fn option_second(input: List(Char)) -> Option(Char)

Return the second element of a list as Option, or None() if fewer than two elements.

option_space(char: Char, unicode: Bool) -> Bool

 fn option_space(char: Char, unicode: Bool) -> Bool

Return true if char is whitespace under options (ASCII or Unicode).

option_unicode_word(previous: Option(Char)) -> Bool

 fn option_unicode_word(previous: Option(Char)) -> Bool

Return true if an Option(Char) is Some Unicode word character.

option_word(char: Char, unicode: Bool) -> Bool

 fn option_word(char: Char, unicode: Bool) -> Bool

Return true if char is a word character under options (ASCII or Unicode).

optional(a: Type, regex: Regex(a)) -> Regex(Option(a))

 fn optional(a: Type, regex: Regex(a)) -> Regex(Option(a))

Match zero or one occurrence of regex, returning Option(a).

optional_literal(a: Type, regex: Regex(a), lazy: Bool) -> Regex(Choice(a, Unit))

 fn optional_literal(a: Type, regex: Regex(a), lazy: Bool) -> Regex(Choice(a, Unit))

Optional regex parameterized by lazy quantifier preference.

optional_pattern(a: Type, regex: Regex(a)) -> Regex(Choice(a, Unit))

 fn optional_pattern(a: Type, regex: Regex(a)) -> Regex(Choice(a, Unit))

Greedy optional regex returning Choice(a, Unit).

or_same(a: Type, left: Regex(a), right: Regex(a)) -> Regex(a)

 fn or_same(a: Type, left: Regex(a), right: Regex(a)) -> Regex(a)

Match left or right when both branches produce the same result type.

pattern_accepts(shape: ShapeCode, pattern: Pattern(shape), input: String) -> Bool

 fn pattern_accepts(shape: ShapeCode, pattern: Pattern(shape), input: String) -> Bool

Compile and run a Pattern on input, returning whether it matches the full string.

pattern_evidence(shape: ShapeCode, pattern: Pattern(shape), input: List(Char)) -> Option(List(Evidence))

 fn pattern_evidence(shape: ShapeCode, pattern: Pattern(shape), input: List(Char)) -> Option(List(Evidence))

Compile and run a Pattern on input, returning its winning evidence stack.

pattern_machine_eta(n: Nat, machine: PatternMachine(n)) -> Equivalent(PatternMachine(n), machine, MkPatternMachine(pattern_machine_starts(machine), pattern_machine_next(machine)))

 fn pattern_machine_eta(n: Nat, machine: PatternMachine(n)) -> Equivalent(PatternMachine(n), machine, MkPatternMachine(pattern_machine_starts(machine), pattern_machine_next(machine)))

Eta-equivalence reconstructing a PatternMachine from its starts and transition function.

pattern_machine_next(n: Nat, machine: PatternMachine(n)) -> Function(Bounded(n), Function(Char, List(MachineState(n))))

 fn pattern_machine_next(n: Nat, machine: PatternMachine(n)) -> Function(Bounded(n), Function(Char, List(MachineState(n))))

Project the transition function from a PatternMachine.

pattern_machine_next_at(n: Nat, machine: PatternMachine(n), state: Bounded(n), char: Char) -> List(MachineState(n))

 fn pattern_machine_next_at(n: Nat, machine: PatternMachine(n), state: Bounded(n), char: Char) -> List(MachineState(n))

Evaluate the transitions of machine from state on char.

pattern_machine_next_at_from_next(n: Nat, machine: PatternMachine(n), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), pattern_machine_next_at(machine, state, char), pattern_machine_next_value(machine, state, char))

 fn pattern_machine_next_at_from_next(n: Nat, machine: PatternMachine(n), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), pattern_machine_next_at(machine, state, char), pattern_machine_next_value(machine, state, char))

Equivalence relating pattern_machine_next_at to pattern_machine_next.

pattern_machine_next_value(n: Nat, machine: PatternMachine(n), state: Bounded(n), char: Char) -> List(MachineState(n))

 fn pattern_machine_next_value(n: Nat, machine: PatternMachine(n), state: Bounded(n), char: Char) -> List(MachineState(n))

Evaluate a PatternMachine's transition function at state and char.

pattern_machine_starts(n: Nat, machine: PatternMachine(n)) -> List(MachineState(n))

 fn pattern_machine_starts(n: Nat, machine: PatternMachine(n)) -> List(MachineState(n))

Project the start-state list from a PatternMachine.

pattern_prefix_evidence(shape: ShapeCode, pattern: Pattern(shape), input: List(Char), greedy: Bool) -> Option(EvidencePrefix)

 fn pattern_prefix_evidence(shape: ShapeCode, pattern: Pattern(shape), input: List(Char), greedy: Bool) -> Option(EvidencePrefix)

Find the shortest (lazy: true) or longest (lazy: false) matching prefix of input.

pattern_prefix_evidence_at(shape: ShapeCode, pattern: Pattern(shape), input: List(Char), greedy: Bool, subject_start: Bool, line_start: Bool, previous_ascii_word: Bool, previous_unicode_word: Bool) -> Option(EvidencePrefix)

 fn pattern_prefix_evidence_at(shape: ShapeCode, pattern: Pattern(shape), input: List(Char), greedy: Bool, subject_start: Bool, line_start: Bool, previous_ascii_word: Bool, previous_unicode_word: Bool) -> Option(EvidencePrefix)

Find a matching prefix of input starting at position for pattern.

plus_pattern(a: Type, regex: Regex(a)) -> Regex(List(a))

 fn plus_pattern(a: Type, regex: Regex(a)) -> Regex(List(a))

Greedy one-or-more regex returning List(a).

position_after_character(char: Char) -> InitialPosition

 fn position_after_character(char: Char) -> InitialPosition

Advance a Position by a single character using the default newline policy.

position_after_character_with_policy(char: Char, policy: NewlinePolicy) -> InitialPosition

 fn position_after_character_with_policy(char: Char, policy: NewlinePolicy) -> InitialPosition

Advance a Position by a single character using an explicit newline policy.

position_boundary(subject_start: Bool, line_start: Bool, previous_ascii_word: Bool, previous_unicode_word: Bool, previous_char: Option(Char), input: List(Char)) -> Boundary

 fn position_boundary(subject_start: Bool, line_start: Bool, previous_ascii_word: Bool, previous_unicode_word: Bool, previous_char: Option(Char), input: List(Char)) -> Boundary

Compute the Boundary snapshot for position and remaining characters.

position_boundary_for_history(position: InitialPosition, input: List(Char), history: List(Char)) -> Boundary

 fn position_boundary_for_history(position: InitialPosition, input: List(Char), history: List(Char)) -> Boundary

Construct a Boundary from a reverse character history, remaining input, and policy.

position_line_end(input: List(Char)) -> Bool

 fn position_line_end(input: List(Char)) -> Bool

Test whether position followed by remaining is at a line end under policy.

position_strict_subject_end(input: List(Char)) -> Bool

 fn position_strict_subject_end(input: List(Char)) -> Bool

Return true when remaining is empty (strict subject end).

position_subject_end(input: List(Char)) -> Bool

 fn position_subject_end(input: List(Char)) -> Bool

Test whether position followed by remaining is at the subject end under policy.

posix_class_match_matches(value: PosixClassMatch, actual: Char, unicode: Bool) -> Bool

 fn posix_class_match_matches(value: PosixClassMatch, actual: Char, unicode: Bool) -> Bool

Test whether char satisfies a (possibly negated) PosixClassMatch.

posix_class_matches(posix_class: PosixClass, actual: Char, unicode: Bool) -> Bool

 fn posix_class_matches(posix_class: PosixClass, actual: Char, unicode: Bool) -> Bool

Test whether char belongs to a PosixClass under options.

posix_class_matches_any(values: List(PosixClassMatch), actual: Char, unicode: Bool) -> Bool

 fn posix_class_matches_any(values: List(PosixClassMatch), actual: Char, unicode: Bool) -> Bool

Return true if char satisfies any entry in a list of PosixClassMatches.

predicate(test: Function(Char, Bool)) -> Regex(Char)

 fn predicate(test: Function(Char, Bool)) -> Regex(Char)

Regex matching a single character that satisfies test.

predicate_accepting_destination(char: Char) -> MachineState(S(Z()))

 fn predicate_accepting_destination(char: Char) -> MachineState(S(Z()))

Construct the accepting destination state after matching a single character.

predicate_machine_destinations(holds: Bool, char: Char) -> List(MachineState(S(Z())))

 fn predicate_machine_destinations(holds: Bool, char: Char) -> List(MachineState(S(Z())))

Return the accepting destination when test(char) holds, or empty otherwise.

predicate_machine_next(test: Function(Char, Bool), _state: Bounded(S(Z())), char: Char) -> List(MachineState(S(Z())))

 fn predicate_machine_next(test: Function(Char, Bool), _state: Bounded(S(Z())), char: Char) -> List(MachineState(S(Z())))

Transition function for a single-character predicate machine.

predicate_machine_start() -> MachineState(S(Z()))

 fn predicate_machine_start() -> MachineState(S(Z()))

Construct the single start state of a predicate PatternMachine.

predicate_machine_thread() -> ThreadState(S(Z()))

 fn predicate_machine_thread() -> ThreadState(S(Z()))

Return the singleton start-state list for a predicate machine.

predicate_pattern_machine(test: Function(Char, Bool)) -> PatternMachine(S(Z()))

 fn predicate_pattern_machine(test: Function(Char, Bool)) -> PatternMachine(S(Z()))

Construct a one-state PatternMachine matching characters satisfying test.

prefix_routine(n: Nat, instruction: EvidenceInstruction, states: List(MachineState(n))) -> List(MachineState(n))

 fn prefix_routine(n: Nat, instruction: EvidenceInstruction, states: List(MachineState(n))) -> List(MachineState(n))

Prepend a single EvidenceInstruction to every state in states.

prepend_initial_certificate(routine: List(EvidenceInstruction), path_routine: List(ExtendedInstruction), initial_evidence: List(Evidence), initial_captures: List(CaptureFrame), final_evidence: List(Evidence), regular_execution: ExtendedEvidenceRoutineExecution(regular_routine(routine), Nil(), Nil(), initial_evidence, initial_captures), path_certificate: CertifiedPathRoutine(path_routine, initial_evidence, initial_captures, final_evidence)) -> CertifiedPathRoutine(append_extended_routines(regular_routine(routine), path_routine), Nil(), Nil(), final_evidence)

 fn prepend_initial_certificate(routine: List(EvidenceInstruction), path_routine: List(ExtendedInstruction), initial_evidence: List(Evidence), initial_captures: List(CaptureFrame), final_evidence: List(Evidence), regular_execution: ExtendedEvidenceRoutineExecution(regular_routine(routine), Nil(), Nil(), initial_evidence, initial_captures), path_certificate: CertifiedPathRoutine(path_routine, initial_evidence, initial_captures, final_evidence)) -> CertifiedPathRoutine(append_extended_routines(regular_routine(routine), path_routine), Nil(), Nil(), final_evidence)

Attach an initial-state witness to a MachineAcceptingSearch result.

prepend_optional_repetition_conversion(a: Type) -> Conversion(Tuple(Choice(a, Unit), List(a)), List(a))

 fn prepend_optional_repetition_conversion(a: Type) -> Conversion(Tuple(Choice(a, Unit), List(a)), List(a))

Construct a Conversion prepending an optional (Choice(a, Unit)) element onto a list.

prepend_optional_repetition_conversion_for(shape: ShapeCode) -> Conversion(Tuple(Choice(Sem(shape), Unit), List(Sem(shape))), List(Sem(shape)))

 fn prepend_optional_repetition_conversion_for(shape: ShapeCode) -> Conversion(Tuple(Choice(Sem(shape), Unit), List(Sem(shape))), List(Sem(shape)))

Construct a shape-indexed optional-repetition Conversion.

prepend_optional_repetition_result(a: Type, value: Tuple(Choice(a, Unit), List(a))) -> List(a)

 fn prepend_optional_repetition_result(a: Type, value: Tuple(Choice(a, Unit), List(a))) -> List(a)

Prepend a Choice(a, Unit) element onto a repetition result list if present.

prepend_repetition_conversion(a: Type) -> Conversion(Tuple(a, List(a)), List(a))

 fn prepend_repetition_conversion(a: Type) -> Conversion(Tuple(a, List(a)), List(a))

Construct a Conversion consing a repeated element onto a result list.

prepend_repetition_conversion_for(shape: ShapeCode) -> Conversion(Tuple(Sem(shape), List(Sem(shape))), List(Sem(shape)))

 fn prepend_repetition_conversion_for(shape: ShapeCode) -> Conversion(Tuple(Sem(shape), List(Sem(shape))), List(Sem(shape)))

Construct a shape-indexed repetition-cons Conversion.

prepend_repetition_result(a: Type, value: Tuple(a, List(a))) -> List(a)

 fn prepend_repetition_result(a: Type, value: Tuple(a, List(a))) -> List(a)

Cons a matched element onto a repetition result list.

prepend_transition_certificate(char: Char, routine: List(EvidenceInstruction), suffix_routine: List(ExtendedInstruction), source_evidence: List(Evidence), source_captures: List(CaptureFrame), destination_evidence: List(Evidence), destination_captures: List(CaptureFrame), final_evidence: List(Evidence), regular_execution: ExtendedEvidenceRoutineExecution(regular_routine(routine), source_evidence, record_capture_char(source_captures, char), destination_evidence, destination_captures), suffix_certificate: CertifiedPathRoutine(suffix_routine, destination_evidence, destination_captures, final_evidence)) -> CertifiedPathRoutine(append_extended_routines(transition_routine(char, routine), suffix_routine), source_evidence, source_captures, final_evidence)

 fn prepend_transition_certificate(char: Char, routine: List(EvidenceInstruction), suffix_routine: List(ExtendedInstruction), source_evidence: List(Evidence), source_captures: List(CaptureFrame), destination_evidence: List(Evidence), destination_captures: List(CaptureFrame), final_evidence: List(Evidence), regular_execution: ExtendedEvidenceRoutineExecution(regular_routine(routine), source_evidence, record_capture_char(source_captures, char), destination_evidence, destination_captures), suffix_certificate: CertifiedPathRoutine(suffix_routine, destination_evidence, destination_captures, final_evidence)) -> CertifiedPathRoutine(append_extended_routines(transition_routine(char, routine), suffix_routine), source_evidence, source_captures, final_evidence)

Prepend a single-character transition step onto a MachineAcceptingSearch result.

range(first: Char, last: Char) -> Regex(Char)

 fn range(first: Char, last: Char) -> Regex(Char)

Regex matching any character in the inclusive range [low, high].

range_predicate(first: Char, last: Char, actual: Char) -> Bool

 fn range_predicate(first: Char, last: Char, actual: Char) -> Bool

Return true if char lies inclusively between low and high.

range_test(first: Char, last: Char) -> Function(Char, Bool)

 fn range_test(first: Char, last: Char) -> Function(Char, Bool)

Curried predicate testing inclusion in [low, high].

record_active_winner(n: Nat, slots: ActiveWinnerSlots, index: Bounded(n)) -> ActiveWinnerSlots

 fn record_active_winner(n: Nat, slots: ActiveWinnerSlots, index: Bounded(n)) -> ActiveWinnerSlots

Mark state as visited in the active-thread winner set slots.

record_named_capture_char(frames: List(NamedCaptureFrame), char: Char) -> List(NamedCaptureFrame)

 fn record_named_capture_char(frames: List(NamedCaptureFrame), char: Char) -> List(NamedCaptureFrame)

Append char to every open named-capture frame on the active stack.

record_thread_winner(n: Nat, table: ThreadWinnerTable, state: ThreadState(n)) -> ThreadWinnerTable

 fn record_thread_winner(n: Nat, table: ThreadWinnerTable, state: ThreadState(n)) -> ThreadWinnerTable

Record a thread's state in table so lower-priority duplicates are pruned.

reference_thompson_machine(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> PatternMachine(thompson_state_count(compilation))

 fn reference_thompson_machine(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> PatternMachine(thompson_state_count(compilation))

Reference constructor retained for differential tests.

regular_routine(routine: List(EvidenceInstruction)) -> List(ExtendedInstruction)

 fn regular_routine(routine: List(EvidenceInstruction)) -> List(ExtendedInstruction)

Check whether a routine executes cleanly to a valid evidence stack.

remember_prefix(n: Nat, threads: List(EvidenceThread(n)), rest: List(Char), previous: Option(EvidencePrefix)) -> Option(EvidencePrefix)

 fn remember_prefix(n: Nat, threads: List(EvidenceThread(n)), rest: List(Char), previous: Option(EvidencePrefix)) -> Option(EvidencePrefix)

Update the latest recorded EvidencePrefix when an accepting thread is present.

repeat(a: Type, regex: Regex(a)) -> Regex(List(a))

 fn repeat(a: Type, regex: Regex(a)) -> Regex(List(a))

Match zero or more occurrences of regex, collecting results in a List.

repeat_accepting(n: Nat, routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint)) -> List(MachineState(n))

 fn repeat_accepting(n: Nat, routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint)) -> List(MachineState(n))

Construct the accepting end-of-repetition state for a Kleene-star machine.

repeat_destination_order(n: Nat, routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), starts: List(MachineState(n)), lazy: Bool) -> List(MachineState(n))

 fn repeat_destination_order(n: Nat, routine: List(EvidenceInstruction), constraints: List(BoundaryConstraint), starts: List(MachineState(n)), lazy: Bool) -> List(MachineState(n))

Order loop-back and exit destinations according to lazy preference.

repeat_destinations(n: Nat, destinations: List(MachineState(n)), starts: List(MachineState(n)), lazy: Bool) -> List(MachineState(n))

 fn repeat_destinations(n: Nat, destinations: List(MachineState(n)), starts: List(MachineState(n)), lazy: Bool) -> List(MachineState(n))

Expand body states into loop-back and accepting repetition destinations.

repeat_machine_next(n: Nat, starts: List(MachineState(n)), lazy: Bool, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> List(MachineState(n))

 fn repeat_machine_next(n: Nat, starts: List(MachineState(n)), lazy: Bool, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> List(MachineState(n))

Transition function for a repetition machine.

repeat_machine_starts(n: Nat, starts: List(MachineState(n)), lazy: Bool) -> List(MachineState(n))

 fn repeat_machine_starts(n: Nat, starts: List(MachineState(n)), lazy: Bool) -> List(MachineState(n))

Compute start states for a repetition machine, respecting lazy preference.

repeat_pattern_machine(n: Nat, machine: PatternMachine(n), lazy: Bool) -> PatternMachine(n)

 fn repeat_pattern_machine(n: Nat, machine: PatternMachine(n), lazy: Bool) -> PatternMachine(n)

Construct the PatternMachine for greedy or lazy repetition of a submachine.

repeated_pattern(a: Type, regex: Regex(a), lazy: Bool) -> Regex(List(a))

 fn repeated_pattern(a: Type, regex: Regex(a), lazy: Bool) -> Regex(List(a))

Zero-or-more regex parameterized by lazy quantifier preference.

replay_named_capture_routine(routine: List(ExtendedInstruction), layout: CaptureLayout) -> Option(List(NamedCapture))

 fn replay_named_capture_routine(routine: List(ExtendedInstruction), layout: CaptureLayout) -> Option(List(NamedCapture))

Replay an ExtendedRoutine against a NamedCaptureLayout to extract named captures.

rows_as_next(n: Nat, rows: TransitionRows(n)) -> Function(Bounded(n), Function(Char, List(MachineState(n))))

 fn rows_as_next(n: Nat, rows: TransitionRows(n)) -> Function(Bounded(n), Function(Char, List(MachineState(n))))

Adapt a TransitionRows table into a curried transition function.

rows_from_next(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n))))) -> TransitionRows(n)

 fn rows_from_next(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n))))) -> TransitionRows(n)

Build a TransitionRows table directly from a transition function next.

rows_from_next_equivalent(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), transition_rows_next(rows_from_next(n, next), state, char), next(state, char))

 fn rows_from_next_equivalent(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), transition_rows_next(rows_from_next(n, next), state, char), next(state, char))

Pointwise equivalence showing rows_from_next lookup agrees with next.

rows_from_next_value_equivalent(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n))))) -> Equivalent(TransitionRows(n), rows_from_next(n, next), TransitionRows(build_transition_rows(n, fn(state) -> state, next)))

 fn rows_from_next_value_equivalent(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n))))) -> Equivalent(TransitionRows(n), rows_from_next(n, next), TransitionRows(build_transition_rows(n, fn(state) -> state, next)))

Equivalence unfolding rows_from_next to TransitionRows(build_transition_rows(...)).

run_evidence(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), input: List(Char), threads: List(EvidenceThread(n))) -> Option(List(Evidence))

 fn run_evidence(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), input: List(Char), threads: List(EvidenceThread(n))) -> Option(List(Evidence))

Run active EvidenceThreads across input and return the winning evidence stack.

run_first_prefix_evidence(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), input: List(Char), threads: List(EvidenceThread(n))) -> Option(EvidencePrefix)

 fn run_first_prefix_evidence(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), input: List(Char), threads: List(EvidenceThread(n))) -> Option(EvidencePrefix)

Find the shortest prefix of input that produces accepting evidence.

run_last_prefix_evidence(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), input: List(Char), threads: List(EvidenceThread(n)), previous: Option(EvidencePrefix)) -> Option(EvidencePrefix)

 fn run_last_prefix_evidence(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), input: List(Char), threads: List(EvidenceThread(n)), previous: Option(EvidencePrefix)) -> Option(EvidencePrefix)

Find the longest prefix of input that produces accepting evidence.

same_capture_slot(left: Nat, right: Nat) -> Bool

 fn same_capture_slot(left: Nat, right: Nat) -> Bool

Return true if two CaptureSlot identifiers refer to the same slot.

same_chars(left: List(Char), right: List(Char)) -> Bool

 fn same_chars(left: List(Char), right: List(Char)) -> Bool

Compare two List(Char) values for exact equality.

same_thread_state(n: Nat, left: ThreadState(n), right: ThreadState(n)) -> Bool

 fn same_thread_state(n: Nat, left: ThreadState(n), right: ThreadState(n)) -> Bool

Return true if two EvidenceThreads occupy the same machine state.

search_accepting_from(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), current_evidence: List(Evidence), captures: List(CaptureFrame)) -> AcceptingSearch(n, machine, input, after_input, state, current_evidence, captures)

 fn search_accepting_from(n: Nat, machine: PatternMachine(n), input: List(Char), after_input: List(Char), state: ThreadState(n), current_evidence: List(Evidence), captures: List(CaptureFrame)) -> AcceptingSearch(n, machine, input, after_input, state, current_evidence, captures)

Perform certified backtracking acceptance search from a single MachineState.

search_accepting_members(n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source_state: ThreadState(n), source_evidence: List(Evidence), source_captures: List(CaptureFrame), current: List(MachineState(n)), members: MachineStateMembers(n, machine_destinations(n, machine, source_state, char, transition_boundary_before(char, rest, after_input)), current)) -> AcceptingSearch(n, machine, Cons(char, rest), after_input, source_state, source_evidence, source_captures)

 fn search_accepting_members(n: Nat, machine: PatternMachine(n), char: Char, rest: List(Char), after_input: List(Char), source_state: ThreadState(n), source_evidence: List(Evidence), source_captures: List(CaptureFrame), current: List(MachineState(n)), members: MachineStateMembers(n, machine_destinations(n, machine, source_state, char, transition_boundary_before(char, rest, after_input)), current)) -> AcceptingSearch(n, machine, Cons(char, rest), after_input, source_state, source_evidence, source_captures)

Perform certified backtracking acceptance search across a list of member states.

search_first_machine_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> CertifiedPrefixSearch(n, machine, position)

 fn search_first_machine_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> CertifiedPrefixSearch(n, machine, position)

Find the shortest certified prefix accepted by machine.

search_first_machine_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char)) -> CertifiedPrefixSearch(n, machine, position)

 fn search_first_machine_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char)) -> CertifiedPrefixSearch(n, machine, position)

Recursive helper for search_first_machine_prefix.

search_initial_members(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), current: List(MachineState(n)), members: MachineStateMembers(n, initial_machine_destinations(n, machine, position, input, after_input), current)) -> MachineAcceptingSearch(n, machine, position, input, after_input)

 fn search_initial_members(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char), current: List(MachineState(n)), members: MachineStateMembers(n, initial_machine_destinations(n, machine, position, input, after_input), current)) -> MachineAcceptingSearch(n, machine, position, input, after_input)

Search a list of initial member states for a certified acceptance derivation.

search_last_machine_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> CertifiedPrefixSearch(n, machine, position)

 fn search_last_machine_prefix(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char)) -> CertifiedPrefixSearch(n, machine, position)

Find the longest certified prefix accepted by machine.

search_last_machine_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: CertifiedPrefixSearch(n, machine, position)) -> CertifiedPrefixSearch(n, machine, position)

 fn search_last_machine_prefix_loop(n: Nat, machine: PatternMachine(n), position: InitialPosition, reversed_prefix: List(Char), remaining_input: List(Char), previous: CertifiedPrefixSearch(n, machine, position)) -> CertifiedPrefixSearch(n, machine, position)

Recursive helper for search_last_machine_prefix.

search_machine_acceptance(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char)) -> MachineAcceptingSearch(n, machine, position, input, after_input)

 fn search_machine_acceptance(n: Nat, machine: PatternMachine(n), position: InitialPosition, input: List(Char), after_input: List(Char)) -> MachineAcceptingSearch(n, machine, position, input, after_input)

Perform certified full-string acceptance search for machine on input.

sem_identity_conversion(shape: ShapeCode) -> Conversion(Sem(shape), Sem(shape))

 fn sem_identity_conversion(shape: ShapeCode) -> Conversion(Sem(shape), Sem(shape))

Identity Conversion on Sem(shape).

set_test(chars: List(Char)) -> Function(Char, Bool)

 fn set_test(chars: List(Char)) -> Function(Char, Bool)

Predicate testing membership in chars, optionally negated.

simplified(shape: ShapeCode, regex: Regex(Sem(shape))) -> Regex(Sem(Simplify(shape)))

 fn simplified(shape: ShapeCode, regex: Regex(Sem(shape))) -> Regex(Sem(Simplify(shape)))

Wrap regex with a compile-time shape simplification pass.

simplify_compiled(shape: ShapeCode, program: CompiledRegex(Sem(shape))) -> CompiledRegex(Sem(Simplify(shape)))

 fn simplify_compiled(shape: ShapeCode, program: CompiledRegex(Sem(shape))) -> CompiledRegex(Sem(Simplify(shape)))

Apply shape simplification to a CompiledRegex.

simplify_program(shape: ShapeCode, program: RegexProgram(Sem(shape))) -> RegexProgram(Sem(Simplify(shape)))

 fn simplify_program(shape: ShapeCode, program: RegexProgram(Sem(shape))) -> RegexProgram(Sem(Simplify(shape)))

Apply shape simplification to a compiled RegexProgram.

space_class(negated: Bool) -> Regex(Char)

 fn space_class(negated: Bool) -> Regex(Char)

Regex matching ASCII whitespace (\s) or non-whitespace (\S when negated).

space_class_with_options(negated: Bool, unicode: Bool) -> Regex(Char)

 fn space_class_with_options(negated: Bool, unicode: Bool) -> Regex(Char)

Regex matching \s / \S under options.

space_option_predicate(negated: Bool, unicode: Bool, char: Char) -> Bool

 fn space_option_predicate(negated: Bool, unicode: Bool, char: Char) -> Bool

Test whether char matches \s / \S under options.

space_options_test(negated: Bool, unicode: Bool) -> Function(Char, Bool)

 fn space_options_test(negated: Bool, unicode: Bool) -> Function(Char, Bool)

Curried predicate for \s / \S under options.

staged_alternate_next(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_rows: TransitionRows(right_count), state: Bounded(plus(left_count, right_count)), char: Char) -> List(MachineState(plus(left_count, right_count)))

 fn staged_alternate_next(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_rows: TransitionRows(right_count), state: Bounded(plus(left_count, right_count)), char: Char) -> List(MachineState(plus(left_count, right_count)))

Transition step for a staged alternation machine.

staged_alternate_next_from_side(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_rows: TransitionRows(right_count), side: BoundedSum(left_count, right_count), char: Char) -> List(MachineState(plus(left_count, right_count)))

 fn staged_alternate_next_from_side(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_rows: TransitionRows(right_count), side: BoundedSum(left_count, right_count), char: Char) -> List(MachineState(plus(left_count, right_count)))

Dispatch a staged alternation transition from a classified left/right state.

staged_alternate_next_function(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_rows: TransitionRows(right_count)) -> Function(Bounded(plus(left_count, right_count)), Function(Char, List(MachineState(plus(left_count, right_count)))))

 fn staged_alternate_next_function(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_rows: TransitionRows(right_count)) -> Function(Bounded(plus(left_count, right_count)), Function(Char, List(MachineState(plus(left_count, right_count)))))

Curried transition function for a staged alternation machine.

staged_alternate_starts(left_count: Nat, right_count: Nat, left_starts: List(MachineState(left_count)), right_starts: List(MachineState(right_count)), prefer_right: Bool) -> List(MachineState(plus(left_count, right_count)))

 fn staged_alternate_starts(left_count: Nat, right_count: Nat, left_starts: List(MachineState(left_count)), right_starts: List(MachineState(right_count)), prefer_right: Bool) -> List(MachineState(plus(left_count, right_count)))

Compute start states for a staged alternation machine.

staged_boundary_rows(constraint: BoundaryConstraint) -> TransitionRows(Z())

 fn staged_boundary_rows(constraint: BoundaryConstraint) -> TransitionRows(Z())

Construct the empty TransitionRows table for a boundary constraint pattern.

staged_concat_next(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_starts: List(MachineState(right_count)), right_rows: TransitionRows(right_count), state: Bounded(plus(left_count, right_count)), char: Char) -> List(MachineState(plus(left_count, right_count)))

 fn staged_concat_next(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_starts: List(MachineState(right_count)), right_rows: TransitionRows(right_count), state: Bounded(plus(left_count, right_count)), char: Char) -> List(MachineState(plus(left_count, right_count)))

Transition step for a staged concatenation machine.

staged_concat_next_from_side(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_starts: List(MachineState(right_count)), right_rows: TransitionRows(right_count), side: BoundedSum(left_count, right_count), char: Char) -> List(MachineState(plus(left_count, right_count)))

 fn staged_concat_next_from_side(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_starts: List(MachineState(right_count)), right_rows: TransitionRows(right_count), side: BoundedSum(left_count, right_count), char: Char) -> List(MachineState(plus(left_count, right_count)))

Dispatch a staged concatenation transition from a classified left/right state.

staged_concat_next_function(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_starts: List(MachineState(right_count)), right_rows: TransitionRows(right_count)) -> Function(Bounded(plus(left_count, right_count)), Function(Char, List(MachineState(plus(left_count, right_count)))))

 fn staged_concat_next_function(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_starts: List(MachineState(right_count)), right_rows: TransitionRows(right_count)) -> Function(Bounded(plus(left_count, right_count)), Function(Char, List(MachineState(plus(left_count, right_count)))))

Curried transition function for a staged concatenation machine.

staged_concat_rows_transition_equation(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_starts: List(MachineState(right_count)), right_rows: TransitionRows(right_count), state: Bounded(plus(left_count, right_count)), char: Char) -> Equivalent(List(MachineState(plus(left_count, right_count))), transition_rows_next(rows_from_next(plus(left_count, right_count), staged_concat_next_function(left_count, left_rows, right_starts, right_rows)), state, char), staged_concat_next(left_count, left_rows, right_starts, right_rows, state, char))

 fn staged_concat_rows_transition_equation(left_count: Nat, right_count: Nat, left_rows: TransitionRows(left_count), right_starts: List(MachineState(right_count)), right_rows: TransitionRows(right_count), state: Bounded(plus(left_count, right_count)), char: Char) -> Equivalent(List(MachineState(plus(left_count, right_count))), transition_rows_next(rows_from_next(plus(left_count, right_count), staged_concat_next_function(left_count, left_rows, right_starts, right_rows)), state, char), staged_concat_next(left_count, left_rows, right_starts, right_rows, state, char))

Equivalence unfolding staged concatenation row lookup to staged_concat_next.

staged_concat_starts(left_count: Nat, right_count: Nat, left_starts: List(MachineState(left_count)), right_starts: List(MachineState(right_count))) -> List(MachineState(plus(left_count, right_count)))

 fn staged_concat_starts(left_count: Nat, right_count: Nat, left_starts: List(MachineState(left_count)), right_starts: List(MachineState(right_count))) -> List(MachineState(plus(left_count, right_count)))

Compute start states for a staged concatenation machine.

staged_empty_rows() -> TransitionRows(Z())

 fn staged_empty_rows() -> TransitionRows(Z())

Construct the empty TransitionRows table for an empty pattern.

staged_group_next(n: Nat, rows: TransitionRows(n), state: Bounded(n), char: Char) -> List(MachineState(n))

 fn staged_group_next(n: Nat, rows: TransitionRows(n), state: Bounded(n), char: Char) -> List(MachineState(n))

Transition step for a staged group machine over TransitionRows.

staged_group_next_function(n: Nat, rows: TransitionRows(n)) -> Function(Bounded(n), Function(Char, List(MachineState(n))))

 fn staged_group_next_function(n: Nat, rows: TransitionRows(n)) -> Function(Bounded(n), Function(Char, List(MachineState(n))))

Curried transition function for a staged group machine.

staged_group_starts(n: Nat, starts: List(MachineState(n))) -> List(MachineState(n))

 fn staged_group_starts(n: Nat, starts: List(MachineState(n))) -> List(MachineState(n))

Compute start states for a staged group machine.

staged_machine_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> PatternMachine(thompson_state_count(compilation))

 fn staged_machine_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> PatternMachine(thompson_state_count(compilation))

Staged literals use a row-backed machine. The transition rows are built from the direct staged machine seed below, rather than reconstructing a canonical Thompson machine for every child closure.

staged_machine_rows_transition_equivalent(shape: ShapeCode, compilation: ThompsonCompilation(shape), state: Bounded(thompson_state_count(compilation)), char: Char) -> Equivalent(List(MachineState(thompson_state_count(compilation))), pattern_machine_next_at(staged_machine_from_compilation(compilation), state, char), transition_rows_next(direct_staged_rows_values_from_compilation(compilation), state, char))

 fn staged_machine_rows_transition_equivalent(shape: ShapeCode, compilation: ThompsonCompilation(shape), state: Bounded(thompson_state_count(compilation)), char: Char) -> Equivalent(List(MachineState(thompson_state_count(compilation))), pattern_machine_next_at(staged_machine_from_compilation(compilation), state, char), transition_rows_next(direct_staged_rows_values_from_compilation(compilation), state, char))

Equivalence showing staged machine rows match thompson_machine transitions.

staged_machine_seed_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> PatternMachine(thompson_state_count(compilation))

 fn staged_machine_seed_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> PatternMachine(thompson_state_count(compilation))

Construct the closure machine once per Thompson subtree. Let-binding the child results is important: starts and next are two projections of the same child value, not two independent recursive reconstructions.

staged_machine_starts_equivalent(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> Equivalent(List(MachineState(thompson_state_count(compilation))), pattern_machine_starts(staged_machine_from_compilation(compilation)), pattern_machine_starts(thompson_machine(compilation)))

 fn staged_machine_starts_equivalent(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> Equivalent(List(MachineState(thompson_state_count(compilation))), pattern_machine_starts(staged_machine_from_compilation(compilation)), pattern_machine_starts(thompson_machine(compilation)))

Proof that staged compilation start states equal thompson_machine start states.

staged_predicate_next(test: Function(Char, Bool), state: Bounded(S(Z())), char: Char) -> List(MachineState(S(Z())))

 fn staged_predicate_next(test: Function(Char, Bool), state: Bounded(S(Z())), char: Char) -> List(MachineState(S(Z())))

Transition step for a staged single-character predicate machine.

staged_predicate_next_function(test: Function(Char, Bool)) -> Function(Bounded(S(Z())), Function(Char, List(MachineState(S(Z())))))

 fn staged_predicate_next_function(test: Function(Char, Bool)) -> Function(Bounded(S(Z())), Function(Char, List(MachineState(S(Z())))))

Curried transition function for a staged predicate machine.

staged_repeat_next(n: Nat, starts: List(MachineState(n)), rows: TransitionRows(n), lazy: Bool, state: Bounded(n), char: Char) -> List(MachineState(n))

 fn staged_repeat_next(n: Nat, starts: List(MachineState(n)), rows: TransitionRows(n), lazy: Bool, state: Bounded(n), char: Char) -> List(MachineState(n))

Transition step for a staged repetition machine.

staged_repeat_next_function(n: Nat, starts: List(MachineState(n)), rows: TransitionRows(n), lazy: Bool) -> Function(Bounded(n), Function(Char, List(MachineState(n))))

 fn staged_repeat_next_function(n: Nat, starts: List(MachineState(n)), rows: TransitionRows(n), lazy: Bool) -> Function(Bounded(n), Function(Char, List(MachineState(n))))

Curried transition function for a staged repetition machine.

staged_repeat_starts(n: Nat, starts: List(MachineState(n)), lazy: Bool) -> List(MachineState(n))

 fn staged_repeat_starts(n: Nat, starts: List(MachineState(n)), lazy: Bool) -> List(MachineState(n))

Compute start states for a staged repetition machine.

staged_rows_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> StagedRows(thompson_state_count(compilation))

 fn staged_rows_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> StagedRows(thompson_state_count(compilation))

Extract the TransitionRows table from a StagedCompilation.

staged_rows_transition_equivalent(shape: ShapeCode, compilation: ThompsonCompilation(shape), state: Bounded(thompson_state_count(compilation)), char: Char) -> Equivalent(List(MachineState(thompson_state_count(compilation))), transition_rows_next(direct_staged_rows_values_from_compilation(compilation), state, char), pattern_machine_next_at(thompson_machine(compilation), state, char))

 fn staged_rows_transition_equivalent(shape: ShapeCode, compilation: ThompsonCompilation(shape), state: Bounded(thompson_state_count(compilation)), char: Char) -> Equivalent(List(MachineState(thompson_state_count(compilation))), transition_rows_next(direct_staged_rows_values_from_compilation(compilation), state, char), pattern_machine_next_at(thompson_machine(compilation), state, char))

Pointwise equivalence showing staged compilation rows match thompson_machine transitions.

staged_rows_values_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> TransitionRows(thompson_state_count(compilation))

 fn staged_rows_values_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> TransitionRows(thompson_state_count(compilation))

Compatibility reference retained for differential checking. It preserves the original row formulas while the active machine below uses the direct staged rows; this keeps the comparison path independent of the optimized construction.

staged_starts_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> List(MachineState(thompson_state_count(compilation)))

 fn staged_starts_from_compilation(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> List(MachineState(thompson_state_count(compilation)))

Extract the start-state list from a StagedCompilation.

start_anchor() -> Regex(Unit)

 fn start_anchor() -> Regex(Unit)

Zero-width anchor matching the start of subject or line.

start_anchor_with_options(multiline: Bool) -> Regex(Unit)

 fn start_anchor_with_options(multiline: Bool) -> Regex(Unit)

Zero-width start anchor respecting multiline and newline options.

step_evidence_thread(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), char: Char, boundary: Boundary, thread: EvidenceThread(n)) -> List(EvidenceThread(n))

 fn step_evidence_thread(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), char: Char, boundary: Boundary, thread: EvidenceThread(n)) -> List(EvidenceThread(n))

Step a single EvidenceThread on char at boundary using machine.

step_evidence_threads(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), char: Char, boundary: Boundary, threads: List(EvidenceThread(n))) -> List(EvidenceThread(n))

 fn step_evidence_threads(n: Nat, next: Function(Bounded(n), Function(Char, List(MachineState(n)))), char: Char, boundary: Boundary, threads: List(EvidenceThread(n))) -> List(EvidenceThread(n))

Step all active EvidenceThreads on char at boundary.

strict_end_anchor() -> Regex(Unit)

 fn strict_end_anchor() -> Regex(Unit)

Zero-width anchor matching strictly at the end of the subject (\z).

strict_end_constraint() -> BoundaryConstraint

 fn strict_end_constraint() -> BoundaryConstraint

Construct a strict subject-end (\z) boundary constraint with the default newline policy.

strict_end_constraint_with_policy(policy: NewlinePolicy) -> BoundaryConstraint

 fn strict_end_constraint_with_policy(policy: NewlinePolicy) -> BoundaryConstraint

Construct a strict subject-end (\z) boundary constraint with an explicit newline policy.

string_identity_conversion() -> Conversion(String, String)

 fn string_identity_conversion() -> Conversion(String, String)

Identity Conversion on String.

subject_end_constraint() -> BoundaryConstraint

 fn subject_end_constraint() -> BoundaryConstraint

Construct a subject-end (\Z) boundary constraint with the default newline policy.

subject_end_constraint_with_policy(policy: NewlinePolicy) -> BoundaryConstraint

 fn subject_end_constraint_with_policy(policy: NewlinePolicy) -> BoundaryConstraint

Construct a subject-end (\Z) boundary constraint with an explicit newline policy.

subject_end_for(policy: NewlinePolicy, next_char: Option(Char), after_next_char: Option(Char)) -> Bool

 fn subject_end_for(policy: NewlinePolicy, next_char: Option(Char), after_next_char: Option(Char)) -> Bool

Determine whether a position is at the subject end (allowing a trailing newline) under policy.

subject_initial_position() -> InitialPosition

 fn subject_initial_position() -> InitialPosition

Construct the starting Position at the beginning of a subject.

subject_start_constraint() -> BoundaryConstraint

 fn subject_start_constraint() -> BoundaryConstraint

Construct a subject-start (\A) boundary constraint with the default newline policy.

subject_start_constraint_with_policy(policy: NewlinePolicy) -> BoundaryConstraint

 fn subject_start_constraint_with_policy(policy: NewlinePolicy) -> BoundaryConstraint

Construct a subject-start (\A) boundary constraint with an explicit newline policy.

terminal_newline(policy: NewlinePolicy, char: Char) -> Bool

 fn terminal_newline(policy: NewlinePolicy, char: Char) -> Bool

Return true if remaining consists solely of a single terminal line break under policy.

thompson_compiled(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> Sigma(n: Nat, PatternMachine(n))

 fn thompson_compiled(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> Sigma(n: Nat, PatternMachine(n))

Package a ThompsonCompilation into an existentially quantified PatternMachine.

thompson_machine(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> PatternMachine(thompson_state_count(compilation))

 fn thompson_machine(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> PatternMachine(thompson_state_count(compilation))

Canonical constructor. The reference copy above is deliberately kept separate so transition-row implementations can be compared without changing the proof theorem's original definitional equations.

thompson_state_count(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> Nat

 fn thompson_state_count(shape: ShapeCode, compilation: ThompsonCompilation(shape)) -> Nat

Return the total number of states in a ThompsonCompilation.

thread_winner_seen(n: Nat, table: ThreadWinnerTable, state: ThreadState(n)) -> Bool

 fn thread_winner_seen(n: Nat, table: ThreadWinnerTable, state: ThreadState(n)) -> Bool

Return true if a thread's state has already been visited in table.

transition_boundary(char: Char, rest: List(Char)) -> Boundary

 fn transition_boundary(char: Char, rest: List(Char)) -> Boundary

Compute the Boundary immediately after consuming char at position.

transition_boundary_before(char: Char, rest: List(Char), after_input: List(Char)) -> Boundary

 fn transition_boundary_before(char: Char, rest: List(Char), after_input: List(Char)) -> Boundary

Compute the Boundary before consuming char, incorporating trailing after_input.

transition_routine(char: Char, routine: List(EvidenceInstruction)) -> List(ExtendedInstruction)

 fn transition_routine(char: Char, routine: List(EvidenceInstruction)) -> List(ExtendedInstruction)

Convert a transition's EvidenceInstruction list into an ExtendedRoutine.

transition_rows_constructor_equivalent(n: Nat, values: TransitionRowsFrom(n, n), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), transition_rows_next(TransitionRows(values), state, char), transition_rows_from_next(values, state, char))

 fn transition_rows_constructor_equivalent(n: Nat, values: TransitionRowsFrom(n, n), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), transition_rows_next(TransitionRows(values), state, char), transition_rows_from_next(values, state, char))

Equivalence unfolding transition_rows_next applied to a TransitionRows constructor.

transition_rows_from_next(remaining: Nat, total: Nat, rows: TransitionRowsFrom(remaining, total), state: Bounded(remaining), char: Char) -> List(MachineState(total))

 fn transition_rows_from_next(remaining: Nat, total: Nat, rows: TransitionRowsFrom(remaining, total), state: Bounded(remaining), char: Char) -> List(MachineState(total))

Look up transitions for a bounded state and char in a TransitionRowsFrom suffix.

transition_rows_machine(n: Nat, starts: List(MachineState(n)), rows: TransitionRows(n)) -> PatternMachine(n)

 fn transition_rows_machine(n: Nat, starts: List(MachineState(n)), rows: TransitionRows(n)) -> PatternMachine(n)

A table-backed machine exposes the same indexed machine interface as the reference closure machine. The only runtime closure is this single row lookup adapter; transition construction itself is performed once when the table is built, not by recursively rebuilding Thompson combinators for each input character.

transition_rows_machine_next_equation(n: Nat, starts: List(MachineState(n)), rows: TransitionRows(n), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), pattern_machine_next_at(transition_rows_machine(starts, rows), state, char), transition_rows_next(rows, state, char))

 fn transition_rows_machine_next_equation(n: Nat, starts: List(MachineState(n)), rows: TransitionRows(n), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), pattern_machine_next_at(transition_rows_machine(starts, rows), state, char), transition_rows_next(rows, state, char))

Equivalence relating pattern_machine_next_at on a table-backed machine to transition_rows_next.

transition_rows_next(n: Nat, rows: TransitionRows(n), state: Bounded(n), char: Char) -> List(MachineState(n))

 fn transition_rows_next(n: Nat, rows: TransitionRows(n), state: Bounded(n), char: Char) -> List(MachineState(n))

Look up transitions for state and char in a compiled TransitionRows table.

transition_rows_next_equivalent(n: Nat, starts: List(MachineState(n)), next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), transition_rows_next(compile_transition_rows(n, MkPatternMachine(starts, next)), state, char), next(state, char))

 fn transition_rows_next_equivalent(n: Nat, starts: List(MachineState(n)), next: Function(Bounded(n), Function(Char, List(MachineState(n)))), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), transition_rows_next(compile_transition_rows(n, MkPatternMachine(starts, next)), state, char), next(state, char))

Pointwise equivalence showing compile_transition_rows preserves a machine's transition function.

transition_rows_next_from_machine(n: Nat, machine: PatternMachine(n), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), transition_rows_next(compile_transition_rows(n, machine), state, char), pattern_machine_next_at(machine, state, char))

 fn transition_rows_next_from_machine(n: Nat, machine: PatternMachine(n), state: Bounded(n), char: Char) -> Equivalent(List(MachineState(n)), transition_rows_next(compile_transition_rows(n, machine), state, char), pattern_machine_next_at(machine, state, char))

Pointwise equivalence relating compiled transition rows to pattern_machine_next_at.

transport_list_member(a: Type, value: a, left: List(a), right: List(a), member: ListMember(a, value, left), equality: Equivalent(List(a), left, right)) -> ListMember(a, value, right)

 fn transport_list_member(a: Type, value: a, left: List(a), right: List(a), member: ListMember(a, value, left), equality: Equivalent(List(a), left, right)) -> ListMember(a, value, right)

Transport a ListMember witness along list equality.

unicode_alnum(actual: Char) -> Bool

 fn unicode_alnum(actual: Char) -> Bool

Return true if char is a Unicode letter or decimal digit.

unicode_alpha(actual: Char) -> Bool

 fn unicode_alpha(actual: Char) -> Bool

Return true if char is a Unicode alphabetic character.

unicode_category_in(category: Atom, values: List(Atom)) -> Bool

 fn unicode_category_in(category: Atom, values: List(Atom)) -> Bool

Return true if category appears in the list categories.

unicode_graph(actual: Char) -> Bool

 fn unicode_graph(actual: Char) -> Bool

Return true if char is a visible Unicode graphical character.

unicode_print(actual: Char) -> Bool

 fn unicode_print(actual: Char) -> Bool

Return true if char is a printable Unicode character.

unicode_property_class(property: UnicodeProperty, negated: Bool) -> Regex(Char)

 fn unicode_property_class(property: UnicodeProperty, negated: Bool) -> Regex(Char)

Regex matching a single UnicodeProperty (\p{...} / \P{...}).

unicode_property_match_matches(value: UnicodePropertyMatch, actual: Char) -> Bool

 fn unicode_property_match_matches(value: UnicodePropertyMatch, actual: Char) -> Bool

Test whether char satisfies a (possibly negated) UnicodePropertyMatch.

unicode_property_matches(property: UnicodeProperty, actual: Char) -> Bool

 fn unicode_property_matches(property: UnicodeProperty, actual: Char) -> Bool

Test whether char satisfies a UnicodeProperty.

unicode_property_matches_any(values: List(UnicodePropertyMatch), actual: Char) -> Bool

 fn unicode_property_matches_any(values: List(UnicodePropertyMatch), actual: Char) -> Bool

Return true if char satisfies any entry in a list of UnicodePropertyMatches.

unicode_property_test(property: UnicodeProperty, negated: Bool) -> Function(Char, Bool)

 fn unicode_property_test(property: UnicodeProperty, negated: Bool) -> Function(Char, Bool)

Curried predicate for a UnicodeProperty with optional negation.

unicode_word_constraint(expected: Bool) -> BoundaryConstraint

 fn unicode_word_constraint(expected: Bool) -> BoundaryConstraint

Construct a Unicode word-boundary (\b / \B) constraint.

unit_identity_conversion() -> Conversion(Unit, Unit)

 fn unit_identity_conversion() -> Conversion(Unit, Unit)

Identity Conversion on Unit.

update_named_capture_ledger(slot: Nat, value: String, entries: List(NamedCaptureLedgerEntry)) -> List(NamedCaptureLedgerEntry)

 fn update_named_capture_ledger(slot: Nat, value: String, entries: List(NamedCaptureLedgerEntry)) -> List(NamedCaptureLedgerEntry)

Record or overwrite a captured text value for slot in the named-capture ledger.

vertical_class(negated: Bool) -> Regex(Char)

 fn vertical_class(negated: Bool) -> Regex(Char)

Regex matching vertical whitespace (\v or \V when negated).

vertical_predicate(negated: Bool, char: Char) -> Bool

 fn vertical_predicate(negated: Bool, char: Char) -> Bool

Test whether char is vertical whitespace (\v / \V).

vertical_test(negated: Bool) -> Function(Char, Bool)

 fn vertical_test(negated: Bool) -> Function(Char, Bool)

Curried predicate for vertical whitespace (\v / \V).

weaken_machine_state_members(n: Nat, head: MachineState(n), whole: List(MachineState(n)), values: List(MachineState(n)), members: MachineStateMembers(n, whole, values)) -> MachineStateMembers(n, Cons(head, whole), values)

 fn weaken_machine_state_members(n: Nat, head: MachineState(n), whole: List(MachineState(n)), values: List(MachineState(n)), members: MachineStateMembers(n, whole, values)) -> MachineStateMembers(n, Cons(head, whole), values)

Weaken a MachineStateMembers witness by prepending an extra element to the ambient list.

word_boundary(unicode: Bool, negated: Bool) -> Regex(Unit)

 fn word_boundary(unicode: Bool, negated: Bool) -> Regex(Unit)

Zero-width word-boundary anchor (\b or negated \B) respecting options.

word_class(negated: Bool) -> Regex(Char)

 fn word_class(negated: Bool) -> Regex(Char)

Regex matching an ASCII word character (\w) or non-word (\W when negated).

word_class_with_options(negated: Bool, unicode: Bool) -> Regex(Char)

 fn word_class_with_options(negated: Bool, unicode: Bool) -> Regex(Char)

Regex matching \w / \W under options.

word_option_predicate(negated: Bool, unicode: Bool, char: Char) -> Bool

 fn word_option_predicate(negated: Bool, unicode: Bool, char: Char) -> Bool

Test whether char matches \w / \W under options.

word_options_test(negated: Bool, unicode: Bool) -> Function(Char, Bool)

 fn word_options_test(negated: Bool, unicode: Bool) -> Function(Char, Bool)

Curried predicate for \w / \W under options.