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

Update Heapster, Monadification, and MRSolver to handle high-order SpecM functions #2017

Merged
merged 316 commits into from
Feb 9, 2024

Conversation

m-yac
Copy link
Contributor

@m-yac m-yac commented Jan 24, 2024

This PR makes changes to Heapster, Cryptol Monadification, and MRSolver to support higher-order SpecM functions. In particular, this brings things into parity with the update to the Coq definition of the SpecM monad which allows such functions to be defined in a sound way (the untyped-ho-calls branch of entree-specs, I believe - @eddywestbrook is that right?).

Outside of the technical details of Heapster, Monadification, and MRSolver, this PR:

  • Moves the Heapster SpecM definitions from Prelude.sawcore into their own file, SpecM.sawcore, which is also included by default like the Prelude
  • Adds an example to heaspter-saw/examples which verifies that the top-level interface of the dilithium reference implementation satisfies a Cryptol spec using MRSolver

Eddy Westbrook added 30 commits August 24, 2023 07:38
…rsive shapes and permissions to use exprCtxPureTypeTerms for the arguments, to match their definitions
… and pis when they are type-checked, in order to make the Coq translation work in cases where these argument types have identifiers that translate to alternate Coq definitions
… information is in a reader effect and not a state effect, making it clearer where in the translator code variables are bound; also fixed #1927
… directly translates an LLVM zero initializer to a Heapster permission + SAW core term, so that we use repeatBVVec in the SAW term rather than a giant vector literal
…ainst emptyBitSet with the new termIsClosed function
Eddy Westbrook added 24 commits February 2, 2024 17:05
…e unsafeAssert Coq tactic is currently defined *after* the translation to Coq of the Prelude
… in SpecM.v instead of automatically generated
…the other way around, so that it can use the generated Num operations like tcAdd and tcMul
…e_llvmshape to make sure the user-supplied type and type description match
@eddywestbrook
Copy link
Contributor

@RyanGlScott Could you please re-review this? Or are there still things you think I should address?

Copy link
Contributor

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

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

Thanks, @eddywestbrook. Two minor comments, but otherwise this LGTM.

heapster-saw/examples/_CoqProject Show resolved Hide resolved
@@ -4,12 +4,14 @@ env <- heapster_init_env_from_file "clearbufs.sawcore" "clearbufs.bc";
// Integer types
heapster_define_perm env "int64" " " "llvmptr 64" "exists x:bv 64.eq(llvmword(x))";

// FIXME: get reachability perms working again!
Copy link
Contributor

Choose a reason for hiding this comment

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

This sort of thing would also be worth mentioning in an issue about re-enabling Heapster tests (should you choose to file one), along with the other FIXMEs in the heapster-saw/examples subdirectory.

@eddywestbrook eddywestbrook merged commit 2a3ca89 into master Feb 9, 2024
38 checks passed
@mergify mergify bot deleted the heapster/higher-order-no-stack branch February 9, 2024 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subsystem: heapster Issues specifically related to memory verification using Heapster subsystem: MRSolver Issues related to the Mr. Solver monadic-recursive solver in Heapster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants