Skip to content

Commit 549eb57

Browse files
Delete trailing whitespaces
1 parent db3e044 commit 549eb57

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

src/solvers/refinement/README.md

+37-37
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
\section string_solver_interface String solver interface
88

99
The basic role of the solver is to answer whether the set of equations given
10-
is satisfiable. One example usage, is to determine whether an assertion in a
10+
is satisfiable. One example usage, is to determine whether an assertion in a
1111
program can be violated.
12-
For instance, CBMC and JBMC, convert a input program and property to check
12+
For instance, CBMC and JBMC, convert a input program and property to check
1313
about this program to a set of equations. These equations are fed to a solver,
14-
which is one of the last step in CBMC and JBMC, as it tells us whether the
14+
which is one of the last step in CBMC and JBMC, as it tells us whether the
1515
property holds or can fail.
1616

17-
The secondary role of the solver is to provide a satisfying assignment of
17+
The secondary role of the solver is to provide a satisfying assignment of
1818
the variables of the equations, this can for instance be used to construct
1919
a trace.
2020

@@ -54,57 +54,57 @@ equation true, in that case `length2 = length3 = 1` and
5454

5555
\subsection general_interface General interface
5656

57-
The common interface for solvers in CProver is inherited from
57+
The common interface for solvers in CProver is inherited from
5858
`decision_proceduret` and is the common interface for all solvers.
5959
It is essentially composed of these three functions:
6060

61-
- `string_refinementt::set_to(const exprt &expr, bool value)`:
61+
- `string_refinementt::set_to(const exprt &expr, bool value)`:
6262
\copybrief string_refinementt::set_to
63-
- `string_refinementt::dec_solve()`:
63+
- `string_refinementt::dec_solve()`:
6464
\copybrief string_refinementt::dec_solve
65-
- `string_refinementt::get(const exprt &expr) const`:
65+
- `string_refinementt::get(const exprt &expr) const`:
6666
\copybrief string_refinementt::get
67-
67+
6868
For each goal given to CProver:
69-
- `set_to` is called on several equations, roughly one for each step of the
69+
- `set_to` is called on several equations, roughly one for each step of the
7070
symbolic execution that leads to that goal;
7171
- `dec_solve` is called to determine whether the goal is reachable given these
7272
equations;
7373
- `get` is called by the interpreter to obtain concrete value to build a trace
7474
leading to the goal;
75-
- The same process can be repeated for further goals, in that case the
75+
- The same process can be repeated for further goals, in that case the
7676
constraints added by previous calls to `set_to` remain valid.
7777

7878
\subsection specificity Specificity of the string solver
7979

80-
The specificity of the solver is in what kind of expressions `set_to` accepts
80+
The specificity of the solver is in what kind of expressions `set_to` accepts
8181
and understands. `string_refinementt::set_to` accepts all constraints that are
8282
normally accepted by `bv_refinementt`.
8383

8484
`string_refinementt::set_to` also understands constraints of the form:
85-
* `char_pointer1 = b ? char_pointer2 : char_pointer3` where `char_pointer<i>`
85+
* `char_pointer1 = b ? char_pointer2 : char_pointer3` where `char_pointer<i>`
8686
variables are of type pointer to characters and `b` is a Boolean
8787
expression.
8888
* `i = cprover_primitive(args)` where `i` is of signed bit vector type.
8989
String primitives are listed in the next section.
9090

91-
\note In the implementation, equations that are not of these forms are passed
91+
\note In the implementation, equations that are not of these forms are passed
9292
to an embedded `bv_refinementt` solver.
9393

9494
\subsection string-representation String representation in the solver
9595

9696
String primitives can have arguments which are pointers to characters.
97-
These pointers represent strings.
98-
To each of these pointers the string solver associate a char array
97+
These pointers represent strings.
98+
To each of these pointers the string solver associate a char array
9999
which represents the content of the string.
100-
If the pointer is the address of an actual array in the program they should be
100+
If the pointer is the address of an actual array in the program they should be
101101
linked by using the primitive `cprover_string_associate_array_to_pointer`.
102102
The length of the array can also be linked to a variable of the program using
103103
`cprover_string_associate_length_to_array`.
104104

105105
\warning The solver assumes the memory pointed by the arguments is immutable
106106
which is not something that is true in general for C pointers for instance.
107-
Therefore for each transformation on a string, it is assumed the program
107+
Therefore for each transformation on a string, it is assumed the program
108108
allocates a new string before calling a primitive.
109109

