Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,6 @@ jobs:
with:
node-version: 16

- run: echo "KRML_HOME=$(pwd)/karamel" >> $GITHUB_ENV

- name: Karamel CI (test-pulse)
working-directory: karamel
run: |
Expand Down
4 changes: 3 additions & 1 deletion test/pulse/Break.fst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ fn simple_break ()
while (!k)
invariant live k
ensures true
decreases (if !k then 1 else 0)
{
break;
}
}

fn break_continue_and_return (which: UInt8.t)
divergent fn break_continue_and_return (which: UInt8.t)
{
let mut i = 0ul;
while (!i `UInt32.lt` 1000ul)
Expand Down Expand Up @@ -48,6 +49,7 @@ fn find_zero_with_break (a: array Int32.t) (sz: SizeT.t)
invariant pure (SizeT.v !i <= SizeT.v sz /\
(forall (j: nat). j < SizeT.v (!i) ==> Seq.index 'va j <> 0l))
ensures (SizeT.v !i < SizeT.v sz /\ a.(!i) = 0l)
decreases (SizeT.v sz - SizeT.v (!i))
{
if (a.(!i) = 0l) {
break;
Expand Down
1 change: 1 addition & 0 deletions test/pulse/Goto.fst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fn find_zero (a: array Int32.t) (sz: SizeT.t)
invariant live i
invariant pure (SizeT.v !i <= SizeT.v sz /\
(forall (j: nat). j < SizeT.v (!i) ==> Seq.index 'va j <> 0l))
decreases (SizeT.v sz - SizeT.v (!i))
{
if (a.(!i) = 0l) {
return !i;
Expand Down
2 changes: 2 additions & 0 deletions test/pulse/Inline.fst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ fn tst (shared : UInt32.t)
let mut i = 0ul;
while (!i <^ uu__k)
invariant live i
invariant pure (v (!i) <= v uu__k)
decreases (Prims.op_Subtraction (v uu__k) (v (!i)))
{
i := !i +^ 1ul;
};
Expand Down
4 changes: 2 additions & 2 deletions test/pulse/InlineLoopCond.fst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module InlineLoopCond
#lang-pulse
open Pulse

fn test (f : unit -> fn returns UInt32.t)
divergent fn test (f : unit -> fn returns UInt32.t)
returns UInt32.t
{
let uu__ = f ();
Expand All @@ -15,7 +15,7 @@ fn test (f : unit -> fn returns UInt32.t)
0ul
}

fn test_ok (x : UInt32.t)
divergent fn test_ok (x : UInt32.t)
returns UInt32.t
{
(* This one could be inlined (it's not at the moment) *)
Expand Down
Loading