Fix BV ITE rewrite (#3004)
authorAndres Noetzli <noetzli@stanford.edu>
Sat, 18 May 2019 01:47:09 +0000 (18:47 -0700)
committerGitHub <noreply@github.com>
Sat, 18 May 2019 01:47:09 +0000 (18:47 -0700)
commitd7514f640835ba6e7c8c4db4fa6fd041bbf0fe3c
treed68a7c6816e9c86bd9ce456a5a8dad52fc6b90f1
parent5c38c59cb40df00e29cbd9d30495833f88c6d4fb
Fix BV ITE rewrite (#3004)

The rewrite `BvIteConstChildren` assumes that `BvIteEqualChildren` has
been applied before it runs. However, with nested ITEs, it was possible
to violate that assertion. Given `bvite(c1, bvite(c2, 0, 0), bvite(c3,
0, 0))`, `BvIteEqualChildren` would rewrite that term to `bvite(c2, 0,
0)`. The `LinearRewriteStrategy` then ran `BvIteConstChildren` on
`bvite(c2, 0, 0)` which complained about the equal children. This commit
implements a simple fix that splits the `LinearRewriteStrategy` into two
strategies to make sure that if `BvIteEqualChildren` rewrites a node, we
drop back to the `Rewriter`. This ensures that the rewrites on the
rewritten node are invoked in the correct order.
src/theory/bv/theory_bv_rewriter.cpp
test/unit/theory/theory_bv_rewriter_white.h