110110
\section primitives String primitives
@@ -118,7 +118,7 @@ allocates a new string before calling a primitive.
118118
* `cprover_string_char_at` :
119119
\copybrief string_constraint_generatort::add_axioms_for_char_at(const function_application_exprt &f)
120120
\link string_constraint_generatort::add_axioms_for_char_at(const function_application_exprt &f) More... \endlink
121-
* `cprover_string_length` :
121+
* `cprover_string_length` :
122122
\copybrief string_constraint_generatort::add_axioms_for_length(const function_application_exprt &f)
123123
\link string_constraint_generatort::add_axioms_for_length(const function_application_exprt &f) More... \endlink
124124

@@ -127,10 +127,10 @@ allocates a new string before calling a primitive.
127127
* `cprover_string_compare_to` :
128128
\copybrief string_constraint_generatort::add_axioms_for_compare_to(const function_application_exprt &f)
129129
\link string_constraint_generatort::add_axioms_for_compare_to(const function_application_exprt &f) More... \endlink
130-
* `cprover_string_contains` :
130+
* `cprover_string_contains` :
131131
\copybrief string_constraint_generatort::add_axioms_for_contains(const function_application_exprt &f)
132132
\link string_constraint_generatort::add_axioms_for_contains(const function_application_exprt &f) More... \endlink
133-
* `cprover_string_equals` :
133+
* `cprover_string_equals` :
134134
\copybrief string_constraint_generatort::add_axioms_for_equals(const function_application_exprt &f)
135135
\link string_constraint_generatort::add_axioms_for_equals(const function_application_exprt &f) More... \endlink
136136
* `cprover_string_equals_ignore_case` :
@@ -145,25 +145,25 @@ allocates a new string before calling a primitive.
145145
* `cprover_string_is_suffix` :
146146
\copybrief string_constraint_generatort::add_axioms_for_is_suffix
147147
\link string_constraint_generatort::add_axioms_for_is_suffix More... \endlink
148-
* `cprover_string_index_of` :
148+
* `cprover_string_index_of` :
149149
\copybrief string_constraint_generatort::add_axioms_for_index_of(const function_application_exprt &f)
150150
\link string_constraint_generatort::add_axioms_for_index_of(const function_application_exprt &f) More... \endlink
151151
* `cprover_string_last_index_of` :
152152
\copybrief string_constraint_generatort::add_axioms_for_last_index_of(const function_application_exprt &f)
153153
\link string_constraint_generatort::add_axioms_for_last_index_of(const function_application_exprt &f) More... \endlink
154154

155-
\subsection transformations Transformations:
155+
\subsection transformations Transformations:
156156

157157
* `cprover_string_char_set` :
158158
\copybrief string_constraint_generatort::add_axioms_for_char_set(const function_application_exprt &f)
159159
\link string_constraint_generatort::add_axioms_for_char_set(const function_application_exprt &f) More... \endlink
160-
* `cprover_string_concat` :
160+
* `cprover_string_concat` :
161161
\copybrief string_constraint_generatort::add_axioms_for_concat(const function_application_exprt &f)
162162
\link string_constraint_generatort::add_axioms_for_concat(const function_application_exprt &f) More... \endlink
163163
* `cprover_string_delete` :
164164
\copybrief string_constraint_generatort::add_axioms_for_delete(const function_application_exprt &f)
165165
\link string_constraint_generatort::add_axioms_for_delete(const function_application_exprt &f) More... \endlink
166-
* `cprover_string_insert` :
166+
* `cprover_string_insert` :
167167
\copybrief string_constraint_generatort::add_axioms_for_insert(const function_application_exprt &f)
168168
\link string_constraint_generatort::add_axioms_for_insert(const function_application_exprt &f) More... \endlink
169169
* `cprover_string_replace` :
@@ -172,7 +172,7 @@ allocates a new string before calling a primitive.
172172
* `cprover_string_set_length` :
173173
\copybrief string_constraint_generatort::add_axioms_for_set_length(const function_application_exprt &f)
174174
\link string_constraint_generatort::add_axioms_for_set_length(const function_application_exprt &f) More... \endlink
175-
* `cprover_string_substring` :
175+
* `cprover_string_substring` :
176176
\copybrief string_constraint_generatort::add_axioms_for_substring(const function_application_exprt &f)
177177
\link string_constraint_generatort::add_axioms_for_substring(const function_application_exprt &f) More... \endlink
178178
* `cprover_string_to_lower_case` :
@@ -212,18 +212,18 @@ allocates a new string before calling a primitive.
212212
\subsection deprecated Deprecated primitives:
213213

214214
* `cprover_string_concat_code_point`, `cprover_string_code_point_at`,
215-
`cprover_string_code_point_before`, `cprover_string_code_point_count`:
215+
`cprover_string_code_point_before`, `cprover_string_code_point_count`:
216216
Java specific, should be part of Java models.
217-
* `cprover_string_offset_by_code_point`, `cprover_string_concat_char`,
218-
`cprover_string_concat_int`, `cprover_string_concat_long`,
217+
* `cprover_string_offset_by_code_point`, `cprover_string_concat_char`,
218+
`cprover_string_concat_int`, `cprover_string_concat_long`,
219219
`cprover_string_concat_bool`, `cprover_string_concat_double`,
220-
`cprover_string_concat_float`, `cprover_string_insert_int`,
220+
`cprover_string_concat_float`, `cprover_string_insert_int`,
221221
`cprover_string_insert_long`, `cprover_string_insert_bool`,
222222
`cprover_string_insert_char`, `cprover_string_insert_double`,
223-
`cprover_string_insert_float` :
223+
`cprover_string_insert_float` :
224224
Should be done in two steps: conversion from primitive type and call
225225
to the string primitive.
226-
* `cprover_string_array_of_char_pointer`, `cprover_string_to_char_array` :
226+
* `cprover_string_array_of_char_pointer`, `cprover_string_to_char_array` :
227227
Pointer to char array association
228228
is now handled by `string_constraint_generatort`, there is no need for
229229
explicit conversion.
@@ -232,15 +232,15 @@ allocates a new string before calling a primitive.
232232
Should use `cprover_string_length(s) == 0` instead.
233233
* `cprover_string_empty_string` : Can use literal of empty string instead.
234234
* `cprover_string_of_long` : Should be the same as `cprover_string_of_int`.
235-
* `cprover_string_delete_char_at` : A call to
236-
`cprover_string_delete_char_at(s, i)` would be the same thing as
235+
* `cprover_string_delete_char_at` : A call to
236+
`cprover_string_delete_char_at(s, i)` would be the same thing as
237237
`cprover_string_delete(s, i, i+1)`.
238238
* `cprover_string_of_bool` :
239239
Language dependent, should be implemented in the models.
240240
* `cprover_string_copy` : Same as `cprover_string_substring(s, 0)`.
241241
* `cprover_string_of_int_hex` : Same as `cprover_string_of_int(s, 16)`.
242242
* `cprover_string_of_double` : Same as `cprover_string_of_float`.
243-
243+
244244
\section algorithm Decision algorithm
245245

246246
\copydetails string_refinementt::dec_solve
@@ -249,9 +249,9 @@ allocates a new string before calling a primitive.
249249

250250
This is done by generate_instantiations(messaget::mstreamt &stream, const namespacet &ns, const string_constraint_generatort &generator, const index_set_pairt &index_set, const string_axiomst &axioms).
251251
\copydetails generate_instantiations(messaget::mstreamt &stream, const namespacet &ns, const string_constraint_generatort &generator, const index_set_pairt &index_set, const string_axiomst &axioms)
252-
252+
253253
\subsection axiom-check Axiom check
254254

255255
\copydetails check_axioms(const string_axiomst &axioms, string_constraint_generatort &generator, const std::function<exprt(const exprt &)> &get, messaget::mstreamt &stream, const namespacet &ns, std::size_t max_string_length, bool use_counter_example, ui_message_handlert::uit ui, const union_find_replacet &symbol_resolve)
256-
\link check_axioms(const string_axiomst &axioms, string_constraint_generatort &generator, const std::function<exprt(const exprt &)> &get, messaget::mstreamt &stream, const namespacet &ns, std::size_t max_string_length, bool use_counter_example, ui_message_handlert::uit ui, const union_find_replacet &symbol_resolve)
256+
\link check_axioms(const string_axiomst &axioms, string_constraint_generatort &generator, const std::function<exprt(const exprt &)> &get, messaget::mstreamt &stream, const namespacet &ns, std::size_t max_string_length, bool use_counter_example, ui_message_handlert::uit ui, const union_find_replacet &symbol_resolve)
257257
(See function documentation...) \endlink

0 commit comments

Comments
 (0)