关于「东西方原典考辨:《韩非子·难一》的矛与楯,布尔《思维规律》的 x² = x」,《规则叠加的悬崖》给出的定量结论是什么?

结论:第七章考辨《韩非子·难一》的矛与楯与布尔 1854 年的《思维规律》。

数据口径:书中规则册与数据均为示意;全部计算由书中程序生成;本书属非个人化经营方法,不构成法律、合规或经营决策意见。 第四章给一本 24 个开关的示意规则册做体检:裸约束比 0.958,载荷 0.475,死锁时约束比中位数只有 1.292,最小冲突核横跨三个规则族。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库

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.5
查看完整验算程序
# 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]))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《布尔可满足性相变阈值、促销合规与门禁叠加的约束比临界与全盘死锁预警母典》第 7 章「东西方原典考辨:《韩非子·难一》的矛与楯,布尔《思维规律》的 x² = x」(版本 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}
}

本书其他章节结论