CBMC
|
#include <string_constraint.h>
Public Member Functions | |
string_constraintt (const symbol_exprt &_univ_var, const exprt &lower_bound, const exprt &upper_bound, const exprt &body, message_handlert &message_handler) | |
string_constraintt (symbol_exprt univ_var, exprt upper_bound, exprt body, message_handlert &message_handler) | |
exprt | univ_within_bounds () const |
void | replace_expr (union_find_replacet &replace_map) |
exprt | negation () const |
Public Attributes | |
symbol_exprt | univ_var |
exprt | lower_bound |
exprt | upper_bound |
exprt | body |
Related Functions | |
(Note that these are not member functions.) | |
typedef std::map< exprt, std::vector< exprt > > | array_index_mapt |
static array_index_mapt | gather_indices (const exprt &expr) |
static bool | is_linear_arithmetic_expr (const exprt &expr, const symbol_exprt &var) |
static bool | universal_only_in_index (const string_constraintt &constr) |
The universally quantified variable is only allowed to occur in index expressions in the body of a string constraint. More... | |
static bool | is_valid_string_constraint (messaget::mstreamt &stream, const namespacet &ns, const string_constraintt &constraint) |
Checks the data invariant for string_constraintt. More... | |
This represents a universally quantified string constraint as laid out in DOI: 10.1007/978-3-319-03077-7. The paper seems to specify a universal constraint as follows.
A universal constraint is of the form \( \forall i.\ PI(i) \Rightarrow PV(i)\) where \(PI\) and \(PV\) satisfies the following conditions:
PI
, called the index guard, must follow the grammarPV
is called the value constraint. The index variable i
can only be used in array read expressions of the form a[i]
. ie. PV
is of the form \(P'(s_0[f_0(i)],\ldots, s_k[f_k(i)] )\), moreover when focusing on one specific string, all indices are the same [stated in a roundabout manner]. \(L(n)\) and \(P(n, s_0,\ldots, s_k)\) may contain other (free) variables, but in \(P\), \(n\) can only occur as an argument to an \(f\) [explicitly stated, implied].Definition at line 55 of file string_constraint.h.
string_constraintt::string_constraintt | ( | const symbol_exprt & | _univ_var, |
const exprt & | lower_bound, | ||
const exprt & | upper_bound, | ||
const exprt & | body, | ||
message_handlert & | message_handler | ||
) |
Definition at line 34 of file string_constraint.cpp.
|
inline |
Definition at line 73 of file string_constraint.h.
|
inline |
Definition at line 101 of file string_constraint.h.
|
inline |
Definition at line 94 of file string_constraint.h.
|
inline |
Definition at line 87 of file string_constraint.h.
|
related |
Definition at line 1935 of file string_refinement.cpp.
|
related |
Definition at line 1938 of file string_refinement.cpp.
|
related |
expr | an expression |
var | a symbol |
expr
is a linear function of var
. Definition at line 1961 of file string_refinement.cpp.
|
related |
Checks the data invariant for string_constraintt.
stream | message stream | |
ns | namespace | |
[in] | constraint | the string constraint to check |
Definition at line 2007 of file string_refinement.cpp.
|
related |
The universally quantified variable is only allowed to occur in index expressions in the body of a string constraint.
This function returns true if this is the case and false otherwise.
[in] | constr | The string constraint to check |
Definition at line 1987 of file string_refinement.cpp.
exprt string_constraintt::body |
Definition at line 63 of file string_constraint.h.
exprt string_constraintt::lower_bound |
Definition at line 61 of file string_constraint.h.
symbol_exprt string_constraintt::univ_var |
Definition at line 60 of file string_constraint.h.
exprt string_constraintt::upper_bound |
Definition at line 62 of file string_constraint.h.