jmi*_*ite 5 functional-programming theorem-proving agda dependent-type agda-mode
我正在尝试编译一个 Agda 文件,但是我无法让它找到标准库。我在这里看过文档。
我使用 Stack 来安装它:
> which agda
/home/joey/.local/bin/agda
Run Code Online (Sandbox Code Playgroud)
我已经为我的 Agda 目录设置了环境变量:
> echo $AGDA_DIR
/home/joey/.agda
Run Code Online (Sandbox Code Playgroud)
其中填充了正确的文件:
/home/joey/agda/agda-stdlib/standard-library.agda-lib
> cat "$AGDA_DIR"/libraries
/home/joey/agda/agda-stdlib/standard-library.agda-lib
> cat "$AGDA_DIR"/defaults
standard-library
> cat /home/joey/agda/agda-stdlib/standard-library.agda-lib
name: standard-library
include: src
Run Code Online (Sandbox Code Playgroud)
但是,当我去编译 Agda 文件时,出现以下错误:
Failed to find source of module Function in any of the following
locations:
/home/joey/agda/AutoInAgda/src/Function.agda
/home/joey/agda/AutoInAgda/src/Function.lagda
/home/joey/.stack/snapshots/x86_64-linux-nopie/lts-8.14/8.0.2/share/x86_64-linux-ghc-8.0.2/Agda-2.5.2/lib/prim/Function.agda
/home/joey/.stack/snapshots/x86_64-linux-nopie/lts-8.14/8.0.2/share/x86_64-linux-ghc-8.0.2/Agda-2.5.2/lib/prim/Function.lagda
when scope checking the declaration
open import Function
Run Code Online (Sandbox Code Playgroud)
我如何告诉 Agda 去哪里寻找标准库?这是因为堆栈的问题吗?
我在 Ubuntu 17.10 上,如果这有区别的话。
事实证明,如果您的根目录中有 .agda-lib 文件,它将完全忽略默认文件。所以关键是standard-library
在该文件中明确包含。
我错过了一件愚蠢的事情,但希望其他有同样问题的人会找到这个答案。