coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: [Coq-Club] Issues with the module system
- Date: Sun, 30 Jul 2017 09:05:17 +0000
- Accept-language: de-DE, en-US
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=michael.soegtrop AT intel.com; spf=Pass smtp.mailfrom=michael.soegtrop AT intel.com; spf=None smtp.helo=postmaster AT mga02.intel.com
- Dlp-product: dlpe-windows
- Dlp-reaction: no-action
- Dlp-version: 11.0.0.116
- Ironport-phdr: 9a23:4ImyEhK2XHELB6UORdmcpTZWNBhigK39O0sv0rFitYgeLPjxwZ3uMQTl6Ol3ixeRBMOAuqIC07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9ZDeZwZFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QLYpUjqg8qhrUgflhicZOTAk7GHZhM9+jKNHrx2uvBFw2ZLYbYWPOfZiYq/RY9UXTndBUMZLUCxBB5uxY4USAeoGI+lYoJX9p0EJrRumHQWnGeThyj5UiX/2x6I1zeAhHQ/b1wEnGtIOsWjbrNXvO6gMVeC51rLIzTLdYPNZxTf98o/Icgg6rPGNW7JwbdTeyU01GwzZiVWQrJXoMjWI3eoDtGib6vBvVeOpi2M/qgFxpCKvxsY2hYXTiIIV0EjI9SR/wIYpO9K4TFR3bsO6H5ZWqiqUNJN2T9s/T2xmtys20KAKtJC0cSQQ1ZgqyR/SZ+aZf4SU+h7vSeecLDliiH9rdr+znQi+/Eakx+HmS8W500hGojJYntTNsn0BzQLf58iIR/dn4EutwyiD2x3O5uxCPEs6j7DUK4Q7zb41jpcTsVrMHivxmEjuia+WeV8r9vS25+j9Y7XmoIOcOJFwig3kLqsuncm/Dfw5MggIQWeb5fyx2KDt8ED2WrlGk/M7n6bDvJzHK8kWp7S1DxFJ3oo77hawFTam0NAWnXkdK1JFfQqKj43oO17SIPD3F+mwg1C2nDdwwPDJILLhAonXLnjEiLfsZrd960hAyAUtydBT/Y5bCrYEIP7rQE/+qMTYDgMlMwyz2+voFNJ91poHVW2TBq+ZLbjdvEST5uMvJumMfJUatCz8K/gj/f7ujGU2lUUTfamzjtMrbyXyFfN/Zk6dfHDEg9EbEG5MsBB0BLjhj0THWjpObV6zWbg973c1EtT1I53EQ9Xnu7uM0zuhGYUSLkVHAVCFHHOiP9GBWvwMYS+WZNRmnzMYT7+5Y44nyRyq8gT9zuw0faLv5iQEuMe7h5BO7OrJmERq+A==
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 |
- [Coq-Club] Issues with the module system, Soegtrop, Michael, 07/30/2017
- Re: [Coq-Club] Issues with the module system, Elvis M. Detty, 07/30/2017
- Re: [Coq-Club] Issues with the module system, Bas Spitters, 07/30/2017
- Re: [Coq-Club] Issues with the module system, Elvis M. Detty, 07/30/2017
Archive powered by MHonArc 2.6.18.