Documentation

Cedar.Thm.Ext.Decimal

Well-formed decimal syntax is exactly syntax to which the grammar assigns some value.

Completeness of Decimal.parse: if the grammar assigns s the value d.toInt, then parsing accepts the string as d. Well-formedness is not a separate hypothesis — IsDecimalValue already asserts that s is a rendering of the grammar's productions.

Soundness of Decimal.parse: if parsing succeeds, then the input is a well-formed rendering whose grammar value is exactly the returned decimal's value. (The value is automatically in Int64 range, since d : Decimal = Int64, so no range conjunct is stated.)

Exact parser characterization: parsing succeeds with d precisely when the declarative grammar relation assigns the input the value d.toInt.

Parsing the canonical string representation of a decimal returns the same decimal.

Failure characterization for Decimal.parse: parsing rejects exactly malformed strings and well-formed strings whose grammar value overflows the Int64 range. The value relation is total on well-formed syntax, so these cases are exhaustive and mutually exclusive.

toString is injective: distinct decimals produce distinct strings.

Equal normal form iff equal value: normalization decides decimal equality.