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
cubicalCubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transptype: enhancementIssues and pull requests about possible improvementsux: error reportingIssues to do with how Agda reports errors
This is surely well-known but I haven’t found a bug report about it. I find it quite difficult to work with cubical Agda because the constraint reporting on end points is incomprehensible. See for instance the code below.
{-# OPTIONS --cubical #-}open importCubical.Core.EverythingpublicpostulateA :Seta b a' b' : A
p : a ≡ b
test : a' ≡ b'
test i = hcomp (λ j → (λ {(i = i0) →?; (i = i1) →?})) (p i)
Current output when doing C-c C-l:
?0 : A
?1 : A
_15 : A [ at /tmp/xx.agda:11,10-68 ]
_16 : A [ at /tmp/xx.agda:11,10-68 ]
———— Errors ————————————————————————————————————————————————
Failed to solve the following constraints:
a' = _16 (i = i0) : A
b' = _16 (i = i1) : A
_15
:= λ i →
hcomp (λ j → λ { (i = i0) → ?0 (j = j) ; (i = i1) → ?1 (j = j) })
(p i)
[blocked on problem 20]
[20] b = ?1 (j = i0) : A
[20] a = ?0 (j = i0) : A
Expected output:
?0 : A
?1 : A
———— Constraints ————————————————————————————————————————————————
?0 (j = i0) = a : A
?0 (j = i1) = a' : A
?1 (j = i0) = b : A
?1 (j = i1) = b' : A
In addition, there shouldn’t be any yellow in this file.
Agda uses yellow for both unsolved metas and unsolved constraints. Originally 'constraint' meant 'equality constraint' but a lot of other constraints have been added since, including postponed typechecking problem 'constraints' x : A.
[...] has an unsolved "constraint", namely that ?0 : A, yet there shouldn’t be any yellow.
Actually I think there is yellow but it's hidden by the hole.
Ah ok. So then maybe that the two constraints ?0 (j = i0) = a and ?0 (j = i1) = a' should be considered to be constraints about ?0 and therefore be hidden by the hole as well, and similarly for ?1?
I feel like for unsolved constraints that are blocked on an interaction meta, the yellow is often not very helpful. OTOH if there are no more interaction holes but still unsolved constraints then I really want to see the highlighting. So maybe we should try to keep track of which meta a constraint is blocked on (I think in principle we do already but it's not very accurate) and wait with displaying constraints blocked on interaction metas.
Or we could even only highlight constraints that are not blocked on any meta (but still unsolved). After all, if there are unsolved metas they will be highlighted already and this will often give you a better idea of the location where to insert the implicit argument.
I feel like for unsolved constraints that are blocked on an interaction meta, the yellow is often not very helpful. OTOH if there are no more interaction holes but still unsolved constraints then I really want to see the highlighting. So maybe we should try to keep track of which meta a constraint is blocked on (I think in principle we do already but it's not very accurate) and wait with displaying constraints blocked on interaction metas.
Do you have an example of code with no interaction metas and no unsolved metas, but still unsolved constraints? I had the impression that because type-checking and conversion are decidable, if there is no unsolved metas then all type-checking/equality constraints are either provably true or provably false, so I do not see when it is needed to have yellow for unsolved constraints.
@guillaumebrunerie As far as I understand there has to be an unsolved meta, but what gets highlighted is the code which depends on the constraint being satisfied to successfully typecheck.
Also the "_15" and "_16" metas are generated because some terms are blocked on the resolution of a constraint. Agda replaces those terms by metas (storing what they should eventually be), so that it doesn't have to deal with ill-typed terms internally. I agree it's not something (most) users want to see though.
@guillaumebrunerie My last commit should have improved the situation with hcomp and friends.
At least the constraints shown are more readable:
———— Errors ————————————————————————————————————————————————
Failed to solve the following constraints:
a' = ?0 (j = i1) : A
b' = ?1 (j = i1) : A
_15 := λ i → p i [blocked on problem 20]
[20] b = ?1 (j = i0) : A
[20] a = ?0 (j = i0) : A
I also plan on having something more systematic at least for interaction points in positions like foo .... = ?, but let me know if you have other bad experiences with arguments to hcomp/transp/comp.
cubicalCubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transptype: enhancementIssues and pull requests about possible improvementsux: error reportingIssues to do with how Agda reports errors
Activity
Saizan commentedon Mar 4, 2019
How so? There's plenty of unsatisfied constraints around.
I mean, I agree that it's annoying to have so much yellow around, but yellow for unsolved constraints is a fairly expected UI principle of agda.
guillaumebrunerie commentedon Mar 4, 2019
Maybe I’m using the word "constraints" in a wrong way here, but I thought that yellow meant unsolved metas, not unsolved constraints.
For instance
has an unsolved "constraint", namely that
?0 : A, yet there shouldn’t be any yellow.jespercockx commentedon Mar 4, 2019
Agda uses yellow for both unsolved metas and unsolved constraints. Originally 'constraint' meant 'equality constraint' but a lot of other constraints have been added since, including postponed typechecking problem 'constraints'
x : A.Actually I think there is yellow but it's hidden by the hole.
guillaumebrunerie commentedon Mar 4, 2019
Ah ok. So then maybe that the two constraints
?0 (j = i0) = aand?0 (j = i1) = a'should be considered to be constraints about?0and therefore be hidden by the hole as well, and similarly for?1?jespercockx commentedon Mar 4, 2019
I feel like for unsolved constraints that are blocked on an interaction meta, the yellow is often not very helpful. OTOH if there are no more interaction holes but still unsolved constraints then I really want to see the highlighting. So maybe we should try to keep track of which meta a constraint is blocked on (I think in principle we do already but it's not very accurate) and wait with displaying constraints blocked on interaction metas.
jespercockx commentedon Mar 4, 2019
Or we could even only highlight constraints that are not blocked on any meta (but still unsolved). After all, if there are unsolved metas they will be highlighted already and this will often give you a better idea of the location where to insert the implicit argument.
gallais commentedon Mar 4, 2019
Technically we actively remove interaction metas from the set of metas that should
be highlighted. But the result is the same: they are not displayed.
guillaumebrunerie commentedon Mar 4, 2019
In any case, in addition to the issue about the yellow:
_15and_16come from?)guillaumebrunerie commentedon Mar 4, 2019
Do you have an example of code with no interaction metas and no unsolved metas, but still unsolved constraints? I had the impression that because type-checking and conversion are decidable, if there is no unsolved metas then all type-checking/equality constraints are either provably true or provably false, so I do not see when it is needed to have yellow for unsolved constraints.
Saizan commentedon Mar 4, 2019
@guillaumebrunerie As far as I understand there has to be an unsolved meta, but what gets highlighted is the code which depends on the constraint being satisfied to successfully typecheck.
Also the "_15" and "_16" metas are generated because some terms are blocked on the resolution of a constraint. Agda replaces those terms by metas (storing what they should eventually be), so that it doesn't have to deal with ill-typed terms internally. I agree it's not something (most) users want to see though.
guillaumebrunerie commentedon Mar 4, 2019
@Saizan Ah, that makes sense.
The
_15and_16and the "error" are actually not related to cubical, so I filed #3606 (although it does come up very often when usinghcomp).[ Re #3605 ] Block arguments of constrained prims, not applications
Saizan commentedon Mar 5, 2019
@guillaumebrunerie My last commit should have improved the situation with
hcompand friends.At least the constraints shown are more readable:
I also plan on having something more systematic at least for interaction points in positions like
foo .... = ?, but let me know if you have other bad experiences with arguments tohcomp/transp/comp.Saizan commentedon Dec 2, 2019
The original reported example looks fairly good now.
I'm leaving this up for improvements to the "interaction boundaries" machinery.
Such as propagating boundaries through introductions and other possible cases.