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

#include <SolverTypes.h>

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

Detailed Description

Definition at line 196 of file SolverTypes.h.

Constructor & Destructor Documentation

◆ ClauseAllocator() [1/2]

Minisat::ClauseAllocator::ClauseAllocator ( uint32_t start_cap)
inline

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

Minisat::ClauseAllocator::ClauseAllocator ( )
inline

Definition at line 204 of file SolverTypes.h.

204: extra_clause_field(false){}

Member Function Documentation

◆ _free()

void Minisat::ClauseAllocator::_free ( CRef cid)
inline

Definition at line 230 of file SolverTypes.h.

231 {
232 Clause& c = operator[](cid);
233 RegionAllocator<uint32_t>::_free(clauseWord32Size(c.size(), c.has_extra()));
234 }
Clause & operator[](Ref r)
void _free(int size)
Definition Alloc.h:62
Here is the call graph for this function:

◆ ael()

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

Definition at line 228 of file SolverTypes.h.

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

◆ alloc()

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

Definition at line 211 of file SolverTypes.h.

212 {
213 assert(sizeof(Lit) == sizeof(uint32_t));
214 assert(sizeof(float) == sizeof(uint32_t));
215 bool use_extra = learnt | extra_clause_field;
216
217 CRef cid = RegionAllocator<uint32_t>::alloc(clauseWord32Size(ps.size(), use_extra));
218 new (lea(cid)) Clause(ps, use_extra, learnt);
219
220 return cid;
221 }
Ref alloc(int size)
Definition Alloc.h:117
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:

◆ lea() [1/2]

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

Definition at line 226 of file SolverTypes.h.

226{ 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 * Minisat::ClauseAllocator::lea ( Ref r) const
inline

Definition at line 227 of file SolverTypes.h.

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

◆ moveTo()

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

Definition at line 206 of file SolverTypes.h.

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

◆ operator[]() [1/2]

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

Definition at line 224 of file SolverTypes.h.

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

◆ operator[]() [2/2]

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

Definition at line 225 of file SolverTypes.h.

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

◆ reloc()

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

Definition at line 236 of file SolverTypes.h.

237 {
238 Clause& c = operator[](cr);
239
240 if (c.reloced()) { cr = c.relocation(); return; }
241
242 cr = to.alloc(c, c.learnt());
243 c.relocate(cr);
244
245 // Copy extra data-fields:
246 // (This could be cleaned-up. Generalize Clause-constructor to be applicable here instead?)
247 to[cr].mark(c.mark());
248 if (to[cr].learnt()) to[cr].activity() = c.activity();
249 else if (to[cr].has_extra()) to[cr].calcAbstraction();
250 }
Here is the call graph for this function:

Member Data Documentation

◆ extra_clause_field

bool Minisat::ClauseAllocator::extra_clause_field

Definition at line 201 of file SolverTypes.h.


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