Zulip Chat Archive

Stream: general

Topic: meta mutual def errors


Mario Carneiro (Aug 24 2018 at 13:54):

Does anyone know the source of this error? I get unexpected error, failed to generate equational lemmas in the front-end even though it's a meta def so it shouldn't have equations

meta mutual def A, B
with A : unit  tactic unit | _ := return ()
with B : unit  tactic unit | _ := return ()

Scott Morrison (Aug 24 2018 at 13:57):

(Mario and I are sitting next to each other and just discovered the curious answer. I'll explain while he does something useful. :-)

Scott Morrison (Aug 24 2018 at 13:57):

This doesn't work:

meta mutual def A, B
with A : ℕ → ℕ
| n := 0
with B : ℕ → ℕ
| n := 0

Scott Morrison (Aug 24 2018 at 13:58):

with the same error.

Scott Morrison (Aug 24 2018 at 13:58):

However

meta mutual def A, B
with A : ℕ → ℕ
| 0 := 0
| (n+1) := B 0
with B : ℕ → ℕ
| n := 0

Scott Morrison (Aug 24 2018 at 13:58):

or even

meta mutual def A, B
with A : ℕ → ℕ
| 0 := 0
| (n+1) := A 0
with B : ℕ → ℕ
| n := 0

Scott Morrison (Aug 24 2018 at 13:59):

Somehow the compiler is insisting that the definitions actually refer to either themselves or each other.

Scott Morrison (Aug 24 2018 at 13:59):

And this only happens in meta.

Scott Morrison (Aug 24 2018 at 14:00):

Oh well! :-)


Last updated: Dec 20 2023 at 11:08 UTC