// Expand, then normalize
hash_map<Node, Node, NodeHashFunction> cache;
n = d_private->expandDefinitions(n, cache);
- n = d_private->rewriteBooleanTerms(n);
- n = Rewriter::rewrite(n);
+ // There are two ways model values for terms are computed (for historical
+ // reasons). One way is that used in check-model; the other is that
+ // used by the Model classes. It's not clear to me exactly how these
+ // two are different, but they need to be unified. This ugly hack here
+ // is to fix bug 554 until we can revamp boolean-terms and models [MGD]
+ if(!n.getType().isFunction()) {
+ n = d_private->rewriteBooleanTerms(n);
+ n = Rewriter::rewrite(n);
+ }
Trace("smt") << "--- getting value of " << n << endl;
TheoryModel* m = d_theoryEngine->getModel();