diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-02-26 09:02:15 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 09:02:15 -0600 |
commit | abd0048cdb6cf4d2ee0a096c9f7a63a1f7f1d9c8 (patch) | |
tree | cffa12338950b4d7b5bfc43e78849684b6058e30 /src/theory/arith/nonlinear_extension.cpp | |
parent | 50c31e61ab240ccd551a0aea732f8b9a88d7fb32 (diff) |
Support for witnessing choice in models (#3781)
Fixes #3300.
This adds an option --model-witness-choice that ensures that choices in models are of the form (choice ((x Int)) (or (= x c) P)), which is helpful if the user wants to know a potential value in the range of the choice.
Diffstat (limited to 'src/theory/arith/nonlinear_extension.cpp')
-rw-r--r-- | src/theory/arith/nonlinear_extension.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/theory/arith/nonlinear_extension.cpp b/src/theory/arith/nonlinear_extension.cpp index 6c04268db..acae404ba 100644 --- a/src/theory/arith/nonlinear_extension.cpp +++ b/src/theory/arith/nonlinear_extension.cpp @@ -1304,9 +1304,16 @@ void NonlinearExtension::check(Theory::Effort e) { // Otherwise, we will answer SAT. The values that we approximated are // recorded as approximations here. TheoryModel* tm = d_containing.getValuation().getModel(); - for (std::pair<const Node, Node>& a : d_approximations) + for (std::pair<const Node, std::pair<Node, Node>>& a : d_approximations) { - tm->recordApproximation(a.first, a.second); + if (a.second.second.isNull()) + { + tm->recordApproximation(a.first, a.second.first); + } + else + { + tm->recordApproximation(a.first, a.second.first, a.second.second); + } } } } |