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

#include <SolverTypes.h>

Inheritance diagram for Gluco2::ClauseAllocator:
Collaboration diagram for Gluco2::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 Gluco2::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 Gluco2::RegionAllocator< uint32_t >
enum  
 
enum  
 
typedef uint32_t Ref
 

Detailed Description

Definition at line 223 of file SolverTypes.h.

Constructor & Destructor Documentation

◆ ClauseAllocator() [1/2]

Gluco2::ClauseAllocator::ClauseAllocator ( uint32_t start_cap)
inline

Definition at line 230 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]

Gluco2::ClauseAllocator::ClauseAllocator ( )
inline

Definition at line 231 of file SolverTypes.h.

231: extra_clause_field(false){}

Member Function Documentation

◆ ael()

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

Definition at line 255 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 Gluco2::ClauseAllocator::alloc ( const Lits & ps,
bool learnt = false )
inline

Definition at line 238 of file SolverTypes.h.

239 {
240 assert(sizeof(Lit) == sizeof(uint32_t));
241 assert(sizeof(float) == sizeof(uint32_t));
242 bool use_extra = learnt | extra_clause_field;
243
244 CRef cid = RegionAllocator<uint32_t>::alloc(clauseWord32Size(ps.size(), use_extra));
245 new (lea(cid)) Clause(ps, use_extra, learnt);
246
247 return cid;
248 }
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 Gluco2::ClauseAllocator::free_ ( CRef cid)
inline

Definition at line 257 of file SolverTypes.h.

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

◆ lea() [1/2]

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

Definition at line 253 of file SolverTypes.h.

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

◆ lea() [2/2]

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

Definition at line 254 of file SolverTypes.h.

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

◆ moveTo()

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

Definition at line 233 of file SolverTypes.h.

233 {
234 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 & Gluco2::ClauseAllocator::operator[] ( Ref r)
inline

Definition at line 251 of file SolverTypes.h.

251{ 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 & Gluco2::ClauseAllocator::operator[] ( Ref r) const
inline

Definition at line 252 of file SolverTypes.h.

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

◆ reloc()

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

Definition at line 263 of file SolverTypes.h.

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

Member Data Documentation

◆ extra_clause_field

bool Gluco2::ClauseAllocator::extra_clause_field

Definition at line 228 of file SolverTypes.h.


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