{
  "id": "a-mir-formality",
  "name": "a-mir-formality",
  "aka": [
    "formality-rust"
  ],
  "summary": "An early-stage, executable model of Rust's type system, trait solver and borrow checker, written as inference rules in Rust and maintained by members of the Rust types team.",
  "details": "The rules are written with formality-core, a Rust library for defining judgments, so the model runs as an ordinary Rust program and its tests check whether small Rust-like programs are accepted or rejected. It works on its own Rust-like grammar (types, traits, impls, functions, ADTs and a MIR-like expression language), not on real Rust source code. Function bodies can be translated to MiniRust, which gives them a run-time meaning. The README says the intention is to propose the model to Rust as an RFC if the experiments succeed.",
  "target": "rust",
  "fragment": "Static semantics: well-formedness of types and items, trait solving and associated-type normalization, coherence (overlap and orphan rules), and borrow checking of a MIR-like expression language. Run-time behavior is delegated to MiniRust through a code generator. No list of covered or excluded Rust features is published.",
  "framework": "Rust (formality-core judgment library)",
  "provers": [],
  "open": "open-source",
  "license": "MIT OR Apache-2.0",
  "maintainers": [
    "Rust types team members (github.com/rust-lang/a-mir-formality)"
  ],
  "links": {
    "homepage": "https://rust-lang.github.io/a-mir-formality/",
    "repo": "https://github.com/rust-lang/a-mir-formality",
    "docs": "https://rust-lang.github.io/a-mir-formality/intro.html"
  },
  "validation": "Snapshot tests in the repository check that example programs type-check or fail with an expected error. No published comparison against rustc was found.",
  "stage_evidence": {
    "mechanized": {
      "met": true,
      "evidence": "https://github.com/rust-lang/a-mir-formality",
      "note": "The judgments are machine-readable Rust code. The model is not available in a proof assistant."
    },
    "scope_stated": {
      "met": false,
      "evidence": "https://rust-lang.github.io/a-mir-formality/intro.html",
      "note": "The book describes the layers of the model, but there is no list of covered Rust features and no Rust version."
    },
    "executable": {
      "met": true,
      "evidence": "https://rust-lang.github.io/a-mir-formality/intro.html",
      "note": "The model runs with cargo test; judgments are executed directly."
    },
    "validated": {
      "met": false,
      "evidence": "https://github.com/rust-lang/a-mir-formality/tree/main/tests",
      "note": "Repository tests only; no published differential testing against rustc."
    },
    "adopted_by_owner": {
      "met": false,
      "evidence": "https://github.com/rust-lang/a-mir-formality/blob/main/README.md",
      "note": "Hosted in the rust-lang organization and described as maintained by the Rust types team, but the README calls it an early-stage experiment that may later be proposed as an official part of the language definition through an RFC."
    },
    "full_coverage": {
      "met": false,
      "note": "Described as early-stage and experimental."
    },
    "tracks_versions": {
      "met": false,
      "note": "No stated policy for following Rust releases."
    }
  },
  "features": {
    "rust.borrows": {
      "status": "partial",
      "note": "Borrow checking is modeled as judgments over its MIR-like expression language (let, if, loop, break, return and expressions); how much of rustc's borrow checker it matches is not documented.",
      "source": "https://github.com/rust-lang/a-mir-formality/blob/main/book/src/formality_rust/borrow_check.md"
    },
    "rust.traits": {
      "status": "partial",
      "note": "Trait solving, associated-type normalization, higher-ranked where clauses and coherence (overlap and orphan checks) are modeled; the project does not claim full coverage of Rust's trait system.",
      "source": "https://github.com/rust-lang/a-mir-formality/blob/main/book/src/formality_rust/coherence.md"
    }
  },
  "last_release": {
    "version": "main@b2394ae",
    "date": "2026-11-24",
    "source": "https://github.com/rust-lang/a-mir-formality/commits/main"
  },
  "last_checked": "2026-11-26",
  "attestation": "maintainer",
  "claimed_by_authors": false,
  "sources": [
    {
      "url": "https://github.com/rust-lang/a-mir-formality/blob/main/README.md",
      "title": "a-mir-formality README",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://github.com/rust-lang/a-mir-formality/blob/main/Cargo.toml",
      "title": "Cargo.toml (license; 'Model of the Rust type system maintained by the Rust types team')",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://rust-lang.github.io/a-mir-formality/intro.html",
      "title": "a-mir-formality book",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://github.com/rust-lang/a-mir-formality/blob/main/book/src/formality_rust/codegen.md",
      "title": "Code generation to MiniRust",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://github.com/rust-lang/a-mir-formality/releases",
      "title": "Releases of the formality-core and formality-macros crates",
      "accessed": "2026-11-26"
    }
  ],
  "computed": {
    "kind": "semantics",
    "methodology_version": "0.1",
    "built": "2026-11-26",
    "links": {
      "html": "/semantics/a-mir-formality/",
      "json": "/semantics/a-mir-formality.json",
      "markdown": "/semantics/a-mir-formality.md"
    },
    "stage": {
      "stage": -1,
      "name": "Not yet staged",
      "criteria": [
        {
          "key": "mechanized",
          "stage": 0,
          "label": "Machine-checked or machine-readable definition",
          "met": true,
          "evidence": "https://github.com/rust-lang/a-mir-formality",
          "note": "The judgments are machine-readable Rust code. The model is not available in a proof assistant.",
          "computed": false
        },
        {
          "key": "scope_stated",
          "stage": 0,
          "label": "Fragment and version are stated",
          "met": false,
          "evidence": "https://rust-lang.github.io/a-mir-formality/intro.html",
          "note": "The book describes the layers of the model, but there is no list of covered Rust features and no Rust version.",
          "computed": false
        },
        {
          "key": "executable",
          "stage": 1,
          "label": "Can be executed or tested",
          "met": true,
          "evidence": "https://rust-lang.github.io/a-mir-formality/intro.html",
          "note": "The model runs with cargo test; judgments are executed directly.",
          "computed": false
        },
        {
          "key": "validated",
          "stage": 1,
          "label": "Published results against conformance tests or real implementations",
          "met": false,
          "evidence": "https://github.com/rust-lang/a-mir-formality/tree/main/tests",
          "note": "Repository tests only; no published differential testing against rustc.",
          "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://github.com/rust-lang/a-mir-formality/blob/main/README.md",
          "note": "Adopted by the owner: no; full coverage: no; tracks new versions: no. Hosted in the rust-lang organization and described as maintained by the Rust types team, but the README calls it an early-stage experiment that may later be proposed as an official part of the language definition through an RFC. Described as early-stage and experimental. No stated policy for following Rust releases.",
          "computed": true
        }
      ],
      "missing_for_next": [
        "scope_stated"
      ]
    },
    "used_by": []
  }
}