ilasynth  1.0
ILASynth: Template-based ILA Synthesis Engine
simplify.hpp
Go to the documentation of this file.
1 #ifndef __SIMPLIFY_HPP_DEFINED__
2 #define __SIMPLIFY_HPP_DEFINED__
3 
4 #include <boost/logic/tribool.hpp>
5 #include <ilasynth/ast.hpp>
6 #include <ilasynth/rewriter.hpp>
7 #include <ilasynth/smt.hpp>
8 #include <stack>
9 
10 namespace ilasynth {
12  z3::context ctx;
13  z3::solver S;
15 
17 
18  void _add(const nptr_t& a, bool negate = false);
19  boost::logic::tribool _isConstant(const nptr_t& c);
20 
21  void getNewArgs(const Node* op, nptr_vec_t& args);
22  nptr_t getRepl(const Node* n) const;
23  nptr_t rewriteITE(const Node* n);
24  void dfs(const Node* n);
25 
26 public:
27  // constructor.
28  ITESimplifier(const nptr_t& assump);
29  // destructor.
30  virtual ~ITESimplifier();
31  // add a vector of assumption.
32  void addAssumptions(const nptr_vec_t& assumps);
33  // add exactly one assumption.
34  void addAssumption(const nptr_t& a);
35  // create clone
36  void createClone(const Node* n);
37 
38  void reset() { rwmap.clear(); }
39  nptr_t simplify(Node* n);
40 };
41 } // namespace ilasynth
42 #endif
void addAssumptions(const nptr_vec_t &assumps)
std::vector< nptr_t > nptr_vec_t
Definition: node.hpp:27
nptr_t simplify(Node *n)
z3::solver S
Definition: simplify.hpp:13
nptr_t rewriteITE(const Node *n)
boost::shared_ptr< Node > nptr_t
Definition: node.hpp:24
Definition: simplify.hpp:11
void createClone(const Node *n)
rwmap_t rwmap
Definition: simplify.hpp:16
void reset()
Definition: simplify.hpp:38
Definition: smt.hpp:14
void _add(const nptr_t &a, bool negate=false)
Definition: abstraction.hpp:21
ITESimplifier(const nptr_t &assump)
Definition: node.hpp:55
nptr_t getRepl(const Node *n) const
void addAssumption(const nptr_t &a)
boost::logic::tribool _isConstant(const nptr_t &c)
Z3ExprAdapter adapter
Definition: simplify.hpp:14
z3::context ctx
Definition: simplify.hpp:12
void getNewArgs(const Node *op, nptr_vec_t &args)
void dfs(const Node *n)
std::unordered_map< const Node *, nptr_t, decltype(&nodeHash), decltype(&nodeEqual)> rwmap_t
Definition: node.hpp:177