-
Notifications
You must be signed in to change notification settings - Fork 273
[TG-2608] Use string dependencies to reduce the number of constraints #1947
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
Merged
romainbrenguier
merged 28 commits into
diffblue:develop
from
romainbrenguier:dependency-graph/stop-adding-unecessary-constraints#TG-2608
Mar 26, 2018
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
54a4d7d
Add class for builtin function with no eval
romainbrenguier c26b83d
Constructor for builtin function with no eval
romainbrenguier 408adbe
never return nullptr in to_string_builtin_function
romainbrenguier 2e7057a
Remove use of unknown_dependency
romainbrenguier 82f552c
Add and add_constraint method to builtin functions
romainbrenguier b8df2b3
Initialize return_code for all builtin_functions
romainbrenguier 8a7d194
add_constraints method in string_dependencies
romainbrenguier 41c0294
Add constraints from the string dependencies
romainbrenguier 97ee2d6
Store builtin function pointer inside builtin node
romainbrenguier 6609247
Add a maybe_testing_function to builtin functions
romainbrenguier 46d2507
Add move constructors to builtin_function_nodet
romainbrenguier c487c4b
Generic get_reachable function
romainbrenguier 23f8cd4
Correct name of builtin function with no eval
romainbrenguier 3c61cf2
Add a hash function for nodes
romainbrenguier 4b342f7
Only add constraints on test function dependencies
romainbrenguier be5f194
Add double quotes to output_dot
romainbrenguier 2655a9b
Rewrite axioms for insert
romainbrenguier e3da98c
Deactivating invariant
romainbrenguier a45c64f
Add tests for the use of string dependencies
romainbrenguier c3aed85
Define two helper functions for for_each_successor
romainbrenguier 8a98246
Adapt unit tests for the new interface
romainbrenguier 8684e6d
Helper functions for length constraints on strings
romainbrenguier 61b3910
Add length_constraint method to builtin functions
romainbrenguier 805f45f
Correct add_constraints in string_dependencies
romainbrenguier 0bb2fad
Define a for_each_atomic_string helper function
romainbrenguier 367ca13
Ensure all atomic strings in arguments have node
romainbrenguier 50cfe34
Clear constraints at each call to dec_solve
romainbrenguier 60bfbd0
Reduce string-max-length on String.equals test
romainbrenguier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class Test { | ||
void test(String s) { | ||
// Filter | ||
if(s == null) | ||
return; | ||
|
||
// Act | ||
|
||
// this matters for the final test | ||
String t = s.concat("_foo"); | ||
|
||
// these should be ignored by the solver as they | ||
// do not matter for the final test | ||
String u = s.concat("_bar"); | ||
String v = s.concat("_baz"); | ||
String w = s.concat("_fiz"); | ||
String x = s.concat("_buz"); | ||
|
||
// Assert | ||
assert t.endsWith("foo"); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CORE | ||
Test.class | ||
--refine-strings --string-max-length 1000 --string-max-input-length 100 --verbosity 10 Test.class --function Test.test | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
assertion at file Test.java line 20 .*: SUCCESS | ||
string_refinement::check_axioms: 3 universal axioms | ||
-- | ||
-- | ||
We check there are exactly 3 universal formulas considered by the solver (2 for | ||
`t = s.concat("_foo")` and 1 for `t.endsWith("foo")`). | ||
The other concatenations should be ignored. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
maybe
and notis
?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.
For the functions that don't have yet a dedicated builtin_function class we consider that could be testing function although we don't actually know. Ultimately this can be replaced by a
is