如何在Coq中使用模内引理?
我在一个名为如何在Coq中使用模内引理?,coq,Coq,我在一个名为a.v Module Type WeakPair. ... End WeakPair. Module WeakPairProps (Import WP : WeakPair). Lemma Weak_A .... End WeakPairProps. 然后我想定义另一个文件B.v,它可以使用WeakPairProps中的Lemma,例如:Weak\u A。 因为WeakPairProps不是一种模块类型,所以我不知道如何编写一个可以重用WeakPairProps中引理的模
a.v
Module Type WeakPair.
...
End WeakPair.
Module WeakPairProps (Import WP : WeakPair).
Lemma Weak_A ....
End WeakPairProps.
然后我想定义另一个文件B.v
,它可以使用WeakPairProps
中的Lemma
,例如:Weak\u A
。
因为
WeakPairProps
不是一种模块类型,所以我不知道如何编写一个可以重用WeakPairProps
中引理的模块。首先,您需要定义一个实现模块类型的模块WeakPair
:
Module WeakPairImpl <: WeakPair.
(* stuff goes here *)
End WeakPairImpl.
现在您可以参考引理:
WeakPairPropsInst.lemma
如果不希望使用限定名称,可以导入WeakPairPropsInst
WeakPairPropsInst.lemma