carl
24.04
Computer ARithmetic Library
|
#include <FormulaPool.h>
Public Member Functions | |
std::size_t | size () const |
void | print () const |
Formula< Pol > | getTseitinVar (const Formula< Pol > &_formula) |
Formula< Pol > | createTseitinVar (const Formula< Pol > &_formula) |
template<typename ArgType > | |
void | forallDo (void(*_func)(ArgType *, const Formula< Pol > &), ArgType *_arg) const |
bool | formulasInverse (const Formula< Pol > &_subformulaA, const Formula< Pol > &_subformulaB) |
Static Public Member Functions | |
static FormulaPool< Pol > & | getInstance () |
Returns the single instance of this class by reference. More... | |
Protected Member Functions | |
FormulaPool (unsigned _capacity=10000) | |
Constructor of the formula pool. More... | |
~FormulaPool () | |
const FormulaContent< Pol > * | trueFormula () const |
const FormulaContent< Pol > * | falseFormula () const |
Private Types | |
using | underlying_set = boost::intrusive::unordered_set< FormulaContent< Pol > > |
Private Member Functions | |
bool | isBaseFormula (const Constraint< Pol > &c) const |
bool | isBaseFormula (const UEquality &ueq) const |
bool | isBaseFormula (const VariableComparison< Pol > &vc) const |
bool | isBaseFormula (const VariableAssignment< Pol > &va) const |
bool | isBaseFormula (const FormulaContent< Pol > *f) const |
const FormulaContent< Pol > * | getBaseFormula (const FormulaContent< Pol > *f) const |
FormulaContent< Pol > * | createNegatedContent (const FormulaContent< Pol > *f) const |
const FormulaContent< Pol > * | create (FormulaType _type) |
Create formula representing a boolean value. More... | |
const FormulaContent< Pol > * | create (Variable _variable) |
Create formula representing a boolean variable. More... | |
const FormulaContent< Pol > * | create (Constraint< Pol > &&_constraint) |
const FormulaContent< Pol > * | create (const Constraint< Pol > &_constraint) |
const FormulaContent< Pol > * | create (VariableComparison< Pol > &&_variableComparison) |
const FormulaContent< Pol > * | create (const VariableComparison< Pol > &_variableComparison) |
const FormulaContent< Pol > * | create (VariableAssignment< Pol > &&_variableAssignment) |
const FormulaContent< Pol > * | create (const VariableAssignment< Pol > &_variableAssignment) |
const FormulaContent< Pol > * | create (BVConstraint &&_constraint) |
const FormulaContent< Pol > * | create (const BVConstraint &_constraint) |
const FormulaContent< Pol > * | create (FormulaType _type, Formula< Pol > &&_subFormula) |
Create formula representing a unary function. More... | |
const FormulaContent< Pol > * | create (FormulaType _type, const Formulas< Pol > &_subformulas) |
Create formula representing a nary function. More... | |
const FormulaContent< Pol > * | create (FormulaType _type, const std::initializer_list< Formula< Pol >> &_subformulas) |
const FormulaContent< Pol > * | create (FormulaType _type, Formulas< Pol > &&_subformulas) |
const FormulaContent< Pol > * | createImplication (Formulas< Pol > &&_subformulas) |
Create formula representing an implication. More... | |
const FormulaContent< Pol > * | createNAry (FormulaType _type, Formulas< Pol > &&_subformulas) |
const FormulaContent< Pol > * | createITE (Formulas< Pol > &&_subformulas) |
const FormulaContent< Pol > * | create (FormulaType _type, std::vector< Variable > &&_vars, const Formula< Pol > &_term) |
const FormulaContent< Pol > * | create (const FormulasMulti< Pol > &_subformulas) |
const FormulaContent< Pol > * | create (const UTerm &_lhs, const UTerm &_rhs, bool _negated) |
const FormulaContent< Pol > * | create (UEquality &&eq) |
void | free (const FormulaContent< Pol > *_elem) |
bool | freeTseitinVariable (const FormulaContent< Pol > *_toDelete) |
void | reg (const FormulaContent< Pol > *_elem) const |
const FormulaContent< Pol > * | add (FormulaContent< Pol > &&_formula) |
Adds the given formula to the pool, if it does not yet occur in there. More... | |
void | check_rehash () |
Private Attributes | |
friend | Singleton< FormulaPool > |
friend | Formula< Pol > |
unsigned | mIdAllocator |
id allocator More... | |
FormulaContent< Pol > * | mpTrue |
The unique formula representing true. More... | |
FormulaContent< Pol > * | mpFalse |
The unique formula representing false. More... | |
pool::RehashPolicy | mRehashPolicy |
std::unique_ptr< typename underlying_set::bucket_type[]> | mPoolBuckets |
underlying_set | mPool |
The formula pool. More... | |
FastPointerMap< FormulaContent< Pol >, const FormulaContent< Pol > * > | mTseitinVars |
FastPointerMap< FormulaContent< Pol >, typename FastPointerMap< FormulaContent< Pol >, const FormulaContent< Pol > * >::iterator > | mTseitinVarToFormula |
Definition at line 32 of file FormulaPool.h.
|
private |
Definition at line 48 of file FormulaPool.h.
|
protected |
Constructor of the formula pool.
_capacity | Expected necessary capacity of the pool. |
|
protected |
|
private |
Adds the given formula to the pool, if it does not yet occur in there.
Note, that this method uses the allocator which is locked before calling.
_formula | The formula to add to the pool. |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
_subformulas | The sub-formulas of the formula to create. |
Definition at line 406 of file FormulaPool.h.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
_constraint | The constraint wrapped by this formula. |
Definition at line 236 of file FormulaPool.h.
|
inlineprivate |
Create formula representing a boolean value.
_type | Formula type, may be either TRUE or FALSE. |
Definition at line 218 of file FormulaPool.h.
|
inlineprivate |
Create formula representing a nary function.
_type | Formula type specifying the function. |
_subformulas | Formula representing the function arguments. |
Definition at line 336 of file FormulaPool.h.
|
inlineprivate |
|
inlineprivate |
Create formula representing a unary function.
_type | Formula type specifying the function. |
_subFormula | Formula representing the function argument. |
Definition at line 294 of file FormulaPool.h.
|
inlineprivate |
|
inlineprivate |
_type | |
_vars | |
_term |
Definition at line 393 of file FormulaPool.h.
|
inlineprivate |
|
inlineprivate |
Create formula representing a boolean variable.
_variable | The Boolean variable wrapped by this formula. |
Definition at line 228 of file FormulaPool.h.
|
inlineprivate |
|
inlineprivate |
|
private |
Create formula representing an implication.
_subformulas |
|
private |
|
private |
|
inlineprivate |
|
inlineprotected |
|
inline |
Definition at line 561 of file FormulaPool.h.
bool carl::FormulaPool< Pol >::formulasInverse | ( | const Formula< Pol > & | _subformulaA, |
const Formula< Pol > & | _subformulaB | ||
) |
|
inlineprivate |
|
inlineprivate |
Definition at line 496 of file FormulaPool.h.
|
inlineprivate |
Definition at line 175 of file FormulaPool.h.
|
inlinestaticinherited |
Returns the single instance of this class by reference.
If there is no instance yet, a new one is created.
Definition at line 45 of file Singleton.h.
|
inlineprivate |
Definition at line 147 of file FormulaPool.h.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
Definition at line 97 of file FormulaPool.h.
|
inlineprivate |
|
inline |
Definition at line 93 of file FormulaPool.h.
|
inlineprotected |
|
private |
Definition at line 35 of file FormulaPool.h.
|
private |
id allocator
Definition at line 41 of file FormulaPool.h.
|
private |
The unique formula representing false.
Definition at line 45 of file FormulaPool.h.
|
private |
The formula pool.
Definition at line 51 of file FormulaPool.h.
|
private |
Definition at line 49 of file FormulaPool.h.
|
private |
The unique formula representing true.
Definition at line 43 of file FormulaPool.h.
|
private |
Definition at line 47 of file FormulaPool.h.
|
private |
Definition at line 58 of file FormulaPool.h.
|
private |
Definition at line 60 of file FormulaPool.h.
|
private |
Definition at line 34 of file FormulaPool.h.