Commit 0fc880d8 by Dan Frumin

### Make `cloc` a primitive record.

```This way we get eta-equality definitionally, and `cloc_plus l 0`
simplifies to `l`.```
parent 45e74acc
 ... @@ -193,7 +193,7 @@ Section proofs. ... @@ -193,7 +193,7 @@ Section proofs. iApply wp_fupd. wp_alloc l as "Hl". iApply wp_fupd. wp_alloc l as "Hl". iMod (locking_heap_alloc with "Hσ Hl") as (?) "[Hσ Hl]"; first done. iMod (locking_heap_alloc with "Hσ Hl") as (?) "[Hσ Hl]"; first done. iIntros "!> !>". rewrite cloc_to_val_eq. iIntros "!> !>". rewrite cloc_to_val_eq. iSplitL "Hlocks Hσ"; [|by iApply ("HΦ" \$! (l, 0%nat))]. iSplitL "Hlocks Hσ"; [|by iApply ("HΦ" \$! (MkCloc l 0))]. iExists X, _. iFrame. iExists X, _. iFrame. iIntros "!%". intros w Hw. destruct (HX _ Hw) as (cl&Hcl&Hin). iIntros "!%". intros w Hw. destruct (HX _ Hw) as (cl&Hcl&Hin). exists cl; split; first done. by rewrite locked_locs_alloc_heap. exists cl; split; first done. by rewrite locked_locs_alloc_heap. ... @@ -428,7 +428,7 @@ Section proofs. ... @@ -428,7 +428,7 @@ Section proofs. iDestruct ("Hv1" with "Hv2") as (cl n -> ->) "HΦ /=". iDestruct ("Hv1" with "Hv2") as (cl n -> ->) "HΦ /=". rewrite cloc_to_val_eq. rewrite cloc_to_val_eq. do 3 awp_proj. awp_op. awp_let. do 2 awp_proj. do 3 awp_proj. awp_op. awp_let. do 2 awp_proj. iApply awp_ret. iApply wp_value. by rewrite -Nat2Z.inj_add. iApply awp_ret. iApply wp_value. by rewrite Nat.add_comm -Nat2Z.inj_add. Qed. Qed. Lemma a_ptr_lt_spec R Φ Ψ1 e1 e2 : Lemma a_ptr_lt_spec R Φ Ψ1 e1 e2 : ... ...