You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please put an X between the brackets as you perform the following steps:
Check that your issue is not already filed.
Reduce the issue to a minimal, self-contained, reproducible test case.
Test your test case against the latest nightly release.
Description
The following code
structureValVar (D: Type) where
d: D
x: Nat
defSet (T : Type) := T → PropstructureSalgwhereD: Type
I: Nat
defnatSalg: Salg := { D := Nat, I := 42 }
inductiveHasMem (salg: Salg): Set (Set (ValVar salg.D))
| hasMem
(set: Set (ValVar salg.D))
(isElem: set ⟨d, x⟩)
:
HasMem salg set
defvalVarSet: Set (ValVar Nat) :=
fun ⟨d, x⟩ => x = 0 ∧ d = 0 ∧ d ∉ []
defvalVarSetHasMem: HasMem natSalg valVarSet :=
HasMem.hasMem
valVarSet
(show valVarSet _ from ⟨rfl, rfl, nofun⟩)
throws (kernel) declaration has metavariables 'valVarSetHasMem'.
There is a list of things that make the issue go away (which is also why I couldn't come up with a more specific title -- I've no idea what the underlying cause is :sorry:):
removing x from ValVar, along with its occurences in the rest of the program
removing I from Salg
removing the salg param from HasMem & replacing occurences with natSalg
removing d ∉ [] from the definition of valVarSet
replacing HasMem.hasMem valVarSet with HasMem.hasMem _ in valVarSetHasMem.
replacing show valVarSet _ from with show _ from, show valVarSet ⟨0, 0⟩ from, or removing it entirely.
Note: this issue's example doesn't typecheck on a recent Lean, I think because of the changes in #6024. In the tests for #6414 I added the following unification hint to make up for the difference:
unif_hint (s : Salg) where
s =?= natSalg
|-
Salg.D s =?= Nat
Unfortunately, this covers up the issue in 4.14. I figure it's still worth including the example in #6414 as a regression test, but it would be better if we could observe that this issue has been fixed.
Prerequisites
Please put an X between the brackets as you perform the following steps:
Description
The following code
throws
(kernel) declaration has metavariables 'valVarSetHasMem'
.There is a list of things that make the issue go away (which is also why I couldn't come up with a more specific title -- I've no idea what the underlying cause is :sorry:):
x
from ValVar, along with its occurences in the rest of the programI
fromSalg
salg
param fromHasMem
& replacing occurences withnatSalg
d ∉ []
from the definition ofvalVarSet
HasMem.hasMem valVarSet
withHasMem.hasMem _
invalVarSetHasMem
.show valVarSet _ from
withshow _ from
,show valVarSet ⟨0, 0⟩ from
, or removing it entirely.Expected behavior: The code throws no errors.
Versions
Version: Lean 4.14.0-nightly-2024-11-01
Platform: live.lean-lang.org
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: