ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cadical_solution.cpp
Go to the documentation of this file.
1#include "global.h"
2
3#include "internal.hpp"
4
6
7namespace CaDiCaL {
8
9// Sam Buss suggested to debug the case where a solver incorrectly claims
10// the formula to be unsatisfiable by checking every learned clause to be
11// satisfied by a satisfying assignment. Thus the first inconsistent
12// learned clause will be immediately flagged without the need to generate
13// proof traces and perform forward proof checking. The incorrectly derived
14// clause will raise an abort signal and thus allows to debug the issue with
15// a symbolic debugger immediately.
16
19 for (const auto &lit : internal->clause)
20 if (sol (internal->externalize (lit)) == lit)
21 return;
23 fputs ("learned clause unsatisfied by solution:\n", stderr);
24 for (const auto &lit : internal->clause)
25 fprintf (stderr, "%d ", lit);
26 fputc ('0', stderr);
28}
29
32 for (const auto &lit : *c)
33 if (sol (internal->externalize (lit)) == lit)
34 return;
36 for (const auto &lit : *c)
37 fprintf (stderr, "%d ", lit);
38 fputc ('0', stderr);
40}
41
44 FATAL ("learned empty clause but got solution");
45}
46
49 if (sol (internal->externalize (unit)) == unit)
50 return;
51 FATAL ("learned unit %d contradicts solution", unit);
52}
53
54} // namespace CaDiCaL
55
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
Definition global.h:14
#define FATAL
Definition message.hpp:64
void fatal_message_start()
void fatal_message_end()
int lit
Definition satVec.h:130
void check_solution_on_learned_unit_clause(int unit)
signed char * solution
Definition external.hpp:135
void check_no_solution_after_learning_empty_clause()
void check_solution_on_shrunken_clause(Clause *)
Internal * internal
Definition external.hpp:61
void check_solution_on_learned_clause()
int sol(int elit) const
Definition external.hpp:446