Skip to content

Commit

Permalink
update stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Sep 10, 2024
1 parent 0e98e5a commit 9334f3b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion juvix-stdlib
1 change: 1 addition & 0 deletions tests/Casm/Compilation/positive/out/test078.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
482630520
11 changes: 11 additions & 0 deletions tests/Casm/Compilation/positive/test078.juvix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module test078;

import Stdlib.Prelude open;

fact' (acc : Nat) : Nat → Nat
| zero := acc
| (suc x) := assert (acc /= 0) >-> fact' (acc * suc x) x;

fact : Nat → Nat := fact' 1;

main : Nat := assert (fact 10 == 10 * fact 9) >-> fact 5 + fact 10 + fact 12;
1 change: 1 addition & 0 deletions tests/Casm/positive/out/test018.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
13 changes: 13 additions & 0 deletions tests/Casm/positive/test018.casm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- assertions

start:
[ap] = 10
[ap + 1] = 1
ap += 2
loop:
[ap] = [ap - 2] - 1
[ap + 1] = [ap - 1] * [ap - 2]
ap += 2
jmp loop if [ap - 2] != 0
[ap] = [ap - 1] - 3628800; ap++
assert [ap - 1]

0 comments on commit 9334f3b

Please sign in to comment.