ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
Gluco::ClauseAllocator Class Reference

#include <SolverTypes.h>

Inheritance diagram for Gluco::ClauseAllocator:
Collaboration diagram for Gluco::ClauseAllocator:

Public Member Functions

 ClauseAllocator (uint32_t start_cap)
 
 ClauseAllocator ()
 
void moveTo (ClauseAllocator &to)
 
template<class Lits>
CRef alloc (const Lits &ps, bool learnt=false)
 
Clauseoperator[] (Ref r)
 
const Clauseoperator[] (Ref r) const
 
Clauselea (Ref r)
 
const Clauselea (Ref r) const
 
Ref ael (const Clause *t)
 
void free_ (CRef cid)
 
void reloc (CRef &cr, ClauseAllocator &to)
 
- Public Member Functions inherited from Gluco::RegionAllocator< uint32_t >
 RegionAllocator (uint32_t start_cap=1024 *1024)
 
 ~RegionAllocator ()
 
uint32_t size () const
 
uint32_t wasted () const
 
Ref alloc (int size)
 
void free_ (int size)
 
void clear ()
 
uint32_toperator[] (Ref r)
 
const uint32_toperator[] (Ref r) const
 
uint32_tlea (Ref r)
 
const uint32_tlea (Ref r) const
 
Ref ael (const uint32_t *t)
 
void moveTo (RegionAllocator &to)
 

Public Attributes

bool extra_clause_field
 

Additional Inherited Members

- Public Types inherited from Gluco::RegionAllocator< uint32_t >
enum  
 
enum  
 
typedef uint32_t Ref
 

Detailed Description

Definition at line 217 of file SolverTypes.h.

Constructor & Destructor Documentation

◆ ClauseAllocator() [1/2]

Gluco::ClauseAllocator::ClauseAllocator ( uint32_t start_cap)
inline

Definition at line 224 of file SolverTypes.h.

RegionAllocator(uint32_t start_cap=1024 *1024)
Definition Alloc.h:50
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClauseAllocator() [2/2]

Gluco::ClauseAllocator::ClauseAllocator ( )
inline

Definition at line 225 of file SolverTypes.h.

225: extra_clause_field(false){}

Member Function Documentation

◆ ael()

Ref Gluco::ClauseAllocator::ael ( const Clause * t)
inline

Definition at line 249 of file SolverTypes.h.

unsigned int uint32_t
Definition Fxch.h:32
Ref ael(const T *t)
Definition Alloc.h:71
Here is the call graph for this function:

◆ alloc()

template<class Lits>
CRef Gluco::ClauseAllocator::alloc ( const Lits & ps,
bool learnt = false )
inline

Definition at line 232 of file SolverTypes.h.

233 {
234 assert(sizeof(Lit) == sizeof(uint32_t));
235 assert(sizeof(float) == sizeof(uint32_t));
236 bool use_extra = learnt | extra_clause_field;
237
238 CRef cid = RegionAllocator<uint32_t>::alloc(clauseWord32Size(ps.size(), use_extra));
239 new (lea(cid)) Clause(ps, use_extra, learnt);
240
241 return cid;
242 }
Clause * lea(Ref r)
Ref alloc(int size)
Definition Alloc.h:114
RegionAllocator< uint32_t >::Ref CRef
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_()

void Gluco::ClauseAllocator::free_ ( CRef cid)
inline

Definition at line 251 of file SolverTypes.h.

252 {
253 Clause& c = operator[](cid);
254 RegionAllocator<uint32_t>::free_(clauseWord32Size(c.size(), c.has_extra()));
255 }
Clause & operator[](Ref r)
void free_(int size)
Definition Alloc.h:62
Here is the call graph for this function:

◆ lea() [1/2]

Clause * Gluco::ClauseAllocator::lea ( Ref r)
inline

Definition at line 247 of file SolverTypes.h.

247{ return (Clause*)RegionAllocator<uint32_t>::lea(r); }
T * lea(Ref r)
Definition Alloc.h:69
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lea() [2/2]

const Clause * Gluco::ClauseAllocator::lea ( Ref r) const
inline

Definition at line 248 of file SolverTypes.h.

248{ return (Clause*)RegionAllocator<uint32_t>::lea(r); }
Here is the call graph for this function:

◆ moveTo()

void Gluco::ClauseAllocator::moveTo ( ClauseAllocator & to)
inline

Definition at line 227 of file SolverTypes.h.

227 {
228 to.extra_clause_field = extra_clause_field;
void moveTo(RegionAllocator &to)
Definition Alloc.h:74
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]() [1/2]

Clause & Gluco::ClauseAllocator::operator[] ( Ref r)
inline

Definition at line 245 of file SolverTypes.h.

245{ return (Clause&)RegionAllocator<uint32_t>::operator[](r); }
T & operator[](Ref r)
Definition Alloc.h:66
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]() [2/2]

const Clause & Gluco::ClauseAllocator::operator[] ( Ref r) const
inline

Definition at line 246 of file SolverTypes.h.

246{ return (Clause&)RegionAllocator<uint32_t>::operator[](r); }
Here is the call graph for this function:

◆ reloc()

void Gluco::ClauseAllocator::reloc ( CRef & cr,
ClauseAllocator & to )
inline

Definition at line 257 of file SolverTypes.h.

258 {
259 Clause& c = operator[](cr);
260
261 if (c.reloced()) { cr = c.relocation(); return; }
262
263 cr = to.alloc(c, c.learnt());
264 c.relocate(cr);
265
266 // Copy extra data-fields:
267 // (This could be cleaned-up. Generalize Clause-constructor to be applicable here instead?)
268 to[cr].mark(c.mark());
269 if (to[cr].learnt()) {
270 to[cr].activity() = c.activity();
271 to[cr].setLBD(c.lbd());
272 to[cr].setSizeWithoutSelectors(c.sizeWithoutSelectors());
273 to[cr].setCanBeDel(c.canBeDel());
274 }
275 else if (to[cr].has_extra()) to[cr].calcAbstraction();
276 }
Here is the call graph for this function:

Member Data Documentation

◆ extra_clause_field

bool Gluco::ClauseAllocator::extra_clause_field

Definition at line 222 of file SolverTypes.h.


The documentation for this class was generated from the following file: