mirror of
https://github.com/Z3Prover/z3
synced 2025-07-19 10:52:02 +00:00
Api (#7097)
* rename ul_pair to column Signed-off-by: Lev Nachmanson <levnach@hotmail.com> * t Signed-off-by: Lev Nachmanson <levnach@hotmail.com> * simple test passed * remove an assert * relax an assertion * remove an obsolete function Signed-off-by: Lev Nachmanson <levnach@hotmail.com> * access a term by the term column * remove the column index from colunm.h * remove an unused method * remove debug code * fix the build of lp_tst Signed-off-by: Lev Nachmanson <levnach@hotmail.com> --------- Signed-off-by: Lev Nachmanson <levnach@hotmail.com> Co-authored-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
133546625c
commit
bdb9106f99
45 changed files with 587 additions and 973 deletions
|
@ -1,77 +0,0 @@
|
|||
/*++
|
||||
Copyright (c) 2017 Microsoft Corporation
|
||||
|
||||
Abstract:
|
||||
|
||||
justifications for upper or lower bounds
|
||||
|
||||
Author:
|
||||
|
||||
Lev Nachmanson (levnach)
|
||||
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
#include "util/vector.h"
|
||||
#include "util/dependency.h"
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
#include "math/lp/column_info.h"
|
||||
#include "math/lp/lp_types.h"
|
||||
|
||||
namespace lp {
|
||||
|
||||
|
||||
inline bool kind_is_strict(lconstraint_kind kind) { return kind == LT || kind == GT;}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& out, lconstraint_kind k) {
|
||||
switch (k) {
|
||||
case LE: return out << "<=";
|
||||
case LT: return out << "<";
|
||||
case GE: return out << ">=";
|
||||
case GT: return out << ">";
|
||||
case EQ: return out << "=";
|
||||
case NE: return out << "!=";
|
||||
}
|
||||
return out << "??";
|
||||
}
|
||||
|
||||
inline bool compare(const std::pair<mpq, var_index> & a, const std::pair<mpq, var_index> & b) {
|
||||
return a.second < b.second;
|
||||
}
|
||||
|
||||
class ul_pair {
|
||||
u_dependency* m_lower_bound_witness = nullptr;
|
||||
u_dependency* m_upper_bound_witness = nullptr;
|
||||
bool m_associated_with_row = false;
|
||||
public:
|
||||
// TODO - seems more straight-forward to just expose ul_pair as a struct with direct access to attributes.
|
||||
|
||||
u_dependency*& lower_bound_witness() { return m_lower_bound_witness; }
|
||||
u_dependency* lower_bound_witness() const { return m_lower_bound_witness; }
|
||||
u_dependency*& upper_bound_witness() { return m_upper_bound_witness; }
|
||||
u_dependency* upper_bound_witness() const { return m_upper_bound_witness; }
|
||||
|
||||
// equality is used by stackedvector operations.
|
||||
// this appears to be a low level reason
|
||||
|
||||
bool operator!=(const ul_pair & p) const {
|
||||
return !(*this == p);
|
||||
}
|
||||
|
||||
bool operator==(const ul_pair & p) const {
|
||||
return m_lower_bound_witness == p.m_lower_bound_witness
|
||||
&& m_upper_bound_witness == p.m_upper_bound_witness
|
||||
&& m_associated_with_row == p.m_associated_with_row;
|
||||
}
|
||||
// empty constructor
|
||||
ul_pair() {}
|
||||
|
||||
ul_pair(bool associated_with_row) :
|
||||
m_associated_with_row(associated_with_row) {}
|
||||
|
||||
bool associated_with_row() const { return m_associated_with_row; }
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue