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
Add support for Setω+n #4609
Add support for Setω+n #4609
Conversation
I'm just trying this out, and fixing #4109 in particular has made it much easier to do some reasoning about reflected terms in macros, so thanks for that! In particular I can now have a data structure data _Reflects_ : {a : Level} {A : Set a} → Term → A → Setω where
... to express that a reflected term corresponds to a particular real term, which then makes it easier to safely manipulate and analyse real terms according to their structure. |
Quick note: When I try C-c C-c to case split on an instance of a data type in
Is that something that should be changed? Edit: Actually, it won't let me pattern match at all on such a datatype. It's not just the editor integration. I guess that needs to be fixed to make |
Would it just be a case of stopping it from triggering the error, in this code? agda/src/full/Agda/TypeChecking/Rules/LHS.hs Lines 1759 to 1773 in 1f17ae4
|
2fee73a
to
68ca6c5
Compare
Indeed, that's it. I added a fix. |
So I noticed that the printing of |
I wonder if there would be some way to make |
See #4093. |
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.
LGTM.
I do not grasp the change in its entirety, but we'll see it once people start using it.
For printing, we should consider using subscripts like for Set_1
: Set\omega_1
etc.
equalType (El Inf $ apply tSub $ a : map (setHiding NotHidden) [bA,phi,u]) | ||
(El Inf $ apply tSub $ a : map (setHiding NotHidden) [bA',phi',u']) | ||
compareAtom cmp (AsTermsOf $ El Inf $ apply tSub $ a : map (setHiding NotHidden) [bA,phi,u]) | ||
equalType (El (Inf 0) $ apply tSub $ a : map (setHiding NotHidden) [bA,phi,u]) |
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.
Looks hackish.
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 agree. I'm not sure why Inf
is needed here in the first place, but I guess it is because there is no dedicated sort for non-fibrant types like the interval / face lattice of cubical. Maybe @Saizan can comment on this.
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.
Inf
is the sort of tSub
and a few other cubical primitives.
Indeed that's because it's outside the range of sorts indexed by a Level
, which are the ones with composition, is that still the case after this PR?
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.
It's still the case that Inf
is outside of the range of sorts that are indexed by Level
, but it is no longer disallowed to split on types in it. So it would probably be good to move the interval to its own sort if this PR is merged.
Now But how will the user rename An alternative would be to change the current behaviour of the empty module and allowing the old behaviour with a new import command-line option maybe |
Can you make sure it's still impossible to split on the |
The most robust way to do this would be to give the interval its own sort. |
I rebased this PR on the current master after the fix of #4093, and added the concrete syntax |
Actually the coverage checker is forbidding splitting on the interval in the |
Ok, I was already suspecting something like that because there were no failing tests. So I will go ahead and merge this then. |
Together with the addition of Setω+i, this ensures that every closed Agda sort has a successor sort. Note that this change currently has no effect since SizeUniv is defined to be equal to Set0.
I am hyped. Thanks @jespercockx for this PR! |
Documentation for PR agda#4609
…nual (#4645) * added piSort UnivSort funSort to user-manual * Update universe-levels.lagda.rst Typos found by Andreas * added sort-system to doc * additional explanations on funSort and PiSort * piSort and comments - minor * case issue and note internal constructors * added Setω+n to sort system in doc Documentation for PR #4609 * added names for Setω+n to lexical structures in docs Also updated links in sorts system page. * updated `i` is a natural number expression * `i` can only be a literal natural number Also reverted the addition of Setω as keyword in lexical-structure.
This PR adds internal syntax and typing rules for a second universe hierarchy
Setω+n
, which sits on top of Agda's regular universe hierarchy. UnlikeSet i
, this hierarchy is not polymorphic, so it is not possible to quantify over allSetω+n
at once. This is my proposed answer to #4595 and fixes issues #2119, #4109, and #4585.Note that there is no concrete syntax yet for
Setω+n
(except in error messages). I tried to add it in the same way as I did forSetω
, but adding an infinite number of builtins is hard. Instead, it might be necessary to add hardcoded support for it in the parser, unless someone can think of a better solution.