办公效率

形式化验证覆盖边界报告

提供证明与验证产物,梳理已证性质、依赖的公理和可信计算基,并指出验证覆盖的缺口。

# 验证边界报告工具

分析形式化验证产物,清晰报告哪些内容已验证、哪些是假设,以及哪些仍未验证。

## 概述

处理经过形式化验证的代码时,必须准确了解验证提供了哪些保证,以及边界在哪里。此技能分析验证产物并生成结构化报告,以便:

1. **识别已验证组件** - 已完成证明的代码
2. **列出假设和公理** - 被直接信任的内容
3. **记录可信计算基(TCB)** - 外部依赖
4. **突出未验证组件** - 验证覆盖范围中的缺口
5. **解释验证的局限性** - 某些部分未被验证的原因

**核心原则:** 保持审慎,表述明确。绝不夸大验证覆盖范围。

## 分析工作流程

```
Verification Artifacts
    ↓
Parse & Identify Components
    ↓
Classify Each Component
    ↓
Analyze Dependencies
    ↓
Generate Boundary Report
```

## 组件分类

### 已验证组件

**定义:** 对所述性质具有完整且经过检查的证明的代码。

**标准:**
- 所有证明义务均已完成
- 证明中没有 `sorry`、`admit`、`Admitted`
- 证明已由验证器检查(Isabelle、Coq、Dafny 等)
- 性质已明确陈述并得到证明

**识别示例:**
```isabelle
(* VERIFIED *)
theorem insertion_sort_correct:
  "sorted (insertion_sort xs) ∧ mset (insertion_sort xs) = mset xs"
proof (induction xs)
  case Nil
  then show ?case by simp
next
  case (Cons x xs)
  then show ?case using insert_sorted mset_insert by auto
qed
```

### 假设组件

**定义:** 未经证明即被接受的陈述。

**标准:**
- 标记为 `axiom`、`sorry`、`admit`、`Admitted`、`assume`
- 声明时未提供证明
- 明确声明为假设

**识别示例:**
```coq
(* ASSUMED *)
Axiom functional_extensionality : forall A B (f g : A -> B),
  (forall x, f x = g x) -> f = g.

(* ASSUMED - proof incomplete *)
Theorem complex_property : ...
Proof.
  (* ... *)
Admitted.
```

### 可信计算基(TCB)

**定义:** 必须信任的外部组件。

**组件:**
- 证明助手内核(Isabelle、Coq、Dafny 验证器)
- 未经验证而使用的标准库
- 代码提取/生成工具
- 操作系统和硬件
- 外部函数或 FFI 调用

**识别示例:**
```isabelle
(* TCB: Relies on Isabelle kernel *)
export_code my_function in SML file "output.sml"

(* TCB: Uses unverified standard library *)
definition process_file :: "string ⇒ unit" where
  "process_file path = ..." (* Calls OS file operations *)
```

### 未验证组件

**定义:** 未经形式化验证的代码。

**原因:**
- 尚未验证(正在进行中)
- 有意不予验证(重要性较低)
- 无法验证(外部依赖)
- 已尝试验证但尚未完成

**识别示例:**
```dafny
// UNVERIFIED: No method body verification
method ProcessData(input: seq<int>) returns (output: seq<int>)
  // No ensures clause - postcondition not specified
{
  // Implementation without verification
}
```

## 分析过程

### 第 1 步:识别所有组件

扫描验证产物,查找:
- 定义和实现
- 定理和引理
- 公理和假设
- 外部依赖
- 提取/生成的代码

### 第 2 步:检查验证状态

对每个组件,确定:
- 是否有证明?(完整/不完整/缺失)
- 是否存在假设或公理?
- 声明了哪些性质?
- 证明了哪些性质?

### 第 3 步:追踪依赖关系

梳理依赖关系,了解:
- 已验证代码依赖什么
- 假设的传播
- 使用了哪些 TCB 元素
- 与未验证代码的交互

### 第 4 步:评估覆盖范围

计算:
- 已验证代码的百分比
- 关键组件与非关键组件
- 验证深度(浅层性质与深层性质)

### 第 5 步:生成报告

生成结构化 Markdown 报告,包含:
- 执行摘要
- 已验证组件清单
- 假设和公理
- TCB 文档
- 未验证组件
- 验证缺口和局限性

## 报告结构

### 模板

```markdown
# Verification Boundary Report

**Project:** [Name]
**Date:** [Date]
**Verifier:** [Isabelle/Coq/Dafny/etc.]
**Analyst:** [Name]

## Executive Summary

[Brief overview of verification coverage and key findings]

## Verification Statistics

- Total components: X
- Verified: Y (Z%)
- Assumed: A
- Unverified: B
- TCB elements: C

## Verified Components

### [Component Name]

**Location:** [File:Line]
**Properties Proven:**
- [Property 1]
- [Property 2]

**Proof Status:** ✓ Complete
**Dependencies:** [List verified dependencies]

## Assumptions and Axioms

### [Assumption Name]

**Location:** [File:Line]
**Statement:** [Formal statement]
**Justification:** [Why this is assumed]
**Impact:** [What depends on this]
**Risk Level:** [Low/Medium/High]

## Trusted Computing Base

### [TCB Element]

**Type:** [Kernel/Library/Tool/OS/Hardware]
**Description:** [What is trusted]
**Justification:** [Why it must be trusted]
**Mitigation:** [How risk is managed]

## Unverified Components

### [Component Name]

**Location:** [File:Line]
**Reason:** [Why unverified]
**Risk Assessment:** [Impact if incorrect]
**Recommendation:** [Should it be verified?]

## Verification Gaps

[List areas where verification is incomplete or absent]

## Limitations

[Explicit statement of what the verification does NOT guarantee]

## Recommendations

[Suggestions for improving verification coverage]
```

## 针对特定框架的分析

### Isabelle/HOL 分析

有关 Isabelle 的专项验证边界分析,请参阅 [references/isabelle_analysis.md](references/isabelle_analysis.md)。

关键方面:
- 识别 `sorry` 和不完整的证明
- 检查公理的使用情况
- 分析代码生成的可信性
- 对 Sledgehammer 和自动化的依赖

### Coq 分析

有关 Coq 的专项验证边界分析,请参阅 [references/coq_analysis.md](references/coq_analysis.md)。

关键方面:
- 识别 `Admitted` 和 `admit`
- 检查公理的使用情况(函数外延性等)
- 分析代码提取的可信性
- Program 义务

### Dafny 分析

有关 Dafny 的专项验证边界分析,请参阅 [references/dafny_analysis.md](references/dafny_analysis.md)。

关键方面:
- 检查方法验证情况
- 识别 assume 语句
- 分析外部方法
- 验证超时问题

## 常见模式

有关常见验证边界模式和警示信号,请参阅 [references/boundary_patterns.md](references/boundary_patterns.md)。

模式包括:
- 假设的传播
- 部分验证
- 通过测试进行验证
- 可信包装器
- 验证绕过机制

## 分析示例

**输入:已验证的排序实现**

```isabelle
theory VerifiedSort
imports Main "HOL-Library.Multiset"
begin

fun insert :: "nat ⇒ nat list ⇒ nat list" where
  "insert x [] = [x]" |
  "insert x (y # ys) = (if x ≤ y then x # y # ys else y # insert x ys)"

fun insertion_sort :: "nat list ⇒ nat list" where
  "insertion_sort [] = []" |
  "insertion_sort (x # xs) = insert x (insertion_sort xs)"

lemma insert_sorted:
  "sorted xs ⟹ sorted (insert x xs)"
  by (induction xs) auto

lemma mset_insert:
  "mset (insert x xs) = {#x#} + mset xs"
  by (induction xs) (auto simp: ac_simps)

theorem insertion_sort_correct:
  "sorted (insertion_sort xs) ∧ mset (insertion_sort xs) = mset xs"
  by (induction xs) (auto simp: insert_sorted mset_insert)

export_code insertion_sort in SML file "sort.sml"

end
```

**输出:验证边界报告**

```markdown
# Verification Boundary Report

**Project:** VerifiedSort
**Date:** 2026-02-17
**Verifier:** Isabelle/HOL
**Analyst:** Verification Boundary Reporter

## Executive Summary

The insertion sort implementation is fully verified with complete proofs of
correctness (sorting and permutation preservation). The verification relies
on Isabelle's standard library and kernel as the trusted computing base.
Code extraction to SML is part of the TCB.

## Verification Statistics

- Total components: 5
- Verified: 3 (60%)
- Assumed: 0 (0%)
- Unverified: 0 (0%)
- TCB elements: 2 (40%)

## Verified Components

### insert function
**Location:** VerifiedSort.thy:5-7
**Properties Proven:**
- Preserves sortedness (insert_sorted)
- Preserves multiset (mset_insert)
**Proof Status:** ✓ Complete
**Dependencies:** None (base case)

### insertion_sort function
**Location:** VerifiedSort.thy:9-11
**Properties Proven:**
- Produces sorted output
- Preserves all elements (permutation)
**Proof Status:** ✓ Complete
**Dependencies:** insert, insert_sorted, mset_insert

### Correctness theorem
**Location:** VerifiedSort.thy:18-19
**Statement:** sorted (insertion_sort xs) ∧ mset (insertion_sort xs) = mset xs
**Proof Status:** ✓ Complete
**Proof Method:** Induction with auto

## Assumptions and Axioms

None. All proofs are complete without axioms.

## Trusted Computing Base

### Isabelle/HOL Kernel
**Type:** Proof Assistant Kernel
**Description:** The Isabelle/HOL logical kernel that checks all proofs
**Justification:** Fundamental to all verification; cannot be verified within itself
**Mitigation:** Small, well-audited kernel; decades of use

### Isabelle Standard Library
**Type:** Library
**Description:** HOL-Library.Multiset for multiset operations
**Justification:** Used for permutation reasoning
**Mitigation:** Part of standard Isabelle distribution, widely used and tested

### Code Generation
**Type:** Tool
**Description:** export_code mechanism that generates SML
**Justification:** Translates verified Isabelle code to executable SML
**Mitigation:** Code generator is part of Isabelle, but translation correctness
is not formally verified. Generated code must be trusted to match semantics.

## Unverified Components

None. All algorithmic components are verified.

## Verification Gaps

None identified in the core algorithm.

## Limitations

1. **Code extraction trust:** The generated SML code is not verified to match
   the Isabelle semantics. The code generator is trusted.

2. **Termination:** While termination is proven by Isabelle's function package,
   the extracted code's termination depends on the SML runtime.

3. **I/O and side effects:** Any I/O operations in the extracted code are
   outside the verification boundary.

4. **Numeric representation:** The verification uses mathematical integers (nat),
   but extracted code uses machine integers which may overflow.

## Recommendations

1. **Consider verified extraction:** Use a verified code generator or
   certified compilation if higher assurance is needed.

2. **Add overflow checks:** If using extracted code with large inputs,
   add runtime checks for integer overflow.

3. **Document TCB:** Clearly communicate to users that code extraction
   is part of the trusted base.
```

## 最佳实践

1. **保持审慎:** 有疑问时,归类为未验证
2. **表述明确:** 准确说明哪些已验证、哪些未验证
3. **追踪依赖关系:** 展示假设如何传播
4. **量化覆盖范围:** 提供统计数据和百分比
5. **评估风险:** 评估未验证组件的影响
6. **记录 TCB:** 清楚列出所有受信任的元素
7. **不作猜测:** 不要猜测验证状态

## 警示信号

留意:
- 证明中的 `sorry`、`admit`、`Admitted`
- 缺乏依据的公理
- 缺失的规格说明
- 不完整的证明
- 外部函数调用
- 未经验证的代码生成
- 基于超时的“验证”
- 类似“TODO: prove this”的注释

## 报告原则

### 原则 1:完整性

报告所有组件,而不仅是已验证的组件。

### 原则 2:诚实

绝不夸大验证覆盖范围。

### 原则 3:清晰

使用清晰、无歧义的语言。

### 原则 4:可追溯性

将每项声明关联到具体产物。

### 原则 5:风险评估

评估验证缺口的影响。

## 其他资源

有关具体方面的详细指导:
- [Isabelle 分析](references/isabelle_analysis.md) - Isabelle 专项边界分析
- [Coq 分析](references/coq_analysis.md) - Coq 专项边界分析
- [Dafny 分析](references/dafny_analysis.md) - Dafny 专项边界分析
- [边界模式](references/boundary_patterns.md) - 常见模式和警示信号

同类提示词

办公效率· n8n 工作流的对话模型

商品照片转棚拍广告生图指令

上传商品照片并提供说明文字,分析材质、配色和原图问题,写出保留商品外观的棚拍广告生图指令。

=你是一位专业产品摄影师和广告创意总监。分析上传的产品图片及其配文:{{ $('Telegram Trigger Received').item.json.message.caption }} 你的任务是创建一段详细的图像生成提示词,将这张产品照片转化为高端、商业级的广告视觉作品。 分析要求: 1. **产品识别**:识别产品类型、尺寸、类别、材质、配色和关键特征 2. **当前状态评估**:指出当前的光线、背景、构图和质量问题 3. **目标美学**:根据产品类别确定理想的广告风格(奢侈品、科技、食品、时尚等) 输出(严格使用 JSON 格式):
办公效率· n8n 工作流的对话模型

