#include "theory/arith/theory_arith.h"
#include "theory/arith/theory_arith_private.h"
#include "theory/quantifiers/term_util.h"
+#include "util/random.h"
using namespace std;
using namespace CVC4::kind;
Node pv,
CegInstEffort effort)
{
- return true;
+ return effort != CEG_INST_EFFORT_FULL;
}
Node ArithInstantiator::hasProcessAssertion(CegInstantiator* ci,
CegInstEffort effort)
{
Node atom = lit.getKind() == NOT ? lit[0] : lit;
- bool pol = lit.getKind() != NOT;
// arithmetic inequalities and disequalities
if (atom.getKind() == GEQ
- || (atom.getKind() == EQUAL && !pol && atom[0].getType().isReal()))
+ || (atom.getKind() == EQUAL && atom[0].getType().isReal()))
{
return lit;
}
bool pol = lit.getKind() != NOT;
// arithmetic inequalities and disequalities
Assert(atom.getKind() == GEQ
- || (atom.getKind() == EQUAL && !pol && atom[0].getType().isReal()));
+ || (atom.getKind() == EQUAL && atom[0].getType().isReal()));
// get model value for pv
Node pv_value = ci->getModelValue(pv);
// cannot contain infinity?
{
return false;
}
- // disequalities are either strict upper or lower bounds
- unsigned rmax = (atom.getKind() == GEQ || options::cbqiModel()) ? 1 : 2;
+ // compute how many bounds we will consider
+ unsigned rmax = 1;
+ if (atom.getKind() == EQUAL && (pol || !options::cbqiModel()))
+ {
+ rmax = 2;
+ }
for (unsigned r = 0; r < rmax; r++)
{
int uires = ires;
}
}
}
+ else if (pol)
+ {
+ // equalities are both non-strict upper and lower bounds
+ uires = r == 0 ? 1 : -1;
+ }
else
{
+ // disequalities are either strict upper or lower bounds
bool is_upper;
if (options::cbqiModel())
{
Node cmp = nm->mkNode(GEQ, lhs_value, rhs_value);
cmp = Rewriter::rewrite(cmp);
Assert(cmp.isConst());
- is_upper = (cmp != ci->getQuantifiersEngine()->getTermUtil()->d_true);
+ is_upper = !cmp.isConst() || !cmp.getConst<bool>();
}
}
else
{
+ // since we are not using the model, we try both.
is_upper = (r == 0);
}
Assert(atom.getKind() == EQUAL && !pol);
bool use_inf = ci->useVtsInfinity()
&& (d_type.isInteger() ? options::cbqiUseInfInt()
: options::cbqiUseInfReal());
- bool upper_first = false;
+ bool upper_first = Random::getRandom().pickWithProb(0.5);
if (options::cbqiMinBounds())
{
upper_first = d_mbp_bounds[1].size() < d_mbp_bounds[0].size();
{
return true;
}
+ else if (!options::cbqiMultiInst())
+ {
+ return false;
+ }
}
}
else
t_values[rr].push_back(Node::null());
// check if it is better than the current best bound : lexicographic
// order infinite/finite/infinitesimal parts
+ bool new_best_set = false;
bool new_best = true;
for (unsigned t = 0; t < 3; t++)
{
value[t]);
value[t] = Rewriter::rewrite(value[t]);
}
- // check if new best
- if (best != -1)
+ // check if new best, if we have not already set it.
+ if (best != -1 && !new_best_set)
{
Assert(!value[t].isNull() && !best_bound_value[t].isNull());
if (value[t] != best_bound_value[t])
Kind k = rr == 0 ? GEQ : LEQ;
Node cmp_bound = nm->mkNode(k, value[t], best_bound_value[t]);
cmp_bound = Rewriter::rewrite(cmp_bound);
- if (cmp_bound
- != ci->getQuantifiersEngine()->getTermUtil()->d_true)
+ // Should be comparing two constant values which should rewrite
+ // to a constant. If a step failed, we assume that this is not
+ // the new best bound.
+ Assert(cmp_bound.isConst());
+ if (!cmp_bound.isConst() || !cmp_bound.getConst<bool>())
{
new_best = false;
break;
}
+ // indicate that the value of new_best is now established.
+ new_best_set = true;
}
}
}
{
return true;
}
+ else if (!options::cbqiMultiInst())
+ {
+ return false;
+ }
}
}
}
{
return true;
}
+ else if (!options::cbqiMultiInst())
+ {
+ return false;
+ }
}
}
if (options::cbqiMidpoint() && !d_type.isInteger())
{
return true;
}
+ else if (!options::cbqiMultiInst())
+ {
+ return false;
+ }
}
}
// generally should not make it to this point, unless we are using a
{
return true;
}
+ else if (!options::cbqiMultiInst())
+ {
+ return false;
+ }
}
}
}
regress1/quantifiers/NUM878.smt2 \
regress1/quantifiers/RND-small.smt2 \
regress1/quantifiers/RNDPRE_4_1-dd-nqe.smt2 \
+ regress1/quantifiers/RND_4_1-existing-inst.smt2 \
regress1/quantifiers/RND_4_16.smt2 \
regress1/quantifiers/anti-sk-simp.smt2 \
regress1/quantifiers/ari118-bv-2occ-x.smt2 \
regress1/quantifiers/qcft-javafe.filespace.TreeWalker.006.smt2 \
regress1/quantifiers/qcft-smtlib3dbc51.smt2 \
regress1/quantifiers/quaternion_ds1_symm_0428.fof.smt2 \
+ regress1/quantifiers/repair-const-nterm.smt2 \
regress1/quantifiers/recfact.cvc \
regress1/quantifiers/rew-to-0211-dd.smt2 \
regress1/quantifiers/ricart-agrawala6.smt2 \