summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/cegqi
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-03-26 11:47:22 -0500
committerGitHub <noreply@github.com>2021-03-26 11:47:22 -0500
commit72f70f1573651bcbf5f327c7a3411ece0e607e3f (patch)
treed2e57f33fdbb6a260b0f523aa4cf2b621474e374 /src/theory/quantifiers/cegqi
parentfa6c3db414d27f47e0bee55480df939e78c14eb3 (diff)
Pass term registry to quantifiers modules (#6216)
Diffstat (limited to 'src/theory/quantifiers/cegqi')
-rw-r--r--src/theory/quantifiers/cegqi/ceg_instantiator.cpp2
-rw-r--r--src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp22
-rw-r--r--src/theory/quantifiers/cegqi/inst_strategy_cegqi.h3
3 files changed, 17 insertions, 10 deletions
diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
index d3bc788cd..ca9599ba3 100644
--- a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
+++ b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
@@ -26,7 +26,7 @@
#include "theory/quantifiers/cegqi/inst_strategy_cegqi.h"
#include "theory/quantifiers/first_order_model.h"
#include "theory/quantifiers/quantifiers_attributes.h"
-#include "theory/quantifiers/quantifiers_rewriter.h"
+#include "theory/quantifiers/quantifiers_state.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
diff --git a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp
index 2c0fba7a6..99df6cf13 100644
--- a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp
+++ b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp
@@ -24,6 +24,7 @@
#include "theory/quantifiers/quantifiers_attributes.h"
#include "theory/quantifiers/quantifiers_rewriter.h"
#include "theory/quantifiers/term_database.h"
+#include "theory/quantifiers/term_registry.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
#include "theory/rewriter.h"
@@ -52,8 +53,9 @@ TrustNode InstRewriterCegqi::rewriteInstantiation(Node q,
InstStrategyCegqi::InstStrategyCegqi(QuantifiersEngine* qe,
QuantifiersState& qs,
QuantifiersInferenceManager& qim,
- QuantifiersRegistry& qr)
- : QuantifiersModule(qs, qim, qr, qe),
+ QuantifiersRegistry& qr,
+ TermRegistry& tr)
+ : QuantifiersModule(qs, qim, qr, tr, qe),
d_irew(new InstRewriterCegqi(this)),
d_cbqi_set_quant_inactive(false),
d_incomplete_check(false),
@@ -84,10 +86,10 @@ bool InstStrategyCegqi::needsCheck(Theory::Effort e)
QuantifiersModule::QEffort InstStrategyCegqi::needsModel(Theory::Effort e)
{
- size_t nquant = d_quantEngine->getModel()->getNumAssertedQuantifiers();
+ size_t nquant = d_treg.getModel()->getNumAssertedQuantifiers();
for (size_t i = 0; i < nquant; i++)
{
- Node q = d_quantEngine->getModel()->getAssertedQuantifier( i );
+ Node q = d_treg.getModel()->getAssertedQuantifier(i);
if (doCbqi(q))
{
return QEFFORT_STANDARD;
@@ -193,11 +195,15 @@ void InstStrategyCegqi::reset_round(Theory::Effort effort)
d_incomplete_check = false;
d_active_quant.clear();
//check if any cbqi lemma has not been added yet
- for( unsigned i=0; i<d_quantEngine->getModel()->getNumAssertedQuantifiers(); i++ ){
- Node q = d_quantEngine->getModel()->getAssertedQuantifier( i );
+ FirstOrderModel* fm = d_treg.getModel();
+ size_t nquant = fm->getNumAssertedQuantifiers();
+ for (size_t i = 0; i < nquant; i++)
+ {
+ Node q = fm->getAssertedQuantifier(i);
//it is not active if it corresponds to a rewrite rule: we will process in rewrite engine
if( doCbqi( q ) ){
- if( d_quantEngine->getModel()->isQuantifierActive( q ) ){
+ if (fm->isQuantifierActive(q))
+ {
d_active_quant[q] = true;
Debug("cegqi-debug") << "Check quantified formula " << q << "..." << std::endl;
Node cel = getCounterexampleLiteral(q);
@@ -211,7 +217,7 @@ void InstStrategyCegqi::reset_round(Theory::Effort effort)
Trace("cegqi-warn") << "CBQI WARNING: Bad decision on CE Literal." << std::endl;
}else{
Trace("cegqi") << "Inactive : " << q << std::endl;
- d_quantEngine->getModel()->setQuantifierActive( q, false );
+ fm->setQuantifierActive(q, false);
d_cbqi_set_quant_inactive = true;
d_active_quant.erase( q );
}
diff --git a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h
index 92b9506e7..6db755246 100644
--- a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h
+++ b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h
@@ -71,7 +71,8 @@ class InstStrategyCegqi : public QuantifiersModule
InstStrategyCegqi(QuantifiersEngine* qe,
QuantifiersState& qs,
QuantifiersInferenceManager& qim,
- QuantifiersRegistry& qr);
+ QuantifiersRegistry& qr,
+ TermRegistry& tr);
~InstStrategyCegqi();
/** whether to do counterexample-guided instantiation for quantifier q */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback