ilang  1.1.4
ILAng: A Modeling and Verification Platform for SoCs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros
chc_inv_in_wrapper.h
1 // --- Hongce Zhang (hongcez@princeton.edu)
3 
4 #ifndef CHC_INV_IN_WRAPPER_H__
5 #define CHC_INV_IN_WRAPPER_H__
6 
7 #include <ilang/smt-inout/yosys_smt_parser.h>
8 
9 namespace ilang {
10 namespace smt {
11 
14 protected:
15  // the raw result (not including the sat/unsat)
16  std::string raw_string;
17 
18 public:
19  // -------------- CONSTRUCTOR ------------------- //
20  // -------------- CONSTRUCTOR ------------------- //
21  SmtlibInvariantParserBase(); // do nothing
26  operator=(const SmtlibInvariantParserBase&) = delete;
27  // -------------- DESTRUCTOR ------------------- //
28  virtual ~SmtlibInvariantParserBase(); // do nothing
29 
30  // -------------- METHODS ------------------- //
31  // parse from a file, we will add something there to make
32  // if sat --> failed (return false)
33  // if unsat --> add the (assert ...)
34  virtual bool ParseInvResultFromFile(const std::string& fname) = 0;
35  // parse from a string: assume we have the (assert ...) there
36  virtual void ParseSmtResultFromString(const std::string& text) = 0;
38  virtual std::string GetFinalTranslateResult() const = 0;
40  // virtual const local_vars_t & GetLocalVarDefs() const = 0;
41 
43  std::string GetRawSmtString() const;
44 
46  static void set_new_local_ctr(unsigned cnt);
48  static void parse_local_var_name_to_set_counter(const std::string & name);
50  static unsigned get_local_ctr();
51 
52 protected:
54  static std::string get_a_new_local_var_name();
56  static unsigned local_var_idx;
57 
58 }; // class SmtlibInvariantParserBase
59 
62 protected:
63  // the pointer that will be used to cast to internal datatype
65 
66 public:
67  // -------------- CONSTRUCTOR ------------------- //
69  bool _flatten_datatype, bool _flatten_hierarchy,
70  const std::set<std::string>& _inv_pred_name,
71  const std::string& dut_inst_name);
77 
78  // -------------- DESTRUCTOR ------------------- //
80 
81  // -------------- METHODS ------------------- //
82  // parse from a file, we will add something there to make
83  // if sat --> failed (return false)
84  // if unsat --> add the (assert ...)
85  bool ParseInvResultFromFile(const std::string& fname);
86  // parse from a string: assume we have the (assert ...) there
87  void ParseSmtResultFromString(const std::string& text);
89  std::string GetFinalTranslateResult() const;
91  // const local_vars_t & GetLocalVarDefs() const; // no available
92 }; // class SmtlibInvariantParserInstance
93 
94 }; // namespace smt
95 }; // namespace ilang
96 
97 #endif // CHC_INV_IN_WRAPPER_H__
this a base class, should not be instantiated
Definition: chc_inv_in_wrapper.h:61
static void parse_local_var_name_to_set_counter(const std::string &name)
parse the names to set the new counters
std::string GetRawSmtString() const
get the local variable definitions
this a base class, should not be instantiated
Definition: chc_inv_in_wrapper.h:13
SmtlibInvariantParserInstance & operator=(const SmtlibInvariantParserInstance &)=delete
no assignment
virtual std::string GetFinalTranslateResult() const =0
get the translate result
to parse an smt file this will only work on the yosys&#39;s generated smt and not on the assembled CHC ...
Definition: yosys_smt_parser.h:22
std::string GetFinalTranslateResult() const
get the translate result
static unsigned get_local_ctr()
to check the value of this counter
static void set_new_local_ctr(unsigned cnt)
set the counter to a new val when loading
SmtlibInvariantParserBase & operator=(const SmtlibInvariantParserBase &)=delete
no assignment
static unsigned local_var_idx
the idx to it
Definition: chc_inv_in_wrapper.h:56
static std::string get_a_new_local_var_name()
a counter to get local variable name