-
Notifications
You must be signed in to change notification settings - Fork 52
New lazy/eager logic. #787
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
base: main
Are you sure you want to change the base?
Conversation
40e84c7
to
3b74196
Compare
I have no idea how that one stuck goal (in the CI) in the examples is related to this PR. The fix is trivial however, and just requires providing the SMT more information. |
This kind of SMT calls are very fragile. Restarting the CI without any change could have fixed it. |
This logic is deliberately slightly less expressive than the one it replaces, which does not hinder usability in any cryptographic context, with the hope that it is simpler to maintain and verify.
bea7f9c
to
c3c25b6
Compare
The old
Maybe you are trying to insist that the statements being swapped are identical? But you allowed them to be different except when I moved to an abstract procedure. |
One unpleasant workaround for this example, is to have Or2 use the variables of Or1, and prove instead
(so it's Or1.incr_x that is being swapped). Since the tracing is discarded at the end, this works. This is akin to how FRO and RRO are used in PROM, where it's RRO.resample() that is being swapped over FRO -> RRO. But I find the existing flexibility attractive. |
The new logic indeed insists on using the same swapping statement on both sides. It's true that the syntax of We made the choice to restrict to a single swapping statement after noticing that it would not cause any problem in the real uses of |
OK, I see. I'll be sad to see the opportunity to have different swapping statements go away, as I think it's more elegant. Unless I'm missing something, the new logic forces a style where the procedures of the second module use the variables of the first. I personally find this ugly. My only "real" example is a different proof of part of PROM that I use for pedagogical purposes, in part. In it, I do use the flexibility. I'll see if I can adapt it to the new logic in a not too ugly way. Clearly, you should also prohibit using different statements in the concrete case (my first 2 lemmas). It was a surprise when I could not lift them to the lemma using the abstract module. |
Update: I reworked my "real" usage of eager to use the new logic, and it wasn't too hard or messy, and the user-facing result is unchanged. Given that hardly anyone uses eager directly, I can see the advantage of the TCB being simpler, even if it's (in my opinion) a little more awkward to use. |
This PR implements a new lazy/eager logic which is deliberately slightly less expressive than the one it replaces, which does not hinder usability in any cryptographic context, with the hope that it is simpler to maintain and verify.
It also brings some documentation in the interface file. The corresponding source file has been formatted with
ocamlformat
(although it is not (yet) the case for other source files in the project).This new implementation also fixes #771.