hax icon indicating copy to clipboard operation
hax copied to clipboard

How to distribute proofs with Rust code?

Open W95Psp opened this issue 1 year ago • 1 comments

  • Extrinsic proofs:
    • the assumption here is that in an extrinsic proof model, extractions always typechecks because the program is always wrapped into a monad of exception
    • separate files can provide lemma about extracted functions
  • Intrinsic proofs: (the path we're currently taking with the F* backend)
    • programs are extracted as such, and type checking implies panic freedom (at least)
    • we thus sometimes need annotations:
      • pre/postcondition
      • strong types enforcing properties (see #431)
      • calls to lemmas
      • assertions
      • insert backend-specific code
      • modify backend-generated code
    • question: how do we store those proofs?

W95Psp avatar Jan 15 '24 08:01 W95Psp

Is proof generation a deterministic/reproducible process? If so, maybe it would make sense to only store cryptographic hashes of the resulting proofs?

ROMemories avatar Apr 11 '24 08:04 ROMemories

This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.

github-actions[bot] avatar Sep 25 '24 02:09 github-actions[bot]

@ROMemories, I missed your comment here, sorry. We previously had hand-edited F* extractions, at some point. Thus, we needed to keep the generated code.

But now, we have many more ways of annotating Rust directly, and we no longer need (or want!) hand-edited code. So indeed, we don't actually need to store generated code. A locked version of Rust, its dependencies and of hax should always produce the same extraction, that's (or should be!) a deterministic process. Thus I don't think we even need a hash of the extraction.

I'm closing this issue: we are figuring out this progressively whenever we work on a new project, and I think we converge to putting all annotations in Rust. (wdyt @franziskuskiefer? feel free to reopen if you think this issue is valuable)

W95Psp avatar Sep 30 '24 06:09 W95Psp

A locked version of Rust, its dependencies and of hax should always produce the same extraction, that's (or should be!) a deterministic process.

I think we converge to putting all annotations in Rust.

Awesome, thanks for the answer!

ROMemories avatar Sep 30 '24 07:09 ROMemories