The arithmetic inference manager did rewrite conflicts, which lead to nodes from the conflict not being assumptions (but rewritten assumptions) triggering an assertion. This rewrite is now removed.
Furthermore rewrites triggering the same assertion within the icp subsolver have been refactored to avoid this issue.
#include "theory/arith/bound_inference.h"
#include "theory/arith/normal_form.h"
+#include "theory/rewriter.h"
namespace CVC4 {
namespace theory {
bool BoundInference::add(const Node& n)
{
// Parse the node as a comparison
- auto comp = Comparison::parseNormalForm(n);
+ auto comp = Comparison::parseNormalForm(Rewriter::rewrite(n));
auto dec = comp.decompose(true);
if (std::get<0>(dec).isVariable())
{
case InferenceId::NL_IAND_VALUE_REFINE: return "IAND_VALUE_REFINE";
case InferenceId::NL_CAD_CONFLICT: return "CAD_CONFLICT";
case InferenceId::NL_CAD_EXCLUDED_INTERVAL: return "CAD_EXCLUDED_INTERVAL";
+ case InferenceId::NL_ICP_CONFLICT: return "ICP_CONFLICT";
+ case InferenceId::NL_ICP_PROPAGATION: return "ICP_PROPAGATION";
default: return "?";
}
}
{
Trace("arith::infman") << "Adding conflict: " << inftype << " " << conf
<< std::endl;
- conflict(Rewriter::rewrite(conf));
+ conflict(conf);
}
bool InferenceManager::hasUsed() const
std::vector<Candidate> ICPSolver::constructCandidates(const Node& n)
{
- auto comp = Comparison::parseNormalForm(n).decompose(false);
+ auto comp =
+ Comparison::parseNormalForm(Rewriter::rewrite(n)).decompose(false);
Kind k = std::get<1>(comp);
if (k == Kind::DISTINCT)
{
d_state.reset();
for (const auto& n : assertions)
{
- Node tmp = Rewriter::rewrite(n);
- Trace("nl-icp") << "Adding " << tmp << std::endl;
- if (tmp.getKind() != Kind::CONST_BOOLEAN)
+ Trace("nl-icp") << "Adding " << n << std::endl;
+ if (n.getKind() != Kind::CONST_BOOLEAN)
{
- if (!d_state.d_bounds.add(tmp))
+ if (!d_state.d_bounds.add(n))
{
- addCandidate(tmp);
+ addCandidate(n);
}
}
}
regress0/arith/issue3683.smt2
regress0/arith/issue4367.smt2
regress0/arith/issue4525.smt2
+ regress0/arith/issue5219-conflict-rewrite.smt2
regress0/arith/ite-lift.smt2
regress0/arith/leq.01.smtv1.smt2
regress0/arith/miplib.cvc
--- /dev/null
+; REQUIRES: poly
+; COMMAND-LINE: --theoryof-mode=term --nl-ext --nl-icp
+; EXPECT: unknown
+(set-logic QF_NRA)
+(declare-fun x () Real)
+(declare-fun y () Real)
+(assert (and (< 1 y) (= y (+ x (* x x)))))
+(check-sat)