-
Notifications
You must be signed in to change notification settings - Fork 273
Extract string dependencies into its own files #4695
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
Extract string dependencies into its own files #4695
Conversation
2b709f6
to
2096197
Compare
15f36b6
to
2fdc6f3
Compare
rebased onto develop |
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: 15f36b6).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/112897202
Status will be re-evaluated on next push.
Common spurious failures include: 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); compatibility was already broken by an earlier merge.
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 2fdc6f3).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/112900910
|
||
#include "string_builtin_function.h" | ||
#include "string_constraint.h" | ||
#include "string_constraint_generator.h" |
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 think this include is not necessary if you forward declare string_constraint_generatort
#include <memory> | ||
|
||
#include "string_builtin_function.h" | ||
#include "string_constraint.h" |
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 don't think this include is used
@@ -31,6 +31,7 @@ Author: Alberto Griggio, [email protected] | |||
|
|||
#include "equation_symbol_mapping.h" | |||
#include "string_constraint_instantiation.h" | |||
#include "string_dependencies.h" |
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 already included in the header file so it's not needed here.
return *node.data; | ||
} | ||
|
||
static void for_each_atomic_string( |
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.
❓ Is this function related only to dependencies?
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.
Probably not, but it's not used anywhere else yet.
|
||
/// Keep track of dependencies between strings. | ||
/// Each string points to the builtin_function calls on which it depends. | ||
/// Each builtin_function points to the strings on which the result depends. |
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 think this documentation should answer the question "What do we mean by dependency
and how do we use dependencies?". An example, or reference to markdown files about the string solver with examples, would be helpful here. I don't know much about the string solver so I'm mostly guessing what any of this might mean. 🙂
#include <iostream> | ||
#include <numeric> | ||
#include <unordered_set> | ||
#include <util/arith_tools.h> |
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've seen empty lines in other files between STL includes and includes of files from the same project. The coding standard doesn't say anything about this other than the first dependency being the header file for this .cpp file though...
⚒️ It looks like the only necessary includes here are
#include "string_dependencies.h"
#include <unordered_set>
#include <util/expr_iterator.h>
#include <util/graph.h>
#include <util/make_unique.h>
#include <util/ssa_expr.h>
@@ -27,6 +27,7 @@ Author: Alberto Griggio, [email protected] | |||
|
|||
#include "string_constraint.h" | |||
#include "string_constraint_generator.h" | |||
#include "string_dependencies.h" |
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.
⛏️ Could forward declare string_dependenciest
instead of including this file.
2fdc6f3
to
9e0b64f
Compare
@antlechner @romainbrenguier I cleaned up the imports. |
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 9e0b64f).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/113098867
|
||
\*******************************************************************/ | ||
|
||
#ifndef CPROVER_SOLVERS_STRINGS_STRING_DEPENDENCIES_H |
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.
doxygen \file
is missing.
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.
@peterschrammel Is that really useful? The class is already documented.
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 would only repeat the description.
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.
@allredj, please check whether it generates an entry next to the file here: http://cprover.diffblue.com/files.html
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.
Indeed there's no description on the file view. I added a file documentation for this file.
9e0b64f
to
9b48bc5
Compare
9b48bc5
to
b2bdda5
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: b2bdda5).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/113725627
Based on #4692.
Only review last 2 commits.