-
Notifications
You must be signed in to change notification settings - Fork 717
feat: better universe normalization #8769
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
base: master
Are you sure you want to change the base?
Changes from 4 commits
1ed0538
aaed391
f9f3323
00ba1a2
6c06b91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -359,10 +359,10 @@ private def isExplicitSubsumed (lvls : Array Level) (firstNonExplicit : Nat) : B | |
| let max := lvls[firstNonExplicit - 1]!.getOffset | ||
| isExplicitSubsumedAux lvls max firstNonExplicit | ||
|
|
||
| partial def normalize (l : Level) : Level := | ||
| partial def normalize (l : Level) (offset := 0): Level := | ||
| if isAlreadyNormalizedCheap l then l | ||
| else | ||
| let k := l.getOffset | ||
| let k := offset + l.getOffset | ||
| let u := l.getLevelOffset | ||
| match u with | ||
| | max l₁ l₂ => | ||
|
|
@@ -376,11 +376,16 @@ partial def normalize (l : Level) : Level := | |
| let prevK := lvl₁.getOffset | ||
| mkMaxAux lvls k (i+1) prev prevK levelZero | ||
| | imax l₁ l₂ => | ||
| if l₂.isNeverZero then addOffset (normalize (mkLevelMax l₁ l₂)) k | ||
| if l₂.isNeverZero then normalize (mkLevelMax l₁ l₂) k | ||
| else | ||
| let l₁ := normalize l₁ | ||
| let l₂ := normalize l₂ | ||
| addOffset (mkIMaxAux l₁ l₂) k | ||
| match l₂ with | ||
| | max l₂ l₃ => | ||
| normalize (mkLevelMax (mkIMaxAux l₁ l₂) (mkIMaxAux l₁ l₃)) k | ||
|
||
| | imax l₂ l₃ => | ||
| normalize (mkIMaxAux (mkLevelMax l₁ l₂) l₃) k | ||
| | _ => addOffset (mkIMaxAux l₁ l₂) k | ||
| | _ => unreachable! | ||
|
|
||
| /-- | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| universe u v w | ||
|
|
||
| variable (A : Type u) (B : Sort v) | ||
|
|
||
| /-- info: A → A → B : Sort (imax (u + 1) v) -/ | ||
| #guard_msgs in | ||
| #check A → A → B |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming this is meant to make
normalize l offequivalent toaddOffset (normalize l) off? Then surely thethenpart of here should returnaddOffset l offThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I'll just remove the offset for now (I mainly just wanted for the function to be tail-recursive).