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 in non-logical objects not granted in module definitions #15403

Closed
herbelin opened this issue Dec 27, 2021 · 0 comments · Fixed by #15412
Closed

Inlining in non-logical objects not granted in module definitions #15403

herbelin opened this issue Dec 27, 2021 · 0 comments · Fixed by #15412
Labels
kind: bug An error, flaw, fault or unintended behaviour. part: modules The module system of Coq.
Milestone

Comments

@herbelin
Copy link
Member

Description of the problem

Module Type EqType.
   Parameter Inline t : Type.
   Parameter eq : t -> t -> Prop.
   Notation "#" := t (only parsing).
End EqType.

Module NAT.
   Definition t := nat.
   Definition eq := @eq nat.
End NAT.

Module F (E:EqType) :=
  E.

Module Import NAT' := F NAT.
About NAT'.eq. (* no arguments scopes, because it is for the non-logical-objects purpose of type NAT'.t *)
About NAT.eq. (* arguments scopes have also been canceled *)
Check #. (* no inlining: NAT'.t *)

Contrastingly, it is ok with an Include:

Module F (E:EqType).
  Include E.
End F.

Module Import NAT' := F NAT.
About NAT'.eq. (* Arguments NAT'.eq (_ _)%nat_scope *)
About NAT.eq. (* Arguments NAT.eq (_ _)%nat_scope *)
Check #. (* nat *)

(explicit qualification with NAT' even when imported is from me, to emphasize the differences)

Fix possibly to come.

Coq Version

From 8.5 to master.

@herbelin herbelin added part: modules The module system of Coq. kind: bug An error, flaw, fault or unintended behaviour. labels Dec 27, 2021
herbelin added a commit to herbelin/github-coq that referenced this issue Dec 30, 2021
The invariants of the code for delta-resolver composition are complex
and I don't understand them well. At least, there was a discrepancy
when composing either a delta-resolver [Top.NAT'=>Top.E] or
delta-resolver [Top.NAT'.t=>Top.E.t] with a substitution
{Top.E |-> Top.NAT [Top.NAT.t=>inline(Some _)]}: the second case was
returning [Top.NAT'.t=>inline(Some _)] but not the first case. The
discrepancy was in gen_subst_delta_resolver, which
subst_codom_delta_resolver was calling and we fix the first case.
coqbot-app bot added a commit that referenced this issue Jan 6, 2022
…of module paths in delta-resolver

Reviewed-by: SkySkimmer
Co-authored-by: SkySkimmer <SkySkimmer@users.noreply.github.com>
@Zimmi48 Zimmi48 added this to the 8.16+rc1 milestone Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug An error, flaw, fault or unintended behaviour. part: modules The module system of Coq.
Projects
None yet
2 participants