Elm Exactly

Theorema87_vacuous_inner

StandardElmMech/Stat/SpecExamples.lean:347, A87: the default copy is always made; a variable the declaration does not quantify · kernel-checked (decide +kernel)

A87, A43, A27 (dynamic-core, after the check example): the number of 2 ^ -1 (and of the 0 it is compared with) is not mentioned by the type of y, so it is not a variable of the declaration: no closure generalises it, and it is Float in every copy of y, y$Int included. Only the branches 1 and 2, at y's own variable, follow the copy.

Statement

theorem a87_vacuous_inner :
    onOk a87InnerView (endToEnd Btest s_a87_vacuous_inner) =
    some (some ["y", "y$Int", "main"], some [.intF 2, .intF 1, .intF 0, .intF 1, .intF 2],
          some [.intF 2, .intF 1, .intF 0, .int 1, .int 2])

Proof

by
  decide +kernel

Proved by decide +kernel: Lean's kernel itself runs the decision procedure, here the evaluator, and checks that the answer is true, so nothing outside the kernel is trusted.

About rulings A87, A43, A27 of the book, where the implementations disagreed or were silent and the definition decides.

In StandardElmMech/Stat/SpecExamples.lean: The rulings on small programs: A27 (a free number is Float, annotations bind), A87 (the default copy is made), A93 (vacuous variables), polymorphic recursion, copy names, abs$Int, exposing items, payload types, kinds of main, eight copies, renaming invariance, record-pattern copies.

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.