名称: 证明助手 描述: 协助构建算法正确性证明 允许工具:
- 读取
- 写入
- 搜索
- 全局匹配
证明助手技能
目的
使用标准证明技术协助构建算法的形式化正确性证明。
能力
- 证明结构模板(归纳法、反证法等)
- 分步证明指导
- 终止性论证生成
- 证明审查与验证
- 识别证明漏洞
目标流程
- 正确性证明测试
- 算法实现
证明技术
数学归纳法
- 基础情况识别
- 归纳假设构建
- 归纳步骤构建
反证法
- 假设否定
- 逻辑推导
- 矛盾识别
循环不变式证明
- 不变式规范
- 三部分证明(初始化、保持、终止)
结构归纳法
- 适用于递归数据结构
- 基础情况(叶子/空)
- 归纳情况(复合结构)
输入模式
{
"type": "object",
"properties": {
"algorithm": { "type": "string" },
"code": { "type": "string" },
"proofType": {
"type": "string",
"enum": ["induction", "contradiction", "invariant", "structural"]
},
"claim": { "type": "string" },
"partialProof": { "type": "string" }
},
"required": ["algorithm", "claim"]
}
输出模式
{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"proof": { "type": "string" },
"structure": { "type": "array" },
"gaps": { "type": "array" },
"suggestions": { "type": "array" }
},
"required": ["success"]
}