summaryrefslogtreecommitdiff
path: root/src/preprocessing/passes/bv_to_int.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-04-22 10:02:05 -0500
committerGitHub <noreply@github.com>2021-04-22 15:02:05 +0000
commitccd0e7fdf1484d72b0a2565fefd0259fe7557b0c (patch)
tree5713dd6c821f13151e6ba71f519d5d2394a316c6 /src/preprocessing/passes/bv_to_int.cpp
parentbc928d24d7454d81f39006b4129a29286fcd10eb (diff)
Fix models for sygus-inference, bv2int, real2int (#6421)
In each case, previously we were generating a define-fun, what we needed was to do a model substitution. This actually meant that check-models was giving false positives. The model was incorrect but check-models succeeded due to its use of expand definitions.
Diffstat (limited to 'src/preprocessing/passes/bv_to_int.cpp')
-rw-r--r--src/preprocessing/passes/bv_to_int.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/preprocessing/passes/bv_to_int.cpp b/src/preprocessing/passes/bv_to_int.cpp
index 6fe676e30..c725081c2 100644
--- a/src/preprocessing/passes/bv_to_int.cpp
+++ b/src/preprocessing/passes/bv_to_int.cpp
@@ -840,8 +840,15 @@ void BVToInt::defineBVUFAsIntUF(Node bvUF, Node intUF)
}
// If the result is BV, it needs to be casted back.
result = castToType(result, resultType);
- // add the function definition to the smt engine.
- d_preprocContext->getSmt()->defineFunction(bvUF, args, result, true);
+ // add the substitution to the preprocessing context, which ensures the
+ // model for bvUF is correct, as well as substituting it in the input
+ // assertions when necessary.
+ if (!args.empty())
+ {
+ result = d_nm->mkNode(
+ kind::LAMBDA, d_nm->mkNode(kind::BOUND_VAR_LIST, args), result);
+ }
+ d_preprocContext->addSubstitution(bvUF, result);
}
bool BVToInt::childrenTypesChanged(Node n)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback