-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve original parameter names in residual code
Closes #28.
- Loading branch information
Showing
33 changed files
with
208 additions
and
124 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
main(m, n) := Combine(1u32, 3u32, 7u32, 13u32, f0(m, n)); | ||
|
||
f0(x0, x1) := match =(x0, 0u32) { | ||
F() -> match =(x1, 0u32) { | ||
F() -> f0(-(x0, 1u32), f0(x0, -(x1, 1u32))), | ||
T() -> f0(-(x0, 1u32), 1u32) | ||
f0(m, n) := match =(m, 0u32) { | ||
F() -> match =(n, 0u32) { | ||
F() -> f0(-(m, 1u32), f0(m, -(n, 1u32))), | ||
T() -> f0(-(m, 1u32), 1u32) | ||
}, | ||
T() -> +(x1, 1u32) | ||
T() -> +(n, 1u32) | ||
}; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
main(x) := Combine(f0(x), Panic("666")); | ||
|
||
f0(x0) := f0(x0); | ||
f0(x) := f0(x); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
main(xs, op1, op2) := f1(op1, op2, xs); | ||
|
||
f0(x0, x1) := match x1 { | ||
f0(x0, op1) := match op1 { | ||
F() -> +(x0, 5i32), | ||
G() -> /(x0, 10i32), | ||
H() -> *(x0, x0) | ||
}; | ||
|
||
f1(x0, x1, x2) := match x2 { | ||
Cons(x3, x4) -> Cons(f0(f0(x3, x0), x1), f1(x0, x1, x4)), | ||
f1(op1, op2, xs) := match xs { | ||
Cons(x0, x1) -> Cons(f0(f0(x0, op1), op2), f1(op1, op2, x1)), | ||
Nil() -> Nil() | ||
}; |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
main(xs, ys, zs) := f0(xs, ys, zs); | ||
|
||
f0(x0, x1, x2) := match x0 { | ||
Cons(x3, x4) -> Cons(x3, f0(x4, x1, x2)), | ||
Nil() -> f1(x1, x2) | ||
f0(xs, ys, zs) := match xs { | ||
Cons(x0, x1) -> Cons(x0, f0(x1, ys, zs)), | ||
Nil() -> f1(ys, zs) | ||
}; | ||
|
||
f1(x0, x1) := match x0 { | ||
Cons(x2, x3) -> Cons(x2, f1(x3, x1)), | ||
Nil() -> x1 | ||
f1(ys, zs) := match ys { | ||
Cons(x0, x1) -> Cons(x0, f1(x1, zs)), | ||
Nil() -> zs | ||
}; |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
main(xs) := f0(xs); | ||
|
||
f0(x0) := match x0 { | ||
Cons(x1, x2) -> Cons(*(*(x1, x1), *(x1, x1)), f0(x2)), | ||
f0(xs) := match xs { | ||
Cons(x0, x1) -> Cons(*(*(x0, x0), *(x0, x0)), f0(x1)), | ||
Nil() -> Nil() | ||
}; |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
main(n) := Combine(1u32, 1u32, 2u32, 6u32, 24u32, 120u32, f0(n)); | ||
|
||
f0(x0) := match =(x0, 0u32) { | ||
F() -> *(x0, f0(-(x0, 1u32))), | ||
f0(n) := match =(n, 0u32) { | ||
F() -> *(n, f0(-(n, 1u32))), | ||
T() -> 1u32 | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
main(xs) := f0(xs); | ||
|
||
f0(x0) := match x0 { | ||
Branch(x1, x2) -> +(f1(x1), f1(x2)), | ||
Leaf(x1) -> x1 | ||
f0(xs) := match xs { | ||
Branch(x0, x1) -> +(f1(x0), f1(x1)), | ||
Leaf(x0) -> x0 | ||
}; | ||
|
||
f1(x0) := f0(x0); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
main(n) := Combine(91i32, 91i32, 91i32, 91i32, 92i32, 93i32, f0(n)); | ||
|
||
f0(x0) := match >(x0, 100i32) { | ||
F() -> f0(f0(+(x0, 11i32))), | ||
T() -> -(x0, 10i32) | ||
f0(n) := match >(n, 100i32) { | ||
F() -> f0(f0(+(n, 11i32))), | ||
T() -> -(n, 10i32) | ||
}; |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
main(xs) := f0(xs); | ||
|
||
f0(x0) := match x0 { | ||
Cons(x1, x2) -> match x2 { | ||
Cons(x3, x4) -> +(*(2i32, x1), +(*(3i32, x3), f0(x4))), | ||
Nil() -> +(*(2i32, x1), 0i32) | ||
f0(xs) := match xs { | ||
Cons(x0, x1) -> match x1 { | ||
Cons(x2, x3) -> +(*(2i32, x0), +(*(3i32, x2), f0(x3))), | ||
Nil() -> +(*(2i32, x0), 0i32) | ||
}, | ||
Nil() -> 0i32 | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
main(x, y) := Pair(f0(x), f0(y)); | ||
|
||
f0(x0) := match x0 { | ||
A(x1) -> B(x1), | ||
C(x1) -> D(x1) | ||
f0(x) := match x { | ||
A(x0) -> B(x0), | ||
C(x0) -> D(x0) | ||
}; |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
main(xs) := f0(xs); | ||
|
||
f0(x0) := match x0 { | ||
Branch(x1, x2) -> +(f1(x1), f1(x2)), | ||
Leaf(x1) -> *(x1, x1) | ||
f0(xs) := match xs { | ||
Branch(x0, x1) -> +(f1(x0), f1(x1)), | ||
Leaf(x0) -> *(x0, x0) | ||
}; | ||
|
||
f1(x0) := f0(x0); |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
main(xs) := f0(xs); | ||
|
||
f0(x0) := match x0 { | ||
Cons(x1, x2) -> +(*(x1, x1), f0(x2)), | ||
f0(xs) := match xs { | ||
Cons(x0, x1) -> +(*(x0, x0), f0(x1)), | ||
Nil() -> 0i32 | ||
}; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
main(x, _y, _z) := f0(_y, _z, x); | ||
|
||
f0(x0, x1, x2) := f0(x2, x2, x2); | ||
f0(_y, _z, x) := f0(x, x, x); |
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.