ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
check.h
Go to the documentation of this file.
1#ifndef _check_h_INCLUDED
2#define _check_h_INCLUDED
3
4#include <stdbool.h>
5#include <stdlib.h>
6
7#include "global.h"
9
10#ifndef KISSAT_NDEBUG
11
12struct kissat;
13
14void kissat_check_satisfying_assignment (struct kissat *);
15
16typedef struct checker checker;
17
18struct clause;
19
20void kissat_init_checker (struct kissat *);
21void kissat_release_checker (struct kissat *);
22
23#ifndef KISSAT_QUIET
24void kissat_print_checker_statistics (struct kissat *, bool verbose);
25#endif
26
27void kissat_add_unchecked_external (struct kissat *, size_t, const int *);
28
29void kissat_check_and_add_binary (struct kissat *, unsigned, unsigned);
30void kissat_check_and_add_clause (struct kissat *, struct clause *c);
31void kissat_check_and_add_empty (struct kissat *);
32void kissat_check_and_add_internal (struct kissat *, size_t,
33 const unsigned *);
34void kissat_check_and_add_unit (struct kissat *, unsigned);
35
36void kissat_check_shrink_clause (struct kissat *, struct clause *,
37 unsigned remove, unsigned keep);
38
39void kissat_remove_checker_binary (struct kissat *, unsigned, unsigned);
40void kissat_remove_checker_clause (struct kissat *, struct clause *c);
41void kissat_remove_checker_external (struct kissat *, size_t, const int *);
42
43void kissat_remove_checker_internal (struct kissat *, size_t,
44 const unsigned *);
45
46#define ADD_UNCHECKED_EXTERNAL(SIZE, LITS) \
47 do { \
48 if (GET_OPTION (check) > 1) \
49 kissat_add_unchecked_external (solver, (SIZE), (LITS)); \
50 } while (0)
51
52#define CHECK_AND_ADD_BINARY(A, B) \
53 do { \
54 if (GET_OPTION (check) > 1) \
55 kissat_check_and_add_binary (solver, (A), (B)); \
56 } while (0)
57
58#define CHECK_AND_ADD_TERNARY(A, B, C) \
59 do { \
60 if (GET_OPTION (check) > 1) { \
61 unsigned CLAUSE[3] = {(A), (B), (C)}; \
62 kissat_check_and_add_internal (solver, 3, CLAUSE); \
63 } \
64 } while (0)
65
66#define CHECK_AND_ADD_CLAUSE(CLAUSE) \
67 do { \
68 if (GET_OPTION (check) > 1) \
69 kissat_check_and_add_clause (solver, (CLAUSE)); \
70 } while (0)
71
72#define CHECK_AND_ADD_EMPTY() \
73 do { \
74 if (GET_OPTION (check) > 1) \
75 kissat_check_and_add_empty (solver); \
76 } while (0)
77
78#define CHECK_AND_ADD_LITS(SIZE, LITS) \
79 do { \
80 if (GET_OPTION (check) > 1) \
81 kissat_check_and_add_internal (solver, (SIZE), (LITS)); \
82 } while (0)
83
84#define CHECK_AND_ADD_STACK(S) \
85 CHECK_AND_ADD_LITS (SIZE_STACK (S), BEGIN_STACK (S))
86
87#define CHECK_AND_ADD_UNIT(A) \
88 do { \
89 if (GET_OPTION (check) > 1) \
90 kissat_check_and_add_unit (solver, (A)); \
91 } while (0)
92
93#define CHECK_SHRINK_CLAUSE(C, REMOVE, KEEP) \
94 do { \
95 if (GET_OPTION (check) > 1) \
96 kissat_check_shrink_clause (solver, (C), (REMOVE), (KEEP)); \
97 } while (0)
98
99#define REMOVE_CHECKER_BINARY(A, B) \
100 do { \
101 if (GET_OPTION (check) > 1) \
102 kissat_remove_checker_binary (solver, (A), (B)); \
103 } while (0)
104
105#define REMOVE_CHECKER_TERNARY(A, B, C) \
106 do { \
107 if (GET_OPTION (check) > 1) { \
108 unsigned CLAUSE[3] = {(A), (B), (C)}; \
109 kissat_remove_checker_internal (solver, 3, CLAUSE); \
110 } \
111 } while (0)
112
113#define REMOVE_CHECKER_CLAUSE(CLAUSE) \
114 do { \
115 if (GET_OPTION (check) > 1) \
116 kissat_remove_checker_clause (solver, (CLAUSE)); \
117 } while (0)
118
119#define REMOVE_CHECKER_LITS(SIZE, LITS) \
120 do { \
121 if (GET_OPTION (check) > 1) \
122 kissat_remove_checker_internal (solver, (SIZE), (LITS)); \
123 } while (0)
124
125#define REMOVE_CHECKER_STACK(S) \
126 do { \
127 if (GET_OPTION (check) > 1) \
128 kissat_remove_checker_internal (solver, SIZE_STACK (S), \
129 BEGIN_STACK (S)); \
130 } while (0)
131
132#else
133
134#define ADD_UNCHECKED_EXTERNAL(...) \
135 do { \
136 } while (0)
137#define CHECK_AND_ADD_BINARY(...) \
138 do { \
139 } while (0)
140#define CHECK_AND_ADD_TERNARY(...) \
141 do { \
142 } while (0)
143#define CHECK_AND_ADD_CLAUSE(...) \
144 do { \
145 } while (0)
146#define CHECK_AND_ADD_EMPTY(...) \
147 do { \
148 } while (0)
149#define CHECK_AND_ADD_LITS(...) \
150 do { \
151 } while (0)
152#define CHECK_AND_ADD_STACK(...) \
153 do { \
154 } while (0)
155#define CHECK_AND_ADD_UNIT(...) \
156 do { \
157 } while (0)
158#define CHECK_SHRINK_CLAUSE(...) \
159 do { \
160 } while (0)
161#define REMOVE_CHECKER_BINARY(...) \
162 do { \
163 } while (0)
164#define REMOVE_CHECKER_TERNARY(...) \
165 do { \
166 } while (0)
167#define REMOVE_CHECKER_CLAUSE(...) \
168 do { \
169 } while (0)
170#define REMOVE_CHECKER_LITS(...) \
171 do { \
172 } while (0)
173#define REMOVE_CHECKER_STACK(...) \
174 do { \
175 } while (0)
176
177#endif
178
180
181#endif
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.