SVF
Conditions.h
Go to the documentation of this file.
1 //===- Conditions.h -- Context/Path BDD conditions----------------------------//
2 //
3 // SVF: Static Value-Flow Analysis
4 //
5 // Copyright (C) <2013-2017> <Yulei Sui>
6 //
7 
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 
18 // You should have received a copy of the GNU General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //
21 //===----------------------------------------------------------------------===//
22 
23 /*
24  * BitVectorCond.h
25  *
26  * Created on: 31/10/2013
27  * Author: yesen
28  */
29 
30 #ifndef BITVECTORCOND_H_
31 #define BITVECTORCOND_H_
32 
33 #include "Util/BasicTypes.h"
34 #include <stdio.h>
35 #include "CUDD/cuddInt.h"
36 
37 namespace SVF
38 {
39 
44 {
45 public:
46 
49  {
51  }
52 
55  {
57  }
58 
60  {
61  return Cudd_bddIthVar(m_bdd_mgr, i);
62  }
63  inline unsigned BddVarNum()
64  {
65  return Cudd_ReadSize(m_bdd_mgr);
66  }
67 
68  inline DdNode* getTrueCond() const
69  {
70  return BddOne();
71  }
72  inline DdNode* getFalseCond() const
73  {
74  return BddZero();
75  }
76 
78  {
80  }
82  {
84  }
86  {
88  }
89  inline void markForRelease(DdNode* cond)
90  {
92  }
94 
95  DdNode* AND(DdNode* lhs, DdNode* rhs);
96  DdNode* OR(DdNode* lhs, DdNode* rhs);
97  DdNode* NEG(DdNode* lhs);
99 
104  void ddClearFlag(DdNode * f) const;
105  void BddSupportStep( DdNode * f, NodeBS &support) const;
106  void BddSupport( DdNode * f, NodeBS &support) const;
107  void dump(DdNode* lhs, raw_ostream & O);
108  std::string dumpStr(DdNode* lhs) const;
110  inline void printMinterms(DdNode* d)
111  {
113  }
114  inline void printDbg(DdNode* d)
115  {
116  Cudd_PrintDebug(m_bdd_mgr,d,0,3);
117  }
118 private:
119  inline DdNode* BddOne() const
120  {
121  return Cudd_ReadOne(m_bdd_mgr);
122  }
123  inline DdNode* BddZero() const
124  {
126  }
127 
129 };
130 
131 } // End namespace SVF
132 
133 #endif /* BITVECTORCOND_H_ */
DdNode * AND(DdNode *lhs, DdNode *rhs)
Operations on conditions.
Definition: Conditions.cpp:40
#define CUDD_UNIQUE_SLOTS
Definition: cudd.h:93
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
Definition: cuddRef.c:150
Definition: cudd.h:270
llvm::raw_ostream raw_ostream
LLVM outputs.
Definition: BasicTypes.h:99
DdNode * BddOne() const
Definition: Conditions.h:119
DdNode * Cudd_ReadLogicZero(DdManager *dd)
Definition: cuddAPI.c:1298
void BddSupport(DdNode *f, NodeBS &support) const
Definition: Conditions.cpp:134
#define CUDD_CACHE_SLOTS
Definition: cudd.h:94
void dump(DdNode *lhs, raw_ostream &O)
Definition: Conditions.cpp:143
DdNode * getTrueCond() const
Definition: Conditions.h:68
DdNode * BddZero() const
Definition: Conditions.h:123
unsigned u32_t
Definition: SVFBasicTypes.h:75
void printMinterms(DdNode *d)
print minterms and debug information for the Ddnode
Definition: Conditions.h:110
int Cudd_ReadPeakLiveNodeCount(DdManager *dd)
Definition: cuddAPI.c:3476
int Cudd_ReadSize(DdManager *dd)
Definition: cuddAPI.c:1681
DdNode * Cudd_bdd(u32_t i)
Definition: Conditions.h:59
void BddSupportStep(DdNode *f, NodeBS &support) const
Definition: Conditions.cpp:121
unsigned BddVarNum()
Definition: Conditions.h:63
u32_t getBDDMemUsage()
Definition: Conditions.h:77
u32_t getCondNumber()
Definition: Conditions.h:81
int Cudd_PrintMinterm(DdManager *manager, DdNode *node)
Definition: cuddUtil.c:220
DdManager * Cudd_Init(unsigned int numVars, unsigned int numVarsZ, unsigned int numSlots, unsigned int cacheSize, unsigned long maxMemory)
Definition: cuddInit.c:121
DdManager * m_bdd_mgr
Definition: Conditions.h:128
BddCondManager()
Constructor.
Definition: Conditions.h:48
u32_t getMaxLiveCondNumber()
Definition: Conditions.h:85
DdNode * getFalseCond() const
Definition: Conditions.h:72
int Cudd_PrintDebug(DdManager *dd, DdNode *f, int n, int pr)
Definition: cuddUtil.c:386
DdNode * OR(DdNode *lhs, DdNode *rhs)
Definition: Conditions.cpp:68
DdNode * Cudd_ReadOne(DdManager *dd)
Definition: cuddAPI.c:1227
std::string dumpStr(DdNode *lhs) const
Definition: Conditions.cpp:163
long Cudd_ReadNodeCount(DdManager *dd)
Definition: cuddAPI.c:3504
~BddCondManager()
Destructor.
Definition: Conditions.h:54
DdNode * NEG(DdNode *lhs)
Definition: Conditions.cpp:93
for isBitcode
Definition: ContextDDA.h:15
void ddClearFlag(DdNode *f) const
Definition: Conditions.cpp:108
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
Definition: cuddAPI.c:430
llvm::SparseBitVector NodeBS
Definition: SVFBasicTypes.h:87
unsigned long Cudd_ReadMemoryInUse(DdManager *dd)
Definition: cuddAPI.c:3242
void Cudd_Quit(DdManager *unique)
Definition: cuddInit.c:218
void printDbg(DdNode *d)
Definition: Conditions.h:114
void markForRelease(DdNode *cond)
Definition: Conditions.h:89