formalmethods.dev

§ 02 · workbench

Now break something.

Four instruments, one engine, running in your browser — the same code that answers /api/mcp. Every verdict says exactly what it proved: holds, violated, or incomplete.

A

Trace checker

A property and a run, judged position by position. The truth table is the whole proof: every subformula, every step, nothing hidden.

why · the LTL chapter — § 1.3 →

satisfies

finite-trace (LTLf) semantics · 3 states

the run · edit me
0
1
2

Click a chip to flip an atom in that state. Every edit re-evaluates the property immediately — no run button, the table is the test.

012pos
request
response
retry
truth table · every subformula, every position
posrequestresponseF responserequest -> F responseG (request -> F response)
0TFTTT
1TFTTT
2FTTTT

Read the last column for the verdict at each position; the columns to its left explain it. This is the same table check_ltl returns over MCP.

exposed over mcpcheck_ltl
view the JSON-RPC body · POST to /api/mcp
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "check_ltl",
    "arguments": {
      "formula": "G (request -> F response)",
      "trace": [
        [
          "request"
        ],
        [
          "request",
          "retry"
        ],
        [
          "response"
        ]
      ]
    }
  }
}
B

Model checker

Every behaviour of a Kripke structure at once — and when one breaks the property, you get the run that broke it: a ready-made failing test.

why · the model-checking chapter — § 1.4 →

The checker enumerates every lasso — a simple path that enters a loop — and evaluates the property on each, infinite semantics. Dead ends are read as “stuttering forever”, which is how liveness catches hangs.

Empty depth = check every behaviour of the model. A bound is bounded model checking: violations found are real, and “incomplete” is reported honestly.

idle · readypaid · coinvend · dispense
◎ start = initial state · dashed loops stutter (the system freezes)
holds

3 states · depth 3 · 1 lassos checked · 0.2 ms

Holds, exhaustively. Every possible run of the model was checked (depth = 3 = all 3 states, no truncation). The property is proven for this model — which is exactly as strong as the model is faithful.

exposed over mcpmodel_check
view the JSON-RPC body · POST to /api/mcp
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "model_check",
    "arguments": {
      "formula": "G (coin -> F dispense)",
      "model": {
        "atoms": [
          "coin",
          "dispense",
          "ready"
        ],
        "initial": [
          "idle"
        ],
        "states": [
          {
            "id": "idle",
            "atoms": [
              "ready"
            ],
            "next": [
              "paid"
            ]
          },
          {
            "id": "paid",
            "atoms": [
              "coin"
            ],
            "next": [
              "vend"
            ]
          },
          {
            "id": "vend",
            "atoms": [
              "dispense"
            ],
            "next": [
              "idle"
            ]
          }
        ]
      }
    }
  }
}
C

Fuzzer

Random executions against your spec, shrunk to the smallest reproduction. Absence of failure is reported as evidence, never as proof.

why · the PBT chapter — § 1.6 →

exposed over mcpfalsify_property
view the JSON-RPC body · POST to /api/mcp
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "falsify_property",
    "arguments": {
      "formula": "G (request -> F response)",
      "atoms": [
        "request",
        "response",
        "retry"
      ],
      "iterations": 500,
      "trace_length": 6
    }
  }
}
D

Coverage meter

What did your tests never touch? Coverage is the negative metric: it proves gaps, not correctness. The honest checklist at the bottom of every campaign.

why · the coverage chapter — § 1.7 →

Coverage answers one question with total honesty: which states and transitions did no test ever reach? It cannot certify the ones that were reached — that is what the checker above is for.

exposed over mcpanalyze_coverage
view the JSON-RPC body · POST to /api/mcp
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "analyze_coverage",
    "arguments": {
      "model": {
        "atoms": [
          "coin",
          "dispense",
          "ready"
        ],
        "initial": [
          "idle"
        ],
        "states": [
          {
            "id": "idle",
            "atoms": [
              "ready"
            ],
            "next": [
              "paid"
            ]
          },
          {
            "id": "paid",
            "atoms": [
              "coin"
            ],
            "next": [
              "vend"
            ]
          },
          {
            "id": "vend",
            "atoms": [
              "dispense"
            ],
            "next": [
              "idle"
            ]
          }
        ]
      },
      "traces": [
        [
          "idle",
          "paid",
          "vend"
        ],
        [
          "idle",
          "paid",
          "vend",
          "idle",
          "paid"
        ]
      ]
    }
  }
}