// higher-order.
if (tm->isValue(n))
{
- // In rare cases, it could be that multiple terms in the same
- // equivalence class are considered values. We prefer the one that is
- // a "base" model value (e.g. a constant) here. We throw a warning
- // if there are 2 model values in the same equivalence class, and
- // a debug failure if there are 2 base values in the same equivalence
- // class.
+ // In some cases, there can be multiple terms in the same equivalence
+ // class are considered values, e.g., when real algebraic numbers did
+ // not simplify to rational values or real.pi was used as a model
+ // value. We distinguish three kinds of model values: constants,
+ // non-constant base values and non-base values, and we use them in
+ // this order of preference.
+ // We print a trace message if there is more than one model value in
+ // the same equivalence class. We throw a debug failure if there are
+ // at least two base model values in the same equivalence class that
+ // do not compare equal.
bool assignConstRep = false;
bool isBaseValue = tm->isBaseModelValue(n);
if (constRep.isNull())
}
else if (isBaseValue)
{
- Assert(false)
- << "Base model values in the same equivalence class "
- << constRep << " " << n << std::endl;
+ Node isEqual = rewrite(constRep.eqNode(n));
+ if (isEqual.isConst() && isEqual.getConst<bool>())
+ {
+ assignConstRep = n.isConst();
+ }
+ else
+ {
+ Assert(false) << "Distinct base model values in the same "
+ "equivalence class "
+ << constRep << " " << n << std::endl;
+ }
}
}
if (assignConstRep)
regress0/nl/issue8135-icp-candidates.smt2
regress0/nl/issue8161-var-elim.smt2
regress0/nl/issue8226-ran-refinement.smt2
+ regress0/nl/issue8414-ran-rational.smt2
regress0/nl/lazard-spurious-root.smt2
regress0/nl/magnitude-wrong-1020-m.smt2
regress0/nl/mult-po.smt2
--- /dev/null
+; EXPECT: sat
+;; only triggers with UFNRA (instead of QF_UFNRA)
+(set-logic UFNRA)
+(declare-fun r2 () Real)
+(declare-fun r5 () Real)
+(declare-fun r () Real)
+(declare-fun b (Bool) Real)
+(declare-fun u (Real) Real)
+(declare-fun r9 () Real)
+(assert (= r2 (u (+ 0.2 r2))))
+(assert (= (= 0.0 (+ r2 3.2 r)) (= 1.0 (+ (u r5) (- r9 (b (= (* r r5) (+ 3 r))))))))
+(check-sat)