关于「真规则不是随机规则:长短混合、2+p 模型与「要求」和「禁止」的配比」,《规则叠加的悬崖》给出的定量结论是什么?
结论:第五章说明短规则主导悬崖,死锁需要「要求」与「禁止」同在,最危险的配比使死锁约束比低到 2.638。
数据口径:书中规则册与数据均为示意;全部计算由书中程序生成;本书属非个人化经营方法,不构成法律、合规或经营决策意见。 第四章给一本 24 个开关的示意规则册做体检:裸约束比 0.958,载荷 0.475,死锁时约束比中位数只有 1.292,最小冲突核横跨三个规则族。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 2.638
| q demands | never deadlocked | median m*/n | median demands/n |
|---|---|---|---|
| 0.0 | 60 | never | never |
| 0.1 | 0 | 4.062 | 0.400 |
| 0.2 | 0 | 2.987 | 0.600 |
| 0.3 | 0 | 2.700 | 0.800 |
| 0.4 | 0 | 2.638 | 1.050 |
| 0.5 | 0 | 2.713 | 1.363 |
| 0.6 | 0 | 2.662 | 1.575 |
| 0.7 | 0 | 3.188 | 2.162 |
| 0.8 | 0 | 3.925 | 3.150 |
| 0.9 | 0 | 5.612 | 5.075 |
| 1.0 | 60 | never | never |
查看完整验算程序
# Chapter 5. p52: deadlock needs both demands and prohibitions
# Model: a share q of rules are demands ("at least one of these 3
# switches is on", all signs positive) and the rest prohibitions
# ("never these 2 together", both signs negative). With only one
# kind the set is always satisfiable (all on, or all off). Median
# last-straw ratio m* / n over 60 formulas on n = 40 switches,
# rules capped at 12 n; "never" if over half never deadlock.
import random
import statistics
from collections import Counter
N, RUNS, CAP = 40, 60, 12
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 last_straw(rules):
lo, hi = 0, len(rules)
if dpll([list(c) for c in rules]):
return None
while hi - lo > 1:
mid = (lo + hi) // 2
if dpll([list(c) for c in rules[:mid]]):
lo = mid
else:
hi = mid
return hi
rng = random.Random(20261122)
print("q demands never deadlocked median m*/n median demands/n")
for q in (0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0):
vals, dem, never = [], [], 0
for _ in range(RUNS):
rules = []
for _ in range(CAP * N):
if rng.random() < q:
rules.append(rng.sample(range(1, N + 1), 3))
else:
rules.append([-v for v in rng.sample(range(1, N + 1), 2)])
ms = last_straw(rules)
if ms is None:
never += 1
vals.append(float("inf"))
dem.append(float("inf"))
else:
vals.append(ms / N)
dem.append(len([c for c in rules[:ms] if c[0] > 0]) / N)
med = statistics.median(vals)
if med == float("inf"):
txt = "%11s %16s" % ("never", "never")
else:
txt = "%11.3f %16.3f" % (med, statistics.median(dem))
print("%9.1f %16d %s" % (q, never, txt))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《布尔可满足性相变阈值、促销合规与门禁叠加的约束比临界与全盘死锁预警母典》第 5 章「真规则不是随机规则:长短混合、2+p 模型与「要求」和「禁止」的配比」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 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}
}