This should be the last PR before quantifiers engine will not be passed to quantifiers modules.
#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"
#include "theory/theory_engine.h"
CegInstantiator::CegInstantiator(Node q,
QuantifiersState& qs,
+ TermRegistry& tr,
InstStrategyCegqi* parent)
: d_quant(q),
d_qstate(qs),
+ d_treg(tr),
d_parent(parent),
- d_qe(parent->getQuantifiersEngine()),
d_is_nested_quant(false),
d_effort(CEG_INST_EFFORT_NONE)
{
}
Node CegInstantiator::getModelValue( Node n ) {
- return d_qe->getModel()->getValue( n );
+ return d_treg.getModel()->getValue(n);
}
Node CegInstantiator::getBoundVariable(TypeNode tn)
namespace CVC4 {
namespace theory {
-
-class QuantifiersEngine;
-
namespace quantifiers {
class Instantiator;
class InstantiatorPreprocess;
class InstStrategyCegqi;
class QuantifiersState;
+class TermRegistry;
/**
* Descriptions of the types of constraints that a term was solved for in.
* The instantiator will be constructing instantiations for quantified formula
* q, parent is the owner of this object.
*/
- CegInstantiator(Node q, QuantifiersState& qs, InstStrategyCegqi* parent);
+ CegInstantiator(Node q,
+ QuantifiersState& qs,
+ TermRegistry& tr,
+ InstStrategyCegqi* parent);
virtual ~CegInstantiator();
/** check
* This adds instantiations based on the state of d_vars in current context
std::vector<Node>& ce_vars,
std::vector<Node>& auxLems);
//------------------------------interface for instantiators
- /** get quantifiers engine */
- QuantifiersEngine* getQuantifiersEngine() { return d_qe; }
/** push stack variable
* This adds a new variable to solve for in the stack
* of variables we are processing. This stack is only
* instantiation, specified by sf.
*
* This function returns true if a call to
- * QuantifiersEngine::addInstantiation(...)
+ * Instantiate::addInstantiation(...)
* was successfully made in a recursive call.
*
* The solved form sf is reverted to its original state if
Node d_quant;
/** Reference to the quantifiers state */
QuantifiersState& d_qstate;
+ /** Reference to the term registry */
+ TermRegistry& d_treg;
/** The parent of this instantiator */
InstStrategyCegqi* d_parent;
- /** quantified formula associated with this instantiator */
- QuantifiersEngine* d_qe;
//-------------------------------globally cached
/** cache from nodes to the set of variables it contains
#include "expr/node_algorithm.h"
#include "options/quantifiers_options.h"
-#include "theory/arith/partial_model.h"
-#include "theory/arith/theory_arith.h"
-#include "theory/arith/theory_arith_private.h"
#include "theory/quantifiers/first_order_model.h"
#include "theory/quantifiers/instantiate.h"
#include "theory/quantifiers/quantifiers_attributes.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"
using namespace std;
std::map<Node, std::unique_ptr<CegInstantiator>>::iterator it =
d_cinst.find(q);
if( it==d_cinst.end() ){
- d_cinst[q].reset(new CegInstantiator(q, d_qstate, this));
+ d_cinst[q].reset(new CegInstantiator(q, d_qstate, d_treg, this));
return d_cinst[q].get();
}
return it->second.get();
namespace CVC4 {
namespace theory {
-
-class QuantifiersEngine;
-
namespace quantifiers {
+
class QuantifiersState;
class TermRegistry;
// full saturation : instantiate from relevant domain, then arbitrary terms
if (options::fullSaturateQuant() || options::fullSaturateInterleave())
{
- d_rel_dom.reset(new RelevantDomain(qe, qr));
+ d_rel_dom.reset(new RelevantDomain(qs, qr, tr));
d_fs.reset(new InstStrategyEnum(qe, qs, qim, qr, tr, d_rel_dom.get()));
modules.push_back(d_fs.get());
}
#include "theory/quantifiers/quantifiers_registry.h"
#include "theory/quantifiers/quantifiers_state.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;
}
}
-RelevantDomain::RelevantDomain(QuantifiersEngine* qe, QuantifiersRegistry& qr)
- : d_qe(qe), d_qreg(qr)
+RelevantDomain::RelevantDomain(QuantifiersState& qs,
+ QuantifiersRegistry& qr,
+ TermRegistry& tr)
+ : d_qs(qs), d_qreg(qr), d_treg(tr)
{
d_is_computed = false;
}
it2->second->reset();
}
}
- FirstOrderModel* fm = d_qe->getModel();
+ FirstOrderModel* fm = d_treg.getModel();
for( unsigned i=0; i<fm->getNumAssertedQuantifiers(); i++ ){
Node q = fm->getAssertedQuantifier( i );
Node icf = d_qreg.getInstConstantBody(q);
}
Trace("rel-dom-debug") << "account for ground terms" << std::endl;
- TermDb * db = d_qe->getTermDatabase();
+ TermDb* db = d_treg.getTermDatabase();
for (unsigned k = 0; k < db->getNumOperators(); k++)
{
Node op = db->getOperator(k);
RDomain * r = it2->second;
RDomain * rp = r->getParent();
if( r==rp ){
- r->removeRedundantTerms(d_qe->getState());
+ r->removeRedundantTerms(d_qs);
for( unsigned i=0; i<r->d_terms.size(); i++ ){
Trace("rel-dom") << r->d_terms[i] << " ";
}
void RelevantDomain::computeRelevantDomain( Node q, Node n, bool hasPol, bool pol ) {
Trace("rel-dom-debug") << "Compute relevant domain " << n << "..." << std::endl;
- Node op = d_qe->getTermDatabase()->getMatchOperator( n );
+ Node op = d_treg.getTermDatabase()->getMatchOperator(n);
for( unsigned i=0; i<n.getNumChildren(); i++ ){
if( !op.isNull() ){
RDomain * rf = getRDomain( op, i );
namespace theory {
namespace quantifiers {
+class QuantifiersState;
class QuantifiersRegistry;
+class TermRegistry;
/** Relevant Domain
*
class RelevantDomain : public QuantifiersUtil
{
public:
- RelevantDomain(QuantifiersEngine* qe, QuantifiersRegistry& qr);
+ RelevantDomain(QuantifiersState& qs,
+ QuantifiersRegistry& qr,
+ TermRegistry& tr);
virtual ~RelevantDomain();
/** Reset. */
bool reset(Theory::Effort e) override;
* each relevant domain object.
*/
std::map< RDomain *, int > d_ri_map;
- /** Quantifiers engine associated with this utility. */
- QuantifiersEngine* d_qe;
- /** The quantifiers registry */
+ /** Reference to the quantifiers state object */
+ QuantifiersState& d_qs;
+ /** Reference to the quantifiers registry */
QuantifiersRegistry& d_qreg;
+ /** Reference to the term registry */
+ TermRegistry& d_treg;
/** have we computed the relevant domain on this full effort check? */
bool d_is_computed;
/** relevant domain literal
namespace CVC4 {
namespace theory {
-
-class QuantifiersEngine;
-
namespace quantifiers {
/** This file contains techniques that compute
namespace theory {
namespace quantifiers {
-SygusQePreproc::SygusQePreproc(QuantifiersEngine* qe) {}
+SygusQePreproc::SygusQePreproc() {}
Node SygusQePreproc::preprocess(Node q)
{
namespace CVC4 {
namespace theory {
-
-class QuantifiersEngine;
-
namespace quantifiers {
/**
class SygusQePreproc
{
public:
- SygusQePreproc(QuantifiersEngine* qe);
+ SygusQePreproc();
~SygusQePreproc() {}
/**
* Preprocess. Returns a lemma of the form q = nq where nq is obtained
* by the quantifier elimination technique outlined above.
*/
Node preprocess(Node q);
-
- private:
- /** Pointer to quantifiers engine */
- QuantifiersEngine* d_quantEngine;
};
} // namespace quantifiers
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr)
- : QuantifiersModule(qs, qim, qr, tr, qe),
- d_conj(nullptr),
- d_sqp(qe)
+ : QuantifiersModule(qs, qim, qr, tr, qe), d_conj(nullptr), d_sqp()
{
d_conjs.push_back(std::unique_ptr<SynthConjecture>(
new SynthConjecture(qs, qim, qr, tr, d_statistics)));
namespace CVC4 {
namespace theory {
-
-class QuantifiersEngine;
-
namespace quantifiers {
class QuantifiersState;
* lazily for performance reasons.
*/
class TermDb : public QuantifiersUtil {
- friend class ::CVC4::theory::QuantifiersEngine;
using NodeBoolMap = context::CDHashMap<Node, bool, NodeHashFunction>;
using NodeList = context::CDList<Node>;
using NodeSet = context::CDHashSet<Node, NodeHashFunction>;