This completes eliminating dependencies on quantifiers engine from internal quantifiers code. It eliminates quantifiers_engine.h as an include from src/theory/quantifiers/ apart from theory_quantifiers.cpp where it is owned.
Followup PRs will further eliminate circular dependencies that arose will refactoring quantifiers engine.
#include "theory/quantifiers/alpha_equivalence.h"
-#include "theory/quantifiers_engine.h"
-
using namespace CVC4::kind;
namespace CVC4 {
return ret;
}
-AlphaEquivalence::AlphaEquivalence(QuantifiersEngine* qe)
- : d_termCanon(), d_aedb(&d_termCanon)
-{
-}
+AlphaEquivalence::AlphaEquivalence() : d_termCanon(), d_aedb(&d_termCanon) {}
Node AlphaEquivalence::reduceQuantifier(Node q)
{
class AlphaEquivalence
{
public:
- AlphaEquivalence(QuantifiersEngine* qe);
+ AlphaEquivalence();
~AlphaEquivalence(){}
/** reduce quantifier
*
#include "theory/arith/theory_arith.h"
#include "theory/arith/theory_arith_private.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
#include "theory/rewriter.h"
#include "util/random.h"
#include "options/quantifiers_options.h"
#include "theory/bv/theory_bv_utils.h"
#include "theory/quantifiers/cegqi/ceg_bv_instantiator_utils.h"
-#include "theory/quantifiers_engine.h"
#include "theory/rewriter.h"
#include "util/bitvector.h"
#include "util/random.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
#include "theory/rewriter.h"
-#include "theory/theory_engine.h"
using namespace std;
using namespace CVC4::kind;
return d_parent->rewriteInstantiation(q, terms, inst, doVts);
}
-InstStrategyCegqi::InstStrategyCegqi(QuantifiersEngine* qe,
- QuantifiersState& qs,
+InstStrategyCegqi::InstStrategyCegqi(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr)
- : QuantifiersModule(qs, qim, qr, tr, qe),
+ : QuantifiersModule(qs, qim, qr, tr),
d_irew(new InstRewriterCegqi(this)),
d_cbqi_set_quant_inactive(false),
d_incomplete_check(false),
typedef context::CDHashMap< Node, int, NodeHashFunction> NodeIntMap;
public:
- InstStrategyCegqi(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ InstStrategyCegqi(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr);
**/
#include "theory/quantifiers/conjecture_generator.h"
+
#include "expr/term_canonize.h"
#include "options/quantifiers_options.h"
#include "theory/quantifiers/ematching/trigger_term_info.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_enumeration.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
#include "theory/rewriter.h"
#include "util/random.h"
}
}
-ConjectureGenerator::ConjectureGenerator(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ConjectureGenerator::ConjectureGenerator(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr)
- : QuantifiersModule(qs, qim, qr, tr, qe),
+ : QuantifiersModule(qs, qim, qr, tr),
d_notify(*this),
d_uequalityEngine(
d_notify, qs.getSatContext(), "ConjectureGenerator::ee", false),
unsigned flushWaitingConjectures( unsigned& addedLemmas, int ldepth, int rdepth );
public:
- ConjectureGenerator(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ ConjectureGenerator(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr);
#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/uf/theory_uf_rewriter.h"
#include "util/hash.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_registry.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
using namespace CVC4::kind;
#include "theory/quantifiers/quantifiers_state.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
#include "theory/uf/equality_engine_iterator.h"
using namespace CVC4::kind;
#include "theory/quantifiers/ematching/inst_match_generator_multi_linear.h"
#include "options/quantifiers_options.h"
-#include "theory/quantifiers_engine.h"
#include "theory/quantifiers/ematching/trigger_trie.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers/quantifiers_attributes.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
using namespace CVC4::kind;
using namespace CVC4::context;
namespace theory {
namespace quantifiers {
-InstantiationEngine::InstantiationEngine(QuantifiersEngine* qe,
- QuantifiersState& qs,
+InstantiationEngine::InstantiationEngine(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr)
- : QuantifiersModule(qs, qim, qr, tr, qe),
+ : QuantifiersModule(qs, qim, qr, tr),
d_instStrategies(),
d_isup(),
d_i_ag(),
// collect all active quantified formulas belonging to this
bool quantActive = false;
d_quants.clear();
- FirstOrderModel* m = d_quantEngine->getModel();
+ FirstOrderModel* m = d_treg.getModel();
size_t nquant = m->getNumAssertedQuantifiers();
for (size_t i = 0; i < nquant; i++)
{
class InstantiationEngine : public QuantifiersModule {
public:
- InstantiationEngine(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ InstantiationEngine(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr);
#include "theory/quantifiers/ematching/var_match_generator.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
#include "theory/rewriter.h"
using namespace CVC4::kind;
#include "theory/quantifiers/fmf/model_engine.h"
#include "theory/quantifiers/term_enumeration.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/theory_engine.h"
+#include "theory/rewriter.h"
using namespace CVC4;
using namespace std;
return lem;
}
-BoundedIntegers::BoundedIntegers(QuantifiersEngine* qe,
- QuantifiersState& qs,
+BoundedIntegers::BoundedIntegers(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr)
- : QuantifiersModule(qs, qim, qr, tr, qe)
+ : QuantifiersModule(qs, qim, qr, tr)
{
}
std::map< Node, std::map< Node, BoundInstTrie > > d_bnd_it;
public:
- BoundedIntegers(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ BoundedIntegers(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr);
#include "theory/quantifiers/fmf/bounded_integers.h"
#include "theory/quantifiers/instantiate.h"
#include "theory/quantifiers/quant_rep_bound_ext.h"
+#include "theory/quantifiers/quantifiers_inference_manager.h"
#include "theory/quantifiers/quantifiers_registry.h"
#include "theory/quantifiers/quantifiers_state.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
#include "theory/rewriter.h"
using namespace CVC4::kind;
#include "theory/quantifiers/instantiate.h"
#include "theory/quantifiers/quant_rep_bound_ext.h"
#include "theory/quantifiers/quantifiers_state.h"
-#include "theory/quantifiers_engine.h"
-#include "theory/uf/equality_engine.h"
using namespace std;
using namespace CVC4;
#include "theory/quantifiers/quant_rep_bound_ext.h"
#include "theory/quantifiers/quantifiers_attributes.h"
#include "theory/quantifiers/term_database.h"
-#include "theory/quantifiers_engine.h"
using namespace CVC4::kind;
using namespace CVC4::context;
namespace quantifiers {
//Model Engine constructor
-ModelEngine::ModelEngine(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ModelEngine::ModelEngine(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
- TermRegistry& tr)
- : QuantifiersModule(qs, qim, qr, tr, qe),
+ TermRegistry& tr,
+ QModelBuilder* builder)
+ : QuantifiersModule(qs, qim, qr, tr),
d_incomplete_check(true),
d_addedLemmas(0),
d_triedLemmas(0),
- d_totalLemmas(0)
+ d_totalLemmas(0),
+ d_builder(builder)
{
}
}
int ModelEngine::checkModel(){
- FirstOrderModel* fm = d_quantEngine->getModel();
+ FirstOrderModel* fm = d_treg.getModel();
//for debugging, setup
for (std::map<TypeNode, std::vector<Node> >::iterator it =
void ModelEngine::exhaustiveInstantiate( Node f, int effort ){
//first check if the builder can do the exhaustive instantiation
- quantifiers::QModelBuilder * mb = d_quantEngine->getModelBuilder();
- unsigned prev_alem = mb->getNumAddedLemmas();
- unsigned prev_tlem = mb->getNumTriedLemmas();
- FirstOrderModel* fm = d_quantEngine->getModel();
- int retEi = mb->doExhaustiveInstantiation(fm, f, effort);
+ unsigned prev_alem = d_builder->getNumAddedLemmas();
+ unsigned prev_tlem = d_builder->getNumTriedLemmas();
+ FirstOrderModel* fm = d_treg.getModel();
+ int retEi = d_builder->doExhaustiveInstantiation(fm, f, effort);
if( retEi!=0 ){
if( retEi<0 ){
Trace("fmf-exh-inst") << "-> Builder determined complete instantiation was impossible." << std::endl;
}else{
Trace("fmf-exh-inst") << "-> Builder determined instantiation(s)." << std::endl;
}
- d_triedLemmas += mb->getNumTriedLemmas()-prev_tlem;
- d_addedLemmas += mb->getNumAddedLemmas()-prev_alem;
+ d_triedLemmas += d_builder->getNumTriedLemmas() - prev_tlem;
+ d_addedLemmas += d_builder->getNumAddedLemmas() - prev_alem;
}else{
if( Trace.isOn("fmf-exh-inst-debug") ){
Trace("fmf-exh-inst-debug") << " Instantiation Constants: ";
}
void ModelEngine::debugPrint( const char* c ){
- Trace( c ) << "Quantifiers: " << std::endl;
- for( unsigned i=0; i<d_quantEngine->getModel()->getNumAssertedQuantifiers(); i++ ){
- Node q = d_quantEngine->getModel()->getAssertedQuantifier( i );
- if (d_qreg.hasOwnership(q, this))
+ if (Trace.isOn(c))
+ {
+ Trace(c) << "Quantifiers: " << std::endl;
+ FirstOrderModel* m = d_treg.getModel();
+ for (size_t i = 0, nquant = m->getNumAssertedQuantifiers(); i < nquant; i++)
{
- Trace( c ) << " ";
- if( !d_quantEngine->getModel()->isQuantifierActive( q ) ){
- Trace( c ) << "*Inactive* ";
- }else{
- Trace( c ) << " ";
+ Node q = m->getAssertedQuantifier(i);
+ if (d_qreg.hasOwnership(q, this))
+ {
+ Trace(c) << " ";
+ if (!m->isQuantifierActive(q))
+ {
+ Trace(c) << "*Inactive* ";
+ }
+ else
+ {
+ Trace(c) << " ";
+ }
+ Trace(c) << q << std::endl;
}
- Trace( c ) << q << std::endl;
}
}
- //d_quantEngine->getModel()->debugPrint( c );
}
} // namespace quantifiers
int d_triedLemmas;
int d_totalLemmas;
public:
- ModelEngine(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ ModelEngine(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
- TermRegistry& tr);
+ TermRegistry& tr,
+ QModelBuilder* builder);
virtual ~ModelEngine();
public:
void debugPrint(const char* c);
/** Identify this module */
std::string identify() const override { return "ModelEngine"; }
+
+private:
+ /** Pointer to the model builder of quantifiers engine */
+ QModelBuilder* d_builder;
};/* class ModelEngine */
}/* CVC4::theory::quantifiers namespace */
#include "theory/quantifiers/inst_match.h"
-#include "theory/quantifiers/instantiate.h"
#include "theory/quantifiers/quantifiers_state.h"
-#include "theory/quantifiers/term_database.h"
-#include "theory/quantifiers_engine.h"
namespace CVC4 {
namespace theory {
Assert(i < d_vals.size());
d_vals[i] = n;
}
-bool InstMatch::set(quantifiers::QuantifiersState& qs, size_t i, TNode n)
+bool InstMatch::set(QuantifiersState& qs, size_t i, TNode n)
{
Assert(i < d_vals.size());
if( !d_vals[i].isNull() ){
* This method returns true if the i^th field was previously uninitialized,
* or is equivalent to n modulo the equalities given by q.
*/
- bool set(quantifiers::QuantifiersState& qs, size_t i, TNode n);
+ bool set(QuantifiersState& qs, size_t i, TNode n);
};
inline std::ostream& operator<<(std::ostream& out, const InstMatch& m) {
#include "theory/quantifiers/quant_util.h"
#include "theory/quantifiers/quantifiers_state.h"
#include "theory/quantifiers/term_database.h"
-#include "theory/quantifiers_engine.h"
#include "theory/uf/equality_engine_iterator.h"
using namespace CVC4::context;
namespace theory {
namespace quantifiers {
-InstStrategyEnum::InstStrategyEnum(QuantifiersEngine* qe,
- QuantifiersState& qs,
+InstStrategyEnum::InstStrategyEnum(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr,
RelevantDomain* rd)
- : QuantifiersModule(qs, qim, qr, tr, qe), d_rd(rd), d_fullSaturateLimit(-1)
+ : QuantifiersModule(qs, qim, qr, tr), d_rd(rd), d_fullSaturateLimit(-1)
{
}
void InstStrategyEnum::presolve()
class InstStrategyEnum : public QuantifiersModule
{
public:
- InstStrategyEnum(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ InstStrategyEnum(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr,
#include "theory/quantifiers/term_enumeration.h"
#include "theory/quantifiers/term_registry.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
#include "theory/rewriter.h"
using namespace CVC4::kind;
#include "theory/quantifiers/quant_util.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
#include "theory/rewriter.h"
using namespace CVC4::kind;
return true;
}
-QuantConflictFind::QuantConflictFind(QuantifiersEngine* qe,
- QuantifiersState& qs,
+QuantConflictFind::QuantConflictFind(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr)
- : QuantifiersModule(qs, qim, qr, tr, qe),
+ : QuantifiersModule(qs, qim, qr, tr),
d_conflict(qs.getSatContext(), false),
d_true(NodeManager::currentNM()->mkConst<bool>(true)),
d_false(NodeManager::currentNM()->mkConst<bool>(false)),
Trace("qcf-debug") << std::endl;
}
bool isConflict = false;
- FirstOrderModel* fm = d_quantEngine->getModel();
+ FirstOrderModel* fm = d_treg.getModel();
unsigned nquant = fm->getNumAssertedQuantifiers();
// for each effort level (find conflict, find propagating)
for (unsigned e = QcfEffortStart(), end = QcfEffortEnd(); e <= end; ++e)
// checked first on the next round. This is an optimization to
// ensure that quantified formulas that are more likely to have
// conflicting instances are checked earlier.
- d_quantEngine->markRelevant(q);
+ d_treg.getModel()->markRelevant(q);
if (options::qcfAllConflict())
{
isConflict = true;
}
else if (d_effort == EFFORT_PROP_EQ)
{
- d_quantEngine->markRelevant(q);
+ d_treg.getModel()->markRelevant(q);
}
}
// clean up assigned
bool areMatchDisequal( TNode n1, TNode n2 );
public:
- QuantConflictFind(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ QuantConflictFind(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr);
quantifiers::QuantifiersState& qs,
quantifiers::QuantifiersInferenceManager& qim,
quantifiers::QuantifiersRegistry& qr,
- quantifiers::TermRegistry& tr,
- QuantifiersEngine* qe)
- : d_quantEngine(qe), d_qstate(qs), d_qim(qim), d_qreg(qr), d_treg(tr)
+ quantifiers::TermRegistry& tr)
+ : d_qstate(qs), d_qim(qim), d_qreg(qr), d_treg(tr)
{
}
return d_qstate.getRepresentative(n);
}
-QuantifiersEngine* QuantifiersModule::getQuantifiersEngine() const
-{
- return d_quantEngine;
-}
-
quantifiers::TermDb* QuantifiersModule::getTermDatabase() const
{
return d_treg.getTermDatabase();
namespace CVC4 {
namespace theory {
-
-class QuantifiersEngine;
-
namespace quantifiers {
class TermDb;
} // namespace quantifiers
QuantifiersModule(quantifiers::QuantifiersState& qs,
quantifiers::QuantifiersInferenceManager& qim,
quantifiers::QuantifiersRegistry& qr,
- quantifiers::TermRegistry& tr,
- QuantifiersEngine* qe);
+ quantifiers::TermRegistry& tr);
virtual ~QuantifiersModule() {}
/** Presolve.
*
*
* Whether this module needs a model built during a
* call to QuantifiersEngine::check(e)
- * It returns one of QEFFORT_* from quantifiers_engine.h,
+ * It returns one of QEFFORT_* from the enumeration above.
* which specifies the quantifiers effort in which it requires the model to
* be built.
*/
bool areDisequal(TNode n1, TNode n2) const;
/** get the representative of n in the current used equality engine */
TNode getRepresentative(TNode n) const;
- /** get quantifiers engine that owns this module */
- QuantifiersEngine* getQuantifiersEngine() const;
/** get currently used term database */
quantifiers::TermDb* getTermDatabase() const;
/** get the quantifiers state */
quantifiers::QuantifiersRegistry& getQuantifiersRegistry();
//----------------------------end general queries
protected:
- /** pointer to the quantifiers engine that owns this module */
- QuantifiersEngine* d_quantEngine;
/** Reference to the state of the quantifiers engine */
quantifiers::QuantifiersState& d_qstate;
/** Reference to the quantifiers inference manager */
#include "theory/quantifiers/first_order_model.h"
#include "theory/quantifiers/quant_bound_inference.h"
-#include "theory/quantifiers_engine.h"
using namespace CVC4::kind;
#include "expr/dtype.h"
#include "expr/dtype_cons.h"
#include "theory/quantifiers/term_database.h"
-#include "theory/quantifiers_engine.h"
#include "theory/quantifiers/first_order_model.h"
#include "options/quantifiers_options.h"
-using namespace std;
-using namespace CVC4;
using namespace CVC4::kind;
-using namespace CVC4::context;
-using namespace CVC4::theory;
-using namespace CVC4::theory::quantifiers;
-QuantDSplit::QuantDSplit(QuantifiersEngine* qe,
- QuantifiersState& qs,
+namespace CVC4 {
+namespace theory {
+namespace quantifiers {
+
+QuantDSplit::QuantDSplit(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr)
- : QuantifiersModule(qs, qim, qr, tr, qe), d_added_split(qs.getUserContext())
+ : QuantifiersModule(qs, qim, qr, tr), d_added_split(qs.getUserContext())
{
}
}
Trace("quant-dsplit") << "QuantDSplit::check" << std::endl;
NodeManager* nm = NodeManager::currentNM();
- FirstOrderModel* m = d_quantEngine->getModel();
+ FirstOrderModel* m = d_treg.getModel();
std::vector<Node> lemmas;
for (std::map<Node, int>::iterator it = d_quant_to_reduce.begin();
it != d_quant_to_reduce.end();
Trace("quant-dsplit") << "QuantDSplit::check finished" << std::endl;
}
+} // namespace quantifiers
+} // namespace theory
+} // namespace CVC4
typedef context::CDHashSet<Node, NodeHashFunction> NodeSet;
public:
- QuantDSplit(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ QuantDSplit(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr);
#include "options/quantifiers_options.h"
#include "theory/quantifiers/relevant_domain.h"
#include "theory/quantifiers/term_registry.h"
-#include "theory/quantifiers_engine.h"
namespace CVC4 {
namespace theory {
{
}
QuantifiersModules::~QuantifiersModules() {}
-void QuantifiersModules::initialize(QuantifiersEngine* qe,
- QuantifiersState& qs,
+void QuantifiersModules::initialize(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr,
// add quantifiers modules
if (options::quantConflictFind())
{
- d_qcf.reset(new QuantConflictFind(qe, qs, qim, qr, tr));
+ d_qcf.reset(new QuantConflictFind(qs, qim, qr, tr));
modules.push_back(d_qcf.get());
}
if (options::conjectureGen())
{
- d_sg_gen.reset(new ConjectureGenerator(qe, qs, qim, qr, tr));
+ d_sg_gen.reset(new ConjectureGenerator(qs, qim, qr, tr));
modules.push_back(d_sg_gen.get());
}
if (!options::finiteModelFind() || options::fmfInstEngine())
{
- d_inst_engine.reset(new InstantiationEngine(qe, qs, qim, qr, tr));
+ d_inst_engine.reset(new InstantiationEngine(qs, qim, qr, tr));
modules.push_back(d_inst_engine.get());
}
if (options::cegqi())
{
- d_i_cbqi.reset(new InstStrategyCegqi(qe, qs, qim, qr, tr));
+ d_i_cbqi.reset(new InstStrategyCegqi(qs, qim, qr, tr));
modules.push_back(d_i_cbqi.get());
qim.getInstantiate()->addRewriter(d_i_cbqi->getInstRewriter());
}
if (options::sygus())
{
- d_synth_e.reset(new SynthEngine(qe, qs, qim, qr, tr));
+ d_synth_e.reset(new SynthEngine(qs, qim, qr, tr));
modules.push_back(d_synth_e.get());
}
// finite model finding
if (options::fmfBound())
{
- d_bint.reset(new BoundedIntegers(qe, qs, qim, qr, tr));
+ d_bint.reset(new BoundedIntegers(qs, qim, qr, tr));
modules.push_back(d_bint.get());
}
if (options::finiteModelFind() || options::fmfBound())
{
- d_model_engine.reset(new ModelEngine(qe, qs, qim, qr, tr));
- modules.push_back(d_model_engine.get());
Trace("quant-init-debug")
<< "Initialize model engine, mbqi : " << options::mbqiMode() << " "
<< options::fmfBound() << std::endl;
<< "...make default model builder." << std::endl;
d_builder.reset(new QModelBuilder(qs, qr, qim));
}
+ d_model_engine.reset(new ModelEngine(qs, qim, qr, tr, d_builder.get()));
+ modules.push_back(d_model_engine.get());
}
if (options::quantDynamicSplit() != options::QuantDSplitMode::NONE)
{
- d_qsplit.reset(new QuantDSplit(qe, qs, qim, qr, tr));
+ d_qsplit.reset(new QuantDSplit(qs, qim, qr, tr));
modules.push_back(d_qsplit.get());
}
if (options::quantAlphaEquiv())
{
- d_alpha_equiv.reset(new AlphaEquivalence(qe));
+ d_alpha_equiv.reset(new AlphaEquivalence());
}
// full saturation : instantiate from relevant domain, then arbitrary terms
if (options::fullSaturateQuant() || options::fullSaturateInterleave())
{
d_rel_dom.reset(new RelevantDomain(qs, qr, tr));
- d_fs.reset(new InstStrategyEnum(qe, qs, qim, qr, tr, d_rel_dom.get()));
+ d_fs.reset(new InstStrategyEnum(qs, qim, qr, tr, d_rel_dom.get()));
modules.push_back(d_fs.get());
}
if (options::sygusInst())
{
- d_sygus_inst.reset(new SygusInst(qe, qs, qim, qr, tr));
+ d_sygus_inst.reset(new SygusInst(qs, qim, qr, tr));
modules.push_back(d_sygus_inst.get());
}
}
* This constructs the above modules based on the current options. It adds
* a pointer to each module it constructs to modules.
*/
- void initialize(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ void initialize(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr,
#include "expr/dtype.h"
#include "expr/dtype_cons.h"
+#include "expr/proof.h"
+#include "expr/proof_node_manager.h"
#include "expr/skolem_manager.h"
#include "options/quantifiers_options.h"
#include "options/smt_options.h"
#include "theory/quantifiers/quantifiers_attributes.h"
#include "theory/quantifiers/quantifiers_state.h"
#include "theory/quantifiers/term_util.h"
+#include "theory/rewriter.h"
#include "theory/sort_inference.h"
-#include "theory/theory_engine.h"
using namespace CVC4::kind;
**/
#include "theory/quantifiers/sygus/cegis.h"
+
#include "expr/node_algorithm.h"
#include "options/base_options.h"
#include "options/quantifiers_options.h"
#include "theory/quantifiers/sygus/example_min_eval.h"
#include "theory/quantifiers/sygus/synth_conjecture.h"
#include "theory/quantifiers/sygus/term_database_sygus.h"
-#include "theory/quantifiers_engine.h"
#include "theory/rewriter.h"
using namespace std;
#include "theory/quantifiers/sygus/ce_guided_single_inv.h"
#include "theory/quantifiers/sygus/transition_inference.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
#include "theory/rewriter.h"
#include "theory/smt_engine_subsolver.h"
#include "util/random.h"
#include "theory/quantifiers/sygus/cegis_unif.h"
#include "expr/sygus_datatype.h"
-#include "options/base_options.h"
#include "options/quantifiers_options.h"
#include "printer/printer.h"
#include "theory/quantifiers/sygus/sygus_unif_rl.h"
#include "theory/quantifiers/sygus/synth_conjecture.h"
#include "theory/quantifiers/sygus/term_database_sygus.h"
-#include "theory/quantifiers_engine.h"
using namespace CVC4::kind;
#include "theory/quantifiers/sygus/sygus_module.h"
-#include "theory/quantifiers_engine.h"
-
namespace CVC4 {
namespace theory {
namespace quantifiers {
#include "theory/quantifiers/sygus/term_database_sygus.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
#include "util/random.h"
using namespace std;
#include "theory/quantifiers/term_registry.h"
using namespace CVC4::kind;
-using namespace std;
namespace CVC4 {
namespace theory {
namespace quantifiers {
-SynthEngine::SynthEngine(QuantifiersEngine* qe,
- QuantifiersState& qs,
+SynthEngine::SynthEngine(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr)
- : QuantifiersModule(qs, qim, qr, tr, qe), d_conj(nullptr), d_sqp()
+ : QuantifiersModule(qs, qim, qr, tr), d_conj(nullptr), d_sqp()
{
d_conjs.push_back(std::unique_ptr<SynthConjecture>(
new SynthConjecture(qs, qim, qr, tr, d_statistics)));
typedef context::CDHashMap<Node, bool, NodeHashFunction> NodeBoolMap;
public:
- SynthEngine(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ SynthEngine(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr);
#include "theory/quantifiers/sygus/sygus_grammar_cons.h"
#include "theory/quantifiers/sygus/synth_engine.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
#include "theory/rewriter.h"
namespace CVC4 {
} // namespace
-SygusInst::SygusInst(QuantifiersEngine* qe,
- QuantifiersState& qs,
+SygusInst::SygusInst(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr)
- : QuantifiersModule(qs, qim, qr, tr, qe),
+ : QuantifiersModule(qs, qim, qr, tr),
d_ce_lemma_added(qs.getUserContext()),
d_global_terms(qs.getUserContext()),
d_notified_assertions(qs.getUserContext())
class SygusInst : public QuantifiersModule
{
public:
- SygusInst(QuantifiersEngine* qe,
- QuantifiersState& qs,
+ SygusInst(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr);
#include "theory/quantifiers/quantifiers_registry.h"
#include "theory/quantifiers/quantifiers_state.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
-#include "theory/theory_engine.h"
+#include "theory/rewriter.h"
+#include "theory/uf/equality_engine.h"
using namespace CVC4::kind;
using namespace CVC4::context;
#include "theory/quantifiers/relevant_domain.h"
#include "theory/quantifiers/term_registry.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers_engine.h"
#include "util/statistics_registry.h"
namespace CVC4 {
#include "theory/quantifiers/term_util.h"
#include "expr/node_algorithm.h"
-#include "options/base_options.h"
-#include "options/datatypes_options.h"
-#include "options/quantifiers_options.h"
-#include "options/uf_options.h"
#include "theory/arith/arith_msum.h"
#include "theory/bv/theory_bv_utils.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_enumeration.h"
-#include "theory/quantifiers_engine.h"
#include "theory/strings/word.h"
#include "theory/rewriter.h"
d_te = te;
// Initialize the modules and the utilities here.
d_qmodules.reset(new quantifiers::QuantifiersModules);
- d_qmodules->initialize(this, d_qstate, d_qim, d_qreg, d_treg, d_modules);
+ d_qmodules->initialize(d_qstate, d_qim, d_qreg, d_treg, d_modules);
if (d_qmodules->d_rel_dom.get())
{
d_util.push_back(d_qmodules->d_rel_dom.get());
d_qreg.getQuantifiersBoundInference().finishInit(d_qmodules->d_bint.get());
}
-quantifiers::QuantifiersState& QuantifiersEngine::getState()
-{
- return d_qstate;
-}
-quantifiers::QuantifiersInferenceManager&
-QuantifiersEngine::getInferenceManager()
-{
- return d_qim;
-}
-
quantifiers::QuantifiersRegistry& QuantifiersEngine::getQuantifiersRegistry()
{
return d_qreg;
}
-quantifiers::TermRegistry& QuantifiersEngine::getTermRegistry()
-{
- return d_treg;
-}
quantifiers::QModelBuilder* QuantifiersEngine::getModelBuilder() const
{
{
return d_treg.getTermDatabaseSygus();
}
-
-quantifiers::TermDb* QuantifiersEngine::getTermDatabase() const
-{
- return d_treg.getTermDatabase();
-}
/// !!!!!!!!!!!!!!
void QuantifiersEngine::presolve() {
quantifiers::QuantifiersInferenceManager& qim,
ProofNodeManager* pnm);
~QuantifiersEngine();
- //---------------------- external interface
- /** The quantifiers state object */
- quantifiers::QuantifiersState& getState();
- /** The quantifiers inference manager */
- quantifiers::QuantifiersInferenceManager& getInferenceManager();
/** The quantifiers registry */
quantifiers::QuantifiersRegistry& getQuantifiersRegistry();
- /** The term registry */
- quantifiers::TermRegistry& getTermRegistry();
- //---------------------- end external interface
//---------------------- utilities
/** get the model builder */
quantifiers::QModelBuilder* getModelBuilder() const;
- /** get term database */
- quantifiers::TermDb* getTermDatabase() const;
/** get model */
quantifiers::FirstOrderModel* getModel() const;
/** get term database sygus */
* The modules utility, which contains all of the quantifiers modules.
*/
std::unique_ptr<quantifiers::QuantifiersModules> d_qmodules;
- //------------- end temporary information during check
- private:
/** list of all quantifiers seen */
std::map<Node, bool> d_quants;
/** quantifiers pre-registered */