/**
* Expand definitions in n.
*/
- Node expandDefinitions(TNode n, hash_map<TNode, Node, TNodeHashFunction>& cache)
+ Node expandDefinitions(TNode n, hash_map<Node, Node, NodeHashFunction>& cache)
throw(TypeCheckingException, AssertionException);
};/* class SmtEnginePrivate */
d_definedFunctions->insert(funcNode, def);
}
-Node SmtEnginePrivate::expandDefinitions(TNode n, hash_map<TNode, Node, TNodeHashFunction>& cache)
+Node SmtEnginePrivate::expandDefinitions(TNode n, hash_map<Node, Node, NodeHashFunction>& cache)
throw(TypeCheckingException, AssertionException) {
if(n.getKind() != kind::APPLY && n.getNumChildren() == 0) {
}
// maybe it's in the cache
- hash_map<TNode, Node, TNodeHashFunction>::iterator cacheHit = cache.find(n);
+ hash_map<Node, Node, NodeHashFunction>::iterator cacheHit = cache.find(n);
if(cacheHit != cache.end()) {
TNode ret = (*cacheHit).second;
return ret.isNull() ? n : ret;
// d_assertionsToPreprocess, but we don't need to reprocess those.
// We also can't use an iterator, because the vector may be moved in
// memory during this loop.
+ Chat() << "constraining subtypes..." << endl;
for(unsigned i = 0, i_end = d_assertionsToPreprocess.size(); i != i_end; ++i) {
constrainSubtypes(d_assertionsToPreprocess[i], d_assertionsToPreprocess);
}
Debug("smt") << " d_assertionsToCheck : " << d_assertionsToCheck.size() << endl;
if(!options::lazyDefinitionExpansion()) {
+ Chat() << "expanding definitions..." << endl;
Trace("simplify") << "SmtEnginePrivate::simplify(): expanding definitions" << endl;
TimerStat::CodeTimer codeTimer(d_smt.d_definitionExpansionTime);
- hash_map<TNode, Node, TNodeHashFunction> cache;
+ hash_map<Node, Node, NodeHashFunction> cache;
for (unsigned i = 0; i < d_assertionsToPreprocess.size(); ++ i) {
d_assertionsToPreprocess[i] =
expandDefinitions(d_assertionsToPreprocess[i], cache);
}
// Apply the substitutions we already have, and normalize
+ Chat() << "applying substitutions..." << endl;
Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): "
<< "applying substitutions" << endl;
for (unsigned i = 0; i < d_assertionsToPreprocess.size(); ++ i) {
Trace("simplify") << " got " << d_assertionsToPreprocess[i] << endl;
}
+ Chat() << "simplifying assertions..." << endl;
bool noConflict = simplifyAssertions();
if(options::doStaticLearning()) {
// Perform static learning
+ Chat() << "doing static learning..." << endl;
Trace("simplify") << "SmtEnginePrivate::simplify(): "
<< "performing static learning" << endl;
staticLearning();
}
{
+ Chat() << "removing term ITEs..." << endl;
TimerStat::CodeTimer codeTimer(d_smt.d_iteRemovalTime);
// Remove ITEs, updating d_iteSkolemMap
d_smt.d_numAssertionsPre += d_assertionsToCheck.size();
if(options::repeatSimp()) {
d_assertionsToCheck.swap(d_assertionsToPreprocess);
+ Chat() << "simplifying assertions..." << endl;
noConflict &= simplifyAssertions();
if (noConflict) {
// Some skolem variables may have been solved for - which is a good thing -
Debug("smt") << " d_assertionsToCheck : " << d_assertionsToCheck.size() << endl;
{
+ Chat() << "theory preprocessing..." << endl;
TimerStat::CodeTimer codeTimer(d_smt.d_theoryPreprocessTime);
// Call the theory preprocessors
d_smt.d_theoryEngine->preprocessStart();
// Push the formula to decision engine
if(noConflict) {
+ Chat() << "pushing to decision engine..." << endl;
Assert(iteRewriteAssertionsEnd == d_assertionsToCheck.size());
d_smt.d_decisionEngine->addAssertions
(d_assertionsToCheck, d_realAssertionsEnd, d_iteSkolemMap);
// Push the formula to SAT
{
+ Chat() << "converting to CNF..." << endl;
TimerStat::CodeTimer codeTimer(d_smt.d_cnfConversionTime);
for (unsigned i = 0; i < d_assertionsToCheck.size(); ++ i) {
d_smt.d_propEngine->assertFormula(d_assertionsToCheck[i]);
Notice() << "SmtEngine::checkModel(): checking assertion " << *i << endl;
Node n = Node::fromExpr(*i);
+ // Apply any define-funs from the problem.
+ {
+ hash_map<Node, Node, NodeHashFunction> cache;
+ n = d_private->expandDefinitions(n, cache);
+ }
+
// Apply our model value substitutions.
n = substitutions.apply(n);
Notice() << "SmtEngine::checkModel(): -- substitutes to " << n << endl;
SmtScope smts(this);
Expr::dag::Scope scope(out, false);
Printer::getPrinter(options::outputLanguage())->toStream( out, m );
- //m->toStream(out);
}
void SmtEngine::setUserAttribute( std::string& attr, Expr expr ){