CBMC
equation_symbol_mapping.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: String solver
4 
5 Author: Diffblue Ltd.
6 
7 \*******************************************************************/
8 
9 #ifndef CPROVER_SOLVERS_STRINGS_EQUATION_SYMBOL_MAPPING_H
10 #define CPROVER_SOLVERS_STRINGS_EQUATION_SYMBOL_MAPPING_H
11 
12 #include <map>
13 #include <unordered_map>
14 
15 #include <util/expr.h>
16 
22 {
23 public:
25  void add(const std::size_t i, const exprt &expr);
26 
30  std::vector<exprt> find_expressions(const std::size_t i);
31 
34  std::vector<std::size_t> find_equations(const exprt &expr);
35 
36 private:
38  std::map<exprt, std::vector<std::size_t>> equations_containing;
40  std::unordered_map<std::size_t, std::vector<exprt>> strings_in_equation;
41 };
42 
43 #endif // CPROVER_SOLVERS_STRINGS_EQUATION_SYMBOL_MAPPING_H
Maps equation to expressions contained in them and conversely expressions to equations that contain t...
void add(const std::size_t i, const exprt &expr)
Record the fact that equation i contains expression expr
std::vector< std::size_t > find_equations(const exprt &expr)
std::map< exprt, std::vector< std::size_t > > equations_containing
Record index of the equations that contain a given expression.
std::unordered_map< std::size_t, std::vector< exprt > > strings_in_equation
Record expressions that are contained in the equation with the given index.
std::vector< exprt > find_expressions(const std::size_t i)
Base class for all expressions.
Definition: expr.h:56