summaryrefslogtreecommitdiff
path: root/src/theory/theory_model_builder.cpp
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2019-04-01 15:07:05 -0700
committerGitHub <noreply@github.com>2019-04-01 15:07:05 -0700
commit8a9ffdbb248ddcc6a41f628f6dcbc070b57e6a28 (patch)
treebf9e85f9950c2c52f7795bdebdfd0183f114060d /src/theory/theory_model_builder.cpp
parent41355e412a142809f63a1939a4515486ccd4c6fb (diff)
FP: Fix wrong model due to partial assignment (#2910)
For a simple query `(not (= (fp.isSubnormal x) false))`, we were getting a wrong model. The issue was that `(sign x)` was not assigned a value and did not appear in the shared terms. In `TheoryFp::collectModelInfo()`, however, we generate an expression that connects the components of `x` to `x`, which contains `(sign x)`. As a result, the normalization while building a model did not result in a constant. This commit fixes the issue by marking `(sign x)` (and `(significand x)`) as assignable. Assignable terms can take any value while building a model if there is no existing value.
Diffstat (limited to 'src/theory/theory_model_builder.cpp')
-rw-r--r--src/theory/theory_model_builder.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/theory/theory_model_builder.cpp b/src/theory/theory_model_builder.cpp
index 77cdfb79b..102979056 100644
--- a/src/theory/theory_model_builder.cpp
+++ b/src/theory/theory_model_builder.cpp
@@ -47,6 +47,14 @@ bool TheoryEngineModelBuilder::isAssignable(TNode n)
return !n.getType().isFunction();
}
}
+ else if (n.getKind() == kind::FLOATINGPOINT_COMPONENT_SIGN)
+ {
+ // Extracting the sign of a floating-point number acts similar to a
+ // selector on a datatype, i.e. if `(sign x)` wasn't assigned a value, we
+ // can pick an arbitrary one. Note that the other components of a
+ // floating-point number should always be assigned a value.
+ return true;
+ }
else
{
// non-function variables, and fully applied functions
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback