dafny-formal-verification
Use this to mathematically guarantee zero race conditions and logical correctness via Dafny formal verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use this to mathematically guarantee zero race conditions and logical correctness via Dafny formal verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
SlopBench soft oracle derived from Andrej Karpathy's behavioral guidelines for LLM coding (https://github.com/forrestchang/andrej-karpathy-skills). Enforces simplicity-first design, surgical changes, and goal-driven execution as structural constraints. Pipeline: https://github.com/davidkimai/specoracle
SlopBench soft oracle enforcing the Zen of Python (PEP 20) as structural quality constraints during LLM code generation. Conditions outputs toward simplicity, flatness, explicitness, and local auditability. Pipeline: https://github.com/davidkimai/specoracle
| name | dafny-formal-verification |
| description | Use this to mathematically guarantee zero race conditions and logical correctness via Dafny formal verification. |
| license | MIT |
Use Dafny when the task needs a hard correctness oracle rather than a style oracle. First write the behavior as a small verified Dafny program, then compile the executable subset to Python. Keep the proof small enough that the compiled Python remains understandable.
method bodies. Use function only for pure specs
or simple executable expressions.requires for caller obligations and input bounds.ensures for the postcondition that must prove the result is correct.invariant on loops to preserve the facts needed by the final ensures.decreases on recursive functions or loops when termination is not obvious.assert sparingly to expose one proof step at a time.modifies..dfy source.method Clamp(x: int, lo: int, hi: int) returns (y: int)
requires lo <= hi
ensures lo <= y <= hi
ensures x < lo ==> y == lo
ensures lo <= x <= hi ==> y == x
ensures hi < x ==> y == hi
{
if x < lo {
y := lo;
} else if hi < x {
y := hi;
} else {
y := x;
}
}