|| resultNode.getType().isSubtypeOf(expectedType))
<< "Run with -t smt for details.";
- // Ensure it's a constant, or a lambda (for uninterpreted functions). This
- // assertion only holds for models that do not have approximate values.
- Assert(m->hasApproximations() || resultNode.getKind() == kind::LAMBDA
- || resultNode.isConst());
+ // Ensure it's a value (constant or const-ish like real algebraic
+ // numbers), or a lambda (for uninterpreted functions). This assertion only
+ // holds for models that do not have approximate values.
+ Assert(m->hasApproximations() || TheoryModel::isValue(resultNode));
if (d_env->getOptions().smt.abstractValues && resultNode.getType().isArray())
{
{
Trace("model-builder-debug") << "...try to normalize" << std::endl;
Node normalized = normalize(m, n, true);
- if (normalized.isConst())
+ if (TheoryModel::isValue(normalized))
{
return normalized;
}
// Members of exclusion set must have values, otherwise we are not yet
// assignable.
Node er = eset[i];
- if (er.isConst())
+ if (TheoryModel::isValue(er))
{
// already processed
continue;
return true;
}
-bool TheoryEngineModelBuilder::isValue(TNode n)
-{
- return n.getKind() == kind::LAMBDA || n.isConst();
-}
-
bool TheoryEngineModelBuilder::isAssignable(TNode n)
{
if (n.getKind() == kind::SELECT || n.getKind() == kind::APPLY_SELECTOR_TOTAL
// applicable. We check if n is a value here, e.g. a term for which
// isConst returns true, or a lambda. The latter is required only for
// higher-order.
- if (isValue(n))
+ if (TheoryModel::isValue(n))
{
Assert(constRep.isNull());
constRep = n;
}
if (!normalized.isNull())
{
- Assert(normalized.isConst());
+ Assert(TheoryModel::isValue(normalized));
typeConstSet.add(tb, normalized);
assignConstantRep(tm, *i2, normalized);
Trace("model-builder") << " Eval: Setting constant rep of "
Trace("model-builder") << " Normalizing rep (" << rep
<< "), normalized to (" << normalized << ")"
<< endl;
- if (normalized.isConst())
+ if (TheoryModel::isValue(normalized))
{
changed = true;
typeConstSet.add(tb, normalized);
{
ri = normalize(m, ri, evalOnly);
}
- if (!ri.isConst())
+ if (!TheoryModel::isValue(ri))
{
childrenConst = false;
}
Node rc = m->getRepresentative(un[j]);
Trace("model-builder-debug2") << " get rep : " << un[j] << " returned "
<< rc << std::endl;
- Assert(rc.isConst());
+ Assert(TheoryModel::isValue(rc));
children.push_back(rc);
}
Node simp = NodeManager::currentNM()->mkNode(un.getKind(), children);