summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2018-05-24 17:28:59 -0500
committerHaniel Barbosa <hanielbbarbosa@gmail.com>2018-05-24 17:28:59 -0500
commitce4493598547a9ef013b7bb8d554c83bae478b1b (patch)
tree17d2eed4d6be1b8162dd095de3dc53bc8f9bef0e /src/theory/quantifiers
parent83b4e2ba719ddc410c125a7ef7ff49f39dc2a599 (diff)
Improve simple constant symmetry breaking for sygus (#1977)
Diffstat (limited to 'src/theory/quantifiers')
-rw-r--r--src/theory/quantifiers/sygus/term_database_sygus.cpp34
-rw-r--r--src/theory/quantifiers/sygus/term_database_sygus.h13
2 files changed, 30 insertions, 17 deletions
diff --git a/src/theory/quantifiers/sygus/term_database_sygus.cpp b/src/theory/quantifiers/sygus/term_database_sygus.cpp
index 121ee34f7..cd6c8bdec 100644
--- a/src/theory/quantifiers/sygus/term_database_sygus.cpp
+++ b/src/theory/quantifiers/sygus/term_database_sygus.cpp
@@ -881,37 +881,43 @@ bool TermDbSygus::isEnumerator(Node e) const
return d_enum_to_conjecture.find(e) != d_enum_to_conjecture.end();
}
-CegConjecture* TermDbSygus::getConjectureForEnumerator(Node e)
+CegConjecture* TermDbSygus::getConjectureForEnumerator(Node e) const
{
- std::map<Node, CegConjecture*>::iterator itm = d_enum_to_conjecture.find(e);
+ std::map<Node, CegConjecture*>::const_iterator itm =
+ d_enum_to_conjecture.find(e);
if (itm != d_enum_to_conjecture.end()) {
return itm->second;
- }else{
- return NULL;
}
+ return nullptr;
}
-Node TermDbSygus::getSynthFunForEnumerator(Node e)
+Node TermDbSygus::getSynthFunForEnumerator(Node e) const
{
- std::map<Node, Node>::iterator itsf = d_enum_to_synth_fun.find(e);
+ std::map<Node, Node>::const_iterator itsf = d_enum_to_synth_fun.find(e);
if (itsf != d_enum_to_synth_fun.end())
{
return itsf->second;
}
- else
- {
- return Node::null();
- }
+ return Node::null();
}
-Node TermDbSygus::getActiveGuardForEnumerator(Node e)
+Node TermDbSygus::getActiveGuardForEnumerator(Node e) const
{
- std::map<Node, Node>::iterator itag = d_enum_to_active_guard.find(e);
+ std::map<Node, Node>::const_iterator itag = d_enum_to_active_guard.find(e);
if (itag != d_enum_to_active_guard.end()) {
return itag->second;
- }else{
- return Node::null();
}
+ return Node::null();
+}
+
+bool TermDbSygus::usingSymbolicConsForEnumerator(Node e) const
+{
+ std::map<Node, bool>::const_iterator itus = d_enum_to_using_sym_cons.find(e);
+ if (itus != d_enum_to_using_sym_cons.end())
+ {
+ return itus->second;
+ }
+ return false;
}
void TermDbSygus::getEnumerators(std::vector<Node>& mts)
diff --git a/src/theory/quantifiers/sygus/term_database_sygus.h b/src/theory/quantifiers/sygus/term_database_sygus.h
index 139e00794..163d65d19 100644
--- a/src/theory/quantifiers/sygus/term_database_sygus.h
+++ b/src/theory/quantifiers/sygus/term_database_sygus.h
@@ -79,11 +79,13 @@ class TermDbSygus {
/** is e an enumerator registered with this class? */
bool isEnumerator(Node e) const;
/** return the conjecture e is associated with */
- CegConjecture* getConjectureForEnumerator(Node e);
+ CegConjecture* getConjectureForEnumerator(Node e) const;
/** return the function-to-synthesize e is associated with */
- Node getSynthFunForEnumerator(Node e);
+ Node getSynthFunForEnumerator(Node e) const;
/** get active guard for e */
- Node getActiveGuardForEnumerator(Node e);
+ Node getActiveGuardForEnumerator(Node e) const;
+ /** are we using symbolic constructors for enumerator e? */
+ bool usingSymbolicConsForEnumerator(Node e) const;
/** get all registered enumerators */
void getEnumerators(std::vector<Node>& mts);
/** Register symmetry breaking lemma
@@ -242,6 +244,11 @@ class TermDbSygus {
* if G is true, then there are more values of e to enumerate".
*/
std::map<Node, Node> d_enum_to_active_guard;
+ /**
+ * Mapping from enumerators to whether we allow symbolic constructors to
+ * appear as subterms of them.
+ */
+ std::map<Node, bool> d_enum_to_using_sym_cons;
/** mapping from enumerators to symmetry breaking clauses for them */
std::map<Node, std::vector<Node> > d_enum_to_sb_lemmas;
/** mapping from symmetry breaking lemmas to type */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback