Rational hitting lists: output adapter #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/RationalHitting/OutputAdapter.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
The fixed four-symbol alphabet of the tape adapter.
Instances For
The ten control states used by the tape adapter.
Equations
Instances For
A fixed-width encoded block stored in the finite control.
Equations
Instances For
Finite auxiliary storage used by the tape adapter.
Equations
Instances For
A tape-adapter instruction with finite auxiliary storage.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A configuration of the tape adapter.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Jump to the specified adapter control state.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Move the tape head and jump to the specified state.
Equations
Instances For
Move left and branch according to whether the delimiter was reached.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Read the designated block coordinates into the finite auxiliary storage.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.RationalHitting.TMTime.OutputAdapter.readBlock [] x✝ = x✝
Instances For
Write a fixed-width Boolean block as tape symbols.
Equations
- Complexity.RationalHitting.TMTime.OutputAdapter.block w = List.map (fun (i : Fin b) => Complexity.RationalHitting.TMTime.OutputAdapter.bit (w i)) (List.finRange b)
Instances For
Copy the designated coordinates from one stored block to another.
Equations
- Complexity.RationalHitting.TMTime.OutputAdapter.fill is w v = List.foldl (fun (u : Complexity.RationalHitting.TMTime.OutputAdapter.Word b) (i : Fin b) => Function.update u i (w i)) v is
Instances For
The fixed finite control map of the tape adapter.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.RationalHitting.TMTime.OutputAdapter.machine get 2 = Complexity.RationalHitting.TMTime.OutputAdapter.leftTo 2 3
- Complexity.RationalHitting.TMTime.OutputAdapter.machine get 5 = Complexity.RationalHitting.TMTime.OutputAdapter.leftTo 5 6
- Complexity.RationalHitting.TMTime.OutputAdapter.machine get 7 = Complexity.RationalHitting.TMTime.OutputAdapter.leftTo 7 8
Instances For
Assemble a configuration from the control state and the two tape halves.
Equations
- Complexity.RationalHitting.TMTime.OutputAdapter.state q v L R = { l := some q, var := v, Tape := Turing.Tape.mk₂ L R }
Instances For
Encode a sequence of bits and its terminal block.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.RationalHitting.TMTime.OutputAdapter.stream code stop x✝ [] = Complexity.RationalHitting.TMTime.OutputAdapter.block (stop x✝)
Instances For
Exact recursive step bound for the adapter's scanning loop.
Equations
Instances For
Literal block input to literal digit output; both head position and blank outside the output are guaranteed, with quadratic bit-time.
A genuine Fin4 finite TM0 output transducer; the encoding/decoding functions are fixed finite tables and no unbounded state or oracle is used.
At the boundary of a stack macrostep, the simulator's tape is determined by the actual stack contents. There is no junk-cell assumption.
The tape alphabet encoding a marked family of Boolean stacks.
Equations
- Complexity.RationalHitting.TMTime.OutputAdapter.StackAlphabet K = Turing.TM2to1.Γ' K fun (x : K) => Bool
Instances For
Encode a stack cell holding one bit in the selected register.
Equations
- Complexity.RationalHitting.TMTime.OutputAdapter.code k enc f x = (enc (f, Function.update (fun (x : K) => none) k (some x))).get
Instances For
Encode a terminal cell with all stacks empty.
Equations
Instances For
Decode the selected stack's bit from a fixed-width encoded block.
Equations
- Complexity.RationalHitting.TMTime.OutputAdapter.getter k dec w = (dec (List.Vector.ofFn w)).2 k
Instances For
Exact inverse interface for a clean output stack, including the bottom marker, right-side blank padding and output order.