7 #ifndef YOSYS_SMT_PARSER_H__
8 #define YOSYS_SMT_PARSER_H__
10 #include <ilang/smt-inout/smt_ast.h>
24 typedef std::map<std::string, state_var_t*> variable_idx_t;
49 const std::string& suffix);
52 const std::vector<state_var_t>& all_flattened_state_var,
53 std::vector<var_type>& args);
56 const std::string& suffix);
59 const std::string& prefix);
61 static std::vector<std::string>
str_to_list(
const std::string& in);
67 const std::string& current_module,
68 const std::map<std::string, state_var_t>& current_mod_state_var_idx,
69 const std::vector<std::string>& arg_def,
70 const std::set<std::string>& defined_func,
const std::string& body_text);
73 std::shared_ptr<func_def_t> fn,
const std::string& current_module,
75 const std::map<std::string, state_var_t>& current_mod_state_var_idx,
76 const std::set<std::string>& defined_func);
96 const std::vector<state_var_t>&
static std::vector< std::string > str_to_list(const std::string &in)
extract list from a space seped text
std::string replace_a_body(const std::string ¤t_module, const std::map< std::string, state_var_t > ¤t_mod_state_var_idx, const std::vector< std::string > &arg_def, const std::set< std::string > &defined_func, const std::string &body_text)
replace : handle a func_body
void construct_flatten_dataype()
construct flatten_datatype (hierarchically)
the class that holds the whole file
Definition: smt_ast.h:183
datatypes_t flatten_datatype
the datatype defs without datatypes
Definition: yosys_smt_parser.h:30
void replace_a_func(std::shared_ptr< func_def_t > fn, const std::string ¤t_module, const std::map< std::string, state_var_t > ¤t_mod_state_var_idx, const std::set< std::string > &defined_func)
replace : handle a func (arg) and invoke the body repl part
void add_no_change_function()
add the no-change-function (hierarchically)
void BreakDatatypes()
Process (replace and add)
const smt_file & GetRawSmtAst() const
Get the unflattened datatype.
void replace_all_function_arg_body()
replace function body and argument
void AddNoChangeStateUpdateFunction()
Add the no change function.
variable_idx_t variable_idx
the variable indices — only top level
Definition: yosys_smt_parser.h:32
const std::vector< state_var_t > & get_module_flatten_dt(const std::string &mod_name) const
return a module's flatten datatypes
to parse an smt file this will only work on the yosys's generated smt and not on the assembled CHC ...
Definition: yosys_smt_parser.h:22
bool is_state_name(const std::string &state_name) const
check if a name is a state
const variable_idx_t & get_var_idx() const
return the top module's variable index
static void convert_datatype_to_type_vec(const std::vector< state_var_t > &all_flattened_state_var, std::vector< var_type > &args)
convert a flatten_datatype to function type decl
smt_file smt_ast
the internal smt-ast
Definition: yosys_smt_parser.h:28
void create_variable_idx()
create the variable indices
static std::string st_name_add_suffix(const std::string &stname, const std::string &suffix)
add a suffix (for next state)
const std::vector< std::string > & get_module_def_orders() const
return a reference to module def order
std::string Export()
Export to string.
static void convert_flatten_datatype_to_arg_vec(const std::vector< state_var_t > &, std::vector< arg_t > &, const std::string &suffix)
convert a flatten_datatype to function arg
static std::string st_name_add_prefix(const std::string &stname, const std::string &prefix)
add a prefix (for state name)