summaryrefslogtreecommitdiff
path: root/src/theory/theory_engine.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-02-29 10:28:27 -0600
committerGitHub <noreply@github.com>2020-02-29 10:28:27 -0600
commitee75ebf00e1aa463656cd192e52d3aec224345c0 (patch)
tree5b34e2133c6d19f2264e4994379f5dc81209239e /src/theory/theory_engine.cpp
parent31efb570a9d5811fd88a34d4915d7d08c81d13fa (diff)
Throw warning instead of error for non-constant values in check-model stages (#3844)
Fixes #3729 and fixes #3720. This updates two more stages of check-model (checking whether values assigned to terms are constants and internally checking whether assertions belonging to theories) to only throw warnings when a term/assertion has a non-constant value in the model. This is to accommodate cases where check-model is infeasible.
Diffstat (limited to 'src/theory/theory_engine.cpp')
-rw-r--r--src/theory/theory_engine.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp
index d176b015d..e15641bb4 100644
--- a/src/theory/theory_engine.cpp
+++ b/src/theory/theory_engine.cpp
@@ -2268,14 +2268,26 @@ void TheoryEngine::checkTheoryAssertionsWithModel(bool hardFailure) {
Node val = getModel()->getValue(assertion);
if (val != d_true)
{
+ std::stringstream ss;
+ ss << theoryId
+ << " has an asserted fact that the model doesn't satisfy." << endl
+ << "The fact: " << assertion << endl
+ << "Model value: " << val << endl;
if (hardFailure)
{
- InternalError()
- << theoryId
- << " has an asserted fact that the model doesn't satisfy."
- << endl
- << "The fact: " << assertion << endl
- << "Model value: " << val << endl;
+ if (val == d_false)
+ {
+ // Always an error if it is false
+ InternalError() << ss.str();
+ }
+ else
+ {
+ // Otherwise just a warning. Notice this case may happen for
+ // assertions with unevaluable operators, e.g. transcendental
+ // functions. It also may happen for separation logic, where
+ // check-model support is limited.
+ Warning() << ss.str();
+ }
}
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback