summaryrefslogtreecommitdiff
path: root/tests/fstar/misc/Paper.fst
diff options
context:
space:
mode:
authorSon Ho2023-02-05 22:03:41 +0100
committerSon HO2023-06-04 21:44:33 +0200
commitc6913b8bf90689d8961c47f59896443e7fae164d (patch)
tree3a2b61a3df49fef14c8ad558ff9630014a5c07e1 /tests/fstar/misc/Paper.fst
parent9ec68c058a1829166fbb2511dedfbe0c2f94d6bc (diff)
Make sure let-bindings in Lean end with line breaks and improve formatting
Diffstat (limited to '')
-rw-r--r--tests/fstar/misc/Paper.fst13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/fstar/misc/Paper.fst b/tests/fstar/misc/Paper.fst
index 95f13f62..4ab31de3 100644
--- a/tests/fstar/misc/Paper.fst
+++ b/tests/fstar/misc/Paper.fst
@@ -6,7 +6,8 @@ open Primitives
#set-options "--z3rlimit 50 --fuel 1 --ifuel 1"
(** [paper::ref_incr] *)
-let ref_incr_fwd_back (x : i32) : result i32 = i32_add x 1
+let ref_incr_fwd_back (x : i32) : result i32 =
+ i32_add x 1
(** [paper::test_incr] *)
let test_incr_fwd : result unit =
@@ -31,11 +32,11 @@ let test_choose_fwd : result unit =
let* z0 = i32_add z 1 in
if not (z0 = 1)
then Fail Failure
- else begin
+ else
let* (x, y) = choose_back i32 true 0 0 z0 in
if not (x = 1)
then Fail Failure
- else if not (y = 0) then Fail Failure else Return () end
+ else if not (y = 0) then Fail Failure else Return ()
(** Unit test for [paper::test_choose] *)
let _ = assert_norm (test_choose_fwd = Return ())
@@ -51,7 +52,7 @@ let rec list_nth_mut_fwd (t : Type0) (l : list_t t) (i : u32) : result t =
| ListCons x tl ->
if i = 0
then Return x
- else begin let* i0 = u32_sub i 1 in list_nth_mut_fwd t tl i0 end
+ else let* i0 = u32_sub i 1 in list_nth_mut_fwd t tl i0
| ListNil -> Fail Failure
end
@@ -62,10 +63,10 @@ let rec list_nth_mut_back
| ListCons x tl ->
if i = 0
then Return (ListCons ret tl)
- else begin
+ else
let* i0 = u32_sub i 1 in
let* tl0 = list_nth_mut_back t tl i0 ret in
- Return (ListCons x tl0) end
+ Return (ListCons x tl0)
| ListNil -> Fail Failure
end