namespace cvc5 {
namespace theory {
+SubstitutionMap::SubstitutionMap(context::Context* context)
+ : d_context(),
+ d_substitutions(context ? context : &d_context),
+ d_substitutionCache(),
+ d_cacheInvalidated(false),
+ d_cacheInvalidator(context ? context : &d_context, d_cacheInvalidated)
+{
+}
+
struct substitution_stack_element {
TNode d_node;
bool d_children_added;
continue;
}
- if (!d_substituteUnderQuantifiers && current.isClosure())
- {
- Debug("substitution::internal") << "--not substituting under quantifier" << endl;
- cache[current] = current;
- toVisit.pop_back();
- continue;
- }
-
NodeMap::iterator find2 = d_substitutions.find(current);
if (find2 != d_substitutions.end()) {
Node rhs = (*find2).second;
private:
typedef std::unordered_map<Node, Node, NodeHashFunction> NodeCache;
+ /** A dummy context used by this class if none is provided */
+ context::Context d_context;
/** The variables, in order of addition */
NodeMap d_substitutions;
/** Cache of the already performed substitutions */
NodeCache d_substitutionCache;
- /** Whether or not to substitute under quantifiers */
- bool d_substituteUnderQuantifiers;
-
/** Has the cache been invalidated? */
bool d_cacheInvalidated;
*/
CacheInvalidator d_cacheInvalidator;
-public:
- SubstitutionMap(context::Context* context,
- bool substituteUnderQuantifiers = true)
- : d_substitutions(context),
- d_substitutionCache(),
- d_substituteUnderQuantifiers(substituteUnderQuantifiers),
- d_cacheInvalidated(false),
- d_cacheInvalidator(context, d_cacheInvalidated)
- {
- }
+ public:
+ SubstitutionMap(context::Context* context = nullptr);
/**
* Adds a substitution from x to t.
std::string name,
bool enableFuncModels)
: d_name(name),
- d_substitutions(c, false),
+ d_substitutions(c),
d_equalityEngine(nullptr),
d_using_model_core(false),
d_enableFuncModels(enableFuncModels)