我在从 Coq 中的模块导入定义时遇到问题。我是 Coq 的新手,但无法使用该语言的引用手册或在线教程解决问题。我有一个模块,它定义了有限集的签名和公理,我打算在另一个模块中实现。还有更多,但它看起来像这样(作为引用,我正在密切关注 Filliatre 关于有限自动机的论文):
Module FinSet.
...
Parameter fset : Set -> Set.
Parameter member : forall A : Set, A -> finset A -> Prop.
Parameter emptyset : forall A : Set, fset A.
Parameter union : forall A : Set, fset A -> fset A -> fset A.
...
Axiom axiom_emptyset :
forall A : Set, forall a : A, ~ (member a (emptyset A)).
Axiom axiom_union :
forall A : Set, forall a b : fset A, forall x : A, i
member x (union a b) <-> (member x a) \/ (member x b).
...
End FinSet.
我使用
coqc
编译模块并尝试将其加载到另一个模块中,例如 FinSetList
或 FinSetRBT
,使用命令 Require Import FinSet
.当我尝试导入模块时,Coq(通过 Proof General)发出警告:Warning: trying to mask the absolute name "FinSet"!
此外,我看不到
FinSet
中定义的任何内容.如何将定义(在本例中为公理)从一个模块导入另一个模块?我基本上遵循了 Pierce 的“软件基础”讲座中概述的步骤。但是,他们不为我工作。
最佳答案
尝试添加到您的 .emacs
归档一些明确的包含路径:
'(coq-prog-args (quote ("-I" "/home/tommd/path/to/some/stuff/lib" "-I" "/home/tommd/path/to/more/stuff/common")))
关于import - 如何在 Coq 中导入模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7904535/