return;
case kind::LAMBDA:
- out << smtKindString(k, d_variant) << " ";
- break;
+ case kind::CHOICE: out << smtKindString(k, d_variant) << " "; break;
// arith theory
case kind::PLUS:
case kind::LAMBDA:
return "lambda";
+ case kind::CHOICE: return "choice";
// arith theory
case kind::PLUS: return "+";
}
//print the model
out << "(model" << endl;
- // print approximations
- if (m.hasApproximations())
- {
- std::vector<std::pair<Expr, Expr> > approx = m.getApproximations();
- for (unsigned i = 0, size = approx.size(); i < size; i++)
- {
- out << "(approximation " << approx[i].second << ")" << std::endl;
- }
- }
+ // don't need to print approximations since they are built into choice
+ // functions in the values of variables.
this->Printer::toStream(out, m);
out << ")" << endl;
//print the heap model, if it exists
|| resultNode.getType().isSubtypeOf(expectedType),
"Run with -t smt for details.");
- // ensure it's a constant
- Assert(resultNode.getKind() == kind::LAMBDA || resultNode.isConst());
+ // Ensure it's a constant, or a lambda (for uninterpreted functions), or
+ // a choice (for approximate values).
+ Assert(resultNode.getKind() == kind::LAMBDA
+ || resultNode.getKind() == kind::CHOICE || resultNode.isConst());
if(options::abstractValues() && resultNode.getType().isArray()) {
resultNode = d_private->mkAbstractValue(resultNode);
d_modelCache[n] = ret;
return ret;
}
+ // it might be approximate
+ std::map<Node, Node>::const_iterator ita = d_approximations.find(n);
+ if (ita != d_approximations.end())
+ {
+ // If the value of n is approximate based on predicate P(n), we return
+ // choice z. P(z).
+ Node v = nm->mkBoundVar(n.getType());
+ Node bvl = nm->mkNode(BOUND_VAR_LIST, v);
+ Node ret = nm->mkNode(CHOICE, bvl, ita->second.substitute(n, v));
+ d_modelCache[n] = ret;
+ return ret;
+ }
// must rewrite the term at this point
ret = Rewriter::rewrite(n);
// return the representative of the term in the equality engine, if it exists
regress0/nl/nta/tan-rewrite.smt2
regress0/nl/real-as-int.smt2
regress0/nl/real-div-ufnra.smt2
+ regress0/nl/sqrt2-value.smt2
regress0/nl/subs0-unsat-confirm.smt2
regress0/nl/very-easy-sat.smt2
regress0/nl/very-simple-unsat.smt2
--- /dev/null
+; SCRUBBER: sed -e 's/choice.*/choice/'
+; EXPECT: sat
+; EXPECT: ((x (choice
+(set-option :produce-models true)
+(set-logic ALL)
+(declare-fun x () Real)
+(assert (= (* x x) 2))
+(check-sat)
+(get-value (x))