`csimp` assumes constructors and `casesOn` applications match. That is, given `I.casesOn x ...`, then if `x` is an constructor, then it is a constructor of the inductive datatype `I`. The transformation `erase_irrelevant` was violating this property when it mixes `Decidable` and `Bool`. We fix this issue by mapping `Decidable.casesOn`, `Decidable.isTrue` and `Decidable.isFalse` to `Bool.casesOn`, `Bool.true` and `Bool.false` respectively.
6 lines
137 B
Text
6 lines
137 B
Text
partial def foo : ∀ (n : Nat), State Unit Unit
|
|
| n =>
|
|
if n == 0 then pure () else
|
|
match n with
|
|
| 0 => pure ()
|
|
| n+1 => foo n
|