CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
string_constraint_instantiation.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Defines related function for string constraints.
4
5Author: Jesse Sigal, jesse.sigal@diffblue.com
6
7\*******************************************************************/
8
11
12#ifndef CPROVER_SOLVERS_REFINEMENT_STRING_CONSTRAINT_INSTANTIATION_H
13#define CPROVER_SOLVERS_REFINEMENT_STRING_CONSTRAINT_INSTANTIATION_H
14
15#include <util/std_expr.h> // IWYU pragma: keep
16
17#include <set>
18
21
39 const exprt &str,
40 const exprt &val);
41
42std::vector<exprt> instantiate_not_contains(
44 const std::set<std::pair<exprt, exprt>> &index_pairs,
45 const std::unordered_map<string_not_contains_constraintt, symbol_exprt>
46 &witnesses);
47
52{
53public:
56 explicit linear_functiont(const exprt &f);
57
59 void add(const linear_functiont &other);
60
63 exprt to_expr(bool negated = false) const;
64
69 static exprt solve(linear_functiont f, const exprt &var, const exprt &val);
70
72 std::string format();
73
74private:
76 std::unordered_map<exprt, mp_integer, irep_hash> coefficients;
78};
79
80#endif // CPROVER_SOLVERS_REFINEMENT_STRING_CONSTRAINT_INSTANTIATION_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
Base class for all expressions.
Definition expr.h:56
Canonical representation of linear function, for instance, expression $x + x - y + 5 - 3$ would given...
exprt to_expr(bool negated=false) const
static exprt solve(linear_functiont f, const exprt &var, const exprt &val)
Return an expression y such that f(var <- y) = val.
std::unordered_map< exprt, mp_integer, irep_hash > coefficients
std::string format()
Format the linear function as a string, can be used for debugging.
void add(const linear_functiont &other)
Make this function the sum of the current function with other.
The type of an expression, extends irept.
Definition type.h:29
API to expression classes.
exprt instantiate(const string_constraintt &axiom, const exprt &str, const exprt &val)
Instantiates a string constraint by substituting the quantifiers.
std::vector< exprt > instantiate_not_contains(const string_not_contains_constraintt &axiom, const std::set< std::pair< exprt, exprt > > &index_pairs, const std::unordered_map< string_not_contains_constraintt, symbol_exprt > &witnesses)
Constraints to encode non containement of strings.