{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-computational-model-01",
  "mko_id": "mko-computational-model",
  "title": {
    "zh-Hant": "抽象計算模型：在七狀態模型中截斷停止邊、計算可達集並區分停止、卡住與不終止",
    "en": "Abstract computational model: truncating halt edges, computing reachability and separating halting, stuck and non-terminating runs in a seven-state model"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-computational-model-01",
    "source": {
      "mko_id": "mko-computational-model",
      "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
      "sha256": "ceedb5463ff015fc7cd0f74870bfb9033cfb9a8ff893490b0335fe4bf9112ace",
      "english_sha256": "ebf84673ae14cdac5d40d5169fdf883572ebfb975b108019f7d01964682ca3ef"
    },
    "mode": "worked_example",
    "audience_prerequisites": [
      "set_operations_def",
      "cartesian_product_def",
      "subset_def",
      "nat_induction",
      "finite_counting_basics"
    ],
    "goal": {
      "zh-Hant": "給定有限模型 (S,Init,Step,Halt)：S={s0,s1,s2,s3,s4,s5,s6}，Init={s0}，Halt={s3}，原始邊資料 {(s0,s1),(s0,s2),(s1,s3),(s1,s5),(s2,s4),(s4,s2),(s3,s6)}。依 MKO 規則截斷停止狀態的外出邊，以不動點迭代算出可達集，找出停止狀態、卡住狀態與可達循環，給出合法的停止、卡住與無窮執行，排除三條不合法的 trace，並說明為何尚未窮盡可達圖的有限深度探索，不能僅憑未見反例就斷言所有極大執行終止。",
      "en": "Given the finite model (S,Init,Step,Halt) with S={s0,s1,s2,s3,s4,s5,s6}, Init={s0}, Halt={s3} and raw edge data {(s0,s1),(s0,s2),(s1,s3),(s1,s5),(s2,s4),(s4,s2),(s3,s6)}: truncate edges out of halt states as the MKO requires, compute the reachable set by fixpoint iteration, identify halt states, stuck states and reachable cycles, exhibit legal halting, stuck and infinite executions, rule out three illegal traces, and explain why depth-bounded exploration that has not exhausted the reachable graph cannot certify termination of all maximal executions merely from the absence of an observed counterexample."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "S={s0,s1,s2,s3,s4,s5,s6}，Init={s0}，Halt={s3}（MKO 假設 a1：S 明示有限）。",
          "en": "S={s0,s1,s2,s3,s4,s5,s6}, Init={s0}, Halt={s3} (MKO assumption a1: S is explicitly finite)."
        }
      },
      {
        "id": "G2",
        "statement": {
          "zh-Hant": "原始邊資料 E_raw={(s0,s1),(s0,s2),(s1,s3),(s1,s5),(s2,s4),(s4,s2),(s3,s6)}。",
          "en": "Raw edge data E_raw={(s0,s1),(s0,s2),(s1,s3),(s1,s5),(s2,s4),(s4,s2),(s3,s6)}."
        }
      },
      {
        "id": "G3",
        "statement": {
          "zh-Hant": "執行約定（MKO 假設 a2 與第二段）：分析前刪去所有從 Halt 狀態出發的邊，得到 Step。執行是以 ℕ 的一個起始段（有限或全部 ℕ）為索引的狀態序列 (t_i)，t_0∈Init，相鄰兩項 (t_i,t_{i+1})∈Step；進入 Halt 即結束。有限執行若末狀態沒有 Step 後繼則稱為極大；有限極大執行的末狀態在 Halt 中稱為停止，不在 Halt 中稱為卡住；無窮執行也視為極大。可延伸的有限前綴仍是合法執行，但不能因尚未到 Halt 就當成全域終止性的反例；全域終止性以下量化從 Init 出發的極大執行。",
          "en": "Execution conventions (MKO assumption a2 and paragraph 2): before analysis, delete every edge leaving a Halt state to obtain Step. An execution is a sequence of states (t_i) indexed by an initial segment of ℕ (finite or all of ℕ), with t_0∈Init and (t_i,t_{i+1})∈Step for consecutive terms; it ends on entering Halt. A finite execution is maximal if its last state has no Step-successor; a finite maximal execution halts if its last state is in Halt and is stuck otherwise; infinite executions are also maximal. Extendible finite prefixes remain legal executions, but not having reached Halt yet does not make such a prefix a counterexample to universal termination. Universal termination below quantifies over maximal executions from Init."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1",
          "G2"
        ],
        "before_tex": "\\mathrm{Init}=\\{s_0\\},\\ \\mathrm{Halt}=\\{s_3\\},\\ E_{\\mathrm{raw}}",
        "after_tex": "\\mathrm{Init},\\mathrm{Halt}\\subseteq S,\\ E_{\\mathrm{raw}}\\subseteq S\\times S",
        "relation": "implies",
        "rule": "subset_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "先檢查資料是否構成 MKO 的模型：s0 與 s3 都在 S 中，所以 Init、Halt⊆S；E_raw 的七個有序對，兩個分量都在 S 中，所以 E_raw⊆S×S。有序對保留方向，例如 (s2,s4) 與 (s4,s2) 是兩條不同的邊。",
          "en": "First check that the data form a model in the MKO's sense: s0 and s3 lie in S, so Init, Halt⊆S; each of the seven ordered pairs of E_raw has both components in S, so E_raw⊆S×S. Ordered pairs keep their direction; for example (s2,s4) and (s4,s2) are two different edges."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "subset_def",
            "cartesian_product_def"
          ],
          "explanation": {
            "zh-Hant": "每個元素與每條邊都逐一檢查；此步不推出任何執行性質。",
            "en": "Every element and every edge is checked; this step derives no execution property."
          }
        },
        "leaf_basis": "subset_def + cartesian_product_def + mko_computational_model_def"
      },
      {
        "id": "S02",
        "uses": [
          "S01",
          "G3"
        ],
        "before_tex": "E_{\\mathrm{raw}}",
        "after_tex": "\\mathrm{Step}=E_{\\mathrm{raw}}\\setminus\\{(s_3,s_6)\\}=\\{(s_0,s_1),(s_0,s_2),(s_1,s_3),(s_1,s_5),(s_2,s_4),(s_4,s_2)\\}",
        "relation": "implies",
        "rule": "set_operations_def",
        "conditions": [
          "\\mathrm{Halt}=\\{s_3\\}"
        ],
        "explanation": {
          "zh-Hant": "依 MKO 假設 a2，刪去所有從 Halt 狀態出發的邊。七條邊中只有 (s3,s6) 的起點 s3∈Halt，刪去後剩 6 條。資料中雖有 (s3,s6)，但模型規定到達 s3 即停止，這條邊不屬於執行語義。",
          "en": "By MKO assumption a2, delete every edge whose source is a Halt state. Of the seven edges only (s3,s6) starts at s3∈Halt; deleting it leaves 6 edges. Although the data contain (s3,s6), the model says execution stops on reaching s3, so this edge is not part of the execution semantics."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G3",
            "set_operations_def"
          ],
          "explanation": {
            "zh-Hant": "需要逐條檢查起點是否在 Halt；N1 重算邊數 7−1=6。",
            "en": "Each edge's source must be checked against Halt; N1 recomputes the edge count 7−1=6."
          }
        },
        "leaf_basis": "set_operations_def + numeric_evaluation"
      },
      {
        "id": "S03",
        "uses": [
          "S02",
          "mko_relation_def"
        ],
        "before_tex": "\\mathrm{Post}(s)=\\mathrm{Step}[\\{s\\}]",
        "after_tex": "\\mathrm{Post}:\\ s_0\\mapsto\\{s_1,s_2\\},\\ s_1\\mapsto\\{s_3,s_5\\},\\ s_2\\mapsto\\{s_4\\},\\ s_4\\mapsto\\{s_2\\},\\ s_3,s_5,s_6\\mapsto\\varnothing",
        "relation": "implies",
        "rule": "mko_relation_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "對每個狀態收集 Step 中以它為起點的邊的終點。s0 與 s1 各有兩個後繼，所以模型是非確定性的；s3、s5、s6 沒有後繼。後繼表是之後所有計算的基礎。",
          "en": "For each state collect the targets of the Step edges starting there. s0 and s1 each have two successors, so the model is nondeterministic; s3, s5 and s6 have no successors. This successor table underlies every later computation."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S02",
            "mko_relation_def"
          ],
          "explanation": {
            "zh-Hant": "六條邊恰好各被歸到其起點一次，2+2+1+1=6 與邊數一致（N2）。",
            "en": "Each of the six edges is assigned to its source exactly once; 2+2+1+1=6 agrees with the edge count (N2)."
          }
        },
        "leaf_basis": "mko_relation_def + set_builder"
      },
      {
        "id": "S04",
        "uses": [
          "S03",
          "reach_def"
        ],
        "before_tex": "R_0=\\mathrm{Init},\\ R_{k+1}=R_k\\cup\\mathrm{Step}[R_k]",
        "after_tex": "R_{m+1}=R_m\\ \\Rightarrow\\ \\mathrm{Reach}=R_m",
        "relation": "theorem_application",
        "rule": "L_fix",
        "conditions": [
          "S\\ \\text{finite}"
        ],
        "explanation": {
          "zh-Hant": "可達性是從 Init 出發沿 Step 的零步或多步閉包（MKO 第一段）。套用引理 L_fix（在 S04.1、S04.2 證明）：逐輪加入後繼，一旦某輪不再增加，當下的集合就是 Reach。因為 R_k 遞增且都在有限的 S 中，至多 |S|=7 輪後必定停止增加。",
          "en": "Reachability is the closure under zero or more Step moves starting from Init (MKO paragraph 1). Apply Lemma L_fix (proved in S04.1 and S04.2): add successors round by round, and as soon as a round adds nothing, the current set is Reach. Since R_k is increasing inside the finite S, it must stop growing within |S|=7 rounds."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "L_fix",
            "reach_def"
          ],
          "explanation": {
            "zh-Hant": "停止條件必須是 R_{m+1}=R_m 這個集合等式，不是「某輪沒有看到新的循環」之類的觀察。",
            "en": "The stopping condition must be the set equality R_{m+1}=R_m, not an observation such as 'no new cycle seen in some round'."
          }
        },
        "leaf_basis": "nat_induction + set_operations_def + reach_def"
      },
      {
        "id": "S04.1",
        "uses": [
          "reach_def",
          "nat_induction",
          "set_operations_def"
        ],
        "before_tex": "R_k",
        "after_tex": "R_k=\\{s\\mid s\\ \\text{reachable in at most}\\ k\\ \\text{steps}\\}",
        "relation": "induction_step",
        "rule": "nat_induction",
        "conditions": [],
        "explanation": {
          "zh-Hant": "對 k 歸納。k=0：零步可達恰是 Init=R_0。設對 k 成立。若 s 至多 k+1 步可達，則要嘛至多 k 步可達（在 R_k），要嘛路徑最後一步從某個至多 k 步可達的 u 走到 s，即 s∈Step[R_k]。反之 R_k 的元素至多 k 步可達，Step[R_k] 的元素由某個 u∈R_k 再走一步，至多 k+1 步可達。所以 R_{k+1} 恰是至多 k+1 步可達的集合，證得 (i)。",
          "en": "Induct on k. k=0: the states reachable in zero steps are exactly Init=R_0. Assume the claim for k. If s is reachable in at most k+1 steps, either it is reachable in at most k steps (so in R_k) or the last move of the path goes from some u reachable in at most k steps to s, i.e. s∈Step[R_k]. Conversely, elements of R_k are reachable in at most k steps, and elements of Step[R_k] are one move from some u∈R_k, hence reachable in at most k+1 steps. So R_{k+1} is exactly the set reachable in at most k+1 steps, proving (i)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "reach_def",
            "nat_induction",
            "set_operations_def",
            "mko_relation_def"
          ],
          "explanation": {
            "zh-Hant": "兩個包含方向都在歸納步中證明；基底用到零步路徑。",
            "en": "Both inclusions are proved in the induction step; the base uses zero-step paths."
          }
        },
        "leaf_basis": "nat_induction + set_operations_def + reach_def + mko_relation_def"
      },
      {
        "id": "S04.2",
        "uses": [
          "S04.1",
          "nat_induction"
        ],
        "before_tex": "R_{m+1}=R_m",
        "after_tex": "\\forall k\\ge m,\\ R_k=R_m;\\ \\mathrm{Reach}=\\textstyle\\bigcup_k R_k=R_m",
        "relation": "implies",
        "rule": "nat_induction",
        "conditions": [],
        "explanation": {
          "zh-Hant": "若 R_{m+1}=R_m，則 R_{m+2}=R_{m+1}∪Step[R_{m+1}]=R_m∪Step[R_m]=R_{m+1}=R_m，依歸納對所有 k≥m 都有 R_k=R_m。每個可達狀態都有某個長度 k 的路徑，由 (i) 它在 R_k 中；R_k 遞增，所以它在 R_{max(k,m)}=R_m 中。反之 R_m 的元素都可達。故 Reach=R_m，證得 (ii)。",
          "en": "If R_{m+1}=R_m then R_{m+2}=R_{m+1}∪Step[R_{m+1}]=R_m∪Step[R_m]=R_{m+1}=R_m, and by induction R_k=R_m for all k≥m. Every reachable state has a path of some length k, so by (i) it lies in R_k; since R_k is increasing, it lies in R_{max(k,m)}=R_m. Conversely every element of R_m is reachable. Hence Reach=R_m, proving (ii)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S04.1",
            "nat_induction",
            "set_extensionality"
          ],
          "explanation": {
            "zh-Hant": "論證需要 R_k 遞增（由定義 R_{k+1}⊇R_k）與 (i)。",
            "en": "The argument needs R_k to be increasing (R_{k+1}⊇R_k by definition) and (i)."
          }
        },
        "leaf_basis": "nat_induction + set_extensionality + set_operations_def"
      },
      {
        "id": "S05",
        "uses": [
          "S03",
          "S04"
        ],
        "before_tex": "R_0=\\{s_0\\}",
        "after_tex": "R_1=\\{s_0,s_1,s_2\\},\\ R_2=\\{s_0,s_1,s_2,s_3,s_4,s_5\\},\\ R_3=R_2\\ \\Rightarrow\\ \\mathrm{Reach}=R_2",
        "relation": "implies",
        "rule": "L_fix",
        "conditions": [],
        "explanation": {
          "zh-Hant": "R_1=R_0∪Post(s0)={s0,s1,s2}。R_2=R_1∪Post(s0)∪Post(s1)∪Post(s2)={s0,s1,s2}∪{s1,s2}∪{s3,s5}∪{s4}={s0,s1,s2,s3,s4,s5}。R_3 再加入 Post(s3)=∅、Post(s4)={s2}、Post(s5)=∅，沒有新狀態，R_3=R_2。依 L_fix，Reach=R_2，共 6 個狀態；s6 不可達。",
          "en": "R_1=R_0∪Post(s0)={s0,s1,s2}. R_2=R_1∪Post(s0)∪Post(s1)∪Post(s2)={s0,s1,s2}∪{s1,s2}∪{s3,s5}∪{s4}={s0,s1,s2,s3,s4,s5}. R_3 further adds Post(s3)=∅, Post(s4)={s2} and Post(s5)=∅, giving no new state, so R_3=R_2. By L_fix, Reach=R_2 with 6 states; s6 is unreachable."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "L_fix"
          ],
          "explanation": {
            "zh-Hant": "每輪都使用完整的後繼表；停止判定是集合等式 R_3=R_2（N3、N4 重算大小）。",
            "en": "Each round uses the complete successor table; the stop test is the set equality R_3=R_2 (N3, N4 recompute the sizes)."
          }
        },
        "leaf_basis": "set_operations_def + mko_relation_def + numeric_evaluation"
      },
      {
        "id": "S06",
        "uses": [
          "G2",
          "S05"
        ],
        "before_tex": "E_{\\mathrm{raw}}[R_2]",
        "after_tex": "s_6\\in E_{\\mathrm{raw}}[R_2]\\ \\text{but}\\ s_6\\notin\\mathrm{Reach}",
        "relation": "implies",
        "rule": "set_operations_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "對照：若忘記截斷而直接用 E_raw，第 3 輪會因 (s3,s6) 加入 s6，得出「全部 7 個狀態可達」，並把 s3 當成還能繼續走的狀態。這與 MKO 假設 a2 衝突。正確分析中 s6 不可達，s3 是執行的終點。",
          "en": "Contrast: if truncation is forgotten and E_raw is used directly, round 3 adds s6 through (s3,s6), giving 'all 7 states reachable' and treating s3 as a state that can continue. That contradicts MKO assumption a2. In the correct analysis s6 is unreachable and s3 is an endpoint of execution."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G2",
            "S02",
            "S05"
          ],
          "explanation": {
            "zh-Hant": "此步只顯示截斷前後結果不同，用來說明 S02 的必要性；不把 E_raw 的結果當作模型的結論。",
            "en": "This step only shows that the result differs with and without truncation, to justify S02; the E_raw result is not taken as a conclusion about the model."
          }
        },
        "leaf_basis": "set_operations_def + mko_relation_def"
      },
      {
        "id": "S07",
        "uses": [
          "S03",
          "S05",
          "G1"
        ],
        "before_tex": "\\mathrm{Reach}=\\{s_0,s_1,s_2,s_3,s_4,s_5\\}",
        "after_tex": "\\mathrm{Reach}\\cap\\mathrm{Halt}=\\{s_3\\},\\ \\{s\\in\\mathrm{Reach}\\setminus\\mathrm{Halt}\\mid\\mathrm{Post}(s)=\\varnothing\\}=\\{s_5\\}",
        "relation": "implies",
        "rule": "set_builder",
        "conditions": [],
        "explanation": {
          "zh-Hant": "可達狀態中，在 Halt 裡的只有 s3。不在 Halt 中又沒有後繼的只有 s5：它是卡住狀態。s3 也沒有後繼，但它在 Halt 中，所以是停止，不是卡住；反過來，s5 沒有後繼並不使它成為停止狀態（MKO 敘述）。s0、s1、s2、s4 都有後繼。",
          "en": "Among the reachable states, only s3 is in Halt. The only state not in Halt and without successors is s5: it is a stuck state. s3 also has no successors, but it is in Halt, so it halts rather than gets stuck; conversely, having no successors does not make s5 a halt state (the MKO statement). s0, s1, s2 and s4 all have successors."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "S05",
            "G1",
            "mko_computational_model_def"
          ],
          "explanation": {
            "zh-Hant": "分類只用 Halt 的給定列表與後繼表，不由「沒有後繼」推出屬於 Halt。",
            "en": "The classification uses only the given list Halt and the successor table, never inferring membership in Halt from having no successors."
          }
        },
        "leaf_basis": "set_builder + mko_computational_model_def"
      },
      {
        "id": "S08",
        "uses": [
          "G3",
          "S02"
        ],
        "before_tex": "(s_0,s_1,s_3)",
        "after_tex": "\\text{legal execution that halts at}\\ s_3",
        "relation": "implies",
        "rule": "mko_computational_model_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "檢查 trace (s0,s1,s3)：首狀態 s0∈Init；(s0,s1)、(s1,s3)∈Step；末狀態 s3∈Halt，執行在此結束。這是一條合法的停止執行。",
          "en": "Check the trace (s0,s1,s3): the first state s0∈Init; (s0,s1) and (s1,s3)∈Step; the last state s3∈Halt, where execution ends. This is a legal halting execution."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G3",
            "S02"
          ],
          "explanation": {
            "zh-Hant": "合法性的三個條件逐一檢查。一條停止執行不表示所有執行都停止（非確定性）。",
            "en": "The three legality conditions are checked one by one. One halting execution does not mean every execution halts (nondeterminism)."
          }
        },
        "leaf_basis": "mko_computational_model_def + exists_intro"
      },
      {
        "id": "S09",
        "uses": [
          "G3",
          "S02",
          "S07"
        ],
        "before_tex": "(s_0,s_1,s_5)",
        "after_tex": "\\text{legal maximal execution, stuck at}\\ s_5\\notin\\mathrm{Halt}",
        "relation": "implies",
        "rule": "mko_computational_model_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "(s0,s1,s5)：s0∈Init，(s0,s1)、(s1,s5)∈Step，所以合法；Post(s5)=∅，無法繼續，所以是極大執行；s5∉Halt，所以它卡住而沒有停止。",
          "en": "(s0,s1,s5): s0∈Init and (s0,s1), (s1,s5)∈Step, so it is legal; Post(s5)=∅, so it cannot continue and is maximal; s5∉Halt, so it is stuck rather than halted."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G3",
            "S02",
            "S07"
          ],
          "explanation": {
            "zh-Hant": "卡住的判定需要兩件事：沒有後繼，且不在 Halt。",
            "en": "Being stuck needs two facts: no successor, and not in Halt."
          }
        },
        "leaf_basis": "mko_computational_model_def + exists_intro"
      },
      {
        "id": "S10",
        "uses": [
          "G3",
          "S02",
          "G1"
        ],
        "before_tex": "t_0=s_0,\\ t_{2k+1}=s_2,\\ t_{2k+2}=s_4\\ (k\\ge 0)",
        "after_tex": "\\forall n\\ge 0,\\ (t_n,t_{n+1})\\in\\mathrm{Step},\\ t_n\\notin\\mathrm{Halt}",
        "relation": "case_split",
        "rule": "case_analysis",
        "conditions": [],
        "explanation": {
          "zh-Hant": "定義以全部 ℕ 為索引的序列：t0=s0，奇數位 t_{2k+1}=s2，正偶數位 t_{2k+2}=s4。對每個 n 分三種情況檢查相鄰對：n=0 時 (s0,s2)∈Step；n=2k+1 時 (t_n,t_{n+1})=(s2,s4)∈Step；n=2k+2 時 n+1=2(k+1)+1，所以 t_{n+1}=s2，(s4,s2)∈Step。三種情況涵蓋所有 n≥0。序列的狀態都在 {s0,s2,s4} 中，與 Halt 不相交，所以執行永不結束：這是一條合法的無窮執行，來自可達的非停止循環 s2→s4→s2。",
          "en": "Define a sequence indexed by all of ℕ: t0=s0, odd positions t_{2k+1}=s2, positive even positions t_{2k+2}=s4. Check consecutive pairs for every n in three cases: for n=0, (s0,s2)∈Step; for n=2k+1, (t_n,t_{n+1})=(s2,s4)∈Step; for n=2k+2, n+1=2(k+1)+1, so t_{n+1}=s2 and (s4,s2)∈Step. The three cases cover every n≥0. All states of the sequence lie in {s0,s2,s4}, disjoint from Halt, so the execution never ends: it is a legal infinite execution, coming from the reachable non-halting cycle s2→s4→s2."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G3",
            "S02",
            "case_analysis"
          ],
          "explanation": {
            "zh-Hant": "情況劃分必須涵蓋所有 n：0、正奇數、正偶數，三者互斥且窮盡。索引恆等式 (2k+2)+1=2(k+1)+1 由 N5 作一次多項式恆等式核對。",
            "en": "The case split must cover every n: 0, positive odd, positive even, which are mutually exclusive and exhaustive. The index identity (2k+2)+1=2(k+1)+1 is checked as a degree-one polynomial identity in N5."
          }
        },
        "leaf_basis": "case_analysis + nat_induction + mko_computational_model_def"
      },
      {
        "id": "S11",
        "uses": [
          "G3",
          "S02",
          "G1"
        ],
        "before_tex": "(s_0,s_3),\\ (s_1,s_3),\\ (s_0,s_1,s_3,s_6)",
        "after_tex": "\\text{none is a legal execution}",
        "relation": "implies",
        "rule": "mko_computational_model_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "三條不合法的 trace，各違反一個條件：(s0,s3) 中 (s0,s3)∉Step；(s1,s3) 的首狀態 s1∉Init；(s0,s1,s3,s6) 在進入 s3∈Halt 後還繼續，而 (s3,s6) 已被截斷，不在 Step 中（MKO 第二段：進入 Halt 就結束）。",
          "en": "Three illegal traces, each violating one condition: in (s0,s3), (s0,s3)∉Step; (s1,s3) starts at s1∉Init; (s0,s1,s3,s6) continues after entering s3∈Halt, and (s3,s6) has been truncated and is not in Step (MKO paragraph 2: entering Halt ends the execution)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G3",
            "S02",
            "G1"
          ],
          "explanation": {
            "zh-Hant": "每條 trace 只需指出一個違反的條件即可排除。",
            "en": "Each trace is ruled out by naming one violated condition."
          }
        },
        "leaf_basis": "mko_computational_model_def + quantifier_negation"
      },
      {
        "id": "S12",
        "uses": [
          "S09",
          "S10"
        ],
        "before_tex": "\\text{stuck execution (S09)},\\ \\text{infinite execution (S10)}",
        "after_tex": "\\neg(\\text{every maximal execution from Init halts})",
        "relation": "implies",
        "rule": "quantifier_negation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "「每條從 Init 出發的極大執行都停止」是全稱命題。S09 給出一條卡住的有限極大執行，S10 給出一條無窮極大執行；任一個都足以否定它。因此本模型不具全域終止性，儘管 S08 有一條停止執行。可延伸的有限前綴本身不算此全稱命題的反例。",
          "en": "'Every maximal execution from Init halts' is a universal statement. S09 gives a stuck finite maximal execution and S10 an infinite maximal execution; either refutes it. Thus this model is not universally terminating, although S08 gives one halting run. An extendible finite prefix is not by itself a counterexample to this property."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S09",
            "S10",
            "quantifier_negation"
          ],
          "explanation": {
            "zh-Hant": "否定全稱只需一個反例；這裡有兩種不同性質的反例，分別對應 MKO 第三段的兩種終止性風險。",
            "en": "Refuting a universal statement needs one counterexample; here there are two of different kinds, matching the two termination risks in MKO paragraph 3."
          }
        },
        "leaf_basis": "quantifier_negation + exists_intro"
      },
      {
        "id": "S13",
        "uses": [
          "S03",
          "S12"
        ],
        "before_tex": "\\text{prefixes of depth}\\ 1:\\ (s_0,s_1),\\ (s_0,s_2)",
        "after_tex": "\\text{no cycle or stuck state visible at depth 1, yet termination fails}",
        "relation": "implies",
        "rule": "quantifier_negation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "只探索深度 1 時，看到的前綴只有 (s0,s1) 與 (s0,s2)，其中尚未顯示循環或卡住狀態。若僅據此斷言「所有極大執行都終止」就錯了：S12 已給出反例。這裡否定的是尚未窮盡可達圖的觀察所作的推論，不是所有有限探索證書；完整探索有限可達圖並檢查循環與非 Halt 的死端，可以支持相應判定。本模型的完整可達圖（S05、S07、S10）揭示了兩種風險。",
          "en": "At depth 1 the observed prefixes are only (s0,s1) and (s0,s2), with no cycle or stuck state yet displayed. Inferring that every maximal execution halts merely from these observations would be wrong: S12 supplies counterexamples. The rejected inference uses observations that have not exhausted the reachable graph; it does not reject every finite exploration certificate. Exhaustively exploring a finite reachable graph and checking cycles and non-Halt dead ends can support the corresponding decision. The complete graph here (S05, S07, S10) reveals both risks."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "S12"
          ],
          "explanation": {
            "zh-Hant": "此步只指出尚未窮盡可達圖的深度受限觀察，不能僅憑未見反例推出所有極大執行終止；不否定完整有限圖證書，也不宣稱一般程式有終止判定法。",
            "en": "This step rejects inferring termination of all maximal executions merely from the absence of counterexamples in a non-exhaustive depth-bounded observation. It neither rejects complete finite-graph certificates nor claims a general termination decision method for programs."
          }
        },
        "leaf_basis": "quantifier_negation + mko_computational_model_def"
      }
    ],
    "result": {
      "zh-Hant": "截斷後 Step 有 6 條邊；Reach={s0,s1,s2,s3,s4,s5}，s6 不可達。s3 是唯一可達的停止狀態，s5 是卡住狀態（沒有後繼但不在 Halt），{s2,s4} 是可達的非停止循環。(s0,s1,s3) 停止，(s0,s1,s5) 卡住，s0 之後在 s2、s4 間無窮交替的序列是無窮執行；(s0,s3)、(s1,s3)、(s0,s1,s3,s6) 都不合法。所以並非所有從 Init 出發的極大執行都停止，深度 1 的探索看不出這一點。",
      "en": "After truncation Step has 6 edges; Reach={s0,s1,s2,s3,s4,s5} and s6 is unreachable. s3 is the only reachable halt state, s5 is stuck (no successors but not in Halt), and {s2,s4} is a reachable non-halting cycle. (s0,s1,s3) halts, (s0,s1,s5) is stuck, and the sequence that goes from s0 and then alternates between s2 and s4 forever is an infinite execution; (s0,s3), (s1,s3) and (s0,s1,s3,s6) are illegal. So not every maximal execution from Init halts, and exploration to depth 1 cannot reveal this."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "s5 沒有後繼，所以 s5 是停止狀態",
          "en": "s5 has no successor, so s5 is a halt state"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "Halt={s3}；s5 是卡住狀態，不是停止狀態。",
          "en": "Halt={s3}; s5 is a stuck state, not a halt state."
        }
      },
      {
        "claim": {
          "zh-Hant": "(s0,s1,s3,s6) 的每對相鄰狀態都在原始資料中，所以它是合法執行",
          "en": "Every consecutive pair of (s0,s1,s3,s6) is in the raw data, so it is a legal execution"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "進入 s3∈Halt 時執行即結束，(s3,s6) 已被截斷。",
          "en": "Execution ends on entering s3∈Halt, and (s3,s6) has been truncated."
        }
      },
      {
        "claim": {
          "zh-Hant": "探索到深度 1 沒有發現循環，所以每條執行都終止",
          "en": "Exploring to depth 1 found no cycle, so every execution terminates"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "從 s0 出發後在 s2 與 s4 之間無窮交替的序列是無窮執行，(s0,s1,s5) 是卡住執行。",
          "en": "The sequence that leaves s0 and then alternates between s2 and s4 forever is an infinite execution, and (s0,s1,s5) is a stuck execution."
        }
      },
      {
        "claim": {
          "zh-Hant": "s6 可達，因為資料中有 (s3,s6)",
          "en": "s6 is reachable because (s3,s6) is in the data"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "截斷後沒有任何進入 s6 的邊，Reach={s0,s1,s2,s3,s4,s5}。",
          "en": "After truncation no edge enters s6, and Reach={s0,s1,s2,s3,s4,s5}."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "set_operations_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "集合運算：x∈A∪B ⇔ x∈A 或 x∈B；x∈A∩B ⇔ x∈A 且 x∈B；x∈A∖B ⇔ x∈A 且 x∉B；在全集 U 中 Aᶜ=U∖A。",
          "en": "Set operations: x∈A∪B ⇔ x∈A or x∈B; x∈A∩B ⇔ x∈A and x∈B; x∈A∖B ⇔ x∈A and x∉B; in a universe U, Aᶜ=U∖A."
        }
      },
      {
        "id": "cartesian_product_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "笛卡兒積：A×B 是所有有序對 (a,b)（a∈A、b∈B）的集合；(a,b)=(c,d) ⇔ a=c 且 b=d。",
          "en": "Cartesian product: A×B is the set of ordered pairs (a,b) with a∈A and b∈B; (a,b)=(c,d) ⇔ a=c and b=d."
        }
      },
      {
        "id": "subset_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "子集：A⊆B 表示 A 的每個元素都是 B 的元素，即 ∀x (x∈A⇒x∈B)。",
          "en": "Subset: A⊆B means every element of A is an element of B, i.e. ∀x (x∈A⇒x∈B)."
        }
      },
      {
        "id": "nat_induction",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "數學歸納原理：對從 n₀ 起的命題族 P(n)，若 P(n₀) 成立，且對每個 n≥n₀ 都有 P(n)⇒P(n+1)，則所有 n≥n₀ 都有 P(n)。",
          "en": "Principle of induction: for a family P(n) starting at n₀, if P(n₀) holds and P(n)⇒P(n+1) for every n≥n₀, then P(n) holds for every n≥n₀."
        }
      },
      {
        "id": "finite_counting_basics",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "有限計數：互斥有限集合 A、B 有 |A∪B|=|A|+|B|；|A×B|=|A|·|B|；有限集之間存在雙射 ⇔ 元素個數相同。",
          "en": "Finite counting: for disjoint finite sets A, B, |A∪B|=|A|+|B|; |A×B|=|A|·|B|; there is a bijection between finite sets ⇔ they have the same number of elements."
        }
      },
      {
        "id": "numeric_evaluation",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "明確整數或有理數算式的精確求值；可以獨立重算。",
          "en": "Exact evaluation of an explicit integer or rational expression; independently recomputable."
        }
      },
      {
        "id": "set_builder",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "集合建構式：x∈{y∈A ∣ P(y)} 當且僅當 x∈A 且 P(x)。",
          "en": "Set-builder notation: x∈{y∈A ∣ P(y)} if and only if x∈A and P(x)."
        }
      },
      {
        "id": "set_extensionality",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "集合相等：A=B 當且僅當 A⊆B 且 B⊆A，即兩者有相同元素。",
          "en": "Set equality: A=B if and only if A⊆B and B⊆A, i.e. they have the same elements."
        }
      },
      {
        "id": "exists_intro",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "∃引入：若找到 a∈D 使 P(a) 成立，則 ∃x∈D, P(x)。",
          "en": "∃-introduction: if some a∈D satisfies P(a), then ∃x∈D, P(x)."
        }
      },
      {
        "id": "case_analysis",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "分情況論證：若 P∨Q 成立，且 P⇒R、Q⇒R 都已證，則 R 成立。所有情況必須涵蓋全部可能。",
          "en": "Proof by cases: if P∨Q holds and both P⇒R and Q⇒R are proved, then R holds. The cases must cover every possibility."
        }
      },
      {
        "id": "quantifier_negation",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "量詞否定：¬(∀x, P(x)) 等價於 ∃x, ¬P(x)；¬(∃x, P(x)) 等價於 ∀x, ¬P(x)。",
          "en": "Negating quantifiers: ¬(∀x, P(x)) is equivalent to ∃x, ¬P(x), and ¬(∃x, P(x)) is equivalent to ∀x, ¬P(x)."
        }
      },
      {
        "id": "mko_computational_model_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-computational-model",
          "sha256": "ceedb5463ff015fc7cd0f74870bfb9033cfb9a8ff893490b0335fe4bf9112ace",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "本條目的有限抽象模型為 (S,Init,Step,Halt)，其中 Init,Halt⊆S、Step⊆S×S。執行從 Init 中狀態開始並沿 Step 前進；無後繼的 stuck 狀態不因而自動屬於 Halt。",
          "en": "The finite abstract model in this entry is (S,Init,Step,Halt), with Init,Halt⊆S and Step⊆S×S. Executions start in Init and follow Step; a stuck state without successors is not automatically a member of Halt."
        }
      },
      {
        "id": "mko_relation_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-relation",
          "sha256": "3788215401bc9a5610691985883d04b506880cc9bd5e2ce0a98054cd5a5f0774",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "從 A 到 B 的二元關係 R 是 A×B 的子集合；關係像 R[C]={y∈B:存在 x∈C，使 (x,y)∈R}。",
          "en": "A binary relation R from A to B is a subset of A×B; its image of C is R[C]={y∈B: there exists x∈C with (x,y)∈R}."
        }
      },
      {
        "id": "reach_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "可達性：狀態 s 從 Init 可達，若存在 k≥0 與狀態 u_0,u_1 到 u_k 的有限路徑，u_0∈Init、u_k=s，且每對相鄰狀態都在 Step 中（k=0 表示零步，即 s∈Init）。Reach 是所有可達狀態的集合。",
          "en": "Reachability: a state s is reachable from Init if there are k≥0 and a finite path of states u_0, u_1 up to u_k with u_0∈Init, u_k=s and every consecutive pair in Step (k=0 means zero steps, i.e. s∈Init). Reach is the set of all reachable states."
        }
      },
      {
        "id": "L_fix",
        "kind": "lemma",
        "proved_in": [
          "S04.1",
          "S04.2"
        ],
        "statement": {
          "zh-Hant": "令 R_0=Init，R_{k+1}=R_k∪Step[R_k]。則 (i) 對每個 k，R_k 恰是至多 k 步可達的狀態集；(ii) 若某個 m 使 R_{m+1}=R_m，則 Reach=R_m。",
          "en": "Let R_0=Init and R_{k+1}=R_k∪Step[R_k]. Then (i) for every k, R_k is exactly the set of states reachable in at most k steps; (ii) if R_{m+1}=R_m for some m, then Reach=R_m."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N1",
        "step": "S02",
        "lhs": "7-1",
        "rhs": "6"
      },
      {
        "id": "N2",
        "step": "S03",
        "lhs": "2+2+1+1",
        "rhs": "6"
      },
      {
        "id": "N3",
        "step": "S05",
        "lhs": "1+2+3",
        "rhs": "6"
      },
      {
        "id": "N4",
        "step": "S05",
        "lhs": "7-6",
        "rhs": "1"
      },
      {
        "id": "N5",
        "step": "S10",
        "vars": [
          "k"
        ],
        "degree": 1,
        "lhs": "(2*k+2)+1",
        "rhs": "2*(k+1)+1"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "在 MKO 範圍內工作：S 是明示有限狀態集，Step 是可具非確定性的有向關係（假設 a1）；到達 Halt 即停止，分析前截斷其外出邊（假設 a2）。不處理有效編碼、公平性或確定性與非確定性模型的分層，不改動 canonical MKO 或英文 edition。",
      "en": "Works inside the MKO's scope: S is an explicitly given finite set of states and Step is a directed relation that may be nondeterministic (assumption a1); reaching Halt stops execution, and edges out of halts are truncated before analysis (assumption a2). Effective encodings, fairness and the layering of deterministic and nondeterministic models are not treated, and the canonical MKO and its English edition are not changed."
    },
    "md_symbols": [
      [
        "S",
        "狀態集 {s0,s1,s2,s3,s4,s5,s6}",
        "the state set {s0,s1,s2,s3,s4,s5,s6}"
      ],
      [
        "\\mathrm{Init},\\ \\mathrm{Halt}",
        "初始狀態集與停止狀態集",
        "the initial and halting state sets"
      ],
      [
        "E_{\\mathrm{raw}}",
        "原始邊資料",
        "the raw edge data"
      ],
      [
        "\\mathrm{Step}",
        "截斷後的轉移關係",
        "the transition relation after truncation"
      ],
      [
        "\\mathrm{Post}(s)",
        "s 的後繼集 Step[{s}]",
        "the successor set Step[{s}] of s"
      ],
      [
        "R_k",
        "第 k 輪可達集（至多 k 步）",
        "the round-k reachable set (at most k steps)"
      ],
      [
        "\\mathrm{Reach}",
        "從 Init 可達的狀態集",
        "the set of states reachable from Init"
      ]
    ],
    "md_error_controls": [
      {
        "title": "沒有外出邊不等於停止 / No outgoing edge does not mean halting",
        "zh": "MKO 指出的誤解是把無外出邊自動叫做 halt。s5 沒有後繼，但不在 Halt 中，所以 (s0,s1,s5) 是卡住，不是停止（S07、S09）。是否停止只由 Halt 的給定列表決定。",
        "en": "The misconception identified in the MKO is calling a state without outgoing edges a halt automatically. s5 has no successors but is not in Halt, so (s0,s1,s5) is stuck, not halted (S07, S09). Halting is decided only by the given list Halt."
      },
      {
        "title": "未窮盡的有限前綴不足以斷言終止 / Non-exhaustive finite prefixes do not certify termination",
        "zh": "深度 1 的探索未顯示循環 s2→s4→s2 或卡住的 s5，但不終止的極大執行確實存在（S12、S13）。尚未窮盡可達圖時，沒有看到反例不等於終止證明。完整有限可達圖可用循環與非 Halt 死端檢查判定；一般程式仍需要適當證明方法。",
        "en": "Depth-1 exploration displays neither the cycle s2→s4→s2 nor the stuck s5, yet non-halting maximal executions exist (S12, S13). If the reachable graph has not been exhausted, absence of an observed counterexample is not a termination proof. A complete finite reachable graph permits cycle and non-Halt dead-end checks; general programs still require suitable proof methods."
      },
      {
        "title": "先截斷停止狀態的外出邊 / Truncate edges out of halts first",
        "zh": "原始資料含 (s3,s6)。若不截斷，s6 會被誤算為可達，(s0,s1,s3,s6) 會被誤認為合法（S06、S11）。MKO 假設 a2 要求在分析前刪去這些邊。",
        "en": "The raw data contain (s3,s6). Without truncation, s6 would be wrongly counted as reachable and (s0,s1,s3,s6) wrongly accepted as legal (S06, S11). MKO assumption a2 requires deleting such edges before analysis."
      }
    ],
    "md_open_items": [
      {
        "zh-Hant": "確定性與非確定性模型、極大執行、公平性與有效編碼的分層模型（MKO formal next）未在此建立；本稿只處理一個明示的有限模型。",
        "en": "The layered treatment of deterministic and nondeterministic models, maximal executions, fairness and effective encodings (MKO formal next) is not built here; this guide handles one explicit finite model only."
      }
    ]
  },
  "revision": {
    "id": "production-20261019-adopted-96",
    "source_commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
    "adopted_source_sha256": "4e735eff3b7dce6a70f861ddcd8dc409e5a688e22cfd99ecfa7115e5ad0c3ebc",
    "original_source_sha256": "e947537df405a61ccf81d4f1a305ce5e409796bc956b63e5b8517923dab8e201",
    "owner_adopted": true,
    "bilingual_sync": "complete_source_bound",
    "formal_Lean": "NOT_RUN",
    "independent_AI_concurrence": "NOT_MEASURED",
    "issue_ids": [
      "BR-M036",
      "BR-M037"
    ],
    "scope": "Owner-adopted natural-language teaching guide; not a formal proof, canonical MKO rewrite or evidence-status promotion."
  }
}
