Ganak in your browser

Write a probabilistic model and get exact probabilities, or count the models of a CNF and query its d-DNNF circuit. Everything runs locally, in WebAssembly.

1. Model

A .gm model. Answers update as you type.

2. Answers

Answers appear here.

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-5an independent event and its probability
out = eng1 | duala 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.02a cause: overheat causes fire with probability 0.02
constraint !(a & b)condition everything on a fact
query lost given eng1_outP(lost | eng1_out)
require lost < 1e-9a requirement, shown as pass or fail

The full description is in spec-ganak-model.md; the command-line tool is ganak-model.

Log

tool runs (stdout, stderr)

1. Formula

DIMACS CNF, with optional c p weight, c p show (format), and c <var> <name> lines naming features.

Log

tool runs (stdout, stderr)

2. Circuit

Compile the formula first.

3. Queries

Result

Results appear here.