Documentation

CslibFrontier.Algorithms.WordRAM.AhoCorasick.Input

Aho–Corasick Word-RAM Input/Output Encodings and Bounds #

Public problem instance, word-array encoding, occurrence encoding/decoding, register-output slot, and width/time thresholds for the integer-alphabet Aho–Corasick Word-RAM realization.

This module has no dependency on Structured, SymbolicExec, or the pure BFS/trie models, so clients inspecting Input, encodeOccurrences, decodeOccurrences, wordBound, or searchTime avoid elaborating the machine-level proof stack.

Main definitions #

Main results #

Input/output encodings and pure bounds #

Input to the integer-alphabet Aho–Corasick matcher: strict alphabet upper bound alphabetSize (σ), keyword list patterns (P), and text text (t).

  • alphabetSize : ℕ

    Strict upper bound σ on alphabet symbols.

  • patterns : List (List ℕ)

    Keyword list P.

  • text : List ℕ

    Text t to scan.

Instances For

    Total length ‖P‖ = ∑_{p ∈ P} |p| of all keywords in P.

    Every symbol of every keyword and of the text lies in [0, inp.alphabetSize).

    Instances For

      Flat word-list encoding of P: [|p₁|, p₁..., |p₂|, p₂..., ...].

      Input word-array encoding [σ, |P|, ‖P‖, |t|] ++ encodePatterns P ++ t.

      Flat word-list encoding of occurrences [(pos₁, y₁), ...]: [pos₁, |y₁|, pos₂, |y₂|, ...].

      Word-width threshold for searchCode and searchProgram.

      Instruction bound O((‖P‖ + 1) · σ + |P| + |t| + occ) for searchProgram.

      Polynomial upper bound on inp.wordBound in terms of |P|, ‖P‖, |t|, and σ alone.

      Under inp.Valid and Fits w inp.wordBound, every word of inp.encode and its length fit in width w.

      @[reducible, inline]

      Output block header register returned by searchProgram.