mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
improving drat output perf
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
1e90be62bc
commit
7fa9768c36
4 changed files with 50 additions and 10 deletions
|
@ -72,14 +72,36 @@ namespace sat {
|
|||
}
|
||||
|
||||
void drat::dump(unsigned n, literal const* c, status st) {
|
||||
switch (st) {
|
||||
case status::asserted: return;
|
||||
case status::external: return; // requires extension to drat format.
|
||||
case status::learned: break;
|
||||
case status::deleted: (*m_out) << "d "; break;
|
||||
if (st == status::asserted || st == status::external) {
|
||||
return;
|
||||
}
|
||||
for (unsigned i = 0; i < n; ++i) (*m_out) << c[i] << " ";
|
||||
(*m_out) << "0\n";
|
||||
|
||||
char buffer[10000];
|
||||
int len = 0;
|
||||
if (st == status::deleted) {
|
||||
buffer[0] = 'd';
|
||||
buffer[1] = ' ';
|
||||
len = 2;
|
||||
}
|
||||
for (unsigned i = 0; i < n && len >= 0; ++i) {
|
||||
literal lit = c[i];
|
||||
int _lit = lit.var();
|
||||
if (lit.sign()) _lit = -_lit;
|
||||
len += snprintf(buffer + len, sizeof(buffer) - len, "%d ", _lit);
|
||||
}
|
||||
|
||||
if (len >= 0) {
|
||||
len += snprintf(buffer + len, sizeof(buffer) - len, "0\n");
|
||||
}
|
||||
if (len >= 0) {
|
||||
m_out->write(buffer, len);
|
||||
}
|
||||
else {
|
||||
if (st == status::deleted) (*m_out) << "d ";
|
||||
for (unsigned i = 0; i < n; ++i) (*m_out) << c[i] << " ";
|
||||
(*m_out) << "0\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void drat::bdump(unsigned n, literal const* c, status st) {
|
||||
|
|
|
@ -1701,6 +1701,7 @@ namespace sat {
|
|||
if (is_fixed_at(lit, c_fixed_truth) || is_true_at(lit, level)) continue;
|
||||
bool unsat = false;
|
||||
if (is_false_at(lit, level)) {
|
||||
if (lit.sign() && lit.var() == 34523) std::cout << "false at " << lit << "\n";
|
||||
unsat = true;
|
||||
}
|
||||
else {
|
||||
|
@ -1708,7 +1709,9 @@ namespace sat {
|
|||
reset_lookahead_reward(lit);
|
||||
unsigned num_units = push_lookahead1(lit, level);
|
||||
update_lookahead_reward(lit, level);
|
||||
if (lit.sign() && lit.var() == 34523) std::cout << "num units.1 " << num_units << " " << inconsistent() << "\n";
|
||||
num_units += do_double(lit, dl_lvl);
|
||||
if (lit.sign() && lit.var() == 34523) std::cout << "num units.2 " << num_units << "\n";
|
||||
if (dl_lvl > level) {
|
||||
base = dl_lvl;
|
||||
//SASSERT(get_level(m_trail.back()) == base + m_lookahead[i].m_offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue