CandidateRewriteDatabase::CandidateRewriteDatabase(bool doCheck,
bool rewAccel,
- bool silent)
+ bool silent,
+ bool filterPairs)
: d_qe(nullptr),
d_tds(nullptr),
d_ext_rewrite(nullptr),
d_doCheck(doCheck),
d_rewAccel(rewAccel),
d_silent(silent),
+ d_filterPairs(filterPairs),
d_using_sygus(false)
{
}
d_qe = nullptr;
d_tds = nullptr;
d_ext_rewrite = nullptr;
- d_crewrite_filter.initialize(ss, nullptr, false);
+ if (d_filterPairs)
+ {
+ d_crewrite_filter.initialize(ss, nullptr, false);
+ }
ExprMiner::initialize(vars, ss);
}
d_qe = qe;
d_tds = d_qe->getTermDatabaseSygus();
d_ext_rewrite = nullptr;
- d_crewrite_filter.initialize(ss, d_tds, d_using_sygus);
+ if (d_filterPairs)
+ {
+ d_crewrite_filter.initialize(ss, d_tds, d_using_sygus);
+ }
ExprMiner::initialize(vars, ss);
}
{
is_unique_term = false;
// should we filter the pair?
- if (!d_crewrite_filter.filterPair(sol, eq_sol))
+ if (!d_filterPairs || !d_crewrite_filter.filterPair(sol, eq_sol))
{
// get the actual term
Node solb = sol;
if (!is_unique_term)
{
// register this as a relevant pair (helps filtering)
- d_crewrite_filter.registerRelevantPair(sol, eq_sol);
+ if (d_filterPairs)
+ {
+ d_crewrite_filter.registerRelevantPair(sol, eq_sol);
+ }
// The analog of terms sol and eq_sol are equivalent under
// sample points but do not rewrite to the same term. Hence,
// this indicates a candidate rewrite.
/** CandidateRewriteDatabase
*
* This maintains the necessary data structures for generating a database
- * of candidate rewrite rules (see Reynolds et al "Rewrites for SMT Solvers
- * Using Syntax-Guided Enumeration" SMT 2018). The primary responsibilities
+ * of candidate rewrite rules (see Noetzli et al "Syntax-Guided Rewrite Rule
+ * Enumeration for SMT Solvers" SAT 2019). The primary responsibilities
* of this class are to perform the "equivalence checking" and "congruence
* and matching filtering" in Figure 1. The equivalence checking is done
* through a combination of the sygus sampler object owned by this class
* discovered rewrites (see option sygusRewSynthAccel()).
* @param silent Whether to silence the output of rewrites discovered by this
* class.
+ * @param filterPairs Whether to filter rewrite pairs using filtering
+ * techniques from the SAT 2019 paper above.
*/
CandidateRewriteDatabase(bool doCheck,
bool rewAccel = false,
- bool silent = false);
+ bool silent = false,
+ bool filterPairs = true);
~CandidateRewriteDatabase() {}
/** Initialize this class */
void initialize(const std::vector<Node>& var,
bool d_rewAccel;
/** if true, we silence the output of candidate rewrites */
bool d_silent;
+ /** if true, we filter pairs of terms to check equivalence */
+ bool d_filterPairs;
/** whether we are using sygus */
bool d_using_sygus;
/** candidate rewrite filter */