Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous coercion fixes #1981

Merged
merged 6 commits into from Dec 22, 2022
Merged

Miscellaneous coercion fixes #1981

merged 6 commits into from Dec 22, 2022

Conversation

gebner
Copy link
Member

@gebner gebner commented Dec 21, 2022

These are various fixes to get mathlib to compile again.

@@ -163,6 +163,7 @@ attribute [coe_decl] CoeOTC.coe

instance [CoeOut α β] [CoeOTC β γ] : CoeOTC α γ where coe a := CoeOTC.coe (CoeOut.coe a : β)
instance [CoeTC α β] : CoeOTC α β where coe a := CoeTC.coe a
instance : CoeOTC α α where coe a := a
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already had the reflexivity instance for CoeTC, this just adds them for the other auxiliary classes as well.

@@ -32,26 +32,18 @@ partial def expandCoe (e : Expr) : MetaM Expr :=
return .visit e.headBeta
return .continue

register_builtin_option maxCoeSize : Nat := {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so done with these arbitrary limits. I spent an hour yesterday trying to figure out what broke with the latest update. Why CoeHTCT worked but CoeT didn't, etc.

There's no reason to have a limit here, and I'm not willing to waste any more time debugging the random breakage this causes.

@@ -102,7 +102,7 @@ partial def normLevel (u : Level) : M Level := do
| Level.max v w => return u.updateMax! (← normLevel v) (← normLevel w)
| Level.imax v w => return u.updateIMax! (← normLevel v) (← normLevel w)
| Level.mvar mvarId =>
if !(← isLevelMVarAssignable mvarId) then
if (← getMCtx).getLevelDepth mvarId != (← getMCtx).depth then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an oversight in #1953. The isLevelMVarAssignable used to check for depth equality, irrespective of whether ignoreLevelMVarDepth was set or not. (While other functions like isReadOnly took it into account.) Now these functions all use the same logic.

@gebner
Copy link
Member Author

gebner commented Dec 21, 2022

Merging to unblock the mathlib bump.

@gebner gebner merged commit a90afa8 into master Dec 22, 2022
@gebner gebner deleted the misccoefixes branch December 22, 2022 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant