Zmod + Memory prototyping branch #131
Draft
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 * R
For 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 addressb
would 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$a
into an array specified asmap (le_split 4) ?xs $@ a
: the variablexs
can be instantiated asmap le_combine (chunk 4 bs)
(but length divisibility by 4 is still needed for the two to be equal).