lean4-htt/tests/lean/run/cbv_ite_issue.lean
Wojciech Różowski 57c5efe309
fix: handling of ite/dite expressions in cbv tactic (#12361)
This PR develops custom simprocs for dealing with `ite`/`dite`
expressions in `cbv` tactics, based on equivalent simprocs from
`Sym.simp`, with the difference that if the condition is not reduced to
`True`/`False`, we make use of the decidable instance and calculate to
what the condition reduces to.

Stacked on top of #12391.
2026-02-09 15:00:10 +00:00

31 lines
655 B
Text

set_option cbv.warning false
example : (if (true = false) then 5 else 7) = 7 := by
conv =>
lhs
cbv
example : (if (true = ((fun x => x) true)) then 5 else 7) = 5 := by
conv =>
lhs
cbv
example : (if (String.Pos.Raw.mk 1 = String.Pos.Raw.mk 2) then 5 else 42) = 42 := by
conv =>
lhs
cbv
example : (if (String.Pos.Raw.mk 1 = String.Pos.Raw.mk 1) then 5 else 42) = 5 := by
conv =>
lhs
cbv
example : (if _ : String.Pos.Raw.mk 1 = String.Pos.Raw.mk 2 then 5 else 42) = 42 := by
conv =>
lhs
cbv
example : (if _ : String.Pos.Raw.mk 1 = String.Pos.Raw.mk 1 then 5 else 42) = 5 := by
conv =>
lhs
cbv