Documentation

CslibFrontier.Logics.RealArithmetic.TermTokenDecoding

Strict decoding of real-arithmetic term tokens #

A raw term word carries unary variable ranks without a separate ambient dimension. The decoder reads each rank as a natural number, using the binary integer and framed constructor stream of encTerm. This exposes the ranks needed by modular evaluation, as in TermModularData from lean-canny at 970f28a5ecefc1327402ade16c068aa4b1b2c183.

The decoder checks token framing and scalar encodings in polynomial time. A later syntax check can decide whether the resulting stream contains exactly one complete term.

Decode the complete framed constructor stream, independently of the ambient dimension.

A term's word decodes to its original prefix tokens with natural-number ranks.

theorem Cslib.Logic.RealArithmetic.termTokenRank_lt_of_decode {word : List Bool} {tokens : List TermToken} {i : ℕ} (h : termTokensDecoder.decode word = some tokens) (hi : Sum.inr (Sum.inl i) ∈ tokens) :
i < word.length

Every decoded variable rank is strictly smaller than the length of the input word.