What does The Cliff of Stacked Rules conclude, in numbers, about “Classical Sources East and West: the Spear and Shield of the Han Feizi, and Boole's x² = x”?
Answer: Chapter 7 examines the spear and shield of the Han Feizi and Boole's Laws of Thought of 1854.
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 only
spear and shield: contradiction; core size 4 of 4
drop 'boast 1' -> satisfiable
drop 'boast 2' -> satisfiable
Yao and Shun: contradiction; core size 4 of 4
drop 'praise Yao' -> satisfiable
drop 'praise Shun' -> satisfiable
claims until self-contradiction (median of 100 speakers)
topics n absolute k=1 hedged k=2 hedged k=3
10 6.0 21.0 50.5
30 10.0 50.0 135.5Show the full program
# Chapter 7. p71: the spear and the shield as clauses
# Model: Han Feizi, Nan Yi (paraphrased). Switches: 1 the shield
# withstands every spear, 2 the spear pierces every shield, 3 this
# spear pierces this shield; and for the Yao and Shun argument of the
# same chapter, 4 Yao was a flawless sage ruler, 5 there were faults
# under Yao, 6 Shun corrected faults. Then the scale question: how
# many claims until a speaker contradicts himself, when every claim
# is absolute (1 switch) or hedged over 2 or 3 switches? Median
# last-straw count over 100 random speakers; fixed seed.
import random
import statistics
from collections import Counter
RUNS = 100
STORY = [
("boast 1", [1]), ("boast 2", [2]),
("meaning of boast 1", [-1, -3]), ("meaning of boast 2", [-2, 3]),
]
YAO = [
("praise Yao", [4]), ("praise Shun", [6]),
("flawless means no faults", [-4, -5]),
("correcting needs faults", [-6, 5]),
]
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 dpll(cls):
while True:
unit = next((c[0] for c in cls if len(c) == 1), None)
if unit is None:
break
cls = assign(cls, unit)
if cls is None:
return False
if not cls:
return True
w = Counter()
for c in cls:
for x in c:
w[x] += 1 << max(0, 8 - len(c))
lit = max(w, key=lambda x: (w[x] + w[-x], w[x], -abs(x), x))
for b in (lit, -lit):
nxt = assign(cls, b)
if nxt is not None and dpll(nxt):
return True
return False
def core(named):
keep = list(named)
for item in list(named):
trial = [r for r in keep if r is not item]
if not dpll([list(c) for _, c in trial]):
keep = trial
return keep
for title, rules in (("spear and shield", STORY), ("Yao and Shun", YAO)):
ok = dpll([list(c) for _, c in rules])
print("%s: %s; core size %d of %d"
% (title, "satisfiable" if ok else "contradiction",
len(core(rules)), len(rules)))
for drop in (0, 1):
rest = rules[:drop] + rules[drop + 1:]
print(" drop '%s' -> %s" % (rules[drop][0], "satisfiable"
if dpll([list(c) for _, c in rest]) else "contradiction"))
rng = random.Random(20261125)
print("claims until self-contradiction (median of %d speakers)" % RUNS)
print("topics n absolute k=1 hedged k=2 hedged k=3")
for n in (10, 30):
cells = []
for k in (1, 2, 3):
vals = []
for _ in range(RUNS):
claims = []
for _ in range(12 * n):
vs = rng.sample(range(1, n + 1), k)
claims.append([v if rng.random() < 0.5 else -v
for v in vs])
lo, hi = 0, len(claims)
while hi - lo > 1:
mid = (lo + hi) // 2
if dpll([list(c) for c in claims[:mid]]):
lo = mid
else:
hi = mid
vals.append(hi)
cells.append(statistics.median(vals))
print("%8d %12.1f %10.1f %10.1f" % (n, cells[0], cells[1],
cells[2]))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 7: Classical Sources East and West: the Spear and Shield of the Han Feizi, and Boole's x² = x. 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
- Chapter 1 · The Cliff of Stacked Rules: the Satisfiability Phase Transition of Random 3-SAT
- Chapter 2 · DPLL with the Standard Library: Unit Propagation, Branching and "Easy, Hard, Easy"
- Chapter 3 · Where the Cliff Lies: the First-Moment Bound, the Exact Threshold of 2-SAT and Rule Length
- Chapter 4 · Measuring a Rulebook: Load, Forced Values, Minimal Conflict Cores and Headroom
- Chapter 5 · Real Rules Are Not Random Rules: Mixed Lengths, the 2+p Model and the Balance of Demands and Prohibitions
- Chapter 6 · Signals on the Eve of Deadlock: Solution Counts, the Backbone and the Hazard of the Next Rule
- Chapter 8 · Closing the Loop: a Monthly Constraint-Ratio Scan of the Five-Kit Rulebooks and a Pre-Registered Test