ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
proof.h
Go to the documentation of this file.
1#ifndef _proof_h_INCLUDED
2#define _proof_h_INCLUDED
3
4#include <stdbool.h>
5#include <stdlib.h>
6
7#include "global.h"
9
10#ifndef KISSAT_NPROOFS
11
12typedef struct proof proof;
13
14struct clause;
15struct file;
16
17void kissat_init_proof (struct kissat *, struct file *, bool binary);
18void kissat_release_proof (struct kissat *);
19
20#ifndef KISSAT_QUIET
21void kissat_print_proof_statistics (struct kissat *, bool verbose);
22#endif
23
24void kissat_add_binary_to_proof (struct kissat *, unsigned, unsigned);
25void kissat_add_clause_to_proof (struct kissat *, const struct clause *c);
26void kissat_add_empty_to_proof (struct kissat *);
27void kissat_add_lits_to_proof (struct kissat *, size_t, const unsigned *);
28void kissat_add_unit_to_proof (struct kissat *, unsigned);
29
30void kissat_shrink_clause_in_proof (struct kissat *, const struct clause *,
31 unsigned remove, unsigned keep);
32
33void kissat_delete_binary_from_proof (struct kissat *, unsigned, unsigned);
34void kissat_delete_clause_from_proof (struct kissat *,
35 const struct clause *c);
36void kissat_delete_external_from_proof (struct kissat *, size_t,
37 const int *);
38void kissat_delete_internal_from_proof (struct kissat *, size_t,
39 const unsigned *);
40
41#define ADD_BINARY_TO_PROOF(A, B) \
42 do { \
43 if (solver->proof) \
44 kissat_add_binary_to_proof (solver, (A), (B)); \
45 } while (0)
46
47#define ADD_TERNARY_TO_PROOF(A, B, C) \
48 do { \
49 if (solver->proof) { \
50 unsigned CLAUSE[3] = {(A), (B), (C)}; \
51 kissat_add_lits_to_proof (solver, 3, CLAUSE); \
52 } \
53 } while (0)
54
55#define ADD_CLAUSE_TO_PROOF(CLAUSE) \
56 do { \
57 if (solver->proof) \
58 kissat_add_clause_to_proof (solver, (CLAUSE)); \
59 } while (0)
60
61#define ADD_EMPTY_TO_PROOF() \
62 do { \
63 if (solver->proof) \
64 kissat_add_empty_to_proof (solver); \
65 } while (0)
66
67#define ADD_LITS_TO_PROOF(SIZE, LITS) \
68 do { \
69 if (solver->proof) \
70 kissat_add_lits_to_proof (solver, (SIZE), (LITS)); \
71 } while (0)
72
73#define ADD_STACK_TO_PROOF(S) \
74 ADD_LITS_TO_PROOF (SIZE_STACK (S), BEGIN_STACK (S))
75
76#define ADD_UNIT_TO_PROOF(A) \
77 do { \
78 if (solver->proof) \
79 kissat_add_unit_to_proof (solver, (A)); \
80 } while (0)
81
82#define SHRINK_CLAUSE_IN_PROOF(C, REMOVE, KEEP) \
83 do { \
84 if (solver->proof) \
85 kissat_shrink_clause_in_proof (solver, (C), (REMOVE), (KEEP)); \
86 } while (0)
87
88#define DELETE_BINARY_FROM_PROOF(A, B) \
89 do { \
90 if (solver->proof) \
91 kissat_delete_binary_from_proof (solver, (A), (B)); \
92 } while (0)
93
94#define DELETE_TERNARY_FROM_PROOF(A, B, C) \
95 do { \
96 if (solver->proof) { \
97 unsigned CLAUSE[3] = {(A), (B), (C)}; \
98 kissat_delete_internal_from_proof (solver, 3, CLAUSE); \
99 } \
100 } while (0)
101
102#define DELETE_CLAUSE_FROM_PROOF(CLAUSE) \
103 do { \
104 if (solver->proof) \
105 kissat_delete_clause_from_proof (solver, (CLAUSE)); \
106 } while (0)
107
108#define DELETE_LITS_FROM_PROOF(SIZE, LITS) \
109 do { \
110 if (solver->proof) \
111 kissat_delete_internal_from_proof (solver, (SIZE), (LITS)); \
112 } while (0)
113
114#define DELETE_STACK_FROM_PROOF(S) \
115 do { \
116 if (solver->proof) \
117 kissat_delete_internal_from_proof (solver, SIZE_STACK (S), \
118 BEGIN_STACK (S)); \
119 } while (0)
120
121#else
122
123#define ADD_BINARY_TO_PROOF(...) \
124 do { \
125 } while (0)
126#define ADD_TERNARY_TO_PROOF(...) \
127 do { \
128 } while (0)
129#define ADD_CLAUSE_TO_PROOF(...) \
130 do { \
131 } while (0)
132#define ADD_LITS_TO_PROOF(...) \
133 do { \
134 } while (0)
135#define ADD_EMPTY_TO_PROOF(...) \
136 do { \
137 } while (0)
138#define ADD_STACK_TO_PROOF(...) \
139 do { \
140 } while (0)
141#define ADD_UNIT_TO_PROOF(...) \
142 do { \
143 } while (0)
144
145#define SHRINK_CLAUSE_IN_PROOF(...) \
146 do { \
147 } while (0)
148
149#define DELETE_BINARY_FROM_PROOF(...) \
150 do { \
151 } while (0)
152#define DELETE_TERNARY_FROM_PROOF(...) \
153 do { \
154 } while (0)
155#define DELETE_CLAUSE_FROM_PROOF(...) \
156 do { \
157 } while (0)
158#define DELETE_LITS_FROM_PROOF(...) \
159 do { \
160 } while (0)
161#define DELETE_STACK_FROM_PROOF(...) \
162 do { \
163 } while (0)
164
165#endif
166
168
169#endif
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition file.h:23