d_involvesExt = false;
d_involvesUt = false;
- for (const std::shared_ptr<DTypeConstructor> ctor : d_constructors)
+ for (const std::shared_ptr<DTypeConstructor>& ctor : d_constructors)
{
if (ctor->involvesExternalType())
{
const
{
std::map<Node, std::shared_ptr<ProofNode>> links;
- for (const std::pair<const Node, ProofGenerator*>& link : d_gens)
+ for (const std::pair<const Node, ProofGenerator* const>& link : d_gens)
{
Assert(link.second);
std::shared_ptr<ProofNode> pfn = link.second->getProofFor(link.first);
std::shared_ptr<ProofNode> pfn = pg->getProofFor(expected);
std::vector<Node> allowedLeaves{assumptions.begin(), assumptions.end()};
// add all current links in the chain
- for (const std::pair<const Node, ProofGenerator*>& link : d_gens)
+ for (const std::pair<const Node, ProofGenerator* const>& link : d_gens)
{
allowedLeaves.push_back(link.first);
}
d_registry->unregisterStat(&d_statTotLiterals);
}
-void MinisatSatSolver::Statistics::init(Minisat::SimpSolver* d_minisat){
- d_statStarts.setData(d_minisat->starts);
- d_statDecisions.setData(d_minisat->decisions);
- d_statRndDecisions.setData(d_minisat->rnd_decisions);
- d_statPropagations.setData(d_minisat->propagations);
- d_statConflicts.setData(d_minisat->conflicts);
- d_statClausesLiterals.setData(d_minisat->clauses_literals);
- d_statLearntsLiterals.setData(d_minisat->learnts_literals);
- d_statMaxLiterals.setData(d_minisat->max_literals);
- d_statTotLiterals.setData(d_minisat->tot_literals);
+void MinisatSatSolver::Statistics::init(Minisat::SimpSolver* minisat){
+ d_statStarts.setData(minisat->starts);
+ d_statDecisions.setData(minisat->decisions);
+ d_statRndDecisions.setData(minisat->rnd_decisions);
+ d_statPropagations.setData(minisat->propagations);
+ d_statConflicts.setData(minisat->conflicts);
+ d_statClausesLiterals.setData(minisat->clauses_literals);
+ d_statLearntsLiterals.setData(minisat->learnts_literals);
+ d_statMaxLiterals.setData(minisat->max_literals);
+ d_statTotLiterals.setData(minisat->tot_literals);
}
} /* namespace CVC4::prop */
assertions.push_back(*i);
}
NodeManager* nm = NodeManager::currentNM();
- for (const std::pair<Node, smt::DefinedFunction>& dfn : df)
+ for (const std::pair<const Node, const smt::DefinedFunction>& dfn : df)
{
Node def = dfn.second.getFormula();
const std::vector<Node>& formals = dfn.second.getFormals();
class Assertions;
class SmtEngineState;
class Preprocessor;
-class SmtEngineStatistics;
+struct SmtEngineStatistics;
/**
* A solver for SMT queries.
{
counters[i] = 0;
}
- for (const std::pair<std::pair<int64_t, int64_t>, uint64_t>& element : table)
+ for (const auto& element : table)
{
uint64_t result = element.second;
counters[result]++;
eq::EqualityEngine* ee)
: d_containing(containing),
d_im(containing.getInferenceManager()),
- d_ee(ee),
d_needsLastCall(false),
d_checkCounter(0),
d_extTheoryCb(ee),
// The theory of arithmetic containing this extension.
TheoryArith& d_containing;
InferenceManager& d_im;
- // pointer to used equality engine
- eq::EqualityEngine* d_ee;
/** The statistics class */
NlStats d_stats;
// needs last call effort
namespace nl {
namespace transcendental {
-namespace {
-
-/**
- * Ensure a is in the main phase:
- * -pi <= a <= pi
- */
-inline Node mkValidPhase(TNode a, TNode pi)
-{
- return mkBounded(
- NodeManager::currentNM()->mkNode(Kind::MULT, mkRationalNode(-1), pi),
- a,
- pi);
-}
-} // namespace
-
TranscendentalState::TranscendentalState(InferenceManager& im, NlModel& model)
: d_im(im), d_model(model)
{
Trace("arrays-crl")<<"Arrays::checkLemmas done.\n";
}
-void TheoryArrays::propagate(RowLemmaType lem)
+void TheoryArrays::propagateRowLemma(RowLemmaType lem)
{
Debug("pf::array") << "TheoryArrays: RowLemma Propagate called. options::arraysPropagate() = "
<< options::arraysPropagate() << std::endl;
// If propagating, check propagations
int prop = options::arraysPropagate();
if (prop > 0) {
- propagate(lem);
+ propagateRowLemma(lem);
}
// Prefer equality between indexes so as not to introduce new read terms
int prop = options::arraysPropagate();
if (prop > 0) {
- propagate(l);
+ propagateRowLemma(l);
if (d_state.isInConflict())
{
return true;
void checkStore(TNode a);
void checkRowForIndex(TNode i, TNode a);
void checkRowLemmas(TNode a, TNode b);
- void propagate(RowLemmaType lem);
+ void propagateRowLemma(RowLemmaType lem);
void queueRowLemma(RowLemmaType lem);
bool dischargeLemmas();
if (all.size() == 1) { return conjunctions[0]; }
NodeBuilder<> conjunction(kind::AND);
- for (const Node& n : all) { conjunction << n; }
+ for (TNode n : all) { conjunction << n; }
return conjunction;
}
if (all.size() == 1) { return nodes[0]; }
NodeBuilder<> disjunction(kind::OR);
- for (const Node& n : all) { disjunction << n; }
+ for (TNode n : all) { disjunction << n; }
return disjunction;
}
/* Create node of kind XOR. */
sca.d_search_terms[tn].find(d);
if (itt != sca.d_search_terms[tn].end())
{
- for (const TNode& t : itt->second)
+ for (const Node& t : itt->second)
{
if (!options::sygusSymBreakLazy()
|| d_active_terms.find(t) != d_active_terms.end())
int new_depth = ((int)itsz->second->d_curr_search_size) - ((int)sz);
std::map< unsigned, std::vector< Node > >::iterator itt = itc->second.d_search_terms[tn].find( new_depth );
if( itt!=itc->second.d_search_terms[tn].end() ){
- for (const TNode& t : itt->second)
+ for (const Node& t : itt->second)
{
if (!options::sygusSymBreakLazy()
|| (d_active_terms.find(t) != d_active_terms.end()
d_conj_count++;
}else{
std::vector< Node > bvs;
- for (const std::pair<TypeNode, unsigned>& lhs_pattern :
+ for (const std::pair<const TypeNode, unsigned>& lhs_pattern :
d_pattern_var_id[lhs])
{
for (unsigned j = 0; j <= lhs_pattern.second; j++)
std::vector<Node> inactive_vars;
std::map<Node, std::map<int, bool> > visited;
std::map<Node, int> exclude;
- for (const std::pair<Node, bool>& pr : qpr.d_phase_reqs)
+ for (const std::pair<const Node, bool>& pr : qpr.d_phase_reqs)
{
if (pr.first.getKind() == GEQ)
{
} while (!evisit.empty() && !elig_vars.empty());
bool ret = false;
- for (const std::pair<Node, bool>& ev : elig_vars)
+ for (const std::pair<const Node, bool>& ev : elig_vars)
{
Node v = ev.first;
Trace("var-elim-ineq-debug")
}
if (threshCount < 2)
{
- for (const std::pair<Node, std::vector<unsigned>>& etp : ev_to_pt)
+ for (const auto& etp : ev_to_pt)
{
if (etp.second.size() < d_deqThresh)
{
d_var_classes[ti.getSubclassForVar(var)].push_back(var);
}
}
- for (const std::pair<unsigned, std::vector<Node>>& p : d_var_classes)
+ for (const std::pair<const unsigned, std::vector<Node>>& p : d_var_classes)
{
d_perm_state_class.push_back(PermutationState(p.second));
if (Trace.isOn("synth-stream-concrete"))
d_curr_ind = 0;
d_comb_state_class.clear();
Trace("synth-stream-concrete") << " ..combining vars :";
- for (const std::pair<unsigned, std::vector<Node>>& p : d_var_classes)
+ for (const std::pair<const unsigned, std::vector<Node>>& p : d_var_classes)
{
// ignore classes without variables being permuted
unsigned perm_var_class_sz = d_stream_permutations.getVarClassSize(p.first);
{
TypeNode svt = sv.getType();
// is it equivalent to a previous variable?
- for (const std::pair<Node, unsigned>& v : var_to_type_id)
+ for (const auto& v : var_to_type_id)
{
Node svc = v.first;
if (svc.getType() == svt)
ops.insert(ops.end(), d_ho_op_slaves[f].begin(), d_ho_op_slaves[f].end());
}
eq::EqualityEngine* ee = d_quantEngine->getMasterEqualityEngine();
- for (const Node& ff : ops)
+ for (TNode ff : ops)
{
- for (const TNode& n : d_op_map[ff])
+ for (const Node& n : d_op_map[ff])
{
if (hasTermCurrent(n) && isTermActive(n))
{
computeArgReps(n);
- TNode r = ee->hasTerm(n) ? ee->getRepresentative(n) : n;
+ TNode r = ee->hasTerm(n) ? ee->getRepresentative(n) : TNode(n);
d_func_map_eqc_trie[f].d_data[r].addTerm(n, d_arg_reps[n]);
}
}
unsigned relevantCount = 0;
eq::EqualityEngine* ee = d_quantEngine->getMasterEqualityEngine();
NodeManager* nm = NodeManager::currentNM();
- for (const Node& ff : ops)
+ for (TNode ff : ops)
{
std::map<Node, std::vector<Node> >::iterator it = d_op_map.find(ff);
if (it == d_op_map.end())
// get model values
std::map<int, Node> mvals;
- for (const std::pair<int, Node>& sub_element : d_label_map[satom][slbl])
+ for (const std::pair<const int, Node>& sub_element : d_label_map[satom][slbl])
{
int sub_index = sub_element.first;
Node sub_lbl = sub_element.second;
const std::map<Node, Node>& negativeMembers =
d_state.getNegativeMembers(representative);
- for (const std::pair<Node, Node>& negativeMember : negativeMembers)
+ for (const auto& negativeMember : negativeMembers)
{
Node member = nm->mkNode(MEMBER, negativeMember.first, univ);
// negativeMember.second is the reason for the negative membership and
{
const std::map<TypeNode, std::vector<TNode> >& slackElements =
d_cardSolver->getFiniteTypeSlackElements();
- for (const std::pair<TypeNode, std::vector<TNode> >& pair : slackElements)
+ for (const auto& pair : slackElements)
{
const std::vector<Node>& members =
d_cardSolver->getFiniteTypeMembers(pair.first);
addNormalFormPair(cii.d_nfPair[0], cii.d_nfPair[1]);
}
// send phase requirements
- for (const std::pair<const Node, bool> pp : cii.d_pendingPhase)
+ for (const std::pair<const Node, bool>& pp : cii.d_pendingPhase)
{
Node ppr = Rewriter::rewrite(pp.first);
d_im.addPendingPhaseRequirement(ppr, pp.second);
// notice this is not critical for soundness: not doing the below incrementing
// will only lead to overapproximating when antecedants are required in
// explanations
- for (const std::pair<Node, std::map<bool, unsigned> >& pe : d_expDep)
+ for (const std::pair<const Node, std::map<bool, unsigned> >& pe : d_expDep)
{
- for (const std::pair<bool, unsigned>& pep : pe.second)
+ for (const auto& pep : pe.second)
{
// See if this can be incremented: it can if this literal is not relevant
// to the current index, and hence it is not relevant for both c1 and c2.
if (Trace.isOn("te-proof-exp"))
{
Trace("te-proof-exp") << "Explanation is:" << std::endl;
- for (const Node& e : exp)
+ for (TNode e : exp)
{
Trace("te-proof-exp") << " " << e << std::endl;
}
explainPredicate(atom, polarity, tassumptions);
}
// ensure that duplicates are removed
- for (const TNode a : tassumptions)
+ for (TNode a : tassumptions)
{
if (std::find(assumptions.begin(), assumptions.end(), a)
== assumptions.end())
}
Trace("pfee-proof") << "...got " << tassumps << std::endl;
// avoid duplicates
- for (const TNode a : tassumps)
+ for (TNode a : tassumps)
{
if (a == lit)
{
subs.push_back(p1);
repls.push_back(p1);
repls.push_back(p0);
- for (const Node nn : d_phi)
+ for (const Node& nn : d_phi)
{
Node s =
nn.substitute(subs.begin(), subs.end(), repls.begin(), repls.end());
subs.clear();
repls.clear();
bool first = true;
- for (const Node& nn : p)
+ for (TNode nn : p)
{
subs.push_back(nn);
if(!first) {