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

type-in-type and spurious levels #3073

Closed
sattlerc opened this issue May 22, 2018 · 2 comments
Closed

type-in-type and spurious levels #3073

sattlerc opened this issue May 22, 2018 · 2 comments
Assignees
Labels
eta η-expansion of metavariables and unification modulo η subject reduction If you look away, this issue will reduce to a term with a different type type: bug Issues and pull requests about actual bugs type-in-type
Milestone

Comments

@sattlerc
Copy link
Contributor

I know the current implementation has been described as a hack, so probably this bug is known.

{-# OPTIONS --type-in-type #-}
module Strange where

Set' :  i  Set _
Set' i = Set i

postulate
  A : Set
  a : A
  T : Set  Set
  comp : (P : A  Set) (g : (a : A)  P a)  P a
  foo :  i (Q : A  Set' i)  T (comp _ Q)
  -- (no issue if Set' is replaced by Set)

bar : T {!_!}
bar = foo _ _

Giving the underscore at the interaction point yields the following error message:

A !=< .Agda.Primitive.Level of type Set
when checking that the expression _ has type Set

This looks like some de Brujin index mismatch.

@UlfNorell UlfNorell added the type: bug Issues and pull requests about actual bugs label Jun 1, 2018
@UlfNorell UlfNorell added this to the 2.5.5 milestone Jun 1, 2018
@UlfNorell UlfNorell modified the milestones: 2.6.0, 2.6.1 Dec 6, 2018
@jespercockx jespercockx self-assigned this Oct 15, 2019
@jespercockx
Copy link
Member

The cause seems to be in the call to etaOnce in instantiateFull: this is eta-contracting \(A : Set) -> Set' lzero to Set', which is absolutely wrong. The check that the type of the domain is indeed Level is simply missing. However, it is not easy to add it because instantiateFull is not type-directed. Instead, I will try to remove it and see if anything breaks.

@jespercockx
Copy link
Member

Removing the ill-typed eta-contraction did not break anything in the test suite, so I went ahead and pushed it.

@jespercockx jespercockx added eta η-expansion of metavariables and unification modulo η subject reduction If you look away, this issue will reduce to a term with a different type labels Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eta η-expansion of metavariables and unification modulo η subject reduction If you look away, this issue will reduce to a term with a different type type: bug Issues and pull requests about actual bugs type-in-type
Projects
None yet
Development

No branches or pull requests

3 participants