-
Notifications
You must be signed in to change notification settings - Fork 59
Another example for eHoare #845
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
43a5833 to
f7fcac0
Compare
f7fcac0 to
3161c60
Compare
3161c60 to
966efa8
Compare
| require import StdOrder. | ||
| (*---*) import RealOrder. | ||
|
|
||
| lemma mul0z (x : int) : 0 * x = 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already exists. Remove.
| lemma mul0z (x : int) : 0 * x = 0. | ||
| proof. by auto. qed. | ||
|
|
||
| lemma neg0: -0 = 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already exists. Remove.
| lemma neg0: -0 = 0. | ||
| proof. by auto. qed. | ||
|
|
||
| lemma xle_rle: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprised if it does not exist. If not, move it to the standard library.
| by rewrite !to_pos_pos //; exact (ler_trans x). | ||
| qed. | ||
|
|
||
| lemma Ep_dbiased (p : real) (f : bool -> xreal) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move it to the standard library. Use the link to the E to reuse the proof.
Another example for eHoare (done with @mzini). This example considers a nested loop which uniformly samples a boolean matrix of size$n \times m$ , and proves that the probably of sampling any boolean matrix of size $n \times m$ is no more than $2 ^ {- n \times m}$ .
My original purpose for this example was to figure out a game hopping in a big proof, but it turned out that this game hopping is not needed. But I think this is a good example for demonstrating how to do proof in eHoare.