AI 時代的法律編譯層:人類法律、機器法律與認知落差
英文題名: The Legal Compilation Layer in the AI Era: Human Law, Machine Law, and the Cognitive Gap系列: 《不可永佔:後 ASI 文明的動態治理、現場主權與權力制衡》02 / 08文件編號: EML-NMP-S3-02-v0.1作者: Neo.K(許筌崴)with Aletheia(GPT-5.6 Sol)機構: 一言諾科技有限公司/EveMissLab日期: 2026-08-10版本: v0.1文件性質: 理論研究稿/Rules-as-Code/法律編譯層與 AI 治理篇研究狀態: 第一代形式化;本文不主張所有法律都可被完整演算法化,也不主張 machine-readable representation 應取代自然語言法律、司法解釋或民主正當性。
摘要
當法律越來越由數位系統執行時,真正控制公民權利、稅務、福利、資格、許可與義務的,不一定只是在國會公報、判決書或行政規則中可見的自然語言文字,而是法律被一次又一次翻譯後嵌入資訊系統的 operational rules。這產生一個新型治理問題:法律上的「權威文本」與機器實際執行的「操作法律」可能逐漸分離。
本文提出 法律編譯層(Legal Compilation Layer, LCL) ,將 AI 時代的法律表示拆為五層:
L = ( L H , L P , L F , L S , L M ) \boxed{
L
=
(
L_H,
L_P,
L_F,
L_S,
L_M
)
} L = ( L H , L P , L F , L S , L M )
其中:
L H L_H L H :Human Legal Text,人類法律權威文本;
L P L_P L P :Plain-Language Legal Projection,白話法律投影;
L F L_F L F :Formal / Computable Legal Rule,形式化可計算規則;
L S L_S L S :Simulation Layer,法律情境模擬與案例測試;
L M L_M L M :Machine-Readable / Machine-Processable Representation,機器可讀與機器可處理表示。
本文拒絕將上述五層視為彼此等價。核心區分為:
Human-Readable ≠ Machine-Readable ≠ Machine-Decidable ≠ Machine-Executable ≠ Legally Authoritative . \boxed{
\text{Human-Readable}
\neq
\text{Machine-Readable}
\neq
\text{Machine-Decidable}
\neq
\text{Machine-Executable}
\neq
\text{Legally Authoritative}.
} Human-Readable = Machine-Readable = Machine-Decidable = Machine-Executable = Legally Authoritative .
一段法律可以被 XML、JSON、Akoma Ntoso 或 LegalRuleML 結構化,卻仍包含必須由法院、行政機關、專家或政治程序判斷的開放概念;一條形式規則可以被執行,卻不代表它就是法源上最高權威;一個 AI 可以提出法律 formalization,也不能因此取得修改法律語義的權力。
本文定義法律編譯鏈:
L H → C H P L P → C P F L F → C F M L M \boxed{
L_H
\xrightarrow{C_{HP}}
L_P
\xrightarrow{C_{PF}}
L_F
\xrightarrow{C_{FM}}
L_M
} L H C H P L P C P F L F C F M L M
並由:
L F → Sim L S L_F
\xrightarrow{\operatorname{Sim}}
L_S L F Sim L S
生成情境測試、反例與邊界案例。每一次跨層編譯均必須保存 semantic witness:
Γ a b l a w , \Gamma_{ab}^{law}, Γ ab l a w ,
記錄來源、轉譯規則、被壓縮語義、未決歧義、例外、版本與責任人。本文進一步提出 Legal Semantic Drift:
Δ a b s e m = d s e m ( L a , L b ) \boxed{
\Delta_{ab}^{sem}
=
d_{sem}(L_a,L_b)
} Δ ab se m = d se m ( L a , L b )
用以描述法律從人類文本進入機器表示時的語義差距。
本文指出,Rules as Code 與 machine-readable law 已非純理論。OECD 將 Rules as Code 定義為政府同時建立官方、machine-consumable 規則的治理模式;紐西蘭 Better Rules 亦直接指出,傳統流程從立法文字到規則分析、再到軟體實作的多次翻譯會造成 interpretation drift。2025 年 OECD 稅務數位化調查更顯示,一部分政府已發布全部或部分 machine-readable tax law。OASIS 的 Akoma Ntoso 與 LegalRuleML 則分別提供結構化法律文件與法律規範/推理表示的開放標準。
但這些進展同時揭露真正危險:若 L M L_M L M 成為福利、稅務、准入、制裁與行政流程的唯一實際執行版本,而一般人、法官甚至立法者無法看見它如何偏離 L H L_H L H ,則會產生 Operational Law Capture :
de jure authority = L H , de facto authority ≈ L M . \boxed{
\text{de jure authority}
=
L_H,
\qquad
\text{de facto authority}
\approx
L_M.
} de jure authority = L H , de facto authority ≈ L M .
本文因此提出「法律權威不變量」:
A u t h o r i t y ( L H ) > A u t h o r i t y ( L F , L M ) \boxed{
Authority(L_H)
>
Authority(L_F,L_M)
} A u t h or i t y ( L H ) > A u t h or i t y ( L F , L M )
除非憲法與立法程序明確改變法源結構。形式化與機器化層只能作為受授權的編譯產物,而不能因為運行速度更快、實際控制系統更多,就反向奪取規範權威。
本文最終提出 AI 時代成熟法律流程:
Legislation → Compilation → Simulation → Verification → Human / Public Deliberation → Authorized Deployment \boxed{
\text{Legislation}
\rightarrow
\text{Compilation}
\rightarrow
\text{Simulation}
\rightarrow
\text{Verification}
\rightarrow
\text{Human / Public Deliberation}
\rightarrow
\text{Authorized Deployment}
} Legislation → Compilation → Simulation → Verification → Human / Public Deliberation → Authorized Deployment
AI 的最佳角色不是成為「法律神諭」,而是法律編譯器、反例產生器、測試器、解釋器與差異偵測器。真正的法律仍必須保留人類可理解性、公開法源、可爭議性、程序正義與重新解釋能力。
關鍵詞: Rules as Code、machine-readable law、LegalRuleML、Akoma Ntoso、法律編譯、法律語義漂移、AI 法律、動態正義、可計算法律、法律認知落差、後 ASI 治理
0. 問題:真正執行的法律在哪裡?
在傳統法律想像中:
Law = legal text . \boxed{
\text{Law}
=
\text{legal text}.
} Law = legal text .
但現代行政國家中,真實流程常常是:
Statute → Agency Interpretation → Business Rule → Software Requirement → Code → Decision . \text{Statute}
\rightarrow
\text{Agency Interpretation}
\rightarrow
\text{Business Rule}
\rightarrow
\text{Software Requirement}
\rightarrow
\text{Code}
\rightarrow
\text{Decision}. Statute → Agency Interpretation → Business Rule → Software Requirement → Code → Decision .
因此公民實際遇到的是:
Y i = P r o g r a m ( D a t a i ) . \boxed{
Y_i
=
Program(
Data_i
).
} Y i = P r o g r am ( D a t a i ) .
如果 Program 的邏輯與法律原文有偏差,
即使法律文字本身沒有改,
公民的「實際法律世界」也已經改變。
這是 AI 時代法律治理的第一個問題。
1. Prior Art:Rules as Code 已從概念走向政府實作
1.1 OECD:Rules as Code
OECD 將 Rules as Code 描述為:
政府建立官方的 machine-consumable rules,使規則能被電腦系統一致理解與執行。
這與:
private software implementation \text{private software implementation} private software implementation
不同。
核心變化在於:
government rulemaking → human + machine consumable rulemaking . \boxed{
\text{government rulemaking}
\rightarrow
\text{human + machine consumable rulemaking}.
} government rulemaking → human + machine consumable rulemaking .
1.2 紐西蘭 Better Rules
Better Rules Discovery Report 指出傳統流程的 translation gap:
立法者建立 human-readable legislation;
rules analysts 重新解讀;
software developers 再次解讀;
business systems 最終嵌入規則。
因此可能:
A → A 1 → A 2 → A 3 . A
\rightarrow
A_1
\rightarrow
A_2
\rightarrow
A_3. A → A 1 → A 2 → A 3 .
這是一條法律語義漂移鏈。
Better Rules 的解法之一,是讓:
policy;
legislation;
concept model;
decision model;
pseudocode;
software logic;
更早共同發展。
1.3 OECD 2025 稅務數位化
OECD 2025 的 tax administration digitalisation report 顯示,machine-readable tax law 已被多個政府實際採用,以支援 automated calculation、real-time compliance 與 third-party integration。
因此:
machine-readable law \boxed{
\text{machine-readable law}
} machine-readable law
已是現實治理基礎設施議題。
1.4 OASIS:Akoma Ntoso 與 LegalRuleML
Akoma Ntoso 提供 parliamentary、legislative、judicial documents 的 machine-readable structured document model。
LegalRuleML 則進一步表達:
legal norms;
rules;
policies;
defeasibility;
legal reasoning metadata。
因此:
legal document structure \boxed{
\text{legal document structure}
} legal document structure
與:
legal normative logic \boxed{
\text{legal normative logic}
} legal normative logic
本來就是不同層。
1.5 2026 PROLEG
2026 年 PROLEG 研究展示一個具體流程:
natural-language law → if-then rules → PROLEG → executable legal reasoning . \text{natural-language law}
\rightarrow
\text{if-then rules}
\rightarrow
\text{PROLEG}
\rightarrow
\text{executable legal reasoning}. natural-language law → if-then rules → PROLEG → executable legal reasoning .
其中 LLM 負責初始轉譯,
但 formalization 需要 legal expert validation。
這正好支持本文:
LLM compilation ≠ legal authority . \boxed{
\text{LLM compilation}
\neq
\text{legal authority}.
} LLM compilation = legal authority .
2. 五層法律表示
本文定義:
L = ( L H , L P , L F , L S , L M ) . \boxed{
L
=
(
L_H,
L_P,
L_F,
L_S,
L_M
).
} L = ( L H , L P , L F , L S , L M ) .
3. L H L_H L H :Human Legal Text
L H = authoritative human legal expression . \boxed{
L_H
=
\text{authoritative human legal expression}.
} L H = authoritative human legal expression .
包括:
constitution;
statute;
regulation;
judgment;
authorized administrative rule。
其特性:
自然語言;
具有法源地位;
包含開放概念;
可被解釋;
可引用歷史、目的與原則。
例如:
reasonable care
不是普通 Boolean。
因此:
L H ⊈ fully decidable code . \boxed{
L_H
\not\subseteq
\text{fully decidable code}.
} L H ⊆ fully decidable code .
4. L P L_P L P :Plain-Language Legal Projection
許多人無法直接理解:
L H . L_H. L H .
所以需要:
L P = PlainProject ( L H ) . \boxed{
L_P
=
\operatorname{PlainProject}(L_H).
} L P = PlainProject ( L H ) .
它回答:
這條法律與我有什麼關係?
我要做什麼?
何時做?
不做會怎樣?
我有哪些權利?
如何申訴?
但:
L P ≠ L H . \boxed{
L_P
\neq
L_H.
} L P = L H .
白話版本是 projection,
不能取代權威原文。
5. L F L_F L F :Formal / Computable Rule
形式層:
L F = ( P r e d i c a t e s , C o n d i t i o n s , E x c e p t i o n s , P r i o r i t y , T e m p o r a l R u l e s , C o n s e q u e n c e s ) . \boxed{
L_F
=
(
Predicates,
Conditions,
Exceptions,
Priority,
TemporalRules,
Consequences
).
} L F = ( P r e d i c a t es , C o n d i t i o n s , E x ce pt i o n s , P r i or i t y , T e m p or a l R u l es , C o n se q u e n ces ) .
例如:
E l i g i b l e ( x ) ⇐ A g e ( x ) ≥ 18 ∧ R e s i d e n t ( x ) ∧ ¬ E x c l u d e d ( x ) . Eligible(x)
\Leftarrow
Age(x)\ge18
\land
Resident(x)
\land
\neg Excluded(x). E l i g ib l e ( x ) ⇐ A g e ( x ) ≥ 18 ∧ R es i d e n t ( x ) ∧ ¬ E x c l u d e d ( x ) .
但法律還可能有:
E x c e p t i o n , O v e r r i d e , D i s c r e t i o n , B u r d e n O f P r o o f . Exception,
Override,
Discretion,
BurdenOfProof. E x ce pt i o n , O v er r i d e , D i scr e t i o n , B u r d e n O f P r oo f .
所以:
L F \boxed{
L_F
} L F
不能只用最簡單 if-then tree。
6. L M L_M L M :Machine Representation
L M L_M L M
可以包括:
XML;
JSON;
LegalRuleML;
Akoma Ntoso;
PROLEG;
domain-specific legal IR。
需要區分:
machine-readable \boxed{
\text{machine-readable}
} machine-readable
與:
machine-executable . \boxed{
\text{machine-executable}.
} machine-executable .
結構化 XML 可以 machine-readable,
卻不一定能直接決定案件。
7. L S L_S L S :Simulation Layer
形式法律最有價值的地方之一,
不是自動判決,
而是可以:
Simulate ( L F ) . \boxed{
\operatorname{Simulate}(L_F).
} Simulate ( L F ) .
輸入:
C 1 , C 2 , … , C n C_1,C_2,\ldots,C_n C 1 , C 2 , … , C n
得到:
Y 1 , Y 2 , … , Y n . Y_1,Y_2,\ldots,Y_n. Y 1 , Y 2 , … , Y n .
因此立法前可以問:
哪些人被意外排除?
哪條規則產生極端負擔?
哪些例外衝突?
哪些參數造成歧視?
是否存在 dead zone?
這就是法律 simulation layer。
8. 五層不是權威平行體
不能寫成:
A u t h o r i t y ( L H ) = A u t h o r i t y ( L P ) = A u t h o r i t y ( L F ) = A u t h o r i t y ( L M ) . Authority(L_H)
=
Authority(L_P)
=
Authority(L_F)
=
Authority(L_M). A u t h or i t y ( L H ) = A u t h or i t y ( L P ) = A u t h or i t y ( L F ) = A u t h or i t y ( L M ) .
本文提出:
A u t h o r i t y ( L H ) > A u t h o r i t y ( L P , L F , L S , L M ) \boxed{
Authority(L_H)
>
Authority(L_P,L_F,L_S,L_M)
} A u t h or i t y ( L H ) > A u t h or i t y ( L P , L F , L S , L M )
除非法律制度本身明確規定其他法源排序。
理由很簡單:
不能因為機器版本實際跑得最多,就變成最高法律。
9. Legal Compilation
定義:
C a b : L a → L b . \boxed{
C_{ab}:
L_a
\rightarrow
L_b.
} C ab : L a → L b .
例如:
C H F : L H → L F . C_{HF}:
L_H
\rightarrow
L_F. C H F : L H → L F .
編譯不是:
copy . \boxed{
\text{copy}.
} copy .
而是:
semantic transformation . \boxed{
\text{semantic transformation}.
} semantic transformation .
所以必須處理語義損失。
10. Semantic Witness
每一次:
L a → L b L_a
\rightarrow
L_b L a → L b
需要:
Γ a b l a w = ( S o u r c e , M a p p i n g , R e s o l v e d , U n r e s o l v e d , L o s s , E x c e p t i o n s , V a l i d a t o r , V e r s i o n ) . \boxed{
\Gamma_{ab}^{law}
=
(
Source,
Mapping,
Resolved,
Unresolved,
Loss,
Exceptions,
Validator,
Version
).
} Γ ab l a w = ( S o u r ce , M a pp in g , R eso l v e d , U n r eso l v e d , L oss , E x ce pt i o n s , V a l i d a t or , V er s i o n ) .
其中:
Source:來源條文;
Mapping:對應;
Resolved:已解釋歧義;
Unresolved:未決問題;
Loss:轉譯損失;
Exceptions:例外;
Validator:法律審核者;
Version:版本。
11. Legal Semantic Drift
定義:
Δ a b s e m = d s e m ( L a , L b ) . \boxed{
\Delta_{ab}^{sem}
=
d_{sem}(
L_a,L_b
).
} Δ ab se m = d se m ( L a , L b ) .
如果:
Δ H F s e m ≫ 0 , \Delta_{HF}^{sem}
\gg0, Δ H F se m ≫ 0 ,
代表形式規則與法律文本可能偏離。
但:
d s e m d_{sem} d se m
不一定能被一個數字完整表示。
實務上可以使用:
Δ a b = ( Δ s c o p e , Δ c o n d i t i o n , Δ e x c e p t i o n , Δ b u r d e n , Δ r i g h t , Δ t e m p o r a l , Δ a u t h o r i t y ) . \boxed{
\mathbf\Delta_{ab}
=
(
\Delta^{scope},
\Delta^{condition},
\Delta^{exception},
\Delta^{burden},
\Delta^{right},
\Delta^{temporal},
\Delta^{authority}
).
} Δ ab = ( Δ sco p e , Δ co n d i t i o n , Δ e x ce pt i o n , Δ b u r d e n , Δ r i g h t , Δ t e m p or a l , Δ a u t h or i t y ) .
12. 最危險的是 Exception Loss
自然語言法律常有:
除外;
但書;
reasonable;
unless;
subject to;
proportionality;
necessity。
如果 formalization 只抓主規則:
R R R
卻漏掉:
E 1 , E 2 , … , E_1,E_2,\ldots, E 1 , E 2 , … ,
會產生:
Exception Loss . \boxed{
\text{Exception Loss}.
} Exception Loss .
這可能比普通 bug 更危險,
因為程式仍然「正確執行」。
13. 正確執行錯誤法律模型
這是 AI 法律最重要的失敗模式:
P r o g r a m C o r r e c t = 1 ∧ L e g a l M o d e l C o r r e c t = 0. \boxed{
ProgramCorrect=1
\land
LegalModelCorrect=0.
} P r o g r am C or r ec t = 1 ∧ L e g a l M o d e l C or r ec t = 0.
所以:
software verification ≠ legal semantic verification . \boxed{
\text{software verification}
\neq
\text{legal semantic verification}.
} software verification = legal semantic verification .
兩種 QA 必須分開。
14. Machine-Readable 不等於 Machine-Decidable
定義:
M R ( L ) = 1 MR(L)=1 M R ( L ) = 1
表示 machine-readable。
M D ( L ) = 1 MD(L)=1 M D ( L ) = 1
表示 machine-decidable。
一般:
M R ( L ) = 1 ⇏ M D ( L ) = 1. \boxed{
MR(L)=1
\not\Rightarrow
MD(L)=1.
} M R ( L ) = 1 ⇒ M D ( L ) = 1.
例如:
是否合理?
可以被 machine-readable 標記,
但不表示存在唯一演算法立即決定。
15. Machine-Decidable 不等於 Legally Final
即使:
M D ( q ) = 1 , MD(q)=1, M D ( q ) = 1 ,
例如:
A g e ≥ 18 , Age\ge18, A g e ≥ 18 ,
仍可能存在:
data error;
exception;
jurisdiction issue;
constitutional challenge。
所以:
decidable fact ≠ final legal judgment . \boxed{
\text{decidable fact}
\neq
\text{final legal judgment}.
} decidable fact = final legal judgment .
16. Machine-Executable 不等於 Legally Authoritative
一條 machine rule:
M M M
可以控制:
welfare;
tax;
access;
permit。
但它可能只是 agency implementation。
因此:
E x e c u t i o n P o w e r ( M ) ⇏ N o r m a t i v e A u t h o r i t y ( M ) . \boxed{
ExecutionPower(M)
\not\Rightarrow
NormativeAuthority(M).
} E x ec u t i o n P o w er ( M ) ⇒ N or ma t i v e A u t h or i t y ( M ) .
17. Operational Law Capture
如果:
L M L_M L M
長期實際控制全部結果,
而:
L H L_H L H
只存在於紙面,
可能形成:
Operational Law Capture . \boxed{
\text{Operational Law Capture}.
} Operational Law Capture .
此時:
d e j u r e = L H , de\ jure
=
L_H, d e j u r e = L H ,
但:
d e f a c t o ≈ L M . de\ facto
\approx
L_M. d e f a c t o ≈ L M .
這是 AI 法治最大的制度風險之一。
18. Shadow Law
本文定義:
L s h a d o w = L M − V e r i f i e d M a p p i n g ( L H ) . \boxed{
L_{shadow}
=
L_M
-
VerifiedMapping(L_H).
} L s ha d o w = L M − V er i f i e d M a pp in g ( L H ) .
即:
機器實際執行,但無法明確追溯至合法來源的規則。
要求:
L s h a d o w → 0. \boxed{
L_{shadow}
\rightarrow0.
} L s ha d o w → 0.
高風險公共系統尤其如此。
19. Unknown 不可被 AI 自動補完
假設:
L H L_H L H
存在歧義:
A ∨ B ? A\lor B? A ∨ B ?
AI 不能:
Guess → L F \boxed{
\operatorname{Guess}
\rightarrow
L_F
} Guess → L F
然後不標記。
應輸出:
U n r e s o l v e d L e g a l N o d e . \boxed{
UnresolvedLegalNode.
} U n r eso l v e d L e g a l N o d e .
並路由至:
human legal review;
authorized interpretation;
judicial process;
legislative amendment。
20. Ambiguity Token
本文提出:
α l a w = ( T e x t S p a n , I n t e r p r e t a t i o n s , A u t h o r i t y N e e d e d , R i s k , T e m p o r a r y D e f a u l t ) . \boxed{
\alpha^{law}
=
(
TextSpan,
Interpretations,
AuthorityNeeded,
Risk,
TemporaryDefault
).
} α l a w = ( T e x tS p an , I n t er p r e t a t i o n s , A u t h or i t y N ee d e d , R i s k , T e m p or a r y D e f a u l t ) .
這是一個法律歧義 token。
因此 compiler 可以說:
這裡不能安全編譯。
而不是幻覺式完成。
21. 編譯器不能成為立法者
Legal Compiler:
C L \mathcal C_L C L
可以:
parse;
align;
formalize;
detect contradiction;
generate test;
propose interpretation。
但:
C L ≠ Legislature . \boxed{
\mathcal C_L
\neq
\text{Legislature}.
} C L = Legislature .
AI 更不能用:
為了讓程式能跑
作為改變法律含義的理由。
22. Compilation Authority
定義:
A C A_C A C
為編譯權限。
至少區分:
Level 0
純草稿。
Level 1
技術 formalization。
Level 2
經法律專家驗證。
Level 3
行政授權使用。
Level 4
正式發布 machine-consumable companion rule。
即使 Level 4:
A C ≠ c o n s t i t u t i o n a l l a w m a k i n g a u t h o r i t y . \boxed{
A_C
\neq
constitutional lawmaking authority.
} A C = co n s t i t u t i o na l l a w mak in g a u t h or i t y .
23. Human Projection 與 Machine Projection 對稱
法律同時需要:
L H → L P \boxed{
L_H
\rightarrow
L_P
} L H → L P
讓人理解,
以及:
L H → L M \boxed{
L_H
\rightarrow
L_M
} L H → L M
讓機器處理。
這兩個都是 projection。
因此:
Human simplicity \boxed{
\text{Human simplicity}
} Human simplicity
與:
machine precision \boxed{
\text{machine precision}
} machine precision
都可能失真。
24. Cognitive Gap
定義:
G H M = d c o g ( H u m a n U n d e r s t a n d i n g ( L ) , M a c h i n e O p e r a t i o n a l R e p r e s e n t a t i o n ( L ) ) . \boxed{
G_{HM}
=
d_{cog}(
HumanUnderstanding(L),
MachineOperationalRepresentation(L)
).
} G H M = d co g ( H u man U n d er s t an d in g ( L ) , M a c hin e O p er a t i o na l R e p r ese n t a t i o n ( L )) .
當:
G H M ↑ , G_{HM}\uparrow, G H M ↑ ,
會出現:
人類不知道系統怎麼算;
技術人員不知道法律為何這樣寫;
法律人不知道程式如何執行;
AI 變成唯一跨層翻譯者。
這是一個治理危險點。
25. Translator Monopoly
如果只有:
A I ⋆ AI^\star A I ⋆
能理解:
L H , L F , L M , L_H,L_F,L_M, L H , L F , L M ,
則:
Translation Monopoly . \boxed{
\text{Translation Monopoly}.
} Translation Monopoly .
即使 AI 很準,
制度仍失去:
independent audit;
public reasoning;
plural interpretation;
contestability。
所以不能把跨層可理解性全部外包給一個 ASI。
26. 多編譯器一致性
可以建立:
C 1 , C 2 , … , C n C_1,C_2,\ldots,C_n C 1 , C 2 , … , C n
獨立 compiler。
比較:
L F ( 1 ) , L F ( 2 ) , … . L_F^{(1)},
L_F^{(2)},\ldots. L F ( 1 ) , L F ( 2 ) , … .
若:
L F ( 1 ) ≠ L F ( 2 ) , L_F^{(1)}
\neq
L_F^{(2)}, L F ( 1 ) = L F ( 2 ) ,
則產生:
C o m p i l e r D i s a g r e e m e n t . \boxed{
CompilerDisagreement.
} C o m p i l er D i s a g r ee m e n t .
而不是偷偷選一個。
這可成為法律 formalization 的 ensemble review。
27. Bidirectional Compilation
成熟系統不只:
L H → L F . L_H\rightarrow L_F. L H → L F .
還要:
L F → E x p l a i n ( L H ) . \boxed{
L_F
\rightarrow
Explain(L_H).
} L F → E x pl ain ( L H ) .
也就是 formal rule 必須能反向指出:
對應哪條文;
哪個 phrase;
哪個例外;
哪個解釋來源。
這稱為:
B i d i r e c t i o n a l L e g a l T r a c e a b i l i t y . \boxed{
Bidirectional Legal Traceability.
} B i d i r ec t i o na l L e g a l T r a ce abi l i t y .
28. Round-Trip Test
定義:
R T ( L H ) = D ( L H , E x p l a i n ( C o m p i l e ( L H ) ) ) . \boxed{
RT(
L_H
)
=
D(
L_H,
Explain(
Compile(
L_H
)
)
).
} R T ( L H ) = D ( L H , E x pl ain ( C o m p i l e ( L H ))) .
若:
R T ≫ 0 , RT\gg0, R T ≫ 0 ,
表示法律編譯 round-trip 語義損失高。
這不是完整法律真理 metric,
但可作 QA。
29. Simulation Before Deployment
法律若已 formalized,
不應直接:
C o m p i l e → D e p l o y . Compile
\rightarrow
Deploy. C o m p i l e → D e pl oy .
而應:
C o m p i l e → S i m u l a t e → R e v i e w → D e p l o y . \boxed{
Compile
\rightarrow
Simulate
\rightarrow
Review
\rightarrow
Deploy.
} C o m p i l e → S im u l a t e → R e v i e w → D e pl oy .
Simulation 可使用:
synthetic population;
historical cases;
adversarial cases;
edge cases;
protected groups。
30. Counterfactual Legislation
對候選法律:
R 1 , R 2 . R_1,R_2. R 1 , R 2 .
可以:
S i m ( R 1 , C ) Sim(R_1,C) S im ( R 1 , C )
與:
S i m ( R 2 , C ) Sim(R_2,C) S im ( R 2 , C )
比較:
burden;
cost;
error;
rights impact;
distribution。
所以:
law drafting \boxed{
\text{law drafting}
} law drafting
第一次可更接近:
test-driven governance . \boxed{
\text{test-driven governance}.
} test-driven governance .
31. Test-Driven Law 的限制
不能變成:
simulation 得分最高的法律就是正義。
因為:
Simulation ≠ Legitimacy . \boxed{
\text{Simulation}
\neq
\text{Legitimacy}.
} Simulation = Legitimacy .
模擬只提供後果證據。
價值選擇仍需要:
public deliberation;
rights;
political decision;
constitutional constraints。
32. Legal Test Suite
本文提出:
T l a w = ( T n o r m a l , T e d g e , T e x c e p t i o n , T r i g h t s , T b i a s , T t e m p o r a l , T c o n f l i c t ) . \boxed{
T^{law}
=
(
T_{normal},
T_{edge},
T_{exception},
T_{rights},
T_{bias},
T_{temporal},
T_{conflict}
).
} T l a w = ( T n or ma l , T e d g e , T e x ce pt i o n , T r i g h t s , T bia s , T t e m p or a l , T co n f l i c t ) .
每次法律版本:
v k v_k v k
都必須跑:
T l a w . T^{law}. T l a w .
33. 法律更新與 dependency invalidation
如果:
L H v 1 → L H v 2 , L_H^{v1}
\rightarrow
L_H^{v2}, L H v 1 → L H v 2 ,
則所有:
L P , L F , L S , L M L_P,L_F,L_S,L_M L P , L F , L S , L M
依賴版本都需要標記:
P o t e n t i a l l y S t a l e . \boxed{
PotentiallyStale.
} P o t e n t ia l l y S t a l e .
不能:
改了法條,但程式下次有空再改。
34. Legal Dependency Graph
定義:
G L = ( V L , E d e p ) . \boxed{
G_L
=
(
V_L,
E_{dep}
).
} G L = ( V L , E d e p ) .
節點:
statute;
regulation;
judgment;
formal rule;
machine implementation;
guidance;
test suite。
法規變更:
Δ L \Delta L Δ L
應觸發:
InvalidateDependents ( Δ L ) . \boxed{
\operatorname{InvalidateDependents}(
\Delta L
).
} InvalidateDependents ( Δ L ) .
35. Version-Locked Decision
任何法律決定:
Y i Y_i Y i
必須保存:
L e g a l V e r s i o n ( Y i ) . \boxed{
LegalVersion(Y_i).
} L e g a l V er s i o n ( Y i ) .
否則未來無法知道:
這個結果是依哪個版本產生?
這是動態正義的必要條件。
36. 法律編譯證書
本文提出:
C L C L = ( S o u r c e V e r s i o n , L H , L P , L F , L M , T e s t S u i t e , S i m u l a t i o n , Δ , U n r e s o l v e d , V a l i d a t o r s , A u t h o r i t y , D e p l o y V e r s i o n ) . \boxed{
\mathfrak C^{LCL}
=
(
SourceVersion,
L_H,
L_P,
L_F,
L_M,
TestSuite,
Simulation,
\mathbf\Delta,
Unresolved,
Validators,
Authority,
DeployVersion
).
} C L C L = ( S o u r ce V er s i o n , L H , L P , L F , L M , T es tS u i t e , S im u l a t i o n , Δ , U n r eso l v e d , V a l i d a t or s , A u t h or i t y , D e pl oy V er s i o n ) .
任何 machine legal rule 都應可回答:
來源是什麼?
誰編譯?
誰驗證?
哪些地方未決?
哪些 test 通過?
對應哪個 runtime 版本?
37. Personal Legal Projection
對個體:
i i i
應生成:
P i l a w = ( A p p l i c a b l e R u l e s , U s e d F a c t s , D e r i v e d F a c t s , O u t c o m e , R e a s o n , R i g h t s , A p p e a l ) . \boxed{
P_i^{law}
=
(
ApplicableRules,
UsedFacts,
DerivedFacts,
Outcome,
Reason,
Rights,
Appeal
).
} P i l a w = ( A ppl i c ab l e R u l es , U se d F a c t s , D er i v e d F a c t s , O u t co m e , R e a so n , R i g h t s , A pp e a l ) .
這就是上一篇 RightToLegalProjection 的具體化。
38. AI Explanation 不能只有自然語言理由
若 AI 說:
因為依相關規定,所以你不符合資格。
這只是 narrative。
真正 explanation 應包含:
Rule ID + Fact ID + Derivation + Exception Check + Version . \boxed{
\text{Rule ID}
+
\text{Fact ID}
+
\text{Derivation}
+
\text{Exception Check}
+
\text{Version}.
} Rule ID + Fact ID + Derivation + Exception Check + Version .
39. Explainability 與 Legal Traceability 不同
Explainability ≠ Legal Traceability . \boxed{
\text{Explainability}
\neq
\text{Legal Traceability}.
} Explainability = Legal Traceability .
一個 AI 可以生成很好懂的解釋,
但仍可能沒有:
真正法源;
正確版本;
正確 derivation。
所以法律系統更需要 traceability。
40. Human Override 也必須可審計
不能形成:
AI 有記錄,人類可以隨便改。
人類 override:
H o v e r r i d e H_{override} H o v er r i d e
也需要:
authority;
reason;
evidence;
scope;
expiry。
因此:
Human-in-the-loop ≠ unaccountable human discretion . \boxed{
\text{Human-in-the-loop}
\neq
\text{unaccountable human discretion}.
} Human-in-the-loop = unaccountable human discretion .
41. Legal Open World
很多法律問題不能封閉為:
W o r l d = D a t a b a s e . World=Database. W or l d = D a t aba se .
因為可能出現:
新事實;
新判例;
新技術;
新權利衝突;
constitutional challenge。
所以:
Legal System = Open-World System . \boxed{
\text{Legal System}
=
\text{Open-World System}.
} Legal System = Open-World System .
machine layer 必須容許:
U n k n o w n , D i s p u t e , N o v e l C a s e . Unknown,
Dispute,
NovelCase. U nk n o w n , D i s p u t e , N o v e l C a se .
42. Novel Case Gate
如果:
C a s e i ∉ C o v e r a g e ( L F ) , Case_i
\notin
Coverage(L_F), C a s e i ∈ / C o v er a g e ( L F ) ,
系統不能硬套最近 rule。
應:
N o v e l C a s e → H u m a n / J u d i c i a l R e v i e w . \boxed{
NovelCase
\rightarrow
Human / Judicial Review.
} N o v e l C a se → H u man / J u d i c ia l R e v i e w .
這是防止算法類比過度的最低 gate。
43. Legal Compilation Pipeline
本文提出成熟流程:
Policy Intent → L H → L P → L F → L M → L S → Verification → Public / Legal Review → Authorized Runtime . \boxed{
\begin{aligned}
&\text{Policy Intent}\\
\rightarrow\;&L_H\\
\rightarrow\;&L_P\\
\rightarrow\;&L_F\\
\rightarrow\;&L_M\\
\rightarrow\;&L_S\\
\rightarrow\;&\text{Verification}\\
\rightarrow\;&\text{Public / Legal Review}\\
\rightarrow\;&\text{Authorized Runtime}.
\end{aligned}
} → → → → → → → → Policy Intent L H L P L F L M L S Verification Public / Legal Review Authorized Runtime .
其中 simulation 可以在 formalization 後反覆回饋到立法。
44. AI 的最佳角色
AI 可以成為:
Legal Compiler Assistant . \boxed{
\text{Legal Compiler Assistant}.
} Legal Compiler Assistant .
負責:
alignment;
formalization suggestion;
ambiguity detection;
test generation;
counterexample generation;
simulation;
explanation;
version diff。
但:
AI Compiler ≠ Legal Sovereign . \boxed{
\text{AI Compiler}
\neq
\text{Legal Sovereign}.
} AI Compiler = Legal Sovereign .
45. 六個核心命題
命題一:machine-readable 不等於 machine-decidable
M R = 1 ⇏ M D = 1. \boxed{
MR=1
\not\Rightarrow
MD=1.
} M R = 1 ⇒ M D = 1.
命題二:machine-executable 不等於 legally authoritative
E x e c u t i o n P o w e r ⇏ N o r m a t i v e A u t h o r i t y . \boxed{
ExecutionPower
\not\Rightarrow
NormativeAuthority.
} E x ec u t i o n P o w er ⇒ N or ma t i v e A u t h or i t y .
命題三:編譯必須保存語義責任
L a → L b ⇒ ∃ Γ a b l a w . \boxed{
L_a\rightarrow L_b
\Rightarrow
\exists\Gamma_{ab}^{law}.
} L a → L b ⇒ ∃ Γ ab l a w .
命題四:法律更新必須使下游規則失效待驗
Δ L H ⇒ I n v a l i d a t e ( L P , L F , L M , L S ) . \boxed{
\Delta L_H
\Rightarrow
Invalidate(
L_P,L_F,L_M,L_S
).
} Δ L H ⇒ I n v a l i d a t e ( L P , L F , L M , L S ) .
命題五:AI 不得把法律歧義靜默補完
A m b i g u i t y ⇒ U n r e s o l v e d N o d e \boxed{
Ambiguity
\Rightarrow
UnresolvedNode
} A mbi g u i t y ⇒ U n r eso l v e d N o d e
除非具有合法 interpretation authority。
命題六:法律模擬不能取代民主正當性
P r e d i c t i v e S u p e r i o r i t y ⇏ N o r m a t i v e L e g i t i m a c y . \boxed{
PredictiveSuperiority
\not\Rightarrow
NormativeLegitimacy.
} P r e d i c t i v e S u p er i or i t y ⇒ N or ma t i v e L e g i t ima cy .
46. 可否證條件
F1:多層表示增加的錯誤大於其收益
若五層同步成本導致更多 semantic drift,則需簡化層級。
F2:machine-readable companion 永遠無法保持與法律同步
若 dependency invalidation 與 validation 在現實政府中不可行,Rules as Code 的適用範圍應縮小。
F3:形式化法律無法處理足夠多公共服務
若可形式化部分極少,L_F 應被定位為局部工具而非核心基礎設施。
F4:法律 simulation 對真實後果預測極差
則 L S L_S L S 只能作邏輯測試,不應作政策效果評估。
F5:白話投影造成大量誤導
若 L P L_P L P 與 L H L_H L H 的 drift 難以控制,plain-language projection 必須更加顯著標記其非權威性。
47. 與動態正義的關係
上一篇已建立:
Y i = F R ⋆ ( θ i ) \boxed{
Y_i
=
F_{R^\star}(
\theta_i
)
} Y i = F R ⋆ ( θ i )
以及:
AI computes ≠ AI legitimizes . \boxed{
\text{AI computes}
\neq
\text{AI legitimizes}.
} AI computes = AI legitimizes .
並要求高風險法律具有 Public Specification、Test Cases、Versioning 與 Independent Audit。
本篇回答的是:
F R ⋆ F_{R^\star} F R ⋆ 到底如何從人類法律安全地變成機器能執行的東西?
答案不是一跳:
L H → C o d e . L_H
\rightarrow
Code. L H → C o d e .
而是:
L H ↔ L P ↔ L F ↔ L M ↔ L S \boxed{
L_H
\leftrightarrow
L_P
\leftrightarrow
L_F
\leftrightarrow
L_M
\leftrightarrow
L_S
} L H ↔ L P ↔ L F ↔ L M ↔ L S
的可追蹤編譯網。
48. 下一篇:前沿決策域 X
一旦法律、政策與模擬都能被 AI 高度形式化,
下一個問題會立刻出現:
如果 AI 比人類更懂法律後果、更會模擬政策、更能預測風險,那麼決策權是否也應隨知識能力一起轉移?
這就是:
Epistemic Competence = ? Political Authority . \boxed{
\text{Epistemic Competence}
\stackrel{?}{=}
\text{Political Authority}.
} Epistemic Competence = ? Political Authority .
下一篇將建立:
X t = H ∪ H + ∪ A I ∪ Σ H − A I ∪ Σ A I . \boxed{
\mathcal X_t
=
H
\cup
H^+
\cup
AI
\cup
\Sigma_{H-AI}
\cup
\Sigma_{AI}.
} X t = H ∪ H + ∪ A I ∪ Σ H − A I ∪ Σ A I .
正式研究:
03 / 08〈前沿決策域 X:人類、AI 與混合智能的權力集合〉 。
49. 結論
AI 時代的法律最大風險之一,
不是 AI 完全看不懂法律。
反而可能是:
AI 與機器系統越來越能執行法律, 但人類越來越不知道它實際執行的是哪一個法律版本。 \boxed{
\text{AI 與機器系統越來越能執行法律,
但人類越來越不知道它實際執行的是哪一個法律版本。}
} AI 與機器系統越來越能執行法律, 但人類越來越不知道它實際執行的是哪一個法律版本。
因此真正需要的不是:
Law → AI . \boxed{
\text{Law}
\rightarrow
\text{AI}.
} Law → AI .
而是:
Law → Versioned Compilation → Simulation → Verification → Authorized Execution → Contestable Explanation . \boxed{
\text{Law}
\rightarrow
\text{Versioned Compilation}
\rightarrow
\text{Simulation}
\rightarrow
\text{Verification}
\rightarrow
\text{Authorized Execution}
\rightarrow
\text{Contestable Explanation}.
} Law → Versioned Compilation → Simulation → Verification → Authorized Execution → Contestable Explanation .
五層結構:
L = ( L H , L P , L F , L S , L M ) \boxed{
L
=
(
L_H,
L_P,
L_F,
L_S,
L_M
)
} L = ( L H , L P , L F , L S , L M )
的目的不是把法律變成程式,
而是防止法律在變成程式的途中失去自己。
所以本文最後的核心句是:
機器可以執行法律, 但機器版本不得因為最常被執行, 就悄悄成為最高法律。 \boxed{
\text{機器可以執行法律,
但機器版本不得因為最常被執行,
就悄悄成為最高法律。}
} 機器可以執行法律, 但機器版本不得因為最常被執行, 就悄悄成為最高法律。
只有當每一層都能回到法源、看到差異、承認未決、接受申訴並重新編譯時,
AI 才可能真正成為法治的編譯器,
而不是法治的替代者。
參考文獻與研究對照
Mohun, J., & Roberts, A. (2020). Cracking the Code: Rulemaking for Humans and Machines . OECD Working Papers on Public Governance, No. 42.
New Zealand Digital Government (2018). Better Rules for Government Discovery Report .
OECD (2025). Tax Administration Digitalisation and Digital Transformation Initiatives — Tax Rule Management and Application .
OASIS (2018). Akoma Ntoso Version 1.0 .
OASIS (2021). LegalRuleML Core Specification Version 1.0 .
Zin, M.-M. et al. (2026). Can Legislation Be Made Machine-Readable in PROLEG? arXiv:2601.01477.
Ma, M., & Wilson, B. (2021). The Legislative Recipe: Syntax for Machine-Readable Legislation . arXiv:2108.08678.
Ugarte, R. C. et al. (2026). Making AI Compliance Evidence Machine-Readable . arXiv:2604.13767.
Neo.K with Aletheia (2026). 動態正義:形式平等、實質負擔與個體化規則 . EveMissLab.
Neo.K with Aletheia (2026). 可不可論的失效域:十七項對抗性反例、反偽裝條件與最低決策核心 . EveMissLab.
附錄 A:第一代符號表
符號
含義
L H L_H L H
Human Legal Text
L P L_P L P
Plain-Language Legal Projection
L F L_F L F
Formal / Computable Legal Rule
L S L_S L S
Simulation Layer
L M L_M L M
Machine-Readable / Processable Legal Representation
C a b C_{ab} C ab
法律跨層編譯器
Γ a b l a w \Gamma_{ab}^{law} Γ ab l a w
跨層語義見證
Δ a b s e m \Delta_{ab}^{sem} Δ ab se m
Legal Semantic Drift
Δ a b \mathbf\Delta_{ab} Δ ab
多維法律語義差異
α l a w \alpha^{law} α l a w
Ambiguity Token
G L G_L G L
Legal Dependency Graph
G H M G_{HM} G H M
Human–Machine Legal Cognitive Gap
L s h a d o w L_{shadow} L s ha d o w
無法追溯至合法來源的 operational shadow law
T l a w T^{law} T l a w
Legal Test Suite
C L C L \mathfrak C^{LCL} C L C L
Legal Compilation Certificate
P i l a w P_i^{law} P i l a w
Personal Legal Projection
附錄 B:系列位置
系列三:《不可永佔:後 ASI 文明的動態治理、現場主權與權力制衡》
動態正義:形式平等、實質負擔與個體化規則
本文|AI 時代的法律編譯層:人類法律、機器法律與認知落差
前沿決策域 X X X :人類、AI 與混合智能的權力集合
動態現場域:為什麼最強智能仍未必最懂當下
現場主權:全域智能與局部決策權的動態配置
類神 ASI 的治理悖論:全知、全域覆蓋與反烏托邦邊界
可不可治理:能力不推出權力,權力不推出意圖
不可永佔:從權力制衡到《無無極篇》的後 ASI 憲政原理
本篇狀態:完成 v0.1。