Strict decoding of real-arithmetic formula tokens #
The dimension-independent decoder reads the constructor stream of encFormula and keeps each
comparison's term word as its payload. The strict framed-list decoder supplies polynomial time
and rejects malformed tags and frames. The shape of the formula and the syntax of its term words
can be checked separately.
Decode framed formula tags with their comparison words, independently of dimension.
theorem Cslib.Logic.RealArithmetic.formulaTokensDecoder_decode_encFormula {n : ℕ} (p : Formula n) :
formulaTokensDecoder.decode ((encFormula n) p) = some (List.map FormulaToken.encodeTerms (encFormula_tokens n p))
A canonical formula word decodes to its prefix tokens with encoded comparison terms.
theorem Cslib.Logic.RealArithmetic.formulaTermWord_length_lt_of_decode {word term : List Bool} {tokens : List FormulaToken} (h : formulaTokensDecoder.decode word = some tokens) (hterm : Sum.inr (Sum.inl term) ∈ tokens ∨ Sum.inr (Sum.inr (Sum.inl term)) ∈ tokens) :
The bits of an equality or inequality term payload fit strictly inside the formula word.