Skip to content

String solver #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
05b7300
started adding support for Strings (with the CVC4 backend)
Apr 9, 2016
361d98a
merged with upstream
Apr 15, 2016
9633963
improved string support in smt2 backend
Apr 15, 2016
6d59022
added first string test to the regression suite (still no .desc though)
Apr 15, 2016
5cd5643
merging with upstream
Apr 29, 2016
61b64bb
fixed bug in converting string length for the CVC4 backend
Apr 29, 2016
08af98c
added more string tests
Apr 29, 2016
89dbec2
removed accidentally committed changes to config.inc
Apr 29, 2016
b820c1e
strings: added hand-written SMT2 versions of test3.c
May 6, 2016
7cc6a6b
strings test3: added version with assertions checked one by one
May 6, 2016
ccba04e
revised string encoding as quantified arrays
May 13, 2016
72ccef3
added more string tests
May 13, 2016
44f48e5
use native support for int2bv in CVC4
May 20, 2016
1f4d2ab
try to add an explicit upper bound to string lengths
May 20, 2016
1baf4db
merged with diffblue/master
May 27, 2016
b560ec1
merged with diffblue master
Jun 3, 2016
c3cc804
added further string length constraints to cope with possible overflows
Jun 10, 2016
916f7ce
fixed encoding of string suffix
Jun 10, 2016
9bb988d
fixed double output in encoding string constraints (check in the cach…
Jun 17, 2016
9cb8535
merged with master
Jul 1, 2016
4b84909
added various string benchmarks taken from z3str2-bv
Jul 1, 2016
8be3253
started working on string support in the SAT backend (via PASS-like a…
Jul 8, 2016
e02fee2
sync with master
Jul 15, 2016
599b343
continued working on string refinement
Jul 15, 2016
d138195
further work on string refinement
Jul 15, 2016
4abb6d6
continued working on string refinement loop
Aug 1, 2016
06eccb4
string refinement: fixed bug in i2bin
Aug 2, 2016
7ce74e8
string refinement: fixed processing of command-line args
Aug 2, 2016
64ae282
string refinement: added missing conversions, fixed bug in axiom inst…
Aug 2, 2016
6afcf55
string refinement: further progress. Now something works, but checkin…
Aug 2, 2016
ad547d2
Adding --pass option to cbmc to use the string refinement code of Alb…
Aug 2, 2016
c864f07
experimenting with another conversion to bit vectors to take the leng…
Aug 3, 2016
557b119
Changed the encoding of strings to use a structured type
Aug 5, 2016
a1fce4f
Post proccessing of the lemmas
Aug 5, 2016
c4c0815
Converting all strings to bit vectors using a structure containing th…
Aug 9, 2016
a3e39ea
cleaned some code
Aug 9, 2016
4d0f0c3
better structure for the code of string expressions
Aug 9, 2016
2675eaf
taking care of char expressions
Aug 10, 2016
453381d
uniformisation of lemmas and axioms by putting them in a same class (…
Aug 10, 2016
2baf3bd
adapted the code for string_equal
Aug 10, 2016
e447fa7
adapted the code for string_equal
Aug 10, 2016
7999115
making the PASS algorithm cleaner
Aug 11, 2016
653ae6c
corrected the problem with infinite loops and some missing conversion…
Aug 12, 2016
30c1b78
removed some debugging information that should no longer be needed
Aug 12, 2016
0a489c7
removed some debugging information that should no longer be needed
Aug 12, 2016
2888fc2
corrected a sign problem in the computation of the substitution
Aug 12, 2016
d03aac0
avoid creating new string symbols when there is no need for it
Aug 12, 2016
45c9d04
adding instantiations before solving
Aug 15, 2016
7bf66a1
Adding new tests for strings
Aug 15, 2016
a690724
adding index to the index set when we have a char_at function
Aug 15, 2016
888e374
Corrected the order in the arguments of issuffix
Aug 15, 2016
1c89da7
A couple of other examples for strings
Aug 15, 2016
b90ec2c
Test descriptions for strings
Aug 15, 2016
f1a4908
Better displaying of the lemmas and other expressions
Aug 15, 2016
759613c
Cleaning a bit the code for string refinement
Aug 15, 2016
3f21d28
Tests coming from the PASS article
Aug 16, 2016
36015e3
adding support for axioms with existential quantifier, and adding the…
Aug 17, 2016
96d30c1
changed the index type to be signed in order to accomodate some funct…
Aug 18, 2016
24bfd52
more precise tests, with both assertions that should succeed and fail
Aug 19, 2016
ff4d91a
repaired the order of instantiation when there are existential quanti…
Aug 19, 2016
cac8777
giving up for now refinement approach for the index set, which was no…
Aug 22, 2016
b81708e
changing the way string constraints are represented
Aug 26, 2016
1624e6e
changing the way string constraints are represented
Aug 26, 2016
3f1c02b
changed the way string constraints are represented
Aug 26, 2016
04ad43d
structured the code for string refinement in several files
Aug 29, 2016
95a4d9e
Completed the algorithm for contains function
Aug 30, 2016
1eea52d
Test for the substring function
Aug 30, 2016
23426ce
corrected the prefix_of function
Aug 30, 2016
4dc1edd
some missing tests
Aug 30, 2016
4f878c0
removed the copy declarations which we don't really know how to do fo…
Aug 30, 2016
86abfae
Compatibility with java strings
Sep 6, 2016
37a3b75
Compatibility with java strings, and a couple of examples of java pro…
Sep 6, 2016
b254c25
Corrected type checkm for string equality in Java programs
Sep 7, 2016
ea93657
Corrected type checkm for string equality in Java programs
Sep 7, 2016
f04df39
Pass preprocessing of java string literals
Sep 10, 2016
7526764
improved pass processing for string literals inside arguments of func…
Sep 10, 2016
fab0bc6
pass processing of new String
Sep 10, 2016
7cf5e6d
PASS preprocessing for indexOf and lastIndexOf
Sep 11, 2016
cddbb6c
removed unecessary debugging information
Sep 11, 2016
19f5172
Substring method and more tests
Sep 12, 2016
9635737
corrected a confusion between c strings and java strings in the case …
Sep 12, 2016
4061517
regression test for java endsWith method
Sep 12, 2016
32d997e
added java contains string method
Sep 12, 2016
d4cee59
cleaning the code by removing some debugging information that were us…
Sep 13, 2016
f9c45b3
basic support for StringBuilder
Sep 13, 2016
f100d55
support for StringBuilder init without argument
Sep 13, 2016
33ded2d
test for StringBuilder
Sep 13, 2016
8e212b2
support for StringBuilder.length
Sep 13, 2016
9f53d15
init from String and void for String and StringBuilder
Sep 13, 2016
27a4a7d
tests for StringBuilder.length
Sep 13, 2016
6661386
substring with only one argument (we should add tests for this also)
Sep 13, 2016
3751029
conversion from integers to strings
Sep 14, 2016
2bc890d
conversion from integers to strings in java
Sep 14, 2016
0081e63
parsing of integer in strings
Sep 14, 2016
45f4b77
parsing of integer in strings
Sep 14, 2016
24cf61b
parsing of integer in strings for java
Sep 14, 2016
1e91533
better handling of StringBuilder.append to allow chained append calls
Sep 14, 2016
2c4395e
of int for negative numbers
Sep 15, 2016
a874b87
conversion between string and int for negative numbers
Sep 15, 2016
b56fcdc
corrected a mistake in the code for string refinement of if expressions
Sep 15, 2016
99add90
easychair example from TACAS09 (Path feasability analysis for string-…
Sep 16, 2016
26be0a4
Separating the classes for the refined string type and string express…
Sep 16, 2016
20cd623
Separating the classes for the refined string type and string express…
Sep 16, 2016
39e4ccc
clening the code of string refinement of useless functions
Sep 16, 2016
fef67d7
incremental string solver for better performances
Sep 16, 2016
2236603
incremental string solver
Sep 16, 2016
baebf8f
a couple of additional string methods, not tested yet
Sep 19, 2016
0ff5946
corrected string builders
Sep 20, 2016
1249657
corrected trim function and test
Sep 20, 2016
4066ea2
corrected case functions and test
Sep 20, 2016
7e49aa1
corrected case functions and test
Sep 22, 2016
a7e6c4c
changed the name of the CPROVER strcat functions to avoid confusion b…
Oct 3, 2016
9a0f4af
corrected append int and test for empty string
Oct 3, 2016
dab12b2
made the string of bool conversion precise
Oct 3, 2016
aff92df
added the set length method for string builders
Oct 3, 2016
ff6b640
added delete and deleteCharAt. Also improved the index simplification…
Oct 4, 2016
74a7d6b
tests for delete and deleteCharAt
Oct 4, 2016
94afd07
tests for delete and deleteCharAt
Oct 4, 2016
3da7602
tests for delete and deleteCharAt
Oct 4, 2016
185eb92
added startsWith(char,fromIndex)
Oct 5, 2016
731623d
added indexOf and lastIndexOf with fromIndex argument
Oct 5, 2016
8177899
tests for indexOf and lastIndexOf with fromIndex argument
Oct 5, 2016
2ac64a2
adding startsWith with toffset argument
Oct 5, 2016
c1691c3
adding String.replace(CC)
Oct 5, 2016
7d1d5f9
tests for setLength and toCharArray
Oct 5, 2016
ed20626
adding String.valueOf for several classes
Oct 5, 2016
827bda9
adding String.valueOf char
Oct 5, 2016
7755cde
adding String.setCharAt
Oct 6, 2016
592a8f2
adding String.subSequence
Oct 6, 2016
c6c0f69
adding StringBuilder.insert and tests
Oct 6, 2016
4f7fc09
unicode string litterals and codePointAt
Oct 7, 2016
acbc764
codePointBefore and Count
Oct 7, 2016
3731dd8
adding appendCodePoint
Oct 7, 2016
57b3d8d
adding String.compareTo
Oct 10, 2016
f6bc09c
adding String.hashCode
Oct 10, 2016
98d0687
adding Integer.toHexString
Oct 10, 2016
d3a39a1
adding Integer.toHexString
Oct 10, 2016
0fadc77
corrected an implementation problem with the initialisation of the in…
Oct 11, 2016
0fc6d29
partial specification for floats
Oct 13, 2016
3c5b277
overapproximation of indexOf for strings as arguments
Oct 13, 2016
9df15f3
overapproximation of lastIndexOf for strings as arguments
Oct 13, 2016
ad4ec55
corrected tests for IndexOf
Oct 13, 2016
c814f13
simplification of the code for string functions identifiers
Oct 13, 2016
547f384
simplification of the code for string functions identifiers
Oct 13, 2016
0202011
simplification of the code for string functions identifiers and corec…
Oct 14, 2016
fa589ef
merge main branch with string solver
Oct 14, 2016
1bfc264
removing useless z3 string tests
Oct 15, 2016
7ea360c
removed changes from the string solver branch that where unecessary
Oct 17, 2016
08d8b7a
removed changes from the string solver branch that where unecessary
Oct 17, 2016
f64c7ad
returning an error when the same variable is counted several time in …
Oct 17, 2016
f3e40fd
skipping delete test, for which our solver runs into the problem of h…
Oct 17, 2016
e474609
skipping a couple of tests for which we have the problem of a variabl…
Oct 17, 2016
e5e3dfb
skipping a couple of tests for which we have the problem of a variabl…
Oct 17, 2016
fd2898c
skipping a couple of tests for which we have the problem of a variabl…
Oct 17, 2016
fc4fadb
some experiment with the format function, not conclusive so far
Oct 18, 2016
404760d
restructuration using a constraint generator
Oct 18, 2016
36c3e60
restructuration using a constraint generator
Oct 18, 2016
9c7ee9b
restructuration using a constraint generator class
Oct 18, 2016
fa6eece
restructuration using a constraint generator class
Oct 19, 2016
103628f
corected problems after restructuration
Oct 19, 2016
b27b90d
repaired some type problems with methods of the code_point kind and c…
Oct 20, 2016
58d62ec
repaired an index problem with trim (case where length gets close to …
Oct 20, 2016
eeea178
repaired some type problems with integers
Oct 20, 2016
d8b2bfe
Merge branch 'string-solver-restructuration' into sat-strings
Oct 20, 2016
14e21c0
starting to use map for pass preprocessing
Oct 20, 2016
ab6ceee
starting to use map for pass preprocessing
Oct 20, 2016
219a603
starting to use map for pass preprocessing
Oct 20, 2016
659427d
using maps for pass preprocessing
Oct 20, 2016
97c2323
introducing a variable for temporary pointers
Oct 20, 2016
5f2cc79
pass preprocessing for functions returning pointers
Oct 23, 2016
51f7d84
pass preprocessing for toCharArray function, not complete but a simpl…
Oct 24, 2016
777be9e
pass preprocessing for toCharArray function, corrected type problems …
Oct 25, 2016
497e41d
corrected a mistake in the pass preprocessing, which was puting argum…
Oct 25, 2016
b6d7750
corrected the type problems for data access in toCharArray
Oct 25, 2016
fd6ecb6
regression test for toCharArray
Oct 25, 2016
dca43ef
regression test for toCharArray
Oct 25, 2016
e2904ba
corrected a problem with StringBuilder in goto programs
Oct 26, 2016
9fed105
trying to add ofCharArray function
Oct 26, 2016
25351e7
changing from malloc to new[] for the char array of string
Oct 27, 2016
18d0af2
Using new version of utf8 to utf16
Oct 27, 2016
4b1eed8
Using a new[] instead for the data part of array in toCharArray
Oct 27, 2016
e475213
simplification of some methods in PASS preprocessing
Oct 27, 2016
dec2cbd
correcting the constraint generation from the of_char_array function
Oct 28, 2016
4114064
tests for the of_char_array function
Oct 28, 2016
f951abb
string initialisation from char array with offset and count arguments
Oct 28, 2016
46fcfb4
string.valueOf for char arrays
Oct 28, 2016
abf01a9
corrected the goto program for String.valueOf for char arrays
Oct 31, 2016
32824e2
tests for String.valueOf
Oct 31, 2016
c2c33bf
setting String.copyValueOf to be the same than valueOf
Oct 31, 2016
88fcf74
adding the StringBuilder.insert(I[C) function
Oct 31, 2016
556de11
adding String.format to the goto program
Oct 31, 2016
51d0bc9
adding String.format to the goto program
Oct 31, 2016
24bbc4c
clearing a bit the make_to_char_array_function function in pass prepr…
Nov 1, 2016
894d502
cleaning pass preprocess functions of useless arguments
Nov 1, 2016
aaf2b89
cleaning the code from codes for functions that are not yet supported
Nov 1, 2016
3764761
cleaning the code from format functions which are not yet working
Nov 1, 2016
0aefe60
removing tests which are in the wrong directory
Nov 1, 2016
0c60215
unimportant spacing changes
Nov 11, 2016
e35d93a
small cleaning
romainbrenguier Nov 21, 2016
f36b5e2
Adapting regression test to the actual output of cbmc
romainbrenguier Dec 2, 2016
bb7ae0e
Changes to the push request as suggested by Michael
Nov 11, 2016
4119d1c
setting pass option necessary to select the right solver
Nov 11, 2016
3513290
Adapting regression test to CBMC ouput
romainbrenguier Dec 6, 2016
176b016
Merge branch 'string-solver-experiments' of github.com:romainbrenguie…
romainbrenguier Dec 6, 2016
b09b7a4
Merge remote-tracking branch 'origin/string-solver' into string-solve…
romainbrenguier Dec 6, 2016
fcde5b5
Merge remote-tracking branch 'diffblue/master' into string-solver-exp…
romainbrenguier Dec 8, 2016
0c5b1c8
Deleted trailing whitespaces
romainbrenguier Dec 8, 2016
54b6947
Renaming make_of_char_array... functions to make_char_array...
romainbrenguier Dec 12, 2016
ab4c970
Catching java.lang.String in string refinement
romainbrenguier Dec 12, 2016
f87e148
Renaming STRING_SOLVER CHAR_WIDTH symbols
romainbrenguier Dec 12, 2016
3921568
using from_integer instead of calls to integer2binary
romainbrenguier Dec 12, 2016
ed0f02c
Renamed forall and exists methods to with_forall and with_exists
romainbrenguier Dec 12, 2016
880812d
Renamed not_contains method to create_not_contains
romainbrenguier Dec 12, 2016
0f6409c
Changing the structure of string_constraintt
romainbrenguier Dec 12, 2016
1035bd2
Removed previously commented code
romainbrenguier Dec 12, 2016
b049bc9
Using from_integer for constant integer
romainbrenguier Dec 13, 2016
3c1daf0
Function to detect and set the language for string refinement
romainbrenguier Dec 13, 2016
91ebe61
Renaming functions of string constraint generator
romainbrenguier Dec 13, 2016
4c5d352
Using from_integer function from arith_tools.h
romainbrenguier Dec 13, 2016
9efef8f
Removing duplicate of has_prefix
romainbrenguier Dec 13, 2016
c81641a
Defining ids for string function in util/irep
romainbrenguier Dec 13, 2016
31b20a5
Replaced --pass option by --refine-string
romainbrenguier Dec 15, 2016
16e58db
Moved the pass* files to string_refine* and renamed classes
romainbrenguier Dec 15, 2016
d39d014
Using from_expr from langapi/language_util.h
romainbrenguier Dec 15, 2016
6b73f41
Use arith-tools.h functions to convert expressions to integer
romainbrenguier Dec 15, 2016
2ab3e49
Made integer_of_expr to correctly deal with negative numbers
romainbrenguier Dec 15, 2016
95d089d
Setting the default of integer_of_expr to 0
romainbrenguier Dec 15, 2016
2e7f98a
Cleaner version of extract_java_string
romainbrenguier Dec 16, 2016
582547d
Removed changes to remove_returns used for debuging
romainbrenguier Dec 16, 2016
d6d4627
Following coding guidelines in string preprocessing
romainbrenguier Dec 16, 2016
ffdef62
Adding more comments in refined_string_type and string_constraint
romainbrenguier Dec 20, 2016
2cd5def
Removed unecessary use of a variable length array
romainbrenguier Dec 20, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions regression/strings/cprover-string-hack.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ typedef unsigned char __CPROVER_char;
******************************************************************************/
extern __CPROVER_char __CPROVER_uninterpreted_string_char_at_func(__CPROVER_string str, int pos);
extern __CPROVER_bool __CPROVER_uninterpreted_string_equal_func(__CPROVER_string str1, __CPROVER_string str2);
extern __CPROVER_string __CPROVER_uninterpreted_string_literal_func();
extern __CPROVER_string __CPROVER_uninterpreted_string_literal_func(char * str);
extern __CPROVER_char __CPROVER_uninterpreted_char_literal_func();
extern __CPROVER_string __CPROVER_uninterpreted_string_concat_func(__CPROVER_string str1, __CPROVER_string str2);
extern int __CPROVER_uninterpreted_string_length_func(__CPROVER_string str);
Expand All @@ -68,5 +68,6 @@ extern int __CPROVER_uninterpreted_string_index_of_func(__CPROVER_string str, __
extern int __CPROVER_uninterpreted_string_last_index_of_func(__CPROVER_string str, __CPROVER_char c);
extern __CPROVER_string __CPROVER_uninterpreted_string_char_set_func(__CPROVER_string str, int pos, __CPROVER_char c);
extern __CPROVER_string __CPROVER_uninterpreted_string_copy_func(__CPROVER_string str);
extern unsigned __CPROVER_uninterpreted_string_parse_int_func(__CPROVER_string str);
extern __CPROVER_string __CPROVER_uninterpreted_string_of_int_func(unsigned i);
extern int __CPROVER_uninterpreted_string_parse_int_func(__CPROVER_string str);
extern __CPROVER_string __CPROVER_uninterpreted_string_of_int_func(int i);

2 changes: 1 addition & 1 deletion regression/strings/java_case/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_case.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_case.java line 11: SUCCESS$
Expand Down
9 changes: 9 additions & 0 deletions regression/strings/java_char_array/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
test_char_array.class
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_char_array.java line 11: SUCCESS$
^\[assertion.2\] assertion at file test_char_array.java line 12: SUCCESS$
^\[assertion.3\] assertion at file test_char_array.java line 13: FAILURE$
--
Binary file not shown.
15 changes: 15 additions & 0 deletions regression/strings/java_char_array/test_char_array.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
public class test_char_array {

public static void main(String[] argv)
{
String s = "abc";
char [] str = s.toCharArray();
int[] test = new int[312];
char c = str[2];
String t = argv[0];
char d = t.charAt(0);
assert(str.length == 3);
assert(c == 'c');
assert(c == d || d < 'a' || d > 'z' );
}
}
11 changes: 11 additions & 0 deletions regression/strings/java_char_array_init/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CORE
test_init.class
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_init.java line 16: SUCCESS$
^\[assertion.2\] assertion at file test_init.java line 17: SUCCESS$
^\[assertion.3\] assertion at file test_init.java line 18: SUCCESS$
^\[assertion.4\] assertion at file test_init.java line 20: SUCCESS$
^\[assertion.5\] assertion at file test_init.java line 21: FAILURE$
--
Binary file not shown.
23 changes: 23 additions & 0 deletions regression/strings/java_char_array_init/test_init.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
public class test_init {

public static void main(String[] argv)
{
char [] str = new char[10];
str[0] = 'H';
str[1] = 'e';
str[2] = 'l';
str[3] = 'l';
str[4] = 'o';
String s = new String(str);
String t = new String(str,1,2);

System.out.println(s);
System.out.println(s.length());
assert(s.startsWith("Hello"));
assert(s.length() == 10);
assert(t.equals("el"));
String u = String.valueOf(str,3,2);
assert(u.equals("lo"));
assert(s.equals("Hello") || !t.equals("el") || !u.equals("lo"));
}
}
2 changes: 1 addition & 1 deletion regression/strings/java_char_at/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_char_at.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_char_at.java line 11: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_code_point/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_code_point.class
--pass
--string-refine
^EXIT=0$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_code_point.java line 5: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_compare/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_compare.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_compare.java line 6: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_concat/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_concat.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_concat.java line 9: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_contains/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
KNOWNBUG
test_contains.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_contains.java line 7: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_delete/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
KNOWNBUG
test_delete.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_delete.java line 11: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_easychair/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
KNOWNBUG
easychair.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file easychair.java line 29: FAILURE$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_empty/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_empty.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_empty.java line 4: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_equal/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_equal.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_equal.java line 7: FAILURE$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_float/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_float.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_float.java line 14: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_index_of/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_index_of.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_index_of.java line 13: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_int/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_int.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_int.java line 8: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_prefix/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_prefix.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_prefix.java line 14: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_replace/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_replace.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_replace.java line 6: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_set_length/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_set_length.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_set_length.java line 8: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_string_builder/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_string_builder.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_string_builder.java line 11: SUCCESS$
Expand Down
8 changes: 8 additions & 0 deletions regression/strings/java_string_builder_insert/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
test_insert.class
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_insert.java line 17: SUCCESS$
^\[assertion.2\] assertion at file test_insert.java line 18: FAILURE$
--
Binary file not shown.
20 changes: 20 additions & 0 deletions regression/strings/java_string_builder_insert/test_insert.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
public class test_insert {

public static void main(String[] argv)
{
char [] str = new char[5];
str[0] = 'H';
str[1] = 'e';
str[2] = 'l';
str[3] = 'l';
str[4] = 'o';


StringBuilder sb = new StringBuilder(" world");
sb.insert(0,str);
String s = sb.toString();
System.out.println(s);
assert(s.equals("Hello world"));
assert(!s.equals("Hello world"));
}
}
2 changes: 1 addition & 1 deletion regression/strings/java_string_builder_length/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_sb_length.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
\[assertion.1\] assertion at file test_sb_length.java line 6: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_strlen/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_length.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_length.java line 10: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_substring/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_substring.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_substring.java line 12: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_suffix/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_suffix.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_suffix.java line 12: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/java_trim/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test_trim.class
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[assertion.1\] assertion at file test_trim.java line 5: SUCCESS$
Expand Down
4 changes: 2 additions & 2 deletions regression/strings/test1/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
int main()
{
__CPROVER_string s;
__CPROVER_char c1, c2;
char c1, c2;
int i;
int j;
i = 2;
s = __CPROVER_string_literal("pippo");
c1 = __CPROVER_char_at(s, i);
c2 = __CPROVER_char_literal("p");
c2 = 'p';
assert (c1 == c2);
assert (c1 != c2);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/test1/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test.c
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[main.assertion.1\] assertion c1 == c2: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/test2/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test.c
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[main.assertion.1\] assertion n == 5: SUCCESS$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/test3.1/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test.c
--pass
--string-refine
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/test3.2/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test.c
--pass
--string-refine
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/test3.3/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int main()
// proving the assertions individually seems to be much faster
//assert(__CPROVER_string_length(s) == i + 5);
//assert(__CPROVER_string_issuffix(__CPROVER_string_literal("po"), s));
assert(__CPROVER_char_at(s, i) == __CPROVER_char_literal("p"));
assert(__CPROVER_char_at(s, i) == 'p');

return 0;
}
2 changes: 1 addition & 1 deletion regression/strings/test3.3/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test.c
--pass
--string-refine
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/test3.4/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test.c
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
Expand Down
2 changes: 1 addition & 1 deletion regression/strings/test3/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int main()

assert(__CPROVER_string_length(s) == i + 5);
assert(__CPROVER_string_issuffix(__CPROVER_string_literal("po"),s));
assert(__CPROVER_char_at(s, i) == __CPROVER_char_literal("p"));
assert(__CPROVER_char_at(s, i) == 'p');
assert(__CPROVER_string_issuffix(__CPROVER_string_literal("p!o"), s));

return 0;
Expand Down
10 changes: 5 additions & 5 deletions regression/strings/test3/test.desc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
CORE
test.c
--pass
--string-refine
^EXIT=10$
^SIGNAL=0$
^\[main.assertion.1\] assertion __CPROVER_uninterpreted_string_length_func(s) == i + 5: SUCCESS$
^\[main.assertion.2\] assertion __CPROVER_uninterpreted_string_is_suffix_func(__CPROVER_uninterpreted_string_literal_func(\"po\"), s): SUCCESS$
^\[main.assertion.3\] assertion __CPROVER_uninterpreted_string_char_at_func(s, i) == __CPROVER_uninterpreted_char_literal_func(\"p\"): SUCCESS$
^\[main.assertion.4\] assertion __CPROVER_uninterpreted_string_is_suffix_func(__CPROVER_uninterpreted_string_literal_func(\"p!o\"), s): FAILURE$
^\[main.assertion.1\] assertion __CPROVER_string_length(s) == i + 5: SUCCESS$
^\[main.assertion.2\] assertion __CPROVER_string_issuffix(__CPROVER_string_literal(\"po\"),s): SUCCESS$
^\[main.assertion.3\] assertion __CPROVER_char_at(s, i) == .p.: SUCCESS$
^\[main.assertion.4\] assertion __CPROVER_string_issuffix(__CPROVER_string_literal(\"p!o\"), s): FAILURE$
--
2 changes: 1 addition & 1 deletion regression/strings/test4/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int main()
int j;
i = 2;
s = __CPROVER_string_literal("pippo");
if (__CPROVER_char_at(s, i) == __CPROVER_char_literal("p")) {
if (__CPROVER_char_at(s, i) == 'p') {
j = 1;
}
assert(j == 1);
Expand Down
Loading