summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2018-08-22 10:37:50 -0500
committerGitHub <noreply@github.com>2018-08-22 10:37:50 -0500
commitc74797f4cbded274e2dca6fee5e0efb439da03f5 (patch)
tree54b54a1e9e468dec4d97673e03be473632ed1549 /src/theory/quantifiers
parentab8d44b83e210ed38623a1440e3ef1d318f7d0d0 (diff)
Fix invalid iterator comparisons (#2349)
Diffstat (limited to 'src/theory/quantifiers')
-rw-r--r--src/theory/quantifiers/conjecture_generator.cpp9
-rw-r--r--src/theory/quantifiers/fmf/bounded_integers.cpp10
-rw-r--r--src/theory/quantifiers/sygus/ce_guided_single_inv.cpp7
3 files changed, 16 insertions, 10 deletions
diff --git a/src/theory/quantifiers/conjecture_generator.cpp b/src/theory/quantifiers/conjecture_generator.cpp
index a079017cd..e82ab617a 100644
--- a/src/theory/quantifiers/conjecture_generator.cpp
+++ b/src/theory/quantifiers/conjecture_generator.cpp
@@ -882,9 +882,12 @@ unsigned ConjectureGenerator::flushWaitingConjectures( unsigned& addedLemmas, in
d_conj_count++;
}else{
std::vector< Node > bvs;
- for( std::map< TypeNode, unsigned >::iterator it = d_pattern_var_id[lhs].begin(); it != d_pattern_var_id[lhs].end(); ++it ){
- for( unsigned i=0; i<=it->second; i++ ){
- bvs.push_back( getFreeVar( it->first, i ) );
+ for (const std::pair<TypeNode, unsigned>& lhs_pattern :
+ d_pattern_var_id[lhs])
+ {
+ for (unsigned i = 0; i <= lhs_pattern.second; i++)
+ {
+ bvs.push_back(getFreeVar(lhs_pattern.first, i));
}
}
Node rsg;
diff --git a/src/theory/quantifiers/fmf/bounded_integers.cpp b/src/theory/quantifiers/fmf/bounded_integers.cpp
index f0789a503..8d8bf7f50 100644
--- a/src/theory/quantifiers/fmf/bounded_integers.cpp
+++ b/src/theory/quantifiers/fmf/bounded_integers.cpp
@@ -459,18 +459,18 @@ void BoundedIntegers::checkOwnership(Node f)
success = true;
//set Attributes on literals
for( unsigned b=0; b<2; b++ ){
- if (bound_lit_map[b].find(v) != bound_lit_map[b].end())
+ std::map<Node, Node>& blm = bound_lit_map[b];
+ if (blm.find(v) != blm.end())
{
+ std::map<Node, bool>& blmp = bound_lit_pol_map[b];
// WARNING_CANDIDATE:
// This assertion may fail. We intentionally do not enable this in
// production as it is considered safe for this to fail. We fail
// the assertion in debug mode to have this instance raised to
// our attention.
- Assert(bound_lit_pol_map[b].find(v)
- != bound_lit_pol_map[b].end());
+ Assert(blmp.find(v) != blmp.end());
BoundIntLitAttribute bila;
- bound_lit_map[b][v].setAttribute(bila,
- bound_lit_pol_map[b][v] ? 1 : 0);
+ bound_lit_map[b][v].setAttribute(bila, blmp[v] ? 1 : 0);
}
else
{
diff --git a/src/theory/quantifiers/sygus/ce_guided_single_inv.cpp b/src/theory/quantifiers/sygus/ce_guided_single_inv.cpp
index 5f5a84a6b..39c3baf5c 100644
--- a/src/theory/quantifiers/sygus/ce_guided_single_inv.cpp
+++ b/src/theory/quantifiers/sygus/ce_guided_single_inv.cpp
@@ -1036,8 +1036,11 @@ int TransitionInference::incrementTrace( DetTrace& dt, Node loc, bool fwd ) {
}
}
if( fwd ){
- std::map< Node, std::map< Node, Node > >::iterator it = d_com[0].d_const_eq.find( loc );
- if( it!=d_com[0].d_const_eq.end() ){
+ Component& cm = d_com[0];
+ std::map<Node, std::map<Node, Node> >::iterator it =
+ cm.d_const_eq.find(loc);
+ if (it != cm.d_const_eq.end())
+ {
std::vector< Node > next;
for( unsigned i=0; i<d_prime_vars.size(); i++ ){
Node pv = d_prime_vars[i];
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback