Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
The `mforeachAux` function was keeping two references to the array because it was implemented using `miterate a ⟨a, rfl⟩ ...` Thus, we would have to allocate a new array even if `a` was not shared. Another issue is that when invoking `x ← f i v`, the array would still have a reference to `v`, and consequently `RC(v) > 1`, and `f` would not be able to perform destructive updates to `v` or reuse its memory cell. Thus, I removed `mforeach` (we only used it to implement `hmap`: the homogeneous map), and implemented a new `hmap` which makes sure destructive updates can be performed modulo the issue with float `let` inwards I described in the previous commit. @kha I found the problem described in the previous commit when I was using `Array.hmap`. If we use `Array`s to implement `Syntax` as we discussed, then a `hmap` that does not prevent destructive updates from happening is a must-have. Otherwise, any benefit we get from using `Array`s instead of `List`s is gone. |
||
|---|---|---|
| .github | ||
| bin | ||
| doc | ||
| gen | ||
| images | ||
| lean4-mode | ||
| library | ||
| script | ||
| src | ||
| tests | ||
| .appveyor.yml | ||
| .clang-format | ||
| .codecov.yml | ||
| .gitattributes | ||
| .gitignore | ||
| .travis.yml | ||
| LICENSE | ||
| README.md | ||
| License | Windows | Linux / macOS | Test Coverage | Chat |
|---|---|---|---|---|
![]() |
About
- Homepage
- Theorem Proving in Lean
- Core library
- Change Log
- FAQ
- For HoTT mode, please use Lean2.
Installation
Stable and nightly binary releases of Lean are available on the homepage. For building Lean from source, see the build instructions.
Miscellaneous
- Building Doxygen Documentation:
doxygen src/Doxyfile - Coding Style
- Library Style Conventions
- Git Commit Conventions
- Automatic Builds
- Syntax Highlight Lean Code in LaTeX
- Exporting, and reference type-checkers
