mirror of
https://github.com/Z3Prover/z3
synced 2025-05-04 06:15:46 +00:00
propagate monics with lp_bound_propagator
This commit is contained in:
parent
c309d52283
commit
cbad61ba2e
5 changed files with 74 additions and 64 deletions
|
@ -20,18 +20,24 @@ Revision History:
|
|||
#pragma once
|
||||
#include "math/lp/lp_settings.h"
|
||||
#include "math/lp/lar_constraints.h"
|
||||
#include "math/lp/lar_solver.h"
|
||||
namespace lp {
|
||||
class implied_bound {
|
||||
public:
|
||||
mpq m_bound;
|
||||
unsigned m_j; // the column for which the bound has been found
|
||||
// It is either the column for which the bound has been found, or,
|
||||
// in the case the column was created as
|
||||
// the slack variable to a term, it is the term index.
|
||||
// It is the same index that was returned by lar_solver::add_var(), or
|
||||
// by lar_solver::add_term()
|
||||
unsigned m_j;
|
||||
bool m_is_lower_bound;
|
||||
bool m_strict;
|
||||
private:
|
||||
std::function<u_dependency*(void)> m_explain_bound = nullptr;
|
||||
std::function<u_dependency*(lar_solver&)> 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; }
|
||||
u_dependency* explain(lar_solver& s) const { return m_explain_bound(s); }
|
||||
void set_explain(std::function<u_dependency*(lar_solver&)> f) { m_explain_bound = f; }
|
||||
lconstraint_kind kind() const {
|
||||
lconstraint_kind k = m_is_lower_bound? GE : LE;
|
||||
if (m_strict)
|
||||
|
@ -43,7 +49,7 @@ class implied_bound {
|
|||
unsigned j,
|
||||
bool is_lower_bound,
|
||||
bool is_strict,
|
||||
std::function<u_dependency*(void)> get_dep):
|
||||
std::function<u_dependency*(lar_solver&)> get_dep):
|
||||
m_bound(a),
|
||||
m_j(j),
|
||||
m_is_lower_bound(is_lower_bound),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue