ilasynth  1.0
ILASynth: Template-based ILA Synthesis Engine
horn.hpp
Go to the documentation of this file.
1 #ifndef __HORN_HPP_DEFINED__
2 #define __HORN_HPP_DEFINED__
3 
4 #include <map>
5 #include <set>
6 #include <string>
7 
8 #include <ilasynth/ast.hpp>
9 #include <ilasynth/type.hpp>
10 
11 namespace ilasynth {
12 // ---------------------------------------------------------------------- //
13 class HornVar;
14 class HornLiteral;
15 class HornClause;
16 class HornDB;
18 
19 typedef HornVar* hvptr_t;
22 
23 // ---------------------------------------------------------------------- //
24 class HornVar {
25 private:
26  // var id.
27  unsigned _id;
28  // var name.
29  std::string _name;
30  // var type.
31  std::string _type;
32  // constraint for var.
33  std::set<std::string> _exec;
34  // set of input (dependent) vars.
35  std::map<std::string, hvptr_t> _ins;
36  // set of output vars.
37  std::set<hvptr_t> _outs;
38  // var is const.
39  bool _const;
40  // var level.
41  int _lvl;
42  // non-deterministic value.
43  std::string _nd;
44 
45 public:
46  // ctor.
47  HornVar(const unsigned& id);
48  // dtor.
49  virtual ~HornVar();
50 
51  // ------------------------------------------------------------------ //
52  // get var id.
53  const unsigned& getId() const;
54  // get var name.
55  const std::string& getName() const;
56  // get var type.
57  const std::string& getType() const;
58  // get var execution constraints.
59  const std::set<std::string>& getExec() const;
60  // get var predicate.
61  std::string getPred() const;
62  // get var relation.
63  std::string getRel() const;
64  // check if is constant.
65  bool isConst() const;
66 
67  // ------------------------------------------------------------------ //
68  // set var name.
69  void setName(std::string s);
70  // set var type.
71  void setType(std::string s);
72  // set constraints for var execution.
73  void setExec(std::string s);
74  // erase execution.
75  void eraseExec();
76  // add dependent input var.
77  void addInVar(hvptr_t v);
78  // add output var.
79  void addOutVar(hvptr_t v);
80  // merge dependent input vars.
81  void mergeInVars(hvptr_t v);
82  // merge output vars.
83  void mergeOutVars(hvptr_t v);
84  // set to be constant.
85  void setConst();
86  // get var level.
87  const int& getLevel() const;
88  // set var level.
89  void setLevel(const int& lvl);
90  // get the number of input vars.
91  size_t getInNum() const;
92  // get the number of output vars.
93  size_t getOutNum() const;
94  // get the input var set.
95  const std::map<std::string, hvptr_t>& getInSet() const;
96  // get the output var set.
97  const std::set<hvptr_t>& getOutSet() const;
98  // get the first output var.
99  hvptr_t getOutVar() const;
100 
101  // ------------------------------------------------------------------ //
102  // set non-deterministic value.
103  void setNd(const std::string& nd);
104  // get non-deterministic value.
105  const std::string& getNd() const;
106  // check if is nd.
107  bool isNd() const;
108 };
109 
110 // ---------------------------------------------------------------------- //
111 class HornLiteral {
112 private:
113  // var of the literal.
115  // sign of the literal.
116  bool _sign;
117  // the literal is a relation, else, a constraint.
118  bool _rel;
119 
120 public:
121  // ctor.
122  HornLiteral(hvptr_t v, bool r = false, bool s = true);
123  // dotr.
124  virtual ~HornLiteral();
125 
126  // ------------------------------------------------------------------ //
127  // get the predicate, with sign considered.
128  std::string getPred() const;
129  // get the set of execution, with sign considered.
130  std::set<std::string> getExec() const;
131  // get the var.
132  hvptr_t getVar() const;
133  // get the sign.
134  bool getSign() const;
135  // check if it is a predicate.
136  bool isRel() const;
137 };
138 
139 // ---------------------------------------------------------------------- //
140 class HornClause {
141 private:
142  // horn clause body.
143  std::set<hlptr_t> _body;
144  // horn clause head.
146 
147 public:
148  // ctor.
149  HornClause();
150  // dtor.
151  virtual ~HornClause();
152 
153  // ------------------------------------------------------------------ //
154  // add one literal to the body.
155  void addBody(hlptr_t l);
156  // set the literal to the head.
157  void setHead(hlptr_t l);
158 
159  // ------------------------------------------------------------------ //
160  // output the clause to stream.
161  void print(std::ostream& out);
162 };
163 
164 // ---------------------------------------------------------------------- //
166 private:
167  // translator
169  // predicate
171  // var mapping from predicate input var to state.
172  std::map<hvptr_t, std::string> _mapIS;
173  // var mapping from predicate output var to state.
174  std::map<hvptr_t, std::string> _mapOS;
175  // var mapping from state to input.
176  std::map<std::string, hvptr_t> _mapSI;
177  // var mapping from state to output.
178  std::map<std::string, hvptr_t> _mapSO;
179 
180 public:
181  // ctor.
183  // dtor.
184  virtual ~HornRewriter();
185 
186  // configure predicate output arguments to state. Set up _mapVS.
187  void configOutput(const std::string& state, hvptr_t arg);
188  // configure predicate input argument as the original predicate.
189  void configInput();
190  // update rewrite mapping for states.
191  void update(const std::string& state, hvptr_t inArg, hvptr_t outArg);
192  // rewrite predicate with specified rules.
193  std::string rewrite(char inType, int inSuff, char outType, int outSuff);
194  // add the rule of rewriting to the clause.
195  void addRewriteRule(hcptr_t C, char aType, int aSuff, char bType, int bSuff);
196  // get rewrited horn var.
197  hvptr_t getRewriteVar(char inTy, int inSu, char outTy, int outSu);
198 };
199 
200 // ---------------------------------------------------------------------- //
201 class HornDB {
202 private:
203  // set of variables.
204  std::map<std::string, hvptr_t> _vars;
205  // set of relations (predicates).
206  std::set<hvptr_t> _rels;
207  // set of horn clauses.
208  std::set<hcptr_t> _clauses;
209  // set of horn clauses for instruction wrapping.
210  std::set<hcptr_t> _wrapClauses;
211 
212 public:
213  // ctor.
214  HornDB();
215  // dtor.
216  virtual ~HornDB();
217 
218  // ------------------------------------------------------------------ //
219  // add one variable to the set.
220  void addVar(hvptr_t v);
221  // denote a rel to the set.
222  void addRel(hvptr_t v);
223  // add a clause to the set.
224  void addClause(hcptr_t c);
225  // add a clause to the instruction wrapping set.
226  void addWrapClause(hcptr_t c);
227  // remove a var from the set.
228  void removeVar(const std::string& n);
229  // remove a rel from the set.
230  void removeRel(hvptr_t v);
231 
232  // ------------------------------------------------------------------ //
233  // output whole to stream.
234  void print(std::ostream& out);
235 
236 private:
237  // output var declaration to stream.
238  void declareVar(std::ostream& out);
239  // output rel declaration to stream.
240  void declareRel(std::ostream& out);
241  // output clauses to stream.
242  void declareClause(std::ostream& out);
243  // output wrap clauses to stream.
244  void declareWrapClause(std::ostream& out);
245 
246  // collector for duplicated ast nodes.
247  std::set<hvptr_t> _dupls;
248 };
249 
250 // ---------------------------------------------------------------------- //
252 private:
253  // name for the translator. (prefix for variables)
254  std::string _name;
255  // pointer to the abstraction.
257  // horn clause data base.
259  // translate ITE as new clause or a node.
261  // translate bitvectors as Int.
262  bool _bvAsInt;
263  // max bitvector length.
265 
266 public:
267  // ctor;
268  HornTranslator(Abstraction* abs, const std::string& name);
269  // dtor.
270  virtual ~HornTranslator();
271 
272  // ------------------------------------------------------------------ //
273  // convert whole abs to horn clauses and output to file.
274  void hornifyAll(const std::string& fileName);
275  // convert one ast node to horn clauses.
276  hvptr_t hornifyNode(NodeRef* node, const std::string& ruleName);
277  // convert abstraction to horn clauses. (Interleave/Blocking)
278  void generateMapping(const std::string& type);
279  // export horn clause to file.
280  void exportHorn(const std::string& fileName);
281  // set _iteAsNode.
282  void setIteAsNode(bool iteAsNode);
283  // set _bvAsInt.
284  void setBvAsInt(bool bvAsInt);
285 
286  // ------------------------------------------------------------------ //
287  // create an instruction with name i, and decode d.
288  void addInstr(const std::string& i, NodeRef* d);
289  // add next state function n for state s to (child-)instruction i.
290  void addNext(const std::string& i, const std::string& s, NodeRef* n);
291  // create a child-instruction with name c, and decode d to instr i.
292  void addChildInstr(const std::string& c, const std::string& i, NodeRef* d);
293 
294  // ------------------------------------------------------------------ //
295  // Traverse and generate horn clauses in depth-first order.
296  void depthFirstTraverse(nptr_t n);
297  // This will be used by depthFirstVisit.
298  void operator()(nptr_t n);
299 
300 private:
301  // var id count.
302  unsigned _varCnt;
303  // mapping from node to var (for internal var with ast node)
304  std::map<nptr_t, hvptr_t> _nVarMap;
305  // mapping from string to var (for top level var without ast node)
306  std::map<std::string, hvptr_t> _sVarMap;
307  // current working clause.
309 
310  // structure for an instruction.
311  struct Instr_t {
312  std::string _name;
314  std::map<std::string, hvptr_t> _nxtFuncs;
315  std::set<std::string> _childInstrs;
316  };
317 
318  // sets of states.
319  std::set<std::string> _states;
320  // sets of instructions.
321  std::map<std::string, struct Instr_t*> _instrs;
322  // sets of child-instructions.
323  std::map<std::string, struct Instr_t*> _childs;
324 
325  // ------------------------------------------------------------------ //
326  // get horn var for the node; create if not exist.
327  hvptr_t getVar(nptr_t n);
328  // get horn var for the name; create if not exist.
329  hvptr_t getVar(const std::string& s);
330  // create a clause with the specified head.
331  hcptr_t addClause(hvptr_t v = NULL);
332  // initialize horn var from a node; Ex. _name, _exec, _outs.
333  void initVar(hvptr_t v, nptr_t n);
334  // initialize horn var from a node (model bitvector as BitVec).
335  void initVarBv(hvptr_t v, nptr_t n);
336  // initialize horn var from a node (model bitvector as Int).
337  void initVarInt(hvptr_t v, nptr_t n);
338  // initialize horn var from a name; _name.
339  void initVar(hvptr_t v, const std::string& s);
340  // get equal node.
342  // get condition node.
344 
345  // ------------------------------------------------------------------ //
346  // eval if node n is an ITE node.
347  bool isITE(nptr_t n) const;
348 
349  // ------------------------------------------------------------------ //
350  // init horn var context: _name, _type, _exec, _ins, and _outs.
351  // init horn var for BoolOp.
352  void initBoolOp(const BoolOp* n, hvptr_t v);
353  // init horn var for BoolVar.
354  void initBoolVar(const BoolVar* n, hvptr_t v);
355  // init horn var for BoolConst.
356  void initBoolConst(const BoolConst* n, hvptr_t v);
357  // init horn var for BitvectorOp.
358  void initBvOp(const BitvectorOp* n, hvptr_t v);
359  // init horn var for BitvectorVar.
360  void initBvVar(const BitvectorVar* n, hvptr_t v);
361  // init horn var for BitvectorConst.
362  void initBvConst(const BitvectorConst* n, hvptr_t v);
363  // init horn var for MemOp.
364  void initMemOp(const MemOp* n, hvptr_t v);
365  // init horn var for MemVar.
366  void initMemVar(const MemVar* n, hvptr_t v);
367  // init horn var for MemConst.
368  void initMemConst(const MemConst* n, hvptr_t v);
369  // init horn var for FuncVar.
370  void initFuncVar(const FuncVar* n, hvptr_t v);
371 
372  // ------------------------------------------------------------------ //
373  // if _bvAsNode is true: model bitvector as Int.
374  // init horn var context: _name, _type, _exec, _ins, and _outs.
375  // init horn var for BoolOp if bv as Int.
376  void initBoolOpInt(const BoolOp* n, hvptr_t v);
377  // init horn var for BoolVar if bv as Int.
378  void initBoolVarInt(const BoolVar* n, hvptr_t v);
379  // init horn var for BoolConst if bv as Int.
380  void initBoolConstInt(const BoolConst* n, hvptr_t v);
381  // init horn var for BitvectorOp if bv as Int.
382  void initBvOpInt(const BitvectorOp* n, hvptr_t v);
383  // init horn var for BitvectorVar if bv as Int.
384  void initBvVarInt(const BitvectorVar* n, hvptr_t v);
385  // init horn var for BitvectorConst if bv as Int.
386  void initBvConstInt(const BitvectorConst* n, hvptr_t v);
387  // init horn var for MemOp if bv as Int.
388  void initMemOpInt(const MemOp* n, hvptr_t v);
389  // init horn var for MemVar if bv as Int.
390  void initMemVarInt(const MemVar* n, hvptr_t v);
391  // init horn var for MemConst if bv as Int.
392  void initMemConstInt(const MemConst* n, hvptr_t v);
393  // init horn var for FuncVar if bv as Int.
394  void initFuncVarInt(const FuncVar* n, hvptr_t v);
395 
396  // ------------------------------------------------------------------ //
397  // add constraints or relations to working horn clause.
398  // add BoolOp to horn clause.
399  void addBoolOp(const BoolOp* n, hvptr_t v);
400  // add BoolVar to horn clause.
401  void addBoolVar(const BoolVar* n, hvptr_t v);
402  // add BoolConst to horn clause.
403  void addBoolConst(const BoolConst* n, hvptr_t v);
404  // add BitvectorOp to horn clause.
405  void addBvOp(const BitvectorOp* n, hvptr_t v);
406  // add BitvectorVar to horn clause.
407  void addBvVar(const BitvectorVar* n, hvptr_t v);
408  // add BitvectorConst to horn clause.
409  void addBvConst(const BitvectorConst* n, hvptr_t v);
410  // add MemOp to horn clause.
411  void addMemOp(const MemOp* n, hvptr_t v);
412  // add MemVar to horn clause.
413  void addMemVar(const MemVar* n, hvptr_t v);
414  // add MemConst to horn clause.
415  void addMemConst(const MemConst* n, hvptr_t v);
416  // add FuncVar to horn clause.
417  void addFuncVar(const FuncVar* n, hvptr_t v);
418 
419  // ------------------------------------------------------------------ //
420  // generate BvOpReadMemBlock execution - little endian
421  std::string genReadMemBlkExecLit(const std::string& mem,
422  const std::string& addr, int addrWidth,
423  int idx) const;
424  // generate BvOpReadMemBlock execution - big endian
425  std::string genReadMemBlkExecBig(const std::string& mem,
426  const std::string& addr, int addrWidth,
427  int idx, int num) const;
428  // generate MemOpStoreMemBlock execution - little endian
429  std::string genStoreMemBlkExecLit(const std::string& mem,
430  const std::string& addr,
431  const std::string& data, int chunkSize,
432  int chunkNum, int addrWidth, int idx) const;
433  // generate MemOpStoreMemBlock execution - big endian
434  std::string genStoreMemBlkExecBig(const std::string& mem,
435  const std::string& addr,
436  const std::string& data, int chunkSize,
437  int chunkNum, int addrWidth, int idx) const;
438  // convert value to smt2.0 bitvector format. ex. #b0000
439  std::string bvToString(mp_int_t val, int width) const;
440  // convert value to smt2.0 bitvector format. ex. #b0000
441  std::string bvToString(int val, int width) const;
442  // generate rules for MemConst.
443  void genMemConstRules(const MemConst* n, hvptr_t v);
444 
445 public:
446  // ------------------------------------------------------------------ //
447  // create name with suffix index: name_idx
448  std::string addSuffix(const std::string& name, const int& idx) const;
449  // duplicate variable with suffix index
450  hvptr_t copyVar(hvptr_t v, const int& idx);
451 
452 private:
453  // ------------------------------------------------------------------ //
454  // check if the length exceed maximum bitvector width.
455  bool isLongBv(const int& w) const;
456 
457  // ------------------------------------------------------------------ //
458  // generate mappings for interleave modeling.
460  // generate mappings for blocking modeling.
462  // generate loop predicate.
464  // generate mappings for interleave modeling for all instructions.
465  void allInterleaveMapping();
466 };
467 } // namespace ilasynth
468 
469 #endif /* __HORN_HPP_DEFINED__ */
Definition: horn.hpp:165
hvptr_t getVar(nptr_t n)
Definition: func.hpp:33
bool isITE(nptr_t n) const
Definition: bitvec.hpp:83
std::string getPred() const
void initMemOp(const MemOp *n, hvptr_t v)
std::map< std::string, struct Instr_t * > _instrs
Definition: horn.hpp:321
hcptr_t _curHc
Definition: horn.hpp:308
void addClause(hcptr_t c)
std::set< hvptr_t > _outs
Definition: horn.hpp:37
hvptr_t _var
Definition: horn.hpp:114
void addBvOp(const BitvectorOp *n, hvptr_t v)
std::set< std::string > _exec
Definition: horn.hpp:33
void initVarBv(hvptr_t v, nptr_t n)
virtual ~HornVar()
void exportHorn(const std::string &fileName)
hvptr_t getEqVar(hvptr_t a, hvptr_t b)
std::set< hlptr_t > _body
Definition: horn.hpp:143
const std::set< hvptr_t > & getOutSet() const
hvptr_t _decodeFunc
Definition: horn.hpp:313
void mergeOutVars(hvptr_t v)
bool isLongBv(const int &w) const
void addVar(hvptr_t v)
Definition: horn.hpp:111
hvptr_t getVar() const
void initBvVarInt(const BitvectorVar *n, hvptr_t v)
std::set< hcptr_t > _wrapClauses
Definition: horn.hpp:210
void declareRel(std::ostream &out)
std::map< std::string, struct Instr_t * > _childs
Definition: horn.hpp:323
void addMemOp(const MemOp *n, hvptr_t v)
void print(std::ostream &out)
std::string genStoreMemBlkExecBig(const std::string &mem, const std::string &addr, const std::string &data, int chunkSize, int chunkNum, int addrWidth, int idx) const
void initBoolConstInt(const BoolConst *n, hvptr_t v)
void initVarInt(hvptr_t v, nptr_t n)
void hornifyAll(const std::string &fileName)
HornLiteral(hvptr_t v, bool r=false, bool s=true)
std::string bvToString(mp_int_t val, int width) const
void genMemConstRules(const MemConst *n, hvptr_t v)
std::map< nptr_t, hvptr_t > _nVarMap
Definition: horn.hpp:304
void initBoolConst(const BoolConst *n, hvptr_t v)
HornTranslator(Abstraction *abs, const std::string &name)
bool getSign() const
void initBvConstInt(const BitvectorConst *n, hvptr_t v)
void addRewriteRule(hcptr_t C, char aType, int aSuff, char bType, int bSuff)
bool _rel
Definition: horn.hpp:118
std::string _name
Definition: horn.hpp:254
void initMemConst(const MemConst *n, hvptr_t v)
HornTranslator * _tr
Definition: horn.hpp:168
size_t getOutNum() const
HornClause * hcptr_t
Definition: horn.hpp:21
void addBoolOp(const BoolOp *n, hvptr_t v)
Definition: horn.hpp:311
void setHead(hlptr_t l)
bool _bvAsInt
Definition: horn.hpp:262
void update(const std::string &state, hvptr_t inArg, hvptr_t outArg)
void operator()(nptr_t n)
std::string genReadMemBlkExecLit(const std::string &mem, const std::string &addr, int addrWidth, int idx) const
std::map< hvptr_t, std::string > _mapIS
Definition: horn.hpp:172
void setExec(std::string s)
boost::multiprecision::cpp_int mp_int_t
Definition: common.hpp:9
virtual ~HornDB()
std::string _nd
Definition: horn.hpp:43
HornVar(const unsigned &id)
std::string genStoreMemBlkExecLit(const std::string &mem, const std::string &addr, const std::string &data, int chunkSize, int chunkNum, int addrWidth, int idx) const
Definition: mem.hpp:46
void declareVar(std::ostream &out)
Definition: abstraction.hpp:31
void addBoolConst(const BoolConst *n, hvptr_t v)
void declareClause(std::ostream &out)
const std::string & getName() const
Definition: bool.hpp:78
hvptr_t getConVar(hvptr_t c)
void configOutput(const std::string &state, hvptr_t arg)
std::map< std::string, hvptr_t > _mapSI
Definition: horn.hpp:176
std::set< hvptr_t > _dupls
Definition: horn.hpp:247
void addRel(hvptr_t v)
boost::shared_ptr< Node > nptr_t
Definition: node.hpp:24
std::string getRel() const
void depthFirstTraverse(nptr_t n)
Definition: horn.hpp:201
std::map< std::string, hvptr_t > _mapSO
Definition: horn.hpp:178
Definition: bool.hpp:46
void initBvOp(const BitvectorOp *n, hvptr_t v)
const std::set< std::string > & getExec() const
void setNd(const std::string &nd)
void addMemVar(const MemVar *n, hvptr_t v)
Definition: horn.hpp:24
void addBvConst(const BitvectorConst *n, hvptr_t v)
void declareWrapClause(std::ostream &out)
std::set< std::string > _childInstrs
Definition: horn.hpp:315
unsigned _id
Definition: horn.hpp:27
void addInstr(const std::string &i, NodeRef *d)
void addInVar(hvptr_t v)
void print(std::ostream &out)
void initMemVar(const MemVar *n, hvptr_t v)
void initBvVar(const BitvectorVar *n, hvptr_t v)
std::string _name
Definition: horn.hpp:29
hvptr_t hornifyNode(NodeRef *node, const std::string &ruleName)
HornDB * _db
Definition: horn.hpp:258
const std::map< std::string, hvptr_t > & getInSet() const
Definition: abstraction.hpp:21
void addWrapClause(hcptr_t c)
hcptr_t addClause(hvptr_t v=NULL)
int _bvMaxSize
Definition: horn.hpp:264
void initBoolOpInt(const BoolOp *n, hvptr_t v)
bool _sign
Definition: horn.hpp:116
HornRewriter(HornTranslator *tr, hvptr_t p)
Definition: bitvec.hpp:38
HornLiteral * hlptr_t
Definition: horn.hpp:20
void initVar(hvptr_t v, nptr_t n)
std::map< std::string, hvptr_t > _nxtFuncs
Definition: horn.hpp:314
bool _const
Definition: horn.hpp:39
void initMemConstInt(const MemConst *n, hvptr_t v)
void setType(std::string s)
std::map< hvptr_t, std::string > _mapOS
Definition: horn.hpp:174
hvptr_t getOutVar() const
Definition: mem.hpp:30
std::string addSuffix(const std::string &name, const int &idx) const
unsigned _varCnt
Definition: horn.hpp:302
void initMemVarInt(const MemVar *n, hvptr_t v)
void setName(std::string s)
hlptr_t _head
Definition: horn.hpp:145
std::string rewrite(char inType, int inSuff, char outType, int outSuff)
void setBvAsInt(bool bvAsInt)
void initBoolOp(const BoolOp *n, hvptr_t v)
bool _iteAsNode
Definition: horn.hpp:260
void initBoolVarInt(const BoolVar *n, hvptr_t v)
void addNext(const std::string &i, const std::string &s, NodeRef *n)
hvptr_t getRewriteVar(char inTy, int inSu, char outTy, int outSu)
Definition: bool.hpp:35
const std::string & getNd() const
std::string genReadMemBlkExecBig(const std::string &mem, const std::string &addr, int addrWidth, int idx, int num) const
void initFuncVar(const FuncVar *n, hvptr_t v)
Abstraction * _abs
Definition: horn.hpp:256
bool isNd() const
void addOutVar(hvptr_t v)
void initBvConst(const BitvectorConst *n, hvptr_t v)
const std::string & getType() const
std::set< hvptr_t > _rels
Definition: horn.hpp:206
int _lvl
Definition: horn.hpp:41
Definition: bitvec.hpp:54
void initBoolVar(const BoolVar *n, hvptr_t v)
Definition: horn.hpp:140
std::set< std::string > _states
Definition: horn.hpp:319
Definition: mem.hpp:67
std::set< std::string > getExec() const
void initBvOpInt(const BitvectorOp *n, hvptr_t v)
Definition: ast.hpp:29
std::string _name
Definition: horn.hpp:312
bool isConst() const
void addChildInstr(const std::string &c, const std::string &i, NodeRef *d)
hvptr_t copyVar(hvptr_t v, const int &idx)
void addMemConst(const MemConst *n, hvptr_t v)
const unsigned & getId() const
std::map< std::string, hvptr_t > _vars
Definition: horn.hpp:204
void mergeInVars(hvptr_t v)
std::set< hcptr_t > _clauses
Definition: horn.hpp:208
void initFuncVarInt(const FuncVar *n, hvptr_t v)
void generateMapping(const std::string &type)
std::map< std::string, hvptr_t > _ins
Definition: horn.hpp:35
void initMemOpInt(const MemOp *n, hvptr_t v)
void addBody(hlptr_t l)
const int & getLevel() const
void addBvVar(const BitvectorVar *n, hvptr_t v)
std::string getPred() const
std::string _type
Definition: horn.hpp:31
HornRewriter * generateLoopPredicate()
HornVar * hvptr_t
Definition: horn.hpp:17
size_t getInNum() const
Definition: horn.hpp:251
std::map< std::string, hvptr_t > _sVarMap
Definition: horn.hpp:306
void addFuncVar(const FuncVar *n, hvptr_t v)
void setIteAsNode(bool iteAsNode)
void removeRel(hvptr_t v)
void removeVar(const std::string &n)
void setLevel(const int &lvl)
hvptr_t _pred
Definition: horn.hpp:170
void addBoolVar(const BoolVar *n, hvptr_t v)