1. Model
A .gm model. Answers update as you type.
2. Answers
3. Graph
Rounded boxes are definitions, ovals random events, double-bordered boxes what a query or requirement asks about, yellow hexagons constraints; an arrow points from a definition to what it uses (left to right), dashed with a circle where it uses the negation. Each node shows its probability given the evidence, with ▲/▼ where the evidence changed it.
4. What matters
The language
event eng1 "Engine 1 fails" 2e-5 | an independent event and its probability |
out = eng1 | dual | a definition: ! & | ^ -> <->, also not and or xor |
atleast 2 of (a, b, c) | also atmost, exactly |
if a then flip(0.9) else flip(0.05) | a conditional probability: flip(p) is a fresh event |
choice load { low 0.7, high 0.3 } | a variable with several values: load.high |
rule overheat -> fire 0.02 | a cause: overheat causes fire with probability 0.02 |
constraint !(a & b) | condition everything on a fact |
query lost given eng1_out | P(lost | eng1_out) |
require lost < 1e-9 | a requirement, shown as pass or fail |
The full description is in
spec-ganak-model.md;
the command-line tool is ganak-model.