Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Question about multiple imports of the same modules

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Question about multiple imports of the same modules


Chronological Thread 
  • From: Jason Gross <jasongross9 AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Question about multiple imports of the same modules
  • Date: Wed, 10 Aug 2016 03:45:24 +0000
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jasongross9 AT gmail.com; spf=Pass smtp.mailfrom=jasongross9 AT gmail.com; spf=None smtp.helo=postmaster AT mail-qt0-f179.google.com
  • Ironport-phdr: 9a23:PR49ABf2kdiGq70f7WboOdGmlGMj4u6mDksu8pMizoh2WeGdxc6/YB7h7PlgxGXEQZ/co6odzbGH6ua4Aydesd7B6ClEK80UEUddyI0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUrDbg8n/7e2u4ZqbO1wO32vkJ+soZ0vm5UWJ749N0NMkcv5wgjLy4VJwM9xMwm1pIV/B1z3d3eyXuKBZziJLpvg6/NRBW6ipN44xTLhfESh0ezttvJ6j5lH/Sl6E4WJZWWELmDJJBRLE5Vf0RMTfqCz/48h0wy6cdeLsSqsvEWCg5rxsThDyjzwcZhY29WjWjop7i6cN80HpnAB234OBONLdD/F5ZK6IJd4=

The problem has nothing to do with files or imports and everything to do with module functors.  Functors are generative: Every time you apply a module functor, you get a fresh copy of every definition.  In particular, the inductive types and axioms you get by applying a functor twice do not unify.  The solution is to move inductive type definitions (and axioms, if need be) outside of your functors.


On Tue, Aug 9, 2016, 7:03 PM John Wiegley <johnw AT newartisans.com> wrote:
Hello,

I have a project that I'd like to modularize more using module functors.  I
end up with a dependency tree similar to the following:

    A: defines "foo"

    B: imports A to use "foo"
    C: imports A to use "foo"

    D: imports both B and C

What happens is that I run into a situation in D where [B.foo] and [C.foo] are
not considered the same type.  I have attached an example below.  Is there any
way to tell Coq that the definitions imported by B and C from A are to be
regarded as the same?


Thanks,
--
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



Archive powered by MHonArc 2.6.18.

Top of Page