Skip to content

Commit dd02467

Browse files
authored
Merge pull request #517 from mtzguido/fix
Update expected output
2 parents 028df92 + acd03f8 commit dd02467

File tree

4 files changed

+44
-45
lines changed

4 files changed

+44
-45
lines changed

lib/pulse/lib/Pulse.Lib.HashTable.fst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ fn replace
238238
}
239239

240240

241-
#push-options "--fuel 1 --ifuel 2 --z3rlimit_factor 4"
241+
#push-options "--fuel 1 --ifuel 2 --z3rlimit_factor 6"
242242
fn insert
243243
(#[@@@ Rust_generics_bounds ["Copy"; "PartialEq"; "Clone"]] kt:eqtype)
244244
(#[@@@ Rust_generics_bounds ["Clone"]] vt:Type0)

share/pulse/examples/GhostBag.fst

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ type gbag_pcm_carrier (a:eqtype) =
5252
| P : map a -> gbag_pcm_carrier a
5353
| F : map a -> gbag_pcm_carrier a
5454

55+
let gbag_equal #a (m1 m2 : gbag_pcm_carrier a) : Tot prop =
56+
match m1, m2 with
57+
| P m1', P m2' -> Map.equal m1' m2'
58+
| F m1', F m2' -> Map.equal m1' m2'
59+
| _, _ -> False
60+
61+
let lemma_elim_gbag_equal #a (m1 m2 : gbag_pcm_carrier a)
62+
: Lemma (requires gbag_equal m1 m2) (ensures m1 == m2) [SMTPat (gbag_equal m1 m2)]
63+
= ()
64+
5565
let gbag_pcm_composable #a : symrel (gbag_pcm_carrier a) =
5666
fun x y ->
5767
match x, y with
@@ -96,51 +106,44 @@ let gbag_pcm' a : pcm' (gbag_pcm_carrier a) =
96106
one = gbag_pcm_one;
97107
}
98108

99-
#push-options "--warn_error -271"
100-
let op_maps_comm a
101-
: m1:map a -> m2:map a -> Lemma (op_maps m1 m2 == op_maps m2 m1) [SMTPat ()] =
102-
fun m1 m2 ->
103-
assert (Map.equal (op_maps m1 m2) (op_maps m2 m1))
104-
105-
let op_maps_assoc_l a
106-
: m1:map a -> m2:map a -> m3:map a ->
107-
Lemma (op_maps m1 (op_maps m2 m3) == op_maps (op_maps m1 m2) m3) [SMTPat ()] =
108-
fun m1 m2 m3 ->
109-
assert (Map.equal (op_maps m1 (op_maps m2 m3)) (op_maps (op_maps m1 m2) m3))
110-
111-
let op_maps_assoc_r a
112-
: m1:map a -> m2:map a -> m3:map a ->
113-
Lemma (op_maps m1 (op_maps m2 m3) == op_maps (op_maps m1 m2) m3) [SMTPat ()] =
114-
fun m1 m2 m3 ->
115-
assert (Map.equal (op_maps m1 (op_maps m2 m3)) (op_maps (op_maps m1 m2) m3))
116-
117109
let gbag_pcm_commutative a : lem_commutative (gbag_pcm' a) =
118-
let _ = op_maps_comm a in
119-
fun _ _ -> ()
110+
fun m1 m2 ->
111+
assert (gbag_equal (gbag_pcm_op m1 m2) (gbag_pcm_op m2 m1))
120112

121-
#restart-solver
122-
#push-options "--z3rlimit_factor 20 --fuel 0 --ifuel 1 --split_queries no"
113+
#push-options "--split_queries always --z3rlimit 20"
123114
let gbag_pcm_assoc_l a : lem_assoc_l (gbag_pcm' a) =
124-
let _ = op_maps_comm a in
125-
let _ = op_maps_assoc_l a in
126-
let _ = op_maps_assoc_r a in
127-
fun _ _ _ -> ()
115+
fun x y z ->
116+
match x, y, z with
117+
| P m1, P m2, P m3
118+
| F m1, P m2, P m3
119+
| P m1, F m2, P m3
120+
| P m1, P m2, F m3 ->
121+
assert (gbag_pcm_composable x y);
122+
assert (gbag_pcm_composable (gbag_pcm_op x y) z);
123+
assert (gbag_pcm_op x (gbag_pcm_op y z) `gbag_equal` gbag_pcm_op (gbag_pcm_op x y) z);
124+
()
125+
| _ -> assert False
128126

129127
let gbag_pcm_assoc_r a : lem_assoc_r (gbag_pcm' a) =
130-
let _ = op_maps_comm a in
131-
let _ = op_maps_assoc_l a in
132-
let _ = op_maps_assoc_r a in
133-
fun _ _ _ -> ()
128+
fun x y z ->
129+
match x, y, z with
130+
| P m1, P m2, P m3
131+
| F m1, P m2, P m3
132+
| P m1, F m2, P m3
133+
| P m1, P m2, F m3 ->
134+
assert (gbag_pcm_composable y z);
135+
assert (gbag_pcm_composable x (gbag_pcm_op y z));
136+
assert (gbag_pcm_op x (gbag_pcm_op y z) `gbag_equal` gbag_pcm_op (gbag_pcm_op x y) z);
137+
()
138+
| _ -> assert False
139+
#pop-options
134140

135141
let gbag_pcm_is_unit a : lem_is_unit (gbag_pcm' a) =
136142
let p = gbag_pcm' a in
137143
fun x ->
138144
assert (p.composable x p.one);
139-
match x with
140-
| P m ->
141-
assert (Map.equal (op_maps m (Map.const None)) m)
142-
| F m ->
143-
assert (Map.equal (op_maps m (Map.const None)) m)
145+
assert (p.op x p.one `gbag_equal` x);
146+
()
144147

145148
let gbag_pcm a : pcm (gbag_pcm_carrier a) = {
146149
p = gbag_pcm' a;
@@ -150,8 +153,6 @@ let gbag_pcm a : pcm (gbag_pcm_carrier a) = {
150153
is_unit = gbag_pcm_is_unit a;
151154
refine = (fun _ -> True)
152155
}
153-
#pop-options
154-
#pop-options
155156

156157
#restart-solver
157158
#push-options "--z3rlimit_factor 4 --fuel 0 --ifuel 1 --split_queries no --warn_error -271"

share/pulse/examples/Pulse.fst.config.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
],
1212
"include_dirs": [
1313
"../../../out/lib/pulse",
14-
"bug-reports",
1514
"by-example",
1615
"parallel",
17-
"parix",
1816
"c",
1917
"dice",
2018
"dice/cbor",

test/bug-reports/ExistsErasedAndPureEqualities.fst.output.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
- Current context:
44
ExistsErasedAndPureEqualities.some_pred x v
55
- In typing environment:
6-
__#536 : Prims.squash (_v_4 == v),
7-
_v_4#535 : FStar.Ghost.erased Prims.int,
8-
__#405 : Prims.squash (v == v),
9-
v#269 : FStar.Ghost.erased Prims.int,
10-
x#263 : Pulse.Lib.Reference.ref Prims.int
6+
__#491 : Prims.squash (_v_4 == v),
7+
_v_4#490 : FStar.Ghost.erased Prims.int,
8+
__#369 : Prims.squash (v == v),
9+
v#245 : FStar.Ghost.erased Prims.int,
10+
x#239 : Pulse.Lib.Reference.ref Prims.int
1111

1212
* Info at ExistsErasedAndPureEqualities.fst(70,32-72,5):
1313
- Expected failure:

0 commit comments

Comments
 (0)