mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-17 10:24:07 +00:00
de2b177423aeceb5ae9c1db331509d39df3b6720
cbv_opaque take precedence over cbv_eval (#12908)
This PR makes `@[cbv_opaque]` unconditionally block all evaluation of a constant by `cbv`, including `@[cbv_eval]` rewrite rules. Previously, `@[cbv_eval]` could bypass `@[cbv_opaque]`, and for bare constants (not applications), `isOpaqueConst` could fall through to `handleConst` which would unfold the definition body. The intended usage pattern is now: mark subterm-producing functions (like `DHashMap.insert`) as `@[cbv_opaque]` to prevent unfolding, and provide `@[cbv_eval]` theorems on the *consuming* function (like `DHashMap.contains`) which pattern-matches against the opaque subterms.
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.
Languages
Lean
94.3%
C++
4.1%
Python
0.6%
Shell
0.4%
CMake
0.3%