Skip to content

Commit 8544627

Browse files
committed
Update dependencies
1 parent 446d566 commit 8544627

11 files changed

+102
-80
lines changed

Makefile.coq.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ COQMF_COQLIB=/Users/anton/.opam/AddressC/lib/coq/
4646
COQMF_COQCORELIB=/Users/anton/.opam/AddressC/lib/coq/../coq-core/
4747
COQMF_DOCDIR=/Users/anton/.opam/AddressC/share/doc/
4848
COQMF_OCAMLFIND=/Users/anton/.opam/AddressC/bin/ocamlfind
49-
COQMF_CAMLFLAGS=-thread -rectypes -bin-annot -strict-sequence -w -a+1..3-4+5..8-9+10..26-27+28..39-40-41-42+43-44-45+46..47-48+49..57-58+59..66-67-68+69-70
49+
COQMF_CAMLFLAGS=-thread -bin-annot -strict-sequence -w -a+1..3-4+5..8-9+10..26-27+28..39-40-41-42+43-44-45+46..47-48+49..57-58+59..66-67-68+69-70
5050
COQMF_WARN=-warn-error +a-3
5151
COQMF_HASNATDYNLINK=true
5252
COQMF_COQ_SRC_SUBDIRS=boot config lib clib kernel library engine pretyping interp gramlib parsing proofs tactics toplevel printing ide stm vernac plugins/btauto plugins/cc plugins/derive plugins/extraction plugins/firstorder plugins/funind plugins/ltac plugins/ltac2 plugins/micromega plugins/nsatz plugins/ring plugins/rtauto plugins/ssr plugins/ssrmatching plugins/syntax
@@ -67,5 +67,5 @@ COQMF_COQPROJECTNATIVEFLAG = no
6767
# #
6868
###############################################################################
6969

70-
COQMF_OTHERFLAGS = '-w' '-notation-overridden' '-w' '-redundant-canonical-projection' '-w' '-convert_concl_no_check' '-w' '-undeclared-scope' '-w' '-cannot-define-projection' '-w' '-ambiguous-paths'
70+
COQMF_OTHERFLAGS = '-w' '-notation-overridden' '-w' '-redundant-canonical-projection' '-w' '-convert_concl_no_check' '-w' '-undeclared-scope' '-w' '-cannot-define-projection' '-w' '-ambiguous-paths' '-w' '-non-reversible-notation' '-w' '-notation-bound-to-variable' '-w' '-ltac2-missing-notation-var'
7171
COQMF_INSTALLCOQDOCROOT = fip_iris

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ All primitives come with a high degree of automation thanks to [Diaframe](https:
88
used in particular to show correctness of various tree insertion
99
algorithms (see our [techreport][fiptree-tr]).
1010

11-
[fiptree-tr]: https://www.microsoft.com/en-us/research/publication/a-functional-correspondence-between-top-down-and-bottom-up-tree-algorithms-fast-and-correct-fully-in-place-functions-with-first-class-constructor-contexts-and-zippers-tr/
11+
[fiptree-tr]: https://www.microsoft.com/en-us/research/publication/fiptree-tr/
1212

1313
AddressC is especially powerful for imperative algorithms which arise naturally from a functional version.
1414
As an example, take the `reverse` function:
@@ -95,11 +95,11 @@ to obtain AddressC code which corresponds closely to the pseudo-code presented i
9595
original papers. To learn more about this work,
9696
please refer [to our paper][fiptree-tr]:
9797
```
98-
@TechReport{Lorenzen:correspondence,
98+
@TechReport{Lorenzen:bst-essence,
9999
author = {Lorenzen, Anton and Leijen, Daan and Swierstra, Wouter and Lindley, Sam},
100-
title = {A Functional Correspondence between Top-down and Bottom-up Tree Algorithms},
100+
title = {The Functional Essence of Imperative Binary Search Trees},
101101
year = 2023,
102-
month = Jul,
102+
month = Dec,
103103
institution = {Microsoft Research},
104104
number = {MSR-TR-2023-28}
105105
}
@@ -110,15 +110,15 @@ please refer [to our paper][fiptree-tr]:
110110
The Coq code is known to compile with:
111111

112112
```
113-
coq 8.17.0 The Coq Proof Assistant
114-
coq-core 8.17.0 The Coq Proof Assistant -- Core Binaries and Tools
115-
coq-diaframe dev.2023-06-15.0.1c3b5549 Diaframe: Automation for Iris
116-
coq-diaframe-heap-lang dev.2023-06-15.0.1c3b5549 Diaframe: Automation for Iris's Heap Lang
117-
coq-equations 1.3+8.17 A function definition package for Coq
118-
coq-iris dev.2023-06-14.0.f0e415b6 A Higher-Order Concurrent Separation Logic Framework with support for interactive proofs
119-
coq-iris-heap-lang dev.2023-06-14.0.f0e415b6 The canonical example language for Iris
120-
coq-stdlib 8.17.0 The Coq Proof Assistant -- Standard Library
121-
coq-stdpp dev.2023-06-01.0.d1254759 An extended "Standard Library" for Coq
113+
coq 8.19.1 The Coq Proof Assistant
114+
coq-core 8.19.1 The Coq Proof Assistant -- Core Binaries and Tools
115+
coq-diaframe dev.2024-02-21.0.9c606e4f Diaframe: Automation for Iris
116+
coq-diaframe-heap-lang dev.2024-02-21.0.9c606e4f Diaframe: Automation for Iris's Heap Lang
117+
coq-equations 1.3+8.19 A function definition package for Coq
118+
coq-iris dev.2024-02-16.1.06f499e0 A Higher-Order Concurrent Separation Logic Framework with support for interactive proofs
119+
coq-iris-heap-lang dev.2024-02-16.1.06f499e0 The canonical example language for Iris
120+
coq-stdlib 8.19.1 The Coq Proof Assistant -- Standard Library
121+
coq-stdpp dev.2024-02-09.0.cafd7113 An extended "Standard Library" for Coq
122122
```
123123

124124
## Compilation

_CoqProject

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
-arg -w -arg -ambiguous-paths
1313
-arg -native-compiler -arg no
1414

15+
# Disable notation warnings for our C-style syntax
16+
-arg -w -arg -non-reversible-notation
17+
-arg -w -arg -notation-bound-to-variable
18+
19+
# TODO: New warning which fires for our C-style variable hack
20+
-arg -w -arg -ltac2-missing-notation-var
1521

1622
theories/idents.v
1723
theories/lang.v

theories/append_wand.v

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ Proof.
6565
wp_heap. wp_enter_loop. wp_heap. iModIntro.
6666
iExists xx, _, (compose acc (fun ys' => x :: ys')), p', (p'' +ₗ 1%nat).
6767
unfold array at 1. iDecompose "Hp". iFrame. iSplitL.
68-
- iSteps. unfold array. iSteps.
68+
- iSteps.
6969
- done. }
7070
+ iExists xs, _, (fun ys' => z :: ys'), p, (p +ₗ 1%nat).
71-
iFrame. unfold array. iDecompose "Hp". iFrame.
72-
iSplitL. 1: unfold array; iSteps. iSteps.
71+
fold is_list. unfold array. iFrame.
72+
iDecompose "Hp" as "p0 p1". iSplitL "p0"; iSteps.
7373
Qed.
7474

7575
End proof.

theories/lang.v

+35-18
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ End Private.
4242

4343
Notation "'var:' x := e1 'in' e2" :=
4444
(Lam (ident_to_string! x)%binder ((fun (x : expr) => e2%E) (Load (ident_to_string! x)%binder)) (Alloc e1%E))
45-
(at level 100, x at level 100, e1, e2 at level 200, right associativity,
46-
format "'[' 'var:' x := '[' e1 ']' 'in' '/' e2 ']'") : expr_scope.
45+
(at level 100, x at level 100, e1, e2 at level 200, right associativity) : expr_scope.
4746

4847
Notation "'var:' x := e1 'in' e2" :=
4948
(Lam x%binder e2%V (Alloc e1%V))
@@ -78,8 +77,7 @@ Notation "'fun:' ( a ) { e }" :=
7877
((fun a =>
7978
e%E)
8079
(Load (ident_to_string! a)%binder)))
81-
(at level 200, a at level 1, e at level 200,
82-
format "'[' 'fun:' ( a ) '/ ' { e } ']'").
80+
(at level 200, a at level 1, e at level 200).
8381

8482
Notation "'fun:' ( a , b ) { e }" :=
8583
(LamV (ident_to_string! a)%binder
@@ -89,8 +87,7 @@ Notation "'fun:' ( a , b ) { e }" :=
8987
e%E)
9088
(Load (ident_to_string! b)%binder))))
9189
(Load (ident_to_string! a)%binder)))
92-
(at level 200, a, b at level 1, e at level 200,
93-
format "'[' 'fun:' ( a , b ) '/ ' { e } ']'").
90+
(at level 200, a, b at level 1, e at level 200).
9491

9592
Notation "'fun:' ( a , b , c ) { e }" :=
9693
(LamV (ident_to_string! a)%binder
@@ -103,8 +100,7 @@ Notation "'fun:' ( a , b , c ) { e }" :=
103100
(Load (ident_to_string! c)%binder))))
104101
(Load (ident_to_string! b)%binder))))
105102
(Load (ident_to_string! a)%binder)))
106-
(at level 200, a, b, c at level 1, e at level 200,
107-
format "'[' 'fun:' ( a , b , c ) '/ ' { e } ']'").
103+
(at level 200, a, b, c at level 1, e at level 200).
108104

109105
Notation "'fun:' ( a , b , c , d ) { e }" :=
110106
(LamV (ident_to_string! a)%binder
@@ -120,8 +116,7 @@ Notation "'fun:' ( a , b , c , d ) { e }" :=
120116
(Load (ident_to_string! c)%binder))))
121117
(Load (ident_to_string! b)%binder))))
122118
(Load (ident_to_string! a)%binder)))
123-
(at level 200, a, b, c, d at level 1, e at level 200,
124-
format "'[' 'fun:' ( a , b , c , d ) '/ ' { e } ']'").
119+
(at level 200, a, b, c, d at level 1, e at level 200).
125120

126121
Notation "'fun:' ( a , b , c , d , e ) { e2 }" :=
127122
(LamV (ident_to_string! a)%binder
@@ -140,8 +135,7 @@ Notation "'fun:' ( a , b , c , d , e ) { e2 }" :=
140135
(Load (ident_to_string! c)%binder))))
141136
(Load (ident_to_string! b)%binder))))
142137
(Load (ident_to_string! a)%binder)))
143-
(at level 200, a, b, c, d, e at level 1, e2 at level 200,
144-
format "'[' 'fun:' ( a , b , c , d , e ) '/ ' { e2 } ']'").
138+
(at level 200, a, b, c, d, e at level 1, e2 at level 200).
145139

146140
Notation "'ret:' e" := e%E (at level 20) : expr_scope.
147141

@@ -285,39 +279,56 @@ End proofs.
285279

286280
(* --------- Tactics ----------- *)
287281

282+
(* We wan to call iSplitL using a selection pattern which includes a fresh ident,
283+
but unfortunately the current implementation does not support this.
284+
Thus, we duplicate the iSplitL tactic here: *)
285+
Tactic Notation "ISplitL" constr(Hs) :=
286+
iStartProof;
287+
let Δ := iGetCtx in
288+
eapply tac_sep_split with Left Hs _ _; (* (js:=Hs) *)
289+
[tc_solve ||
290+
let P := match goal with |- FromSep ?P _ _ => P end in
291+
fail "iSplitL:" P "not a separating conjunction"
292+
|pm_reduce;
293+
lazymatch goal with
294+
| |- False => let Hs := iMissingHypsCore Δ Hs in
295+
fail "iSplitL: hypotheses" Hs "not found"
296+
| _ => split; [(* subgoal 1 *)|(* subgoal 2 *)]
297+
end].
298+
288299
Tactic Notation "wp_begin" constr(x1) :=
289300
let phi := fresh "Φ" in
290301
let Hphi := iFresh in
291302
iIntros (phi); iIntros x1; iIntros [IIdent Hphi];
292-
wp_rec; wp_apply wp_wand_l; iFrame; repeat wp_lam; clear phi.
303+
wp_rec; wp_apply wp_wand_l; ISplitL [Hphi]; first iFrame; repeat wp_lam; clear phi.
293304

294305
Tactic Notation "wp_begin" constr(x1) ";" ident(x2) :=
295306
let phi := fresh "Φ" in
296307
let Hphi := iFresh in
297308
iIntros (phi); iIntros x1; iIntros [IIdent Hphi];
298309
wp_alloc x2;
299-
wp_rec; wp_apply wp_wand_l; iFrame; repeat wp_lam; clear phi.
310+
wp_rec; wp_apply wp_wand_l; ISplitL [Hphi]; first iFrame; repeat wp_lam; clear phi.
300311

301312
Tactic Notation "wp_begin" constr(x1) ";" ident(x2) "," ident(x3) :=
302313
let phi := fresh "Φ" in
303314
let Hphi := iFresh in
304315
iIntros (phi); iIntros x1; iIntros [IIdent Hphi];
305316
wp_alloc x3; wp_alloc x2;
306-
wp_rec; wp_apply wp_wand_l; iFrame; repeat wp_lam; clear phi.
317+
wp_rec; wp_apply wp_wand_l; ISplitL [Hphi]; first iFrame; repeat wp_lam; clear phi.
307318

308319
Tactic Notation "wp_begin" constr(x1) ";" ident(x2) "," ident(x3) "," ident(x4) :=
309320
let phi := fresh "Φ" in
310321
let Hphi := iFresh in
311322
iIntros (phi); iIntros x1; iIntros [IIdent Hphi];
312323
wp_alloc x4; wp_alloc x3; wp_alloc x2;
313-
wp_rec; wp_apply wp_wand_l; iFrame; repeat wp_lam; clear phi.
324+
wp_rec; wp_apply wp_wand_l; ISplitL [Hphi]; first iFrame; repeat wp_lam; clear phi.
314325

315326
Tactic Notation "wp_begin" constr(x1) ";" ident(x2) "," ident(x3) "," ident(x4) "," ident(x5) :=
316327
let phi := fresh "Φ" in
317328
let Hphi := iFresh in
318329
iIntros (phi); iIntros x1; iIntros [IIdent Hphi];
319330
wp_alloc x5; wp_alloc x4; wp_alloc x3; wp_alloc x2;
320-
wp_rec; wp_apply wp_wand_l; iFrame; repeat wp_lam; clear phi.
331+
wp_rec; wp_apply wp_wand_l; ISplitL [Hphi]; first iFrame; repeat wp_lam; clear phi.
321332

322333
Tactic Notation "wp_var" ident(x) :=
323334
wp_alloc x; wp_let.
@@ -380,8 +391,14 @@ Tactic Notation "wp_heap" :=
380391
|| wp_load_offset || wp_store_offset
381392
|| let x := fresh in (wp_alloc x; try done) ).
382393

394+
Tactic Notation "if_decide" :=
395+
let H := fresh in case_bool_decide as H; try inversion H.
396+
397+
Tactic Notation "invalid_case" :=
398+
(subst; done) || lia.
399+
383400
Tactic Notation "wp_type" :=
384-
iSteps; try (repeat case_bool_decide; iSteps).
401+
iSteps; try (repeat if_decide; try invalid_case; iSteps).
385402

386403
Tactic Notation "wp_while" constr(Hinv) :=
387404
wp_apply (wp_while_inv Hinv).

theories/splay_bu.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ Proof.
248248
destruct t' as [|l x r].
249249
+ iDecompose "Ht". wp_type.
250250
+ iDestruct "Ht" as (? ? ?) "[-> [? [Hl Hr]]]". wp_heap.
251-
unfold bu_insert_go at 1. case_bool_decide; wp_heap.
251+
unfold bu_insert_go at 1. if_decide; wp_heap.
252252
{ wp_type. }
253-
{ case_bool_decide; wp_heap.
253+
{ if_decide; wp_heap.
254254
- destruct l; iDecompose "Hl"; wp_heap; wp_type.
255255
- destruct r; iDecompose "Hr"; wp_heap; wp_type. }
256256
- wp_type.

theories/splay_td.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ Proof.
137137
destruct t' as [|l x r].
138138
+ iDecompose "Ht". wp_heap. wp_type.
139139
+ iDestruct "Ht" as (? ? ?) "(-> & ? & Hl & Hr)". wp_heap.
140-
unfold td_insert_go at 1. case_bool_decide; wp_heap. { wp_type. }
141-
{ case_bool_decide; wp_heap.
140+
unfold td_insert_go at 1. if_decide; wp_heap. { wp_type. }
141+
{ if_decide; wp_heap.
142142
- destruct l; iDecompose "Hl".
143143
+ wp_heap. wp_type.
144-
+ wp_heap. case_bool_decide; wp_heap; wp_type.
144+
+ wp_heap. if_decide; wp_heap; wp_type.
145145
- destruct r; iDecompose "Hr".
146146
+ wp_heap. wp_type.
147-
+ wp_heap. case_bool_decide; wp_heap; wp_type; iExFalso; lia. }
147+
+ wp_heap. if_decide; wp_heap; wp_type. }
148148
- wp_type.
149149
Qed.
150150

theories/tree_td.v

+7-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Proof. iSteps. Qed.
2323
Instance is_tree_node_hint (p : loc) (x : Z) (l_r l_l : val) t :
2424
HINT ε₁ ✱ [ l r ; (p +ₗ 0) ↦ l_l ∗ (p +ₗ 1) ↦ #x ∗ (p +ₗ 2) ↦ l_r ∗ is_tree l l_l ∗ is_tree r l_r ∗ ⌜t = Node l x r⌝]
2525
⊫ [id]; is_tree t #p ✱ [⌜t = Node l x r⌝].
26-
Proof. unfold is_tree, array. simpl. iSteps. Qed.
26+
Proof. iSteps. Qed.
2727

2828
(* We want to figure out if a tree is a Leaf or a Node from the "t != NULL" check.
2929
To achieve this, Ike Mulder wrote this typeclass inference code. *)
@@ -119,22 +119,22 @@ Lemma tree_of_ctx (z : ctx) (t : tree) (zv : loc) (hv : loc) (tv : val) :
119119
Proof.
120120
iIntros "[Hz [Hhv Ht]]". iInduction z as [|z x r|l x z] "IH" forall (zv hv t).
121121
- iDecompose "Hz". iSteps.
122-
- iDecompose "Hz" as (? ? ?) "H1 H2 H3 H4". iExists #x. iFrame.
122+
- iDecompose "Hz" as (? ? ?) "H1 H2 H3 H4". iExists #x. iSteps.
123123
iPoseProof ("IH" $! (Loc.add x 0) hv t with "H3 Hhv Ht") as "[%l' [H1' H2']]".
124-
iExists x, l', x0. unfold array, harray. iSteps.
125-
- iDecompose "Hz" as (? ? ?) "H1 H2 H3 H4". iExists #x0. iFrame.
124+
iExists l', x0. unfold array, harray. iSteps.
125+
- iDecompose "Hz" as (? ? ?) "H1 H2 H3 H4". iExists #x0. iSteps.
126126
iPoseProof ("IH" $! (Loc.add x0 2) hv t with "H3 Hhv Ht") as "[%r' [H1' H2']]".
127-
iExists x0, x1, r'. unfold array, harray. iSteps.
127+
iExists x1, r'. unfold array, harray. iSteps.
128128
Qed.
129129

130130
Lemma ctx0_of_ctx (z1 : ctx) (z2 : ctx) (zv1 : loc) (hv1 : loc) (zv2 : loc) (hv2 : loc) :
131131
is_ctx z1 zv1 hv1 ∗ hv1 ↦ #zv2 ∗ is_ctx0 z2 zv2 hv2 -∗ ∃ (zv1' : loc), zv1 ↦ #zv1' ∗ is_ctx0 (comp z1 z2) zv1' hv2.
132132
Proof.
133133
iIntros "[Hz [Hhv Ht]]". iInduction z1 as [|z x r|l x z] "IH" forall (zv1 hv1 z2 zv2 hv2).
134134
- iDecompose "Hz". iExists zv2. iFrame.
135-
- iDecompose "Hz". iExists x. iFrame. iExists x0. iFrame.
135+
- iDecompose "Hz". iExists x. iFrame.
136136
iApply (ctx_of_ctx0). iSteps. repeat rewrite (Loc.add_0). iSteps.
137-
- iDecompose "Hz". iExists x0. iFrame. iExists x1. iFrame.
137+
- iDecompose "Hz". iExists x0. iFrame.
138138
iApply (ctx_of_ctx0). iSteps. repeat rewrite (Loc.add_0). iSteps.
139139
Qed.
140140

theories/zip.v

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ Lemma heap_is_higher_rank_correct `{!heapGS Σ} (rk1 rk2 x1 x2 : Z) :
3030
heap_is_higher_rank #rk1 #rk2 #x1 #x2
3131
{{{ v, RET v; ∃ (b : bool), ⌜v = #b⌝ ∗ ⌜b = is_higher_rank rk1 rk2 x1 x2⌝ }}}.
3232
Proof.
33-
wp_begin "H". unfold is_higher_rank.
34-
repeat case_bool_decide; iSteps.
33+
wp_begin "H". unfold is_higher_rank. repeat case_bool_decide; iSteps.
3534
Qed.
3635

3736
(* Recursive *)

theories/zip_bu.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Proof.
230230
iIntros (v) "[%b [Hv Hb]]". unfold bu_insert_go.
231231
destruct b; iDestruct "Hv" as %->; iDestruct "Hb" as %<-.
232232
{ wp_type. }
233-
{ wp_heap. case_bool_decide.
233+
{ wp_heap. if_decide.
234234
- wp_type.
235235
- wp_pures. wp_load. wp_alloc Hk as "Hk'". wp_load. wp_alloc Ht as "Ht'".
236236
wp_apply (heap_unzip_correct (Node rk l x r) k with "[Hp Hl Hr Hk' Ht']").

0 commit comments

Comments
 (0)