ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
collect.c File Reference
#include "collect.h"
#include "allocate.h"
#include "colors.h"
#include "compact.h"
#include "inline.h"
#include "print.h"
#include "report.h"
#include "sort.c"
#include "trail.h"
#include <inttypes.h>
#include <string.h>
Include dependency graph for collect.c:

Go to the source code of this file.

Macros

#define INLINE_SORT
 

Functions

void kissat_update_first_reducible (kissat *solver, clause *reducible)
 
void kissat_update_last_irredundant (kissat *solver, clause *irredundant)
 
void kissat_sparse_collect (kissat *solver, bool compact, reference start)
 
bool kissat_compacting (kissat *solver)
 
void kissat_initial_sparse_collect (kissat *solver)
 
void kissat_dense_collect (kissat *solver)
 

Macro Definition Documentation

◆ INLINE_SORT

#define INLINE_SORT

Definition at line 1 of file collect.c.

Function Documentation

◆ kissat_compacting()

bool kissat_compacting ( kissat * solver)

Definition at line 635 of file collect.c.

635 {
636 if (!GET_OPTION (compact))
637 return false;
638 unsigned inactive = solver->vars - solver->active;
639 unsigned limit = GET_OPTION (compactlim) / 1e2 * solver->vars;
640 bool compact = (inactive > limit);
641 LOG ("%u inactive variables %.0f%% <= limit %u %.0f%%", inactive,
642 kissat_percent (inactive, solver->vars), limit,
643 kissat_percent (limit, solver->vars));
644 return compact;
645}
#define LOG(...)
#define solver
Definition kitten.c:211
#define GET_OPTION(N)
Definition options.h:295
Here is the caller graph for this function:

◆ kissat_dense_collect()

void kissat_dense_collect ( kissat * solver)

Definition at line 730 of file collect.c.

730 {
731 KISSAT_assert (!solver->watching);
732 KISSAT_assert (!solver->level);
733 START (collect);
734 INC (garbage_collections);
735 INC (dense_garbage_collections);
736 REPORT (1, 'G');
737 dense_sweep_garbage_clauses (solver);
738 REPORT (1, 'C');
739 STOP (collect);
740}
#define INC(NAME)
#define KISSAT_assert(ignore)
Definition global.h:13
#define STOP(P)
Definition profile.hpp:158
#define START(P)
Definition profile.hpp:150
#define REPORT(...)
Definition report.h:10

◆ kissat_initial_sparse_collect()

void kissat_initial_sparse_collect ( kissat * solver)

Definition at line 647 of file collect.c.

647 {
648 KISSAT_assert (!solver->level);
649 KISSAT_assert (!solver->inconsistent);
650 KISSAT_assert (solver->watching);
651 KISSAT_assert (kissat_trail_flushed (solver));
652 if (solver->statistics_.units) {
653 bool compact = GET_OPTION (compact);
654 kissat_sparse_collect (solver, compact, 0);
655 }
656 REPORT (0, '.');
657}
void kissat_sparse_collect(kissat *solver, bool compact, reference start)
Definition collect.c:610
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kissat_sparse_collect()

void kissat_sparse_collect ( kissat * solver,
bool compact,
reference start )

Definition at line 610 of file collect.c.

610 {
611 KISSAT_assert (solver->watching);
612 START (collect);
613 INC (garbage_collections);
614 INC (sparse_gcs);
615 REPORT (1, 'G');
616 unsigned vars, mfixed;
617 if (compact)
618 vars = kissat_compact_literals (solver, &mfixed);
619 else {
620 vars = solver->vars;
621 mfixed = INVALID_LIT;
622 }
623 flush_all_watched_clauses (solver, compact, start);
624 reference move = sparse_sweep_garbage_clauses (solver, compact, start);
625 if (compact)
626 kissat_finalize_compacting (solver, vars, mfixed);
627 if (move != INVALID_REF)
628 move_redundant_clauses_to_the_end (solver, move);
629 rewatch_clauses (solver, start);
630 REPORT (1, 'C');
632 STOP (collect);
633}
#define INVALID_LIT
unsigned kissat_compact_literals(kissat *solver, unsigned *mfixed_ptr)
Definition compact.c:21
void kissat_finalize_compacting(kissat *solver, unsigned vars, unsigned mfixed)
Definition compact.c:322
#define INVALID_REF
Definition reference.h:16
ABC_NAMESPACE_HEADER_START typedef unsigned reference
Definition reference.h:9
#define kissat_check_statistics(...)
Definition statistics.h:464
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kissat_update_first_reducible()

void kissat_update_first_reducible ( kissat * solver,
clause * reducible )

Definition at line 185 of file collect.c.

185 {
187 KISSAT_assert (!reducible->garbage);
188 KISSAT_assert (reducible->redundant);
189 if (solver->first_reducible != INVALID_REF) {
190 reference ref = kissat_reference_clause (solver, reducible);
191 if (ref >= solver->first_reducible) {
192 LOG ("no need to update larger first reducible");
193 return;
194 }
195 }
196 clause *end = (clause *) END_STACK (solver->arena);
197 update_first_reducible (solver, end, reducible);
198}
#define END_STACK(S)
Definition stack.h:48
unsigned short ref
Definition giaNewBdd.h:38

◆ kissat_update_last_irredundant()

void kissat_update_last_irredundant ( kissat * solver,
clause * irredundant )

Definition at line 200 of file collect.c.

200 {
202 KISSAT_assert (!irredundant->garbage);
203 KISSAT_assert (!irredundant->redundant);
204 if (solver->last_irredundant != INVALID_REF) {
205 reference ref = kissat_reference_clause (solver, irredundant);
206 if (ref <= solver->last_irredundant) {
207 LOG ("no need to update smaller last irredundant");
208 return;
209 }
210 }
211 clause *end = (clause *) END_STACK (solver->arena);
212 update_last_irredundant (solver, end, irredundant);
213}
pcover irredundant()
Here is the call graph for this function:
Here is the caller graph for this function: