summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2018-11-04 18:06:29 -0600
committerAndres Noetzli <andres.noetzli@gmail.com>2018-11-04 16:06:29 -0800
commitf0d1016c0c9b5335a4c2f564ac1a115fe0a74329 (patch)
tree8d2f50f303584aee5cf51423ac91830bde0eca9c
parentc5d84115b1e54411a5816002d4615408e72a57fb (diff)
Implement option to turn off symmetry breaking for basic enumerators (#2686)
Improves the existing implementation for sygus-active-gen=basic.
-rw-r--r--src/theory/quantifiers/sygus/sygus_enumerator.cpp43
-rw-r--r--src/theory/quantifiers/sygus/synth_conjecture.cpp12
2 files changed, 29 insertions, 26 deletions
diff --git a/src/theory/quantifiers/sygus/sygus_enumerator.cpp b/src/theory/quantifiers/sygus/sygus_enumerator.cpp
index 61ab9007a..a39c9e958 100644
--- a/src/theory/quantifiers/sygus/sygus_enumerator.cpp
+++ b/src/theory/quantifiers/sygus/sygus_enumerator.cpp
@@ -241,33 +241,36 @@ bool SygusEnumerator::TermCache::addTerm(Node n)
d_terms.push_back(n);
return true;
}
- Node bn = d_tds->sygusToBuiltin(n);
- Node bnr = d_tds->getExtRewriter()->extendedRewrite(bn);
- // must be unique up to rewriting
- if (d_bterms.find(bnr) != d_bterms.end())
+ if (options::sygusSymBreakDynamic())
{
- Trace("sygus-enum-exc") << "Exclude: " << bn << std::endl;
- return false;
- }
- // if we are doing PBE symmetry breaking
- if (d_pbe != nullptr)
- {
- // Is it equivalent under examples?
- Node bne = d_pbe->addSearchVal(d_tn, d_enum, bnr);
- if (!bne.isNull())
+ Node bn = d_tds->sygusToBuiltin(n);
+ Node bnr = d_tds->getExtRewriter()->extendedRewrite(bn);
+ // must be unique up to rewriting
+ if (d_bterms.find(bnr) != d_bterms.end())
+ {
+ Trace("sygus-enum-exc") << "Exclude: " << bn << std::endl;
+ return false;
+ }
+ // if we are doing PBE symmetry breaking
+ if (d_pbe != nullptr)
{
- if (bnr != bne)
+ // Is it equivalent under examples?
+ Node bne = d_pbe->addSearchVal(d_tn, d_enum, bnr);
+ if (!bne.isNull())
{
- Trace("sygus-enum-exc") << "Exclude (by examples): " << bn
- << ", since we already have " << bne
- << "!=" << bnr << std::endl;
- return false;
+ if (bnr != bne)
+ {
+ Trace("sygus-enum-exc") << "Exclude (by examples): " << bn
+ << ", since we already have " << bne
+ << "!=" << bnr << std::endl;
+ return false;
+ }
}
}
+ Trace("sygus-enum-terms") << "tc(" << d_tn << "): term " << bn << std::endl;
+ d_bterms.insert(bnr);
}
- Trace("sygus-enum-terms") << "tc(" << d_tn << "): term " << bn << std::endl;
d_terms.push_back(n);
- d_bterms.insert(bnr);
return true;
}
void SygusEnumerator::TermCache::pushEnumSizeIndex()
diff --git a/src/theory/quantifiers/sygus/synth_conjecture.cpp b/src/theory/quantifiers/sygus/synth_conjecture.cpp
index 21079aedc..e668b2206 100644
--- a/src/theory/quantifiers/sygus/synth_conjecture.cpp
+++ b/src/theory/quantifiers/sygus/synth_conjecture.cpp
@@ -705,17 +705,17 @@ class EnumValGeneratorBasic : public EnumValGenerator
}
Node next = *d_te;
++d_te;
- Node nextb = d_tds->sygusToBuiltin(next);
if (options::sygusSymBreakDynamic())
{
+ Node nextb = d_tds->sygusToBuiltin(next);
nextb = d_tds->getExtRewriter()->extendedRewrite(nextb);
- }
- if (d_cache.find(nextb) == d_cache.end())
- {
+ if (d_cache.find(nextb) != d_cache.end())
+ {
+ return getNext();
+ }
d_cache.insert(nextb);
- return next;
}
- return getNext();
+ return next;
}
private:
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback