simplification of if



On 2012-09-01, Stavros Macrakis <macrakis at alum.mit.edu> wrote:

> Is there any good reason that (if true then A else B) doesn't
> *simplify *to A?

I made a half-hearted effort in that direction some time ago; the code
that I came up with is now in share/contrib/boolsimp. Some of the stuff
you mentioned are handled by that code, but it's not very extensive so I
suspect it's easy to come up with examples that it won't handle.
The boolsimp code handles some Boolean expressions as well as "if"
expressions.

It might or might not be worth the trouble to update and expand
boolsimp. Probably an effective approach would be to scope out the
simplification policies we want to put in place, then see what (if
anything) can be salvaged from boolsimp.

A related idea which has been floated before is to make the Boolean
operators simplifying instead of evaluating. I wonder if anyone would
like to talk about that.

best,

Robert Dodier