Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Calling things from a parent module into another module as neat as possible

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Calling things from a parent module into another module as neat as possible


Chronological Thread 
  • From: Milad Ketabii <ketabii.math AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Calling things from a parent module into another module as neat as possible
  • Date: Wed, 6 Jun 2018 18:46:21 +1000
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=ketabii.math AT gmail.com; spf=Pass smtp.mailfrom=ketabii.math AT gmail.com; spf=None smtp.helo=postmaster AT mail-ua0-f172.google.com
  • Ironport-phdr: 9a23:+LlCYhLv9Yf1vwl+L9mcpTZWNBhigK39O0sv0rFitYgRK/zxwZ3uMQTl6Ol3ixeRBMOHs68C07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwVFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QLYpUjqg8qhrUgflhyUJNzA5/m/ZidF+grxHrx+6vRNz35TZbZuJOPZifK7Qe84RS2pbXsZWUixMGoSyb4oLD+UbIOlTsozzqEUSrRSkHgasBeLvwSJPi3/1w6I6z/4uHhrH3AwhBd4OtW7brMn1NKoJXuC1ybPHzTTHb/9MxTj9743IfwknrPqRXrxwadLcxVczGw7BlFmdqozoMymL2ugQsWWX9fdsWOCxh2Mhtgp/uCKgxt02hYnMno8Vyk7L9SF+wIstIN23Uk97Ydq9HJtNrS6WK5J6Qs0/T2xqpio20LIGuZm8fCgFzJQo2QTTZOCAc4iN+h7jVeCRLilkhH99Zr6zmxK//VKjx+D8TMW4zktGoyhfntXRtH0ByQTf6s2dRft8+keh1yyP1wfW6uxcIkA7i7bbJIQ6zb4xl5ofq0HDETXqmEX2l6KWeUAk9fKp6+TjeLnpupicN4pshgHkLqsugtC/Afg/MgUWQ2eb/v282KT/8k39XbVFleY7krLZsZDfPcQUvLS1Aw5T0oY56hawFS2q0NoCnSpPEFUQcxWeyoPtJlvmIfbiDP75jU7/vi1swqXjP7noDt3uI2TKmrbgNeJ+5lJVwgsyi9VW+5J8BbQIIfa1UUj04o+LRiQlOhC5lr60QO520ZkTDDrWU/2pdZjKuFrN3doBZuyFZYsbojH4cqF36PvnjHt/klgYL/DwgcknLUugF/EjGH23JGL2i45YQ2gPtws6CuftjQ/aCGMBVzOJR6s5owoDJsemAIPEHN7/hbWA2GKmF8UTaDkZUBaDFnDnc4jCUPAJOnqf

Hi Sylvian

There is no functors here. Neither base nor any of the modules depending on it are parametric modules.

The Base itself is a module, which has some sections and other smaller modules in it.

To clarify the situation further, let's name the modules which depend on the Base by M1, M2, so forth. Also assume that Good_Person is a definition in M1, where two functions f1 and f2 each of which is defined in Base, are used to specify the Good_Person property.

The problem is that I need to use the name of Base in front of f1 and f2 at each instance by writing Base.f1 and Base.f2 . What I want is to simply write f1 and f2 wherever I wish and go through no problem. 

The situation would be like this; when one calls the Coq library for lists inside their modules/sections/etc for formalising something
, they would not use the name List.hd or List.tl in each instance of using the head and tail functions defined in Coq.List.list. They would rather simply write hd or tl in their specification.


I hope it is clearer what I mean. If otherwise, then let me know so that I lead to my github link.

thanks for your help,
Milad



On Wed, Jun 6, 2018 at 5:27 PM, Sylvain Boulmé <Sylvain.Boulme AT univ-grenoble-alpes.fr> wrote:
Hi Milad,

Le 06/06/2018 à 07:50, Milad Ketabii a écrit :
Hi there!

I have a problem, for which a solution already is there. However, I am looking for a better way of accomplishing the task.

Here, I will first explain the problem itself, as much simply as possible. Then I mention the crazy solution which I have. But I hope someone would kindly hint at a superior approach.

*The problem and a crazy solution:*

I have a formalisation which I intend to break into a base file and some modules, each of which calls this base in.

The base formalisation has variables. These variables are used inside each module as well. We finally would extract executable program into Haskell.

The base is constituted of some sections. To make the variables in the base file available to the modules (without instantiating them), I have made the out-most part of the base file as a module, rather than a section. This prevents errors that I would get by trying to compile the modules.

I do not fully understand your current solution: is this "out-most" part a module in parameter of each module ? (Now, are your modules actually functors ?)

However, the hassle is that I need to put the name of the base module in front of every variable, definition, and function which are celled in the modules.

Whatever module "Base" is: a parameter or an actual implementation, you only need to write "Import Base." in each module that uses "Base" in order to solve your problem.

Regards,

Sylvain.




Archive powered by MHonArc 2.6.18.

Top of Page