-
Notifications
You must be signed in to change notification settings - Fork 50
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
unsoundness with probabilistic while #212
Comments
Yeah. In the inductive step, we assume something about the behaviour of the loop wrapped in a conditional. For example, in your
The assumption I think this is enough to fix it, but I'd like to see the original pHL rule this is implementing (or to take the time to write a proof for this). |
I wasn't even aware that there is an (abstract) type |
I'm not aware of any others that use the In this case, the I'll be taking a stab at writing and sketching a proof for the rule in the next couple of days. @strub is also hoping that that will let us find a tactic that implements it without exposing the extra-logical self-reference. For example, we could build the |
That was my thought as well. If |
One fix is to implement @fdupress's proposal: the induction hypothesis should be on |
The abstract statement in the induction hypothesis should not be guarded with the loop condition. Fix #212
So it turns out we can finish the proof for PIR. (See commit 68f0b01). This has me suspicious, but Benjamin believes it. Benjamin also believes the inductive case should be as follows instead (note the absence of
|
After another call with @bgregoir , where I finally understood the Universe, I've just pushed a further simplified The general proof pattern is a bit heavier, but remains generally understandable: some of the conditional reasoning takes place in the bound itself, instead of happening solely in code. PR coming up Soon™. |
The abstract statement in the induction hypothesis should not be guarded with the loop condition. Fix #212
The abstract statement in the induction hypothesis should not be guarded with the loop condition. Fix #212
From @chdoc over in the PR (#226)
You're not seeing ghosts. Looking a bit deeper, I see two more issues:
@bgregoir any opinions on this? |
The abstract statement in the induction hypothesis should not be guarded with the loop condition. Fix #212
@fdupress Where are we standing? Is your commit ready for a PR? |
The PR is still there, with Benjamin's commit on top, and verification that it implements the rules. It could be improved for usability, but it's ready to merge for soundness. |
Oh, there is already a PR 😅 |
This fixes #212 and implements a version of the pHL while rule which does have a(n unpublished) pen-and-paper proof. This (obviously) makes using the pHL while rule generally less simple, but particularly so when the loop condition itself is probabilistically modified by the loop body (as, for example, in rejection sampling). In general, the bound given to the `while` tactic in those cases will need to be conditional. (Essentially capturing control-flow conditions in the bound itself.) Examples of proofs illustrating this case can be found in theories/distributions/Dexcepted.ec (starting line 299, including the conseq) and examples/PIR.ec (starting line 202, including also the conseq). Upper-bounds should be unaffected. On lower bounds, one can no longer apply the upper bound rule. On equalities, we have now added the lower-bound exit check (that if the loop is not entered and the event is true, then the probability should be 1), and further missing checks. In all cases, the inductive reasoning case was simplified to remove duplicated control-flow. co-authored-by: Benjamin Grégoire <[email protected]> co-authored-by: François Dupressoir <[email protected]>
This fixes #212 and implements a version of the pHL while rule which does have a(n unpublished) pen-and-paper proof. This (obviously) makes using the pHL while rule generally less simple, but particularly so when the loop condition itself is probabilistically modified by the loop body (as, for example, in rejection sampling). In general, the bound given to the `while` tactic in those cases will need to be conditional. (Essentially capturing control-flow conditions in the bound itself.) Examples of proofs illustrating this case can be found in theories/distributions/Dexcepted.ec (starting line 299, including the conseq) and examples/PIR.ec (starting line 202, including also the conseq). Upper-bounds should be unaffected. On lower bounds, one can no longer apply the upper bound rule. On equalities, we have now added the lower-bound exit check (that if the loop is not entered and the event is true, then the probability should be 1), and further missing checks. In all cases, the inductive reasoning case was simplified to remove duplicated control-flow. co-authored-by: Benjamin Grégoire <[email protected]> co-authored-by: François Dupressoir <[email protected]>
This fixes EasyCrypt#212 and implements a version of the pHL while rule which does have a(n unpublished) pen-and-paper proof. This (obviously) makes using the pHL while rule generally less simple, but particularly so when the loop condition itself is probabilistically modified by the loop body (as, for example, in rejection sampling). In general, the bound given to the `while` tactic in those cases will need to be conditional. (Essentially capturing control-flow conditions in the bound itself.) Examples of proofs illustrating this case can be found in theories/distributions/Dexcepted.ec (starting line 299, including the conseq) and examples/PIR.ec (starting line 202, including also the conseq). Upper-bounds should be unaffected. On lower bounds, one can no longer apply the upper bound rule. On equalities, we have now added the lower-bound exit check (that if the loop is not entered and the event is true, then the probability should be 1), and further missing checks. In all cases, the inductive reasoning case was simplified to remove duplicated control-flow. co-authored-by: Benjamin Grégoire <[email protected]> co-authored-by: François Dupressoir <[email protected]>
Turns out, the
while <invariant> <measure> <upper bound> <probability of decrease>
rule is unsound as well:(the extra-logical
w : statement
made me very suspicious)The text was updated successfully, but these errors were encountered: