ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
occs.hpp
Go to the documentation of this file.
1#ifndef _occs_h_INCLUDED
2#define _occs_h_INCLUDED
3
4#include "global.h"
5
6#include <vector>
7
9
10namespace CaDiCaL {
11
12// Full occurrence lists used in a one-watch scheme for all clauses in
13// subsumption checking and for irredundant clauses in variable elimination.
14
15struct Clause;
16using namespace std;
17
19
20inline void shrink_occs (Occs &os) { shrink_vector (os); }
21inline void erase_occs (Occs &os) { erase_vector (os); }
22
23inline void remove_occs (Occs &os, Clause *c) {
24 const auto end = os.end ();
25 auto i = os.begin ();
26 for (auto j = i; j != end; j++) {
27 const Clause *d = *i++ = *j;
28 if (c == d)
29 i--;
30 }
31 CADICAL_assert (i + 1 == end);
32 os.resize (i - os.begin ());
33}
34
35typedef Occs::iterator occs_iterator;
36typedef Occs::const_iterator const_occs_iterator;
37
38} // namespace CaDiCaL
39
41
42#endif
#define ABC_NAMESPACE_CXX_HEADER_START
#define ABC_NAMESPACE_CXX_HEADER_END
#define CADICAL_assert(ignore)
Definition global.h:14
void shrink_vector(std::vector< T > &v)
Definition util.hpp:101
void erase_occs(Occs &os)
Definition occs.hpp:21
vector< Clause * > Occs
Definition occs.hpp:18
Occs::iterator occs_iterator
Definition occs.hpp:35
void shrink_occs(Occs &os)
Definition occs.hpp:20
Occs::const_iterator const_occs_iterator
Definition occs.hpp:36
void erase_vector(std::vector< T > &v)
Definition util.hpp:90
void remove_occs(Occs &os, Clause *c)
Definition occs.hpp:23