{
  "id": "frama-c-wp",
  "name": "Frama-C WP",
  "aka": [
    "Frama-C/WP",
    "WP plug-in"
  ],
  "summary": "Write ACSL contracts and loop invariants as comments in your C code; Frama-C's WP plug-in turns them into proof goals for SMT solvers.",
  "use_if": [
    "You write or maintain C code and can annotate it with contracts (pre- and postconditions) and loop invariants.",
    "You need proofs that hold for all inputs, not just up to a bound, for example for certification (DO-178C, Common Criteria).",
    "Your code is mostly plain integer and pointer code without heavy casting."
  ],
  "avoid_if": [
    "Your code relies on unions, type punning, casts between pointer types or byte-level memory tricks.",
    "Your code uses threads or shared memory.",
    "Your code is heavy on floating point and you need precise numeric results; automatic provers rarely succeed there."
  ],
  "effort": "auto-active",
  "open": "open-source",
  "license": "LGPL-2.1-only",
  "maintainers": [
    "CEA-List"
  ],
  "links": {
    "homepage": "https://frama-c.com/fc-plugins/wp.html",
    "repo": "https://git.frama-c.com/pub/frama-c",
    "docs": "https://frama-c.com/download/frama-c-wp-manual.pdf",
    "tutorial": "https://allan-blanchard.fr/publis/frama-c-wp-tutorial-en.pdf"
  },
  "components": [
    {
      "role": "frontend",
      "name": "Frama-C kernel (C parser, normalizer and bundled libc headers)",
      "assurance": "trusted",
      "note": "Frama-C's own front end; by default it uses its own standard-library headers instead of the system ones."
    },
    {
      "role": "translation",
      "name": "RTE plug-in",
      "assurance": "trusted",
      "note": "Adds an assertion before each operation that could cause a runtime error (run with -wp-rte)."
    },
    {
      "role": "translation",
      "name": "WP (weakest-precondition calculus, memory models, Qed simplifier)",
      "assurance": "trusted",
      "note": "Default model is Typed+var+int+float."
    },
    {
      "role": "checker",
      "name": "Alt-Ergo (default) or other SMT solvers via Why3 (Z3, cvc5)",
      "assurance": "trusted"
    },
    {
      "role": "checker",
      "name": "Rocq (Coq)",
      "ref": "rocq",
      "ref_kind": "prover",
      "assurance": "trusted",
      "note": "Optional; for goals the SMT solvers cannot prove, checked interactively in Rocq."
    },
    {
      "role": "compiler",
      "name": "Any C compiler, e.g. gcc or clang (not part of Frama-C)",
      "assurance": "trusted"
    }
  ],
  "verifies": [
    {
      "target": "c",
      "note": "Code must parse with Frama-C's front end. Loops built with goto (non-natural loops) are not supported since Frama-C 23."
    }
  ],
  "properties": {
    "no-ub": {
      "status": "partial",
      "note": "With -wp-rte, the RTE plug-in adds assertions for runtime errors such as invalid memory access and arithmetic overflow, and WP proves them for all inputs. Guards for pointer alignment and for calls through invalid function pointers are skipped, and code outside the memory model (for example heterogeneous pointer casts) cannot be handled.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "functional": {
      "status": "full",
      "note": "ACSL contracts with pre/postconditions, behaviors and ghost code.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "equivalence": {
      "status": "partial",
      "note": "WP proves one function against one contract. Relating two programs (such as an optimized and a reference version) needs the separate research plug-in RPP, which uses self-composition on top of WP.",
      "source": "https://arxiv.org/abs/1801.06876v2"
    },
    "info-flow": {
      "status": "none",
      "note": "WP has no built-in support. Non-interference can be stated with the separate RPP plug-in, and Frama-C's SecureFlow tool targets information flow, but neither is part of WP; constant-time is not covered.",
      "source": "https://frama-c.com/download/frama-c-user-manual.pdf"
    },
    "concurrency": {
      "status": "none",
      "note": "WP's manual describes no model of threads or atomics. Frama-C's Mthread tool analyzes concurrent code, but it is not part of WP.",
      "source": "https://frama-c.com/download/frama-c-user-manual.pdf"
    },
    "termination": {
      "status": "full",
      "note": "terminates and decreases clauses and loop variants generate termination goals, including for (mutually) recursive functions.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    }
  },
  "features": {
    "core.integers": {
      "status": "full",
      "note": "Machine-integer model by default; overflow and downcast checks are set by kernel -warn options or the RTE plug-in.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "core.floats": {
      "status": "partial",
      "note": "The default float model follows IEEE 754 and is sound, but the manual says automated provers give very little support for proving float properties. A \"real\" model exists but is unsound.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "core.heap": {
      "status": "partial",
      "note": "Pointers and aliasing are handled by the Typed memory model, but ACSL clauses for specifying allocation and deallocation are not implemented in WP.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "core.arrays": {
      "status": "full",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "core.loops": {
      "status": "full",
      "note": "Needs a loop invariant (and a variant for termination) for each loop. Loops built with goto are not supported.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "core.recursion": {
      "status": "full",
      "note": "Recursive functions need a decreases clause when termination is required.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "core.higher-order": {
      "status": "partial",
      "note": "A function pointer must be provably equal to one of a finite set of known functions (ACSL calls extension); function contracts cannot yet be passed through pointers.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "core.concurrency": {
      "status": "none",
      "note": "No model of threads or shared-memory concurrency in WP.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "core.io": {
      "status": "partial",
      "note": "I/O and system calls are described only by ACSL contracts in Frama-C's bundled libc, which are assumed, not proved, and cover a subset of POSIX.",
      "source": "https://frama-c.com/download/frama-c-user-manual.pdf"
    },
    "core.stdlib": {
      "status": "partial",
      "note": "Frama-C bundles a libc with ACSL specifications that the user manual calls incomplete and part of the trusted computing base.",
      "source": "https://frama-c.com/download/frama-c-user-manual.pdf"
    },
    "c.provenance": {
      "status": "partial",
      "note": "The default Typed model forbids casts between unrelated pointer types (for example reading an int through a char pointer). The option for unlimited casts is unsound; the byte-level model is experimental.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "c.unions": {
      "status": "partial",
      "note": "The manual lists bytes, unions and casts as a hard open limitation; only the experimental Bytes and Region models give byte-level access.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "c.bitfields": {
      "status": "unknown",
      "note": "The WP manual does not discuss bit-fields."
    },
    "c.varargs": {
      "status": "partial",
      "note": "The Variadic plug-in (on by default) rewrites variadic functions and calls into fixed-argument ones; printf/scanf calls with a non-constant format string are not translated.",
      "source": "https://frama-c.com/fc-plugins/variadic.html"
    },
    "c.setjmp": {
      "status": "none",
      "note": "A 2024 Thales/CEA presentation on WP lists setjmp/longjmp among C features still to be handled.",
      "source": "https://frama-c.com/download/publications/frama-c-days-2024/09-javacard.pdf"
    },
    "c.volatile": {
      "status": "partial",
      "note": "By default a volatile read gives an arbitrary value and a write is treated as an assigns clause; device behavior is not modeled.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "c.inline-asm": {
      "status": "partial",
      "note": "For extended GNU asm, Frama-C generates assigns clauses from the output operands; what the assembly computes is not modeled and must be specified by hand.",
      "source": "https://frama-c.com/download/frama-c-user-manual.pdf"
    }
  },
  "trust": {
    "checker": {
      "level": "amber",
      "summary": "Alt-Ergo or another SMT solver via Why3 is trusted; no proof certificates.",
      "note": "WP's own simplifier (Qed) is also trusted. Goals can instead be proved in Rocq (Coq), whose kernel then checks them.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "semantics": {
      "level": "amber",
      "summary": "C model built into Frama-C and WP's memory models; no published validation found.",
      "note": "Some non-default options are unsound by design (Typed with unlimited casts, the real-number float model, -wp-no-volatile); the defaults avoid them.",
      "source": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "frontend": {
      "level": "amber",
      "summary": "Frama-C's own C parser and normalizer, not the compiler's front end.",
      "source": "https://frama-c.com/download/frama-c-user-manual.pdf"
    },
    "binary_gap": {
      "level": "red",
      "summary": "The binary comes from an ordinary C compiler; the proof does not carry down to it."
    },
    "escape_hatches": {
      "level": "amber",
      "summary": "admit, axioms and assumed libc contracts exist; the Report plug-in lists them.",
      "note": "admit and axiom generate no proof goal, and contracts of functions without bodies are assumed. Report marks these \"considered valid\", but a property that depends on them can still show as \"surely valid\", and the manual says dependency tracking is neither correct nor complete. Optional smoke tests look for contradictory assumptions.",
      "source": "https://frama-c.com/download/frama-c-user-manual.pdf"
    }
  },
  "stage_evidence": {
    "public_artifact": {
      "met": true,
      "evidence": "https://git.frama-c.com/pub/frama-c"
    },
    "published_use": {
      "met": true,
      "evidence": "https://www.di.ens.fr/~delmas/erts18/erts18-short.pdf",
      "note": "Airbus (ERTS 2018): unit proof of avionics C functions with Frama-C/WP and Alt-Ergo."
    },
    "installs_on_current": {
      "met": true,
      "evidence": "https://frama-c.com/html/get-frama-c.html",
      "note": "Installers for Linux and macOS; opam for Linux, macOS and Windows (WSL)."
    },
    "user_docs": {
      "met": true,
      "evidence": "https://frama-c.com/download/frama-c-wp-manual.pdf"
    },
    "external_users": {
      "met": true,
      "evidence": "https://www.di.ens.fr/~delmas/erts18/erts18-short.pdf",
      "note": "Airbus and Thales (not the CEA-List developers) report using WP."
    },
    "soundness_channel": {
      "met": true,
      "evidence": "https://git.frama-c.com/pub/frama-c",
      "note": "Issue tracker on the Frama-C GitLab (sign in, for example with a GitHub account, to view and file issues); reports can be public or confidential."
    }
  },
  "production_users": [
    {
      "org": "Thales",
      "what": "Java Card virtual machine for smart cards, verified with Frama-C (WP and MetAcsl); this work enabled Common Criteria EAL7 certification.",
      "source": "https://list.cea.fr/en/towards-the-formal-certification-of-security-products/"
    }
  ],
  "last_release": {
    "version": "33.0 (Arsenic)",
    "date": "2026-07-23",
    "source": "https://git.frama-c.com/pub/frama-c/-/tags/33.0"
  },
  "used_for": [
    {
      "name": "Airbus unit proof of avionics software (replacing the older Caveat tool)",
      "url": "https://www.di.ens.fr/~delmas/erts18/erts18-short.pdf"
    },
    {
      "name": "Thales Java Card virtual machine (about 8,000 lines of C, 80,000 proof goals)",
      "url": "https://frama-c.com/download/publications/frama-c-days-2024/09-javacard.pdf"
    }
  ],
  "last_checked": "2026-11-26",
  "attestation": "maintainer",
  "claimed_by_authors": false,
  "sources": [
    {
      "url": "https://frama-c.com/download/frama-c-wp-manual.pdf",
      "title": "WP Plug-in Manual for Frama-C 33.0 (Arsenic)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://frama-c.com/download/frama-c-user-manual.pdf",
      "title": "Frama-C User Manual for Frama-C 33.0 (Arsenic)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://frama-c.com/fc-plugins/wp.html",
      "title": "WP plug-in page",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://frama-c.com/2021/06/10/acsl-admit-check.html",
      "title": "Admit and check annotations in ACSL",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://frama-c.com/html/get-frama-c.html",
      "title": "Get Frama-C",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://github.com/ocaml/opam-repository/tree/master/packages/frama-c/frama-c.33.0",
      "title": "frama-c 33.0 opam package (license LGPL-2.1-only)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://www.di.ens.fr/~delmas/erts18/erts18-short.pdf",
      "title": "Brahmi et al., Formalise to automate (Airbus, ERTS 2018)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://frama-c.com/download/publications/frama-c-days-2024/09-javacard.pdf",
      "title": "Thales JavaCard VM verification (Frama-C Days 2024)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://list.cea.fr/en/towards-the-formal-certification-of-security-products/",
      "title": "CEA-List, Towards the formal certification of security products (2024)",
      "accessed": "2026-11-26"
    }
  ],
  "computed": {
    "kind": "toolchains",
    "methodology_version": "0.1",
    "built": "2026-11-26",
    "links": {
      "html": "/toolchains/frama-c-wp/",
      "json": "/toolchains/frama-c-wp.json",
      "markdown": "/toolchains/frama-c-wp.md"
    },
    "stage": {
      "stage": 1,
      "name": "Usable",
      "criteria": [
        {
          "key": "public_artifact",
          "stage": 0,
          "label": "Publicly available",
          "met": true,
          "evidence": "https://git.frama-c.com/pub/frama-c",
          "computed": false
        },
        {
          "key": "published_use",
          "stage": 0,
          "label": "At least one published verification uses it",
          "met": true,
          "evidence": "https://www.di.ens.fr/~delmas/erts18/erts18-short.pdf",
          "note": "Airbus (ERTS 2018): unit proof of avionics C functions with Frama-C/WP and Alt-Ergo.",
          "computed": false
        },
        {
          "key": "recent_release",
          "stage": 1,
          "label": "Released or updated in the last 12 months",
          "met": true,
          "evidence": "https://git.frama-c.com/pub/frama-c/-/tags/33.0",
          "note": "Latest release: 33.0 (Arsenic), 2026-07-23.",
          "computed": true
        },
        {
          "key": "installs_on_current",
          "stage": 1,
          "label": "Installs and runs on current platforms",
          "met": true,
          "evidence": "https://frama-c.com/html/get-frama-c.html",
          "note": "Installers for Linux and macOS; opam for Linux, macOS and Windows (WSL).",
          "computed": false
        },
        {
          "key": "user_docs",
          "stage": 1,
          "label": "User documentation or tutorial",
          "met": true,
          "evidence": "https://frama-c.com/download/frama-c-wp-manual.pdf",
          "computed": false
        },
        {
          "key": "external_users",
          "stage": 1,
          "label": "Used by a group other than its authors",
          "met": true,
          "evidence": "https://www.di.ens.fr/~delmas/erts18/erts18-short.pdf",
          "note": "Airbus and Thales (not the CEA-List developers) report using WP.",
          "computed": false
        },
        {
          "key": "production_users",
          "stage": 2,
          "label": "Verified code in production at two or more independent organizations",
          "met": false,
          "note": "1 recorded: Thales.",
          "computed": true
        },
        {
          "key": "checker_not_red",
          "stage": 2,
          "label": "Checker axis is not red",
          "met": true,
          "computed": true
        },
        {
          "key": "semantics_not_red",
          "stage": 2,
          "label": "Semantics axis is not red",
          "met": true,
          "computed": true
        },
        {
          "key": "soundness_channel",
          "stage": 2,
          "label": "Public channel for soundness bugs",
          "met": true,
          "evidence": "https://git.frama-c.com/pub/frama-c",
          "note": "Issue tracker on the Frama-C GitLab (sign in, for example with a GitHub account, to view and file issues); reports can be public or confidential.",
          "computed": false
        }
      ],
      "missing_for_next": [
        "production_users"
      ]
    }
  }
}