summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-02-11 18:20:25 -0600
committerGitHub <noreply@github.com>2020-02-11 16:20:25 -0800
commit0858188716609ae8a45e542bc4e054e675f2676d (patch)
tree82f206b79dc8f7f1235d79cb3e8da73187f28c86 /src/theory
parent0f25a37b05db224fe16c3c0357c24d89ad9e5cee (diff)
Fix non-linear equality solving that involves mixed real/integer arithmetic (#3739)
* Fix non-linear equality solving that involves mixed real/integer. * Format * Fix * Revert Co-authored-by: Ahmed Irfan <43099566+ahmed-irfan@users.noreply.github.com>
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/arith/nl_model.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/theory/arith/nl_model.cpp b/src/theory/arith/nl_model.cpp
index 54ae4c52a..8a4145552 100644
--- a/src/theory/arith/nl_model.cpp
+++ b/src/theory/arith/nl_model.cpp
@@ -534,8 +534,11 @@ bool NlModel::solveEqualitySimple(Node eq,
if (ArithMSum::isolate(uv, msum, veqc, slv, EQUAL) != 0)
{
Assert(!slv.isNull());
- // currently do not support substitution-with-coefficients
- if (veqc.isNull() && !expr::hasSubterm(slv, uv))
+ // Currently do not support substitution-with-coefficients.
+ // We also ensure types are correct here, which avoids substituting
+ // a term of non-integer type for a variable of integer type.
+ if (veqc.isNull() && !expr::hasSubterm(slv, uv)
+ && slv.getType().isSubtypeOf(uv.getType()))
{
Trace("nl-ext-cm")
<< "check-model-subs : " << uv << " -> " << slv << std::endl;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback