ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
proof.hpp
Go to the documentation of this file.
1#ifndef _proof_h_INCLUDED
2#define _proof_h_INCLUDED
3
4#include "global.h"
5
7
8namespace CaDiCaL {
9
10/*------------------------------------------------------------------------*/
11
12class File;
13struct Clause;
14struct Internal;
15class Tracer;
16class FileTracer;
17
18/*------------------------------------------------------------------------*/
19
20// Provides proof checking and writing.
21
22class Proof {
23
24 Internal *internal;
25
26 vector<int> clause; // of external literals
27 vector<int64_t> proof_chain; // LRAT style proof chain of clause
28 int64_t clause_id; // id of added clause
29 bool redundant;
30
31 // the 'tracers'
32 vector<Tracer *> tracers; // tracers (ie checker)
33 vector<FileTracer *> file_tracers; // file tracers (ie LRAT tracer)
34
35 void add_literal (int internal_lit); // add to 'clause'
36 void add_literals (Clause *); // add to 'clause'
37
38 void add_literals (const vector<int> &); // ditto
39
40 void add_original_clause (
41 bool restore = false); // notify observers of original clauses
42 void add_derived_clause ();
43 void add_assumption_clause ();
44 void delete_clause ();
45 void demote_clause ();
46 void weaken_minus ();
47 void strengthen ();
48 void finalize_clause ();
49 void add_assumption ();
50 void add_constraint ();
51
52public:
53 Proof (Internal *);
54 ~Proof ();
55
56 void connect (Tracer *t) { tracers.push_back (t); }
57 void disconnect (Tracer *t);
58 // Add original clauses to the proof (for online proof checking).
59 //
60 void add_original_clause (int64_t, bool, const vector<int> &);
61
62 void add_assumption_clause (int64_t, const vector<int> &,
63 const vector<int64_t> &);
64 void add_assumption_clause (int64_t, int, const vector<int64_t> &);
65 void add_assumption (int);
66 void add_constraint (const vector<int> &);
67 void reset_assumptions ();
68
69 // Add/delete original clauses to/from the proof using their original
70 // external literals (from external->eclause)
71 //
72 void add_external_original_clause (int64_t, bool, const vector<int> &,
73 bool restore = false);
74 void delete_external_original_clause (int64_t, bool, const vector<int> &);
75
76 // Add derived (such as learned) clauses to the proof.
77 //
78 void add_derived_empty_clause (int64_t, const vector<int64_t> &);
79 void add_derived_unit_clause (int64_t, int unit, const vector<int64_t> &);
80 void add_derived_clause (Clause *c, const vector<int64_t> &);
81 void add_derived_clause (int64_t, bool, const vector<int> &,
82 const vector<int64_t> &);
83
84 // deletion of clauses. It comes in several variants, depending if the
85 // clause should be restored or not
86 void delete_clause (int64_t, bool, const vector<int> &);
87 void weaken_minus (int64_t, const vector<int> &);
88 void weaken_plus (int64_t, const vector<int> &);
89 void delete_unit_clause (int64_t id, const int lit);
90 void delete_clause (Clause *);
91 void weaken_minus (Clause *);
92 void weaken_plus (Clause *);
93 void strengthen (int64_t);
94
95 void finalize_unit (int64_t, int);
96 void finalize_external_unit (int64_t, int);
97 void finalize_clause (int64_t, const vector<int> &c);
98 void finalize_clause (Clause *);
99
100 void report_status (int, int64_t);
101 void begin_proof (int64_t);
103 void conclude_sat (const vector<int> &model);
104 void conclude_unknown (const vector<int> &trace);
105 void solve_query ();
106 // These two actually pretend to add and remove a clause.
107 //
108 void flush_clause (Clause *); // remove falsified literals
109 void strengthen_clause (Clause *, int, const vector<int64_t> &);
111 const vector<int64_t> &);
112
113 void flush ();
114};
115
116} // namespace CaDiCaL
117
119
120#endif
#define ABC_NAMESPACE_CXX_HEADER_START
#define ABC_NAMESPACE_CXX_HEADER_END
Proof(Internal *)
void disconnect(Tracer *t)
void finalize_unit(int64_t, int)
void delete_unit_clause(int64_t id, const int lit)
void connect(Tracer *t)
Definition proof.hpp:56
void conclude_unknown(const vector< int > &trace)
void weaken_plus(int64_t, const vector< int > &)
void strengthen_clause(Clause *, int, const vector< int64_t > &)
void begin_proof(int64_t)
void delete_external_original_clause(int64_t, bool, const vector< int > &)
void finalize_external_unit(int64_t, int)
void otfs_strengthen_clause(Clause *, const vector< int > &, const vector< int64_t > &)
void add_derived_unit_clause(int64_t, int unit, const vector< int64_t > &)
void report_status(int, int64_t)
void add_derived_empty_clause(int64_t, const vector< int64_t > &)
void flush_clause(Clause *)
void conclude_sat(const vector< int > &model)
void conclude_unsat(ConclusionType, const vector< int64_t > &)
void add_external_original_clause(int64_t, bool, const vector< int > &, bool restore=false)
bool trace
Definition globals.c:36
ConclusionType
Definition tracer.hpp:15
int lit
Definition satVec.h:130