{
  "schema_version": "ocme-reviewed-question-reader-v1",
  "question_id": "q-20261008-advance-20261011-r03-variable-expression-0060",
  "pilot_number": "R0008-04735",
  "number": 4735,
  "family_id": "qf-density11-expression-local-shadow-pair",
  "title": {
    "zh-Hant": "第 4735 題：詞法遮蔽的內外層值",
    "en": "Question 4735: Outer and Lexically Shadowed Values"
  },
  "original_question": {
    "schema_version": "ocme-question-v0.1",
    "id": "q-20261008-advance-20261011-r03-variable-expression-0060",
    "batch_id": "batch-20261008-advance-20261011-r03-variable-expression-foundations",
    "language": "zh-Hant",
    "source_mko_ids": [
      "mko-variable-expression"
    ],
    "title_zh": "詞法遮蔽的內外層值",
    "stem_zh": "有理數Q；表達式非方程式。外層x=-3，內層局部x=-8詞法遮蔽外層，c=-1。依序求外層及內層x+c的整數值。",
    "answer": {
      "kind": "expression",
      "value": "(-4, -9)",
      "explanation_zh": "外層與遮蔽內層值=(-4, -9)。各層用自己的綁定後加c；內層不改外層，局部遮蔽不是外層賦值更新。"
    },
    "difficulty": {
      "band": "upper_secondary",
      "level": 2,
      "skills": [
        "詞法遮蔽的內外層值"
      ]
    },
    "variant": {
      "family_id": "qf-density11-expression-local-shadow-pair",
      "seed": 202610113060,
      "parameters": {
        "outer": -3,
        "inner": -8,
        "c": -1,
        "binding_mode": "lexical_shadow_no_mutation",
        "operation": "density11_expression_local_shadow_pair",
        "domain": "typed_Q_scoped_binding_slice",
        "semantic_template": "qf-density11-expression-local-shadow-pair/[-3,-8,-1]"
      }
    },
    "verification": {
      "status": "candidate",
      "checks": [
        "producer_exact_integer_rational_arithmetic",
        "producer_finite_enumeration",
        "producer_source_snapshot_check",
        "producer_substantive_template_deduplication",
        "producer_json_schema"
      ],
      "warning_zh": "僅為產生端候選及自檢；主端須另做獨立驗收，不構成人工審定、普遍證明或形式 Evidence。"
    },
    "provenance": {
      "generator_role": "question_producer",
      "generator_model": "model_unknown",
      "generated_at": "2026-10-08",
      "contract_version": "ocme-question-factory-v0.1"
    }
  },
  "original_english_edition": {
    "schema_version": "ocme-question-localization-v0.1",
    "question_id": "q-20261008-advance-20261011-r03-variable-expression-0060",
    "batch_id": "batch-20261008-advance-20261011-r03-variable-expression-foundations",
    "locale": "en",
    "translation_state": "ai_candidate",
    "source": {
      "question_sha256": "57f84983649cdd3ea44cf942fdcc89f4db0bbb82ead528b55a83d1363fa608e7",
      "family_id": "qf-density11-expression-local-shadow-pair",
      "seed": 202610113060,
      "semantic_template": "qf-density11-expression-local-shadow-pair/[-3,-8,-1]"
    },
    "fields": {
      "title": "Outer and Lexically Shadowed Values",
      "stem": "All operations and evaluations are exact in Q, not truncated natural-number arithmetic. Outer x=-3, locally shadowing inner x=-8, c=-1. Give (outer x+c, inner x+c) as integers; the inner binding does not mutate the outer one.",
      "answer": {
        "kind": "expression",
        "value": "(-4, -9)",
        "explanation": "Use each scope’s own binding before adding c; lexical shadowing is not assignment to the outer environment. The exact result, retaining the requested order, is (-4, -9)."
      },
      "skills": [
        "Outer and Lexically Shadowed Values"
      ],
      "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": "有理數Q；表達式非方程式。外層x=-3，內層局部x=-8詞法遮蔽外層，c=-1。依序求外層及內層x+c的整數值。",
        "en": "All operations and evaluations are exact in Q, not truncated natural-number arithmetic. Outer x=-3, locally shadowing inner x=-8, c=-1. Give (outer x+c, inner x+c) as integers; the inner binding does not mutate the outer one."
      }
    }
  ],
  "steps": [
    {
      "id": "S001",
      "uses": [
        "G001"
      ],
      "before": "typed rational expression and explicitly given environment",
      "after": "evaluation,not solving an equation",
      "relation": "implies",
      "rule_id": "expression_environment_scope",
      "conditions": [],
      "explanation": {
        "zh-Hant": "表達式求值不是求解方程式；只把明示環境代入，不反推未知根或擅改綁定。",
        "en": "Evaluating an expression is not solving an equation;substitute only the supplied environment without inventing roots or changing bindings."
      },
      "reverse_audit": {
        "kind": "premise_and_result_audit",
        "explanation": {
          "zh-Hant": "回到原始資料與本步條件核對，不把單向推論誤稱等價。",
          "en": "Check against the original data and this step's premises; a one-way implication is not an equivalence."
        }
      },
      "arithmetic": null
    },
    {
      "id": "S002",
      "uses": [
        "G001",
        "S001"
      ],
      "before": "outer x+c := sum(-3, -1)",
      "after": "outer x+c = -4",
      "relation": "calculation",
      "rule_id": "exact_rational_arithmetic",
      "conditions": [],
      "explanation": {
        "zh-Hant": "外層使用自己的x綁定。",
        "en": "The outer expression uses its own x binding."
      },
      "reverse_audit": {
        "kind": "premise_and_result_audit",
        "explanation": {
          "zh-Hant": "以精確有理數重算 outer x+c，不以小數近似替代。",
          "en": "Recompute outer x+c with exact rational arithmetic, not rounded decimals."
        }
      },
      "arithmetic": {
        "operation": "sum",
        "inputs": [
          "-3",
          "-1"
        ],
        "output": "-4",
        "label": "outer x+c"
      }
    },
    {
      "id": "S003",
      "uses": [
        "G001",
        "S002"
      ],
      "before": "inner x+c := sum(-8, -1)",
      "after": "inner x+c = -9",
      "relation": "calculation",
      "rule_id": "exact_rational_arithmetic",
      "conditions": [],
      "explanation": {
        "zh-Hant": "內層使用局部遮蔽後的x綁定。",
        "en": "The inner expression uses its local shadowing binding."
      },
      "reverse_audit": {
        "kind": "premise_and_result_audit",
        "explanation": {
          "zh-Hant": "以精確有理數重算 inner x+c，不以小數近似替代。",
          "en": "Recompute inner x+c with exact rational arithmetic, not rounded decimals."
        }
      },
      "arithmetic": {
        "operation": "sum",
        "inputs": [
          "-8",
          "-1"
        ],
        "output": "-9",
        "label": "inner x+c"
      }
    },
    {
      "id": "S004",
      "uses": [
        "G001",
        "S003"
      ],
      "before": "outer x=-3;local inner x=-8",
      "after": "outer x after inner evaluation=-3",
      "relation": "implies",
      "rule_id": "lexical_shadow_no_outer_mutation",
      "conditions": [],
      "explanation": {
        "zh-Hant": "局部遮蔽不是對外層變數賦值；離開內層後原外層綁定不變。",
        "en": "Local shadowing is not assignment to the outer variable;the original outer binding survives the inner evaluation."
      },
      "reverse_audit": {
        "kind": "premise_and_result_audit",
        "explanation": {
          "zh-Hant": "回到原始資料與本步條件核對，不把單向推論誤稱等價。",
          "en": "Check against the original data and this step's premises; a one-way implication is not an equivalence."
        }
      },
      "arithmetic": null
    }
  ],
  "math_model": {
    "result": [
      "-4",
      "-9"
    ],
    "outer_after_inner": -3
  },
  "conclusion": {
    "canonical_value": "(-4, -9)",
    "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-20261008-advance-20261011-r03-variable-expression-foundations",
      "batch_path": "public/data/questions/batches/batch-20261008-advance-20261011-r03-variable-expression-foundations/questions.jsonl",
      "batch_sha256": "62cfe30aaffc9d75ac212c2a5a4338aa58a8acb9aa7a328ac228475f96d02fb6",
      "original_line": 60,
      "original_line_sha256": "49fcd1c0a45f922c322b5b07b0d74abed85e5369d2a1b714e10256d558a2f43d",
      "question_compact_sha256": "57f84983649cdd3ea44cf942fdcc89f4db0bbb82ead528b55a83d1363fa608e7",
      "english_row_compact_sha256": "120bfb5fa05bdc954f46b64d55181129d3088bde009ecd0e6e41c96721877664",
      "english_manifest_path": "public/data/i18n/editions/batch-20261008-advance-20261011-r03-variable-expression-foundations.en.json",
      "english_rows_path": "public/data/i18n/questions/batch-20261008-advance-20261011-r03-variable-expression-foundations.en.jsonl"
    },
    "mko_bindings": {
      "mko-variable-expression": {
        "sha256": "da4b6e4a4edfd379a38b6535fd3030cc5c552e2b549572c0d4733d68974a292c",
        "english_sha256": "4a8cfbcc1fa5d73c360d18a95f35f69578250d0104baf76036f4efc8de9d7e81",
        "original_path": "public/data/mko/variable-expression.json",
        "english_path": "public/data/i18n/editions/mko-variable-expression.en.json"
      }
    },
    "selected_manifest_sha256": "5233edba9654a6cffd8b6b2d83c932f82ded15f9c0b7c733bd049943e672acff",
    "selected_part_sha256": "6dc34e24b0f43c50e49365ca1a1153175f8661d5290c9236df5527bb047157eb",
    "original_candidate_sha256": "3415c8e43a50642b282dba9165eac8b7bd8dffd6b8ad51453184c6012da2ddba",
    "original_candidate_line_sha256": "3415c8e43a50642b282dba9165eac8b7bd8dffd6b8ad51453184c6012da2ddba"
  },
  "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-004-p9",
    "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": "b6e05a3e8193a93db505dbf337528fca72e2e41528b1e92b698a3f0683d74289",
      "question_first_witness_sha256": "caa8693baf0b91acd09a20215d1aa6954ae513fc0b0814f26ac1c8c834b60d67"
    },
    "status": "second_context_reviewed",
    "mathematical_semantics": true,
    "bilingual_semantics": true,
    "steps_reviewed": 4,
    "method": "family_template_semantic_review_plus_independent_per_instance_reconstruction",
    "exact_question_first_check": {
      "model_sha256": "ce4e100d6c481400d824be89c5da4562dec375b3248a75b5fd0726ebaa776fe7",
      "arithmetic_steps": 2
    },
    "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."
  }
}
