Skip to main content

Module examples

Module examples 

Source
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§

ExampleSpec
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 .logos file that declares a ## Page opens 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.lg validation, and a scoped Style: 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. The hardware_examples integration 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_EXAMPLES because 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), N pigeons into N-1 holes. Opened in Hardware mode; load_hardware_spec routes a pigeons: 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) needs 2^Ω(n) steps on.
REGALLOC_EXAMPLES
Register-allocation examples: a basic block’s variable live ranges + a register budget. Opened in Hardware mode; load_hardware_spec routes a registers: 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 the hardware_examples integration test. Opened in Hardware mode (they live under /examples/hardware); load_hardware_spec routes module … endmodule content to the RTL BMC path.

Functions§

compiled_runtime_needs
What a registry program the browser cannot run needs (“Live networking”); None for 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; None for 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 the example_health tests drive the same specs, so serving, opening and testing can never drift.