This PR enables transforming nondependent `let`s into `have`s in a number of contexts: the bodies of nonrecursive definitions, equation lemmas, smart unfolding definitions, and types of theorems. A motivation for this change is that when zeta reduction is disabled, `simp` can only effectively rewrite `have` expressions (e.g. `split` uses `simp` with zeta reduction disabled), and so we cache the nondependence calculations by transforming `let`s to `have`s. The transformation can be disabled using `set_option cleanup.letToHave false`. Uses `Meta.letToHave`, introduced in #8954.
15 lines
195 B
Text
15 lines
195 B
Text
true
|
|
(match i with
|
|
| 0 => true
|
|
| n.succ => true) &&
|
|
f i
|
|
if i < 5 then 0 else 1
|
|
if i < 5 then 0 else g i j
|
|
i + 1
|
|
i + h i j
|
|
i + 1
|
|
i + i * 2
|
|
i + i * r i j
|
|
i + i * r i j
|
|
have z := s i j;
|
|
z + z
|