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

.#modulename-number in goals of open imported parameterised modules #1278

Closed
GoogleCodeExporter opened this issue Aug 8, 2015 · 14 comments
Closed
Assignees
Labels
modules Issues relating to the module system syntax Bike-shedding of the surface syntax type: bug Issues and pull requests about actual bugs ux: display Issues relating to how terms are printed for display
Milestone

Comments

@GoogleCodeExporter
Copy link

GoogleCodeExporter commented Aug 8, 2015

I see strange printing of internal names when I open import a parameterised module in a different file, using the latest git version of Agda. To reproduce, create the following files:

-------------- A.agda --------------
module A (X : Set1) where

  data D : Set where
    d : D
------------------------------------

-------------- B.agda --------------
module B where 

open import A Set

open import Relation.Binary.PropositionalEquality

test : (c : D) -> (c ≡ c)
test d = {!!} -- goal ".#A-60005532.d ≡ .#A-60005532.d"
------------------------------------

If I change "open import A Set" into

import A
open A Set

then the printing problem disappears. It also does not occur if A is not parameterised.

Original issue reported on code.google.com by fredrik....@gmail.com on 8 Sep 2014 at 9:20

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

My bad. I just hacked the parser (Parser.y) to get the sugar open import A Set. The proper solution is to add a new declaration to Syntax.Concrete and process it properly in the Translation.ConcreteToAbstract.

Parser.y:

    ; unique = hashString $ show $ (Nothing :: Maybe ()) <$ r
         -- turn range into unique id, but delete file path
         -- which is absolute and messes up suite of failing tests
         -- (different hashs on different installations)
         -- TODO: Don't use (insecure) hashes in this way.
    ; fresh = Name mr [ Id $ stringToRawName $ ".#" ++ show m ++ "-" ++ show unique ]

Maybe not too difficult to fix?

Original comment by andreas....@gmail.com on 11 Sep 2014 at 9:11

  • Changed state: Accepted

@GoogleCodeExporter GoogleCodeExporter added type: bug Issues and pull requests about actual bugs auto-migrated modules Issues relating to the module system syntax Bike-shedding of the surface syntax ux: display Issues relating to how terms are printed for display labels Aug 8, 2015
@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

See issue #481 for the initial feature request open import M args and some discussion.

Original comment by andreas....@gmail.com on 15 Sep 2014 at 12:59

  • Added labels: Modules, Syntax

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

My bad. I just hacked the parser (Parser.y) to get the sugar open import A Set. ...

Are you sure?

I removed 'unique' from Parser.y and I defined 'Fresh' as it was defined before the commit c370b16 (see the issue-1278 branch).

I was expecting an error on

  open import A Set

but it type-checked without problems.

Original comment by andres.s...@gmail.com on 15 Sep 2014 at 1:19

  • Changed state: InfoNeeded

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

I think the problem is not about whether it type checks, but how names are printed.

Note that the freshness magic is to ensure that you can write two "open import" statements for the same module without getting an error about duplicate module identifier A and without confusing the two instantiations of the same module, e.g.

open import A Set using ()
open import A Set

Issue #896 seems also related but not quite.

Note that with

open import A Set

A is not in scope, so the expected goal would be

.A.d == .A.d

Original comment by andreas....@gmail.com on 15 Sep 2014 at 3:38

@GoogleCodeExporter
Copy link
Author

Original comment by andreas....@gmail.com on 15 Sep 2014 at 7:53

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

Andres, are you planning to take this issue? (Maybe you should set the Owner then.)

Original comment by andreas....@gmail.com on 16 Sep 2014 at 11:37

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

I don't dare to answer affirmatively :-)

Original comment by andres.s...@gmail.com on 16 Sep 2014 at 7:42

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

I just want to avoid a race to fix this bug. ;-) You can give back ownership.

Original comment by andreas....@gmail.com on 18 Sep 2014 at 6:56

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

... at any time, if you choose to.

Original comment by andreas....@gmail.com on 18 Sep 2014 at 6:57

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

Please, be my guest :-)

Original comment by andres.s...@gmail.com on 23 Sep 2014 at 2:51

@GoogleCodeExporter
Copy link
Author

Original comment by andreas....@gmail.com on 29 Sep 2014 at 2:22

  • Changed state: Started

@asr
Copy link
Member

asr commented Oct 10, 2016

Note that with

open import A Set

A is not in scope, so the expected goal would be

.A.d == .A.d

@andreasabel, the goal in upstream is

?0 : d ≡ d

isn't it the expected behaviour?

@andreasabel
Copy link
Member

That looks fine. I guess we can add the test case and close this issue.

@asr asr added this to the 2.5.2 milestone Oct 12, 2016
@asr asr self-assigned this Oct 12, 2016
@asr
Copy link
Member

asr commented Oct 12, 2016

I'll do it.

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 syntax Bike-shedding of the surface syntax type: bug Issues and pull requests about actual bugs ux: display Issues relating to how terms are printed for display
Projects
None yet
Development

No branches or pull requests

3 participants