mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 20:05:51 +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
|
@ -20,6 +20,35 @@ Author:
|
|||
|
||||
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>
|
||||
arith_base<num_t>::arith_base(context& ctx) :
|
||||
plugin(ctx),
|
||||
|
|
|
@ -57,31 +57,8 @@ namespace sls {
|
|||
num_t m_args_value;
|
||||
unsigned m_var_to_flip = UINT_MAX;
|
||||
|
||||
bool 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;
|
||||
}
|
||||
}
|
||||
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 << ")";
|
||||
}
|
||||
}
|
||||
bool is_true() const;
|
||||
std::ostream& display(std::ostream& out) const;
|
||||
};
|
||||
private:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue