Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Issues with the module system

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Issues with the module system


Chronological Thread 
  • From: Bas Spitters <b.a.w.spitters AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Cc: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
  • Subject: Re: [Coq-Club] Issues with the module system
  • Date: Sun, 30 Jul 2017 16:54:34 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=b.a.w.spitters AT gmail.com; spf=Pass smtp.mailfrom=b.a.w.spitters AT gmail.com; spf=None smtp.helo=postmaster AT mail-ua0-f174.google.com
  • Ironport-phdr: 9a23:MVC4qhEs9F8oI2ROLXD2U51GYnF86YWxBRYc798ds5kLTJ7zpc+wAkXT6L1XgUPTWs2DsrQf2rqQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbQhFgDmwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VC+85Kl3VhDnlCYHNyY48G7JjMxwkLlbqw+lqxBm3oLYfJ2ZOP94c6jAf90VWHBBU95TWCxPAo2yYYgBAfcfM+lEoIfwvEcOrQKkCAWwGO/j1j1Fi3nr1qM6yeQhFgTG0RQ9Et0Uq3Tfscj7NL8TUeCp0KnH0y/Db+hL0jr684fEaAoureuCXL5qasrR0UgvFx/ZjlqOs4zlJCiY1usIs2eB7upgUfijhHIgqwF0uzWiwNonhIfOhoIQ0F/E9CN5zZ40Jd2+Uk57YMSrHIFetyGAL4d2Q8UiQ312tyY+0LEJpIC0cS4Xw5ok3x7Sc+KLf5SM7x75V+ucIS10iGx4dL+9nRq+7Eqtx+L6W8KpylhFtDBFncPJtn0V1xzc9MyHSvxl80ekwzmP1gTT5vhZIU8uiabXMpAhzqMym5ccq0jDESj2mEL5jK+SaEoo4PSn6+PiYrn+p5+cMZF7ih3mP6gwhsCyBf40PwsOUmSB5+iwyb/u8VfkTLhIgfA6iqzZv4rbJcQfqK65GQhV0oM75hmkFTupys4UnHcdIFJeYBKHjpTpO03QL/DiFveymFuskDJxyPDHOr3tGInCLn/GkLv5Z7Zy91ZcyBYvzdBY/59bFrYBIOvqVkDtsNzYEwQ2Phevw+fnDdV9zpkRVXiOAq+fKqPSsEWH6vghI+mWN8cpv2PWLOFtzPrzhzdtklgEOKKtwJE/aXaiH/0gLV/PMlT2hdJUO24R9jEmTfD2hUeZGWpZIX/0QOQn/jAnFI+8Fq/MQ4mshPqK2yLtTc4eXXxPFl3ZSSSgTI6DQfpZLXvKesI=

A bigger issue seems to be that Coq provides (at least) three ways to
deal with this kind of kind of modularity: classes, structures and
modules.

This makes it difficult to organize the stdlib.

I know there are thoughts on merging some of these. I don't recall
having seen a CEP, though.

On Sun, Jul 30, 2017 at 4:01 PM, Elvis M. Detty
<beque AT protonmail.com>
wrote:
> № 3 sounds lovely! I just spent the last week or so fighting my "module
> merger" scripts*, so Michael's mail hit a nerve :).
>
> I dream about a "lax Include", where the definitions are only included if
> the module itself does not provide its own.
>
> ElMa
>
> *: In my project I use scripts to do № 1: copy base module verbatim over to
> the bottom of the git repo, then git rebase over it to adapt the derived
> module to the parent
>
> This is of course fragile, and invalidates all git references in the
> process, so cannot really recommend.
>
>
> Sent with ProtonMail Secure Email.
>
> -------- Original Message --------
> Subject: [Coq-Club] Issues with the module system
> Local Time: July 30, 2017 2:05 AM
> UTC Time: July 30, 2017 9:05 AM
> From:
> michael.soegtrop AT intel.com
> To:
> coq-club AT inria.fr
>
> <coq-club AT inria.fr>
>
>
> Dear Coq Team & Users,
>
>
>
> I tried to separate some of my samples from my infrastructure in order to
> deliver them to Benjamin and found that the main issue here comes from the
> module system. I changed many module definitions in the standard library, so
> that I can live with them. The changes are simple and easy to maintain, but
> it makes it very hard for me to share samples.
>
>
>
> The issues I have comes from definitions like:
>
>
>
> https://coq.inria.fr/library/Coq.ZArith.BinInt.html#
>
>
>
> Module Z
>
> <: ZAxiomsSig
>
> <: UsualOrderedTypeFull
>
> <: UsualDecidableTypeFull
>
> <: TotalOrder.
>
>
>
> The problem here is that it is impossible (afaik – I discussed this on the
> list a while ago) to define the abstract module type of module Z without
> literally copying the definition of 3 of the 4 involved module types,
> because all of them include a type definition named “t”. I tried a lot of
> things, e.g. defining local modules with the common definitions bound
> together using “with Definition t:=XYZ.t” and including these, but to no
> effect.
>
>
>
> I use a lot of automation and automation frequently works better with
> abstract definitions. If it is not required for a proof to know how e.g. Z
> is actually defined, it is obviously easier to find the proof automatically
> if the proof databases don’t contain these unnecessary details, e.g. the
> systems doesn’t have the option to destruct a Z. For this reason I do a lot
> of proofs in modules with the involved types defined as abstractly as
> possible to get the proof done as module types. Obviously this also results
> in more flexible results. But this requires either
>
>
>
> 1.) a lot of module type signature cut and paste
>
> 2.) changing every other module type definition in the standard library
> to a module type functor getting the involved type- and e.g. operator
> definitions as module type parameters
>
> 3.) enhance Coq’s module system with a module type merge operator, which
> gives a module type equivalent to the type of Module Z above without
> signature cut & paste.
>
>
> I went with method 2, which makes my samples incompatible with the rest of
> the Coq world – or too large to be manageable because I have my own copy of
> the standard library.
>
>
>
> I wonder how others are handling this? Maybe I am just doing something
> wrong? Or maybe others prefer type classes or canonical instances over
> modules?
>
>
>
> In case there is no solution, what would be the proposed fix? I actually
> would prefer to have 2.) and 3.). I could help with 2.) and deliver a
> standard library changed to use module type functors plus compatibility
> files which create the currently existing module types from the newly
> defined functors. In my version of the lib I also renamed some module types
> so that it is more obvious from the name what the difference between various
> variants is, but I would keep the names of all module types as they exist
> now in the compatibility files.
>
>
>
> I find this more elegant and flexible than 3.) - I feel the merging of
> definitions of t, eq, … in the above definition of Z is a bit of a hack, but
> having 3.) can still be nice for exploring ideas quickly.
>
>
>
> Best regards,
>
>
>
> Michael
>
>
>
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
>
>



Archive powered by MHonArc 2.6.18.

Top of Page