2 つの異なるファイルに 2 つの異なるモジュール署名があります。フィールド名は同じですが、動作が異なります。
そして内部のファンクターは別のファンクターを定義します。
PI.v
Module Type TPI.
Parameter sig : Signature.
Parameter trsInt: forall f, pi f.
End TPI.
Module P (Export T: TPI).
Lemma A...
Module Export Mono <: MonoType.
End P.
と
MI.v
Module Type TMI.
Parameter sig : Signature.
Parameter trsInt : forall f, mi f.
End TMI.
Module M (Export TM: TMI).
Lemma B ...
Module Export Mono <: MonoType.
End M.
MonoType
たとえば、別のファイル内の場所Mono.v
これが私の状況です。
そのファイル内に別のファイルが呼び出され、ファイルとB.v
の両方で定義とレンマを使用する必要があります。PI.v
MI.v
そして、たとえば、両方を使用する必要がある1つの定義。
Definition redPair R is :=
match is with
| Type_PI => pi_int R is
| Type_MI => mi_int R is
end.
モジュール署名内で使用され、モジュール署名内で使用されているため、 (署名)が異なるR
ためpi_int R
、問題があります。mi_int R
sig
pi_int
trsInt
TPI
mint_int
trsInt
TMI
これが私が定義した方法です:
Module PI (Import P : TPI).
Definition pi_int R is := P.trsInt ...
(* inside PI I define another functor for MI *)
Module MI (Import M : TMI).
Definition mi_int R is := M.trsInt ...
Definition redPair R is :=
match is with
| Type_PI => pi_int R is
| Type_MI => mi_int R is (* error here saying that it used the sig of
P.sig but in this case mi_int used the sig of M.sig *)
end.
End MI.
End PI.
私の質問は、定義で同じ署名を持つことができるモジュールの適切な構造を持つことができる方法があるということredPair
です? ご協力ありがとうございました。