What does Beyond Distillation conclude, in numbers, about “The Front-End Statechart: Reachability, Deadlock and an Interface Gate on Every Path”?

Answer: With five orthogonal regions, each drawn once in a statechart, there are 17 states and 27 transitions. Flattened into a single machine, there are 360 states and 2,652 transitions. Two coupling constraints across regions (payment may leave idle only when the cart is locked; paid or refunded requires consent first) cut the legal states to 144, a share of 0.4000.

Scope of the numbers: Parameters are illustrative and all calculations are generated by the book's programs. This is general business analysis, not investment, legal or medical advice, and the code it generates is teaching material deployed to no site.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.4000, 144, 17, 2652, 27, 360

regions5
statechart states17
statechart transitions27
flat states360
flat transitions2,652
flat states meeting couplings 144
share meeting couplings0.4000
adding regions of 3 states with 4 transitions each:
extra chart states flat states flat transitions
120 1,080 9,396
223 3,240 32,508
326 9,720 110,484
Show the full program
# Chapter 3. p33: why a front-end organ is written as a statechart.
# Five orthogonal regions (cart, sign-in, language, payment, consent) are
# drawn once each in a statechart; a flat machine needs their product.
# Local transitions are counted per region; in the flat machine every
# local transition is copied once per state of the other regions. Two
# coupling invariants (payment can leave idle only with a locked cart;
# paid needs consent) cut the valid product. Region sizes illustrative.
import itertools
import math

REGIONS = [
    ("cart", ["empty", "filled", "locked"], 4),
    ("auth", ["guest", "member", "expired"], 4),
    ("lang", ["zh", "en", "ms", "th"], 12),
    ("pay", ["idle", "pending", "paid", "failed", "refunded"], 6),
    ("consent", ["unset", "accepted"], 1),
]


def valid(combo):
    cart, auth, lang, pay, consent = combo
    if pay != "idle" and cart != "locked":
        return False
    if pay in ("paid", "refunded") and consent != "accepted":
        return False
    return True


if __name__ == "__main__":
    sizes = [len(r[1]) for r in REGIONS]
    flat = math.prod(sizes)
    chart_states = int(math.fsum(sizes))
    chart_tr = int(math.fsum(r[2] for r in REGIONS))
    flat_tr = 0
    for i, r in enumerate(REGIONS):
        flat_tr += r[2] * (flat // sizes[i])
    print("regions                       {}".format(len(REGIONS)))
    print("statechart states             {}".format(chart_states))
    print("statechart transitions        {}".format(chart_tr))
    print("flat states                   {:,}".format(flat))
    print("flat transitions              {:,}".format(flat_tr))
    combos = list(itertools.product(*[r[1] for r in REGIONS]))
    ok = [c for c in combos if valid(c)]
    print("flat states meeting couplings {}".format(len(ok)))
    print("share meeting couplings       {:.4f}".format(len(ok) / flat))
    print("adding regions of 3 states with 4 transitions each:")
    print("  extra   chart states   flat states   flat transitions")
    for extra in (1, 2, 3):
        s2 = sizes + [3] * extra
        t2 = [r[2] for r in REGIONS] + [4] * extra
        f2 = math.prod(s2)
        ft = 0
        for i in range(len(s2)):
            ft += t2[i] * (f2 // s2[i])
        print("  {:>5}   {:>12}   {:>11,}   {:>16,}".format(
            extra, int(math.fsum(s2)), f2, ft))

Single source and citation

Fan, Y. (2026). Beyond Distillation: Executable Business-Organ Synthesis, Generative Code Crystallisation and Living-System Bootstrapping (Version 1.0.0), Chapter 3: The Front-End Statechart: Reachability, Deadlock and an Interface Gate on Every Path. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-378 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026378,
  author    = {Fan, Yafu},
  title     = {Beyond Distillation: Executable Business-Organ Synthesis, Generative Code Crystallisation and Living-System Bootstrapping},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book