}
if (!finishedComputing)
{
- bool hasOperator = cur.hasOperator();
+ // The only non-constant operators we consider are APPLY_UF and
+ // APPLY_SELECTOR. All other operators are either builtin, or should be
+ // considered constants, e.g. constructors.
+ Kind k = cur.getKind();
+ bool hasOperator = k == kind::APPLY_UF || k == kind::APPLY_SELECTOR;
size_t nextChildIndex = v.second;
if (hasOperator && nextChildIndex > 0)
{
{
Trace("model-builder-debug") << "...try to normalize" << std::endl;
Node normalized = normalize(m, n, true);
+ Trace("model-builder-debug")
+ << "...return " << normalized
+ << ", isValue=" << m->isValue(normalized) << std::endl;
if (m->isValue(normalized))
{
return normalized;
Assert(assertedReps.find(*i) != assertedReps.end());
Node rep = assertedReps[*i];
Node normalized = normalize(tm, rep, false);
- Trace("model-builder") << " Normalizing rep (" << rep
- << "), normalized to (" << normalized << ")"
- << endl;
+ Trace("model-builder")
+ << " Normalizing rep (" << rep << "), normalized to ("
+ << normalized << ")"
+ << ", isValue=" << tm->isValue(normalized) << std::endl;
if (tm->isValue(normalized))
{
changed = true;
{
children.push_back(r.getOperator());
}
- bool childrenConst = true;
- for (size_t i = 0; i < r.getNumChildren(); ++i)
+ for (size_t i = 0, nchild = r.getNumChildren(); i < nchild; ++i)
{
Node ri = r[i];
bool recurse = true;
{
ri = normalize(m, ri, evalOnly);
}
- if (!m->isValue(ri))
- {
- childrenConst = false;
- }
}
children.push_back(ri);
}
retNode = NodeManager::currentNM()->mkNode(r.getKind(), children);
- if (childrenConst)
- {
- retNode = rewrite(retNode);
- }
+ retNode = rewrite(retNode);
}
d_normalizedCache[r] = retNode;
return retNode;
regress0/datatypes/par-updater-type-rule.smt2
regress0/datatypes/parametric-alt-list.cvc.smt2
regress0/datatypes/proj-issue172.smt2
+ regress0/datatypes/proj-issue474-app-cons-value.smt2
regress0/datatypes/rec1.cvc.smt2
regress0/datatypes/rec2.cvc.smt2
regress0/datatypes/rec4.cvc.smt2