在伟大的自动机之城(Automata)里,数以百万计的机器沿着每条街道的工坊嗡嗡作响、咔嚓运转,那里住着一个检验官公会(Guild of Inspectors)。他们的职责很简单:对于任何被带到他们面前的机器,他们会观察其运行,然后宣布它最终是否会平静地停下来——齿轮归于寂静——还是会永远旋转,无休止地碾压下去。市民们深深信赖他们,因为一台永不停歇的机器是危险的;它可能过热、耗尽城市所有的燃料,或者将操作者困在徒劳工作的无尽循环中。
In the great city of Automata, where millions of machines hummed and clicked in workshops along every street, there lived a Guild of Inspectors. Their duty was simple: for any machine brought before them, they would watch it run and declare whether it would eventually come to a peaceful stop — its gears settling into silence — or whether it would spin forever, grinding on without end. The citizens trusted them deeply, for an endless machine was dangerous; it could overheat, consume all the city's fuel, or trap its operator in an infinite loop of futile work.
有一天,公会的大师(Master of the Guild)宣布了一个新的雄心。他花了数年研究城中的每一台机器——织出图案后便停下的织机、算完总和后便休息的计算器、走到尽头便鸣响的钟表。他相信他能建造一台万能检验官(Grand Inspector):一台单一的通用机器,能够接收任何其他机器的蓝图,连同该机器可能接收的任何输入,经过有限的思考后,做出裁决。「会停下」或者「永不停下」。不再有不确定。不再有猜测。城市终于会安全了。
One day, the Master of the Guild announced a new ambition. He had spent years studying every machine in the city — looms that stitched patterns and halted, calculators that cranked through sums and rested, clocks that ticked down and chimed. He believed he could build a Grand Inspector: a single, universal machine that could take in the blueprint of any other machine, along with whatever input that machine might receive, and after some finite deliberation, pronounce a verdict. "Will stop" or "Will never stop." No more uncertainty. No more guessing. The city would be safe at last.
万能检验官建成了。它宏伟壮观——一座由透镜和杠杆组成的巍峨装置,有一个插蓝图的槽和一个插输入数据的槽。起初它运转完美。给它织机的蓝图和一匹丝绸,它宣布「会停下」。给它悖论引擎(paradox engine)的蓝图——那台唯一任务就是寻找圆周率最后一位数字的机器——它宣布「永不停下」。市民们欢呼。大师满面春风。万能检验官被安置在中央广场,准备为任何将机器带到它面前的人服务。
The Grand Inspector was built. It was magnificent — a towering apparatus of lenses and levers, with a slot for blueprints and a slot for input data. It worked flawlessly at first. Given the blueprint of a loom and a bolt of silk, it declared "Will stop." Given the blueprint of a paradox engine — a machine whose only job was to find the last digit of pi — it declared "Will never stop." The citizens cheered. The Master beamed. The Grand Inspector was placed in the central square, ready to serve anyone who brought a machine before it.
然后一位名叫科塔(Kota)的年轻学徒来了,带着一份她自己的奇特蓝图。她仔细研究了万能检验官——理解了它内部的每一个齿轮、每一个透镜、每一个决策路径。从那份理解中,她设计了一台她称为镜像机(Mirror)的机器。镜像机的蓝图极为巧妙:当镜像机被赋予任何输入时,它会首先将该输入送入万能检验官的完美模拟中,询问检验官:镜像机本身——在同一输入上运行——是否会停下。如果检验官的模拟回答「会停下」,镜像机就会故意进入一个无限循环,永远旋转。如果模拟回答「永不停下」,镜像机就会立即停机,齿轮归于寂静。
Then a young apprentice named Kota arrived, carrying a peculiar blueprint of her own. She had studied the Grand Inspector carefully — understood every gear, every lens, every decision path inside it. From that understanding, she had designed a machine she called the Mirror. The Mirror's blueprint was cunning: when the Mirror was given any input, it would first feed that input into a perfect simulation of the Grand Inspector, asking the Inspector whether the Mirror itself — running on that same input — would ever stop. If the Inspector's simulation answered "Will stop," the Mirror would deliberately enter an infinite loop, spinning forever. If the simulation answered "Will never stop," the Mirror would immediately halt, its gears settling into silence.
科塔将镜像机的蓝图放入万能检验官的插槽,将镜像机的输入放入另一个插槽。她提出了核心问题:「检验官,镜像机是否会停下?」人群安静下来。万能检验官开始思考——透镜转动、杠杆切换——模拟镜像机,而镜像机反过来又在模拟万能检验官模拟镜像机,而镜像机又在模拟……一场浩大的递归在机器内部展开。检验官探索的每一条路径都导向矛盾。如果它试图说「会停下」,那意味着镜像机进入了无限循环——所以镜像机永远不会停下,使得裁决错误。如果它试图说「永不停下」,那意味着镜像机立即停机——所以镜像机反而会停下,使得裁决再次错误。
Kota placed the Mirror's blueprint into the Grand Inspector's slot and the Mirror's input into the other slot. She asked the central question: "Inspector, will the Mirror ever stop?" The crowd fell silent. The Grand Inspector began its deliberation — lenses turning, levers shifting — simulating the Mirror, which in turn was simulating the Grand Inspector simulating the Mirror, which was simulating... A vast recursion unfolded inside the machine. Every path the Inspector explored led to a contradiction. If it tried to say "Will stop," it would mean the Mirror enters an infinite loop — so the Mirror would never stop, making the verdict wrong. If it tried to say "Will never stop," it would mean the Mirror halts immediately — so the Mirror would stop, making the verdict wrong again.
万能检验官无法做出裁决。它不能说「会停下」而不撒谎。它不能说「永不停下」而不撒谎。它也不能拒绝回答,因为它被设计为总是在有限思考后给出答案。它的齿轮旋转,它的透镜搜索,但每一个结论都坍缩为悖论。机器一直运转下去,寻找一个并不存在的答案。大师惊恐地看着他那完美的检验官——那台旨在评判所有其他机器的机器——自身变成了一台永不停歇的机器,无解地碾压着。人群明白了他们正在目睹什么:万能检验官永远不可能存在,因为任何这样的检验官,面对一台颠覆其裁决的机器,必然失败。
The Grand Inspector could not reach a verdict. It could not say "Will stop" without lying. It could not say "Will never stop" without lying. It could not refuse to answer, for it was designed to always answer after finite deliberation. Its gears spun, its lenses searched, but every conclusion collapsed into paradox. The machine ran on and on, searching for an answer that did not exist. The Master watched in horror as his perfect Inspector — the machine meant to judge all others — became itself an endless machine, grinding without resolution. The crowd understood what they were seeing: no universal inspector could ever exist, because any such inspector, confronted with a machine that contradicted its verdict, would necessarily fail.
这个故事揭示了停机问题(halting problem)的本质——不存在一个通用算法,能够对每一个可能的程序和输入判定该程序最终会结束运行还是永远继续下去。艾伦·图灵(Alan Turing)在1936年通过构造一个逻辑悖论证明了这一点:如果这样一个万能判定器存在,你可以向它输入一个被设计为做出与其预测相反之事的程序,迫使它陷入矛盾。这意味着关于计算的一些问题是根本不可判定(undecidable)的——无论机器多么强大、方法多么巧妙,没有任何单一程序能够对所有程序的所有停机问题给出正确答案。
This story reveals the essence of the halting problem — there is no general algorithm that can decide, for every possible program and input, whether that program will eventually finish running or continue forever. Alan Turing proved this in 1936 by constructing a logical paradox: if such a universal decider existed, you could feed it a program designed to do the opposite of whatever it predicts, forcing it into a contradiction. This means some questions about computation are fundamentally undecidable — no matter how powerful the machine or how clever the method, no single procedure can correctly answer all halting questions for all programs.