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

Package invariants #810

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open

Package invariants #810

wants to merge 51 commits into from

Conversation

jcp19
Copy link
Contributor

@jcp19 jcp19 commented Dec 17, 2024

Changelog:

  • we introduce the notion of package invariants to describe the contents of global state (we distinguish between non-duplicable and duplicable invariants - more details to follow soon). We introduce the statement openDupPkgInv to open the duplicable invariants of the current package if initialization is guaranteed to be finished, and we introduce all necessary proof obligations for the init functions and main function.
  • we introduce a notion of a friendPkg, i.e., a package to which we may send resources after initialization is finished. These resources are made available as a precondition to the initializer of the selected package (no other package may access these resources). Due to some challenges with resolving paths to imported packages in imported packages, this feature is still heavily configuration dependent and may break easily, and thus, it is still experimental (I opened an issue to keep track of its evolution - Stabilize support for friend clauses #830)
  • we introduce the notion of functions that may be called during initialization (marked with mayInit) to make sure we never open invariants that might not hold yet - more details on this soon
  • we deprecate initEnsures clauses to allow for modularly checking a package. We also deprecate the --lazyImports flag, as it is no longer necessary: If the package under verification does not declare any package invariants nor initRequires clauses, then nothing is checked for that package. Because our methodology is now modular, we do not have to re-check initialization of all imported packages.
  • we make the Desugarer sequential again to fix the regression reported in Regression same_package/import-fail01/main fails non-deterministically #762

Minor TODOs:

  • protect the use of friend clauses under a feature flag --enableFriendClauses
  • add more tests

@jcp19 jcp19 mentioned this pull request Dec 17, 2024
@jcp19 jcp19 changed the title Package invariants [WIP] Package invariants Dec 17, 2024
@jcp19 jcp19 linked an issue Jan 6, 2025 that may be closed by this pull request
@jcp19 jcp19 linked an issue Jan 19, 2025 that may be closed by this pull request
@jcp19 jcp19 changed the title [WIP] Package invariants Package invariants Jan 30, 2025
@jcp19 jcp19 marked this pull request as ready for review January 30, 2025 18:19
@jcp19 jcp19 requested a review from ArquintL January 31, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant