mirror of
https://github.com/Z3Prover/z3
synced 2025-06-20 04:43:39 +00:00
nla_interval initial review (#101)
* updates Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * code review of nla_intervals: combine functionality Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * tidy Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * formatting Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
26956cafb0
commit
b6c28764f8
2 changed files with 346 additions and 616 deletions
|
@ -4,34 +4,7 @@
|
||||||
#include "util/mpq.h"
|
#include "util/mpq.h"
|
||||||
|
|
||||||
namespace nla {
|
namespace nla {
|
||||||
void intervals::set_var_interval_with_deps(lpvar v, interval& b) const {
|
|
||||||
TRACE("nla_intervals_details", m_core->print_var(v, tout) << "\n";);
|
|
||||||
lp::constraint_index ci;
|
|
||||||
rational val;
|
|
||||||
bool is_strict;
|
|
||||||
if (ls().has_lower_bound(v, ci, val, is_strict)) {
|
|
||||||
m_config.set_lower(b, val);
|
|
||||||
m_config.set_lower_is_open(b, is_strict);
|
|
||||||
m_config.set_lower_is_inf(b, false);
|
|
||||||
b.m_lower_dep = mk_dep(ci);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_config.set_lower_is_open(b, true);
|
|
||||||
m_config.set_lower_is_inf(b, true);
|
|
||||||
b.m_lower_dep = nullptr;
|
|
||||||
}
|
|
||||||
if (ls().has_upper_bound(v, ci, val, is_strict)) {
|
|
||||||
m_config.set_upper(b, val);
|
|
||||||
m_config.set_upper_is_open(b, is_strict);
|
|
||||||
m_config.set_upper_is_inf(b, false);
|
|
||||||
b.m_upper_dep = mk_dep(ci);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_config.set_upper_is_open(b, true);
|
|
||||||
m_config.set_upper_is_inf(b, true);
|
|
||||||
b.m_upper_dep = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void intervals::set_interval_for_scalar(interv& a, const rational& v) {
|
void intervals::set_interval_for_scalar(interv& a, const rational& v) {
|
||||||
set_lower(a, v);
|
set_lower(a, v);
|
||||||
|
@ -42,105 +15,19 @@ void intervals::set_interval_for_scalar(interv& a, const rational& v) {
|
||||||
set_upper_is_inf(a, false);
|
set_upper_is_inf(a, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const nex* intervals::get_inf_interval_child(const nex_sum& e) const {
|
||||||
|
for (auto * c : e) {
|
||||||
intervals::interv intervals::power_with_deps(const interv& a, unsigned n) {
|
if (has_inf_interval(*c))
|
||||||
interv b;
|
|
||||||
interval_deps_combine_rule combine_rule;
|
|
||||||
power(a, n, b, combine_rule);
|
|
||||||
combine_deps(a, combine_rule, b);
|
|
||||||
TRACE("nla_horner_details", tout << "power of "; display(tout, a) << " = ";
|
|
||||||
display(tout, b) << "\n"; );
|
|
||||||
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
intervals::interv intervals::interval_of_expr_with_deps(const nex* e, unsigned power) {
|
|
||||||
interv a;
|
|
||||||
switch (e->type()) {
|
|
||||||
case expr_type::SCALAR:
|
|
||||||
set_interval_for_scalar(a, to_scalar(e)->value());
|
|
||||||
if (power != 1) {
|
|
||||||
return power_with_deps(a, power);
|
|
||||||
}
|
|
||||||
return a;
|
|
||||||
case expr_type::SUM:
|
|
||||||
{
|
|
||||||
interv b = interval_of_sum_with_deps(to_sum(e));
|
|
||||||
if (power != 1)
|
|
||||||
return power_with_deps(b, power);
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
case expr_type::MUL:
|
|
||||||
{
|
|
||||||
interv b = interval_of_mul_with_deps(to_mul(e));
|
|
||||||
if (power != 1)
|
|
||||||
return power_with_deps(b, power);;
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
case expr_type::VAR:
|
|
||||||
set_var_interval_with_deps(to_var(e)->var(), a);
|
|
||||||
if (power != 1)
|
|
||||||
return power_with_deps(a, power);;
|
|
||||||
return a;
|
|
||||||
default:
|
|
||||||
TRACE("nla_intervals_details", tout << e->type() << "\n";);
|
|
||||||
SASSERT(false);
|
|
||||||
return interv();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
intervals::interv intervals::interval_of_expr(const nex* e, unsigned power) {
|
|
||||||
TRACE("nla_intervals_details", tout << "e = " << *e << "\n";);
|
|
||||||
interv a;
|
|
||||||
switch (e->type()) {
|
|
||||||
case expr_type::SCALAR:
|
|
||||||
set_interval_for_scalar(a, to_scalar(e)->value());
|
|
||||||
break;
|
|
||||||
case expr_type::SUM:
|
|
||||||
{
|
|
||||||
interv b = interval_of_sum(to_sum(e));
|
|
||||||
if (power != 1) {
|
|
||||||
return power_with_deps(b, power);;
|
|
||||||
}
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
case expr_type::MUL:
|
|
||||||
{
|
|
||||||
interv b = interval_of_mul(to_mul(e));
|
|
||||||
if (power != 1) {
|
|
||||||
return power_with_deps(b, power);;
|
|
||||||
}
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
case expr_type::VAR:
|
|
||||||
set_var_interval(to_var(e)->var(), a);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
TRACE("nla_intervals_details", tout << e->type() << "\n";);
|
|
||||||
SASSERT(false);
|
|
||||||
return interv();
|
|
||||||
}
|
|
||||||
if (power != 1) {
|
|
||||||
return power_with_deps(a, power);;
|
|
||||||
}
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
const nex* intervals::get_inf_interval_child(const nex_sum* e) const {
|
|
||||||
for (auto * c : *e) {
|
|
||||||
if (has_inf_interval(c))
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool intervals::mul_has_inf_interval(const nex_mul* e) const {
|
bool intervals::mul_has_inf_interval(const nex_mul& e) const {
|
||||||
bool has_inf = false;
|
bool has_inf = false;
|
||||||
for (const auto & p : *e) {
|
for (const auto & p : e) {
|
||||||
const nex *c = p.e();
|
const nex &c = *p.e();
|
||||||
if (!c->is_elementary())
|
if (!c.is_elementary())
|
||||||
return false;
|
return false;
|
||||||
if (has_zero_interval(c))
|
if (has_zero_interval(c))
|
||||||
return false;
|
return false;
|
||||||
|
@ -149,99 +36,33 @@ bool intervals::mul_has_inf_interval(const nex_mul* e) const {
|
||||||
return has_inf;
|
return has_inf;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool intervals::has_inf_interval(const nex* e) const {
|
bool intervals::has_inf_interval(const nex& e) const {
|
||||||
if (e->is_var())
|
if (e.is_var())
|
||||||
return m_core->no_bounds(to_var(e)->var());
|
return m_core->no_bounds(e.to_var().var());
|
||||||
if (e->is_mul()) {
|
if (e.is_mul())
|
||||||
return mul_has_inf_interval(to_mul(e));
|
return mul_has_inf_interval(e.to_mul());
|
||||||
}
|
if (e.is_scalar())
|
||||||
if (e->is_scalar())
|
|
||||||
return false;
|
return false;
|
||||||
for (auto * c : e->to_sum()) {
|
for (auto * c : e.to_sum())
|
||||||
if (has_inf_interval(c))
|
if (has_inf_interval(*c))
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool intervals::has_zero_interval(const nex* e) const {
|
bool intervals::has_zero_interval(const nex& e) const {
|
||||||
SASSERT(!e->is_scalar() || !to_scalar(e)->value().is_zero());
|
SASSERT(!e.is_scalar() || !e.to_scalar().value().is_zero());
|
||||||
return e->is_var() && m_core->var_is_fixed_to_zero(e->to_var().var());
|
return e.is_var() && m_core->var_is_fixed_to_zero(e.to_var().var());
|
||||||
}
|
}
|
||||||
|
|
||||||
const nex* intervals::get_zero_interval_child(const nex_mul* e) const {
|
const nex* intervals::get_zero_interval_child(const nex_mul& e) const {
|
||||||
for (const auto & p : *e) {
|
for (const auto & p : e) {
|
||||||
const nex * c = p.e();
|
const nex * c = p.e();
|
||||||
if (has_zero_interval(c))
|
if (has_zero_interval(*c))
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
intervals::interv intervals::interval_of_mul_with_deps(const nex_mul* e) {
|
|
||||||
TRACE("nla_intervals_details", tout << "e = " << *e << "\n";);
|
|
||||||
const nex * zero_interval_child = get_zero_interval_child(e);
|
|
||||||
if (zero_interval_child) {
|
|
||||||
interv a = interval_of_expr_with_deps(zero_interval_child, 1);
|
|
||||||
set_zero_interval_deps_for_mult(a);
|
|
||||||
TRACE("nla_intervals_details", tout << "zero_interval_child = "<< *zero_interval_child << std::endl << "a = "; display(tout, a); );
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
interv a;
|
|
||||||
set_interval_for_scalar(a, e->coeff());
|
|
||||||
TRACE("nla_intervals_details", tout << "a = "; display(tout, a); );
|
|
||||||
for (const auto & ep : *e) {
|
|
||||||
interv b = interval_of_expr_with_deps(ep.e(), ep.pow());
|
|
||||||
TRACE("nla_intervals_details", tout << "ep = " << ep << ", "; display(tout, b); );
|
|
||||||
interv c;
|
|
||||||
interval_deps_combine_rule comb_rule;
|
|
||||||
mul_two_intervals(a, b, c, comb_rule);
|
|
||||||
TRACE("nla_intervals_details", tout << "c before combine_deps() "; display(tout, c););
|
|
||||||
combine_deps(a, b, comb_rule, c);
|
|
||||||
TRACE("nla_intervals_details", tout << "a "; display(tout, a););
|
|
||||||
TRACE("nla_intervals_details", tout << "c "; display(tout, c););
|
|
||||||
set_with_deps(a, c);
|
|
||||||
TRACE("nla_intervals_details", tout << "part mult "; display(tout, a););
|
|
||||||
}
|
|
||||||
TRACE("nla_intervals_details", tout << "e=" << *e << "\n";
|
|
||||||
tout << " return "; display(tout, a););
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
intervals::interv intervals::interval_of_mul(const nex_mul* e) {
|
|
||||||
TRACE("nla_intervals_details", tout << "e = " << *e << "\n";);
|
|
||||||
const nex * zero_interval_child = get_zero_interval_child(e);
|
|
||||||
if (zero_interval_child) {
|
|
||||||
interv a = interval_of_expr(zero_interval_child, 1);
|
|
||||||
set_zero_interval_deps_for_mult(a);
|
|
||||||
TRACE("nla_intervals_details", tout << "zero_interval_child = "<< *zero_interval_child << std::endl << "a = "; display(tout, a); );
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
interv a;
|
|
||||||
|
|
||||||
set_interval_for_scalar(a, e->coeff());
|
|
||||||
TRACE("nla_intervals_details", tout << "a = "; display(tout, a); );
|
|
||||||
for (const auto & ep : *e) {
|
|
||||||
interv b = interval_of_expr(ep.e(), ep.pow() );
|
|
||||||
TRACE("nla_intervals_details", tout << "ep = " << ep << ", "; display(tout, b); );
|
|
||||||
interv c;
|
|
||||||
interval_deps_combine_rule comb_rule;
|
|
||||||
mul_two_intervals(a, b, c, comb_rule);
|
|
||||||
TRACE("nla_intervals_details", tout << "c before combine_deps() "; display(tout, c););
|
|
||||||
combine_deps(a, b, comb_rule, c);
|
|
||||||
TRACE("nla_intervals_details", tout << "a "; display(tout, a););
|
|
||||||
TRACE("nla_intervals_details", tout << "c "; display(tout, c););
|
|
||||||
set_with_no_deps(a, c);
|
|
||||||
TRACE("nla_intervals_details", tout << "part mult "; display(tout, a););
|
|
||||||
}
|
|
||||||
TRACE("nla_intervals_details", tout << "e=" << *e << "\n";
|
|
||||||
tout << " return "; display(tout, a););
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream & intervals::print_dependencies(ci_dependency* deps , std::ostream& out) const {
|
std::ostream & intervals::print_dependencies(ci_dependency* deps , std::ostream& out) const {
|
||||||
svector<lp::constraint_index> expl;
|
svector<lp::constraint_index> expl;
|
||||||
m_dep_manager.linearize(deps, expl);
|
m_dep_manager.linearize(deps, expl);
|
||||||
|
@ -260,64 +81,18 @@ std::ostream & intervals::print_dependencies(ci_dependency* deps , std::ostream&
|
||||||
// return true iff the interval of n is does not contain 0
|
// return true iff the interval of n is does not contain 0
|
||||||
bool intervals::check_nex(const nex* n, ci_dependency* initial_deps) {
|
bool intervals::check_nex(const nex* n, ci_dependency* initial_deps) {
|
||||||
m_core->lp_settings().stats().m_cross_nested_forms++;
|
m_core->lp_settings().stats().m_cross_nested_forms++;
|
||||||
auto i = interval_of_expr(n, 1);
|
auto i = interval_of_expr<without_deps>(n, 1);
|
||||||
if (!separated_from_zero(i)) {
|
if (!separated_from_zero(i)) {
|
||||||
reset();
|
reset();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
auto interv_wd = interval_of_expr_with_deps(n, 1);
|
auto interv_wd = interval_of_expr<with_deps>(n, 1);
|
||||||
TRACE("grobner", tout << "conflict: interv_wd = "; display(tout, interv_wd ) <<"expr = " << *n << "\n, initial deps\n"; print_dependencies(initial_deps, tout););
|
TRACE("grobner", tout << "conflict: interv_wd = "; display(tout, interv_wd ) <<"expr = " << *n << "\n, initial deps\n"; print_dependencies(initial_deps, tout););
|
||||||
check_interval_for_conflict_on_zero(interv_wd, initial_deps);
|
check_interval_for_conflict_on_zero(interv_wd, initial_deps);
|
||||||
reset(); // clean the memory allocated by the interval bound dependencies
|
reset(); // clean the memory allocated by the interval bound dependencies
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
intervals::interv intervals::interval_of_sum_no_term_with_deps(const nex_sum* e) {
|
|
||||||
const nex* inf_e = get_inf_interval_child(e);
|
|
||||||
if (inf_e) {
|
|
||||||
return interv();
|
|
||||||
}
|
|
||||||
auto & es = *e;
|
|
||||||
interv a = interval_of_expr_with_deps(es[0], 1);
|
|
||||||
for (unsigned k = 1; k < es.size(); k++) {
|
|
||||||
TRACE("nla_intervals_details_sum", tout << "es[" << k << "]= " << *es[k] << "\n";);
|
|
||||||
interv b = interval_of_expr_with_deps(es[k], 1);
|
|
||||||
interv c;
|
|
||||||
interval_deps_combine_rule combine_rule;
|
|
||||||
TRACE("nla_intervals_details_sum", tout << "a = "; display(tout, a) << "\nb = "; display(tout, b) << "\n";);
|
|
||||||
add(a, b, c, combine_rule);
|
|
||||||
combine_deps(a, b, combine_rule, c);
|
|
||||||
set_with_deps(a, c);
|
|
||||||
TRACE("nla_intervals_details_sum", tout << *es[k] << ", ";
|
|
||||||
display(tout, a); tout << "\n";);
|
|
||||||
}
|
|
||||||
TRACE("nla_intervals_details", tout << "e=" << *e << "\n";
|
|
||||||
tout << " interv = "; display(tout, a););
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
intervals::interv intervals::interval_of_sum_no_term(const nex_sum* e) {
|
|
||||||
const nex* inf_e = get_inf_interval_child(e);
|
|
||||||
if (inf_e) {
|
|
||||||
return interv();
|
|
||||||
}
|
|
||||||
auto & es = *e;
|
|
||||||
interv a = interval_of_expr(es[0], 1);
|
|
||||||
for (unsigned k = 1; k < es.size(); k++) {
|
|
||||||
TRACE("nla_intervals_details_sum", tout << "es[" << k << "]= " << *es[k] << "\n";);
|
|
||||||
interv b = interval_of_expr(es[k], 1);
|
|
||||||
interv c;
|
|
||||||
TRACE("nla_intervals_details_sum", tout << "a = "; display(tout, a) << "\nb = "; display(tout, b) << "\n";);
|
|
||||||
add(a, b, c);
|
|
||||||
set_with_no_deps(a, c);
|
|
||||||
TRACE("nla_intervals_details_sum", tout << *es[k] << ", ";
|
|
||||||
display(tout, a); tout << "\n";);
|
|
||||||
}
|
|
||||||
TRACE("nla_intervals_details", tout << "e=" << *e << "\n";
|
|
||||||
tout << " interv = "; display(tout, a););
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
void intervals::add_mul_of_degree_one_to_vector(const nex_mul* e, vector<std::pair<rational, lpvar>> &v) {
|
void intervals::add_mul_of_degree_one_to_vector(const nex_mul* e, vector<std::pair<rational, lpvar>> &v) {
|
||||||
TRACE("nla_horner_details", tout << *e << "\n";);
|
TRACE("nla_horner_details", tout << *e << "\n";);
|
||||||
SASSERT(e->size() == 1);
|
SASSERT(e->size() == 1);
|
||||||
|
@ -351,7 +126,7 @@ lp::lar_term intervals::expression_to_normalized_term(const nex_sum* e, rational
|
||||||
unsigned a_index;
|
unsigned a_index;
|
||||||
for (const nex* c : *e) {
|
for (const nex* c : *e) {
|
||||||
if (c->is_scalar()) {
|
if (c->is_scalar()) {
|
||||||
b += to_scalar(c)->value();
|
b += c->to_scalar().value();
|
||||||
} else {
|
} else {
|
||||||
add_linear_to_vector(c, v);
|
add_linear_to_vector(c, v);
|
||||||
if (v.empty())
|
if (v.empty())
|
||||||
|
@ -367,8 +142,7 @@ lp::lar_term intervals::expression_to_normalized_term(const nex_sum* e, rational
|
||||||
lp::lar_term t;
|
lp::lar_term t;
|
||||||
|
|
||||||
if (a.is_one()) {
|
if (a.is_one()) {
|
||||||
for (unsigned k = 0; k < v.size(); k++) {
|
for (auto& p : v) {
|
||||||
auto& p = v[k];
|
|
||||||
t.add_coeff_var(p.first, p.second);
|
t.add_coeff_var(p.first, p.second);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -398,126 +172,6 @@ lpvar intervals::find_term_column(const lp::lar_term & norm_t, rational& a) cons
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool intervals::interval_from_term_with_deps(const nex* e, interv & i) const {
|
|
||||||
rational a, b;
|
|
||||||
lp::lar_term norm_t = expression_to_normalized_term(to_sum(e), a, b);
|
|
||||||
lp::explanation exp;
|
|
||||||
if (m_core->explain_by_equiv(norm_t, exp)) {
|
|
||||||
set_zero_interval_with_explanation(i, exp);
|
|
||||||
TRACE("nla_intervals", tout << "explain_by_equiv\n";);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
lpvar j = find_term_column(norm_t, a);
|
|
||||||
if (j + 1 == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
set_var_interval_with_deps(j, i);
|
|
||||||
interv bi;
|
|
||||||
mul_with_deps(a, i, bi);
|
|
||||||
add(b, bi);
|
|
||||||
set_with_deps(i, bi);
|
|
||||||
|
|
||||||
TRACE("nla_intervals",
|
|
||||||
m_core->m_lar_solver.print_column_info(j, tout) << "\n";
|
|
||||||
tout << "a=" << a << ", b=" << b << "\n";
|
|
||||||
tout << *e << ", interval = "; display(tout, i););
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool intervals::interval_from_term(const nex* e, interv & i) const {
|
|
||||||
rational a, b;
|
|
||||||
lp::lar_term norm_t = expression_to_normalized_term(to_sum(e), a, b);
|
|
||||||
lp::explanation exp;
|
|
||||||
if (m_core->explain_by_equiv(norm_t, exp)) {
|
|
||||||
set_zero_interval(i);
|
|
||||||
TRACE("nla_intervals", tout << "explain_by_equiv\n";);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
lpvar j = find_term_column(norm_t, a);
|
|
||||||
if (j + 1 == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
set_var_interval(j, i);
|
|
||||||
interv bi;
|
|
||||||
mul_no_deps(a, i, bi);
|
|
||||||
add(b, bi);
|
|
||||||
set_with_no_deps(i, bi);
|
|
||||||
|
|
||||||
TRACE("nla_intervals",
|
|
||||||
m_core->m_lar_solver.print_column_info(j, tout) << "\n";
|
|
||||||
tout << "a=" << a << ", b=" << b << "\n";
|
|
||||||
tout << *e << ", interval = "; display(tout, i););
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
intervals::interv intervals::interval_of_sum_with_deps(const nex_sum* e) {
|
|
||||||
TRACE("nla_intervals_details", tout << "e=" << *e << "\n";);
|
|
||||||
interv i_e = interval_of_sum_no_term_with_deps(e);
|
|
||||||
if (e->is_a_linear_term()) {
|
|
||||||
SASSERT(e->is_sum() && e->size() > 1);
|
|
||||||
interv i_from_term ;
|
|
||||||
if (interval_from_term_with_deps(e, i_from_term)) {
|
|
||||||
interv r = intersect_with_deps(i_e, i_from_term);
|
|
||||||
TRACE("nla_intervals_details", tout << "intersection="; display(tout, r) << "\n";);
|
|
||||||
if (is_empty(r)) {
|
|
||||||
SASSERT(false); // not implemented
|
|
||||||
}
|
|
||||||
return r;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return i_e;
|
|
||||||
}
|
|
||||||
|
|
||||||
intervals::interv intervals::interval_of_sum(const nex_sum* e) {
|
|
||||||
interv i_e = interval_of_sum_no_term(e);
|
|
||||||
TRACE("nla_intervals_details", tout << "e=" << *e << "\ni_e="; display(tout, i_e) << "\n";);
|
|
||||||
if (e->is_a_linear_term()) {
|
|
||||||
SASSERT(e->is_sum() && e->size() > 1);
|
|
||||||
interv i_from_term ;
|
|
||||||
if (interval_from_term(e, i_from_term)) {
|
|
||||||
TRACE("nla_intervals_details", tout << "i_from_term="; display(tout, i_from_term) << "\n";);
|
|
||||||
interv r = intersect(i_e, i_from_term, 44);
|
|
||||||
TRACE("nla_intervals_details", tout << "intersection="; display(tout, r) << "\n";);
|
|
||||||
if (is_empty(r)) {
|
|
||||||
SASSERT(false); // not implemented
|
|
||||||
}
|
|
||||||
return r;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return i_e;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void intervals::set_var_interval(lpvar v, interval& b) const {
|
|
||||||
lp::constraint_index ci;
|
|
||||||
rational val;
|
|
||||||
bool is_strict;
|
|
||||||
if (ls().has_lower_bound(v, ci, val, is_strict)) {
|
|
||||||
m_config.set_lower(b, val);
|
|
||||||
m_config.set_lower_is_open(b, is_strict);
|
|
||||||
m_config.set_lower_is_inf(b, false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_config.set_lower_is_open(b, true);
|
|
||||||
m_config.set_lower_is_inf(b, true);
|
|
||||||
}
|
|
||||||
if (ls().has_upper_bound(v, ci, val, is_strict)) {
|
|
||||||
m_config.set_upper(b, val);
|
|
||||||
m_config.set_upper_is_open(b, is_strict);
|
|
||||||
m_config.set_upper_is_inf(b, false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_config.set_upper_is_open(b, true);
|
|
||||||
m_config.set_upper_is_inf(b, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void intervals::set_zero_interval_with_explanation(interval& i, const lp::explanation& exp) const {
|
void intervals::set_zero_interval_with_explanation(interval& i, const lp::explanation& exp) const {
|
||||||
auto val = rational(0);
|
auto val = rational(0);
|
||||||
m_config.set_lower(i, val);
|
m_config.set_lower(i, val);
|
||||||
|
@ -564,7 +218,6 @@ bool intervals::separated_from_zero_on_upper(const interval& i) const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool intervals::check_interval_for_conflict_on_zero(const interval & i, ci_dependency* dep) {
|
bool intervals::check_interval_for_conflict_on_zero(const interval & i, ci_dependency* dep) {
|
||||||
return check_interval_for_conflict_on_zero_lower(i, dep) || check_interval_for_conflict_on_zero_upper(i, dep);
|
return check_interval_for_conflict_on_zero_lower(i, dep) || check_interval_for_conflict_on_zero_upper(i, dep);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,78 +34,79 @@ class intervals {
|
||||||
typedef ci_dependency_manager::dependency ci_dependency;
|
typedef ci_dependency_manager::dependency ci_dependency;
|
||||||
|
|
||||||
class im_config {
|
class im_config {
|
||||||
unsynch_mpq_manager& m_manager;
|
unsynch_mpq_manager& m_manager;
|
||||||
common::ci_dependency_manager& m_dep_manager;
|
common::ci_dependency_manager& m_dep_manager;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef unsynch_mpq_manager numeral_manager;
|
typedef unsynch_mpq_manager numeral_manager;
|
||||||
|
|
||||||
|
|
||||||
struct interval {
|
struct interval {
|
||||||
interval():
|
interval() :
|
||||||
m_lower(), m_upper(),
|
m_lower(), m_upper(),
|
||||||
m_lower_open(1), m_upper_open(1),
|
m_lower_open(1), m_upper_open(1),
|
||||||
m_lower_inf(1), m_upper_inf(1),
|
m_lower_inf(1), m_upper_inf(1),
|
||||||
m_lower_dep(nullptr), m_upper_dep(nullptr) {}
|
m_lower_dep(nullptr), m_upper_dep(nullptr) {}
|
||||||
mpq m_lower;
|
mpq m_lower;
|
||||||
mpq m_upper;
|
mpq m_upper;
|
||||||
unsigned m_lower_open:1;
|
unsigned m_lower_open : 1;
|
||||||
unsigned m_upper_open:1;
|
unsigned m_upper_open : 1;
|
||||||
unsigned m_lower_inf:1;
|
unsigned m_lower_inf : 1;
|
||||||
unsigned m_upper_inf:1;
|
unsigned m_upper_inf : 1;
|
||||||
ci_dependency * m_lower_dep; // justification for the lower bound
|
ci_dependency* m_lower_dep; // justification for the lower bound
|
||||||
ci_dependency * m_upper_dep; // justification for the upper bound
|
ci_dependency* m_upper_dep; // justification for the upper bound
|
||||||
};
|
};
|
||||||
|
|
||||||
void add_deps(interval const& a, interval const& b,
|
void add_deps(interval const& a, interval const& b,
|
||||||
interval_deps_combine_rule const& deps, interval& i) const {
|
interval_deps_combine_rule const& deps, interval& i) const {
|
||||||
i.m_lower_dep = lower_is_inf(i) ? nullptr : mk_dependency(a, b, deps.m_lower_combine);
|
i.m_lower_dep = lower_is_inf(i) ? nullptr : mk_dependency(a, b, deps.m_lower_combine);
|
||||||
i.m_upper_dep = upper_is_inf(i) ? nullptr : mk_dependency(a, b, deps.m_upper_combine);
|
i.m_upper_dep = upper_is_inf(i) ? nullptr : mk_dependency(a, b, deps.m_upper_combine);
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_deps(interval const& a,
|
void add_deps(interval const& a,
|
||||||
interval_deps_combine_rule const& deps, interval& i) const {
|
interval_deps_combine_rule const& deps, interval& i) const {
|
||||||
i.m_lower_dep = lower_is_inf(i) ? nullptr : mk_dependency(a, deps.m_lower_combine);
|
i.m_lower_dep = lower_is_inf(i) ? nullptr : mk_dependency(a, deps.m_lower_combine);
|
||||||
i.m_upper_dep = upper_is_inf(i) ? nullptr : mk_dependency(a, deps.m_upper_combine);
|
i.m_upper_dep = upper_is_inf(i) ? nullptr : mk_dependency(a, deps.m_upper_combine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Should be NOOPs for precise mpq types.
|
// Should be NOOPs for precise mpq types.
|
||||||
// For imprecise types (e.g., floats) it should set the rounding mode.
|
// For imprecise types (e.g., floats) it should set the rounding mode.
|
||||||
void round_to_minus_inf() {}
|
void round_to_minus_inf() {}
|
||||||
void round_to_plus_inf() {}
|
void round_to_plus_inf() {}
|
||||||
void set_rounding(bool to_plus_inf) {}
|
void set_rounding(bool to_plus_inf) {}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
mpq const & lower(interval const & a) const { return a.m_lower; }
|
mpq const& lower(interval const& a) const { return a.m_lower; }
|
||||||
mpq const & upper(interval const & a) const { return a.m_upper; }
|
mpq const& upper(interval const& a) const { return a.m_upper; }
|
||||||
mpq & lower(interval & a) { return a.m_lower; }
|
mpq& lower(interval& a) { return a.m_lower; }
|
||||||
mpq & upper(interval & a) { return a.m_upper; }
|
mpq& upper(interval& a) { return a.m_upper; }
|
||||||
bool lower_is_open(interval const & a) const { return a.m_lower_open; }
|
bool lower_is_open(interval const& a) const { return a.m_lower_open; }
|
||||||
bool upper_is_open(interval const & a) const { return a.m_upper_open; }
|
bool upper_is_open(interval const& a) const { return a.m_upper_open; }
|
||||||
bool lower_is_inf(interval const & a) const { return a.m_lower_inf; }
|
bool lower_is_inf(interval const& a) const { return a.m_lower_inf; }
|
||||||
bool upper_is_inf(interval const & a) const { return a.m_upper_inf; }
|
bool upper_is_inf(interval const& a) const { return a.m_upper_inf; }
|
||||||
bool is_inf(interval const & a) const { return upper_is_inf(a) && lower_is_inf(a); }
|
bool is_inf(interval const& a) const { return upper_is_inf(a) && lower_is_inf(a); }
|
||||||
bool is_zero(interval const & a) const {
|
bool is_zero(interval const& a) const {
|
||||||
return (!lower_is_inf(a)) && (!upper_is_inf(a)) &&
|
return (!lower_is_inf(a)) && (!upper_is_inf(a)) &&
|
||||||
(!lower_is_open(a)) && (!upper_is_open(a)) &&
|
(!lower_is_open(a)) && (!upper_is_open(a)) &&
|
||||||
unsynch_mpq_manager::is_zero(a.m_lower) &&
|
unsynch_mpq_manager::is_zero(a.m_lower) &&
|
||||||
unsynch_mpq_manager::is_zero(a.m_upper); }
|
unsynch_mpq_manager::is_zero(a.m_upper);
|
||||||
|
}
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
void set_lower(interval & a, mpq const & n) const { m_manager.set(a.m_lower, n); }
|
void set_lower(interval& a, mpq const& n) const { m_manager.set(a.m_lower, n); }
|
||||||
void set_upper(interval & a, mpq const & n) const { m_manager.set(a.m_upper, n); }
|
void set_upper(interval& a, mpq const& n) const { m_manager.set(a.m_upper, n); }
|
||||||
void set_lower(interval & a, rational const & n) const { set_lower(a, n.to_mpq()); }
|
void set_lower(interval& a, rational const& n) const { set_lower(a, n.to_mpq()); }
|
||||||
void set_upper(interval & a, rational const & n) const { set_upper(a, n.to_mpq()); }
|
void set_upper(interval& a, rational const& n) const { set_upper(a, n.to_mpq()); }
|
||||||
void set_lower_is_open(interval & a, bool v) const { a.m_lower_open = v; }
|
void set_lower_is_open(interval& a, bool v) const { a.m_lower_open = v; }
|
||||||
void set_upper_is_open(interval & a, bool v) const { a.m_upper_open = v; }
|
void set_upper_is_open(interval& a, bool v) const { a.m_upper_open = v; }
|
||||||
void set_lower_is_inf(interval & a, bool v) const { a.m_lower_inf = v; }
|
void set_lower_is_inf(interval& a, bool v) const { a.m_lower_inf = v; }
|
||||||
void set_upper_is_inf(interval & a, bool v) const { a.m_upper_inf = v; }
|
void set_upper_is_inf(interval& a, bool v) const { a.m_upper_inf = v; }
|
||||||
|
|
||||||
// Reference to numeral manager
|
// Reference to numeral manager
|
||||||
numeral_manager & m() const { return m_manager; }
|
numeral_manager& m() const { return m_manager; }
|
||||||
|
|
||||||
im_config(numeral_manager & m, ci_dependency_manager& d):m_manager(m), m_dep_manager(d) {}
|
im_config(numeral_manager& m, ci_dependency_manager& d) :m_manager(m), m_dep_manager(d) {}
|
||||||
private:
|
private:
|
||||||
ci_dependency* mk_dependency(interval const& a, interval const& b, deps_combine_rule bd) const {
|
ci_dependency* mk_dependency(interval const& a, interval const& b, deps_combine_rule bd) const {
|
||||||
ci_dependency* dep = nullptr;
|
ci_dependency* dep = nullptr;
|
||||||
|
@ -143,17 +144,19 @@ class intervals {
|
||||||
mutable ci_dependency_manager m_dep_manager;
|
mutable ci_dependency_manager m_dep_manager;
|
||||||
im_config m_config;
|
im_config m_config;
|
||||||
mutable interval_manager<im_config> m_imanager;
|
mutable interval_manager<im_config> m_imanager;
|
||||||
core * m_core;
|
core* m_core;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ci_dependency_manager& dep_manager() { return m_dep_manager; }
|
ci_dependency_manager& dep_manager() { return m_dep_manager; }
|
||||||
typedef interval_manager<im_config>::interval interval;
|
typedef interval_manager<im_config>::interval interval;
|
||||||
private:
|
private:
|
||||||
ci_dependency* mk_dep(lp::constraint_index ci) const;
|
ci_dependency* mk_dep(lp::constraint_index ci) const;
|
||||||
ci_dependency* mk_dep(lp::explanation const &) const;
|
ci_dependency* mk_dep(lp::explanation const&) const;
|
||||||
lp::lar_solver& ls();
|
lp::lar_solver& ls();
|
||||||
const lp::lar_solver& ls() const;
|
const lp::lar_solver& ls() const;
|
||||||
public:
|
public:
|
||||||
|
enum with_deps_t { with_deps, without_deps };
|
||||||
|
|
||||||
intervals(core* c, reslimit& lim) :
|
intervals(core* c, reslimit& lim) :
|
||||||
m_alloc(),
|
m_alloc(),
|
||||||
m_dep_manager(m_val_manager, m_alloc),
|
m_dep_manager(m_val_manager, m_alloc),
|
||||||
|
@ -161,39 +164,35 @@ public:
|
||||||
m_imanager(lim, im_config(m_num_manager, m_dep_manager)),
|
m_imanager(lim, im_config(m_num_manager, m_dep_manager)),
|
||||||
m_core(c)
|
m_core(c)
|
||||||
{}
|
{}
|
||||||
ci_dependency* mk_join(ci_dependency* a, ci_dependency* b) { return m_dep_manager.mk_join(a, b);}
|
ci_dependency* mk_join(ci_dependency* a, ci_dependency* b) { return m_dep_manager.mk_join(a, b); }
|
||||||
ci_dependency* mk_leaf(lp::constraint_index ci) { return m_dep_manager.mk_leaf(ci);}
|
ci_dependency* mk_leaf(lp::constraint_index ci) { return m_dep_manager.mk_leaf(ci); }
|
||||||
|
|
||||||
interval mul(const svector<lpvar>&) const;
|
std::ostream& print_dependencies(ci_dependency*, std::ostream&) const;
|
||||||
void get_explanation_of_upper_bound_for_monomial(lpvar j, svector<lp::constraint_index>& expl) const;
|
|
||||||
void get_explanation_of_lower_bound_for_monomial(lpvar j, svector<lp::constraint_index>& expl) const;
|
|
||||||
std::ostream & print_dependencies(ci_dependency* , std::ostream&) const;
|
|
||||||
std::ostream& print_explanations(const svector<lp::constraint_index> &, std::ostream&) const;
|
|
||||||
std::ostream& display(std::ostream& out, const intervals::interval& i) const;
|
std::ostream& display(std::ostream& out, const intervals::interval& i) const;
|
||||||
void set_lower(interval & a, rational const & n) const { m_config.set_lower(a, n.to_mpq()); }
|
void set_lower(interval& a, rational const& n) const { m_config.set_lower(a, n.to_mpq()); }
|
||||||
void set_upper(interval & a, rational const & n) const { m_config.set_upper(a, n.to_mpq()); }
|
void set_upper(interval& a, rational const& n) const { m_config.set_upper(a, n.to_mpq()); }
|
||||||
void set_lower_is_open(interval & a, bool strict) { m_config.set_lower_is_open(a, strict); }
|
void set_lower_is_open(interval& a, bool strict) { m_config.set_lower_is_open(a, strict); }
|
||||||
void set_lower_is_inf(interval & a, bool inf) { m_config.set_lower_is_inf(a, inf); }
|
void set_lower_is_inf(interval& a, bool inf) { m_config.set_lower_is_inf(a, inf); }
|
||||||
void set_upper_is_open(interval & a, bool strict) { m_config.set_upper_is_open(a, strict); }
|
void set_upper_is_open(interval& a, bool strict) { m_config.set_upper_is_open(a, strict); }
|
||||||
void set_upper_is_inf(interval & a, bool inf) { m_config.set_upper_is_inf(a, inf); }
|
void set_upper_is_inf(interval& a, bool inf) { m_config.set_upper_is_inf(a, inf); }
|
||||||
bool is_zero(const interval& a) const { return m_config.is_zero(a); }
|
bool is_zero(const interval& a) const { return m_config.is_zero(a); }
|
||||||
void set_var_interval(lpvar v, interval & b) const;
|
|
||||||
|
|
||||||
void mul_with_deps(const rational& r, const interval& a, interval& b) const {
|
|
||||||
|
template <enum with_deps_t wd>
|
||||||
|
void mul(const rational& r, const interval& a, interval& b) const {
|
||||||
m_imanager.mul(r.to_mpq(), a, b);
|
m_imanager.mul(r.to_mpq(), a, b);
|
||||||
if (r.is_pos()) {
|
if (wd == with_deps) {
|
||||||
b.m_lower_dep = a.m_lower_dep;
|
if (r.is_pos()) {
|
||||||
b.m_upper_dep = a.m_upper_dep;
|
b.m_lower_dep = a.m_lower_dep;
|
||||||
} else {
|
b.m_upper_dep = a.m_upper_dep;
|
||||||
SASSERT(r.is_neg());
|
}
|
||||||
b.m_upper_dep = a.m_lower_dep;
|
else {
|
||||||
b.m_lower_dep = a.m_upper_dep;
|
SASSERT(r.is_neg());
|
||||||
|
b.m_upper_dep = a.m_lower_dep;
|
||||||
|
b.m_lower_dep = a.m_upper_dep;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mul_no_deps(const rational& r, const interval& a, interval& b) const {
|
|
||||||
m_imanager.mul(r.to_mpq(), a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
void add(const rational& r, interval& a) const {
|
void add(const rational& r, interval& a) const {
|
||||||
if (!a.m_lower_inf) {
|
if (!a.m_lower_inf) {
|
||||||
|
@ -207,18 +206,18 @@ public:
|
||||||
void mul(const interval& a, const interval& b, interval& c) { m_imanager.mul(a, b, c); }
|
void mul(const interval& a, const interval& b, interval& c) { m_imanager.mul(a, b, c); }
|
||||||
void add(const interval& a, const interval& b, interval& c) { m_imanager.add(a, b, c); }
|
void add(const interval& a, const interval& b, interval& c) { m_imanager.add(a, b, c); }
|
||||||
void add(const interval& a, const interval& b, interval& c, interval_deps_combine_rule& deps) { m_imanager.add(a, b, c, deps); }
|
void add(const interval& a, const interval& b, interval& c, interval_deps_combine_rule& deps) { m_imanager.add(a, b, c, deps); }
|
||||||
void set_with_deps(interval& a, const interval& b) const {
|
|
||||||
m_imanager.set(a, b);
|
|
||||||
a.m_lower_dep = b.m_lower_dep;
|
|
||||||
a.m_upper_dep = b.m_upper_dep;
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_with_no_deps(interval& a, const interval& b) const {
|
template <enum with_deps_t wd>
|
||||||
|
void set(interval& a, const interval& b) const {
|
||||||
m_imanager.set(a, b);
|
m_imanager.set(a, b);
|
||||||
|
if (wd == with_deps) {
|
||||||
|
a.m_lower_dep = b.m_lower_dep;
|
||||||
|
a.m_upper_dep = b.m_upper_dep;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mul_two_intervals(const interval& a, const interval& b, interval& c, interval_deps_combine_rule& deps) { m_imanager.mul(a, b, c, deps); }
|
void mul_two_intervals(const interval& a, const interval& b, interval& c, interval_deps_combine_rule& deps) { m_imanager.mul(a, b, c, deps); }
|
||||||
|
|
||||||
void combine_deps(interval const& a, interval const& b, interval_deps_combine_rule const& deps, interval& i) const {
|
void combine_deps(interval const& a, interval const& b, interval_deps_combine_rule const& deps, interval& i) const {
|
||||||
SASSERT(&a != &i && &b != &i);
|
SASSERT(&a != &i && &b != &i);
|
||||||
m_config.add_deps(a, b, deps, i);
|
m_config.add_deps(a, b, deps, i);
|
||||||
|
@ -229,221 +228,310 @@ public:
|
||||||
m_config.add_deps(a, deps, i);
|
m_config.add_deps(a, deps, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void power(interval const & a, unsigned n, interval & b, interval_deps_combine_rule & b_deps) {
|
template <enum with_deps_t wd>
|
||||||
m_imanager.power(a, n, b, b_deps);
|
interval power(const interval& a, unsigned n) {
|
||||||
|
interv b;
|
||||||
|
if (with_deps == wd) {
|
||||||
|
interval_deps_combine_rule combine_rule;
|
||||||
|
m_imanager.power(a, n, b, combine_rule);
|
||||||
|
combine_deps(a, combine_rule, b);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_imanager.power(a, n, b);
|
||||||
|
}
|
||||||
|
TRACE("nla_horner_details", tout << "power of "; display(tout, a) << " = ";
|
||||||
|
display(tout, b) << "\n"; );
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
void power(interval const & a, unsigned n, interval & b) {
|
template <enum with_deps_t wd>
|
||||||
m_imanager.power(a, n, b);
|
void update_lower_for_intersection(const interval& a, const interval& b, interval& i) const {
|
||||||
}
|
if (a.m_lower_inf) {
|
||||||
|
|
||||||
void update_lower_for_intersection(const interval& a, const interval& b, interval & i) const {
|
|
||||||
if (a.m_lower_inf) {
|
|
||||||
if (b.m_lower_inf)
|
if (b.m_lower_inf)
|
||||||
return;
|
return;
|
||||||
copy_lower_bound(b, i);
|
copy_lower_bound<wd>(b, i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (b.m_lower_inf) {
|
||||||
if (b.m_lower_inf) {
|
|
||||||
SASSERT(!a.m_lower_inf);
|
SASSERT(!a.m_lower_inf);
|
||||||
copy_lower_bound(a, i);
|
copy_lower_bound<wd>(a, i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_num_manager.lt(a.m_lower, b.m_lower)) {
|
if (m_num_manager.lt(a.m_lower, b.m_lower)) {
|
||||||
copy_lower_bound(b, i);
|
copy_lower_bound<wd>(b, i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_num_manager.gt(a.m_lower, b.m_lower)) {
|
if (m_num_manager.gt(a.m_lower, b.m_lower)) {
|
||||||
copy_lower_bound(a, i);
|
copy_lower_bound<wd>(a, i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SASSERT(m_num_manager.eq(a.m_lower, b.m_lower));
|
SASSERT(m_num_manager.eq(a.m_lower, b.m_lower));
|
||||||
if (a.m_lower_open) { // we might consider to look at b.m_lower_open too here
|
if (a.m_lower_open) { // we might consider to look at b.m_lower_open too here
|
||||||
copy_lower_bound(a, i);
|
copy_lower_bound<wd>(a, i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
copy_lower_bound(b, i);
|
copy_lower_bound<wd>(b, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_lower_for_intersection_with_deps(const interval& a, const interval& b, interval & i) const {
|
template <enum with_deps_t wd>
|
||||||
if (a.m_lower_inf) {
|
void copy_upper_bound(const interval& a, interval& i) const {
|
||||||
if (b.m_lower_inf)
|
|
||||||
return;
|
|
||||||
copy_lower_bound_with_deps(b, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (b.m_lower_inf) {
|
|
||||||
SASSERT(!a.m_lower_inf);
|
|
||||||
copy_lower_bound_with_deps(a, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_num_manager.lt(a.m_lower, b.m_lower)) {
|
|
||||||
copy_lower_bound_with_deps(b, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_num_manager.gt(a.m_lower, b.m_lower)) {
|
|
||||||
copy_lower_bound_with_deps(a, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SASSERT(m_num_manager.eq(a.m_lower, b.m_lower));
|
|
||||||
if (a.m_lower_open) { // we might consider to look at b.m_lower_open too here
|
|
||||||
copy_lower_bound_with_deps(a, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
copy_lower_bound_with_deps(b, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
void copy_upper_bound_with_deps(const interval& a, interval & i) const {
|
|
||||||
SASSERT(a.m_upper_inf == false);
|
|
||||||
i.m_upper_inf = false;
|
|
||||||
m_config.set_upper(i, a.m_upper);
|
|
||||||
i.m_upper_dep = a.m_upper_dep;
|
|
||||||
i.m_upper_open = a.m_upper_open;
|
|
||||||
}
|
|
||||||
|
|
||||||
void copy_upper_bound(const interval& a, interval & i) const {
|
|
||||||
SASSERT(a.m_upper_inf == false);
|
SASSERT(a.m_upper_inf == false);
|
||||||
i.m_upper_inf = false;
|
i.m_upper_inf = false;
|
||||||
m_config.set_upper(i, a.m_upper);
|
m_config.set_upper(i, a.m_upper);
|
||||||
i.m_upper_open = a.m_upper_open;
|
i.m_upper_open = a.m_upper_open;
|
||||||
|
if (wd == with_deps) {
|
||||||
|
i.m_upper_dep = a.m_upper_dep;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy_lower_bound_with_deps(const interval& a, interval & i) const {
|
template <enum with_deps_t wd>
|
||||||
SASSERT(a.m_lower_inf == false);
|
void copy_lower_bound(const interval& a, interval& i) const {
|
||||||
i.m_lower_inf = false;
|
|
||||||
m_config.set_lower(i, a.m_lower);
|
|
||||||
i.m_lower_dep = a.m_lower_dep;
|
|
||||||
i.m_lower_open = a.m_lower_open;
|
|
||||||
}
|
|
||||||
|
|
||||||
void copy_lower_bound(const interval& a, interval & i) const {
|
|
||||||
SASSERT(a.m_lower_inf == false);
|
SASSERT(a.m_lower_inf == false);
|
||||||
i.m_lower_inf = false;
|
i.m_lower_inf = false;
|
||||||
m_config.set_lower(i, a.m_lower);
|
m_config.set_lower(i, a.m_lower);
|
||||||
i.m_lower_open = a.m_lower_open;
|
i.m_lower_open = a.m_lower_open;
|
||||||
|
if (wd == with_deps) {
|
||||||
|
i.m_lower_dep = a.m_lower_dep;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <enum with_deps_t wd>
|
||||||
void update_upper_for_intersection_with_deps(const interval& a, const interval& b, interval & i) const {
|
void set_var_interval(lpvar v, interval& b) const {
|
||||||
if (a.m_upper_inf) {
|
TRACE("nla_intervals_details", m_core->print_var(v, tout) << "\n";);
|
||||||
|
lp::constraint_index ci;
|
||||||
|
rational val;
|
||||||
|
bool is_strict;
|
||||||
|
if (ls().has_lower_bound(v, ci, val, is_strict)) {
|
||||||
|
m_config.set_lower(b, val);
|
||||||
|
m_config.set_lower_is_open(b, is_strict);
|
||||||
|
m_config.set_lower_is_inf(b, false);
|
||||||
|
if (wd == with_deps) b.m_lower_dep = mk_dep(ci);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_config.set_lower_is_open(b, true);
|
||||||
|
m_config.set_lower_is_inf(b, true);
|
||||||
|
if (wd == with_deps) b.m_lower_dep = nullptr;
|
||||||
|
}
|
||||||
|
if (ls().has_upper_bound(v, ci, val, is_strict)) {
|
||||||
|
m_config.set_upper(b, val);
|
||||||
|
m_config.set_upper_is_open(b, is_strict);
|
||||||
|
m_config.set_upper_is_inf(b, false);
|
||||||
|
if (wd == with_deps) b.m_upper_dep = mk_dep(ci);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_config.set_upper_is_open(b, true);
|
||||||
|
m_config.set_upper_is_inf(b, true);
|
||||||
|
if (wd == with_deps) b.m_upper_dep = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <enum with_deps_t wd>
|
||||||
|
void update_upper_for_intersection(const interval& a, const interval& b, interval& i) const {
|
||||||
|
if (a.m_upper_inf) {
|
||||||
if (b.m_upper_inf)
|
if (b.m_upper_inf)
|
||||||
return;
|
return;
|
||||||
copy_upper_bound_with_deps(b, i);
|
copy_upper_bound<wd>(b, i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (b.m_upper_inf) {
|
||||||
if (b.m_upper_inf) {
|
|
||||||
SASSERT(!a.m_upper_inf);
|
SASSERT(!a.m_upper_inf);
|
||||||
copy_upper_bound_with_deps(a, i);
|
copy_upper_bound<wd>(a, i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_num_manager.gt(a.m_upper, b.m_upper)) {
|
if (m_num_manager.gt(a.m_upper, b.m_upper)) {
|
||||||
copy_upper_bound_with_deps(b, i);
|
copy_upper_bound<wd>(b, i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_num_manager.lt(a.m_upper, b.m_upper)) {
|
if (m_num_manager.lt(a.m_upper, b.m_upper)) {
|
||||||
copy_upper_bound_with_deps(a, i);
|
copy_upper_bound<wd>(a, i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SASSERT(m_num_manager.eq(a.m_upper, b.m_upper));
|
SASSERT(m_num_manager.eq(a.m_upper, b.m_upper));
|
||||||
if (a.m_upper_open) { // we might consider to look at b.m_upper_open too here
|
if (a.m_upper_open) { // we might consider to look at b.m_upper_open too here
|
||||||
copy_upper_bound_with_deps(a, i);
|
copy_upper_bound<wd>(a, i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
copy_upper_bound_with_deps(b, i);
|
copy_upper_bound<wd>(b, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_upper_for_intersection(const interval& a, const interval& b, interval & i) const {
|
template <enum with_deps_t wd>
|
||||||
if (a.m_upper_inf) {
|
interval intersect(const interval& a, const interval& b) const {
|
||||||
if (b.m_upper_inf)
|
|
||||||
return;
|
|
||||||
copy_upper_bound(b, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (b.m_upper_inf) {
|
|
||||||
SASSERT(!a.m_upper_inf);
|
|
||||||
copy_upper_bound(a, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_num_manager.gt(a.m_upper, b.m_upper)) {
|
|
||||||
copy_upper_bound(b, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_num_manager.lt(a.m_upper, b.m_upper)) {
|
|
||||||
copy_upper_bound(a, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SASSERT(m_num_manager.eq(a.m_upper, b.m_upper));
|
|
||||||
if (a.m_upper_open) { // we might consider to look at b.m_upper_open too here
|
|
||||||
copy_upper_bound(a, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
copy_upper_bound(b, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
interval intersect_with_deps(const interval& a, const interval& b) const {
|
|
||||||
interval i;
|
interval i;
|
||||||
TRACE("nla_interval_compare", tout << "a="; display(tout, a) << "\nb="; display(tout, b););
|
TRACE("nla_interval_compare", tout << "a="; display(tout, a) << "\nb="; display(tout, b););
|
||||||
update_lower_for_intersection_with_deps(a, b, i);
|
update_lower_for_intersection<wd>(a, b, i);
|
||||||
TRACE("nla_interval_compare", tout << "i="; display(tout, i) << "\n";);
|
TRACE("nla_interval_compare", tout << "i="; display(tout, i) << "\n";);
|
||||||
update_upper_for_intersection_with_deps(a, b, i);
|
update_upper_for_intersection<wd>(a, b, i);
|
||||||
TRACE("nla_interval_compare", tout << "i="; display(tout, i) << "\n";);
|
TRACE("nla_interval_compare", tout << "i="; display(tout, i) << "\n";);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
interval intersect(const interval& a, const interval& b, int foo) const {
|
template <enum with_deps_t wd>
|
||||||
interval i;
|
bool interval_from_term(const nex& e, interval& i) const {
|
||||||
TRACE("nla_interval_compare", tout << "a="; display(tout, a) << "\nb="; display(tout, b););
|
rational a, b;
|
||||||
update_lower_for_intersection(a, b, i);
|
lp::lar_term norm_t = expression_to_normalized_term(&e.to_sum(), a, b);
|
||||||
TRACE("nla_interval_compare", tout << "i="; display(tout, i) << "\n";);
|
lp::explanation exp;
|
||||||
update_upper_for_intersection(a, b, i);
|
if (m_core->explain_by_equiv(norm_t, exp)) {
|
||||||
TRACE("nla_interval_compare", tout << "i="; display(tout, i) << "\n";);
|
set_zero_interval(i);
|
||||||
return i;
|
TRACE("nla_intervals", tout << "explain_by_equiv\n";);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
lpvar j = find_term_column(norm_t, a);
|
||||||
|
if (j + 1 == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
set_var_interval<without_deps>(j, i);
|
||||||
|
interv bi;
|
||||||
|
mul<wd>(a, i, bi);
|
||||||
|
add(b, bi);
|
||||||
|
set<wd>(i, bi);
|
||||||
|
|
||||||
|
TRACE("nla_intervals",
|
||||||
|
m_core->m_lar_solver.print_column_info(j, tout) << "\n";
|
||||||
|
tout << "a=" << a << ", b=" << b << "\n";
|
||||||
|
tout << e << ", interval = "; display(tout, i););
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <enum with_deps_t wd>
|
||||||
|
interval interval_of_sum_no_term(const nex_sum& e) {
|
||||||
|
const nex* inf_e = get_inf_interval_child(e);
|
||||||
|
if (inf_e) {
|
||||||
|
return interv();
|
||||||
|
}
|
||||||
|
interv a = interval_of_expr<wd>(e[0], 1);
|
||||||
|
for (unsigned k = 1; k < e.size(); k++) {
|
||||||
|
TRACE("nla_intervals_details_sum", tout << "e[" << k << "]= " << *e[k] << "\n";);
|
||||||
|
interv b = interval_of_expr<wd>(e[k], 1);
|
||||||
|
interv c;
|
||||||
|
|
||||||
|
TRACE("nla_intervals_details_sum", tout << "a = "; display(tout, a) << "\nb = "; display(tout, b) << "\n";);
|
||||||
|
if (wd == with_deps) {
|
||||||
|
interval_deps_combine_rule combine_rule;
|
||||||
|
add(a, b, c, combine_rule);
|
||||||
|
combine_deps(a, b, combine_rule, c);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
add(a, b, c);
|
||||||
|
}
|
||||||
|
set<wd>(a, c);
|
||||||
|
TRACE("nla_intervals_details_sum", tout << *e[k] << ", ";
|
||||||
|
display(tout, a); tout << "\n";);
|
||||||
|
}
|
||||||
|
TRACE("nla_intervals_details", tout << "e=" << e << "\n";
|
||||||
|
tout << " interv = "; display(tout, a););
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <enum with_deps_t wd>
|
||||||
|
interval interval_of_sum(const nex_sum& e) {
|
||||||
|
TRACE("nla_intervals_details", tout << "e=" << e << "\n";);
|
||||||
|
interv i_e = interval_of_sum_no_term<wd>(e);
|
||||||
|
if (e.is_a_linear_term()) {
|
||||||
|
SASSERT(e.is_sum() && e.size() > 1);
|
||||||
|
interv i_from_term;
|
||||||
|
if (interval_from_term<wd>(e, i_from_term)) {
|
||||||
|
interv r = intersect<wd>(i_e, i_from_term);
|
||||||
|
TRACE("nla_intervals_details", tout << "intersection="; display(tout, r) << "\n";);
|
||||||
|
if (is_empty(r)) {
|
||||||
|
SASSERT(false); // not implemented
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return i_e;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <enum with_deps_t wd>
|
||||||
|
interval interval_of_mul(const nex_mul& e) {
|
||||||
|
TRACE("nla_intervals_details", tout << "e = " << e << "\n";);
|
||||||
|
const nex* zero_interval_child = get_zero_interval_child(e);
|
||||||
|
if (zero_interval_child) {
|
||||||
|
interv a = interval_of_expr<wd>(zero_interval_child, 1);
|
||||||
|
set_zero_interval_deps_for_mult(a);
|
||||||
|
TRACE("nla_intervals_details", tout << "zero_interval_child = " << *zero_interval_child << std::endl << "a = "; display(tout, a); );
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
interv a;
|
||||||
|
set_interval_for_scalar(a, e.coeff());
|
||||||
|
TRACE("nla_intervals_details", tout << "a = "; display(tout, a); );
|
||||||
|
for (const auto& ep : e) {
|
||||||
|
interv b = interval_of_expr<wd>(ep.e(), ep.pow());
|
||||||
|
TRACE("nla_intervals_details", tout << "ep = " << ep << ", "; display(tout, b); );
|
||||||
|
interv c;
|
||||||
|
interval_deps_combine_rule comb_rule;
|
||||||
|
mul_two_intervals(a, b, c, comb_rule);
|
||||||
|
TRACE("nla_intervals_details", tout << "c before combine_deps() "; display(tout, c););
|
||||||
|
combine_deps(a, b, comb_rule, c);
|
||||||
|
TRACE("nla_intervals_details", tout << "a "; display(tout, a););
|
||||||
|
TRACE("nla_intervals_details", tout << "c "; display(tout, c););
|
||||||
|
set<wd>(a, c);
|
||||||
|
TRACE("nla_intervals_details", tout << "part mult "; display(tout, a););
|
||||||
|
}
|
||||||
|
TRACE("nla_intervals_details", tout << "e=" << e << "\n";
|
||||||
|
tout << " return "; display(tout, a););
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <enum with_deps_t wd>
|
||||||
|
interval interval_of_expr(const nex* e, unsigned p) {
|
||||||
|
interv a;
|
||||||
|
switch (e->type()) {
|
||||||
|
case expr_type::SCALAR:
|
||||||
|
set_interval_for_scalar(a, to_scalar(e)->value());
|
||||||
|
if (p != 1) {
|
||||||
|
return power<wd>(a, p);
|
||||||
|
}
|
||||||
|
return a;
|
||||||
|
case expr_type::SUM: {
|
||||||
|
interv b = interval_of_sum<wd>(e->to_sum());
|
||||||
|
if (p != 1)
|
||||||
|
return power<wd>(b, p);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
case expr_type::MUL: {
|
||||||
|
interv b = interval_of_mul<with_deps>(e->to_mul());
|
||||||
|
if (p != 1)
|
||||||
|
return power<wd>(b, p);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
case expr_type::VAR:
|
||||||
|
set_var_interval<wd>(e->to_var().var(), a);
|
||||||
|
if (p != 1)
|
||||||
|
return power<wd>(a, p);;
|
||||||
|
return a;
|
||||||
|
default:
|
||||||
|
TRACE("nla_intervals_details", tout << e->type() << "\n";);
|
||||||
|
UNREACHABLE();
|
||||||
|
return interval();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool upper_is_inf(const interval& a) const { return m_config.upper_is_inf(a); }
|
bool upper_is_inf(const interval& a) const { return m_config.upper_is_inf(a); }
|
||||||
bool lower_is_inf(const interval& a) const { return m_config.lower_is_inf(a); }
|
bool lower_is_inf(const interval& a) const { return m_config.lower_is_inf(a); }
|
||||||
void set_var_interval_with_deps(lpvar, interval &) const;
|
|
||||||
void set_zero_interval_deps_for_mult(interval&);
|
void set_zero_interval_deps_for_mult(interval&);
|
||||||
void set_zero_interval_with_explanation(interval& , const lp::explanation& exp) const;
|
void set_zero_interval_with_explanation(interval&, const lp::explanation& exp) const;
|
||||||
void set_zero_interval(interval&) const;
|
void set_zero_interval(interval&) const;
|
||||||
bool is_inf(const interval& i) const { return m_config.is_inf(i); }
|
bool is_inf(const interval& i) const { return m_config.is_inf(i); }
|
||||||
bool separated_from_zero_on_lower(const interval&) const;
|
bool separated_from_zero_on_lower(const interval&) const;
|
||||||
bool separated_from_zero_on_upper(const interval&) const;
|
bool separated_from_zero_on_upper(const interval&) const;
|
||||||
inline bool separated_from_zero(const interval& i) const {
|
inline bool separated_from_zero(const interval& i) const {
|
||||||
return separated_from_zero_on_upper(i) ||
|
return separated_from_zero_on_upper(i) ||
|
||||||
separated_from_zero_on_lower(i);
|
separated_from_zero_on_lower(i);
|
||||||
}
|
}
|
||||||
bool check_interval_for_conflict_on_zero(const interval & i, ci_dependency *);
|
bool check_interval_for_conflict_on_zero(const interval& i, ci_dependency*);
|
||||||
bool check_interval_for_conflict_on_zero_lower(const interval & i, ci_dependency*);
|
bool check_interval_for_conflict_on_zero_lower(const interval& i, ci_dependency*);
|
||||||
bool check_interval_for_conflict_on_zero_upper(const interval & i, ci_dependency*);
|
bool check_interval_for_conflict_on_zero_upper(const interval& i, ci_dependency*);
|
||||||
mpq const & lower(interval const & a) const { return m_config.lower(a); }
|
mpq const& lower(interval const& a) const { return m_config.lower(a); }
|
||||||
mpq const & upper(interval const & a) const { return m_config.upper(a); }
|
mpq const& upper(interval const& a) const { return m_config.upper(a); }
|
||||||
inline
|
inline bool is_empty(interval const& a) const {
|
||||||
bool is_empty(interval const & a) const {
|
|
||||||
if (a.m_lower_inf || a.m_upper_inf)
|
if (a.m_lower_inf || a.m_upper_inf)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (m_num_manager.gt(a.m_lower, a.m_upper))
|
if (m_num_manager.gt(a.m_lower, a.m_upper))
|
||||||
return true;
|
return true;
|
||||||
if (m_num_manager.lt(a.m_lower, a.m_upper))
|
if (m_num_manager.lt(a.m_lower, a.m_upper))
|
||||||
|
@ -454,27 +542,16 @@ public:
|
||||||
}
|
}
|
||||||
void reset() { m_alloc.reset(); }
|
void reset() { m_alloc.reset(); }
|
||||||
bool check_nex(const nex*, ci_dependency*);
|
bool check_nex(const nex*, ci_dependency*);
|
||||||
interval interval_of_expr_with_deps(const nex* e, unsigned power);
|
|
||||||
interval interval_of_expr(const nex* e, unsigned power);
|
|
||||||
interval interval_of_sum(const nex_sum*);
|
|
||||||
interval interval_of_sum_no_term(const nex_sum*);
|
|
||||||
interval interval_of_mul(const nex_mul*);
|
|
||||||
interval interval_of_sum_no_term_with_deps(const nex_sum* e);
|
|
||||||
bool interval_from_term_with_deps(const nex* e, interval & i) const;
|
|
||||||
bool interval_from_term(const nex* e, interval & i) const;
|
|
||||||
interval interval_of_sum_with_deps(const nex_sum* e);
|
|
||||||
typedef interval interv;
|
typedef interval interv;
|
||||||
void set_interval_for_scalar(interv&, const rational&);
|
void set_interval_for_scalar(interv&, const rational&);
|
||||||
interv power_with_deps(const interv& a, unsigned);
|
const nex* get_zero_interval_child(const nex_mul&) const;
|
||||||
interv interval_of_mul_with_deps(const nex_mul*);
|
const nex* get_inf_interval_child(const nex_sum&) const;
|
||||||
const nex* get_zero_interval_child(const nex_mul*) const;
|
bool has_zero_interval(const nex&) const;
|
||||||
const nex* get_inf_interval_child(const nex_sum*) const;
|
bool has_inf_interval(const nex&) const;
|
||||||
bool has_zero_interval(const nex* ) const;
|
bool mul_has_inf_interval(const nex_mul&) const;
|
||||||
bool has_inf_interval(const nex* ) const;
|
static lp::lar_term expression_to_normalized_term(const nex_sum*, rational& a, rational& b);
|
||||||
bool mul_has_inf_interval(const nex_mul* ) const;
|
static void add_linear_to_vector(const nex*, vector<std::pair<rational, lpvar>>&);
|
||||||
static lp::lar_term expression_to_normalized_term(const nex_sum*, rational& a, rational & b);
|
static void add_mul_of_degree_one_to_vector(const nex_mul*, vector<std::pair<rational, lpvar>>&);
|
||||||
static void add_linear_to_vector(const nex*, vector<std::pair<rational, lpvar>> &);
|
lpvar find_term_column(const lp::lar_term&, rational& a) const;
|
||||||
static void add_mul_of_degree_one_to_vector(const nex_mul*, vector<std::pair<rational, lpvar>> &);
|
|
||||||
lpvar find_term_column(const lp::lar_term &, rational & a) const;
|
|
||||||
}; // end of intervals
|
}; // end of intervals
|
||||||
} // end of namespace nla
|
} // end of namespace nla
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue