Elm Exactly

Theorema49_float_signed_zero

StandardElmMech/Theorems.lean:313, The rulings, stated directly (kernel-checked) · native_decide (trusts the compiled evaluator)

A49: clamp 0 1 -0 at Float evaluates to +0. [native]

Statement

theorem a49_float_signed_zero :
    ∃ w, EvalExp E0 (ap (v "clamp") [fI 0, fI 1, .atexp (neg (.scon (.intF 0)))]) w ∧
      showElmSigned w = "+0"

Proof

checkShowWith_sound (o := .const false) (by native_decide)

Proved by native_decide: the decision procedure is compiled and run, and its answer is trusted. This is used where values are compared as they print, floats above all, which the kernel cannot compare.

Theorems it uses

About ruling A49 of the book, where the implementations disagreed or were silent and the definition decides.

In StandardElmMech/Theorems.lean: The command #mod_program_theorems (one theorem per program, in module form, in Lib.Btest; tagged [library] when the program names a core library value), budgetNative, the rulings stated directly, and theorems that D1 makes possible (a43_one_unique, a51_one_choice, log_order_demo).

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.