Skip to content
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

Backtranslation of contracts with handling of "modifies" clause #687

Merged
merged 7 commits into from
Oct 17, 2024

Conversation

maul-esel
Copy link
Contributor

This PR changes the backtranslation of procedure contracts.

  • When backtranslating contracts from Boogie (which has modifies clauses to encode frame conditions) to C/ACSL (where our contracts currently do not have modifies or other features for frame conditions), we add conjuncts of the form x == \old(x) for variables that are not modifiable by the procedure.
  • To support this, we add a specialized method for contract backtranslation to the ITranslator interface.

During backtranslation of contracts from Boogie to C we must encode
the Boogie procedure's "modifies" clause into the C function's contract.
To do so properly, we need a specialized backtranslation of contracts.
- do not generate equalities for type declarations
- do not crash if variable cannot be backtranslated
  but output a backtranslation warning
Copy link
Contributor

@schuessf schuessf 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, just a few questions and comments

@maul-esel maul-esel merged commit 7b98158 into dev Oct 17, 2024
2 checks passed
@maul-esel maul-esel deleted the wip/dk/contract-modifies branch October 17, 2024 09:19
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.

2 participants