-
Notifications
You must be signed in to change notification settings - Fork 126
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
Reformulate evaluation semantics #866
Conversation
One thing I notice about this semantics pretty quickly is that it is too strict in the sequence rearranging operations (split, join, transpose, etc.) E.g., the reference semantics is now also too strict on the examples from #640. These should probably all be reorganized as "reindexing" operations, such that the spine of the value returned depends only on the types, and individual values in the returned value force their inputs only when required. This basically does the eta-expansion steps that used to be pervasive locally instead. |
Some other strictness questions that arise: how strict should field, tuple and sequence updating be in the structure being updated? How strict should |
I took the liberty of pushing a commit to fix the typos I found. |
Regarding the strictness of record updates: it seems like this currently works in the main interpreter, so the reference semantics should make it work too:
|
I'm getting an "unused imports" compiler warning:
|
Concerning questions about strictness: My general opinion is that those choices often don't really matter much to Cryptol programmers, who are unlikely to bump into those corner cases. So we should just define the semantics for things in such a way that they're easy/natural to implement. |
Cryptol programmers end up writing recursive sequences quite a lot of different ways, in my experience, and they mostly expect them to work. I guess it would just feel a little weird if records didn't behave the same. E.g., currently all the following work both with the standard evaluator and this version of the reference evaluator and return
|
While we're editing this file, it might be nice to do a bit of formatting to keep the code within 80 columns or so; right now there are some rather wide bits of code that shoot off the right side of the page in the generated pdf. (It looks like the right-margin of the text in the pdf lines up with about column 84 of the code blocks.) |
2006c22
to
576114c
Compare
It compiles and passes the few tests we currenlty have for it, but quite a bit more testing needs to be done to see what the results are and if they are what was expected.
lazier in the sequence structure.
This makes it easier to do eta-expansion in the right places. Also, various tweaks and simplifications to the reference interpreter.
576114c
to
04bd633
Compare
This updates cryptol-saw-core to work with commit GaloisInc/cryptol@0000ffbef6, adapting to PRs GaloisInc/cryptol#866 and GaloisInc/cryptol#867.
Initially, rewrite the reference interpreter to match the new Moggi-style monadic semantics we've been discussing for some time, which does away with the expensive and error-prone eta-expansion phases. Later, once we're convinced we have the semantics we want, rework the main evaluation infrastructure to match.