1 #ifndef __GENCBMCVERIF_HPP_DEFINED 2 #define __GENCBMCVERIF_HPP_DEFINED 4 #include <boost/shared_ptr.hpp> 51 CVar(
nptr_t nptr,
const std::string& name =
"");
53 CVar(
const Node* node,
const std::string& name =
"");
57 CVar(
const std::string& name,
const std::string& val);
65 std::string
def()
const;
67 std::string
refDef()
const;
69 std::string
use()
const;
78 std::string
memdef()
const;
80 std::string
ctype()
const;
98 std::vector<std::pair<CVar*, CVar*>>
103 CFun(
const std::string& name);
113 void addBody(
const std::string& code);
117 void dumpDec(std::ostream& out,
const std::string& modelName,
118 const int& indent,
bool decl =
false)
const;
120 void dumpVarDec(std::ostream& out,
const int& indent)
const;
122 void dumpCode(std::ostream& out,
const int& indent)
const;
125 void dumpCDec(std::ostream& out,
const std::string& modelName,
126 const int& indent)
const;
186 CFun*
addFun(
const std::string& name,
bool ms =
false);
227 void genModel(std::ostream& out)
const;
270 void checkAndInsert(std::map<std::string, T*>& mp,
const std::string& name,
271 T* var,
bool force =
false);
CVar * addInput(const std::string &name, nptr_t node, bool ms=false)
void dumpCode(std::ostream &out, const int &indent) const
CVar * getBoolOpC(const BoolOp *n)
CVarMap * _curVarMap
Definition: genCBMC.hpp:165
Definition: bitvec.hpp:83
CVarMap _localArray
Definition: genCBMC.hpp:167
void dumpDec(std::ostream &out, const std::string &modelName, const int &indent, bool decl=false) const
CVar * getBvConstC(const BitvectorConst *n)
CVarMap _localConstVar
Definition: genCBMC.hpp:168
std::string signedUse() const
std::string memdef() const
CVar * getMemOpC(const MemOp *n)
std::string castUse() const
std::string exactUse() const
bool retSet()
Definition: genCBMC.hpp:107
CVarMap _masks
Definition: genCBMC.hpp:156
CVarMap _states
Definition: genCBMC.hpp:141
void exportAllToDir(const std::string &dirName) const
CVar * getFuncVarC(const FuncVar *n)
void addBody(const std::string &code)
std::string _type
Definition: genCBMC.hpp:42
void addArg(const CVar *arg)
void dumpCDec(std::ostream &out, const std::string &modelName, const int &indent) const
std::vector< const CVar * > _args
Definition: genCBMC.hpp:94
static int varCnt
Definition: genCBMC.hpp:34
Definition: genCBMC.hpp:89
std::map< CFun *, CVarMap * > _varInFun
Definition: genCBMC.hpp:159
CVar * _ret
Definition: genCBMC.hpp:97
CVar * addFuncVar(const std::string &name, nptr_t node, bool ms=false)
std::map< std::string, CFun * > CFunMap
Definition: genCBMC.hpp:134
CVerifGen(const std::string &prefix)
void setMemConst(std::ostream &out) const
bool memberVar
Definition: genCBMC.hpp:82
void createCommon(std::ostream &out) const
Definition: genCBMC.hpp:130
void defMemClass(std::ostream &out) const
std::string _val
Definition: genCBMC.hpp:44
bool _isConst
Definition: genCBMC.hpp:47
CFun(const std::string &name)
std::string refDef() const
static std::string boolStr
Definition: genCBMC.hpp:36
boost::shared_ptr< Node > nptr_t
Definition: node.hpp:24
void exportAllToFile(const std::string &fileName) const
static std::string voidStr
Definition: genCBMC.hpp:39
CFunMap _unitpFuncMap
Definition: genCBMC.hpp:150
void depthFirstTraverse(nptr_t n)
CVar * getBoolVarC(const BoolVar *n)
CVar * getBvOpC(const BitvectorOp *n)
CVar * findVar(CVarMap &mp, const std::string &name)
Definition: abstraction.hpp:21
CFun * addFun(const std::string &name, bool ms=false)
CVar * getMemConstC(const MemConst *n)
CVar * getBvVarC(const BitvectorVar *n)
CVar * addState(const std::string &name, nptr_t node, bool ms=false)
Definition: bitvec.hpp:38
static std::string memStr
Definition: genCBMC.hpp:38
std::map< std::string, CVar * > CVarMap
Definition: genCBMC.hpp:133
static std::string bvStr
Definition: genCBMC.hpp:37
CVar * getMemVarC(const MemVar *n)
std::map< CVar *, const MemConst * > _memConst
Definition: genCBMC.hpp:153
int _idxWidth
Definition: genCBMC.hpp:46
void dumpVarDec(std::ostream &out, const int &indent) const
std::vector< std::string > _codeList
Definition: genCBMC.hpp:95
int _width
Definition: genCBMC.hpp:45
CVar * getBoolConstC(const BoolConst *n)
CVar * _curVar
Definition: genCBMC.hpp:163
CFunMap _funMap
Definition: genCBMC.hpp:145
CVarMap _unitpFuncVarMap
Definition: genCBMC.hpp:148
std::vector< std::string > _varList
Definition: genCBMC.hpp:96
std::string getSignedCCode(CVar *var)
Definition: bitvec.hpp:54
CVarMap _inputs
Definition: genCBMC.hpp:143
void buildFun(CFun *f, nptr_t nptr)
void addFunUpdate(CFun *f, nptr_t lhs, nptr_t rhs)
CFun * _curFun
Definition: genCBMC.hpp:161
std::string _modelName
Definition: genCBMC.hpp:138
std::vector< std::pair< CVar *, CVar * > > _updates
Definition: genCBMC.hpp:99
void genModel(std::ostream &out) const
std::string _name
Definition: genCBMC.hpp:93
std::string _name
Definition: genCBMC.hpp:43
Definition: genCBMC.hpp:28
CVar * appFun(CFun *appFun, CFun *envFun)
void defUnitpFunc(std::ostream &out) const
std::string ctype() const
CVar(nptr_t nptr, const std::string &name="")
void checkAndInsert(std::map< std::string, T *> &mp, const std::string &name, T *var, bool force=false)
void operator()(const Node *n)
void setFunReturn(CFun *f, nptr_t nptr)