Skip to content

Add stub for new goto-harness tool [depends-on: #3920] #3875

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

Conversation

hannes-steffenhagen-diffblue
Copy link
Contributor

@hannes-steffenhagen-diffblue hannes-steffenhagen-diffblue commented Jan 21, 2019

This adds a new executable called goto-harness. Right now it doesn't actually do anything, but ultimately its purpose will be to generate "harness" functions for goto-programs - i.e. given some specification, it'll generate a function suitable as a cbmc entry point function that implements that specification.

Planned for now are two types of harnesses:

One that takes the name of a function with parameters and then generates a function that sets up these parameters and calls the function with them. This is similar to what cbmc does already, however will allow more flexibility in choosing how exactly these parameters will be initialised which was deemed out of scope for cbmc.

The other will be able to take a snapshot of a concrete execution of a program, and then start an analysis from that point.

This PR should serve as a common start point for both of these pieces of work. It's marked as Work In Progress for now as we've not settled on a sensible command line interface; The problem being that different harness generators have mostly completely different sets of options, with only a handful of common options.

  • 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.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

  1. Please copy some of the description into the commit message.
  2. It would likely be good to include a regression test directory (without any actual tests just yet, just the makefiles) in the initial commit as well.

With those we'd in fact have a very nice commit to serve as template for further tools to be created.

src/Makefile Outdated
@@ -27,6 +28,7 @@ all: cbmc.dir \
goto-cc.dir \
goto-diff.dir \
goto-instrument.dir \
goto-harness.dir \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wrong indent or tabs vs spaces issue.

<< banner_string("Goto-Harness", CBMC_VERSION) << '\n'
<< align_center_with_border("Copyright (C) 2019") << '\n'
<< align_center_with_border("Diffblue Ltd.") << '\n'
<< align_center_with_border("[email protected]")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should likely have this align_center_with_border code for everyone...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@sonodtt sonodtt left a comment

Choose a reason for hiding this comment

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

Looks good! Once again, many thanks for the introduction you give. Awesome.

Very interesting the codesign section of the makefile :)

@hannes-steffenhagen-diffblue hannes-steffenhagen-diffblue changed the title Add stub for new goto-harness tool Add stub for new goto-harness tool [depends-on: #3920] Jan 24, 2019
Copy link
Contributor

@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: ff0da3a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98638933
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).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

@hannes-steffenhagen-diffblue
Copy link
Contributor Author

test-gain failures are non-transient (i.e. not going to magically disappear with a force push) but unrelated to this PR

This adds a new executable called goto-harness. Right now it doesn't actually do
anything, but ultimately its purpose will be to generate "harness" functions for
goto-programs - i.e. given some specification, it'll generate a function
suitable as a cbmc entry point function that implements that specification.

Planned for now are two types of harnesses: One that takes the name of a
function with parameters and then generates a function that sets up these
parameters and calls the function with them. This is similar to what cbmc does
already, however will allow more flexibility in choosing how exactly these
parameters will be initialised which was deemed out of scope for cbmc. The other
will be able to take a snapshot of a concrete execution of a program, and then
start an analysis from that point.
Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Repeating my earlier wishlist request: please also add a regression test folder and quite possibly a first regression test, simply running --version (and testing the exit code). That will make this commit a very nice template for future tools.

Copy link
Contributor

@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: a07b2cb).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98650165
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).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

@hannes-steffenhagen-diffblue
Copy link
Contributor Author

hannes-steffenhagen-diffblue commented Jan 25, 2019

@tautschnig Ah sorry, forgot about that! Yeah that makes sense, I've added this now! (I also checked that the regression test is indeed executed - do you know if there is a good way to ensure this mechanically? The only method I know is deliberately failing a test; Accidentally adding adding tests without making sure they are actually being run has been a problem in the past)

EDIT I forgot to do the makefile version of the regression, adding that now

Copy link
Contributor

@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: 9459b30).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98652328
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).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

This merely shows that the goto-harness executable was built (and indeed
executable)
Copy link
Contributor

@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: 30cb51c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98652084
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).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

Copy link
Contributor

@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: 4064bc7).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98656522
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).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

Copy link
Contributor

@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: 7a8d3a8).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98658100
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).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants