Elm Exactly

Theorema93_vacuous_witness

StandardElmMech/Stat/SpecExamples.lean:408, A93: a `number` variable of a group that one binding's type does not mention · kernel-checked (decide +kernel)

A93's example with the instance of the vacuous variable at f 3 set to Int by hand in the annotated phrase that inference gives (where it is a free number variable, which the book's principal derivation does not determine): the reduced program is the same, a93_mutual's. The witness is ignored, and the vacuous variable is Float at every occurrence (Choices, item 3; dynamic-core: "a variable that nothing at the occurrence fixes is Float").

Statement

theorem a93_vacuous_witness :
    (inferProgram Btest (bareOf s_a93_mutual)).toOption.map a93WitnessView =
    some ([none, some (.var (.fresh 6 .num))], [none, some tIntTy], true, some a93Expected)

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 ruling A93 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.