mirror of
https://github.com/Z3Prover/z3
synced 2025-05-18 05:04:45 +00:00
crash
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
a5dd59fdfb
commit
abf29b57aa
9 changed files with 999 additions and 903 deletions
64
src/math/lp/dioph_eq.cpp
Normal file
64
src/math/lp/dioph_eq.cpp
Normal file
|
@ -0,0 +1,64 @@
|
|||
#include "math/lp/dioph_eq.h"
|
||||
#include "math/lp/int_solver.h"
|
||||
#include "math/lp/lar_solver.h"
|
||||
#include "math/lp/lp_utils.h"
|
||||
|
||||
namespace lp {
|
||||
struct imp {
|
||||
|
||||
int_solver& lia;
|
||||
lar_solver& lra;
|
||||
|
||||
imp(int_solver& lia, lar_solver& lra): lia(lia), lra(lra) {}
|
||||
vector<lar_term> m_e;
|
||||
|
||||
void init() {
|
||||
int n_of_rows = lra.r_basis().size();
|
||||
unsigned skipped = 0;
|
||||
for (unsigned i = 0; i < lra.r_basis().size(); i++) {
|
||||
auto & row = lra.get_row(i);
|
||||
lar_term t;
|
||||
bool is_int = true;
|
||||
for (const auto & p : row) {
|
||||
if (!lia.column_is_int(p.var()))
|
||||
is_int = false;
|
||||
}
|
||||
if (is_int) {
|
||||
lar_term t;
|
||||
const auto lcm = get_denominators_lcm(row);
|
||||
for (const auto & p: row) {
|
||||
t.add_monomial(lcm * p.coeff(), p.var());
|
||||
}
|
||||
m_e.push_back(t);
|
||||
} else {
|
||||
skipped ++;
|
||||
}
|
||||
}
|
||||
if (m_e.size() > 0) {
|
||||
std::cout << "collected " << m_e.size() << ", skipped " << skipped << "\n";
|
||||
for (const auto & t: m_e) {
|
||||
lra.print_term(t, std::cout) << "\n";
|
||||
}
|
||||
std::cout << "________________________\n";
|
||||
}
|
||||
}
|
||||
|
||||
lia_move check() {
|
||||
init();
|
||||
return lia_move::undef;
|
||||
}
|
||||
};
|
||||
// Constructor definition
|
||||
dioph_eq::dioph_eq(int_solver& lia): lia(lia) {
|
||||
m_imp = alloc(imp, lia, lia.lra);
|
||||
}
|
||||
dioph_eq::~dioph_eq() {
|
||||
dealloc(m_imp);
|
||||
}
|
||||
|
||||
lia_move dioph_eq::check() {
|
||||
return m_imp->check();
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue