mirror of
https://github.com/anoma/juvix.git
synced 2024-12-04 17:07:28 +03:00
336a934d18
* Closes #2032. * Adds the `juvix dev core normalize` command. * Adds the `:n` command in JuvixCore REPL. * Adds the `--normalize` flag to `juvix dev core read` and `juvix dev core from-concrete`. * Adds `pipeline-normalize` which denotes pipeline steps necessary before normalization. * Adds normalization tests in `tests/VampIR/positive/Core`.
30 lines
357 B
Plaintext
30 lines
357 B
Plaintext
-- mutual recursion
|
|
|
|
def g : Int -> Int;
|
|
|
|
def f : Int -> Int := \(x : Int) {
|
|
if x < 1 then
|
|
1
|
|
else
|
|
2 * x + g (x - 1)
|
|
};
|
|
|
|
def h : Int -> Int;
|
|
|
|
def g : Int -> Int := \(x : Int) {
|
|
if x < 1 then
|
|
1
|
|
else
|
|
x + h (x - 1)
|
|
};
|
|
|
|
def h : Int -> Int := \(x : Int) {
|
|
if x < 1 then
|
|
1
|
|
else
|
|
x * f (x - 1)
|
|
};
|
|
|
|
\(x : Int) \(y : Int)
|
|
f x + f y
|