-
Notifications
You must be signed in to change notification settings - Fork 274
Implement model for String.equals #2588
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
Implement model for String.equals #2588
Conversation
4e8ab5d
to
2ba1c31
Compare
Pointer update to: diffblue/java-models-library#7 |
I am a nominated reviewer, but I'd hope for @romainbrenguier and @cesaro to weigh in/approve. |
2ba1c31
to
759e25c
Compare
c333e35
to
6a07c37
Compare
@@ -1,5 +1,5 @@ | |||
public class test | |||
{ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably an involuntary change
6a07c37
to
c37762f
Compare
e0a5597
to
444c186
Compare
compute_inverse_function(stream, axiom.univ_var, val, index); | ||
implies_exprt instance( | ||
compute_inverse_function(axiom.univ_var, val, index); | ||
exprt instance = implies_exprt( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this change
@@ -63,6 +63,14 @@ public static StringBuilder deleteCharAt(StringBuilder sb, int index) { | |||
return sb.deleteCharAt(index); | |||
} | |||
|
|||
public static boolean equals(String a, String b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here in the regression folder? We are loading models library so I thought the method is implemented there now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🦅
|
||
if(width==0) | ||
return conversion_failed(expr); | ||
if(operands.empty() && width == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this been investigated?
exprt::operandst conjuncts; | ||
for(const auto &index : indexes) | ||
for(const auto &index : find_indexes(axiom.body, str, axiom.univ_var)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I understood this correctly but if there is more than one index via which we access str
, all of them would get replaced with the same new index var
which is not correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are several indexes then we get the conjunction of the replacement.
For instance for a formula forall q. s[q+x]='a' && s[q]=c
we would get s[v] = 'a' && s[v-x] = c && s[v+x] = 'a' && s[v] = c
.
I will add this example to the doxygen.
29bbb88
to
7a8e8cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 7a8e8cb).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85036174
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
7a8e8cb
to
1f00403
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 1f00403).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85385375
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
1f00403
to
365d8ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 365d8ca).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85407757
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
408cba9
to
a5cce05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 408cba9).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86245748
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: a5cce05).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86248971
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: fa07dc7).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86257728
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
af56a9b
to
9f3d360
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 9f3d360).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86437726
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
Includes a pointer update to the definition change in the java-models-library submodule.
String.equals currently handled by CBMC, this removes support within CBMC so that String.equals will be handled by a model instead. CProverString.equals is provided by JBMC instead of String.equals.
The thing we warn about is not an error in itself and it's unlikely the user will understand what this talks about.
The fact that the array is always accessed at the same index, is not a necessary condition for the correctness of the instantiate function.
9f3d360
to
87bd027
Compare
submodule update now pointing to master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 87bd027).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86492208
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
String.equals currently handled by CBMC, this removes support
within CBMC so that String.equals will be handled by a model instead.
Includes a pointer update to the definition change in the
java-models-library submodule.