Documentation

Cedar.Thm.Ext.Duration

Duration parser theorem surface.

parse_sound and parse_complete characterize successful parsing against the declarative IsDurationValue relation. parse_eq_none_iff characterizes exactly when parsing rejects.

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

Completeness of Duration.parse: if the grammar assigns str the value d.val.toInt, then parsing accepts the string as d.

Soundness of Duration.parse: if parsing succeeds, the declarative grammar relation assigns the input exactly the returned duration's value.

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

Failure characterization for Duration.parse: parsing rejects exactly malformed strings and well-formed strings whose grammar value overflows the Int64 range.

Parsing a negated duration string negates the underlying value.

offset and durationSince are inverses: adding a duration then computing the difference gives back the same duration.

parse ∘ toString roundtrip: parsing the string representation recovers the original.

toString is injective: distinct durations produce distinct strings.

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