{
  "schema_version": "ocme-reviewed-question-reader-v1",
  "question_id": "q-20261015-advance-20261118-r06-regular-expression-0005",
  "pilot_number": "R0054-27505",
  "number": 27505,
  "family_id": "qf-mod49-regex-ast-qualification",
  "title": {
    "zh-Hant": "第 27505 題：正規表示式",
    "en": "Question 27505: Regular Expressions Have Typed Nodes and an Explicit Alphabet"
  },
  "original_question": {
    "schema_version": "ocme-question-v0.1",
    "id": "q-20261015-advance-20261118-r06-regular-expression-0005",
    "batch_id": "batch-20261015-advance-20261118-r06-regular-expression-foundations",
    "language": "zh-Hant",
    "source_mko_ids": [
      "mko-regular-expression"
    ],
    "title_zh": "正規表示式",
    "stem_zh": "typed regex AST、finite alphabet與完整word semantics責任。操作=regex-ast-qualification；資料={\"alphabet\":[\"a\",\"b\",\"c\"],\"regex\":{\"type\":\"concat\",\"children\":[{\"type\":\"symbol\",\"value\":\"b\"},{\"type\":\"symbol\",\"value\":\"c\"},{\"type\":\"symbol\",\"value\":\"a\"},{\"type\":\"symbol\",\"value\":\"b\"},{\"type\":\"symbol\",\"value\":\"c\"}]}}。請依 exact_ordered_tuple_declared_by_interface 欄序回答。",
    "answer": {
      "kind": "expression",
      "value": "([a, b, c], {children:[{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"},{type:\"symbol\",value:\"a\"},{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"}],type:\"concat\"}, 是, typed_AST_symbols_in_alphabet)",
      "explanation_zh": "Wave6第十二層核對=([a, b, c], {children:[{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"},{type:\"symbol\",value:\"a\"},{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"}],type:\"concat\"}, 是, typed_AST_symbols_in_alphabet)；依完整明示資料獨立重算；empty language、epsilon、union、ordered concat與star嚴格區分並處理epsilon cycle；bounded enumeration不證unbounded equivalence；shell wildcard不是核心AST。"
    },
    "difficulty": {
      "band": "undergraduate_core",
      "level": 1,
      "skills": [
        "正規表示式"
      ]
    },
    "variant": {
      "family_id": "qf-mod49-regex-ast-qualification",
      "seed": 202611186005,
      "parameters": {
        "alphabet": [
          "a",
          "b",
          "c"
        ],
        "regex": {
          "type": "concat",
          "children": [
            {
              "type": "symbol",
              "value": "b"
            },
            {
              "type": "symbol",
              "value": "c"
            },
            {
              "type": "symbol",
              "value": "a"
            },
            {
              "type": "symbol",
              "value": "b"
            },
            {
              "type": "symbol",
              "value": "c"
            }
          ]
        },
        "domain": "Exact_typed_regular_expression",
        "operation": "regex-ast-qualification",
        "semantic_template": "regex-ast-qualification|{alphabet:[\"a\",\"b\",\"c\"],regex:{children:[{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"},{type:\"symbol\",value:\"a\"},{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"}],type:\"concat\"}}"
      }
    },
    "verification": {
      "status": "candidate",
      "checks": [
        "producer_exact_finite_or_symbolic_model",
        "producer_source_snapshot_check",
        "producer_substantive_template_deduplication",
        "producer_json_schema"
      ],
      "warning_zh": "候選須主端重算；不構成一般limit theorem、coverage、number-theory或language theorem證明、人工審定、Lean或Evidence。"
    },
    "provenance": {
      "generator_role": "question_producer",
      "generator_model": "model_unknown",
      "generated_at": "2026-10-15",
      "contract_version": "ocme-question-factory-v0.1"
    }
  },
  "original_english_edition": {
    "schema_version": "ocme-question-localization-v0.1",
    "question_id": "q-20261015-advance-20261118-r06-regular-expression-0005",
    "batch_id": "batch-20261015-advance-20261118-r06-regular-expression-foundations",
    "locale": "en",
    "translation_state": "ai_candidate",
    "source": {
      "question_sha256": "92348aae760f7fe0163d60c270f4e070eb0359348ed90a6d935993ecc87be2c2",
      "family_id": "qf-mod49-regex-ast-qualification",
      "seed": 202611186005,
      "semantic_template": "regex-ast-qualification|{alphabet:[\"a\",\"b\",\"c\"],regex:{children:[{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"},{type:\"symbol\",value:\"a\"},{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"}],type:\"concat\"}}"
    },
    "fields": {
      "title": "Regular Expressions Have Typed Nodes and an Explicit Alphabet",
      "stem": "Use alphabet=[a, b, c] and typed regular-expression AST={\"type\":\"concat\",\"children\":[{\"type\":\"symbol\",\"value\":\"b\"},{\"type\":\"symbol\",\"value\":\"c\"},{\"type\":\"symbol\",\"value\":\"a\"},{\"type\":\"symbol\",\"value\":\"b\"},{\"type\":\"symbol\",\"value\":\"c\"}]}. Words are arrays of alphabet symbols; distinguish empty language from the language containing the empty word. Give (alphabet, canonical_typed_AST, AST_qualified, qualification_statement).",
      "answer": {
        "kind": "expression",
        "value": "([a, b, c], {children:[{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"},{type:\"symbol\",value:\"a\"},{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"}],type:\"concat\"}, Yes, typed_AST_symbols_in_alphabet)",
        "explanation": "Validate each node type, exact key set, arity and symbol membership. Canonicalize unions extensionally while retaining concatenation order. A shell wildcard is not one of these core regular-expression AST nodes. The exact result, retaining the requested order, is ([a, b, c], {children:[{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"},{type:\"symbol\",value:\"a\"},{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"}],type:\"concat\"}, Yes, typed_AST_symbols_in_alphabet)."
      },
      "skills": [
        "Regular Expressions Have Typed Nodes and an Explicit Alphabet"
      ],
      "verification_warning": "This is a candidate exercise. Mechanical recomputation checks only the stated conditions and this instance; it is neither a formal proof nor human review."
    }
  },
  "givens": [
    {
      "id": "G001",
      "text": {
        "zh-Hant": "typed regex AST、finite alphabet與完整word semantics責任。操作=regex-ast-qualification；資料={\"alphabet\":[\"a\",\"b\",\"c\"],\"regex\":{\"type\":\"concat\",\"children\":[{\"type\":\"symbol\",\"value\":\"b\"},{\"type\":\"symbol\",\"value\":\"c\"},{\"type\":\"symbol\",\"value\":\"a\"},{\"type\":\"symbol\",\"value\":\"b\"},{\"type\":\"symbol\",\"value\":\"c\"}]}}。請依 exact_ordered_tuple_declared_by_interface 欄序回答。",
        "en": "Use alphabet=[a, b, c] and typed regular-expression AST={\"type\":\"concat\",\"children\":[{\"type\":\"symbol\",\"value\":\"b\"},{\"type\":\"symbol\",\"value\":\"c\"},{\"type\":\"symbol\",\"value\":\"a\"},{\"type\":\"symbol\",\"value\":\"b\"},{\"type\":\"symbol\",\"value\":\"c\"}]}. Words are arrays of alphabet symbols; distinguish empty language from the language containing the empty word. Give (alphabet, canonical_typed_AST, AST_qualified, qualification_statement)."
      }
    }
  ],
  "steps": [
    {
      "id": "S001",
      "uses": [
        "G001"
      ],
      "before": "source roles = [regex-ast-qualification]",
      "after": "derived = [[alphabet, canonical_typed_AST, AST_qualified, qualification_statement]]",
      "relation": "implies",
      "rule_id": "source_ordered_fields_without_JS",
      "conditions": [],
      "explanation": {
        "zh-Hant": "直接明列此操作與mode完整欄序，不依JavaScript、不由答案形狀猜角色；布林、字串、null與未作聲稱保持不同。",
        "en": "List the complete operation/mode field order without JavaScript or answer-shape inference;Boolean,string,null and an unclaimed result remain distinct."
      },
      "reverse_audit": {
        "kind": "premise_and_result_audit",
        "explanation": {
          "zh-Hant": "回查原始資料、操作數、完整範圍與本步前提；有限見證、條件式定理引用與形式證明分開。",
          "en": "Reverse-check original data,operands,complete scope and premises;finite witnesses,conditional theorem use and formal proof remain distinct."
        }
      },
      "arithmetic": null
    },
    {
      "id": "S002",
      "uses": [
        "G001",
        "S001"
      ],
      "before": "source roles = [root.children[0], [a, b, c], {'type': 'symbol', 'value': 'b'}]",
      "after": "derived = [{'type': 'symbol', 'value': 'b'}, {type:\"symbol\",value:\"b\"}]",
      "relation": "implies",
      "rule_id": "Regex_EACH_typed_node_exact_keys_symbol_scope_union_set_concat_order",
      "conditions": [],
      "explanation": {
        "zh-Hant": "逐node檢type、exact keys與symbol membership。union在raw至少兩child之後才extensional去重（canonical可剩一child）；concat保原順序，star保child。不把canonical結果當raw再多加arity限制。",
        "en": "For EACH node qualify type,exact keys and symbol membership.A union checks raw arity>=2 BEFORE extensional deduplication,so its canonical form may have one child.Concatenation retains order and star retains its child.Do not revalidate canonical output as raw input with a new arity gate."
      },
      "reverse_audit": {
        "kind": "premise_and_result_audit",
        "explanation": {
          "zh-Hant": "回查原始資料、操作數、完整範圍與本步前提；有限見證、條件式定理引用與形式證明分開。",
          "en": "Reverse-check original data,operands,complete scope and premises;finite witnesses,conditional theorem use and formal proof remain distinct."
        }
      },
      "arithmetic": null
    },
    {
      "id": "S003",
      "uses": [
        "G001",
        "S002"
      ],
      "before": "source roles = [root.children[1], [a, b, c], {'type': 'symbol', 'value': 'c'}]",
      "after": "derived = [{'type': 'symbol', 'value': 'c'}, {type:\"symbol\",value:\"c\"}]",
      "relation": "implies",
      "rule_id": "Regex_EACH_typed_node_exact_keys_symbol_scope_union_set_concat_order",
      "conditions": [],
      "explanation": {
        "zh-Hant": "逐node檢type、exact keys與symbol membership。union在raw至少兩child之後才extensional去重（canonical可剩一child）；concat保原順序，star保child。不把canonical結果當raw再多加arity限制。",
        "en": "For EACH node qualify type,exact keys and symbol membership.A union checks raw arity>=2 BEFORE extensional deduplication,so its canonical form may have one child.Concatenation retains order and star retains its child.Do not revalidate canonical output as raw input with a new arity gate."
      },
      "reverse_audit": {
        "kind": "premise_and_result_audit",
        "explanation": {
          "zh-Hant": "回查原始資料、操作數、完整範圍與本步前提；有限見證、條件式定理引用與形式證明分開。",
          "en": "Reverse-check original data,operands,complete scope and premises;finite witnesses,conditional theorem use and formal proof remain distinct."
        }
      },
      "arithmetic": null
    },
    {
      "id": "S004",
      "uses": [
        "G001",
        "S003"
      ],
      "before": "source roles = [root.children[2], [a, b, c], {'type': 'symbol', 'value': 'a'}]",
      "after": "derived = [{'type': 'symbol', 'value': 'a'}, {type:\"symbol\",value:\"a\"}]",
      "relation": "implies",
      "rule_id": "Regex_EACH_typed_node_exact_keys_symbol_scope_union_set_concat_order",
      "conditions": [],
      "explanation": {
        "zh-Hant": "逐node檢type、exact keys與symbol membership。union在raw至少兩child之後才extensional去重（canonical可剩一child）；concat保原順序，star保child。不把canonical結果當raw再多加arity限制。",
        "en": "For EACH node qualify type,exact keys and symbol membership.A union checks raw arity>=2 BEFORE extensional deduplication,so its canonical form may have one child.Concatenation retains order and star retains its child.Do not revalidate canonical output as raw input with a new arity gate."
      },
      "reverse_audit": {
        "kind": "premise_and_result_audit",
        "explanation": {
          "zh-Hant": "回查原始資料、操作數、完整範圍與本步前提；有限見證、條件式定理引用與形式證明分開。",
          "en": "Reverse-check original data,operands,complete scope and premises;finite witnesses,conditional theorem use and formal proof remain distinct."
        }
      },
      "arithmetic": null
    },
    {
      "id": "S005",
      "uses": [
        "G001",
        "S004"
      ],
      "before": "source roles = [root.children[3], [a, b, c], {'type': 'symbol', 'value': 'b'}]",
      "after": "derived = [{'type': 'symbol', 'value': 'b'}, {type:\"symbol\",value:\"b\"}]",
      "relation": "implies",
      "rule_id": "Regex_EACH_typed_node_exact_keys_symbol_scope_union_set_concat_order",
      "conditions": [],
      "explanation": {
        "zh-Hant": "逐node檢type、exact keys與symbol membership。union在raw至少兩child之後才extensional去重（canonical可剩一child）；concat保原順序，star保child。不把canonical結果當raw再多加arity限制。",
        "en": "For EACH node qualify type,exact keys and symbol membership.A union checks raw arity>=2 BEFORE extensional deduplication,so its canonical form may have one child.Concatenation retains order and star retains its child.Do not revalidate canonical output as raw input with a new arity gate."
      },
      "reverse_audit": {
        "kind": "premise_and_result_audit",
        "explanation": {
          "zh-Hant": "回查原始資料、操作數、完整範圍與本步前提；有限見證、條件式定理引用與形式證明分開。",
          "en": "Reverse-check original data,operands,complete scope and premises;finite witnesses,conditional theorem use and formal proof remain distinct."
        }
      },
      "arithmetic": null
    },
    {
      "id": "S006",
      "uses": [
        "G001",
        "S005"
      ],
      "before": "source roles = [root.children[4], [a, b, c], {'type': 'symbol', 'value': 'c'}]",
      "after": "derived = [{'type': 'symbol', 'value': 'c'}, {type:\"symbol\",value:\"c\"}]",
      "relation": "implies",
      "rule_id": "Regex_EACH_typed_node_exact_keys_symbol_scope_union_set_concat_order",
      "conditions": [],
      "explanation": {
        "zh-Hant": "逐node檢type、exact keys與symbol membership。union在raw至少兩child之後才extensional去重（canonical可剩一child）；concat保原順序，star保child。不把canonical結果當raw再多加arity限制。",
        "en": "For EACH node qualify type,exact keys and symbol membership.A union checks raw arity>=2 BEFORE extensional deduplication,so its canonical form may have one child.Concatenation retains order and star retains its child.Do not revalidate canonical output as raw input with a new arity gate."
      },
      "reverse_audit": {
        "kind": "premise_and_result_audit",
        "explanation": {
          "zh-Hant": "回查原始資料、操作數、完整範圍與本步前提；有限見證、條件式定理引用與形式證明分開。",
          "en": "Reverse-check original data,operands,complete scope and premises;finite witnesses,conditional theorem use and formal proof remain distinct."
        }
      },
      "arithmetic": null
    },
    {
      "id": "S007",
      "uses": [
        "G001",
        "S006"
      ],
      "before": "source roles = [root, [a, b, c], {'type': 'concat', 'children': [{'type': 'symbol', 'value': 'b'}, {'type': 'symbol', 'value': 'c'}, {'type': 'symbol', 'value': 'a'}, {'type': 'symbol', 'value': 'b'}, {'type': 'symbol', 'value': 'c'}]}]",
      "after": "derived = [{'type': 'concat', 'children': [{'type': 'symbol', 'value': 'b'}, {'type': 'symbol', 'value': 'c'}, {'type': 'symbol', 'value': 'a'}, {'type': 'symbol', 'value': 'b'}, {'type': 'symbol', 'value': 'c'}]}, {children:[{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"},{type:\"symbol\",value:\"a\"},{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"}],type:\"concat\"}]",
      "relation": "implies",
      "rule_id": "Regex_EACH_typed_node_exact_keys_symbol_scope_union_set_concat_order",
      "conditions": [],
      "explanation": {
        "zh-Hant": "逐node檢type、exact keys與symbol membership。union在raw至少兩child之後才extensional去重（canonical可剩一child）；concat保原順序，star保child。不把canonical結果當raw再多加arity限制。",
        "en": "For EACH node qualify type,exact keys and symbol membership.A union checks raw arity>=2 BEFORE extensional deduplication,so its canonical form may have one child.Concatenation retains order and star retains its child.Do not revalidate canonical output as raw input with a new arity gate."
      },
      "reverse_audit": {
        "kind": "premise_and_result_audit",
        "explanation": {
          "zh-Hant": "回查原始資料、操作數、完整範圍與本步前提；有限見證、條件式定理引用與形式證明分開。",
          "en": "Reverse-check original data,operands,complete scope and premises;finite witnesses,conditional theorem use and formal proof remain distinct."
        }
      },
      "arithmetic": null
    }
  ],
  "math_model": {
    "result": [
      [
        "a",
        "b",
        "c"
      ],
      {
        "type": "concat",
        "children": [
          {
            "type": "symbol",
            "value": "b"
          },
          {
            "type": "symbol",
            "value": "c"
          },
          {
            "type": "symbol",
            "value": "a"
          },
          {
            "type": "symbol",
            "value": "b"
          },
          {
            "type": "symbol",
            "value": "c"
          }
        ]
      },
      true,
      "typed_AST_symbols_in_alphabet"
    ]
  },
  "conclusion": {
    "canonical_value": "([a, b, c], {children:[{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"},{type:\"symbol\",value:\"a\"},{type:\"symbol\",value:\"b\"},{type:\"symbol\",value:\"c\"}],type:\"concat\"}, 是, typed_AST_symbols_in_alphabet)",
    "explanation": {
      "zh-Hant": "依上列完整代值及條件核對得到原題答案；原題編號、格式與狀態保持不變。",
      "en": "The full substitutions and premise checks give the original answer; source identity,format and status are unchanged."
    }
  },
  "definition_note": {
    "zh-Hant": "沿用原題明示的論域、假設與來源 MKO 定義。本題已完成第二對話數理與中英語義覆核，並由原始參數逐題獨立重算模型、答案與每個算術步驟；原題仍為 candidate。",
    "en": "Use the original question domain, assumptions and cited MKO definitions. This item has second-context mathematical and bilingual review, with the model, answer and every arithmetic step independently recomputed from the original parameters; the source question remains a candidate."
  },
  "source": {
    "input_commit": "0f7be61e2c22317a4075561dc822c87d881a50db",
    "question_binding": {
      "batch_id": "batch-20261015-advance-20261118-r06-regular-expression-foundations",
      "batch_path": "public/data/questions/batches/batch-20261015-advance-20261118-r06-regular-expression-foundations/questions.jsonl",
      "batch_sha256": "b5a9bdb4921ed6644e4166cdf8195037033c5a94e7c2372abaf5f100e2ec370d",
      "original_line": 5,
      "original_line_sha256": "a16b8fd7491f8c6f5c2ee5b0fc4dcc8dc84bf8b214e1a4ede1f47ac7464665af",
      "question_compact_sha256": "92348aae760f7fe0163d60c270f4e070eb0359348ed90a6d935993ecc87be2c2",
      "english_row_compact_sha256": "91032681316ed0bd7168d2e9b340ed2bb5739c56743fcb38c29cbebd6dd5e666",
      "english_manifest_path": "public/data/i18n/editions/batch-20261015-advance-20261118-r06-regular-expression-foundations.en.json",
      "english_rows_path": "public/data/i18n/questions/batch-20261015-advance-20261118-r06-regular-expression-foundations.en.jsonl"
    },
    "mko_bindings": {
      "mko-regular-expression": {
        "sha256": "0d4eaa52f48c71240a6e4166e4f1a4ddb3b607f21c102c49d944833b87583695",
        "english_sha256": "22c20144ec938506d8fa94ef6bff9ebea017c5799c2428a541f7b478c7e8182e",
        "original_path": "public/data/mko/regular-expression.json",
        "english_path": "public/data/i18n/editions/mko-regular-expression.en.json"
      }
    },
    "selected_manifest_sha256": "5233edba9654a6cffd8b6b2d83c932f82ded15f9c0b7c733bd049943e672acff",
    "selected_part_sha256": "ad40cc18f9292c43924a7679f3af46574a5284aa5447f5f7f78a0de98840acb8",
    "original_candidate_sha256": "778c23218dc9c997dc411121f3a31e5c654e7e2bd9d0b0187d136319246259a2",
    "original_candidate_line_sha256": "778c23218dc9c997dc411121f3a31e5c654e7e2bd9d0b0187d136319246259a2"
  },
  "historical_source_state": {
    "review_state": {
      "derivation": "candidate_authored_and_locally_checked",
      "source_question_state": "candidate",
      "independent_AI_or_human_review": "NOT_PERFORMED",
      "formalization": "not_formalized",
      "Lean": "NOT_RUN"
    },
    "scope_note": {
      "zh-Hant": "來源綁定教學推導候選；精確核對不等於獨立AI／人工審查或一般形式證明。原題、答案、MKO、公式、AST與歷史不變。",
      "en": "Source-bound pedagogical derivation candidate.Exact checking is not independent AI/human review or general formal proof.Original questions,answers,MKOs,formulas,ASTs and history remain unchanged."
    },
    "label": "Frozen producer metadata; current per-question review is separate below."
  },
  "revision": {
    "id": "review-20261026-010-p55",
    "review_date": "2026-10-26",
    "owner_authorized_reader_publication": true,
    "scope": "One hundred sixty family prototypes and their mathematical/bilingual reasoning variants, stems, boundary statements and every distinct explanation shape were reviewed in a context independent of the producer; parameter substitutions, source bindings, full math models, both answer strings and every arithmetic step were independently reconstructed per question from the original parameters only, with negative controls. This grouped method does not claim a separate literal AI reading of every repeated sentence or an extra AI voter.",
    "review_receipts": {
      "semantic_review_sha256": "0a76d8e93c08bb16998a0483f3dfc0504f269fc3e1982e6cd868cab0a2856d54",
      "question_first_witness_sha256": "09127b736c225714dfa0b7ceb0e6a6e66df27438b480cad8217d3c2f99ce9437"
    },
    "status": "second_context_reviewed",
    "mathematical_semantics": true,
    "bilingual_semantics": true,
    "steps_reviewed": 7,
    "method": "family_template_semantic_review_plus_independent_per_instance_reconstruction",
    "exact_question_first_check": {
      "model_sha256": "b4c8557d2a17812f891936638934dc83726469c338b1ad6960391aadfe3c99aa",
      "arithmetic_steps": 0
    },
    "uses_answer_as_premise": false,
    "human_review": "NOT_PERFORMED",
    "formalization": "not_formalized",
    "Lean": "NOT_RUN",
    "Canonical_truth_promotion": false,
    "authority": "Owner-authorized reviewed reader publication; original question/candidate states remain historical and unchanged."
  }
}
