What does The Cliff of Stacked Rules conclude, in numbers, about “Measuring a Rulebook: Load, Forced Values, Minimal Conflict Cores and Headroom”?

Answer: Chapter 4 checks an illustrative rulebook of 24 switches: bare ratio 0.958, load 0.475, a median clause ratio at deadlock of only 1.292, and a minimal conflict core spanning three rule families.

Scope of the numbers: The rulebooks and data are illustrative; every calculation is generated by the book's programs; the book offers general business method, not legal, compliance or business-decision advice. Chapter 4 checks an illustrative rulebook of 24 switches: bare ratio 0.958, load 0.475, a median clause ratio at deadlock of only 1.292, and a minimal conflict core spanning three rule families.

中文版

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.475, 0.958, 24

switches n24, rules m = 23, raw ratio m/n = 0.958
rule lengths1-switch x5, 2-switch x14, 3-switch x3, 6-switch x1
families: pricing 9, copy 4, style 5, closing 4, ops 1
constraint load L0.475 bits per switch
forced values9; open rules 13 on 15 free switches
effective ratio0.867, effective load = 0.319
campaigns passing every rule1780 of 2^24
log2(solutions) / n0.450
Show the full program
# Chapter 4. p41: the constraint ratio of a real-shaped rules library
# Model: an illustrative campaign library of 24 switches and 23 rules
# drawn from five rule families (pricing, copy, style, closing,
# operations), written as clauses. Reports the raw ratio m / n, the
# clause-length mix, the ratio after forced values are propagated,
# the constraint load L = (1/n) * sum of -log2(1 - 2^-k) over rules
# (bits each rule removes from a random assignment), and the exact
# number of campaigns that pass every rule (counting DPLL).

import math
from collections import Counter

SW = ["coupon_A", "coupon_B", "member_price", "flash_sale", "bundle",
      "free_ship", "early_bird", "new_price", "price_receipt",
      "floor_ok", "countdown", "real_deadline", "live_stock",
      "dark_theme", "red_button", "contrast_ok", "button_44px",
      "compact_layout", "dm_sequence", "consent", "unsub_stop",
      "arena_test", "launch_today", "copy_check"]
LIB = [
    ("pricing", "A and B never stack", [-1, -2]),
    ("pricing", "member price excludes flash sale", [-3, -4]),
    ("pricing", "bundle excludes member price", [-5, -3]),
    ("pricing", "A with flash sale breaks the floor", [-1, -4, -10]),
    ("pricing", "price floor holds", [10]),
    ("pricing", "new price needs a calculator receipt", [-8, 9]),
    ("pricing", "early bird is a new price", [-7, 8]),
    ("pricing", "free shipping needs A or a bundle", [-6, 1, 5]),
    ("pricing", "campaign has an offer", [1, 2, 3, 4, 5, 7]),
    ("copy", "countdown needs a real deadline", [-11, 12]),
    ("copy", "flash sale needs live stock", [-4, 13]),
    ("copy", "early bird needs a real deadline", [-7, 12]),
    ("copy", "launch needs a copy check", [-23, 24]),
    ("style", "contrast at least 4.5 to 1", [16]),
    ("style", "touch targets at least 44 px", [17]),
    ("style", "red button on dark theme fails contrast",
     [-15, -14, -16]),
    ("style", "compact layout shrinks buttons", [-18, -17]),
    ("style", "brand wants red buttons", [15]),
    ("closing", "messages need consent", [-19, 20]),
    ("closing", "messages stop on unsubscribe", [-19, 21]),
    ("closing", "messages need a stress test", [-19, 22]),
    ("closing", "launch needs a stress test", [-23, 22]),
    ("ops", "launch today", [23]),
]


def assign(cls, lit):
    out = []
    for c in cls:
        if lit in c:
            continue
        if -lit in c:
            c = [x for x in c if x != -lit]
            if not c:
                return None
        out.append(c)
    return out


def propagate(cls):
    forced = []
    while True:
        unit = next((c[0] for c in cls if len(c) == 1), None)
        if unit is None:
            return cls, forced
        forced.append(unit)
        cls = assign(cls, unit)
        if cls is None:
            return None, forced


def count(cls, free):
    if cls is None:
        return 0
    if not cls:
        return 1 << free
    w = Counter(abs(x) for c in cls for x in c)
    v = max(w, key=lambda x: (w[x], -x))
    total = 0
    for b in (v, -v):
        nxt = assign(cls, b)
        if nxt is not None:
            total += count(nxt, free - 1)
    return total


def load(cls, n):
    return math.fsum(-math.log2(1.0 - 2.0 ** -len(c)) for c in cls) / n


n, cls = len(SW), [list(c) for _, _, c in LIB]
print("switches n = %d, rules m = %d, raw ratio m/n = %.3f"
      % (n, len(cls), len(cls) / n))
mix = Counter(len(c) for c in cls)
print("rule lengths: " + ", ".join("%d-switch x%d" % (k, mix[k])
                                   for k in sorted(mix)))
fam = Counter(f for f, _, _ in LIB)
print("families: " + ", ".join("%s %d" % (f, fam[f]) for f in
                               ("pricing", "copy", "style", "closing",
                                "ops")))
print("constraint load L = %.3f bits per switch" % load(cls, n))
rest, forced = propagate(cls)
free = n - len(forced)
used = len({abs(x) for c in rest for x in c})
print("forced values: %d; open rules %d on %d free switches"
      % (len(forced), len(rest), used))
print("effective ratio = %.3f, effective load = %.3f"
      % (len(rest) / used, load(rest, used)))
sols = count(rest, free)
print("campaigns passing every rule: %d of 2^%d" % (sols, n))
print("log2(solutions) / n = %.3f" % (math.log2(sols) / n))

Single source and citation

Fan, Y. (2026). Boolean Satisfiability Phase Transitions: the Critical Constraint Ratio at Which Stacked Promotion, Compliance and Gate Rules Deadlock, and How to See It Coming (Version 1.0.0), Chapter 4: Measuring a Rulebook: Load, Forced Values, Minimal Conflict Cores and Headroom. 5D Library. DOI pending

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

BibTeX
@book{fan2026252,
  author    = {Fan, Yafu},
  title     = {Boolean Satisfiability Phase Transitions: the Critical Constraint Ratio at Which Stacked Promotion, Compliance and Gate Rules Deadlock, and How to See It Coming},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book