Open blaxill opened 1 year ago
Here is another example of this issue:
inductive Tree : Nat → Type where
| node : {n : Nat} → List (Tree n) → Tree (n + 1)
I expect this will be an idiom that programming language theory users will want often (e.g. expressions with their context as index and n-ary binders).
But (at least with the current architecture) support for this would require significant extra complexity in the Lean kernel, which we of course want to avoid. So for now the best advise is to expand the data types you are recursing through into mutual
datatypes.
Prerequisites
Description
The definition of
Foo1
below succeeds, butFoo2
fails with the error(kernel) invalid nested inductive datatype 'Prod', nested inductive datatypes parameters cannot contain local variables.
Expected behavior: The definition of both
Foo1
andFoo2
to succeed.Actual behavior:
Foo2
fails with the error(kernel) invalid nested inductive datatype 'Prod', nested inductive datatypes parameters cannot contain local variables.
Reproduces how often: 100%
Versions
Checked on:
Additional Information
For this trivial example expanding
Prod
works, i.e.but my use case is more complex.