\n\
";
+const std::string OptionsHandler::s_cbqiBvIneqModeHelp =
+ "\
+Modes for single invocation techniques, supported by --cbqi-bv-ineq:\n\
+\n\
+eq-slack (default) \n\
++ Solve for the inequality using the slack value in the model, e.g.,\
+ t > s becomes t = s + ( t-s )^M.\n\
+\n\
+eq-boundary \n\
++ Solve for the boundary point of the inequality, e.g.,\
+ t > s becomes t = s+1.\n\
+\n\
+keep \n\
++ Solve for the inequality directly using side conditions for invertibility.\n\
+\n\
+";
+
const std::string OptionsHandler::s_cegqiSingleInvHelp = "\
Modes for single invocation techniques, supported by --cegqi-si:\n\
\n\
}
}
+theory::quantifiers::CbqiBvIneqMode OptionsHandler::stringToCbqiBvIneqMode(
+ std::string option, std::string optarg) throw(OptionException)
+{
+ if (optarg == "eq-slack")
+ {
+ return theory::quantifiers::CBQI_BV_INEQ_EQ_SLACK;
+ }
+ else if (optarg == "eq-boundary")
+ {
+ return theory::quantifiers::CBQI_BV_INEQ_EQ_BOUNDARY;
+ }
+ else if (optarg == "keep")
+ {
+ return theory::quantifiers::CBQI_BV_INEQ_KEEP;
+ }
+ else if (optarg == "help")
+ {
+ puts(s_cbqiBvIneqModeHelp.c_str());
+ exit(1);
+ }
+ else
+ {
+ throw OptionException(std::string("unknown option for --cbqi-bv-ineq: `")
+ + optarg
+ + "'. Try --cbqi-bv-ineq help.");
+ }
+}
+
theory::quantifiers::CegqiSingleInvMode OptionsHandler::stringToCegqiSingleInvMode(std::string option, std::string optarg) throw(OptionException) {
if(optarg == "none" ) {
return theory::quantifiers::CEGQI_SI_MODE_NONE;
theory::quantifiers::PrenexQuantMode stringToPrenexQuantMode(std::string option, std::string optarg) throw(OptionException);
theory::quantifiers::TermDbMode stringToTermDbMode(std::string option, std::string optarg) throw(OptionException);
theory::quantifiers::IteLiftQuantMode stringToIteLiftQuantMode(std::string option, std::string optarg) throw(OptionException);
+ theory::quantifiers::CbqiBvIneqMode stringToCbqiBvIneqMode(
+ std::string option, std::string optarg) throw(OptionException);
theory::quantifiers::CegqiSingleInvMode stringToCegqiSingleInvMode(std::string option, std::string optarg) throw(OptionException);
theory::quantifiers::SygusInvTemplMode stringToSygusInvTemplMode(std::string option, std::string optarg) throw(OptionException);
theory::quantifiers::MacrosQuantMode stringToMacrosQuantMode(std::string option, std::string optarg) throw(OptionException);
static const std::string s_qcfModeHelp;
static const std::string s_qcfWhenModeHelp;
static const std::string s_simplificationHelp;
+ static const std::string s_cbqiBvIneqModeHelp;
static const std::string s_cegqiSingleInvHelp;
static const std::string s_sygusInvTemplHelp;
static const std::string s_termDbModeHelp;
ITE_LIFT_QUANT_MODE_ALL,
};
+enum CbqiBvIneqMode
+{
+ /** solve for inequalities using slack values in model */
+ CBQI_BV_INEQ_EQ_SLACK,
+ /** solve for inequalities using boundary points */
+ CBQI_BV_INEQ_EQ_BOUNDARY,
+ /** solve for inequalities directly, using side conditions */
+ CBQI_BV_INEQ_KEEP,
+};
+
enum CegqiSingleInvMode {
/** do not use single invocation techniques */
CEGQI_SI_MODE_NONE,
use word-level inversion approach for counterexample-guided quantifier instantiation for bit-vectors
option cbqiBvInterleaveValue --cbqi-bv-interleave-value bool :read-write :default false
interleave model value instantiation with word-level inversion approach
-option cbqiBvSlackIneq --cbqi-bv-slack-ineq bool :read-write :default true
- use model slack values when solving inequalities with word-level inversion approach
-option cbqiBvInvInDisEq --cbqi-bv-inv-in-dis-eq bool :read-write :default false
- let bv inverter handle (un)signed less than nodes
+option cbqiBvIneqMode --cbqi-bv-ineq=MODE CVC4::theory::quantifiers::CbqiBvIneqMode :read-write :default CVC4::theory::quantifiers::CBQI_BV_INEQ_EQ_SLACK :include "options/quantifiers_modes.h" :handler stringToCbqiBvIneqMode
+ choose mode for handling bit-vector inequalities with counterexample-guided instantiation
### local theory extensions options
Node atom = lit.getKind() == NOT ? lit[0] : lit;
bool pol = lit.getKind() != NOT;
Kind k = atom.getKind();
- if ((pol && k == EQUAL) || (options::cbqiBvInvInDisEq())) {
- // positively asserted equalities between bitvector terms we leave unmodifed
+ if (pol && k == EQUAL)
+ {
+ // positively asserted equalities between bitvector terms we always leave
+ // unmodified
if (atom[0].getType().isBitVector()) {
return lit;
}
+ }
+ else if (options::cbqiBvIneqMode() == CBQI_BV_INEQ_KEEP)
+ {
+ // if option is set, disequalities and inequalities we leave unmodified
+ if ((k == EQUAL && atom[0].getType().isBitVector()) || k == BITVECTOR_ULT
+ || k == BITVECTOR_SLT)
+ {
+ return lit;
+ }
} else {
bool useSlack = false;
- if (k == EQUAL) {
+ if (k == EQUAL && atom[0].getType().isBitVector())
+ {
// always use slack for disequalities
useSlack = true;
} else if (k == BITVECTOR_ULT || k == BITVECTOR_SLT) {
- if (options::cbqiBvSlackIneq()) {
+ if (options::cbqiBvIneqMode() == CBQI_BV_INEQ_EQ_SLACK)
+ {
useSlack = true;
}
} else {
- // others should be rewritten
- Assert(false);
+ // others are not unhandled
return Node::null();
}
// for all other predicates, we convert them to a positive equality based on