-
Notifications
You must be signed in to change notification settings - Fork 339
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
Loss of subject reduction with Setω #5810
Comments
The only theoretical work in this area (first-class level types and |
In type theories with subtyping, reduction may produce something of a more precise type. So, with {-# OPTIONS --no-cumulativity #-}
{-# OPTIONS --double-check #-}
{-# OPTIONS -v tc.check.internal:20 #-}
open import Agda.Primitive
record ⊤ : Set where
bad : Setω
bad = (λ (ℓ : ⊤ → Level) → ∀ t → Set (ℓ t)) (λ _ → lzero)
-- checking internal (t : ⊤) → Set lzero : Setω |
Perhaps it would make more sense to only assign type |
Actually the occurrence of |
…pendent under substitution This doesn't work yet, since the builtin modules fail to compile
I have implemented an experimental fix for this issue, which you can find at https://github.com/jespercockx/agda/tree/Issue5810. However the builtin cubical modules fail to compile with it. Specifically, I get an error on the type of primComp : ∀ {ℓ} (A : (i : I) → Set (ℓ i)) {φ : I} (u : ∀ i → Partial φ (A i)) (a : A i0) → A i1 The problem here is in the type of I'm summoning the cubical overlords @Saizan @mortberg @plt-amy so hopefully they can give me an idea what the sort of |
Ah, we're being bitten in the behind by comp/transp taking a line of levels. Here's what @Saizan had to say on this when it last came up: #3722 (comment). I think the right move is:
We can't transport/compose in Setω anyway, so it wouldn't be a big loss to change primComp/primTransp to take |
So to experiment I disabled my check when
In addition, many error messages get more cluttered with extra "Has PTS rule: ..." constraints (Issue399.agda, Issue2344.agda, Issue2420.agda, Issue2834.agda, Issue2927.agda, Issue3044.agda, Issue4401.agda, ...) Personally I am more worried about these because they will make Agda's constraints (even) harder to read. Since these PTS constraints always arise from unsolved metavariables, perhaps we could hide them from the constraint output by default (and allow toggling them on with a flag perhaps). I am also trying my fix on the std-lib, and I run into problems with the Sets : ∀ n (ls : Levels n) → Set (Level.suc (⨆ n ls)) This shows a more serious limitation of my current attempt: the level It feels to me that this might require some more discussion and careful thought before we can have a fix that is both sufficient and does not break a bunch of sensible existing code that plays around with universe levels. Because of this and since this is not a regression, I am bumping this to 2.6.4. |
Setomega is really a truncation of what would be naturally ordinal levels. Say we have construction for limit levels
then We currently round up every limit on levels to omega and assign universe |
If cumulativity is added for |
I’d second @andreasabel’s suggestion. The text of this issue might be misleading as I didn’t know what to expect at first, so I hinted that subject reduction should be restored. [ On the other hand, not directly relevant to this issue, what is first-class universe level anyway? Can we learn something from @AndrasKovacs‘s work and lay the groundwork of what Agda is using precisely? ] |
Could you elaborate why? |
Lots of code breaks if Furthermore the current implementation of cumulativity is experimental, it is hidden behind a flag, and it is not compatible with |
Yes, but we could make Setomega cumulative and leave the other universes alone. So, we do not need to enable |
Having subtyping
|
I don't want to have any subtyping enabled by default (unless perhaps if someone finds a good way to combine subtyping with Agda's treatment of meta-variables). |
Subject reduction is lost with
Setω
. Considerwhose type is
Setω
but after normalisation it becomeswhose type is now
Set₁
. Indeed, if we fill the hole with the normalised expression byC-c C-m
, Agda happily produces the second expression and complains about the term it just produced ... Any idea?The text was updated successfully, but these errors were encountered: