Closed Hirrolot closed 1 month ago
We already propagate positive information for equality tests (=). So the following code:
=
main(x) := match =(x, 0i32) { T() -> match =(x, 5i32) { T() -> Panic("impossible"), F() -> "Good 1" }, F() -> match !=(x, 10i32) { T() -> "Good 2", F() -> match =(x, 10i32) { T() -> "Good 3", F() -> Panic("impossible") } } };
Supercompiles to:
main(x) := match =(x, 0i32) { F() -> match !=(x, 10i32) { F() -> match =(x, 10i32) { F() -> Panic("impossible"), T() -> "Good 3" }, T() -> "Good 2" }, T() -> "Good 1" };
However, the =(x, 10i32) test should be also eliminated, resulting in:
=(x, 10i32)
main(x) := match =(x, 0i32) { F() -> match !=(x, 10i32) { F() -> "Good 3", T() -> "Good 2" }, T() -> "Good 1" };
We already propagate positive information for equality tests (
=
). So the following code:Supercompiles to:
However, the
=(x, 10i32)
test should be also eliminated, resulting in: