Theoremnormalise_example
normalise sorts the fields of nested record types too.
Statement
theorem normalise_example :
(PTy.record (.cons "b" .int (.cons "a" (.list (.record (.cons "y" .bool (.cons "x" .string .nil)))) .nil))).normalise =
.record (.cons "a" (.list (.record (.cons "x" .string (.cons "y" .bool .nil)))) (.cons "b" .int .nil))Proof
by
decide +kernelProved 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.
In StandardElmMech/Eff/Normalise.lean: PTy.normalise (record fields sorted by label) and normalise_canon: canonical when each record's labels are distinct.
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.