Rational hitting lists: compiler #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/RationalHitting/Compiler.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
Composition starts in the first machine's default state.
Instances For
Tag a configuration as belonging to the first machine in a composition.
Instances For
Tag a configuration as belonging to the second machine in a composition.
Instances For
The transition map of the compiled machine in this compiler stage.
Equations
- Complexity.RationalHitting.TMTime.Link.machine F G (Sum.inl q) x✝ = match F q x✝ with | none => some (Sum.inr default, Turing.TM0.Stmt.write x✝) | some (r, s) => some (Sum.inl r, s)
- Complexity.RationalHitting.TMTime.Link.machine F G (Sum.inr q) x✝ = Option.map (fun (x : Δ × Turing.TM0.Stmt Γ) => match x with | (r, s) => (Sum.inr r, s)) (G q x✝)
Instances For
Splice two halting finite transducers with exactly one glue step. The intermediate output is the literal tape required by the second input.
The fixed four-symbol alphabet of the final finite-state machine.
Equations
Instances For
The blank-preserving map from Boolean tape symbols into the fixed alphabet.
Equations
Instances For
Translate a Boolean-tape instruction to the fixed alphabet.
Equations
Instances For
The transition map of the compiled machine in this compiler stage.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Translate a Boolean-tape configuration to the fixed alphabet.
Equations
Instances For
End-to-end, finite-state, Fin4 one-tape compilation. Input and output are literal 1/2 digit strings, NOT different encodings hidden by an interface. The stack program is a single fixed finite syntax tree. Final scratch must be empty; the designated output stack has reversed output order, as explicitly stated.
A fixed finite stack program with literal unary input and exact canonical output, bounded by a fixed polynomial in the input length.
Equations
Instances For
A single finite stack program generating exact hitting-list encodings in polynomial time.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The raw compiler preserves literal input/output and gives a fixed finite alphabet and state space with a polynomial transition bound.