Rational hitting lists: dense records #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/RationalHitting/DenseRecords.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
Self-delimiting word records (distinct from the final output encoding).
Equations
Instances For
Escape each data bit by prefixing it with a false marker.
Equations
- Complexity.RationalHitting.StackLanguage.pairWord w = List.flatMap (fun (b : Bool) => [false, b]) w
Instances For
Move and escape the bits of one record.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Consume a binary word, prepending one encoded reversed record.
Equations
Instances For
Read one escaped data bit or consume the record terminator.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Remove one self-delimiting record; produce its reversed binary word.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dense serialized arrays of variable-width binary records.
Equations
Instances For
Register embedding for the unpacking stage of a record move.
Equations
Instances For
Register embedding for the packing stage of a record move.
Equations
Instances For
Move one delimited record between stacks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Register embedding for moving records forward during a scan.
Equations
Instances For
Register embedding for restoring records after a scan.
Equations
Instances For
Move one record and decrement the unary scan counter.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Scan the specified number of records using a unary counter.
Equations
Instances For
Restore all scanned records to the original stack.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Register embedding for unpacking a record without consuming it permanently.
Equations
Instances For
Register embedding for restoring a peeked record.
Equations
Instances For
Copy the next record while restoring its original representation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Indexed read. Register 4 is a unary index; register 0 is a serialized array and is restored byte-for-byte. Register 5 receives the exact binary word.
Equations
- One or more equations did not get rendered due to their size.