3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-23 03:27:52 +00:00
This commit is contained in:
Nikolaj Bjorner 2025-01-27 10:51:12 -08:00
parent b6e7b80704
commit 15ee879602
3 changed files with 14 additions and 9 deletions

View file

@ -22,6 +22,16 @@ Revision History:
#include "util/trace.h"
namespace sat {
// move to util.h
template<typename S, typename P>
unsigned num_true(S const& set, P const& p) {
unsigned r = 0;
for (auto const& e : set)
if (p(e))
r++;
return r;
}
integrity_checker::integrity_checker(solver const & _s):
s(_s) {
@ -101,13 +111,7 @@ namespace sat {
}
bool integrity_checker::check_learned_clauses() const {
unsigned num_frozen = 0;
clause * const * end = s.end_clauses();
for (clause * const * it = s.begin_clauses(); it != end; ++it) {
clause & c = *(*it);
if (c.frozen())
num_frozen++;
}
unsigned num_frozen = num_true(s.learned(), [&](clause const* c) { return c->frozen(); });
VERIFY(num_frozen == s.m_num_frozen);
return check_clauses(s.begin_learned(), s.end_learned());
}