We may fail to type check auxiliary definitions that use rec_fn_macro. The problem is that this macro cannot be unfolded. So, we fix the problem by not type checking them. We add them as constants, and store the definition in an auxiliary vector.
9 lines
276 B
Text
9 lines
276 B
Text
inductive tree (A : Type*)
|
|
| leaf : A -> tree
|
|
| node : list tree -> tree
|
|
|
|
def foo {A : Type*} : nat → tree A → nat
|
|
| 0 _ := 0
|
|
| (n+1) (tree.leaf a) := 0
|
|
| (n+1) (tree.node []) := foo n (tree.node [])
|
|
| (n+1) (tree.node (x::xs)) := foo n x
|