Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR fixes an issue in the expand reset reuse pass that causes segfaults in very rare situations. This bug occurs in situations where two projections from the same field happen right before a reset, for example: ``` let x.2 := oproj[0] _x.1; inc x.2; let x.3 := oproj[0] _x.1; inc x.3; let _x.4 := reset[1] _x.1; ``` when expand reset reuse we optimize situations like this to only `inc` on the cold path as on the hot path we are going to keep the projectees alive until at least `reuse` by just not `dec`-ing the resetee. However, the algorithm for this assumed that we do not project more than once from each field and thus removed both `inc x.2` and `inc x.3` which is too much. The bug was masked compared to the original #13407 that was reproducible in 4.29, because the presented code relied on semantics of global constants which were changed in 4.30. The PR contains a modified (and more consistent) reproducer. Closes: #13407 Co investigated with @Rob23oba |
||
|---|---|---|
| .claude | ||
| .github | ||
| .vscode | ||
| doc | ||
| images | ||
| releases_drafts | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .gitpod.Dockerfile | ||
| .gitpod.yml | ||
| .ignore | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| lean-toolchain | ||
| LICENSE | ||
| LICENSES | ||
| README.md | ||
| RELEASES.md | ||
This is the repository for Lean 4.
About
- Quickstart
- Homepage
- Theorem Proving Tutorial
- Functional Programming in Lean
- Documentation Overview
- Language Reference
- Release notes starting at v4.0.0-m3
- Examples
- External Contribution Guidelines
Installation
See Install Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean.