Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
Leonardo de Moura b76deb4f0d fix(tests/playground/parser/syntax): another issue with float let inwards
@kha I keep finding problems with the float `let` inwards
transformation. It is always a nasty interaction between this
transformation and the `reset/reuse` insertion procedure.

The example I used in the new comment can be modified to a
`casesOn` with more than one branch (e.g., `Option.casesOn`).
Suppose we wrote
```
let o : Option Nat := Array.index a i in
let a              := Array.update a i none in
Option.casesOn o
  none
  (fun n, some (Array.update a i (some (n + 1))))
```
In the example above, the compiler will float
`a := Array.update a i none` inwards.
```
let o : Option Nat := Array.index a i in
Option.casesOn o
  none
  (fun n,
   let a := Array.update a i none in
   some (Array.update a i (some (n + 1))))
```
Then, adding reset/reuse:
```
let o : Option Nat := Array.index a i in
Option.casesOn o
  none
  (fun n,
   let o := reset o in
   let a := Array.update a i none in
   let n := n + 1 in
   let o := reuse o (some n)
   some (Array.update a i o))
```
Similarly to the example in the new comment, the `reset o` will fail since
the array `a` would still have a reference to `o`.

Remarks:
- Haskell also implements float `let` inwards.
- I am not sure how important the float `let` inward transformation is.
- I can see other nasty interactions after we implement user-defined
  simplification rules. For example, I guess many users would find the
  following lemma to be a good rewriting rule:
  ```
  (Array.update (Array.update a i v) i w) = (Array.update a i w)
  ```
  However, if we use this lemma in the example above, then `Array.update a i none` will be eliminated,
  and `reset o` will fail.
2019-04-19 14:52:52 -07:00
.github chore(.github/CONTRIBUTING): fix typos and URLs 2017-10-30 16:23:22 +01:00
bin chore(bin/leanc.in): remove flags that do not exist on clang++ for OSX 2019-03-18 08:38:50 -07:00
doc doc(doc/make/index): add instructions for invoking makefile manually 2019-03-25 14:57:57 -07:00
gen feat(runtime): avoid extra switch 2019-02-23 17:35:21 -08:00
images chore(CMakeLists.txt): move Lean logo to make sure we can test leanemacs without installing Lean 2015-01-31 17:38:49 -08:00
lean4-mode feat(frontends/lean): add partial keyword 2019-03-26 16:09:55 -07:00
library chore(library/init/data/array/basic): missing [inline] 2019-04-19 14:52:52 -07:00
script chore(library/constants.txt): remove dead variables 2019-03-22 13:26:48 -07:00
src fix(tests/playground/parser/syntax): another issue with float let inwards 2019-04-19 14:52:52 -07:00
tests chore(tests/playground): fix tests 2019-04-18 17:29:49 -07:00
.appveyor.yml chore(.appveyor,.travis): disable leanpkg registry tests 2018-04-12 18:32:20 +02:00
.clang-format feat(library/vm/process): add basic process support 2017-03-28 18:08:06 -07:00
.codecov.yml fix(.codecov.yml): do not fail github ci if coverage drops by 0.01% 2017-06-25 10:35:02 +02:00
.gitattributes chore(.gitattributes): use union merge strategy for doc/changes.md 2017-12-11 12:49:10 +01:00
.gitignore feat(bin/leanc): add simple C++ compiler wrapper script 2019-03-18 16:11:30 +01:00
.travis.yml chore(.travis.yml): trigger AppVeyor nightly build from Travis 2018-04-13 16:44:27 +02:00
LICENSE Add LICENSE file 2013-07-15 18:55:48 -07:00
README.md chore(README): point CI links to lean4 branch 2018-04-12 13:50:42 +02:00

logo

LicenseWindowsLinux / macOSTest CoverageChat
Codecov Join the Zulip chat

About

Installation

Stable and nightly binary releases of Lean are available on the homepage. For building Lean from source, see the build instructions.

Miscellaneous

Roadmap