Expert begins by treating Malbolge as a formal machine: states, transition relation, initial memory after load, and observation via I/O. Informal vibes got you through Easy; Medium built labs; Expert demands precise language.
Malbolge Expert · Lesson 1 · On the house
Formal model
Malbolge · expert · Formal model. Lesson 1 is free — on the house.
Lessons · Malbolge Expert · Lesson 1 of 10 · On the house
Formal model
Malbolge · expert · Formal model.

A state can be modeled as (memory image, a, c, d) plus input tape position and output so far. Transition applies decode/execute/encrypt rules. Halt states are terminal.
Why formalize? So claims become checkable: does this interpreter implement the same relation? Does this optimization preserve observable behavior? Does this normalized assembly round-trip?
Write the transition in pseudocode with total functions for crazy, crazy2, decode, and pointer updates. Ambiguous English is how dialect wars start.
Finite memory (59049 cells) means the configuration space is finite though astronomical. Finiteness matters for theory talk next.
Pitfalls: handwavy state; forgetting output/input in the state; underspecified illegal handling; calling two ports identical without a formal checklist.
Deepening expert-formal-model: write precondition and postcondition in one sentence each before you touch search or a tracer. Vague goals produce vague fitness and vague traces. Malbolge amplifies vagueness into wasted CPU.
Workbench on expert-formal-model: change one knob — mutation rate, step cap, table constant, dialect flag — then remeasure. Batch knobs create superstition. Lab notebooks beat lore.
Portability for expert-formal-model: name the interpreter family beside every result screenshot. Classic versus normalized versus experimental ports disagree politely until they ruin your week.
Composition for expert-formal-model: after a success, break it on purpose (wrong EOF, tighter cap, swapped crazy2) and record the symptom line. Symptom catalogs are Expert fuel.
Teach-back for expert-formal-model: explain today's still without looking, using only a/c/d and one dump line. Hesitation is a map of what to restudy.
Numeric drill on expert-formal-model: three micro-targets or three micro-traces beat one theatrical attempt. Medium difficulty cliffs are climbed in switchbacks.
Naming for expert-formal-model: label candidates, elites, and fixtures with roles — seed, mutant, champion, oracle. Stale names in logs lie harder than stale Malbolge cells.
History of practice for expert-formal-model: keep failed fitness curves. A flatline teaches as much as a spike. Your future self will thank the ugly plots.
Negative space for expert-formal-model: list what you will not claim today — no casual hand hello, no universal dialect, no cruelty-as-virtue. Negatives keep judgment clean.
Observational equivalence: two machines are alike if for all inputs they produce the same outputs and halt behavior under the same caps. Use that definition when claiming port parity.
Partial functions for illegal ops must become total in the model — map to HALT_ERROR or NOP per dialect — or your transition relation is not a relation you can implement.
Abstraction lemma sketch: if encryption and crazy are pure functions of state, then caching decode for (c,[c]) is valid. Impure ports break the lemma.
Write invariants: memory length constant; a,c,d in range; output only appends. Check invariants in the simulator every cycle in debug builds.
Proof-shaped claims need proof-shaped interfaces: equal_states, step, run, observe. Soft prose cannot replace them in Expert writeups.
Executable specs (small reference in a slow language) beat PDF specs when disputes arise.
State hashing for visited-set experiments must be collision-aware enough for your budget; document the hash.
Assessment angle on formal model: predict one dump field before revealing the tracer line. Wrong predictions are tuition — write them down.
Refactor note on formal model: after it works, rename log fields and tighten the lab report section for this idea so next week's you can reuse it.
Edge cases for formal model: try the empty program, a one-glyph program, and a max-length-under-budget candidate. Edges expose loader and fitness lies.
Caller contract for formal model: document what your tool clobbers — RNG state, working files, interpreter globals — like an ABI between lab scripts.
(Lesson 1 deepen.) Return to the still after each quiz miss and point to the sentence that already answered it. Open-book means the page is a tool, not a trap.
Change one mental model at a time: radix, then tables, then encrypt, then search. Stacking model changes manufactures superstition.
Keep a running glossary in your notebook — trit, crazy, crazy2, a, c, d, normalize, fitness, dialect. Definitions drift if unwritten.
When stuck, shrink the experiment until one cycle is understandable. Magnification beats marathon confusion.
Explain the last still to a rubber duck using only register names and one verb per op class. If the duck would be confused, you are too.
Compare your notes with a classmate's dump from the same artifact; disagreements are gold if you resolve them against a reference.
Prefer short daily drills over weekend heroics. Hostile machines reward steady exposure.
formal-model
# Malbolge · Formal model
# Level: expertWalked still — Formal model note: type it exactly. Matching Host notes trains the same precision you need when candidates differ by one glyph.
Quiz
A useful Malbolge state includes?
Quiz
Formalizing helps you check?
Quiz
Configuration space is?
Quiz
Ambiguous English specs cause?
Quiz
Transition relation captures?
Quiz
Forgetting I/O in the state model?
Check
Match the still for: Formal model.
Check
Type the Host note still for this lesson.
Formal state on the desk. Next: undecidability feel.
Open-book: the answers are on this page. Pass every quiz and check (8) to mark the lesson done. This visit: 0/8.