namespace theory {
namespace quantifiers {
-SygusEnumerator::SygusEnumerator(TermDbSygus* tds, SynthConjecture* p)
- : d_tds(tds), d_parent(p), d_tlEnum(nullptr), d_abortSize(-1)
+SygusEnumerator::SygusEnumerator(TermDbSygus* tds,
+ SynthConjecture* p,
+ SygusStatistics& s)
+ : d_tds(tds), d_parent(p), d_stats(s), d_tlEnum(nullptr), d_abortSize(-1)
{
}
d_sampleRrVInit(false)
{
}
-void SygusEnumerator::TermCache::initialize(Node e,
- TypeNode tn,
- TermDbSygus* tds,
- SygusPbe* pbe)
+void SygusEnumerator::TermCache::initialize(
+ SygusStatistics* s, Node e, TypeNode tn, TermDbSygus* tds, SygusPbe* pbe)
{
Trace("sygus-enum-debug") << "Init term cache " << tn << "..." << std::endl;
+ d_stats = s;
d_enum = e;
d_tn = tn;
d_tds = tds;
{
Node bn = d_tds->sygusToBuiltin(n);
Node bnr = d_tds->getExtRewriter()->extendedRewrite(bn);
+ ++(d_stats->d_enumTermsRewrite);
if (options::sygusRewVerify())
{
if (bn != bnr)
// if we are doing PBE symmetry breaking
if (d_pbe != nullptr)
{
+ ++(d_stats->d_enumTermsExampleEval);
// Is it equivalent under examples?
Node bne = d_pbe->addSearchVal(d_tn, d_enum, bnr);
if (!bne.isNull())
Trace("sygus-enum-terms") << "tc(" << d_tn << "): term " << bn << std::endl;
d_bterms.insert(bnr);
}
+ ++(d_stats->d_enumTerms);
d_terms.push_back(n);
return true;
}
pbe = nullptr;
}
}
- d_tcache[tn].initialize(d_enum, tn, d_tds, pbe);
+ d_tcache[tn].initialize(&d_stats, d_enum, tn, d_tds, pbe);
}
SygusEnumerator::TermEnum* SygusEnumerator::getMasterEnumForType(TypeNode tn)
class SygusEnumerator : public EnumValGenerator
{
public:
- SygusEnumerator(TermDbSygus* tds, SynthConjecture* p);
+ SygusEnumerator(TermDbSygus* tds, SynthConjecture* p, SygusStatistics& s);
~SygusEnumerator() {}
/** initialize this class with enumerator e */
void initialize(Node e) override;
TermDbSygus* d_tds;
/** pointer to the synth conjecture that owns this enumerator */
SynthConjecture* d_parent;
+ /** reference to the statistics of parent */
+ SygusStatistics& d_stats;
/** Term cache
*
* This stores a list of terms for a given sygus type. The key features of
* natural number n, and redundancy criteria are used for discarding terms
* that are not relevant. This includes discarding terms whose builtin version
* is the same up to T-rewriting with another, or is equivalent under
- * examples, if the conjecture in question is in PBE form and sygusSymBreakPbe
- * is enabled.
+ * examples, if the conjecture in question is in examples form and
+ * sygusSymBreakPbe is enabled.
*
* This class also computes static information about sygus types that is
* relevant for enumeration. Primarily, this includes mapping constructors
public:
TermCache();
/** initialize this cache */
- void initialize(Node e,
+ void initialize(SygusStatistics* s,
+ Node e,
TypeNode tn,
TermDbSygus* tds,
SygusPbe* pbe = nullptr);
void setComplete();
private:
+ /** reference to the statistics of parent */
+ SygusStatistics* d_stats;
/** the enumerator this cache is for */
Node d_enum;
/** the sygus type of terms in this cache */
d_cegqi_si_lemmas("SynthEngine::cegqi_lemmas_si", 0),
d_solutions("SynthConjecture::solutions", 0),
d_filtered_solutions("SynthConjecture::filtered_solutions", 0),
- d_candidate_rewrites_print("SynthConjecture::candidate_rewrites_print", 0)
+ d_candidate_rewrites_print("SynthConjecture::candidate_rewrites_print",
+ 0),
+ d_enumTermsRewrite("SygusEnumerator::enumTermsRewrite", 0),
+ d_enumTermsExampleEval("SygusEnumerator::enumTermsEvalExamples", 0),
+ d_enumTerms("SygusEnumerator::enumTerms", 0)
{
smtStatisticsRegistry()->registerStat(&d_cegqi_lemmas_ce);
smtStatisticsRegistry()->registerStat(&d_solutions);
smtStatisticsRegistry()->registerStat(&d_filtered_solutions);
smtStatisticsRegistry()->registerStat(&d_candidate_rewrites_print);
+ smtStatisticsRegistry()->registerStat(&d_enumTermsRewrite);
+ smtStatisticsRegistry()->registerStat(&d_enumTermsExampleEval);
+ smtStatisticsRegistry()->registerStat(&d_enumTerms);
}
SygusStatistics::~SygusStatistics()
smtStatisticsRegistry()->unregisterStat(&d_solutions);
smtStatisticsRegistry()->unregisterStat(&d_filtered_solutions);
smtStatisticsRegistry()->unregisterStat(&d_candidate_rewrites_print);
+ smtStatisticsRegistry()->unregisterStat(&d_enumTermsRewrite);
+ smtStatisticsRegistry()->unregisterStat(&d_enumTermsExampleEval);
+ smtStatisticsRegistry()->unregisterStat(&d_enumTerms);
}
} // namespace quantifiers
IntStat d_filtered_solutions;
/** Number of candidate rewrites printed (for --sygus-rr) */
IntStat d_candidate_rewrites_print;
+ /** Number of terms checked for rewrite-based symmetry in fast enumerators */
+ IntStat d_enumTermsRewrite;
+ /** Number of terms checked for example-based symmetry in fast enumerators */
+ IntStat d_enumTermsExampleEval;
+ /** Number of non-redundant terms generated by fast enumerators */
+ IntStat d_enumTerms;
};
} // namespace quantifiers
== options::SygusActiveGenMode::ENUM
|| options::sygusActiveGenMode()
== options::SygusActiveGenMode::AUTO);
- d_evg[e].reset(new SygusEnumerator(d_tds, this));
+ d_evg[e].reset(new SygusEnumerator(d_tds, this, d_stats));
}
}
Trace("sygus-active-gen")