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

hcompU eta rule in conversion checker loses solution #6632

Closed
SquidDev opened this issue May 12, 2023 · 1 comment · Fixed by #6645
Closed

hcompU eta rule in conversion checker loses solution #6632

SquidDev opened this issue May 12, 2023 · 1 comment · Fixed by #6645
Assignees
Labels
conversion Conversion checking for terms, types; Subtyping; Size solving cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp type: bug Issues and pull requests about actual bugs
Milestone

Comments

@SquidDev
Copy link
Contributor

Agda.TypeChecking.Conversion has a rule to eta-expand applications of hcomp.

Def q es | Just q == mHComp, Just (sl:s:args@[phi,u,u0]) <- allApplyElims es
, Sort (Type lvl) <- unArg s
, Just unglueU <- mUnglueU, Just subIn <- mSubIn
-> do
let l = Level lvl
ty <- el' (pure $ l) (pure $ unArg u0)
let bA = subIn `apply` [sl,s,phi,u0]
let mkUnglue m = apply unglueU $ [argH l] ++ map (setHiding Hidden) [phi,u] ++ [argH bA,argN m]
reportSDoc "conv.hcompU" 20 $ prettyTCM (ty,mkUnglue m,mkUnglue n)
compareTerm cmp ty (mkUnglue m) (mkUnglue n)

However, currently this does not trigger as we look up SUBIN as a primitive rather than a builtin, so it's always treated as undefined:

mSubIn <- getPrimitiveTerm' builtinSubIn

However, this rule may be too over-eager and when active can cause failures, as such as seen in this test run (in the defition of lCancelP). @plt-amy informs we we probably need some guards here to avoid over-eagerly applying this rule.

@SquidDev SquidDev added type: bug Issues and pull requests about actual bugs conversion Conversion checking for terms, types; Subtyping; Size solving cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp labels May 12, 2023
@SquidDev SquidDev changed the title hcompU eta rule in conversion checker looses solution hcompU eta rule in conversion checker loses solution May 12, 2023
@SquidDev
Copy link
Contributor Author

Thank you! You're the best!

@andreasabel andreasabel added this to the 2.6.4 milestone May 29, 2023
@andreasabel andreasabel mentioned this issue Jul 21, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conversion Conversion checking for terms, types; Subtyping; Size solving cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp type: bug Issues and pull requests about actual bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants