3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

use vectors instead of hash-tables in dimacs serialization to avoid hash-table contention

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-01-12 11:05:00 -08:00
parent e623f1e9c9
commit e4d6aa07dc
3 changed files with 26 additions and 14 deletions

View file

@ -332,10 +332,17 @@ namespace sat {
}
void drat::verify(unsigned n, literal const* c) {
if (m_check_unsat && !is_drup(n, c) && !is_drat(n, c)) {
if (!m_check_unsat) {
return;
}
for (unsigned i = 0; i < n; ++i) {
declare(c[i]);
}
if (!is_drup(n, c) && !is_drat(n, c)) {
literal_vector lits(n, c);
std::cout << "Verification of " << lits << " failed\n";
s.display(std::cout);
SASSERT(false);
exit(0);
UNREACHABLE();
//display(std::cout);
@ -476,6 +483,10 @@ namespace sat {
literal lit = c[i];
if (lit != wc.m_l1 && lit != wc.m_l2 && value(lit) != l_false) {
wc.m_l2 = lit;
if (m_watches.size() <= (~lit).index())
{
IF_VERBOSE(0, verbose_stream() << m_watches.size() << " " << lit << " " << (~lit).index() << "\n");
}
m_watches[(~lit).index()].push_back(idx);
done = true;
}

View file

@ -344,11 +344,11 @@ namespace sat {
void solver::mk_bin_clause(literal l1, literal l2, bool learned) {
if (find_binary_watch(get_wlist(~l1), ~l2)) {
assign_core(l1, 0, justification(l2));
assign_core(l1, 0, justification(l1));
return;
}
if (find_binary_watch(get_wlist(~l2), ~l1)) {
assign_core(l2, 0, justification(l1));
assign_core(l2, 0, justification(l2));
return;
}
watched* w0 = find_binary_watch(get_wlist(~l1), l2);