ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
krite.c File Reference
#include "krite.h"
#include "inline.h"
#include "internal.h"
#include "watch.h"
#include <inttypes.h>
Include dependency graph for krite.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void kissat_write_dimacs (kissat *solver, FILE *file)
 

Function Documentation

◆ kissat_write_dimacs()

ABC_NAMESPACE_IMPL_START void kissat_write_dimacs ( kissat * solver,
FILE * file )

Definition at line 10 of file krite.c.

10 {
11 size_t imported = SIZE_STACK (solver->import);
12 if (imported)
13 imported--;
14 fprintf (file, "p cnf %zu %" PRIu64 "\n", imported, BINIRR_CLAUSES);
15 KISSAT_assert (solver->watching);
16 if (solver->watching) {
17 for (all_literals (ilit))
19 if (watch.type.binary) {
20 const unsigned iother = watch.binary.lit;
21 if (iother < ilit)
22 continue;
23 const int elit = kissat_export_literal (solver, ilit);
24 const int eother = kissat_export_literal (solver, iother);
25 fprintf (file, "%d %d 0\n", elit, eother);
26 }
27 } else {
28 for (all_literals (ilit))
30 if (watch.type.binary) {
31 const unsigned iother = watch.binary.lit;
32 if (iother < ilit)
33 continue;
34 const int elit = kissat_export_literal (solver, ilit);
35 const int eother = kissat_export_literal (solver, iother);
36 fprintf (file, "%d %d 0\n", elit, eother);
37 }
38 }
39 for (all_clauses (c))
40 if (!c->garbage && !c->redundant) {
41 for (all_literals_in_clause (ilit, c)) {
42 const int elit = kissat_export_literal (solver, ilit);
43 fprintf (file, "%d ", elit);
44 }
45 fputs ("0\n", file);
46 }
47}
#define SIZE_STACK(S)
Definition stack.h:19
#define all_literals(LIT)
Definition internal.h:274
#define all_clauses(C)
Definition internal.h:279
#define all_literals_in_clause(LIT, C)
Definition clause.h:47
#define KISSAT_assert(ignore)
Definition global.h:13
#define solver
Definition kitten.c:211
#define BINIRR_CLAUSES
Definition statistics.h:341
Definition file.h:23
Definition watch.h:41
watch_type type
Definition watch.h:42
binary_watch binary
Definition watch.h:43
#define all_binary_blocking_watches(WATCH, WATCHES)
Definition watch.h:151
#define all_binary_large_watches(WATCH, WATCHES)
Definition watch.h:158
#define WATCHES(LIT)
Definition watch.h:137