Binary encodings of real-arithmetic expressions and formulas #
The flat constructor-stream layout is the one used by the formal abstract of
edemaine/lean-canny at 970f28a5ecefc1327402ade16c068aa4b1b2c183.
Integer constants use binary magnitudes and variables use unary ranks. The dimension is a
fixed parameter to each embedding; it is not a separate field in the encoded word.
Constructor tokens are framed individually; comparisons carry complete encoded terms.
The generated constructor, projection and injectivity APIs come from derive_encoding.
Main definitions #
Cslib.Logic.RealArithmetic.encTerm: binary-integer/unary-variable expression encoding.Cslib.Logic.RealArithmetic.encFormula: Boolean formulas over those encoded expressions.
Recognize this constructor on a typed value.
Extracting a recursive field has a native polynomial-time certificate. The machine scans constructor arities and copies the selected child stream.
Extracting a recursive field has a native polynomial-time certificate. The machine scans constructor arities and copies the selected child stream.
Number of constructor occurrences, including leaves.
Native decoding of typed token streams; no scalar decoder is assumed.
Extracting a recursive field has a native polynomial-time certificate. The machine scans constructor arities and copies the selected child stream.
Reading recursive arities uses only finitely many constructor tag bits.
Exact size: every token is framed once, independently of depth.
Recognize this constructor on a typed value.
The complete payload reconstructs exactly this constructor.
Reencoding a decoded value recovers every input token; all other complete-word parses fail.
Extracting a recursive field has a native polynomial-time certificate. The machine scans constructor arities and copies the selected child stream.
Complete payload reconstruction is natively polynomial-time.
Strict bit-word decoder, conditional on explicitly supplied native partial decoders for every scalar field. Empty scalar types are supported.
Complete payload reconstruction is natively polynomial-time.
Recognize this constructor on a typed value.
Serialized values are exactly complete one-root constructor streams.
Prefix decoding preserves the entire following stream.
Number of stream tokens equals the number of constructors.
Linear bit size in constructor count plus scalar word lengths.
Complete payload reconstruction is natively polynomial-time.
Sum of the unframed scalar encoding lengths at all nodes.
This matcher recognizes the constructor's range.
Recognize this constructor on a typed value.
Node reconstruction writes its token followed by its children's streams.
Complete payload reconstruction is natively polynomial-time.
Complete payload reconstruction is natively polynomial-time.
Node reconstruction writes its token followed by its children's streams.
Number of stream tokens equals the number of constructors.
Recognize this constructor on a typed value.
The complete payload reconstructs exactly this constructor.
Number of constructor occurrences, including leaves.
Extracting a recursive field has a native polynomial-time certificate. The machine scans constructor arities and copies the selected child stream.
Complete payload reconstruction is natively polynomial-time.
Complete payload reconstruction is natively polynomial-time.
Reading recursive arities uses only finitely many constructor tag bits.
The complete payload reconstructs exactly this constructor.
Native decoding of typed token streams; no scalar decoder is assumed.
Recognize this constructor on a typed value.
Complete payload reconstruction is natively polynomial-time.
Extracting a recursive field has a native polynomial-time certificate. The machine scans constructor arities and copies the selected child stream.
Complete payload reconstruction is natively polynomial-time.
The complete payload reconstructs exactly this constructor.
Exact size: every token is framed once, independently of depth.
Serialized values are exactly complete one-root constructor streams.
Reencoding a decoded value recovers every input token; all other complete-word parses fail.
The complete payload reconstructs exactly this constructor.
Prefix decoding preserves the entire following stream.
Extracting a recursive field has a native polynomial-time certificate. The machine scans constructor arities and copies the selected child stream.
Linear bit size in constructor count plus scalar word lengths.
This matcher recognizes the constructor's range.
Recognize this constructor on a typed value.
Complete payload reconstruction is natively polynomial-time.
Sum of the unframed scalar encoding lengths at all nodes.
Extracting a recursive field has a native polynomial-time certificate. The machine scans constructor arities and copies the selected child stream.
Recognize this constructor on a typed value.
Recognize this constructor on a typed value.
Recognize this constructor on a typed value.
This matcher recognizes the constructor's range.
Strict bit-word decoder, conditional on explicitly supplied native partial decoders for every scalar field. Empty scalar types are supported.
This matcher recognizes the constructor's range.
Extracting a recursive field has a native polynomial-time certificate. The machine scans constructor arities and copies the selected child stream.
A prefix constructor token with a natural-number variable rank. The four alternatives are an integer constant, a variable, addition, and multiplication, in that order.
Raw prefix token for an integer constant.
Raw prefix token for a variable with natural-number rank i.
Raw prefix token for addition.
Raw prefix token for multiplication.
A prefix formula token. The alternatives are falsity, equality to zero, strict inequality to zero, negation, conjunction, and disjunction. Comparison tokens carry a complete term word.
Encode the formula constructor tags followed by the term word or empty payload.
Raw prefix token for falsity.
Raw prefix token for equality to zero, carrying an encoded term word.
Raw prefix token for strict inequality to zero, carrying an encoded term word.
Raw prefix token for negation.
Raw prefix token for conjunction.
Raw prefix token for disjunction.