Fixes #8182.
return bounds;
}
+bool SineSolver::hasExactModelValue(TNode n) const
+{
+ Assert(n.getKind() == SINE);
+ Node mv = d_data->d_model.computeAbstractModelValue(n[0]);
+ return d_mpointsSine.find(mv) != d_mpointsSine.end();
+}
+
} // namespace transcendental
} // namespace nl
} // namespace arith
unsigned actual_d,
int region);
+ /**
+ * Does n of the form sin(x) have an exact model value? This is true if
+ * the model value of x is in the domain of d_mpointsSine.
+ */
+ bool hasExactModelValue(TNode n) const;
+
private:
std::pair<Node, Node> getSecantBounds(TNode e,
TNode c,
std::unordered_map<Node, Node> trReps;
for (const Node& n : termSet)
{
- if (isTranscendentalKind(n.getKind()))
+ Kind k = n.getKind();
+ if (!isTranscendentalKind(n.getKind()))
{
- Node r = d_astate.getRepresentative(n);
- trReps[r] = n;
+ continue;
+ }
+ // it might have an exact value, in which case there is nothing to do
+ if (k == SINE && d_sineSlv.hasExactModelValue(n))
+ {
+ continue;
}
+ Node r = d_astate.getRepresentative(n);
+ trReps[r] = n;
}
if (trReps.empty())
{
regress0/nl/nta/issue7938-tf-model.smt2
regress0/nl/nta/issue8147-unc-model.smt2
regress0/nl/nta/issue8160-model-purify.smt2
+ regress0/nl/nta/issue8182-exact-mv-keep.smt2
+ regress0/nl/nta/issue8182-2-exact-mv-keep.smt2
regress0/nl/nta/proj-issue460-pi-value.smt2
regress0/nl/nta/real-pi.smt2
regress0/nl/nta/sin-sym.smt2
--- /dev/null
+; COMMAND-LINE: -q
+; EXPECT: sat
+(set-logic ALL)
+(set-info :status sat)
+(declare-fun a () Real)
+(declare-fun b () Real)
+(assert (= a (* b (+ (sin a) (/ 1 a)))))
+(check-sat)
--- /dev/null
+; COMMAND-LINE: -q
+; EXPECT: sat
+(set-logic ALL)
+(declare-fun v () Real)
+(assert (forall ((V Real)) (> 0 (/ 0.0 v))))
+(assert (= 0.0 (* (sin v) (sin 1.0))))
+(check-sat)