简体   繁体   English

相当于 Coq 的 Agda 的 `Eval`

[英]Equivalent of Coq's `Eval` for Agda

Coq has an Eval command that you can use to have the type-checker evaluate an expression and print it to the console. Coq 有一个Eval命令,您可以使用它让类型检查器评估表达式并将其打印到控制台。 Is there an equivalent to this in Agda?在 Agda 中是否有与此等价的功能? In particular, I'd like to avoid actually compiling and executing the program.特别是,我想避免实际编译和执行程序。 I just want to introspect a value to make sure my code is working (and help me understand it better) before I go to the effort of writing proofs.在我开始编写证明之前,我只想自省一个值以确保我的代码正常工作(并帮助我更好地理解它)。

It's fine if the solution involves agda-mode (as compared to Coq, where it's part of the language).如果解决方案涉及 agda-mode(与 Coq 相比,它是语言的一部分),那很好。

我找到了一个解决方案: Ctrl-C Ctrl-N in agda-mode 允许输入表达式,然后打印评估结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM