A text runtime that executes a "knot program" with two pointers at once — one running forward, one backward — and watches them cross seams and touch containers.
This is the runtime side of the PCB knot tools: it executes the structures you build/analyze in the Knot Builder and Knot Workbench.
What it does
A knot program is written as text and split into lobes (sections separated by :###:); each lobe holds instructions. The machine flattens all lobes into one instruction stream and runs two pointers across it at once: a FWD pointer (left → right across every lobe) and a BWD pointer (right → left). As they move they cross seams, touch containers, and rack up cycles — and every move is written to the trace.
Writing / loading a program
- Program source (left, editable) — your knot program.
; begins a comment; :###: separates lobes; scope markers and single-letter lobe labels are structural (not executed); literals and unknown tokens are skipped.
- Example dropdown +
LOAD EXAMPLE — drop in a ready program. LOAD parses the source; the Parsed program view then shows its structure.
Running it
STEP FWD ▶ / ◀ STEP BWD — advance one pointer by a single instruction.
STEP BOTH — advance both pointers one step. RUN — run to completion. RESET — rewind the machine.
Readouts
- Pointers — the live position and current instruction of the FWD and BWD pointers.
- Counters —
cycle count and seam crossings.
- Containers — the boxes the pointers touch as they run, with a live count.
- Trace — a running log of every executed instruction.
How to use it
- 1 — Pick an Example →
LOAD EXAMPLE (or write your own: ; comments, :###: between lobes).
- 2 —
LOAD to parse; confirm the Parsed program view filled in.
- 3 — Step (
FWD/BWD/BOTH) one move at a time, or RUN to the end.
- 4 — Watch the pointers, the seam/cycle counters, the Containers panel, and the Trace.
- 5 —
RESET to start over.