Documentation

Complexitylib.Circuits.FormulaEncoding.Internal

Boolean-formula codec internals #

This module proves the stack-machine, round-trip, injectivity, and length properties of the canonical postfix formula encoding.

Internal exact length of one encoded token.

Internal token-prefix round trip.

theorem Complexity.FormulaCode.run?_append_internal (first second : List Token) (stack : List BoolFormula) :
run? (first ++ second) stack = (run? first stack).bind (run? second)

Internal composition law for the postfix stack machine.

theorem Complexity.FormulaCode.run?_tokens_internal (formula : BoolFormula) (stack : List BoolFormula) :
run? (tokens formula) stack = some (formula :: stack)

Internal stack specification for the postfix tokens of a formula.

Internal reconstruction of a formula from its own postfix tokens.

Internal exact token-count theorem.

Internal fixed-count token-list round trip.

theorem Complexity.FormulaCode.decodePrefix?_encode_append_internal (formula : BoolFormula) (suffix : List Bool) :
decodePrefix? (encode formula ++ suffix) = some (formula, suffix)

Internal formula-prefix round trip.

Internal exact-decoder round trip.

Internal injectivity of canonical formula serialization.

theorem Complexity.FormulaCode.decode?_encode_append_eq_none_internal (formula : BoolFormula) {suffix : List Bool} (hsuffix : suffix []) :
decode? (encode formula ++ suffix) = none

Internal rejection of nonempty trailing data by exact decoding.

Internal exact formula-code length.