mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 22:23:22 +00:00
move definitions to cpp
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
5a9161ed7b
commit
ff104c4b13
3 changed files with 32 additions and 26 deletions
|
@ -138,7 +138,7 @@ namespace euf {
|
||||||
};
|
};
|
||||||
|
|
||||||
theory_id m_fid = 0;
|
theory_id m_fid = 0;
|
||||||
unsigned m_op = null_decl_kind;
|
decl_kind m_op = null_decl_kind;
|
||||||
func_decl* m_decl = nullptr;
|
func_decl* m_decl = nullptr;
|
||||||
vector<eq> m_eqs;
|
vector<eq> m_eqs;
|
||||||
ptr_vector<node> m_nodes;
|
ptr_vector<node> m_nodes;
|
||||||
|
|
|
@ -20,6 +20,35 @@ Author:
|
||||||
|
|
||||||
namespace sls {
|
namespace sls {
|
||||||
|
|
||||||
|
template<typename num_t>
|
||||||
|
bool arith_base<num_t>::ineq::is_true() const {
|
||||||
|
switch (m_op) {
|
||||||
|
case ineq_kind::LE:
|
||||||
|
return m_args_value + m_coeff <= 0;
|
||||||
|
case ineq_kind::EQ:
|
||||||
|
return m_args_value + m_coeff == 0;
|
||||||
|
default:
|
||||||
|
return m_args_value + m_coeff < 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename num_t>
|
||||||
|
std::ostream& arith_base<num_t>::ineq::display(std::ostream& out) const {
|
||||||
|
bool first = true;
|
||||||
|
for (auto const& [c, v] : m_args)
|
||||||
|
out << (first ? "" : " + ") << c << " * v" << v, first = false;
|
||||||
|
if (m_coeff != 0)
|
||||||
|
out << " + " << m_coeff;
|
||||||
|
switch (m_op) {
|
||||||
|
case ineq_kind::LE:
|
||||||
|
return out << " <= " << 0 << "(" << m_args_value + m_coeff << ")";
|
||||||
|
case ineq_kind::EQ:
|
||||||
|
return out << " == " << 0 << "(" << m_args_value + m_coeff << ")";
|
||||||
|
default:
|
||||||
|
return out << " < " << 0 << "(" << m_args_value + m_coeff << ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<typename num_t>
|
template<typename num_t>
|
||||||
arith_base<num_t>::arith_base(context& ctx) :
|
arith_base<num_t>::arith_base(context& ctx) :
|
||||||
plugin(ctx),
|
plugin(ctx),
|
||||||
|
|
|
@ -57,31 +57,8 @@ namespace sls {
|
||||||
num_t m_args_value;
|
num_t m_args_value;
|
||||||
unsigned m_var_to_flip = UINT_MAX;
|
unsigned m_var_to_flip = UINT_MAX;
|
||||||
|
|
||||||
bool is_true() const {
|
bool is_true() const;
|
||||||
switch (m_op) {
|
std::ostream& display(std::ostream& out) const;
|
||||||
case ineq_kind::LE:
|
|
||||||
return m_args_value + m_coeff <= 0;
|
|
||||||
case ineq_kind::EQ:
|
|
||||||
return m_args_value + m_coeff == 0;
|
|
||||||
default:
|
|
||||||
return m_args_value + m_coeff < 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::ostream& display(std::ostream& out) const {
|
|
||||||
bool first = true;
|
|
||||||
for (auto const& [c, v] : m_args)
|
|
||||||
out << (first ? "" : " + ") << c << " * v" << v, first = false;
|
|
||||||
if (m_coeff != 0)
|
|
||||||
out << " + " << m_coeff;
|
|
||||||
switch (m_op) {
|
|
||||||
case ineq_kind::LE:
|
|
||||||
return out << " <= " << 0 << "(" << m_args_value + m_coeff << ")";
|
|
||||||
case ineq_kind::EQ:
|
|
||||||
return out << " == " << 0 << "(" << m_args_value + m_coeff << ")";
|
|
||||||
default:
|
|
||||||
return out << " < " << 0 << "(" << m_args_value + m_coeff << ")";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue