将Coq提取到Haskell时如何设置模块名称
当我使用Extraction Language Haskell.提取/编译Coq到Extraction Language Haskell. 在Coq文件中运行coqtop -compile mymodule.v > MyModule.hs ,我得到一个Haskell模块,它以module Main where开头。
是否有选项可以设置生成的Haskell模块名称?
我现在管这样sed -
coqtop -compile mymodule.v | sed s/Main/MyModule/ > MyModule.hs
但我正在寻找更清洁的解决方案。
您可以使用Extraction "file"或Extraction Library (或其变体),例如
Definition foo := 6*7.
Extraction Language Haskell.
Extraction "MyModule" foo.
以上生成MyModule.hs文件,该文件以module MyModule where开头。
上一篇: How to set the module name when extracting Coq to Haskell
