Skip to content

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

Merged

Conversation

allredj
Copy link
Contributor

@allredj allredj commented May 22, 2019

Based on #4692.
Only review last 2 commits.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@allredj allredj force-pushed the clean-up/extract-string-dependencies branch from 2b709f6 to 2096197 Compare May 22, 2019 16:13
@allredj allredj requested a review from antlechner May 22, 2019 16:21
@allredj allredj force-pushed the clean-up/extract-string-dependencies branch 3 times, most recently from 15f36b6 to 2fdc6f3 Compare May 23, 2019 08:50
@allredj
Copy link
Contributor Author

allredj commented May 23, 2019

rebased onto develop

Copy link
Contributor Author

@allredj allredj left a 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.

Copy link
Contributor Author

@allredj allredj left a 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"
Copy link
Contributor

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"
Copy link
Contributor

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"
Copy link
Contributor

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(
Copy link
Contributor

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?

Copy link
Contributor Author

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.
Copy link
Contributor

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>
Copy link
Contributor

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"
Copy link
Contributor

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.

@allredj allredj force-pushed the clean-up/extract-string-dependencies branch from 2fdc6f3 to 9e0b64f Compare May 24, 2019 12:44
@allredj
Copy link
Contributor Author

allredj commented May 24, 2019

@antlechner @romainbrenguier I cleaned up the imports.

Copy link
Contributor Author

@allredj allredj left a 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doxygen \file is missing.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

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.

@allredj allredj force-pushed the clean-up/extract-string-dependencies branch from 9e0b64f to 9b48bc5 Compare May 28, 2019 16:00
@tautschnig
Copy link
Collaborator

@allredj Please rebase now that #4729 is in to make CI happy.

@allredj allredj force-pushed the clean-up/extract-string-dependencies branch from 9b48bc5 to b2bdda5 Compare May 30, 2019 08:16
Copy link
Contributor Author

@allredj allredj left a 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

@allredj allredj merged commit 3f9d063 into diffblue:develop May 30, 2019
@allredj allredj deleted the clean-up/extract-string-dependencies branch May 30, 2019 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants