We use the auxiliary procedure pull_nested_rec_fn to pull recursive application in nested match expressions. This is needed because the nested match expression is compiled before we process the recursive procedure that contains it. This transformation may produce performance problems if the recursive application does not depend on the data being matched. Here is an example from the new test: ``` def tst : tree → nat | (tree.leaf v) := v | (tree.node v l r) := match f v with | tt := tst l | ff := tst r end ``` pull_nested_rec_fn will convert it into ``` def tst : tree → nat | (tree.leaf v) := v | (tree.node v l r) := tst._match_1 (f v) (tst l) (tst r) ``` Since our interpreter uses eager evaluation, both `(tst l)` and `(tst r)` are executed. This commit fixes this issue by expanding `tst._match_1` during code generation. |
||
|---|---|---|
| .. | ||
| lean | ||
| .gitignore | ||