diff options
author | Clark Barrett <barrett@cs.nyu.edu> | 2012-06-04 22:26:40 +0000 |
---|---|---|
committer | Clark Barrett <barrett@cs.nyu.edu> | 2012-06-04 22:26:40 +0000 |
commit | 3609fb41d7744b3a7d74e44f7bedc4d4c522c938 (patch) | |
tree | 011a3fa796fdb98bb3b9a1b425d12c678535f294 /src/theory/substitutions.cpp | |
parent | 468c5bc5d8b63ec6818813270225e09383dd79ff (diff) |
Added preprocessing pass that propagates unconstrained values - solves all of
the unconstrained examples in QF_AUFBV/brummayerbiere3 - should also help
generally on at least BV and maybe others.
Off by default for now - results are mixed and it's hard to evaluate with so
many existing assertion failures and segfaults - will re-evaluate once those
are fixed
Diffstat (limited to 'src/theory/substitutions.cpp')
-rw-r--r-- | src/theory/substitutions.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/theory/substitutions.cpp b/src/theory/substitutions.cpp index caf7566b9..b7ad1d174 100644 --- a/src/theory/substitutions.cpp +++ b/src/theory/substitutions.cpp @@ -71,6 +71,10 @@ Node SubstitutionMap::internalSubstitute(TNode t, NodeCache& substitutionCache) } // Mark the substitution and continue Node result = builder; + find = substitutionCache.find(result); + if (find != substitutionCache.end()) { + result = find->second; + } Debug("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): setting " << current << " -> " << result << std::endl; substitutionCache[current] = result; toVisit.pop_back(); @@ -114,13 +118,16 @@ void SubstitutionMap::addSubstitution(TNode x, TNode t, bool invalidateCache) { d_substitutions[(*it).first] = internalSubstitute((*it).second, tempCache); } - // Put the new substitution in - d_substitutions[x] = t; + // Put the new substitution in, but apply existing substitutions to rhs first + d_substitutions[x] = apply(t); // Also invalidate the cache if (invalidateCache) { d_cacheInvalidated = true; } + else { + d_substitutionCache[x] = d_substitutions[x]; + } } static bool check(TNode node, const SubstitutionMap::NodeMap& substitutions) CVC4_UNUSED; |