# 第 21596 題：上下文無關文法

[返回所在分頁 108](https://ocme.evemisslab.com/zh-Hant/questions/page/108/)

[← 逐題詳解目錄](https://ocme.evemisslab.com/zh-Hant/questions/) · [原題批次](https://ocme.evemisslab.com/zh-Hant/practice/batch-20261014-advance-20261109-r07-context-free-grammar-foundations/#q-20261014-advance-20261109-r07-context-free-grammar-0021)

本頁是已完成第二對話 AI 數理與中英語義覆核的教學詳解，只支持本題明示的模型與前提。沒有人工審查或新 Lean 證明，也不提升原題或 MKO 的 Canonical 真值狀態。

R0042-21596 · q-20261014-advance-20261109-r07-context-free-grammar-0021



## 原題與已知條件

finite disjoint nonterminals/terminals、start與complete production set。操作=cfg-qualification；資料={"nonterminals":["S20","A20"],"terminals":["a20","b20"],"start":"S20","productions":[["S20",["a20","A20"]],["A20",["b20","A20"]],["A20",[]]],"allow_epsilon":true}。請依 exact_ordered_tuple_declared_by_interface 欄序回答。


- G001 — finite disjoint nonterminals/terminals、start與complete production set。操作=cfg-qualification；資料={"nonterminals":["S20","A20"],"terminals":["a20","b20"],"start":"S20","productions":[["S20",["a20","A20"]],["A20",["b20","A20"]],["A20",[]]],"allow_epsilon":true}。請依 exact_ordered_tuple_declared_by_interface 欄序回答。





## 定義與適用範圍

沿用原題明示的論域、假設與來源 MKO 定義。本題已完成第二對話數理與中英語義覆核，並由原始參數逐題獨立重算模型、答案與每個算術步驟；原題仍為 candidate。


- [mko-context-free-grammar](https://ocme.evemisslab.com/zh-Hant/mko/mko-context-free-grammar/)





## 逐步推導

S001 · implies操作前

source operation=cfg-qualification;original snapshot and mathematics retained

操作後

explicit ordered source output fields=[nonterminals, terminals, start, productions, allow_epsilon, grammar_qualified, certificate]

條件：無

原題歷史介面標記保留，本頁直接列來源有序欄位，不需JavaScript。tag不是額外證據，固定No保留其原聲稱範圍。

步驟識別與依賴規則：source_ordered_interface_explicit_without_javascript · 依賴：G001





S002 · implies操作前

ORIGINAL production index=0;lhs=S20,rhs=[a20, A20];N=[S20, A20],T=[a20, b20],allow_epsilon=是

操作後

lhs is ONE declared nonterminal;every rhs symbol legal;empty rhs accepted ONLY under the explicit epsilon convention;original production position retained

條件：無

每條production左邊只有一個非終結符；右邊逐symbol核合法，空右邊依明示epsilon慣例。重複production位置可存在，不能排序改變首witness索引。

步驟識別與依賴規則：cfg_each_original_production_single_nonterminal_legal_rhs · 依賴：G001, S001





S003 · implies操作前

ORIGINAL production index=1;lhs=A20,rhs=[b20, A20];N=[S20, A20],T=[a20, b20],allow_epsilon=是

操作後

lhs is ONE declared nonterminal;every rhs symbol legal;empty rhs accepted ONLY under the explicit epsilon convention;original production position retained

條件：無

每條production左邊只有一個非終結符；右邊逐symbol核合法，空右邊依明示epsilon慣例。重複production位置可存在，不能排序改變首witness索引。

步驟識別與依賴規則：cfg_each_original_production_single_nonterminal_legal_rhs · 依賴：G001, S002





S004 · implies操作前

ORIGINAL production index=2;lhs=A20,rhs=[];N=[S20, A20],T=[a20, b20],allow_epsilon=是

操作後

lhs is ONE declared nonterminal;every rhs symbol legal;empty rhs accepted ONLY under the explicit epsilon convention;original production position retained

條件：無

每條production左邊只有一個非終結符；右邊逐symbol核合法，空右邊依明示epsilon慣例。重複production位置可存在，不能排序改變首witness索引。

步驟識別與依賴規則：cfg_each_original_production_single_nonterminal_legal_rhs · 依賴：G001, S003





S005 · implies操作前

ORIGINAL unique disjoint N=[S20, A20],T=[a20, b20];start=S20;complete productions=[[S20, [a20, A20]], [A20, [b20, A20]], [A20, []]];allow_epsilon=是

操作後

start belongs to nonterminals;finite grammar qualified;NO derivation,membership,regularity,unambiguity or PDA equivalence inferred

條件：無

定義合格只是文法的資格，不自動有某個word的推導，也不推regular、unambiguous等額外性質。非終結符／終結符順序保原輸入。

步驟識別與依賴規則：cfg_qualified_alphabets_start_not_language_property · 依賴：G001, S004









## 逐步反向核對


- S005 · premise_and_result_audit — 回到原始資料與本步條件核對，不把單向推論誤稱等價。
- S004 · premise_and_result_audit — 回到原始資料與本步條件核對，不把單向推論誤稱等價。
- S003 · premise_and_result_audit — 回到原始資料與本步條件核對，不把單向推論誤稱等價。
- S002 · premise_and_result_audit — 回到原始資料與本步條件核對，不把單向推論誤稱等價。
- S001 · premise_and_result_audit — 回到原始資料與本步條件核對，不把單向推論誤稱等價。





## 結論

([S20, A20], [a20, b20], S20, [[S20, [a20, A20]], [A20, [b20, A20]], [A20, []]], 是, 是, finite_disjoint_alphabets_single_nonterminal_lhs)

依上列完整代值及條件核對得到原題答案；原題編號、格式與狀態保持不變。





## 本題覆核與來源綁定

覆核日期：2026-10-26

原題、答案、步驟表達式、數值 AST 與既有歷史保持原樣；原來的候選狀態屬於來源歷史，不覆寫為形式化證明。

來源雜湊與覆核憑證
- input commit: 0f7be61e2c22317a4075561dc822c87d881a50db
- original question SHA-256: f5db0c52a397395ba3288ecf38f86d86f98137c765f14c86c7aca5ea42765c89
- candidate record SHA-256: 74596d67e54b0ed246e59fe2b29335e508f470d1c84f691ec78541cdba31a661
- semantic review receipt SHA-256: dd44555041dfbb6fe9936aa00b9a5f8c5982c2784ef61dd0cbd5d1a303a49c1a
- question-first witness SHA-256: 9a6011263f6ac53b9a1fd57addf2f3e2f6088b54802c539f332d689480dc2d17
- Lean: NOT_RUN · human review: NOT_PERFORMED

[同源完整 JSON](https://ocme.evemisslab.com/data/question-derivations/questions/q-20261014-advance-20261109-r07-context-free-grammar-0021.json)




