This was an option that rejected instantiations that are true according to the current
model's equality engine.
This option was never helpful and will be burdensome to maintain with new updates
to equality engine infrastructure.
default = "true"
help = "allow theory combination to happen once initially, before quantifier strategies are run"
-[[option]]
- name = "quantModelEe"
- category = "regular"
- long = "quant-model-ee"
- type = "bool"
- default = "false"
- read_only = true
- help = "use equality engine of model for last call effort"
-
[[option]]
name = "instMaxLevel"
category = "regular"
default = "true"
help = "do not consider instances of quantified formulas that are currently entailed"
-[[option]]
- name = "instNoModelTrue"
- category = "regular"
- long = "inst-no-model-true"
- type = "bool"
- default = "false"
- help = "do not consider instances of quantified formulas that are currently true in model, if it is available"
-
[[option]]
name = "qcfEagerTest"
category = "regular"
}
eq::EqualityEngine* EqualityQueryQuantifiersEngine::getEngine(){
- return d_qe->getActiveEqualityEngine();
+ return d_qe->getMasterEqualityEngine();
}
void EqualityQueryQuantifiersEngine::getEquivalenceClass( Node a, std::vector< Node >& eqc ){
// construct the lemma
Trace("inst-assert") << "(assert " << body << ")" << std::endl;
- if (d_qe->usingModelEqualityEngine() && options::instNoModelTrue())
- {
- Node val_body = d_qe->getModel()->getValue(body);
- if (val_body.isConst() && val_body.getConst<bool>())
- {
- Trace("inst-add-debug") << " --> True in model." << std::endl;
- ++(d_statistics.d_inst_duplicate_model_true);
- return false;
- }
- }
-
Node lem = NodeManager::currentNM()->mkNode(kind::OR, q.negate(), body);
lem = Rewriter::rewrite(lem);
: d_instantiations("Instantiate::Instantiations_Total", 0),
d_inst_duplicate("Instantiate::Duplicate_Inst", 0),
d_inst_duplicate_eq("Instantiate::Duplicate_Inst_Eq", 0),
- d_inst_duplicate_ent("Instantiate::Duplicate_Inst_Entailed", 0),
- d_inst_duplicate_model_true("Instantiate::Duplicate_Inst_Model_True", 0)
+ d_inst_duplicate_ent("Instantiate::Duplicate_Inst_Entailed", 0)
{
smtStatisticsRegistry()->registerStat(&d_instantiations);
smtStatisticsRegistry()->registerStat(&d_inst_duplicate);
smtStatisticsRegistry()->registerStat(&d_inst_duplicate_eq);
smtStatisticsRegistry()->registerStat(&d_inst_duplicate_ent);
- smtStatisticsRegistry()->registerStat(&d_inst_duplicate_model_true);
}
Instantiate::Statistics::~Statistics()
smtStatisticsRegistry()->unregisterStat(&d_inst_duplicate);
smtStatisticsRegistry()->unregisterStat(&d_inst_duplicate_eq);
smtStatisticsRegistry()->unregisterStat(&d_inst_duplicate_ent);
- smtStatisticsRegistry()->unregisterStat(&d_inst_duplicate_model_true);
}
} /* CVC4::theory::quantifiers namespace */
IntStat d_inst_duplicate;
IntStat d_inst_duplicate_eq;
IntStat d_inst_duplicate_ent;
- IntStat d_inst_duplicate_model_true;
Statistics();
~Statistics();
}; /* class Instantiate::Statistics */
eq::EqualityEngine* QuantifiersModule::getEqualityEngine() const
{
- return d_quantEngine->getActiveEqualityEngine();
+ return d_quantEngine->getMasterEqualityEngine();
}
bool QuantifiersModule::areEqual(TNode n1, TNode n2) const
void TermDb::computeArgReps( TNode n ) {
if (d_arg_reps.find(n) == d_arg_reps.end())
{
- eq::EqualityEngine * ee = d_quantEngine->getActiveEqualityEngine();
+ eq::EqualityEngine* ee = d_quantEngine->getMasterEqualityEngine();
for (const TNode& nc : n)
{
TNode r = ee->hasTerm(nc) ? ee->getRepresentative(nc) : nc;
{
ops.insert(ops.end(), d_ho_op_slaves[f].begin(), d_ho_op_slaves[f].end());
}
- eq::EqualityEngine* ee = d_quantEngine->getActiveEqualityEngine();
+ eq::EqualityEngine* ee = d_quantEngine->getMasterEqualityEngine();
for (const Node& ff : ops)
{
for (const TNode& n : d_op_map[ff])
unsigned nonCongruentCount = 0;
unsigned alreadyCongruentCount = 0;
unsigned relevantCount = 0;
- eq::EqualityEngine* ee = d_quantEngine->getActiveEqualityEngine();
+ eq::EqualityEngine* ee = d_quantEngine->getMasterEqualityEngine();
NodeManager* nm = NodeManager::currentNM();
for (const Node& ff : ops)
{
f = getOperatorRepresentative( f );
}
computeUfTerms( f );
- Assert(!d_quantEngine->getActiveEqualityEngine()->hasTerm(r)
- || d_quantEngine->getActiveEqualityEngine()->getRepresentative(r)
+ Assert(!d_quantEngine->getMasterEqualityEngine()->hasTerm(r)
+ || d_quantEngine->getMasterEqualityEngine()->getRepresentative(r)
== r);
std::map< Node, std::map< unsigned, std::vector< Node > > >::iterator it = d_func_map_rel_dom.find( f );
if( it != d_func_map_rel_dom.end() ){
bool TermDb::hasTermCurrent( Node n, bool useMode ) {
if( !useMode ){
return d_has_map.find( n )!=d_has_map.end();
- }else{
- //return d_quantEngine->getActiveEqualityEngine()->hasTerm( n ); //some assertions are not sent to EE
- if (options::termDbMode() == options::TermDbMode::ALL)
- {
- return true;
- }
- else if (options::termDbMode() == options::TermDbMode::RELEVANT)
- {
- return d_has_map.find( n )!=d_has_map.end();
- }
- else
- {
- Assert(false);
- return false;
- }
}
+ //some assertions are not sent to EE
+ if (options::termDbMode() == options::TermDbMode::ALL)
+ {
+ return true;
+ }
+ else if (options::termDbMode() == options::TermDbMode::RELEVANT)
+ {
+ return d_has_map.find( n )!=d_has_map.end();
+ }
+ Assert(false) << "TermDb::hasTermCurrent: Unknown termDbMode : " << options::termDbMode();
+ return false;
}
bool TermDb::isTermEligibleForInstantiation(TNode n, TNode f)
std::map< Node, Node >::iterator it = d_term_elig_eqc.find( r );
if( it==d_term_elig_eqc.end() ){
Node h;
- eq::EqualityEngine* ee = d_quantEngine->getActiveEqualityEngine();
+ eq::EqualityEngine* ee = d_quantEngine->getMasterEqualityEngine();
eq::EqClassIterator eqc_i = eq::EqClassIterator( r, ee );
while (!eqc_i.isFinished())
{
d_func_map_rel_dom.clear();
d_consistent_ee = true;
- eq::EqualityEngine* ee = d_quantEngine->getActiveEqualityEngine();
+ eq::EqualityEngine* ee = d_quantEngine->getMasterEqualityEngine();
Assert(ee->consistent());
// if higher-order, add equalities for the purification terms now
d_curr_effort_level = QuantifiersModule::QEFFORT_NONE;
d_conflict = false;
d_hasAddedLemma = false;
- d_useModelEe = false;
//don't add true lemma
d_lemmas_produced_c[d_term_util->d_true] = true;
void QuantifiersEngine::check( Theory::Effort e ){
CodeTimer codeTimer(d_statistics.d_time);
- d_useModelEe = options::quantModelEe() && ( e>=Theory::EFFORT_LAST_CALL );
- // if we want to use the model's equality engine, build the model now
- if( d_useModelEe && !d_model->isBuilt() ){
- Trace("quant-engine-debug") << "Build the model." << std::endl;
- if (!d_te->getModelBuilder()->buildModel(d_model.get()))
- {
- //we are done if model building was unsuccessful
- flushLemmas();
- if( d_hasAddedLemma ){
- Trace("quant-engine-debug") << "...failed." << std::endl;
- return;
- }
- }
- }
-
- if( !getActiveEqualityEngine()->consistent() ){
+
+ if (!getMasterEqualityEngine()->consistent())
+ {
Trace("quant-engine-debug") << "Master equality engine not consistent, return." << std::endl;
return;
}
return d_te->getMasterEqualityEngine();
}
-eq::EqualityEngine* QuantifiersEngine::getActiveEqualityEngine() const
-{
- if( d_useModelEe ){
- return d_model->getEqualityEngine();
- }
- return d_te->getMasterEqualityEngine();
-}
-
Node QuantifiersEngine::getInternalRepresentative( Node a, Node q, int index ){
- bool prevModelEe = d_useModelEe;
- d_useModelEe = false;
- Node ret = d_eq_query->getInternalRepresentative( a, q, index );
- d_useModelEe = prevModelEe;
- return ret;
+ return d_eq_query->getInternalRepresentative(a, q, index);
}
bool QuantifiersEngine::getSynthSolutions(
}
void QuantifiersEngine::debugPrintEqualityEngine( const char * c ) {
- eq::EqualityEngine* ee = getActiveEqualityEngine();
+ eq::EqualityEngine* ee = getMasterEqualityEngine();
eq::EqClassesIterator eqcs_i = eq::EqClassesIterator( ee );
std::map< TypeNode, int > typ_num;
while( !eqcs_i.isFinished() ){
//---------------------- utilities
/** get the master equality engine */
eq::EqualityEngine* getMasterEqualityEngine() const;
- /** get the active equality engine */
- eq::EqualityEngine* getActiveEqualityEngine() const;
/** get equality query */
EqualityQuery* getEqualityQuery() const;
/** get the model builder */
void addTermToDatabase( Node n, bool withinQuant = false, bool withinInstClosure = false );
/** notification when master equality engine is updated */
void eqNotifyNewClass(TNode t);
- /** use model equality engine */
- bool usingModelEqualityEngine() const { return d_useModelEe; }
/** debug print equality engine */
void debugPrintEqualityEngine( const char * c );
/** get internal representative
context::CDO<bool> d_conflict_c;
/** has added lemma this round */
bool d_hasAddedLemma;
- /** whether to use model equality engine */
- bool d_useModelEe;
//------------- end temporary information during check
private:
/** list of all quantifiers seen */