Skip to content

Show abstract states in program source code #3215

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
merged 2 commits into from
Nov 18, 2018
Merged

Conversation

kroening
Copy link
Member

@kroening kroening commented Oct 21, 2018

  • 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.
  • 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).
  • n/a 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
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.

Passed Diffblue compatibility checks (cbmc commit: 7258f15).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88660117

@kroening kroening force-pushed the show-ai-on-source branch 2 times, most recently from d8faf32 to 77e7459 Compare October 23, 2018 09:04
@kroening kroening assigned tautschnig and unassigned kroening Oct 23, 2018
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: 77e7459).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88822020
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.

Passed Diffblue compatibility checks (cbmc commit: 70269f5).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88836441

@tautschnig tautschnig assigned kroening and unassigned tautschnig Oct 24, 2018
@kroening kroening removed their assignment Oct 24, 2018
@kroening
Copy link
Member Author

Both done!

@@ -626,7 +627,18 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)

if(options.get_bool_option("show"))
{
static_show_domain(goto_model, *analyzer, options, out);
if(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I would prefer a new option for output "text-on-source" or something like that and have show_on_source just called for that. That way we maintain backwards compatibility.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, it's now --show-on-source.

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

@kroening kroening force-pushed the show-ai-on-source branch 3 times, most recently from 05a5c0c to d5d204e Compare November 8, 2018 15:14
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.

⚠️
Diffblue compatibility check is currently unavailable.
Please create manual bump.
(cbmc commit: d5d204e).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90749109

@kroening kroening assigned martin-cs and unassigned kroening Nov 8, 2018
@@ -800,7 +811,8 @@ void goto_analyzer_parse_optionst::help()
" goto-analyzer file.c ... source file names\n"
"\n"
"Task options:\n"
" --show display the abstract domains\n"
" --show display the abstract states on the goto program\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
" --show display the abstract states on the goto program\n"
// NOLINTNEXTLINE(whitespace/line_length)
" --show display the abstract states on the goto program\n"

The abstract states are shown in a different color on the source code text
of the program, as opposed to the goto-program dump.  Indentation of the
output of the abstract is made to match the indentation of the source code.
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.

⚠️
Diffblue compatibility check is currently unavailable.
Please create manual bump.
(cbmc commit: 5dd3760).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90819223

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.

✔️
Passed Diffblue compatibility checks (cbmc commit: 3658167).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90955098

Copy link
Contributor

@chrisr-diffblue chrisr-diffblue 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, and a nice feature.

{
const auto abstract_state = ai.abstract_state_before(loc);
if(abstract_state->is_top())
return {};
Copy link
Collaborator

@martin-cs martin-cs Nov 16, 2018

Choose a reason for hiding this comment

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

This doesn't match the name of the function or the documentation; why should the file name depend on the domain?

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

I'm happy with the way this is implemented. I'm ... undecided on the change in the usage model. My understanding is that the usage model of CPROVER has been very much pipeline : you need the source to create the goto-program but after that you don't need it any more. This then loops back around and changes the relationship between analysis results and code. This is not a bad thing but it is a change of abstraction / architecture. If we are going to go this way (and I am not for or against doing so at this stage) then we should probably think about the consequences / necessary architectural changes. For example, do we need to store / be able to do byte-exact reconstruction of source from goto-programs?

So, I think the answer is merge this and if we find that we're adding lots more features, think about changing the architecture.

@kroening
Copy link
Member Author

Yes, we do want pipeline! However, note that "view abstract fixedpoint on source code" is still very much a feature aimed at developers of analysis tools, as opposed to users, so if this gets broken by some transformation it's not a big deal. You'll then have to view using the goto-program, which is what we currently do.

@kroening kroening merged commit 6747d24 into develop Nov 18, 2018
@kroening kroening deleted the show-ai-on-source branch November 18, 2018 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants