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

Inlining of modules fails in some cases due to quirks in Coq's resolution of module names #16

Closed
JasonGross opened this issue Dec 16, 2015 · 2 comments · Fixed by #72
Closed

Comments

@JasonGross
Copy link
Owner

Consider the files Foo.v:

Axiom A : Set.

and Bar.v:

Require Foo.Foo.

Module Export Top_DOT_Foo_DOT_Foo_DOT_Baz.
  Module Export Foo.
    Module Export Foo.
      Module Baz.
      End Baz.
    End Foo.
  End Foo.
End Top_DOT_Foo_DOT_Foo_DOT_Baz.

Import Foo.Foo.

Check A.

The command

coq_makefile Foo.v Bar.v -R . Foo | make -f - clean all

succeeds, because (I think) Coq refuses to mask absolute names and so the Import Foo.Foo refers to Foo.v, not to Top_DOT_Foo_DOT_Foo_DOT_Baz.Foo.Foo, even though the latter was declared later, which is how module resolution usually works.

This means that running

rm -f *.vo *.glob *.v.d; ~/coq-bug-finder/find-bug.py Bar.v out.v -R . Foo

gives

Error: The reference A was not found in the current environment.

rather than thinking that there is no error.

If the coq-devs see fit to implement feature request #4455, that could basically fix this. Otherwise, this will require careful thought.

@JasonGross
Copy link
Owner Author

Now that coq/coq#14537 is fixed, it may be possible to fix the issue with Import, at least, by adjusting all Import/Export statements while inlining the module.

@JasonGross
Copy link
Owner Author

I still wish the coqdevs would implement coq/coq#14541, which would admit a much cleaner solution to this problem.

JasonGross added a commit that referenced this issue Oct 9, 2021
JasonGross added a commit that referenced this issue Oct 9, 2021
JasonGross added a commit that referenced this issue Oct 9, 2021
JasonGross added a commit that referenced this issue Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant