返回顶部
a

acorn-proverAcorn证明器

Verify and write proofs using the Acorn theorem prover for mathematical and cryptographic formalization. Use when working with Acorn proof files (.ac), verifying theorems, formalizing mathematical or cryptographic protocols, or writing proofs in the Acorn language. Triggers on: (1) Creating or editing .ac files, (2) Running acorn verify commands, (3) Formalizing math or crypto proofs, (4) Questions about Acorn syntax or standard library.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,624
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

acorn-prover

Acorn Prover

设置(首次运行时必须执行)

如果技能目录中不存在 config.env:

  1. 1. 询问用户以下路径:
- ACORN_LIB - acornlib 的路径(例如 /path/to/acornprover/acornlib) - ACORN_PROJECT - 存放 .ac 文件的项目目录路径(例如 /path/to/acorn-playground)
  1. 2. 验证路径是否存在(使用 list_dir 或等效方法)。如果路径无效,告知用户并重新询问。
  1. 3. 运行 setup.sh,传入验证后的路径:

bash
bash skills/acorn-prover/scripts/setup.sh LIB> PROJECT>

  1. 4. 加载配置以获取 ACORNLIB、ACORNPROJECT 和 USE_MISE 变量:

bash
source skills/acorn-prover/config.env

如果上述任一变量为空/未设置,告知用户手动设置该变量。
如果上述任一变量发生更改,询问用户新的路径并重新运行 setup。

配置

配置值存储在 skills/acorn-prover/config.env 中:

变量描述
ACORNLIBacornlib 的路径
ACORNPROJECT
存放 .ac 文件的项目目录 |
| USE_MISE | 如果 mise 可用则为 true |

验证证明

如果 USE_MISE=true:

bash
mise run acorn verify .ac

否则,使用直接 CLI:

bash
acorn --lib $ACORN_LIB verify .ac

重新验证证明(CI/CD)

检查所有证明是否已缓存且无需 AI 搜索:

bash

使用 mise


mise run acorn reverify

或直接 CLI

acorn --lib $ACORN_LIB reverify

用于 CI 流水线以确保所有证明完整。

训练数据生成

为 AI 模型开发生成训练数据(问题-证明对):

bash

使用 mise


mise run acorn training ./training_data

或直接 CLI

acorn --lib $ACORNLIB training ./trainingdata

参数:DIR - 输出训练数据的目录。

文档生成

生成库参考文档:

bash

使用 mise


mise run acorn docs ./docs/library

或直接 CLI

acorn --lib $ACORN_LIB docs ./docs/library

参数:DIR - 输出文档的目录。

工作流程

  1. 1. 加载配置:source skills/acorn-prover/config.env
  2. 在 $ACORNPROJECT/ 中编写证明文件
  3. 运行相应命令(verify、reverify、training、docs)
  4. 始终向用户显示完整的命令输出(成功或错误)
  5. 使用 references/syntax.md 中的常见错误表调试错误
  6. 迭代直至验证通过

快速语法概览

acorn
from nat import Nat
from addcommgroup import AddCommGroup

// 定理 - 自动证明或带提示
theorem example(a: Nat, b: Nat) {
a < b implies a != b
}

// 类型类 - 公理是命名块,没有 axiom 关键字
typeclass A: AddGroup extends Zero, Neg, Add {
inverse_right(a: A) { a + -a = A.0 }
}

// 结构体
structure Pair[T, U] { first: T second: U }

// 归纳类型 - 构造器必须小写
inductive MyBool { tru fls }

关键点:

  • - 内置逻辑关键字(not、and、or、implies、iff、true、false)为保留字 - 请勿重定义
  • 构造器名称必须小写
  • 类型类公理使用命名块,而非 axiom 关键字

标准库(acornlib)

$ACORN_LIB/src 中的关键模块:

模块内容
nat/自然数公理、归纳法、加法
add_group.ac
AddGroup,包含 a + -a = A.0 |
| addcommgroup.ac | 阿贝尔群(AddCommGroup) |

参考

  • - 完整语法、错误表、示例:参见 references/syntax.md
  • Context7 文档:使用 context7 MCP,路径为 /acornprover/acorn 或 /acornprover/acornlib 以获取最新文档

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 acorn-prover-1776370359 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 acorn-prover-1776370359 技能

通过命令行安装

skillhub install acorn-prover-1776370359

下载

⬇ 下载 acorn-prover v1.0.0(免费)

文件大小: 4.68 KB | 发布时间: 2026-4-17 15:42

v1.0.0 最新 2026-4-17 15:42
Initial release of the acorn-prover skill.

- Supports verifying and writing proofs using the Acorn theorem prover for mathematical and cryptographic formalization.
- Guides user setup: prompts for and validates required Acorn library/project paths; runs setup, and sources config automatically.
- Commands for verification, re-verification (CI/CD), training data, and documentation generation, supporting both mise and CLI workflows.
- Includes quick Acorn syntax overview and highlights key standard library modules.
- Extensive workflow and troubleshooting instructions for users.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部