Skip to content

add a 'language feature' facility for goto programs #7695

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

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

kroening
Copy link
Member

@kroening kroening commented May 1, 2023

This adds a facility to track the language features used by a goto program. The features are stored in the value of a symbol in the symbol table part of a goto model. The default, when not specificd, is true, i.e., we conservatively assume that the feature might be in use unless we know otherwise.

Checks for three language features not supported by goto symex are added (assembler, function pointers, vectors).

  • 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.
  • n/a 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).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@kroening kroening force-pushed the language-features branch 3 times, most recently from f9b7c9d to 4b351cc Compare May 1, 2023 21:14
This adds a facility to track the language features used by a goto program.
The features are stored in the value of a symbol in the symbol table part of
a goto model.  The default, when not specificd, is 'true', i.e., we
conservatively assume that the feature might be in use unless we know
otherwise.

Checks for three language features not supported by goto symex are added
(assembler, function pointers, vectors).
@kroening kroening force-pushed the language-features branch from 4b351cc to e4f28ec Compare May 1, 2023 21:49
@remi-delmas-3000
Copy link
Collaborator

Hi Daniel,
would it be possible to also add a function that traverses the instructions of the GOTO functions and reports the presence/absence of the language features ? We could use this in DEBUG builds to check that the manually set flags match the goto model's contents. In release builds we just trust the tags.

@NlightNFotis
Copy link
Contributor

Hello, we (@diffblue/diffblue-opensource) had a meeting to discuss the PR today, and while we're generally happy with the approach that is being taken, there are a few items that we would appreciate some clarity on:

  1. This PR appears to be adding some of the language features, but seems to be missing others (say, language features transformed/eliminated by remove_returns, adjust_float_expressions, etc). Are there plans for these to be supported as part of this PR or perhaps a follow up PR?

  2. This PR appears to be adding the infrastructure for setting language feature flags and seems to be unsetting those after the corresponding transformations have run, but we can't find where they are being set.

    We are assuming that these are going to be set in the various frontends (which will come around a bit later during this PR or in a follow up). Is our assumption correct?

  3. We understand that one of the future aims for CBMC is to support analysis models that come from various different front-ends in the future.

    We believe that if CBMC is to work with multi-source-language models in the future, it will need to support knowledge of what language features are present on a per-function basis (because on a multi-source-language model, different front-ends might have applied different transformations to the models they produced, and thus, different functions might have different language features present).

    Is there some mechanism that would facilitate that, and if not, would it make sense to consider it early so that it doesn't pose significant challenges later?

  4. One of the problems we were hoping to solve with our original proposed solution was the issue of multiple instrumentations being run on the same model, causing problems with multiple assertions being present in the model and reporting of results after analysis.

    This approach seems to be adding support for language features, but no mechanism to track instrumentations done. Would it be safe to assume that the same mechanism can be used to track instrumentations?

    If yes, would it make sense to keep the instrumentation symbols in the same list, or perhaps a different one?

    If not, what would be a proposed mechanism that would solve the multiple instrumentations issue.

@TGWDB
Copy link
Contributor

TGWDB commented May 30, 2023

Note that should/when #7736 is merged we should also assume that vectors cannot appear in symex-ready-goto.

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.

4 participants