@@ -34,11 +34,11 @@ exprt string_constraint_generatort::add_axioms_for_index_of(
34
34
symbol_exprt contains=fresh_boolean (" contains_in_index_of" );
35
35
36
36
// We add axioms:
37
- // a1 : -1 <= index< |str|
37
+ // a1 : -1 <= index < |str|
38
38
// a2 : !contains <=> index=-1
39
- // a3 : contains => from_index<= index&& str[index]= c
40
- // a4 : forall n, from_index<=n< index. contains => str[n]!= c
41
- // a5 : forall m, from_index<=n< |str|. !contains => str[m]!= c
39
+ // a3 : contains == > from_index <= index && str[index] = c
40
+ // a4 : forall n, n:[from_index, index[ . contains == > str[n] != c
41
+ // a5 : forall m, n:[from_index, |str|[ . !contains == > str[m] != c
42
42
43
43
exprt minus1=from_integer (-1 , index_type);
44
44
and_exprt a1 (
@@ -102,14 +102,14 @@ exprt string_constraint_generatort::add_axioms_for_index_of_string(
102
102
symbol_exprt contains=fresh_boolean (" contains_substring" );
103
103
104
104
// We add axioms:
105
- // a1 : contains => from_index <= offset <= |haystack|-|needle|
105
+ // a1 : contains == > from_index <= offset <= |haystack|-|needle|
106
106
// a2 : !contains <=> offset=-1
107
107
// a3 : forall n:[0,|substring|[.
108
- // contains => haystack[n+offset]=needle[n]
108
+ // contains == > haystack[n+offset]=needle[n]
109
109
// a4 : forall n:[from_index,offset[.
110
- // contains => (exists m:[0,|needle|[. haystack[m+n]!= needle[m]])
110
+ // contains == > (exists m:[0,|needle|[. haystack[m+n] != needle[m]])
111
111
// a5: forall n:[from_index,|haystack|-|needle|[.
112
- // !contains => (exists m:[0,|needle|[. haystack[m+n]!= needle[m])
112
+ // !contains == > (exists m:[0,|needle|[. haystack[m+n] != needle[m])
113
113
114
114
implies_exprt a1 (
115
115
contains,
@@ -161,9 +161,9 @@ exprt string_constraint_generatort::add_axioms_for_index_of_string(
161
161
// Unfold the existential quantifier as a disjunction in case of a constant
162
162
// a4 && a5 <=> a6:
163
163
// forall n:[from_index,|haystack|-|needle|].
164
- // !contains || n < offset =>
165
- // haystack[n]!= needle[0] || ... ||
166
- // haystack[n+|needle|-1]!= needle[|needle|-1]
164
+ // !contains || n < offset == >
165
+ // haystack[n] != needle[0] || ... ||
166
+ // haystack[n+|needle|-1] != needle[|needle|-1]
167
167
symbol_exprt qvar2=fresh_univ_index (" QA_index_of_string_2" , index_type);
168
168
mp_integer sub_length;
169
169
assert (!to_integer (needle.length (), sub_length));
@@ -220,16 +220,16 @@ exprt string_constraint_generatort::add_axioms_for_last_index_of_string(
220
220
symbol_exprt contains=fresh_boolean (" contains_substring" );
221
221
222
222
// We add axioms:
223
- // a1 : contains => offset <= from_index && offset <= |haystack| - |needle|
224
- // a2 : !contains <=> offset= -1
223
+ // a1 : contains == > offset <= from_index && offset <= |haystack| - |needle|
224
+ // a2 : !contains <=> offset = -1
225
225
// a3 : forall n:[0, needle.length[,
226
- // contains => haystack[n+offset]= needle[n]
226
+ // contains == > haystack[n+offset] = needle[n]
227
227
// a4 : forall n:[offset+1, min(from_index, |haystack| - |needle|)].
228
- // contains =>
229
- // (exists m:[0,|substring|[. haystack[m+n]!= needle[m]])
228
+ // contains == >
229
+ // (exists m:[0,|substring|[. haystack[m+n] != needle[m]])
230
230
// a5: forall n:[0, min(from_index, |haystack| - |needle|)].
231
- // !contains =>
232
- // (exists m:[0,|substring|[. haystack[m+n]!= needle[m])
231
+ // !contains == >
232
+ // (exists m:[0,|substring|[. haystack[m+n] != needle[m])
233
233
234
234
implies_exprt a1 (
235
235
contains,
@@ -283,9 +283,9 @@ exprt string_constraint_generatort::add_axioms_for_last_index_of_string(
283
283
// Unfold the existential quantifier as a disjunction in case of a constant
284
284
// a4 && a5 <=> a6:
285
285
// forall n:[0, min(from_index,|haystack|-|needle|)].
286
- // !contains || n > offset =>
287
- // haystack[n]!= needle[0] || ... ||
288
- // haystack[n+|substring|-1]!= needle[|substring|-1]
286
+ // !contains || n > offset == >
287
+ // haystack[n] != needle[0] || ... ||
288
+ // haystack[n+|substring|-1] != needle[|substring|-1]
289
289
symbol_exprt qvar2=fresh_univ_index (" QA_index_of_string_2" , index_type);
290
290
mp_integer sub_length;
291
291
assert (!to_integer (needle.length (), sub_length));
@@ -384,10 +384,10 @@ exprt string_constraint_generatort::add_axioms_for_last_index_of(
384
384
385
385
// We add axioms:
386
386
// a1 : -1 <= i <= from_index
387
- // a2 : (i= -1 <=> !contains)
388
- // a3 : ( contains => i <= from_index &&s[i]= c)
389
- // a4 : forall n. i+1 <= n < from_index +1 &&contains => s[n]!= c
390
- // a5 : forall m. 0 <= m < from_index +1 &&!contains => s[m]!= c
387
+ // a2 : i = -1 <=> !contains
388
+ // a3 : contains ==> ( i <= from_index && s[i] = c)
389
+ // a4 : forall n:[ i+1, from_index+1[ && contains == > s[n] != c
390
+ // a5 : forall m:[0, from_index+1[ && !contains == > s[m] != c
391
391
392
392
exprt index1=from_integer (1 , index_type);
393
393
exprt minus1=from_integer (-1 , index_type);
0 commit comments