Fix RewriteITEBv to ensure rewrite to fixpoint (#2878)
authorAndres Noetzli <andres.noetzli@gmail.com>
Mon, 1 Apr 2019 21:26:23 +0000 (14:26 -0700)
committerGitHub <noreply@github.com>
Mon, 1 Apr 2019 21:26:23 +0000 (14:26 -0700)
commit41355e412a142809f63a1939a4515486ccd4c6fb
treeb8b7ee334c8cdc52c72a10356adfaf769793c539
parentae536749a2342e51c450deb62a13d5cfda965881
Fix RewriteITEBv to ensure rewrite to fixpoint (#2878)

`TheoryBVRewriter::RewriteITEBv()` is currently always returning the
status `REWRITE_DONE`. This can result in a situation where a rewritten
node can be rewritten again (which breaks the contract of our rewriter).
The unit test in this commit illustrates the issue. The commit fixes the
issue by returning `REWRITE_AGAIN` or `REWRITE_AGAIN_FULL` if a node
changed. `REWRITE_AGAIN_FULL` is needed if the resulting node may have a
child that is not a subterm of the original expression.
src/theory/bv/theory_bv_rewriter.cpp
test/unit/theory/CMakeLists.txt
test/unit/theory/theory_bv_rewriter_white.h [new file with mode: 0644]