DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <Formula.hh>
Public Types | |
enum | BinaryOperator { OrOp = 0, AndOp = 1 } |
enum | UnaryOperator { NotOp = 0 } |
typedef Utils::Exception< Formula > | Exception |
typedef std::reference_wrapper< Formula const > | ConstReference |
typedef std::vector< ConstReference > | FormulaVector |
typedef Formula * | Pointer |
Public Member Functions | |
void | getModels (FormulaVector &models) const |
const Formula & | existAbstract (const VariableVector &variables, bool complementSet=false) const |
bool | isAssignment () const |
const VariableVector & | support () const |
const Value & | value () const |
const Variable & | variable () const |
bool | isFalse () const |
bool | isTrue () const |
void | primes (FormulaVector &result) const |
bool | operator== (const Formula &f) const |
bool | operator!= (const Formula &f) const |
virtual | ~Formula () |
const Cudd & | bddManager () const |
const BDD & | bdd () const |
const Formula & | operator|| (const Formula &f) const |
const Formula & | operator && (const Formula &f) const |
const Formula & | operator! () const |
const Formula & | apply (BinaryOperator op, const Formula &f) const |
const Formula & | apply (UnaryOperator op) const |
bool | entails (const Formula &f) const |
bool | satisfies (const Formula &f) const |
bool | isCube () const |
bool | equivalent (const Formula &f) const |
string | textify () const |
string | latexify () const |
bool | isNull () const |
FormulaFactory & | owner () const |
Static Public Member Functions | |
static string | typeName () |
Private Member Functions | |
Formula (FormulaFactory &owner) | |
Formula (const BDD &bdd, int index, FormulaFactory &owner) | |
Private Attributes | |
BDD | _bdd |
int | _dataIndex |
FormulaFactory * | _owner |
VariableVector | _support |
bool | _supportNotComputed |
ValueVector | _value |
Friends | |
class | FormulaFactory |
ostream & | operator<< (ostream &os, const Formula &f) |
A Formula object. It represents boolean formula (use of Binary Decision Diagram)
Definition at line 42 of file Formula.hh.
typedef std::reference_wrapper<Formula const> Diades::Sdmdl::Formula::ConstReference |
Definition at line 73 of file Formula.hh.
Definition at line 66 of file Formula.hh.
typedef std::vector<ConstReference> Diades::Sdmdl::Formula::FormulaVector |
Definition at line 74 of file Formula.hh.
typedef Formula* Diades::Sdmdl::Formula::Pointer |
Definition at line 75 of file Formula.hh.
Enumerator | |
---|---|
OrOp | |
AndOp |
Definition at line 49 of file Formula.hh.
Enumerator | |
---|---|
NotOp |
Definition at line 57 of file Formula.hh.
|
inlineprivate |
Null Formula constructor
owner | the FormulaFactory that creates this Formula |
Definition at line 119 of file Formula.hh.
|
inlineprivate |
Formula constructor
bdd | the underlying bdd |
index | the data index provided by the FormulaFactory |
owner | the FormulaFactory that creates this Formula |
Definition at line 133 of file Formula.hh.
References existAbstract(), and getModels().
|
inlinevirtual |
const Formula& Diades::Sdmdl::Formula::apply | ( | BinaryOperator | op, |
const Formula & | f | ||
) | const |
Apply a binary operator
op | the binaryoperator |
f | the Formula to combine |
Referenced by bdd(), Diades::Sdmdl::FormulaBinaryOperator< OP >::operator()(), and Diades::Sdmdl::FormulaUnaryOperator< OP >::operator()().
const Formula& Diades::Sdmdl::Formula::apply | ( | UnaryOperator | op | ) | const |
Apply a unary operator
op | the unaryoperator |
|
inline |
Definition at line 288 of file Formula.hh.
References _bdd, apply(), entails(), equivalent(), isCube(), isNull(), latexify(), operator &&(), operator!(), operator<<, operator||(), owner(), satisfies(), and textify().
Referenced by Diades::Sdmdl::CubeGenerator::CubeGenerator(), and Diades::Sdmdl::FormulaFactory::valid().
const Cudd& Diades::Sdmdl::Formula::bddManager | ( | ) | const |
Referenced by Diades::Sdmdl::CubeGenerator::CubeGenerator(), Diades::Sdmdl::CubeGenerator::cubeSize(), and ~Formula().
bool Diades::Sdmdl::Formula::entails | ( | const Formula & | f | ) | const |
bool Diades::Sdmdl::Formula::equivalent | ( | const Formula & | f | ) | const |
const Formula& Diades::Sdmdl::Formula::existAbstract | ( | const VariableVector & | variables, |
bool | complementSet = false |
||
) | const |
Perform the abstraction: "there exists a model satisfying 'variables', such that *this" So called existancial quantification abstraction. Suppose for instance a Formula f defined over the variable v1, v2, v3, v4 and the domain of v1 is {1,2,3} Then the result of the abstraction of over v1 is abst(f) = f|v1=1 or f|v1=2 or f|v1=3 where f|v1=a is the restriction of f over v1=a that is (v1=a) and f
If the Boolean complementSet is set to true then perform the abstraction on the complement set of 'variables'
variables | the set of variables to abstract |
complementSet | if true, the abstraction is done on the complemented set |
Referenced by Formula().
void Diades::Sdmdl::Formula::getModels | ( | FormulaVector & | models | ) | const |
Model enumerations
models | the set of full/complete assignments F such that F is a model of the current formula |
Referenced by Formula(), and Diades::Sdmdl::FormulaFactory::valid().
|
inline |
Definition at line 180 of file Formula.hh.
References Diades::Sdmdl::Value::isNull(), support(), and value().
bool Diades::Sdmdl::Formula::isCube | ( | ) | const |
Referenced by bdd().
bool Diades::Sdmdl::Formula::isFalse | ( | ) | const |
Referenced by variable().
bool Diades::Sdmdl::Formula::isNull | ( | ) | const |
Referenced by bdd(), Diades::Sdmdl::CubeGenerator::CubeGenerator(), Diades::Sdmdl::Rule::makeEffect(), and Diades::Sdmdl::Rule::makePrecondition().
bool Diades::Sdmdl::Formula::isTrue | ( | ) | const |
Referenced by variable().
const Formula& Diades::Sdmdl::Formula::operator! | ( | ) | const |
|
inline |
f | The Formula to compare with |
Definition at line 265 of file Formula.hh.
|
inline |
f | The Formula to compare with |
Definition at line 254 of file Formula.hh.
FormulaFactory& Diades::Sdmdl::Formula::owner | ( | ) | const |
void Diades::Sdmdl::Formula::primes | ( | FormulaVector & | result | ) | const |
Compute the prime implicants of the Formula F Recall that an implicant of F is a formula I such that I implies F A prime implicant PI is a conjunction of litterals that is an implicant of F such that no subconjunction of litterals in PI is an implicant So 'primes' compute the set of prime implicants PI1,..,PIn of F which means that F is equivalent to PI1 or ... or PIN.
result | the resulting set of prime implicants |
Referenced by variable().
bool Diades::Sdmdl::Formula::satisfies | ( | const Formula & | f | ) | const |
const VariableVector& Diades::Sdmdl::Formula::support | ( | ) | const |
Referenced by isAssignment(), and variable().
|
inlinestatic |
Definition at line 68 of file Formula.hh.
const Value& Diades::Sdmdl::Formula::value | ( | ) | const |
Referenced by Diades::Sdmdl::FormulaFactory::context(), and isAssignment().
|
inline |
Definition at line 210 of file Formula.hh.
References isFalse(), isTrue(), primes(), and support().
Referenced by Diades::Sdmdl::FormulaFactory::context().
|
friend |
Definition at line 428 of file Formula.hh.
|
friend |
|
private |
_bdd
the underlying Binary Decision Diagram (CUDD package)
Definition at line 81 of file Formula.hh.
Referenced by bdd().
|
private |
_dataIndex
the data index
Definition at line 85 of file Formula.hh.
|
mutableprivate |
_factory
the FormulaFactory that created and owns this Formula
Definition at line 89 of file Formula.hh.
|
mutableprivate |
_support
the support of the Formula
Definition at line 96 of file Formula.hh.
|
mutableprivate |
_supportNotComputed
the support is not computed yet
Definition at line 103 of file Formula.hh.
|
mutableprivate |
_value
the potential Value of the Formula if it is an assignment
Definition at line 110 of file Formula.hh.