import - 字符串和 Ascii 的 Coq 导入问题
问题描述
我正在尝试strchr
在 Coq 中编写一个简单的函数,然后将其导出到 Haskell。我面临可能与这篇文章(?)类似的导入问题,但我似乎无法解决它们。这是我的coq代码:
(***********)
(* IMPORTS *)
(***********)
Require Import Coq.Arith.PeanoNat.
Require Import Coq.Lists.List.
Require Import Coq.Strings.String.
Require Import Coq.Strings.Ascii.
(**********)
(* strchr *)
(**********)
Fixpoint strchr (haystack : string) (needle : ascii) : string :=
match haystack with
| EmptyString => EmptyString
| String c s' => match (Ascii.eqb needle c) with
| true => s
| false => strchr s' needle
end
end.
(********************************)
(* Extraction Language: Haskell *)
(********************************)
Extraction Language Haskell.
(***************************)
(* Extract to Haskell file *)
(***************************)
Extraction "/home/oren/GIT/kMemLoops/strchr.hs" strchr.
这是我得到的错误:
Error: The reference Ascii.eqb was not found in the current environment.
解决方案
eqb
大约一年前添加的,只是 coq 8.9+ 的一部分。你碰巧有旧版本吗?
推荐阅读
- python - Python Selenium:可以通过 javascript 识别 selenium 驱动程序吗?
- bar-chart - Tableau 条形图 - 如何为每个条形着色
- java - java中线程的等待和通知序列
- suitecrm - suiteCRM 中每个模块类型的描述
- javascript - 如何让我的 html 元素不参与 elementFromPoint
- java - 用单斜杠“/”替换斜杠之间的点,即“/./”
- angularjs - 添加自定义字段,但在呈现表单时避免使用 angularjs 正式包装器
- r - 如何为大小设置单独的图例并填写 ggplot
- javascript - 如何在 ReactJS 中生成嵌入式代码?
- php - 如何获取 url 的最后一部分并构建重定向?