Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Making Modules work

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Making Modules work


Chronological Thread 
  • From: Tej Chajed <tchajed AT mit.edu>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Making Modules work
  • Date: Sun, 12 Apr 2020 19:34:29 -0500
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=tchajed AT mit.edu; spf=Pass smtp.mailfrom=tchajed AT mit.edu; spf=None smtp.helo=postmaster AT outgoing.mit.edu
  • Ironport-phdr: 9a23:k/ueDRFuOhJyem5HPv4olp1GYnF86YWxBRYc798ds5kLTJ76r8SwAkXT6L1XgUPTWs2DsrQf1LqQ7viocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWc6iQdFxm3MQN/IazOF4jeis2206jyoMWIIlYAuD3oarRraR6ysA+Z4sIRmM5pLrs74hrPuHpBPepMkzBGP1WWyirx5I+b/Jdh/igY7+4q98dCXKnSeqUkC7FUEWJ1YCgO+MT3uEyaHkO07XwGXzBNykERX1r1qSriV5K0iRPU8/Jn0XjIOMzqC704RGb6tvY5eFrTkC4CcgUB3iTSg810grhcpUPzoh1jhYPYfdPMbacsTubmZdofAFF5cINRWihGW9PuaJYTAO0AO+keqojh4VYCsEnmCA==

I wrote an answer to this question on Stack Overflow: https://stackoverflow.com/questions/47973317/require-import-require-import.

In your particular case, the issue is the file Foo.v is implicitly in a module called Foo. Thus the fully qualified path to magic is actually Foo.Foo.magic, and after the import it’s just Foo.magic. If you want to make just magic work, you actually want to Require Foo and then Import Foo.Foo (or remove the module Foo in Foo.v).


On Sun, Apr 12, 2020 at 7:25 PM Agnishom Chattopadhyay <agnishom AT cmi.ac.in> wrote:
Hi;

I am really confused with Require, Export, Import, etc. I tried doing a Google search but I do not find any simple explanations.

What I want to do is to have two files Foo and Bar:

Module Foo.

  Definition magic : nat := 5.

End Foo.


Now, I want to be able to access magic inside Bar:

Module Bar.

  Require Foo.
  Import Foo.
  Check Foo.magic.
  Fail Check magic. (* How do I make this work? *)

End Bar.

What am I doing wrong?



Archive powered by MHonArc 2.6.18.

Top of Page