mirror of
https://github.com/Z3Prover/z3
synced 2025-05-04 06:15:46 +00:00
runs a simple test
This commit is contained in:
parent
c050af922f
commit
c309d52283
11 changed files with 291 additions and 112 deletions
|
@ -21,37 +21,34 @@ Revision History:
|
|||
#include "math/lp/lp_settings.h"
|
||||
#include "math/lp/lar_constraints.h"
|
||||
namespace lp {
|
||||
struct implied_bound {
|
||||
class implied_bound {
|
||||
public:
|
||||
mpq m_bound;
|
||||
unsigned m_j; // the column for which the bound has been found
|
||||
bool m_is_lower_bound;
|
||||
bool m_coeff_before_j_is_pos;
|
||||
unsigned m_row_or_term_index;
|
||||
bool m_strict;
|
||||
bool m_strict;
|
||||
private:
|
||||
std::function<u_dependency*(void)> m_explain_bound = nullptr;
|
||||
public:
|
||||
u_dependency* explain() const { return m_explain_bound(); }
|
||||
void set_explain(std::function<u_dependency*(void)> f) { m_explain_bound = f; }
|
||||
lconstraint_kind kind() const {
|
||||
lconstraint_kind k = m_is_lower_bound? GE : LE;
|
||||
if (m_strict)
|
||||
k = static_cast<lconstraint_kind>(k / 2);
|
||||
return k;
|
||||
}
|
||||
bool operator==(const implied_bound & o) const {
|
||||
return m_j == o.m_j && m_is_lower_bound == o.m_is_lower_bound && m_bound == o.m_bound &&
|
||||
m_coeff_before_j_is_pos == o.m_coeff_before_j_is_pos &&
|
||||
m_row_or_term_index == o.m_row_or_term_index && m_strict == o.m_strict;
|
||||
}
|
||||
implied_bound(){}
|
||||
implied_bound(const mpq & a,
|
||||
unsigned j,
|
||||
bool lower_bound,
|
||||
bool coeff_before_j_is_pos,
|
||||
unsigned row_or_term_index,
|
||||
bool strict):
|
||||
bool is_lower_bound,
|
||||
bool is_strict,
|
||||
std::function<u_dependency*(void)> get_dep):
|
||||
m_bound(a),
|
||||
m_j(j),
|
||||
m_is_lower_bound(lower_bound),
|
||||
m_coeff_before_j_is_pos(coeff_before_j_is_pos),
|
||||
m_row_or_term_index(row_or_term_index),
|
||||
m_strict(strict) {
|
||||
m_is_lower_bound(is_lower_bound),
|
||||
m_strict(is_strict),
|
||||
m_explain_bound(get_dep) {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue