3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-03 21:01:22 +00:00

add a trace statement

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2021-03-19 13:17:27 -07:00
parent 1971ee60e1
commit 3b67dd8288
3 changed files with 58 additions and 40 deletions

View file

@ -215,6 +215,7 @@ namespace lp {
if (u1 < l1) {
fill_explanation_from_fixed_columns(row);
TRACE("gcd_test", tout << "row failed the GCD test:\n"; lia.display_row(tout, row););
return false;
}
return true;

View file

@ -488,13 +488,16 @@ bool int_solver::at_upper(unsigned j) const {
}
}
std::ostream& int_solver::display_row_info(std::ostream & out, unsigned row_index) const {
std::ostream & int_solver::display_row(std::ostream & out, lp::row_strip<rational> const & row) const {
bool first = true;
auto & rslv = lrac.m_r_solver;
bool first = true;
for (const auto &c: rslv.m_A.m_rows[row_index]) {
if (is_fixed(c.var())) {
if (!get_value(c.var()).is_zero()) {
impq val = get_value(c.var())*c.coeff();
for (const auto &c : row)
{
if (is_fixed(c.var()))
{
if (!get_value(c.var()).is_zero())
{
impq val = get_value(c.var()) * c.coeff();
if (!first && val.is_pos())
out << "+";
if (val.y.is_zero())
@ -505,18 +508,22 @@ std::ostream& int_solver::display_row_info(std::ostream & out, unsigned row_inde
first = false;
continue;
}
if (c.coeff().is_one()) {
if (c.coeff().is_one())
{
if (!first)
out << "+";
}
else if (c.coeff().is_minus_one())
out << "-";
else {
if (c.coeff().is_pos()) {
else
{
if (c.coeff().is_pos())
{
if (!first)
out << "+";
}
if (c.coeff().is_big()) {
if (c.coeff().is_big())
{
out << " b*";
}
else
@ -526,14 +533,22 @@ std::ostream& int_solver::display_row_info(std::ostream & out, unsigned row_inde
first = false;
}
out << "\n";
for (const auto& c: rslv.m_A.m_rows[row_index]) {
for (const auto &c : row)
{
if (is_fixed(c.var()))
continue;
rslv.print_column_info(c.var(), out);
if (is_base(c.var())) out << "j" << c.var() << " base\n";
if (is_base(c.var()))
out << "j" << c.var() << " base\n";
}
return out;
}
std::ostream& int_solver::display_row_info(std::ostream & out, unsigned row_index) const {
auto & rslv = lrac.m_r_solver;
auto row = rslv.m_A.m_rows[row_index];
return display_row(out, row);
}
bool int_solver::shift_var(unsigned j, unsigned range) {

View file

@ -117,6 +117,8 @@ public:
bool shift_var(unsigned j, unsigned range);
std::ostream& display_row_info(std::ostream & out, unsigned row_index) const;
std::ostream & display_row(std::ostream & out, vector<row_cell<rational>> const & row) const;
private:
unsigned random();
bool has_inf_int() const;