Veo 3营销视频分镜指令

填写视频需求、营销目标、图像描述和画幅,生成包含场景、运镜、动作、灯光与结尾的结构化制片指令。

=# Veo3 视频生成系统提示词 你是一名专业的视频提示词工程师,擅长为 Veo3 视频生成撰写细致、富有电影感的提示词。你的角色是分析用户输入,将其转化为全面的视频生成指令,以产出高质量、引人入胜的内容。 ## 输入分析 你将收到以下用户输入: - **AI Videos instructions**:视频生成的核心用户请求 - **Campaign objectives**:营销活动目标和说明 - **Images Description**:用户提供的视觉背景信息 - **Aspect Ratio**:要求的视频尺寸比例 ## 输出格式 你
可填 21 项
办公效率· n8n 工作流的对话模型

保留原品的社媒广告视觉方案

提供商品图和配文,生成保留原品外观的广告生图说明,广告文字仅从配文提取,缺项留空。

={ "system_prompt": "你是一位顶尖创意总监,专攻爆款产品广告,拥有15年以上奢侈品牌广告活动经验。将产品图片转化为商业级广告,让浏览者停下滑动并促进转化。", "instructions": { "core_rules": [ "保持原始产品100%不变——不得修改、替换或扭曲", "只提取和使用用户配文中提供的文字", "如果配文中没有相关文字,文字字段留空——绝不生成AI广告语", "专注于高端视觉强化和商业摄影技巧", "制作适合在Instagram展
办公效率· Claude Fable 5.2

用代码制作长纪录片流程

从题材调研、脚本和样帧审核开始,按章节生成三维分镜、旁白、环境声与可复现渲染。

<inputs> 向我询问: 1. 我的主题 2. 目标视频时长 3. 我是否已有脚本 如果我只给你一个主题,先研究该主题并撰写脚本。 开始制作任何内容之前,先向我展示: - 完整脚本 - 章节拆分 - 前 60 seconds 的分镜计划 - 6 张展示预期视觉方向的静帧 在我认可视觉效果之前,不要渲染完整视频。 </inputs> <story> 按照高品质 YouTube 纪录片的方式来写,不要写成 AI 科普解说。 故事必须始终向前推进。 每个部分都需要包含以下内容之一: - 一个新问题 - 一个揭示 - 一个矛盾 - 一个后果 - 一条证据
办公效率

同场景表情变化九宫格自拍

上传主角照片,可选搭档参考图或设定,并填写服装、背景或姿势偏好,生成同一布光和构图的九张变化。

# photo-booth ## 何时使用此 skill - 当用户希望根据参考图制作大头贴宫格、表情宫格、情侣自拍宫格、同步姿势组图或多种人像变体时使用。 - 当请求制作 3x3 宫格,且主体、房间、服装、构图和布光保持一致,仅表情或细微姿势发生变化时触发。 ## 必需输入 - 主要人物的主参考图。 - 可选的伴侣或角色参考图。 - 如果未提供伴侣参考图,需提供期望的伴侣设定。 - 用户指定的服装、背景、摄影时代、姿势清单或氛围。 如果缺少主参考图,请用户附上。如果伴侣设定或预期风格不明确,提出一个有针对性的问题。 ## 连续性规则 -
需参考图
办公效率· Claude Code / 动效编程

单镜头立体落地页飞越动画

提供落地页链接、品牌名、标志和两段收尾文案,可选配乐,制作卡片随镜头掠过而浮起的连续飞越短片。

<inputs> 向我索取:我的落地页链接、品牌名称和标志、由两部分组成的结尾文案(一句陈述,后接一小段斜体文字),以及一条 15 second 音轨(可选)。 </inputs> <direction> 以 60fps 对我的落地页进行 14.5 second 3D 飞越拍摄,1440x1152。页面平放在明亮的摄影棚地面上(中央为 #f9fbfb,角落为 #f2f3f6),周围有柔和宽阔的阴影,圆角为 24px。全程使用一个连续镜头,绝不切镜:镜头从首屏上方低处开始,以恒定速度沿页面向后滑行,同时朝页面上方看去;然后垂直升至正上方,将整个页面呈现为
✓