diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-05-10 17:43:48 -0500 |
---|---|---|
committer | Haniel Barbosa <hanielbbarbosa@gmail.com> | 2018-05-10 17:43:48 -0500 |
commit | 2ac2c2a0c6ab1318736c026dfeb7533b5ffc7f29 (patch) | |
tree | 7e5a72e5ad46ab5b1ca2293b7eea641df58467aa /src/theory/quantifiers/sygus/sygus_pbe.cpp | |
parent | adcbee78823120baa47eb8ba868b614512a121a9 (diff) |
Exclude Boolean connectives from ITE conditions in SygusUnifStrat (#1900)
Diffstat (limited to 'src/theory/quantifiers/sygus/sygus_pbe.cpp')
-rw-r--r-- | src/theory/quantifiers/sygus/sygus_pbe.cpp | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/src/theory/quantifiers/sygus/sygus_pbe.cpp b/src/theory/quantifiers/sygus/sygus_pbe.cpp index 7faeb0252..401ab03ee 100644 --- a/src/theory/quantifiers/sygus/sygus_pbe.cpp +++ b/src/theory/quantifiers/sygus/sygus_pbe.cpp @@ -179,21 +179,57 @@ bool CegConjecturePbe::initialize(Node n, std::map<Node, std::vector<Node>> strategy_lemmas; d_sygus_unif[c].initialize( d_qe, singleton_c, d_candidate_to_enum[c], strategy_lemmas); - // collect lemmas from all strategies - for (const std::pair<const Node, std::vector<Node>>& p : strategy_lemmas) - { - lemmas.insert(lemmas.end(), p.second.begin(), p.second.end()); - } Assert(!d_candidate_to_enum[c].empty()); Trace("sygus-pbe") << "Initialize " << d_candidate_to_enum[c].size() << " enumerators for " << c << "..." << std::endl; + // collect list per type of strategy points with strategy lemmas + std::map<TypeNode, std::vector<Node>> tn_to_strategy_pt; + for (const std::pair<const Node, std::vector<Node>>& p : strategy_lemmas) + { + TypeNode tnsp = p.first.getType(); + tn_to_strategy_pt[tnsp].push_back(p.first); + } // initialize the enumerators + NodeManager* nm = NodeManager::currentNM(); for (const Node& e : d_candidate_to_enum[c]) { + TypeNode etn = e.getType(); d_tds->registerEnumerator(e, c, d_parent, true); Node g = d_tds->getActiveGuardForEnumerator(e); d_enum_to_active_guard[e] = g; d_enum_to_candidate[e] = c; + TNode te = e; + // initialize static symmetry breaking lemmas for it + // we register only one "master" enumerator per type + // thus, the strategy lemmas (which are for individual strategy points) + // are applicable (disjunctively) to the master enumerator + std::map<TypeNode, std::vector<Node>>::iterator itt = + tn_to_strategy_pt.find(etn); + if (itt != tn_to_strategy_pt.end()) + { + std::vector<Node> disj; + for (const Node& sp : itt->second) + { + std::map<Node, std::vector<Node>>::iterator itsl = + strategy_lemmas.find(sp); + Assert(itsl != strategy_lemmas.end()); + if (!itsl->second.empty()) + { + TNode tsp = sp; + Node lem = itsl->second.size() == 1 ? itsl->second[0] + : nm->mkNode(AND, itsl->second); + if (tsp != te) + { + lem = lem.substitute(tsp, te); + } + disj.push_back(lem); + } + } + Node lem = disj.size() == 1 ? disj[0] : nm->mkNode(OR, disj); + Trace("sygus-pbe") << " static redundant op lemma : " << lem + << std::endl; + lemmas.push_back(lem); + } } Trace("sygus-pbe") << "Initialize " << d_examples[c].size() << " example points for " << c << "..." << std::endl; |