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

Agda considers module parameters to be flexible for interactive case splitting #1653

Closed
jespercockx opened this issue Sep 18, 2015 · 2 comments
Assignees
Labels
modules Issues relating to the module system type: bug Issues and pull requests about actual bugs ux: case splitting Issues relating to the case split ("C-c C-c") command
Milestone

Comments

@jespercockx
Copy link
Member

Minimal example:

open import Common.Equality
module _ (A : Set₁) where
  foo : A ≡ Set → Set
  foo e = {!e!}

When case splitting on e, Agda produces foo refl = ?, which is an error. Either module parameters shouldn't be flexible, or there should be some mechanism supporting specialization of module parameters (could maybe be useful sometimes).

@andreasabel
Copy link
Member

I notice that TC.Coverage.computeNeighbourhood gets a different "telescope before split point" delta1, depending on whether we are interactive (A : Set1 is included) or not (it is not there). So it seems we have to put interactive splitting into the right module context (it is in top context, seemingly).

@andreasabel andreasabel self-assigned this Sep 19, 2015
@andreasabel
Copy link
Member

The original problem is easily fixed by stripping the module parameters from the split clause:

-  (casectxt, f, clause@(Clause{ clauseTel = tel, clausePerm = perm, namedClausePats = ps })) <- findClause meta
+  (casectxt, f, cl) <- findClause meta
+  vs <- take <$> (getModuleFreeVars =<< currentModule) <*> getContextArgs
+  let clause@(Clause{ clauseTel = tel, clausePerm = perm, namedClausePats = ps }) = cl `apply` vs

However, then case splitting for extended lambda does not work anymore (too many patterns are dropped during printing). Extended Lambda has some magic which I do not really understand.
Giving up.

@andreasabel andreasabel removed their assignment Sep 30, 2015
@andreasabel andreasabel added type: bug Issues and pull requests about actual bugs modules Issues relating to the module system ux: case splitting Issues relating to the case split ("C-c C-c") command labels Nov 19, 2015
@andreasabel andreasabel added this to the 2.5.2 milestone Jun 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules Issues relating to the module system type: bug Issues and pull requests about actual bugs ux: case splitting Issues relating to the case split ("C-c C-c") command
Projects
None yet
Development

No branches or pull requests

3 participants