Theoremroundtrip
The round trip (sec:effects-ports, the property): a value of a canonical payload type that encodes to j decodes from j to itself with its records' fields in label order, unless one of the exceptions of A88 occurs in it; given the one fact about Lean's floats it uses.
Statement
theorem roundtrip {τ : PTy} {v : Val} {j : BVal} (hF : FloatRoundTrip) (hτ : τ.Canon)
(he : Enc τ v j) (hx : NoExc τ v) : Dec τ j (normVal v)Proof
(dec_iff _ _ _).mpr (rt hF τ v j hτ ((enc_iff _ _ _).mp he) hx)Proved by a term, which Lean's kernel checks directly.
Theorems it uses
About ruling A88 of the book, where the implementations disagreed or were silent and the definition decides.
In StandardElmMech/Eff/RoundTrip.lean: The round trip of encoding and decoding (roundtrip), except where A88 says otherwise (NoExc), under the named hypothesis FloatRoundTrip; the exceptions shown to be needed.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.