summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/ematching/instantiation_engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/theory/quantifiers/ematching/instantiation_engine.cpp')
-rw-r--r--src/theory/quantifiers/ematching/instantiation_engine.cpp60
1 files changed, 38 insertions, 22 deletions
diff --git a/src/theory/quantifiers/ematching/instantiation_engine.cpp b/src/theory/quantifiers/ematching/instantiation_engine.cpp
index d2650f01f..2fe28fc61 100644
--- a/src/theory/quantifiers/ematching/instantiation_engine.cpp
+++ b/src/theory/quantifiers/ematching/instantiation_engine.cpp
@@ -15,11 +15,12 @@
#include "theory/quantifiers/ematching/instantiation_engine.h"
#include "options/quantifiers_options.h"
-#include "theory/quantifiers/first_order_model.h"
#include "theory/quantifiers/ematching/inst_strategy_e_matching.h"
+#include "theory/quantifiers/ematching/trigger.h"
+#include "theory/quantifiers/first_order_model.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers/ematching/trigger.h"
+#include "theory/quantifiers_engine.h"
#include "theory/theory_engine.h"
using namespace std;
@@ -35,7 +36,13 @@ InstantiationEngine::InstantiationEngine(QuantifiersEngine* qe)
d_instStrategies(),
d_isup(),
d_i_ag(),
- d_quants() {
+ d_quants(),
+ d_quant_rel(nullptr)
+{
+ if (options::relevantTriggers())
+ {
+ d_quant_rel.reset(new quantifiers::QuantRelevance);
+ }
if (options::eMatching()) {
// these are the instantiation strategies for E-matching
// user-provided patterns
@@ -45,7 +52,8 @@ InstantiationEngine::InstantiationEngine(QuantifiersEngine* qe)
}
// auto-generated patterns
- d_i_ag.reset(new InstStrategyAutoGenTriggers(d_quantEngine));
+ d_i_ag.reset(
+ new InstStrategyAutoGenTriggers(d_quantEngine, d_quant_rel.get()));
d_instStrategies.push_back(d_i_ag.get());
}
}
@@ -174,24 +182,32 @@ void InstantiationEngine::checkOwnership(Node q)
}
}
-void InstantiationEngine::registerQuantifier( Node f ){
- if( d_quantEngine->hasOwnership( f, this ) ){
- //for( unsigned i=0; i<d_instStrategies.size(); ++i ){
- // d_instStrategies[i]->registerQuantifier( f );
- //}
- //take into account user patterns
- if( f.getNumChildren()==3 ){
- Node subsPat =
- d_quantEngine->getTermUtil()->substituteBoundVariablesToInstConstants(
- f[2], f);
- //add patterns
- for( int i=0; i<(int)subsPat.getNumChildren(); i++ ){
- //Notice() << "Add pattern " << subsPat[i] << " for " << f << std::endl;
- if( subsPat[i].getKind()==INST_PATTERN ){
- addUserPattern( f, subsPat[i] );
- }else if( subsPat[i].getKind()==INST_NO_PATTERN ){
- addUserNoPattern( f, subsPat[i] );
- }
+void InstantiationEngine::registerQuantifier(Node q)
+{
+ if (!d_quantEngine->hasOwnership(q, this))
+ {
+ return;
+ }
+ if (d_quant_rel)
+ {
+ d_quant_rel->registerQuantifier(q);
+ }
+ // take into account user patterns
+ if (q.getNumChildren() == 3)
+ {
+ Node subsPat =
+ d_quantEngine->getTermUtil()->substituteBoundVariablesToInstConstants(
+ q[2], q);
+ // add patterns
+ for (const Node& p : subsPat)
+ {
+ if (p.getKind() == INST_PATTERN)
+ {
+ addUserPattern(q, p);
+ }
+ else if (p.getKind() == INST_NO_PATTERN)
+ {
+ addUserNoPattern(q, p);
}
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback