diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-06-10 16:53:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-10 21:53:38 +0000 |
commit | 5fb5d6030aa031d5f63676ec29ffa8e158fa5c6a (patch) | |
tree | 5d03b8923d08bcdf9c84151c7fab1a4ee4e52fba /src/preprocessing | |
parent | 6394bf6ffa2486587d1726271769117f7dc227a8 (diff) |
Ensure bv2nat and int2bv are not rewritten when using solve-bv-as-int (#6725)
This PR ensures we do not eagerly rewrite bv2nat and int2bv when using solve-bv-as-int. Instead they are rewritten during expandDefinitions (at the end of preprocessing).
It also updates regressions that relied on lazy extended function reductions in the lazy solver to use solve-bv-as-int, and adds a missing case (INT_TO_BITVECTOR) in the solve-int-as-bv preprocessing pass.
A followup PR will remove support for lazy extended function reductions for bv2nat / int2bv altogether.
Diffstat (limited to 'src/preprocessing')
-rw-r--r-- | src/preprocessing/passes/bv_to_int.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/preprocessing/passes/bv_to_int.cpp b/src/preprocessing/passes/bv_to_int.cpp index b6f53f8c2..ad2707035 100644 --- a/src/preprocessing/passes/bv_to_int.cpp +++ b/src/preprocessing/passes/bv_to_int.cpp @@ -408,6 +408,14 @@ Node BVToInt::translateWithChildren(Node original, returnNode = translated_children[0]; break; } + case kind::INT_TO_BITVECTOR: + { + // ((_ int2bv n) t) ---> (mod t 2^n) + size_t sz = original.getOperator().getConst<IntToBitVector>().d_size; + returnNode = d_nm->mkNode( + kind::INTS_MODULUS_TOTAL, translated_children[0], pow2(sz)); + } + break; case kind::BITVECTOR_AND: { // We support three configurations: |