This PR enables `--nl-cad` for QF_NRA (and QF_UFNRA) by default to improve nonlinear arithmetic solving.
Furthermore, it takes care of disabling it when libpoly is not available. It also adds a fix to the CadSolver that avoids incorrect SATs in the presence of theory combination.
long = "nl-ext"
type = "bool"
default = "true"
- read_only = true
help = "incremental linearization approach to non-linear"
[[option]]
category = "regular"
long = "nl-cad"
type = "bool"
- default = "false"
+ default = "true"
help = "whether to use the cylindrical algebraic decomposition solver for non-linear arithmetic"
[[option]]
{
throw OptionException("--proof-new is not yet supported.");
}
+
+ if (logic == LogicInfo("QF_UFNRA"))
+ {
+#ifdef CVC4_USE_POLY
+ if (!options::nlCad() && !options::nlCad.wasSetByUser())
+ {
+ options::nlCad.set(true);
+ options::nlExt.set(false);
+ options::nlRlvMode.set(options::NlRlvMode::INTERLEAVE);
+ }
+#endif
+ }
+#ifndef CVC4_USE_POLY
+ if (options::nlCad())
+ {
+ if (options::nlCad.wasSetByUser())
+ {
+ std::stringstream ss;
+ ss << "Cannot use " << options::nlCad.getName() << " without configuring with --poly.";
+ throw OptionException(ss.str());
+ }
+ else
+ {
+ Notice() << "Cannot use --" << options::nlCad.getName()
+ << " without configuring with --poly." << std::endl;
+ options::nlCad.set(false);
+ options::nlExt.set(true);
+ }
+ }
+#endif
}
} // namespace smt
#include <poly/polyxx.h>
#endif
+#include "options/arith_options.h"
#include "theory/arith/inference_id.h"
#include "theory/arith/nl/cad/cdcac.h"
#include "theory/arith/nl/poly_conversion.h"
{
return false;
}
- assertions.clear();
+ bool foundNonVariable = false;
for (const auto& v : d_CAC.getVariableOrdering())
{
Node variable = d_CAC.getConstraints().varMapper()(v);
+ if (!variable.isVar())
+ {
+ Trace("nl-cad") << "Not a variable: " << variable << std::endl;
+ foundNonVariable = true;
+ }
Node value = value_to_node(d_CAC.getModel().get(v), d_ranVariable);
if (value.isConst())
{
}
Trace("nl-cad") << "-> " << v << " = " << value << std::endl;
}
+ if (foundNonVariable)
+ {
+ Trace("nl-cad")
+ << "Some variable was an extended term, don't clear list of assertions."
+ << std::endl;
+ return false;
+ }
+ Trace("nl-cad") << "Constructed a full assignment, clear list of assertions."
+ << std::endl;
+ assertions.clear();
return true;
#else
Warning() << "Tried to use CadSolver but libpoly is not available. Compile "
-; COMMAND-LINE: --iand-mode=value
-; COMMAND-LINE: --iand-mode=sum --bvand-integer-granularity=1 --finite-model-find
+; COMMAND-LINE: --iand-mode=value --no-check-models
+; COMMAND-LINE: --iand-mode=sum --bvand-integer-granularity=1 --finite-model-find --no-check-models
; EXPECT: sat
(set-logic QF_NIA)
(set-info :status sat)
-; SCRUBBER: sed -e 's/BOUND_VARIABLE_[0-9]*/BOUND_VARIABLE/; s/((x (witness ((BOUND_VARIABLE Real)) (or (= BOUND_VARIABLE.*/SUCCESS/'
+; SCRUBBER: sed -e 's/BOUND_VARIABLE_[0-9]*/BOUND_VARIABLE/; s/((x (witness ((BOUND_VARIABLE Real)) (.*/SUCCESS/'
; COMMAND-LINE: --produce-models --model-witness-value --no-check-models
; EXPECT: sat
; EXPECT: SUCCESS