-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JuvixTree "apply" transformation (#2595)
* Moves the "apply" transformation from JuivxAsm to JuvixTree. This transformation removes the `CallClosures` nodes. * Makes Nockma compilation tests use JuvixTree instead of JuvixAsm files. * Depends on #2594 * Depends on #2590 * Depends on #2589 * Depends on #2587
- Loading branch information
Showing
42 changed files
with
305 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
function juvix_apply_1(*, *) : *; | ||
function juvix_apply_2(*, *, *) : *; | ||
function juvix_apply_3(*, *, *, *) : *; | ||
function juvix_apply_4(*, *, *, *, *) : *; | ||
|
||
function juvix_apply_1(*, *) : * { | ||
br(eq(1, argsnum(arg[0]))) { | ||
true: call(arg[0], arg[1]) | ||
false: cextend(arg[0], arg[1]) | ||
} | ||
} | ||
|
||
function juvix_apply_2(*, *, *) : * { | ||
save[n](argsnum(arg[0])) { | ||
br(eq(2, n)) { | ||
true: call(arg[0], arg[1], arg[2]) | ||
false: br(eq(1, n)) { | ||
true: call[juvix_apply_1](call(arg[0], arg[1]), arg[2]) | ||
false: cextend(arg[0], arg[1], arg[2]) | ||
} | ||
} | ||
} | ||
} | ||
|
||
function juvix_apply_3(*, *, *, *) : * { | ||
save[n](argsnum(arg[0])) { | ||
br(eq(3, n)) { | ||
true: call(arg[0], arg[1], arg[2], arg[3]) | ||
false: br(lt(3, n)) { | ||
true: cextend(arg[0], arg[1], arg[2], arg[3]) | ||
false: br(eq(2, n)) { | ||
true: call[juvix_apply_1](call(arg[0], arg[1], arg[2]), arg[3]) | ||
false: call[juvix_apply_2](call(arg[0], arg[1]), arg[2], arg[3]) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
function juvix_apply_4(*, *, *, *, *) : * { | ||
save[n](argsnum(arg[0])) { | ||
br(eq(4, n)) { | ||
true: call(arg[0], arg[1], arg[2], arg[3], arg[4]) | ||
false: br(lt(4, n)) { | ||
true: cextend(arg[0], arg[1], arg[2], arg[3], arg[4]) | ||
false: br(eq(3, n)) { | ||
true: call[juvix_apply_1](call(arg[0], arg[1], arg[2], arg[3]), arg[4]) | ||
false: br(eq(2, n)) { | ||
true: call[juvix_apply_2](call(arg[0], arg[1], arg[2]), arg[3], arg[4]) | ||
false: call[juvix_apply_3](call(arg[0], arg[1]), arg[2], arg[3], arg[4]) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.