Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Example gallery

The reference implementation ships a corpus of ten example documents in examples/. Every one parses strict-clean (zero errors, zero warnings) under default options and is fmt-clean — tests enforce both. A curated spine appears in the playground’s example tray; every file can also be opened directly in the project workspace.

Open any of them in the playground to see the graph, or run thoughtml <file> (add --compute for the second reading, --audit for the mirror). Ten files is deliberate: few enough to read all of them in a sitting, and between them they carry a worked instance of every kind, relation, posture, field, basis, lifecycle state, confidence form, and both mirror conflicts — pinned by a test, so the claim cannot quietly go stale. The domains are spread on purpose, from a home kitchen to a wildfire: nothing about the language is specific to software.

The repository also includes a six-file project under examples/snake-project/. Its project.thml entry imports product, architecture, gameplay, quality, and release modules into one graph. Use it to try the multi-file playground, file/line provenance, live streaming, and inline expansion of imported conclusions:

thoughtml stream examples/snake-project/project.thml

Start here

ExampleWhat it teaches
pour-the-slab.thmlA clean document the mirror still flags — the confidence-vs-status conflict. The flagship demo, and the smallest complete piece of reasoning.
why-the-loaf-failed.thmlAn everyday question done properly: candidate-for proposes, answers resolves, and a ruled-out guess is parked abandoned rather than deleted.

Arguments and evidence

ExampleWhat it teaches
peer-review.thmlundercuts (attack an inference — target the link) versus opposes (attack a claim), plus the second mirror conflict: two referees write one id two ways and both are kept.
well-water.thmlA field investigation as an acyclic causes/enables/prevents graph; a scope whose provenance its members inherit; a weighted evidence bundle.

Time and change

ExampleWhat it teaches
dating-the-codex.thmlA belief revised as evidence lands; the earlier one superseded, not erased. --as-of replay makes a conflict disappear, because at that date it did not exist yet.

Decisions

ExampleWhat it teaches
grant-panel.thmlOne award, four people: criteria collected with part-of (not evidence), options weighed, one withdrawn and kept abandoned, the award blocked until a review answers.

The compute layer

ExampleWhat it teaches
orchard-water.thmlA budget that computes itself: = formula lines with real dimensional analysis (L/min × min = L, ÷ trees = L/tree, and a subtraction that must match dimensions).
evacuate-or-shelter.thmlThe whole compute layer in one decision: a probability borrowed from derived confidence, expected-value ranking, and a what-if that flips it.

Dialects and modularity (advanced)

ExampleWhat it teaches
inspection-standards.thmlA standalone importable library — a part-of collection of requirements, and the building block the inspection imports.
bridge-inspection.thmlimport … as with namespaced cross-document references, run as a project — plus a profile declaring a structural-engineering dialect (defect/remedy kinds, aggravates/mitigates relations, a severity field, a certifies posture).

A walkthrough: pour-the-slab.thml

The most instructive example is the smallest interesting one:

focus conditions-are-fine
  kind claim
  Conditions on site are fine to pour the foundation slab this afternoon.

focus truck-is-booked
  kind observation
  The ready-mix truck is booked for 14:00 and the full crew is on site.

focus overnight-freeze
  kind observation
  The site thermometer logged minus four degrees from 02:00 to 06:00, and tonight's
  forecast repeats it. Fresh concrete that freezes before it sets never recovers.

link truck-is-booked supports conditions-are-fine
link overnight-freeze opposes conditions-are-fine

site-engineer holds conditions-are-fine
  confidence 0.88 assumed
  note Pouring today. The truck is booked and the crew moves to another job Thursday.

Read it through the mirror:

  • Argument status. overnight-freeze has no attackers → in. It opposes conditions-are-fine, so conditions-are-fine → out (defeated by its own recorded counter-evidence, even though a booked truck supports it).
  • Conflict. The site engineer holds the now-out claim at 0.88 (≥ 0.66) → a confidence-vs-status error.
  • Provenance. That 0.88 is assumed — the mirror shows not just how sure the engineer is, but on what footing.

The document is structurally clean. The mirror surfaces the contradiction the form can’t — and leaves the call to you. That’s ThoughtML in one screen.