Draft
Conversation
| Local Coercion Z.of_nat : nat >-> Z. | ||
| Local Infix "$+" := map.putmany (at level 70). | ||
|
|
||
| Context {width : Z} {word : Word.Interface.word width} {word_ok : word.ok word}. |
Contributor
There was a problem hiding this comment.
Now that we have the way of implementing words with Zmod, do we still need to abstract all files over the word implementation and ok proofs?
Contributor
Author
There was a problem hiding this comment.
Yes, this branch is for experimentation like this.
204f76e to
388d05c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is on top of rocq-prover/stdlib@499c6e5 or later; should work if that's placed in sibling directory and built with
dune build -p rocq-stdlib.However, as of right now the later commits do not actually depend on Zmod and could be cherry-picked to work with earlier stdlib.(done)For building up the hierarchy of C-style memory representations, I think the next to add are
m =* (le_split 4 x ++ le_split 4 y) $@ a * R, or the ethernet-packet spec in garagedoor paper.m =* flat_map (le_split 4) xs $@ a * RFor reasoning about these constructs, I think of lemmas as falling into two categories based on whether their unification-driving arguments (universally quantified variables) reference specification variables or implementation variables. With specification variables for structs, we have e.g.
(xs ++ ys)$@a <--> xs$@a * ys$@(a+length xs)and the specialization of that forys=y::ys'. On the other hand, a program indexing into that array with as-byte load at addressbwould naively getfirstn s (skipn (b-a) (xs ++ ys)). The latter is a mouthful, but it can be simplified with lemmas for firstn of++and so on. A similar consideration appears for arrays when casting uninitialized memorybs$ainto an array specified asmap (le_split 4) ?xs $@ a: the variablexscan be instantiated asmap le_combine (chunk 4 bs)(but length divisibility by 4 is still needed for the two to be equal).