DiaDes  0.1
DIAgnosis of Discrete-Event System
CubeGenerator.hh
Go to the documentation of this file.
1 #ifndef CUBEGENERATOR_H_
2 #define CUBEGENERATOR_H_
3 
6 using namespace std;
7 
8 
9 namespace Diades
10 {
11  namespace Sdmdl
12  {
13 
14 
16  {
17  private:
18  DdGen * gen;
19  int * cube;
20  CUDD_VALUE_TYPE value;
21  const Formula & f;
22 
23  public:
24  CubeGenerator(const Formula & f1):f(f1){
25  require(Diades::Utils::Exception<Formula>,!f1.isNull(),"CubeGenerator: the formula is invalid");
26  gen = Cudd_FirstCube(f.bddManager().getManager(),f.bdd().getNode(),&cube,&value);
27  }
28 
29  ~CubeGenerator() { Cudd_GenFree(gen); }
30 
31  bool isEmpty() const { return Cudd_IsGenEmpty(gen); }
32  int cubeSize() const { return f.bddManager().ReadSize(); }
33  int * currentCube() const { return cube; }
34 
35  void nextCube() { Cudd_NextCube(gen, &cube, &value); }
36  };
37 
38  };
39 };
40 
41 //DdNode *
42 //Cudd_CubeArrayToBdd(
43 // DdManager * dd,
44 // int * array
45 //)
46 //int
47 //Cudd_BddToCubeArray(
48 // DdManager * dd,
49 // DdNode * cube,
50 // int * array
51 //)
52 //int
53 //cuddCheckCube(
54 // DdManager * dd,
55 // DdNode * g
56 //)
57 #endif /*CUBEGENERATOR_H_*/
STL namespace.
Formula class using BDD.
const Cudd & bddManager() const
CubeGenerator(const Formula &f1)
#define require(Exception, expr, message)
Definition: Assertion.hh:90
Namespace of the Diades project.
const BDD & bdd() const
Definition: Formula.hh:288