summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-03-31 04:21:12 -0500
committerGitHub <noreply@github.com>2021-03-31 09:21:12 +0000
commitc28829ce6fc9861b8f0e902952c9983bba10820a (patch)
treefa65880901593d7e4673aad596cf790a51943891 /src/theory/quantifiers
parent4e1c3c1c12103ef5d3f2cb3d873247bb66716287 (diff)
Add missing inference ids (#6242)
Towards having complete stats on inference ids for each lemma, fact, and conflict.
Diffstat (limited to 'src/theory/quantifiers')
-rw-r--r--src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp6
-rw-r--r--src/theory/quantifiers/cegqi/ceg_arith_instantiator.h3
-rw-r--r--src/theory/quantifiers/cegqi/ceg_instantiator.cpp18
-rw-r--r--src/theory/quantifiers/cegqi/ceg_instantiator.h8
-rw-r--r--src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp13
-rw-r--r--src/theory/quantifiers/cegqi/inst_strategy_cegqi.h2
-rw-r--r--src/theory/quantifiers/ematching/ho_trigger.cpp3
-rw-r--r--src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp2
-rw-r--r--src/theory/quantifiers/fmf/bounded_integers.cpp4
-rw-r--r--src/theory/quantifiers/quant_split.cpp2
-rw-r--r--src/theory/quantifiers/sygus_inst.cpp2
11 files changed, 23 insertions, 40 deletions
diff --git a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp
index 94c8b87e6..aa5512f5f 100644
--- a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp
+++ b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp
@@ -697,11 +697,7 @@ bool ArithInstantiator::needsPostProcessInstantiationForVariable(
}
bool ArithInstantiator::postProcessInstantiationForVariable(
- CegInstantiator* ci,
- SolvedForm& sf,
- Node pv,
- CegInstEffort effort,
- std::vector<Node>& lemmas)
+ CegInstantiator* ci, SolvedForm& sf, Node pv, CegInstEffort effort)
{
Assert(std::find(sf.d_non_basic.begin(), sf.d_non_basic.end(), pv)
!= sf.d_non_basic.end());
diff --git a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.h b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.h
index 34985cd51..00b23307e 100644
--- a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.h
+++ b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.h
@@ -125,8 +125,7 @@ class ArithInstantiator : public Instantiator
bool postProcessInstantiationForVariable(CegInstantiator* ci,
SolvedForm& sf,
Node pv,
- CegInstEffort effort,
- std::vector<Node>& lemmas) override;
+ CegInstEffort effort) override;
std::string identify() const override { return "Arith"; }
private:
diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
index 38b9c739e..26cb1d53c 100644
--- a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
+++ b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
@@ -562,7 +562,6 @@ bool CegInstantiator::constructInstantiation(SolvedForm& sf, unsigned i)
sf.d_vars.size() > d_input_vars.size() || !d_var_order_index.empty();
std::vector< Instantiator * > pp_inst;
std::map< Instantiator *, Node > pp_inst_to_var;
- std::vector< Node > lemmas;
for( std::map< Node, Instantiator * >::iterator ita = d_active_instantiators.begin(); ita != d_active_instantiators.end(); ++ita ){
if (ita->second->needsPostProcessInstantiationForVariable(
this, sf, ita->first, d_effort))
@@ -577,19 +576,19 @@ bool CegInstantiator::constructInstantiation(SolvedForm& sf, unsigned i)
bool postProcessSuccess = true;
for( std::map< Instantiator *, Node >::iterator itp = pp_inst_to_var.begin(); itp != pp_inst_to_var.end(); ++itp ){
if (!itp->first->postProcessInstantiationForVariable(
- this, sf_tmp, itp->second, d_effort, lemmas))
+ this, sf_tmp, itp->second, d_effort))
{
postProcessSuccess = false;
break;
}
}
if( postProcessSuccess ){
- return doAddInstantiation( sf_tmp.d_vars, sf_tmp.d_subs, lemmas );
+ return doAddInstantiation(sf_tmp.d_vars, sf_tmp.d_subs);
}else{
return false;
}
}else{
- return doAddInstantiation( sf.d_vars, sf.d_subs, lemmas );
+ return doAddInstantiation(sf.d_vars, sf.d_subs);
}
}else{
bool is_sv = false;
@@ -1050,7 +1049,9 @@ bool CegInstantiator::constructInstantiationInc(Node pv,
}
}
-bool CegInstantiator::doAddInstantiation( std::vector< Node >& vars, std::vector< Node >& subs, std::vector< Node >& lemmas ) {
+bool CegInstantiator::doAddInstantiation(std::vector<Node>& vars,
+ std::vector<Node>& subs)
+{
if (vars.size() > d_input_vars.size() || !d_var_order_index.empty())
{
Trace("cegqi-inst-debug") << "Reconstructing instantiations...." << std::endl;
@@ -1082,12 +1083,7 @@ bool CegInstantiator::doAddInstantiation( std::vector< Node >& vars, std::vector
}
}
Trace("cegqi-inst-debug") << "Do the instantiation...." << std::endl;
- bool ret = d_parent->doAddInstantiation(subs);
- for (const Node& l : lemmas)
- {
- d_parent->addPendingLemma(l);
- }
- return ret;
+ return d_parent->doAddInstantiation(subs);
}
bool CegInstantiator::isEligibleForInstantiation(Node n) const
diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.h b/src/theory/quantifiers/cegqi/ceg_instantiator.h
index bca62f2ef..800398fb9 100644
--- a/src/theory/quantifiers/cegqi/ceg_instantiator.h
+++ b/src/theory/quantifiers/cegqi/ceg_instantiator.h
@@ -20,6 +20,7 @@
#include <vector>
#include "expr/node.h"
+#include "theory/inference_id.h"
#include "util/statistics_registry.h"
namespace CVC4 {
@@ -554,9 +555,7 @@ class CegInstantiator {
* It returns true if a successful call to the output channel's
* doAddInstantiation was made.
*/
- bool doAddInstantiation(std::vector<Node>& vars,
- std::vector<Node>& subs,
- std::vector<Node>& lemmas);
+ bool doAddInstantiation(std::vector<Node>& vars, std::vector<Node>& subs);
//------------------------------------ static queries
/** is cbqi sort
@@ -771,8 +770,7 @@ public:
virtual bool postProcessInstantiationForVariable(CegInstantiator* ci,
SolvedForm& sf,
Node pv,
- CegInstEffort effort,
- std::vector<Node>& lemmas)
+ CegInstEffort effort)
{
return true;
}
diff --git a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp
index 19821d347..6390feec0 100644
--- a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp
+++ b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp
@@ -380,7 +380,7 @@ void InstStrategyCegqi::registerCounterexampleLemma(Node q, Node lem)
ce_vars.push_back(d_qreg.getInstantiationConstant(q, i));
}
// send the lemma
- d_qim.lemma(lem, InferenceId::UNKNOWN);
+ d_qim.lemma(lem, InferenceId::QUANTIFIERS_CEGQI_CEX);
// get the preprocessed form of the lemma we just sent
std::vector<Node> skolems;
std::vector<Node> skAsserts;
@@ -394,11 +394,11 @@ void InstStrategyCegqi::registerCounterexampleLemma(Node q, Node lem)
std::vector<Node> auxLems;
CegInstantiator* cinst = getInstantiator(q);
cinst->registerCounterexampleLemma(ppLem, ce_vars, auxLems);
- for (unsigned i = 0, size = auxLems.size(); i < size; i++)
+ for (size_t i = 0, size = auxLems.size(); i < size; i++)
{
Trace("cegqi-debug") << "Auxiliary CE lemma " << i << " : " << auxLems[i]
<< std::endl;
- d_qim.addPendingLemma(auxLems[i], InferenceId::UNKNOWN);
+ d_qim.addPendingLemma(auxLems[i], InferenceId::QUANTIFIERS_CEGQI_CEX_AUX);
}
}
@@ -498,11 +498,6 @@ bool InstStrategyCegqi::doAddInstantiation( std::vector< Node >& subs ) {
return false;
}
-bool InstStrategyCegqi::addPendingLemma(Node lem) const
-{
- return d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
-}
-
CegInstantiator * InstStrategyCegqi::getInstantiator( Node q ) {
std::map<Node, std::unique_ptr<CegInstantiator>>::iterator it =
d_cinst.find(q);
@@ -541,7 +536,7 @@ bool InstStrategyCegqi::processNestedQe(Node q, bool isPreregister)
// add lemmas to process
for (const Node& lem : lems)
{
- d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
+ d_qim.addPendingLemma(lem, InferenceId::QUANTIFIERS_CEGQI_NESTED_QE);
}
// don't need to process this, since it has been reduced
return true;
diff --git a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h
index 6db755246..db3997865 100644
--- a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h
+++ b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h
@@ -123,8 +123,6 @@ class InstStrategyCegqi : public QuantifiersModule
//------------------- interface for CegqiOutputInstStrategy
/** Instantiate the current quantified formula forall x. Q with x -> subs. */
bool doAddInstantiation(std::vector<Node>& subs);
- /** Add pending lemma lem via the inference manager of this class. */
- bool addPendingLemma(Node lem) const;
//------------------- end interface for CegqiOutputInstStrategy
protected:
diff --git a/src/theory/quantifiers/ematching/ho_trigger.cpp b/src/theory/quantifiers/ematching/ho_trigger.cpp
index a2885cdec..f197e50ee 100644
--- a/src/theory/quantifiers/ematching/ho_trigger.cpp
+++ b/src/theory/quantifiers/ematching/ho_trigger.cpp
@@ -505,7 +505,8 @@ uint64_t HigherOrderTrigger::addHoTypeMatchPredicateLemmas()
{
Node u = tdb->getHoTypeMatchPredicate(tn);
Node au = nm->mkNode(kind::APPLY_UF, u, f);
- if (d_qim.addPendingLemma(au, InferenceId::UNKNOWN))
+ if (d_qim.addPendingLemma(au,
+ InferenceId::QUANTIFIERS_HO_MATCH_PRED))
{
// this forces f to be a first-class member of the quantifier-free
// equality engine, which in turn forces the quantifier-free
diff --git a/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp b/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp
index d489869ae..45d5f13a7 100644
--- a/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp
+++ b/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp
@@ -624,7 +624,7 @@ void InstStrategyAutoGenTriggers::addTrigger( inst::Trigger * tr, Node q ) {
<< "Make partially specified user pattern: " << std::endl;
Trace("auto-gen-trigger-partial") << " " << qq << std::endl;
Node lem = nm->mkNode(OR, q.negate(), qq);
- d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
+ d_qim.addPendingLemma(lem, InferenceId::QUANTIFIERS_PARTIAL_TRIGGER_REDUCE);
return;
}
unsigned tindex;
diff --git a/src/theory/quantifiers/fmf/bounded_integers.cpp b/src/theory/quantifiers/fmf/bounded_integers.cpp
index 8fcbeca4f..9222c4c93 100644
--- a/src/theory/quantifiers/fmf/bounded_integers.cpp
+++ b/src/theory/quantifiers/fmf/bounded_integers.cpp
@@ -296,7 +296,7 @@ void BoundedIntegers::check(Theory::Effort e, QEffort quant_e)
{
Trace("bound-int-lemma")
<< "*** bound int : proxy lemma : " << prangeLem << std::endl;
- d_qim.addPendingLemma(prangeLem, InferenceId::UNKNOWN);
+ d_qim.addPendingLemma(prangeLem, InferenceId::QUANTIFIERS_BINT_PROXY);
addedLemma = true;
}
}
@@ -727,7 +727,7 @@ bool BoundedIntegers::getRsiSubsitution( Node q, Node v, std::vector< Node >& va
nn = nn.substitute( vars.begin(), vars.end(), subs.begin(), subs.end() );
Node lem = NodeManager::currentNM()->mkNode( LEQ, nn, d_range[q][v] );
Trace("bound-int-lemma") << "*** Add lemma to minimize instantiated non-ground term " << lem << std::endl;
- d_qim.lemma(lem, InferenceId::UNKNOWN);
+ d_qim.lemma(lem, InferenceId::QUANTIFIERS_BINT_MIN_NG);
}
return false;
}else{
diff --git a/src/theory/quantifiers/quant_split.cpp b/src/theory/quantifiers/quant_split.cpp
index 23087286b..f9b0a1e80 100644
--- a/src/theory/quantifiers/quant_split.cpp
+++ b/src/theory/quantifiers/quant_split.cpp
@@ -203,7 +203,7 @@ void QuantDSplit::check(Theory::Effort e, QEffort quant_e)
for (const Node& lem : lemmas)
{
Trace("quant-dsplit") << "QuantDSplit lemma : " << lem << std::endl;
- d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
+ d_qim.addPendingLemma(lem, InferenceId::QUANTIFIERS_DSPLIT);
}
Trace("quant-dsplit") << "QuantDSplit::check finished" << std::endl;
}
diff --git a/src/theory/quantifiers/sygus_inst.cpp b/src/theory/quantifiers/sygus_inst.cpp
index 1baf50045..36d2978a5 100644
--- a/src/theory/quantifiers/sygus_inst.cpp
+++ b/src/theory/quantifiers/sygus_inst.cpp
@@ -548,7 +548,7 @@ void SygusInst::addCeLemma(Node q)
if (d_ce_lemma_added.find(q) != d_ce_lemma_added.end()) return;
Node lem = d_ce_lemmas[q];
- d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
+ d_qim.addPendingLemma(lem, InferenceId::QUANTIFIERS_SYQI_CEX);
d_ce_lemma_added.insert(q);
Trace("sygus-inst") << "Add CE Lemma: " << lem << std::endl;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback