Skip to content

Commit 5aa519b

Browse files
authored
Merge pull request #3852 from FStarLang/_nik_eqtype_as_type
Remove eqtype_as_type from layered effect samples
2 parents f3f8859 + 111d285 commit 5aa519b

15 files changed

Lines changed: 26 additions & 26 deletions

File tree

examples/layeredeffects/GenericTotalDM4A.fst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ effect {
8585
* there is now a check in the typechecker to forbid it,
8686
* so the lift below fails
8787
*)
88-
let lift_pure_dm4a (a:Type) (f:(eqtype_as_type unit -> Tot a))
88+
let lift_pure_dm4a (a:Type) (f:(unit -> Tot a))
8989
: repr a (w_return (f ()))
9090
= return _ (f ())
9191

examples/oplss2021/OPLSS2021.ParDiv.fst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ val bind_pure_c_ (a:Type) (b:Type)
349349
(wp:pure_wp a)
350350
(pre:hm.r)
351351
(post:b -> hm.r)
352-
(f:eqtype_as_type unit -> PURE a wp)
352+
(f:unit -> PURE a wp)
353353
(g:(x:a -> comp b pre post))
354354
: Pure (comp b
355355
pre
@@ -364,7 +364,7 @@ val bind_div_c_ (a:Type) (b:Type)
364364
(wp:pure_wp a)
365365
(pre:hm.r)
366366
(post:b -> hm.r)
367-
(f:eqtype_as_type unit -> DIV a wp)
367+
(f:unit -> DIV a wp)
368368
(g:(x:a -> comp b pre post))
369369
: Pure (comp b
370370
pre

examples/oplss2021/OPLSS2021.ParNDSDiv.fst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ val bind_pure_c_ (a:Type) (b:Type)
349349
(wp:pure_wp a)
350350
(pre:hm.r)
351351
(post:b -> hm.r)
352-
(f:eqtype_as_type unit -> PURE a wp)
352+
(f:unit -> PURE a wp)
353353
(g:(x:a -> comp b pre post))
354354
: Pure (comp b
355355
pre
@@ -364,7 +364,7 @@ val bind_div_c_ (a:Type) (b:Type)
364364
(wp:pure_wp a)
365365
(pre:hm.r)
366366
(post:b -> hm.r)
367-
(f:eqtype_as_type unit -> DIV a wp)
367+
(f:unit -> DIV a wp)
368368
(g:(x:a -> comp b pre post))
369369
: Pure (comp b
370370
pre

tests/bug-reports/closed/Bug2055.fst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let bind a b (x: repr a _) (f:a-> repr b _) : repr b () = f x
99
reifiable
1010
reflectable
1111
layered_effect {
12-
ND : a:Type -> dummy:eqtype_as_type unit -> Effect
12+
ND : a:Type -> dummy:unit -> Effect
1313
with repr = repr;
1414
return = return;
1515
bind = bind
@@ -18,7 +18,7 @@ layered_effect {
1818
let monotonic #a (wp : pure_wp a) =
1919
forall p1 p2. (forall x. p1 x ==> p2 x) ==> wp p1 ==> wp p2
2020

21-
let lift_pure_nd (a:Type) (wp:pure_wp a) (f:(eqtype_as_type unit -> PURE a wp)) :
21+
let lift_pure_nd (a:Type) (wp:pure_wp a) (f:(unit -> PURE a wp)) :
2222
Pure (repr a ()) (requires (wp (fun _ -> True))) // <--- This is a lift from Tot only
2323
(ensures (fun _ -> True))
2424
= assume (monotonic wp);

tests/bug-reports/closed/Bug2169.fst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ layered_effect {
138138
if_then_else = i_if_then_else
139139
}
140140

141-
let lift_pure_nd (a:Type) (wp:pure_wp a) (f:(eqtype_as_type unit -> PURE a wp)) :
141+
let lift_pure_nd (a:Type) (wp:pure_wp a) (f:(unit -> PURE a wp)) :
142142
Pure (irepr a wp) (requires True)
143143
(ensures (fun _ -> True))
144144
= fun p _ -> let r = elim_pure f p in [r]

tests/bug-reports/closed/Bug2169b.fst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ layered_effect {
7878
if_then_else = i_if_then_else
7979
}
8080

81-
let lift_pure_nd (a:Type) (wp:pure_wp a) (f:(eqtype_as_type unit -> PURE a wp)) :
81+
let lift_pure_nd (a:Type) (wp:pure_wp a) (f:(unit -> PURE a wp)) :
8282
Pure (irepr a wp) (requires True)
8383
(ensures (fun _ -> True))
8484
= fun p _ -> elim_pure f p

tests/bug-reports/closed/Bug2641.fst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ let dm_free_subcomp a wp1 wp2 f = f
105105
val lift_pure_dm_free :
106106
a: Type ->
107107
w: pure_wp a ->
108-
f: (_: eqtype_as_type unit -> PURE a w) ->
108+
f: (_: unit -> PURE a w) ->
109109
Tot (dm_free a (wp_lift_pure_hist w))
110110
let lift_pure_dm_free a w f =
111111
FStar.Monotonic.Pure.elim_pure_wp_monotonicity_forall ();

tests/bug-reports/closed/Bug3120a.fst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ let as_requires_wlift #a (w : pure_wp a) :
163163
assert (forall post. w post ==> w (fun _ -> True)) ;
164164
assert (forall post. (True ==> w post) ==> w (fun _ -> True))
165165

166-
let lift_pure (a : Type) (w : pure_wp a) (f:(eqtype_as_type unit -> PURE a w)) : dm a (wlift w) =
166+
let lift_pure (a : Type) (w : pure_wp a) (f:(unit -> PURE a w)) : dm a (wlift w) =
167167
as_requires_wlift w ;
168168
d_bind #_ #_ #_ #_ #_ #_ #_ #(fun _ -> w_return (elim_pure #a #w f)) (d_req (as_requires w)) (fun _ ->
169169
let r = elim_pure #a #w f in

tests/micro-benchmarks/Effects.Coherence.fst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ let return (a:Type) (x:a) : repr a () = x
2626
let bind (a:Type) (b:Type) (f:repr a ()) (g:a -> repr b ()) : repr b () = g f
2727

2828
layered_effect {
29-
M1 : Type -> eqtype_as_type unit -> Effect
29+
M1 : Type -> unit -> Effect
3030
with
3131
repr = repr;
3232
return = return;
@@ -36,7 +36,7 @@ layered_effect {
3636
new_effect M2 = M1
3737
new_effect M3 = M1
3838

39-
let lift_pure_m (a:Type) (wp:_) (f:eqtype_as_type unit -> PURE a wp)
39+
let lift_pure_m (a:Type) (wp:_) (f:unit -> PURE a wp)
4040
: Pure (repr a ()) (requires wp (fun _ -> True)) (ensures fun _ -> True)
4141
= FStar.Monotonic.Pure.elim_pure_wp_monotonicity_forall ();
4242
f ()

tests/micro-benchmarks/Erasable.fst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ let e_unit_5 = t
7171

7272
(* Tests for extraction of erasable effects, combined with their lifts to non-erasable effects *)
7373

74-
type repr (a:Type) (_:eqtype_as_type unit) = a
74+
type repr (a:Type) (_:unit) = a
7575
let return (a:Type) (x:a) : repr a () = x
7676
let bind (a b:Type) (f:repr a ()) (g:a -> repr b ()) : repr b () = g f
7777
[@@ primitive_extraction]
7878
total
7979
effect {
80-
MPURE (a:Type) (_:eqtype_as_type unit) with {repr; return; bind}
80+
MPURE (a:Type) (_:unit) with {repr; return; bind}
8181
}
8282

8383
//an erasable effect must be marked total
@@ -88,7 +88,7 @@ new_effect MGHOST = MPURE
8888
total new_effect MGHOST = MPURE
8989

9090
//a lift cannot be in Ghost effect if the source effect is not erasable
91-
let lift_PURE_MPURE_error (a:Type) (wp:pure_wp a) (f:eqtype_as_type unit -> PURE a wp)
91+
let lift_PURE_MPURE_error (a:Type) (wp:pure_wp a) (f:unit -> PURE a wp)
9292
: Ghost (repr a ())
9393
(requires wp (fun _ -> True))
9494
(ensures fun _ -> True)
@@ -99,7 +99,7 @@ sub_effect PURE ~> MPURE = lift_PURE_MPURE_error
9999

100100
//lifts from GHOST effect are not allowed
101101
//GHOST effect is implicitly lifted/combined with effects when appropriate
102-
let lift_GHOST_MPURE (a:Type) (wp:pure_wp a) (f:eqtype_as_type unit -> GHOST a wp)
102+
let lift_GHOST_MPURE (a:Type) (wp:pure_wp a) (f:unit -> GHOST a wp)
103103
: Ghost (repr a ())
104104
(requires wp (fun _ -> True))
105105
(ensures fun _ -> True)
@@ -108,7 +108,7 @@ let lift_GHOST_MPURE (a:Type) (wp:pure_wp a) (f:eqtype_as_type unit -> GHOST a w
108108
[@@expect_failure [187]]
109109
sub_effect GHOST ~> MPURE = lift_GHOST_MPURE
110110

111-
let lift_PURE_MPURE (a:Type) (wp:pure_wp a) (f:eqtype_as_type unit -> PURE a wp)
111+
let lift_PURE_MPURE (a:Type) (wp:pure_wp a) (f:unit -> PURE a wp)
112112
: Pure (repr a ())
113113
(requires wp (fun _ -> True))
114114
(ensures fun _ -> True)
@@ -205,7 +205,7 @@ total
205205
new_effect M2 = MPURE
206206

207207
//instead of defining lifts from PURE To M1 or M2, we define polymonadic binds
208-
let bind_PURE_M1 (a b:Type) (wp:pure_wp a) (f:eqtype_as_type unit -> PURE a wp) (g:a -> repr b ())
208+
let bind_PURE_M1 (a b:Type) (wp:pure_wp a) (f:unit -> PURE a wp) (g:a -> repr b ())
209209
: Pure (repr b ())
210210
(requires wp (fun _ -> True))
211211
(ensures fun _ -> True)

0 commit comments

Comments
 (0)