Write your app's logic as one pure function, say what must never happen, and let a checker try every order events can arrive in. When a rule breaks you get the shortest sequence that breaks it, replayable. When nothing breaks you get a proof that holds for every order, where a passing test covers one.
// 1. The model: one pure function. Effects are data, nobody performs them here.
export const microwave = defineModel({ initial, step });
// 2. The rule: a sentence about every state the oven can ever reach.
always("the magnetron is never on with the door open",
(world) => !(the(world).magnetron && the(world).door === "open"));
// 3. The check: in your test file, against the same model the app runs.
await explore(microwave, { machines: { oven: microwave.initial() }, environment, rules });worlds explored: 15, max depth: 2
VIOLATION: the magnetron is never on with the door open
1. press start
[oven] pressStart → cooking, door closed, magnetron ON
2. door opens
[oven] openDoor → cooking, door open, magnetron ON
Nobody wrote a test called "door opens while cooking". The rule was written once and the checker found the order, in fifteen milliseconds.
Five-minute tour: make microwave-react opens the tutorial page, with a live oven and
a button that runs the checker in front of you. Or read
A microwave below, which is the same thing.
One framework, four languages. TypeScript, Swift and Rust today, Python through the Rust core. The examples below are TypeScript because that is what the tutorial page runs; Swift and Rust, Python and the browser have their own sections with the same model in them.
Status: pre-1.0. The Rust core is on crates.io as
correcto-core. Swift installs by git URL and TypeScript is not on npm yet. The API will move. See Installing.
Conventional software development can feel like whack-a-mole. You patch one failure mode and uncover another, then you get comfortable by adding a regression test for the case you just saw.
Once a system has enough variables, testing stops being a guarantee. You can't enumerate every order things happen in, so you cover the edge cases you thought of and hope the rest never come up.
The usual answer is more samples. Parameter sweeps, fuzzing, property tests: run the system over a range of inputs instead of one, and let the range find what you didn't think of. That works, and you should keep doing it. A sweep is how you find the scenario you never imagined. What a sweep can't do is prove a rule. A rule says something never happens, which is a claim about every state the system can reach, and sampling states, however many, only ever says "not yet".
Formal modeling takes that second question head on. It gives you the vocabulary and the tooling to state the rules your system must keep and to prove them over every reachable state, instead of sampling them.
The example I give people is basic kinematics. You know v = d/t. Do you write a test for
every distance and every time? Does the equation hold at t = 10, at 100, at 10¹⁰? You
don't check, because the equation holds for every d and t in its domain.1 Notice
what the experiments were for. They found the edge of its domain, the scales where you need
a different model. Sweeps map the domain and the model proves what holds inside it.
Software deserves the same split. Sweep to find interesting scenarios, to measure quantities, and to check the seam where the model meets real hardware. Write a rule for anything that must never happen, and let a checker walk every order of events to prove it. One invariant replaces a family of tests, and the checker's walk is a complete sweep of the model, not a sample of it.
You're building the app for your robot vacuum. Or the checkout flow. Or the screen that drives an infusion pump. It starts on a whiteboard or in a doc: "It's idle. Press start, it cleans. Lid opens, it stops. Battery low, it goes home." It looks clean and everyone nods.
Then you translate it into code. The states become an enum. Then you add a flag, because one transition needed "but only if we already docked once". Then a timer. Then a second flag, because the first one wasn't enough. Six months in, the doc says one thing, the code says another, and the truth lives in the head of whoever fixed the last bug. That's drift, and nobody did anything wrong to get there. The spec and the code are two artifacts, and two artifacts always drift.
The bugs that survive drift are almost all the same kind, so it's worth being exact about it.
Your app has several sources of events that don't coordinate with each other. In a microwave oven there are two: the person, and the cook timer.
person: pressStart, pressStop, openDoor, closeDoor
timer: timerDone (only exists once a cook has started)
The machine handles one event at a time, so what it actually sees is one merged
sequence. Merging streams while keeping each stream's own order is called
interleaving them, like riffling two halves of a deck. An interleaving is one such
merged sequence of events and nothing more. The states aren't part of it, they fall
out of it, because step is deterministic and the start state plus the event order
fixes every state along the way.
pressStart, timerDone, openDoor cook finishes, then the door opens. fine
pressStart, openDoor, timerDone door opens mid-cook. magnetron on, door open. bug
openDoor, pressStart press refused, the door is open. fine
You don't pick the merge. The person and the timer do. Three independent events have six orders. Six have 720. Add "the packet might get dropped" and "the user might tap again" and you're past anything a person tests by hand.
A test fixes one interleaving: the one you thought of. The bug is in one you didn't. The door opens while the magnetron is running. The "go home" timer fires after the robot already docked. Someone taps twice in the 200 ms before the button disables. The fetch resolves after the user navigated away. It ships, it shows up on someone else's device, and you can't reproduce it because you don't know which order they hit.
You can vibe code a whole app in an afternoon now. That's real and I'm not going to pretend otherwise. But the model writes code the way you do: one interleaving at a time, the ones it thought of. It will happily generate the flag, the second flag and the timer, and it will drift exactly the same way, only faster.
So I propose giving AI a foundation it can't drift from. If the states, the events and the transitions are written down as math, and a checker tries every interleaving and hands back the shortest path to any broken rule, then the AI is writing against something that pushes back. Let it generate all the complexity it wants. Anything that breaks a rule gets caught in milliseconds, with a trace that says exactly how. That's how you get apps that are complex and powerful and also correct and verifiable.
- A bug you can't reproduce becomes a two-line trace. The checker explored every interleaving and this is the shortest one that breaks your rule. Press start, open the door, there you go.
- Rules instead of tests. You write what must never be true. The checker finds the sequence. You stop guessing which order to test.
- The code you check is the code you ship. One function, run by a small runtime in the app and by the checker in tests. There is no spec to drift from the code, because the spec is the code.
- Something for AI to write against. Generate as much logic as you want. The checker says no when it's wrong, and says exactly where.
The formal methods people solved the interleaving problem decades ago. Write the system as a state machine, let a model checker walk every reachable state, read the counterexample when a rule fails. TLA+, SPIN, Alloy. It works. Almost nobody building apps uses it, because the model lives in TLA+ and the app lives in TypeScript, and now you have two artifacts again.
Correcto's answer is to not have two. You write one pure function: given the state and an event, return the next state and a list of effects. Effects are values, like "turn the magnetron on", not actions. In tests, a checker runs that function against a hostile environment: timers that fire whenever they like, links that drop packets, hardware that says yes and does nothing. In the app, a runtime executes the same function and hands each effect to a handler you write, the only code that touches the real world.
The textbook example, from Clarke, Grumberg and Peled's Model Checking, chapter 4.
Nobody argues with the premise: door open, magnetron off. There is a runnable version
of everything below at examples/microwave/react, with a live oven on the page.
The state is plain data. Every field is something the controller knows.
export interface MicrowaveState {
door: "open" | "closed";
phase: "idle" | "cooking" | "paused" | "error"; // paused: door opened mid-cook
magnetron: boolean; // what we last told the magnetron
}
export type MicrowaveEvent =
| { type: "pressStart" }
| { type: "pressStop" }
| { type: "openDoor" }
| { type: "closeDoor" }
| { type: "timerDone" }; // the cook time ran out
export type MicrowaveEffect =
| { type: "magnetron"; on: boolean }
| { type: "armCookTimer" }
| { type: "pauseCookTimer" } // stop the countdown, keep the remaining time
| { type: "resumeCookTimer" } // continue from the remaining time
| { type: "cancelCookTimer" }
| { type: "beep" };The logic is one function, step(state, event) -> [state, effects]. Here is the door
case, written the way you'd write it on a Tuesday, or the way an AI writes it when you
say "handle the door":
case "openDoor":
if (state.phase === "cooking") return onDoorOpenedWhileCooking(state);
return [{ ...state, door: "open" }, []];
function doorOpenedBuggy(state: MicrowaveState): Step {
return [{ ...state, door: "open" }, []];
}Press start, the magnetron comes on. The timer fires, it goes off. Open the door while idle, fine. The tests you'd think to write all pass. Now the rules: sentences about every state the oven can ever be in, not examples. The formal word is invariant, which is what the theory calls them.
export const rules: Rule<MicrowaveState>[] = [
always("the magnetron is never on with the door open",
(world) => !(the(world).magnetron && the(world).door === "open")),
// …
always("cooking means the cook timer is armed",
(world) => (the(world).phase === "cooking") === world.timers.armed.length > 0),
// …
];Last, what you don't control. A person who can press start, press stop and work the door, and a timer that fires whenever it likes. Budgets keep it finite. This is the whole recurring cost of the method, about one line per thing the world can do to you:
export const environment: Environment<MicrowaveState, MicrowaveEvent, MicrowaveEffect> = {
actions: [
{ label: "press start", event: { type: "pressStart" }, budget: 2 },
{ label: "door opens", event: { type: "openDoor" }, group: "door", budget: 2,
enabled: (state) => state.door === "closed" },
// …
],
classify: (effect) =>
effect.type === "armCookTimer" || effect.type === "resumeCookTimer"
? { kind: "armTimer", id: "cook", generation: 0 }
: effect.type === "cancelCookTimer" || effect.type === "pauseCookTimer"
? { kind: "cancelTimer", id: "cook" }
: { kind: "ignore" },
timerEvent: () => ({ type: "timerDone" }),
};Run the checker.
worlds explored: 15, max depth: 2
VIOLATION: the magnetron is never on with the door open
initial:
oven: idle, door closed, magnetron off
1. press start
[oven] pressStart → cooking, door closed, magnetron ON
2. door opens
[oven] openDoor → cooking, door open, magnetron ON
A world is one snapshot of everything: the machine's state plus whatever is pending around it, like an armed timer. Fifteen of them were reachable within the budgets. Two moves in, the rule broke. The door case updated the door and nobody told the magnetron. That's the whole bug, and it's the shortest path to it.
The fix is the missing output:
function doorOpenedFixed(state: MicrowaveState): Step {
return [
{ ...state, door: "open", phase: "paused", magnetron: false },
[{ type: "magnetron", on: false }, { type: "pauseCookTimer" }],
];
}worlds explored: 38, max depth: 5
all invariants hold
Thirty-eight worlds now, because cooks can pause and resume, and every one of them is fine. I never wrote a test called "door opens while cooking". I wrote what must never be true and the checker found the order.
The door bug is the one you might catch in review. Here is the one you wouldn't, and it
is the reason this method earns its keep in a UI. A store that arms a setTimeout and
never keeps the handle looks fine in a diff:
start: () => {
set({ phase: "cooking", magnetron: true });
magnetronPower(true);
setTimeout(() => { set({ phase: "idle", magnetron: false }); beep(); }, COOK_MS);
},Press start, press stop, press start again. The first timer is still out there, and four seconds later it fires into a cook that already restarted. No test covers it. As a model, the same mistake is Stop forgetting to return its cancel effect, and the checker names it in two moves:
worlds explored: 17, max depth: 2
VIOLATION: cooking means the cook timer is armed
1. press start
[oven] pressStart → cooking, door closed, magnetron ON
2. press stop
[oven] pressStop → idle, door closed, magnetron off
Almost every UI bug has that shape, something outlives the thing it belonged to. A stale timer, a response that arrives after the user moved on, an optimistic update whose rollback never comes. Write the rule once and the whole family is covered.
The function you just checked is the function that runs. It drops into a store as middleware and nothing else writes state, which is what keeps the thirty flags from coming back.
import { create } from "zustand";
import { model } from "correcto/zustand";
import { microwave } from "./microwave"; // the logic, once
import { hardware } from "./hardware"; // the side effects, once
export const useMicrowave = create(model(microwave, undefined, hardware));
// in a component
const send = useMicrowave((store) => store.send);
<Button onClick={() => send({ type: "pressStart" })}>Start</Button>Then one handler that turns effects into real calls and real results back into events. This is the only code that touches the world, and it is where everything with an identity lives: the timer handle, the socket, the AbortController. State stays plain data, which is what lets the checker compare two of them.
export function createHardware(log: (line: string) => void, cookMs = 4000): SimulatedHardware {
let timer: number | null = null;
let remaining = cookMs; // what's left on the clock, kept across a pause
let startedAt = 0;
// …
const run = (send: (event: MicrowaveEvent) => void) => {
clear();
startedAt = Date.now();
timer = window.setTimeout(() => send({ type: "timerDone" }), remaining);
};
return {
pause: clear,
perform(effect, send) {
switch (effect.type) {
case "magnetron":
log(`magnetron ${effect.on ? "ON" : "off"}`);
break;
case "armCookTimer":
remaining = cookMs;
run(send);
log(`cook timer set: ${cookMs / 1000}s`);
break;
// …
}
},
};
}The checker runs in your test file, against the same model object the store uses:
const result = await explore(microwave, {
machines: { oven: microwave.initial() },
environment, rules, transitionRules, describe,
});Both checks above finish in about fifteen milliseconds. The engine is Rust compiled to WebAssembly and ships inside the package; it stays in your tests and does not follow a model import into your app bundle.
Pre-1.0, and each language is at a different point, so the instructions differ.
Rust is on crates.io. The crate is correcto-core, and every release is tagged
correcto-core-v<version> in this repository:
correcto-core = "0.1"Swift works today, because the package manifest is at the repository root:
.package(url: "https://github.com/security-union/correcto.git", branch: "main")TypeScript is not on npm yet, and npm cannot install a package from a subdirectory of a git repository, so for now you clone and link:
git clone https://github.com/security-union/correcto.git
cd correcto && make ts-engine # builds the checker engine once
cd /path/to/your-app
npm install /path/to/correcto/typescript zustandWhen correcto is published to npm this becomes npm install correcto zustand. Until
then, treat the API as moving and pin to a commit.
Four pieces, in every language. The names differ; the shapes don't.
- The model contract ships in your app. A
stepfunction and a small runtime that owns the state, runsstep, and hands effects to your handler. Handler results come back as events. Nothing else writes state. - The checker runs in your tests. Worlds, an environment, the explorer, and the three environment pieces every real app needs: a channel (reliable in order, unreliable may reorder or drop), timers (any armed timer may fire, generations make stale ones visible), and an oracle for a call with the outcomes you declare, success, failure or timeout, all of which the checker tries.
- Testing glue for the test runner you already use: assert a report passes, replay a trace through a real implementation, save a counterexample as JSON.
- A UI binding so a screen reads state and sends events, and nothing else.
For the CS readers. Skip it if you want; the code above is the same thing.
A machine is a Mealy machine:
M = ⟨S, s₀, E, F, δ⟩ δ : S × E → S × F*
States, an initial state, events in, effects out, one function. The function doesn't do anything. It returns a list of effects and someone else does them.
A system is n machines plus an environment:
Env = ⟨Γ, γ₀, absorb, enabled⟩
absorb : Γ × Id × F* → Γ
enabled : Γ × Sⁿ → P(Choice)
The environment takes the effects machines emit and decides what can happen next. A choice is "deliver event e to machine i", or "change the environment and tell nobody", like dropping a packet. The environment is the adversary. It gets to pick.
A configuration is everyone's state plus the environment, c = ⟨s, γ⟩, where s is
the list of machine states. That's the "world" above. One step picks an enabled choice,
runs one machine, and puts its effects back:
c → c′ when there is a choice ch in enabled(γ, s) with
(sᵢ′, f) = δ(sᵢ, e) run machine i on the event ch delivers
γ′ = absorb(γ, i, f) put its effects back into the environment
Reach(c₀) is every configuration you can get to. An interleaving is one path through
it. Three kinds of rule:
□φ:φ(c)holds for allcinReach(c₀). A state invariant. "Magnetron off or door closed."ψ(s, e, s′, f)holds for every step taken. A transition invariant. "A stale timer is a no-op."φ(c)holds wheneverenabled(c)is empty. A terminal invariant. "When nothing more can happen, we aren't cooking."
The checker computes Reach(c₀) breadth-first and checks rules on the way.
Breadth-first means the first violation it finds has the shortest witness there is.
There is nothing clever in it, it just visits everything.
| Math | TypeScript | Swift |
|---|---|---|
S, E, F |
State, Event, Effect (plain data: comparable, serializable) |
Model.State, Model.Event, Model.Effect (Hashable, Codable, Sendable) |
δ |
step(state, event) => [state, effects] |
Model.step(_:_:) -> Step<State, Effect> |
c = ⟨s, γ⟩ |
World<S> |
World<M, Env> |
Γ |
Environment with actions, budgets, classify |
your Env struct, built from Channel, Timers, Oracle, budgets |
□φ |
always(name, predicate) |
WorldInvariant(_, when: .always) |
terminal φ |
quiescent(name, predicate) |
WorldInvariant(_, when: .quiescent) |
ψ |
transition(name, predicate) |
TransitionInvariant |
Reach(c₀) |
explore(model, config) |
Explorer.explore(from:) |
| witness path | result.steps, printable, JSON, replayable |
WorldTrace, printable, JSON, replayable |
executing δ for real |
model(...) middleware plus your hardware |
Runtime plus your EffectHandler |
The Swift package is the root of this repository, so a SwiftPM dependency on the repo URL
just works. Four libraries: Correcto (the Model protocol and the Runtime actor),
CorrectoCheck (World, Environment, the explorer), CorrectoTesting (XCTest glue),
and CorrectoUI (Store, an ObservableObject that mirrors the runtime on the main
thread). Sources live in swift/.
The worked Swift example is a coffee machine: a lid, a water tank, a pump, a brew timer, and one rule, the pump never runs with the lid open. Same shape as the microwave, same two-move bug.
struct CoffeeState: Hashable, Codable, Sendable {
enum Phase { case idle, brewing(generation: Int) }
enum Lid { case open, closed }
var phase = Phase.idle
var lid = Lid.closed
var water: Int // cups left in the tank
var pumpOn = false // what we last told the pump
var generation = 0 // so a stale timer can be told from a live one
}
enum CoffeeEvent { case pressBrew, lidOpened, lidClosed, refilled, brewTimer(generation: Int) }
enum CoffeeEffect { case pump(on: Bool), armBrewTimer(generation: Int), cancelBrewTimer }static func step(_ state: CoffeeState, _ event: CoffeeEvent) -> Step<CoffeeState, CoffeeEffect> {
var next = state
switch (state.phase, event) {
case (.idle, .pressBrew):
guard state.lid == .closed, state.water > 0 else { return .ignore(state) }
next.generation += 1
next.phase = .brewing(generation: next.generation)
next.pumpOn = true
return Step(next, [.pump(on: true), .armBrewTimer(generation: next.generation)])
case let (.brewing(generation), .brewTimer(fired)):
guard fired == generation else { return .ignore(state) } // stale timer, ignore it
next.phase = .idle; next.pumpOn = false; next.water -= 1
return Step(next, [.pump(on: false)])
case (_, .lidOpened): next.lid = .open; return Step(next)
case (_, .lidClosed): next.lid = .closed; return Step(next)
default: return .ignore(state)
}
}The rule, and the checker finding the same kind of bug the microwave had:
WorldInvariant("the pump never runs with the lid open") { world in
world.machines.values.allSatisfy { !($0.pumpOn && $0.lid == .open) }
}$ make coffee-check
worlds explored: 15, max depth: 2
VIOLATION: the pump never runs with the lid open
initial:
machine: idle, lid closed, water 1, pump off
1. press brew
[machine] pressBrew → brewing#1, lid closed, water 1, pump ON
effects: pump(on: true), armBrewTimer(generation: 1)
2. lid opens
[machine] lidOpened → brewing#1, lid open, water 1, pump ON
The fix is three lines above the generic lid case, and the check then explores sixty worlds and passes:
case (.brewing, .lidOpened):
next.lid = .open; next.phase = .idle; next.pumpOn = false
return Step(next, [.pump(on: false), .cancelBrewTimer])Effects become real work in an EffectHandler, which is the only code that touches
hardware:
actor SimulatedCoffeeHardware: EffectHandler {
var brew: Task<Void, Never>?
func perform(_ effect: CoffeeEffect, emit: @escaping @Sendable (CoffeeEvent) -> Void) async {
switch effect {
case let .pump(on):
print(" [hw] pump \(on ? "ON" : "off")")
case let .armBrewTimer(g):
brew = Task {
try? await Task.sleep(nanoseconds: 3_000_000_000)
if !Task.isCancelled { emit(.brewTimer(generation: g)) }
}
case .cancelBrewTimer:
brew?.cancel()
}
}
}And a screen reads state and sends events, nothing more:
struct CoffeeMachineView: View {
@ObservedObject var store: Store<CoffeeMachine>
var body: some View {
let s = store.state
VStack {
Text(s.phase == .idle ? "Idle" : "Brewing")
Text("lid \(s.lid) · water \(s.water) · pump \(s.pumpOn ? "ON" : "off")")
HStack {
Button("Brew") { store.send(.pressBrew) }
.disabled(s.phase != .idle || s.lid == .open || s.water == 0)
Button(s.lid == .closed ? "Open lid" : "Close lid") {
store.send(s.lid == .closed ? .lidOpened : .lidClosed)
}
}
}
}
}swift test # the framework, on its own fixtures
make examples-test # the coffee machine and the handshake, Swift and Rust
make coffee # drive the coffee machine from the keyboard
make coffee-check # the checker catching the bug, in Swift and in RustBoth versions, with three more rules, are in examples/coffee-machine/swift. Swift builds
with Xcode's toolchain, not Nix: nixpkgs' Swift cannot target Apple platforms.
The Rust crate is correcto-core: the Model trait, the Runtime, and the Explorer
with its Channel, Timers and Oracle. It depends on serde and nothing else. The
microwave from above lives in examples/microwave/rust,
and its first rule reads like the TypeScript one:
WorldInvariant::always("the magnetron is never on with the door open", |world: &World<M, MicrowaveEnv>| {
world.machines.values().all(|oven| !(oven.magnetron && oven.door == Door::Open))
}),The check is the explorer, the rules, and a starting world:
Explorer::new(environment::<M>())
.with_invariants(invariants::<M>())
.with_transition_invariants(transition_invariants::<M>())
.explore(world::<M>(MicrowaveEnv::default()))The same coffee machine exists once in Rust, in examples/coffee-machine/rust, and
Correcto's generic surface drives it by name from Swift and Python. The framework never
mentions coffee: rust/correcto-ffi exposes a Machine over JSON for any registered
model, and an app registers its models in a ten-line crate. The browser runs the
TypeScript core in typescript/, whose only Rust part is the search engine, compiled to
WebAssembly.
make check # every check on every platform
make rust-test # the checker in Rust: 60 worlds fixed, 15 worlds buggy, same traces
make coffee-bindings # the Swift + Python surface with the coffee model compiled in
make coffee-python # examples/coffee-machine/python/coffee.py; --check runs the checker
make microwave-react # examples/microwave/react: the tutorial page, with a live oven
make coffee-xcode # examples/coffee-machine/xcode: four schemes, Swift model or Rust corePress b in the Python terminal, tap Brew in the iPhone simulator, click Brew in the
browser: the same step runs and the same line prints, "brewing#1, lid closed, water 2,
pump ON". Open the lid and every one of them aborts the brew and cancels the timer,
because there is one place that decision lives. The checker runs in all of them too, and
prints the same two-move trace. conformance/ holds the expected results every
implementation must reproduce, which is what keeps them honest. docs/RUST-CORE.md
explains the layout, the generic bindings, and why the host owns the timer.
docs/GETTING-STARTED.md walks from an empty file to a checked model with a screen
on it, in ten steps.
For the five-minute version, open examples/microwave/react and run make microwave-react. Everything in A microwave is on that page, with an oven
you can click and a button that runs the checker in front of you.
TLA+ and TLC: the model checker everyone should have used and almost nobody did, because the spec isn't the code. SPIN and Promela: same story, older. P from Microsoft: closest in spirit, an executable state machine language with a checker, but it's its own language. stateright: the same idea in Rust, and the closest cousin to this. Elm, Redux, TCA, XState: they got the one-function-owns-the-state part right and never added the checker. Correcto is TLC-style explicit-state checking embedded in the language you ship, with an environment library shaped for apps that touch hardware and talk to peers.
Safety only. It proves nothing bad happens; it does not prove something good eventually happens. No liveness, no fairness. Explicit state, so you bound the search with budgets or it doesn't end, and a budget set too small is the failure mode to watch: the report says whether it finished or stopped at a limit, and that line is the one to read first. No partial-order reduction or symmetry, yet. Timers are untimed: a timer may fire at any moment after arming. That's a sound over-approximation. Anything a real timer can do, this allows, so a rule that holds here holds for real. And an outcome you didn't declare for a hardware call is an outcome that didn't get checked.
There is more written down here than anyone should read in order, so pick by what you came for.
| You want | Read | Time |
|---|---|---|
| To see it work | make microwave-react, press Find the bug |
5 min |
| To know if it is real | blog/2026-09-26-remote-shutter.md: three defects in a shipped iOS app, reproduced, then rediscovered by the checker |
15 min |
| To write your own model | docs/GETTING-STARTED.md, ten steps from an empty file to a checked model on screen (Swift, and the shapes are the same in every language) |
30 min |
| To adopt it in an app that exists | docs/SHADOW-MODE.md first, then docs/ADOPTION.md. Being wrong has to be free before anything depends on the model |
20 min |
| To understand why it works | docs/DESIGN.md: the definitions in full, the environment as formal objects, how the checker and the runtime relate |
an evening |
| To ship one model to four languages | docs/RUST-CORE.md |
20 min |
If you read only one thing after this file, read the case study. It is the only document here with a failing test in it.
Also in the repository:
examples/microwave: the textbook oven, the model in Rust and the tutorial page in React.examples/coffee-machine,examples/handshake: one machine, then two. Each is its own package on top of the framework; the framework does not depend on them.blog/: engineering notes, including a case study on modelling a shipped iOS app.CONTRIBUTING.md: the build matrix and the rules that hold in every implementation.
Footnotes
-
Yes, the domain has edges, and that is the point. Near the speed of light, time depends on who is measuring it and velocities stop adding the way this equation assumes; you need special relativity. At quantum scales a particle has no definite position and velocity at the same time, so
dandtstop being the quantities you thought you had. Classical kinematics is exact inside its domain and silent outside it. A Correcto model is the same: the environment and its budgets are the domain, the rules are proved everywhere inside it, and the model says nothing about what happens outside. ↩