coq-club AT inria.fr
Subject: The Coq mailing list
List archive
Re: [Coq-Club] A module cannot be applied to another module application or with-expression
Chronological Thread
- From: Vadim Zaliva <vzaliva AT cmu.edu>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] A module cannot be applied to another module application or with-expression
- Date: Thu, 21 Nov 2019 20:09:50 -0800
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=vzaliva AT cmu.edu; spf=Pass smtp.mailfrom=vadim.zaliva AT west.cmu.edu; spf=None smtp.helo=postmaster AT mail-io1-f41.google.com
- Ironport-phdr: 9a23:P+VVKxWtAXa6qxKgHUw/gOT4P8HV8LGtZVwlr6E/grcLSJyIuqrYYxCBt8tkgFKBZ4jH8fUM07OQ7/m7HzVdut3f6zgrS99lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrowjdrNQajItsJ6o+yxbErGZDdvhLy29vOV+dhQv36N2q/J5k/SRQuvYh+NBFXK7nYak2TqFWASo/PWwt68LlqRfMTQ2U5nsBSWoWiQZHAxLE7B7hQJj8tDbxu/dn1ymbOc32Sq00WSin4qx2RhLklDsLOjgk+2zRl8d+jr9UoAi5qhNwzY7bYoGbOvR9cK3AY90VWXFMUdxNWyFbGI6wc5cDAugHMO1Fr4f9vVwOrR6mCAajHuzg1z5Ihnrr1qI5yeshFQDG3BI6ENkTt3nUstT0O70WUeC00qnH1y7OYO9T2Tfg8oTHbA0uoeyVUL92bMHfx04vFwbfgVWRr4zoJzWV2f4Is2eF9uZvSeWvhHQ7pAFxuDSg2sAsiozPi4kIyV7E7T10zJgpKdC8UkJ2Yt6pHIFNuyybNoZ6WMwvT3xutS0n0LMJo4S7czIPyJk/xx7QdfiHc4+Q7xLmTumRIDN4iGtkeLK4mhq+6Eagx+LhWsWu31ZKqS1FktbItn8TzRDc9s+HSv5l8keg3zaAyRzT5/laLUwokafXMZ0sz74qmpYOsEnOHzX6lUrrgKOOc0Ur4Omo6+DpYrX8oZ+cMpd5ih/kPaszm8y/BP40MwkUUGif+OS8yqfs8Fb3QbpUlf02jrPVv4zfJcQGvKK2HRJa0ps75xalEzimyMgYnWUALF9dZB2HiJHpN0jSL/D8EPewmE+hkCxrxvDDJr3uGI/BLnnFkLf7fLZy8VRQyAQpzYMX25UBAbYYZfn3R0XZtdrCDxZ/PRbn7fzgDYBD348fXCq9C6uYLqqa5UGa7+YuPeCkb4oI/jvxNq52tLbVkXYllApFLuGS1pwNZSXgR6k0EwCieXPpx+w5PyIKsw45FrG4jVSDVXtSYC/3Uf5loD48D42iAMHIQYX/2OXdjhf+JYVfYyV9Mn7JCW3hJtePXupKZS6PcJc4w240EIO5Qopk7imA8Qrzyr5pNO3Ro3FKqp/4yJ5+4vCVmB0vp2V5
Maybe I should explain better where this is coming from. The problem I am trying to solve is that I end up with two instances of the same module which are distinct as shown in the snippet below. So I am trying to see if I can instantiate it once and pass around to other modules as in my original example.
Module Type CType. Parameter Inline t : Type. End CType.
Module CNat <: CType. Definition t := nat. End CNat.
Module M (Import CT: CType).
Definition fst: t. Admitted.
End M.
Print M.
Module M1 := M(CNat).
Module M2 := M(CNat).
Goal M1.fst = M2.fst.
Proof.
Fail reflexivity.
(*
The command has indeed failed with message:
Unable to unify "M2.fst" with "M1.fst".
*)
Qed.
Vadim
—
Vadim Zaliva
CMU ECE Ph.D. candidate
Mobile/Signal/WhatsApp: +1(510)220-1060
On Thu, Nov 21, 2019 at 7:47 PM Vadim Zaliva <vzaliva AT cmu.edu> wrote:
I am trying to understand the error message “A module cannot be applied to another module application or with-_expression_”.
The minimal example:
Module Type CType. Parameter Inline t : Type. End CType. Module CNat <: CType. Definition t := nat. End CNat. Module Type M (Import CT: CType). End M. Module Z (Import MN: M CNat). End Z. Fail Module Import ZMN := Z(M(CNat)). (* The command has indeed failed with message: A module cannot be applied to another module application or with-_expression_; you must give a name to the intermediate result module first. *) Module Type MN := M(CNat). Fail Module Import ZMN := Z(MN). (* The command has indeed failed with message: Illegal application to a module type. *)
What would be the proper way to do something like this?
Thanks!
—
Vadim Zaliva![]()
CMU ECE Ph.D. candidate
Mobile/Signal/WhatsApp: +1(510)220-1060
- [Coq-Club] A module cannot be applied to another module application or with-expression, Vadim Zaliva, 11/22/2019
- Re: [Coq-Club] A module cannot be applied to another module application or with-expression, Vadim Zaliva, 11/22/2019
- Re: [Coq-Club] A module cannot be applied to another module application or with-expression, Pierre Courtieu, 11/22/2019
- Re: [Coq-Club] A module cannot be applied to another module application or with-expression, Pierre Courtieu, 11/22/2019
- Re: [Coq-Club] A module cannot be applied to another module application or with-expression, Vadim Zaliva, 11/22/2019
Archive powered by MHonArc 2.6.18.