Compleating assignment for interpreter, modified grammars, fixed tests

This commit is contained in:
elvis
2024-11-16 15:40:00 +01:00
parent 40055899c9
commit 9e599cc018
24 changed files with 593 additions and 1238 deletions

View File

@ -0,0 +1,15 @@
lambda n: int -> int =>
let fib = lambda f : (int -> int) -> int -> int =>
\ n : int -> int =>
if n == 0 then 0
else if n == 1 then 1
else f (n - 1) + f (n - 2)
in
let rec fix f : ((int -> int) -> int -> int) -> int -> int =
\ x : int -> int =>
f (fix f) x
in
fix fib n