deductive-verification-with-dafny-and-why3

deductive-verification-with-dafny-and-why3 is a skill for Claude Code, Codex from OutlineDriven/odin-claude-plugin. It costs 48 tokens per session (1,221 once invoked), scanned A, a copy of deductive-verification-with-dafny-and-why3, Apache-2.0.

A guide to proving that imperative programs meet stated rules using Dafny or Why3. These rules include what must be true before and after code runs, and what remains true during loops.

In plain words
What is it for?
Use it to add and verify preconditions, postconditions, loop invariants, and termination measures in Dafny or WhyML source files.
Why use it?
It helps catch incorrect code by checking its behavior mathematically instead of relying only on test cases. It also makes the required assumptions and results explicit.

Skill for Claude CodeCodex

Written for Claude Code and Codex: disable-model-invocation in frontmatter, but also agents/openai.yaml present.

Part of the odin-formal plugin — 9 skills shipped together

Good fit Use it to add and verify preconditions, postconditions, loop invariants, and termination measures in Dafny or WhyML source files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/outlinedriven/odin-claude-plugin/deductive-verification-with-dafny-and-why3
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add OutlineDriven/odin-claude-plugin --skill deductive-verification-with-dafny-and-why3
Clone the repo
git clone --depth 1 https://github.com/OutlineDriven/odin-claude-plugin

Made for: Claude Code, Codex.

Or install odin-formal, the plugin that ships this one along with the rest of its 9 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for deductive-verification-with-dafny-and-why3

README.md
[![agentmods](https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/deductive-verification-with-dafny-and-why3/github.svg)](https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/deductive-verification-with-dafny-and-why3)
Your own site
<a href="https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/deductive-verification-with-dafny-and-why3"><img src="https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/deductive-verification-with-dafny-and-why3/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for deductive-verification-with-dafny-and-why3

Your own site · 80×15
<a href="https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/deductive-verification-with-dafny-and-why3"><img src="https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/deductive-verification-with-dafny-and-why3.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,221 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.01221
Opus 5.5 $0.00019 $0.00488
Sonnet 5.5 $0.00010 $0.00244
Haiku 4.5 $0.00005 $0.00122

Measured 2mo ago against content hash 17a181014acd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

deductive-verification-with-dafny-and-why3 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to deductive-verification-with-dafny-and-why3 — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/odin-formal/skills/deductive-verification-with-dafny-and-why3/SKILL.md · 41 lines

How it starts

The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Deductive verification with Dafny and Why3

Contract

Field Bound contract
Trigger The task is to prove the pre-conditions, post-conditions, and loop invariants of imperative code with an SMT-backed prover: Dafny for annotate-then-verify on executable code, Why3 for multi-prover goals over WhyML. Methodology stays with proof-driven.
Authority Reversible local: writes only Dafny and WhyML source files, prover configuration, and session files under the project; rollback is version control. No remote mutation.
Side effect Local writes to annotated sources, the Why3 user configuration, and .why3session.xml proof sessions. No remote mutation.
Done The module verifies with no unproved obligations: dafny verify reports zero errors, or every Why3 goal is Valid and why3 replay re-confirms the session.

Inputs

  • Code to verify: Dafny sources (.dfy) or WhyML sources (.mlw), new or existing.
  • The property set: pre-conditions, post-conditions, loop invariants, and termination measures.
  • Dafny 4.11 (current release 4.11.0, 2026-08-25), installed per dafny.org with dotnet tool install --global dafny, Homebrew, or the binary archive; the release bundles its own Z3. Reference: DafnyRef at dafny.org.
  • Why3 1.8.2, installed with opam install why3 (add why3-ide for the GUI), with at least one prover detected. Manual at why3.org/doc.
  • Pipeline fact: Dafny verification lowers to Boogie, which encodes to Z3.

Procedure

  1. Install and detect provers. Install Dafny or Why3, then confirm a solver exists. Dafny carries a bundled Z3, so its CLI runs directly. Why3 needs why3 config detect to find provers (Alt-Ergo, CVC4, CVC5, Z3) and record them in the user configuration. Done when: dafny verify runs on a trivial file, or why3 config detect lists at least one prover.
  2. Write the contracts first. State requires and ensures on every method or function, modifies where a method touches the heap, and a decreases measure on recursion. Give every while loop an invariant set, because Dafny verifies loops through their specifications. In WhyML, write requires, ensures, and a variant termination measure on each let rec. Done when: every property is in the source and the first verification run names unproved goals instead of failing on structure.
  3. Clear failures one obligation at a time. Read the error span, state the missing intermediate fact as an assert, and re-verify. Strengthen a loop invariant before touching the post-condition. A calc chain decomposes an arithmetic gap in Dafny. Cap noisy output with --verification-error-limit:<n> (default 5; 0 reports all). Done when: the targeted obligation passes and no new obligation appeared.
  4. Drive Why3 goals across provers. Run why3 prove file.mlw for a batch summary of Valid, Unknown, or Timeout per goal. Open why3 ide file.mlw to run one goal under alternate provers and apply transformations such as split. Save the session, then re-check it in batch with why3 replay <project-directory>, which reruns every proof stored in the directory's why3session.xml. Done when: every goal is Valid under a prover recorded in the session and why3 replay confirms it.
  5. Gate the result. Delivered code has zero verification errors and no weakened contract: never drop a requires or ensures to make a goal pass, and make an inferred loop invariant explicit when the proof depends on it. Run dafny run for an executable check, or dafny translate cs|java|go|py (js also exists; cpp has limited support) when a build target is set. Done when: verification is clean, the executable check or translation target succeeds, and the contracts in the diff match the stated properties.

Read the full file on GitHub · 41 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · +1 lines 17a181014acd
  2. 2mo ago First seen · 40 lines · 48 tokens per session scan A d566e53910ed

Subscribe to this mod's changes

deductive-verification-with-dafny-and-why3 is a skill published in the GitHub repository OutlineDriven/odin-claude-plugin (40 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 48 tokens to every session and 1,221 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to deductive-verification-with-dafny-and-why3, differing in 0 lines, and is treated as a copy.

Related

deductive-verification-with-dafny-and-why3 compared with skills from other repositories

deductive-verification-with-dafny-and-why3 next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
deductive-verification-with-dafny-and-why3OutlineDriven/odin-claude-pluginSkill402mo agoApache-2.0A48Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill330k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14kyesterdayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code