summaryrefslogtreecommitdiff
path: root/src/theory/arith
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-03-10 10:56:58 -0500
committerGitHub <noreply@github.com>2020-03-10 08:56:58 -0700
commit54eb1c069f0a86b157945d95eb0ae0999d8470fd (patch)
treef062eb87026b52315d8b7867a5d7a503e1b05b0d /src/theory/arith
parentf57c7cb845c7d1f8730e1b3ecfa4d1c030b980ac (diff)
Do not set values for non-linear mult terms in collectModelInfo (#3983)
Fixes #3803. When non-linear arithmetic determines there is a model, then it should not send model values for multiplication terms that the linear solver assigned when abstracting (non-linear) multiplication. This avoids conflicts if the non-linear solver changed a value for a variable occurring in a non-linear monomial. This avoids check-model failures.
Diffstat (limited to 'src/theory/arith')
-rw-r--r--src/theory/arith/nl_model.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/theory/arith/nl_model.cpp b/src/theory/arith/nl_model.cpp
index 904300004..abb2a7921 100644
--- a/src/theory/arith/nl_model.cpp
+++ b/src/theory/arith/nl_model.cpp
@@ -1277,11 +1277,12 @@ void NlModel::getModelValueRepair(
std::map<Node, Node>& arithModel,
std::map<Node, std::pair<Node, Node>>& approximations)
{
+ Trace("nl-model") << "NlModel::getModelValueRepair:" << std::endl;
+
// Record the approximations we used. This code calls the
// recordApproximation method of the model, which overrides the model
// values for variables that we solved for, using techniques specific to
// this class.
- Trace("nl-model") << "NlModel::getModelValueRepair:" << std::endl;
NodeManager* nm = NodeManager::currentNM();
for (const std::pair<const Node, std::pair<Node, Node> >& cb :
d_check_model_bounds)
@@ -1324,6 +1325,21 @@ void NlModel::getModelValueRepair(
arithModel[v] = s;
Trace("nl-model") << v << " solved is " << s << std::endl;
}
+
+ // multiplication terms should not be given values; their values are
+ // implied by the monomials that they consist of
+ std::vector<Node> amErase;
+ for (const std::pair<const Node, Node>& am : arithModel)
+ {
+ if (am.first.getKind() == NONLINEAR_MULT)
+ {
+ amErase.push_back(am.first);
+ }
+ }
+ for (const Node& ae : amErase)
+ {
+ arithModel.erase(ae);
+ }
}
} // namespace arith
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback