Expand description
Example files for the Studio playground.
The Studio serves them read-only from the site itself (studio_files), so they never need
copying into the reader’s storage and are there from the first frame.
Structs§
- Example
Spec - One shipped Studio example: where it seeds in the VFS, its mode, its source text (the live const), and the outcome it is locked to.
Enums§
- Expected
- The documented intended outcome an example is locked to. The test harness dispatches on this to the same pipeline the Studio uses for that mode.
- Mode
- Which Studio surface an example belongs to.
Constants§
- ALL_
CODE_ EXAMPLES - The 36 Code-mode examples. Output needles are provisional until the audit run confirms the real interpreter output.
- ALL_
HARDWARE_ SPECS - The 18 Hardware-mode examples, sourced from the four hardware slices. The
deliberately-unsafe demos (
bad-arbiter,traffic-crash,queue-jam,register-alloc-spill) are locked to their intended failure/refutation. - ALL_
LOGIC_ EXAMPLES - The 11 Logic-mode examples.
- ALL_
MATH_ EXAMPLES - The 24 Math-mode examples.
- CODE_
CRDT_ COUNTERS - CODE_
CRDT_ TALLY - CODE_
FIBONACCI - CODE_
HELLO - CODE_
WEB_ COUNTER - Web page: a counter. A
.logosfile that declares a## Pageopens in the Web tab, where it is compiled to WebAssembly and runs live. - CODE_
WEB_ FORM - Web page: a form — two-way binding (
bind={…}),on-submit.prevent,forms.lgvalidation, and a scopedStyle:block. - CODE_
WEB_ SITE - Web page: a website in a website, the front page’s live example: a card with a list, a counted button and a light switch. Kept in its own file so the front page shows exactly what ships.
- CODE_
WEB_ TODO - Web page: a to-do list you add to, tick off and remove from — records in
State:, a form with.prevent, a keyed{for each}with an empty arm, and a derived count. - HARDWARE_
EXAMPLES - Hardware-mode examples:
(filename, English spec). Each is a single English hardware specification that the Studio synthesizes to SystemVerilog Assertions and then certifies (in-browser, no Z3) against the spec. Pure spec sentences — the loader feeds the whole file to the synthesizer. Thehardware_examplesintegration test verifies every one of these synthesizes, round-trips as certified-equivalent, and has a reachable trigger. - HW_
MUTEX - Mutual exclusion as one English sentence. Certified equivalent to its SVA like
every spec above, but kept out of
HARDWARE_EXAMPLESbecause the vacuity check only applies to implication-shaped specs (this one has no trigger to fire — “not both” is unconditional). - LOGIC_
BARBER - LOGIC_
LEIBNIZ - LOGIC_
QUANTIFIERS - LOGIC_
SIMPLE - MATH_
AUTO - MATH_
BOOL - MATH_
GODEL_ LITERATE - MATH_
INCOMPLETENESS_ LITERATE - MATH_
NAT - MATH_
PROP_ LOGIC - PIGEONHOLE_
EXAMPLES - Pigeonhole examples:
pigeons: N→ PHP(N),Npigeons intoN-1holes. Opened in Hardware mode;load_hardware_specroutes apigeons:spec to the live solver, which animates the doomed pigeon and emits a certified symmetry-breaking refutation (Hall witness + Heule PR proof, no Z3) — the family every resolution-based solver (Kissat, CaDiCaL, Z3) needs2^Ω(n)steps on. - REGALLOC_
EXAMPLES - Register-allocation examples: a basic block’s variable live ranges + a register budget. Opened
in Hardware mode;
load_hardware_specroutes aregisters:spec to the certified linear-scan allocator and renders the live-range timeline (coloured by register, spill clique flagged red). - RTL_
EXAMPLES - RTL examples:
(filename, Verilog). Synthesizable Verilog the Studio parses into a transition system and bounded-model-checks / k-induction-proves in the browser (no Z3). Verified by thehardware_examplesintegration test. Opened in Hardware mode (they live under/examples/hardware);load_hardware_specroutesmodule … endmodulecontent to the RTL BMC path.
Functions§
- compiled_
runtime_ needs - What a registry program the browser cannot run needs (“Live networking”);
Nonefor any other file. - compiled_
runtime_ notice - What a registry example that cannot run in the browser shows when it opens, in place of an interpreter run that would only pretend: what it needs, and where it does run.
- planted_
bug_ fix - The registry path of the design a planted bug’s example is, fixed;
Nonefor any other file. - planted_
bug_ notice - What a registry example with a planted bug says when it opens: that the failure is the point, and which example is the same design fixed.
- seed_
examples - Write every shipped example into a VFS, over the copy already there, and retire the ones the
registry dropped. The Studio itself never calls this: it serves the examples from the site
(
studio_files). - seeded_
examples - Every shipped Studio example, the four registries in one sequence. They are the single source
of truth: the Studio serves exactly them (
studio_files) and opens on them (studio_opening), and theexample_healthtests drive the same specs, so serving, opening and testing can never drift.