throw(TypeCheckingException);
/**
- * pre-skolemize quantifiers
+ * Simplify node "in" by expanding definitions and applying any
+ * substitutions learned from preprocessing.
+ */
+ Node simplify(TNode in) {
+ // Substitute out any abstract values in ex.
+ // Expand definitions.
+ hash_map<Node, Node, NodeHashFunction> cache;
+ Node n = expandDefinitions(in, cache).toExpr();
+ // Make sure we've done all preprocessing, etc.
+ Assert(d_assertionsToCheck.size() == 0 && d_assertionsToPreprocess.size() == 0);
+ return applySubstitutions(n).toExpr();
+ }
+
+ /**
+ * Pre-skolemize quantifiers.
*/
Node preSkolemizeQuantifiers(Node n, bool polarity, std::vector<Node>& fvs);
Dump("benchmark") << SimplifyCommand(ex);
}
- // Substitute out any abstract values in ex.
Expr e = d_private->substituteAbstractValues(Node::fromExpr(ex)).toExpr();
if( options::typeChecking() ) {
e.getType(true);// ensure expr is type-checked at this point
}
- // Expand definitions.
- hash_map<Node, Node, NodeHashFunction> cache;
- e = d_private->expandDefinitions(Node::fromExpr(e), cache).toExpr();
- // Make sure we've done simple preprocessing, unit detection, etc.
- Trace("smt") << "SmtEngine::check(): processing assertions" << endl;
+
+ // Make sure all preprocessing is done
d_private->processAssertions();
- return d_private->applySubstitutions(e).toExpr();
+ return d_private->simplify(Node::fromExpr(e)).toExpr();
}
Expr SmtEngine::expandDefinitions(const Expr& ex) throw(TypeCheckingException) {
Notice() << "SmtEngine::checkModel(): -- substitutes to " << n << endl;
// Simplify the result.
- n = Node::fromExpr(simplify(n.toExpr()));
+ n = d_private->simplify(n);
Notice() << "SmtEngine::checkModel(): -- simplifies to " << n << endl;
TheoryId thy = Theory::theoryOf(n);
--- /dev/null
+; same as bug421.smt2 but adds --check-models on command line:
+; this actually caused the same bug for a different reason, so
+; we check them both independently in regressions
+;
+; COMMAND-LINE: --incremental --abstract-values --check-models
+; EXPECT: sat
+; EXPECT: ((a @1) (b @2))
+; EXIT: 10
+(set-logic QF_AUFLIA)
+(set-option :produce-models true)
+(declare-fun a () (Array Int Int))
+(declare-fun b () (Array Int Int))
+(assert (not (= a b)))
+(check-sat)
+(get-value (a b))