namespace theory {
namespace quantifiers {
-BvInverter::BvInverter(Rewriter* r) : d_rewriter(r) {}
+BvInverter::BvInverter(const Options& opts, Rewriter* r)
+ : d_opts(opts), d_rewriter(r)
+{
+}
/*---------------------------------------------------------------------------*/
}
else if (k == BITVECTOR_CONCAT)
{
- if (litk == EQUAL && options::cegqiBvConcInv())
+ if (litk == EQUAL && d_opts.quantifiers.cegqiBvConcInv)
{
/* Compute inverse for s1 o x, x o s2, s1 o x o s2
* (while disregarding that invertibility depends on si)
#include "expr/node.h"
namespace cvc5::internal {
+
+class Options;
+
namespace theory {
class Rewriter;
class BvInverter
{
public:
- BvInverter(Rewriter* r = nullptr);
+ BvInverter(const Options& opts, Rewriter* r = nullptr);
~BvInverter() {}
/** get dummy fresh variable of type tn, used as argument for sv */
Node getSolveVariable(TypeNode tn);
* to this call is null.
*/
Node getInversionNode(Node cond, TypeNode tn, BvInverterQuery* m);
+ /** Reference to options */
+ const Options& d_opts;
/** (Optional) rewriter used as helper in getInversionNode */
Rewriter* d_rewriter;
/** Dummy variables for each type */
// new lemmas
std::vector<Node> new_lems;
- if (options::cegqiBvRmExtract())
+ if (d_opts.quantifiers.cegqiBvRmExtract)
{
NodeManager* nm = NodeManager::currentNM();
SkolemManager* sm = nm->getSkolemManager();
class BvInstantiatorPreprocess : public InstantiatorPreprocess
{
public:
- BvInstantiatorPreprocess() {}
+ BvInstantiatorPreprocess(const Options& opts) : d_opts(opts) {}
~BvInstantiatorPreprocess() override {}
/** register counterexample lemma
*
void collectExtracts(Node lem,
std::map<Node, std::vector<Node>>& extract_map,
std::unordered_set<TNode>& visited);
+ /** Reference to options */
+ const Options& d_opts;
};
} // namespace quantifiers
// setup any theory-specific preprocessors here
if (tid == THEORY_BV)
{
- d_tipp[tid] = new BvInstantiatorPreprocess;
+ d_tipp[tid] = new BvInstantiatorPreprocess(d_env.getOptions());
}
d_tids.push_back(tid);
}
if (options().quantifiers.cegqiBv)
{
// if doing instantiation for BV, need the inverter class
- d_bv_invert.reset(new BvInverter(env.getRewriter()));
+ d_bv_invert.reset(new BvInverter(env.getOptions(), env.getRewriter()));
}
if (options().quantifiers.cegqiNestedQE)
{
Node QuantifiersRewriter::getVarElimEq(Node lit,
const std::vector<Node>& args,
- Node& var)
+ Node& var) const
{
Assert(lit.getKind() == EQUAL);
Node slv;
Node QuantifiersRewriter::getVarElimEqReal(Node lit,
const std::vector<Node>& args,
- Node& var)
+ Node& var) const
{
// for arithmetic, solve the equality
std::map<Node, Node> msum;
Node QuantifiersRewriter::getVarElimEqBv(Node lit,
const std::vector<Node>& args,
- Node& var)
+ Node& var) const
{
if (TraceIsOn("quant-velim-bv"))
{
std::vector<Node> active_args;
computeArgVec(args, active_args, lit);
- BvInverter binv;
+ BvInverter binv(d_opts);
for (const Node& cvar : active_args)
{
// solve for the variable on this path using the inverter
Node QuantifiersRewriter::getVarElimEqString(Node lit,
const std::vector<Node>& args,
- Node& var)
+ Node& var) const
{
Assert(lit.getKind() == EQUAL);
NodeManager* nm = NodeManager::currentNM();
/**
* Get variable eliminate for an equality based on theory-specific reasoning.
*/
- static Node getVarElimEq(Node lit, const std::vector<Node>& args, Node& var);
+ Node getVarElimEq(Node lit, const std::vector<Node>& args, Node& var) const;
/** variable eliminate for real equalities
*
* If this returns a non-null value ret, then var is updated to a member of
* args, lit is equivalent to ( var = ret ).
*/
- static Node getVarElimEqReal(Node lit,
- const std::vector<Node>& args,
- Node& var);
+ Node getVarElimEqReal(Node lit,
+ const std::vector<Node>& args,
+ Node& var) const;
/** variable eliminate for bit-vector equalities
*
* If this returns a non-null value ret, then var is updated to a member of
* args, lit is equivalent to ( var = ret ).
*/
- static Node getVarElimEqBv(Node lit,
- const std::vector<Node>& args,
- Node& var);
+ Node getVarElimEqBv(Node lit, const std::vector<Node>& args, Node& var) const;
/** variable eliminate for string equalities
*
* If this returns a non-null value ret, then var is updated to a member of
* args, lit is equivalent to ( var = ret ).
*/
- static Node getVarElimEqString(Node lit,
- const std::vector<Node>& args,
- Node& var);
+ Node getVarElimEqString(Node lit,
+ const std::vector<Node>& args,
+ Node& var) const;
/** get variable elimination
*
* If there exists an n with some polarity in body, and entails a literal that