File tree Expand file tree Collapse file tree 4 files changed +394
-8
lines changed Expand file tree Collapse file tree 4 files changed +394
-8
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ Section ascend.
32
32
iIntros "[%Hsz Hrespp]".
33
33
iNamed "Hpx".
34
34
wp_apply (wp_Paxos__cquorum with "Hsc").
35
- iIntros (ok) "[ Hsc %Hquorum] ".
36
- wp_if_destruct .
35
+ iIntros " Hsc".
36
+ case_bool_decide as Hquorum; wp_pures; last first .
37
37
{ iApply "HΦ".
38
38
iFrame "HtermcP HtermlP HiscandP HlogP HentspP".
39
39
by iFrame "∗ # %".
Original file line number Diff line number Diff line change 1
1
From Perennial.program_proof.tulip.paxos Require Import prelude.
2
2
From Perennial.program_proof.tulip.paxos.program Require Import repr.
3
+ From Perennial.program_proof.tulip.program Require Import quorum.
3
4
From Goose.github_com.mit_pdos.tulip Require Import paxos quorum.
4
5
5
6
Section cquorum.
@@ -8,11 +9,26 @@ Section cquorum.
8
9
Theorem wp_Paxos__cquorum (px : loc) (n : u64) nids :
9
10
{{{ own_paxos_sc px nids }}}
10
11
Paxos__cquorum #px #n
11
- {{{ (ok : bool), RET #ok; own_paxos_sc px nids ∗ ⌜ size nids / 2 < uint.Z n⌝ }}}.
12
+ {{{ RET #(bool_decide ( size nids / 2 < uint.Z n)); own_paxos_sc px nids }}}.
12
13
Proof .
14
+ iIntros (Φ) "Hpx HΦ".
15
+ wp_rec.
16
+
13
17
(*@ func (px *Paxos) cquorum(n uint64) bool { @*)
14
18
(*@ return quorum.ClassicQuorum(px.sc) <= n @*)
15
19
(*@ } @*)
16
- Admitted .
20
+ iNamed "Hpx".
21
+ wp_loadField.
22
+ wp_apply wp_ClassicQuorum.
23
+ iIntros (x Hx).
24
+ wp_pures.
25
+ case_bool_decide as Hc1.
26
+ { case_bool_decide as Hc2; last word.
27
+ iApply "HΦ". by iFrame "∗ %".
28
+ }
29
+ { case_bool_decide as Hc2; first word.
30
+ iApply "HΦ". by iFrame "∗ %".
31
+ }
32
+ Qed .
17
33
18
34
End cquorum.
Original file line number Diff line number Diff line change @@ -34,9 +34,9 @@ Section push.
34
34
wp_apply (wp_MapLen with "Hlsnpeers").
35
35
iIntros "[%Hszlsnpeers Hlsnpeers]".
36
36
wp_apply (wp_Paxos__cquorum with "Hsc").
37
- iIntros (ok) "[ Hsc %Hqsize] ".
37
+ iIntros " Hsc".
38
38
(* Not using [wp_if_destruct] to prevent it eating equality about [nids]. *)
39
- destruct ok eqn:Hok ; last first.
39
+ case_bool_decide as Hqsize; wp_pures ; last first.
40
40
{ wp_pures.
41
41
iApply "HΦ".
42
42
iFrame "Hcand".
You can’t perform that action at this time.
0 commit comments