{
  "id": "cerberus",
  "name": "Cerberus C semantics",
  "aka": [
    "Cerberus"
  ],
  "summary": "An executable semantics of a large part of ISO C11 that explores all behaviors a small C program may have, including pointer provenance. CN is built on it.",
  "target": "c",
  "fragment": "A substantial fragment of ISO C11, single-threaded in the base version. Not supported: bit-fields, variable-length arrays, C11 generic selection, C11 character-set types, setjmp/longjmp and signals. Only modeled informally or partly: floating point (float and double via OCaml floats), volatile, restrict and register (syntax checks only), the standard library (an adapted musl libc plus a formal printf). The preprocessor is not modeled; GCC or Clang preprocess the input.",
  "version": "ISO C11 (fragment)",
  "framework": "Lem (translated to OCaml)",
  "provers": [],
  "open": "open-source",
  "license": "BSD-2-Clause (with listed exceptions)",
  "maintainers": [
    "University of Cambridge (REMS project)"
  ],
  "links": {
    "homepage": "https://www.cl.cam.ac.uk/~pes20/cerberus/",
    "repo": "https://github.com/rems-project/cerberus",
    "docs": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf",
    "paper": "http://www.cl.cam.ac.uk/users/pes20/cerberus/cerberus-popl2019.pdf"
  },
  "validation": "Published test results. Memarian's 2023 thesis reports differential testing against Clang on Csmith programs (1186 of 1192 and 463 of 470 tests agree; the rest time out) and the GCC torture tests (1148 of 1160 supported tests executed correctly, after manual adaptation; 363 tests use unsupported features). The POPL 2019 paper reports earlier GCC torture results (948 of 974) and results on the ITC Toyota benchmark and a pointer-provenance test suite.",
  "stage_evidence": {
    "mechanized": {
      "met": true,
      "evidence": "https://github.com/rems-project/cerberus",
      "note": "A machine-readable definition in Lem (about 20,000 lines in 2019), compiled to OCaml. It is not available as definitions in a proof assistant."
    },
    "scope_stated": {
      "met": true,
      "evidence": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf",
      "note": "The thesis introduction lists missing and simplified features."
    },
    "executable": {
      "met": true,
      "evidence": "https://github.com/rems-project/cerberus#basic-usage",
      "note": "cerberus --exec runs C programs; a web interface explores all allowed behaviors of small tests."
    },
    "validated": {
      "met": true,
      "evidence": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf",
      "note": "Chapter 12: Csmith differential testing against Clang and the GCC torture tests."
    },
    "adopted_by_owner": {
      "met": false,
      "evidence": "https://webstore.iec.ch/en/publication/107524",
      "note": "Not an official reference for C. Its authors worked with ISO WG14 on pointer provenance; WG14 has since published ISO/IEC TS 6010:2025, a provenance-aware memory object model for C."
    },
    "full_coverage": {
      "met": false,
      "evidence": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf",
      "note": "Several C11 features are missing (see fragment)."
    },
    "tracks_versions": {
      "met": false,
      "note": "No stated policy for following new C standards (C17, C23)."
    }
  },
  "features": {
    "core.integers": {
      "status": "full",
      "note": "Integer undefined behavior is detected. Implementation-defined sizes follow LP64 for testing.",
      "source": "http://www.cl.cam.ac.uk/users/pes20/cerberus/cerberus-popl2019.pdf"
    },
    "core.floats": {
      "status": "partial",
      "note": "Informal: only float and double, computed with OCaml's floats. Floating-point undefined behavior and the floating-point environment are not modeled.",
      "source": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf"
    },
    "core.heap": {
      "status": "full",
      "note": "Memory object models with pointer provenance are the core of the work.",
      "source": "http://www.cl.cam.ac.uk/users/pes20/cerberus/cerberus-popl2019.pdf"
    },
    "core.arrays": {
      "status": "partial",
      "note": "Variable-length arrays are not supported; flexible array members are supported but need more validation.",
      "source": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf"
    },
    "core.loops": {
      "status": "full"
    },
    "core.recursion": {
      "status": "full"
    },
    "core.higher-order": {
      "status": "full",
      "note": "Function pointers are supported.",
      "source": "http://www.cl.cam.ac.uk/users/pes20/cerberus/cerberus-popl2019.pdf"
    },
    "core.concurrency": {
      "status": "partial",
      "note": "The base semantics is single-threaded. Extensions by collaborators add the C11 concurrency model; Cerberus-BMC handles small concurrent examples.",
      "source": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf"
    },
    "core.io": {
      "status": "partial",
      "note": "printf is modeled formally. The 2019 paper notes there is no file system support (for example scanf).",
      "source": "http://www.cl.cam.ac.uk/users/pes20/cerberus/cerberus-popl2019.pdf"
    },
    "core.stdlib": {
      "status": "partial",
      "note": "Library headers come from an adapted musl libc, so undefined behavior inside library functions is only detected as far as musl's own code triggers it.",
      "source": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf"
    },
    "c.provenance": {
      "status": "full",
      "note": "Implements provenance-aware memory models (PNVI variants) including integer-pointer casts. Provenance of sub-objects is not modeled; the thesis calls its semantics an open problem.",
      "source": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf"
    },
    "c.unions": {
      "status": "partial",
      "note": "Unions and union type punning are modeled. C's effective-type (strict aliasing) rules are not: the model targets code built with -fno-strict-aliasing.",
      "source": "http://www.cl.cam.ac.uk/users/pes20/cerberus/cerberus-popl2019.pdf"
    },
    "c.bitfields": {
      "status": "none",
      "note": "The front end rejects bit-fields as not yet supported.",
      "source": "https://github.com/rems-project/cerberus/blob/master/frontend/model/cabs_to_ail.lem"
    },
    "c.varargs": {
      "status": "partial",
      "note": "User-defined variadic functions are supported, but undefined behavior from misusing stdarg.h is not detected.",
      "source": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf"
    },
    "c.setjmp": {
      "status": "none",
      "note": "Non-local jumps (setjmp.h) and signals are not supported.",
      "source": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf"
    },
    "c.volatile": {
      "status": "none",
      "note": "volatile is checked only as syntax; its meaning is not modeled.",
      "source": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf"
    },
    "c.inline-asm": {
      "status": "none",
      "note": "Not supported; the thesis lists 26 GCC torture tests excluded for using inline assembly.",
      "source": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf"
    }
  },
  "last_release": {
    "version": "main@d6eab7d",
    "date": "2026-11-24",
    "source": "https://github.com/rems-project/cerberus/commits/master"
  },
  "last_checked": "2026-11-26",
  "attestation": "maintainer",
  "claimed_by_authors": false,
  "sources": [
    {
      "url": "https://github.com/rems-project/cerberus",
      "title": "Cerberus repository and README",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://www.cl.cam.ac.uk/~pes20/cerberus/",
      "title": "Cerberus project page",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf",
      "title": "The Cerberus C semantics (Memarian, PhD thesis, UCAM-CL-TR-981, 2023)",
      "accessed": "2026-11-26"
    },
    {
      "url": "http://www.cl.cam.ac.uk/users/pes20/cerberus/cerberus-popl2019.pdf",
      "title": "Exploring C Semantics and Pointer Provenance (POPL 2019)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://webstore.iec.ch/en/publication/107524",
      "title": "ISO/IEC TS 6010:2025, A provenance-aware memory object model for C",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://github.com/rems-project/cerberus/blob/master/LICENSE",
      "title": "Cerberus license",
      "accessed": "2026-11-26"
    }
  ],
  "computed": {
    "kind": "semantics",
    "methodology_version": "0.1",
    "built": "2026-11-26",
    "links": {
      "html": "/semantics/cerberus/",
      "json": "/semantics/cerberus.json",
      "markdown": "/semantics/cerberus.md"
    },
    "stage": {
      "stage": 1,
      "name": "Validated",
      "criteria": [
        {
          "key": "mechanized",
          "stage": 0,
          "label": "Machine-checked or machine-readable definition",
          "met": true,
          "evidence": "https://github.com/rems-project/cerberus",
          "note": "A machine-readable definition in Lem (about 20,000 lines in 2019), compiled to OCaml. It is not available as definitions in a proof assistant.",
          "computed": false
        },
        {
          "key": "scope_stated",
          "stage": 0,
          "label": "Fragment and version are stated",
          "met": true,
          "evidence": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf",
          "note": "The thesis introduction lists missing and simplified features.",
          "computed": false
        },
        {
          "key": "executable",
          "stage": 1,
          "label": "Can be executed or tested",
          "met": true,
          "evidence": "https://github.com/rems-project/cerberus#basic-usage",
          "note": "cerberus --exec runs C programs; a web interface explores all allowed behaviors of small tests.",
          "computed": false
        },
        {
          "key": "validated",
          "stage": 1,
          "label": "Published results against conformance tests or real implementations",
          "met": true,
          "evidence": "https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-981.pdf",
          "note": "Chapter 12: Csmith differential testing against Clang and the GCC torture tests.",
          "computed": false
        },
        {
          "key": "authoritative",
          "stage": 2,
          "label": "Adopted by the language or ISA owner, or covers the full current version and tracks new ones",
          "met": false,
          "evidence": "https://webstore.iec.ch/en/publication/107524",
          "note": "Adopted by the owner: no; full coverage: no; tracks new versions: no. Not an official reference for C. Its authors worked with ISO WG14 on pointer provenance; WG14 has since published ISO/IEC TS 6010:2025, a provenance-aware memory object model for C. Several C11 features are missing (see fragment). No stated policy for following new C standards (C17, C23).",
          "computed": true
        }
      ],
      "missing_for_next": [
        "authoritative"
      ]
    },
    "used_by": [
      "cn"
    ]
  }
}