coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Kirill Taran <kirill.t256 AT gmail.com>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] common declarations of module signature and module instance
- Date: Wed, 12 Feb 2014 01:26:24 +0400
Hello,
I want to declare such modules:
But this is impossible due two reasons:
but I am not sure that this line is ok.
Second could be solved by placing definitions T and g into separate module and importing it as argument. But because of mutual definition it becomes difficult:
So, how to implement that with minimum effort?
I want to declare such modules:
Module Type Sig.Definition T : Type := nat.Parameter f : T -> T.Definition g (t : T) : T := f (f t).End Sig.Module Impl <: Sig.Definition f (t : T) : T := t * 2.End Impl.
But this is impossible due two reasons:
- In Impl I don't see definition T from Sig.
- I need to define T and g again in Impl.
but I am not sure that this line is ok.
Second could be solved by placing definitions T and g into separate module and importing it as argument. But because of mutual definition it becomes difficult:
Module Common.
Definition T : Type := nat.
Definition g (t : T) : T := f (f t).
(* Don't know about f here :( *)
End Common.
Module Type Sig (C : Common).Parameter f : T -> T.End Sig.
Module Impl (C : Common) <: Sig C.Definition f (t : T) : T := t * 2.End Impl.
So, how to implement that with minimum effort?
Sincerely,
Kirill Taran
Kirill Taran
- [Coq-Club] common declarations of module signature and module instance, Kirill Taran, 02/11/2014
- Re: [Coq-Club] common declarations of module signature and module instance, Pierre Courtieu, 02/12/2014
- Re: [Coq-Club] common declarations of module signature and module instance, Kirill Taran, 02/12/2014
- Re: [Coq-Club] common declarations of module signature and module instance, Pierre Courtieu, 02/12/2014
Archive powered by MHonArc 2.6.18.