This PR adds `simpControl`, a simproc that handles control-flow expressions such as `if-then-else`. It simplifies conditions while avoiding unnecessary work on branches that won't be taken. The key behavior of `simpControl`: - Simplifies the condition of `if-then-else` expressions - If the condition reduces to `True` or `False`, returns the appropriate branch, and continue simplifying. - If the condition simplifies to a new expression, rebuilds the `if-then-else` with the simplified condition (synthesizing a new `Decidable` instance), and mark it as "done". That is, simplifier main loop will not visit branches. - Does **not** visit branches unless the condition becomes `True` or `False` This is useful for symbolic simplification where we want to avoid wasting effort simplifying branches that may be eliminated after the condition is resolved. This PR also fixes a bug in `Sym/Simp/EvalGround.lean`, and adds some helper functions. |
||
|---|---|---|
| .. | ||
| bench | ||
| bench-radar | ||
| compiler | ||
| elabissues | ||
| ir | ||
| lake | ||
| lean | ||
| pkg | ||
| playground | ||
| plugin | ||
| simpperf | ||
| .gitignore | ||
| common.sh | ||
| lakefile.toml | ||
| lean-toolchain | ||