{
  "id": "KL-FCS-027",
  "version": "1.0.0",
  "domain": "Compiler optimization",
  "kind": "compiler",
  "title": "Triple a six-bit value by addition",
  "problem": "Check a pure unsigned modular rewrite at every input.",
  "specification": {
    "width": 6,
    "source": "x * 3",
    "semantics": "Pure unsigned 6-bit arithmetic modulo 64, with no side effects."
  },
  "claim": {
    "equivalent": true
  },
  "witness": {
    "replacement": "(x + x) + x"
  },
  "verification_scope": "Complete equivalence · 64 inputs",
  "explanation": "The checker evaluates both expressions at every representable value. Overflow wraps identically in the two expressions.",
  "limitations": "The result does not transfer automatically to signed-overflow undefined behavior or effectful expressions.",
  "verification_status": "mechanically-checked",
  "review_status": "awaiting-independent-review",
  "provenance": {
    "origin": "Original Kenton Labs reference instance, authored with Codex assistance on 2026-10-11.",
    "external_dataset": null,
    "model_run": null
  },
  "references": [
    "https://softwarefoundations.cis.upenn.edu/plf-current/Smallstep.html"
  ],
  "license_status": "not-yet-selected",
  "dataset": {
    "family": "compiler",
    "task": "Check a pure unsigned modular rewrite at every input.",
    "input_encoding": "Structured JSON; field meanings are stated in the specification.",
    "coverage": "Complete equivalence · 64 inputs",
    "acceptance": [
      "Enumerate every value at the chosen bit width.",
      "Evaluate the source expression modulo 2ʷ.",
      "Evaluate the replacement under the same semantics.",
      "Compare outputs, including wraparound inputs."
    ],
    "generation": "Deterministic finite fixture; full enumeration or witness replay as stated.",
    "split_policy": "Reference corpus for exposition and reproduction; no train/test evaluation split is claimed."
  },
  "lesson": {
    "motivation": "A rewrite is correct when source and target agree under the exact language semantics and observable behavior.",
    "definitions": [
      {
        "term": "Semantic equivalence",
        "definition": "The same observable result for every input in the declared domain."
      },
      {
        "term": "Modular arithmetic",
        "definition": "Arithmetic wraps modulo 2ʷ for width w."
      },
      {
        "term": "Strength reduction",
        "definition": "Replacing an operation with another expression whose performance must be evaluated separately."
      }
    ],
    "reasoning": [
      "Enumerate every value at the chosen bit width.",
      "Evaluate the source expression modulo 2ʷ.",
      "Evaluate the replacement under the same semantics.",
      "Compare outputs, including wraparound inputs."
    ],
    "worked_example": "The checker evaluates both expressions at every representable value. Overflow wraps identically in the two expressions.",
    "complexity": "Unary width-w equivalence by enumeration checks 2ʷ inputs. This is practical for small widths, not a general large-program optimizer.",
    "common_error": "Correctness is not a speedup claim; duplicating an expression with side effects can be invalid.",
    "further_work": "Add expression DAGs, observable-state semantics, and checked equivalence certificates."
  },
  "related_ids": [
    "KL-FCS-011",
    "KL-FCS-026"
  ]
}
