diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-04-09 20:09:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-09 20:09:51 -0500 |
commit | fc9e113c5f9ea99a1308d0f36b1aad778747870c (patch) | |
tree | 1bc632ebe9d2c28a6ffaac4dc90d7b5203647624 /src/theory/quantifiers/ematching | |
parent | 51824dbdc2a8c19cbae7c76826732ae2f319111d (diff) |
Fix higher-order term indexing. (#1754)
Diffstat (limited to 'src/theory/quantifiers/ematching')
-rw-r--r-- | src/theory/quantifiers/ematching/inst_match_generator.cpp | 6 | ||||
-rw-r--r-- | src/theory/quantifiers/ematching/inst_match_generator.h | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/theory/quantifiers/ematching/inst_match_generator.cpp b/src/theory/quantifiers/ematching/inst_match_generator.cpp index ec0a4039a..0252def60 100644 --- a/src/theory/quantifiers/ematching/inst_match_generator.cpp +++ b/src/theory/quantifiers/ematching/inst_match_generator.cpp @@ -1042,8 +1042,12 @@ void InstMatchGeneratorSimple::addInstantiations(InstMatch& m, TNode t = tat->getNodeData(); Debug("simple-trigger") << "Actual term is " << t << std::endl; //convert to actual used terms - for( std::map< int, int >::iterator it = d_var_num.begin(); it != d_var_num.end(); ++it ){ + for (std::map<unsigned, int>::iterator it = d_var_num.begin(); + it != d_var_num.end(); + ++it) + { if( it->second>=0 ){ + Assert(it->first < t.getNumChildren()); Debug("simple-trigger") << "...set " << it->second << " " << t[it->first] << std::endl; m.setValue( it->second, t[it->first] ); } diff --git a/src/theory/quantifiers/ematching/inst_match_generator.h b/src/theory/quantifiers/ematching/inst_match_generator.h index cbd5702a0..2e7e3c90c 100644 --- a/src/theory/quantifiers/ematching/inst_match_generator.h +++ b/src/theory/quantifiers/ematching/inst_match_generator.h @@ -644,8 +644,11 @@ class InstMatchGeneratorSimple : public IMGenerator { std::vector< TypeNode > d_match_pattern_arg_types; /** The match operator d_match_pattern (see TermDb::getMatchOperator). */ Node d_op; - /** Map from child number to variable index. */ - std::map< int, int > d_var_num; + /** + * Map from child number of d_match_pattern to variable index, or -1 if the + * child is not a variable. + */ + std::map<unsigned, int> d_var_num; /** add instantiations, helper function. * * m is the current match we are building, |