首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Agda加载标准库

Agda加载标准库
EN

Stack Overflow用户
提问于 2016-04-09 05:19:49
回答 1查看 522关注 0票数 2

我安装了Agda (版本2.3.2.2)和标准库(版本0.7)。

我可以加载不导入标准库的程序。

例如,我可以加载

代码语言:javascript
复制
data Bool : Set where
true : Bool
false : Bool

not : Bool -> Bool
not false = true
not true = false

但是,我不能加载

代码语言:javascript
复制
open import Data.Bool
data Bool : Set where
true : Bool
false : Bool

not : Bool -> Bool
not false = true
not true = false

加载标准库时,出现以下错误。

代码语言:javascript
复制
/Users/my_name/.cabal/share/Agda-2.3.2.2/lib-0.7/src/Level.agda:27,1-32
Duplicate binding for built-in thing LEVEL, previous binding to.Agda.Primitive.Level
when checking the pragma BUILTIN LEVEL Level

有什么办法纠正这个错误吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-04-09 06:08:29

您确定版本吗? 2.3.2.2应该与0.7兼容。在我看来,你们的Agda比2.3.2.2更近。有...\Agda-2.3.2.2\lib\prim\Agda\Primitive.agda文件吗?它不应该在那里。

如果这没有帮助,您可以尝试手动将Level模块的内容更改为:

代码语言:javascript
复制
module Level where

-- Levels.

open import Agda.Primitive public
  using    (Level; _⊔_)
  renaming (lzero to zero; lsuc to suc)

-- Lifting.

record Lift {a ℓ} (A : Set a) : Set (a ⊔ ℓ) where
  constructor lift
  field lower : A

open Lift public

但你可能会遇到其他问题。

你真的想要Agda和stdlib的旧版本吗?

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36513068

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档