14 : internal (i), file (f), binary (b)
17 added (0), deleted (0)
26 file->connect_internal (internal);
27 LOG (
"LRAT TRACER connected to internal");
31 LOG (
"LRAT TRACER delete");
37inline void LratTracer::put_binary_zero () {
40 file->put ((
unsigned char) 0);
43inline void LratTracer::put_binary_lit (
int lit) {
47 unsigned idx = abs (
lit);
49 unsigned x = 2 * idx + (
lit < 0);
52 ch = (x & 0x7f) | 0x80;
60inline void LratTracer::put_binary_id (int64_t
id) {
63 uint64_t x = abs (
id);
67 ch = (x & 0x7f) | 0x80;
77void LratTracer::lrat_add_clause (int64_t
id,
const vector<int> &
clause,
78 const vector<int64_t> &chain) {
79 if (delete_ids.size ()) {
81 file->put (latest_id), file->put (
" ");
86 for (
auto &did : delete_ids) {
90 file->put (did), file->put (
" ");
101 file->put (
'a'), put_binary_id (
id);
103 file->put (
id), file->put (
" ");
104 for (
const auto &external_lit :
clause)
106 put_binary_lit (external_lit);
108 file->put (external_lit), file->put (
' ');
113 for (
const auto &c : chain)
117 file->put (c), file->put (
' ');
124void LratTracer::lrat_delete_clause (int64_t
id) {
125 delete_ids.push_back (
id);
135 LOG (
"LRAT TRACER tracing addition of derived clause");
136 lrat_add_clause (
id,
clause, chain);
145 LOG (
"LRAT TRACER tracing deletion of clause");
146 lrat_delete_clause (
id);
155 LOG (
"LRAT TRACER tracing begin of proof");
165void LratTracer::print_statistics () {
167 uint64_t total = added + deleted;
168 MSG (
"LRAT %" PRId64
" added clauses %.2f%%", added,
170 MSG (
"LRAT %" PRId64
" deleted clauses %.2f%%", deleted,
172 MSG (
"LRAT %" PRId64
" bytes (%.2f MB)", bytes,
173 bytes / (
double) (1 << 20));
183 MSG (
"LRAT proof file '%s' closed", file->name ());
196 MSG (
"LRAT proof file '%s' flushed", file->name ());
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
void begin_proof(int64_t) override
void connect_internal(Internal *i) override
void close(bool) override
void flush(bool) override
void delete_clause(int64_t, bool, const vector< int > &) override
void add_derived_clause(int64_t, bool, const vector< int > &, const vector< int64_t > &) override
LratTracer(Internal *, File *file, bool binary)
double percent(double a, double b)
struct clause_t clause
STRUCTURE DEFINITIONS ///.