{
  "id": "KL-FCS-009",
  "version": "1.0.0",
  "domain": "Circuit minimization",
  "kind": "circuits",
  "title": "XOR with a minimum NAND count",
  "problem": "Find the fewest two-input NAND gates for XOR(a,b), with acyclic wiring, reusable signals, unrestricted fan-out, no constants, and one gate-output signal.",
  "specification": {
    "truth_table": 6,
    "row_order": "00, 01, 10, 11; row i is bit i",
    "gate_basis": "two-input NAND; repeated inputs permitted; no constants"
  },
  "claim": {
    "minimum_gates": 4
  },
  "witness": {
    "gates": [
      [
        0,
        1
      ],
      [
        0,
        2
      ],
      [
        1,
        2
      ],
      [
        3,
        4
      ]
    ]
  },
  "verification_scope": "Witness truth table + complete smaller-circuit search",
  "explanation": "The four-gate witness yields the XOR truth table. The checker enumerates every topologically ordered circuit with fewer than four gates, identifying symmetric NAND inputs, and finds none that implements XOR.",
  "limitations": "Minimality is relative to this precise gate basis and wiring model. It says nothing about transistor count, delay, power, or other gate libraries.",
  "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://ocw.mit.edu/courses/6-006-introduction-to-algorithms-fall-2011/"
  ],
  "license_status": "not-yet-selected",
  "dataset": {
    "family": "circuits",
    "task": "Find the fewest two-input NAND gates for XOR(a,b), with acyclic wiring, reusable signals, unrestricted fan-out, no constants, and one gate-output signal.",
    "input_encoding": "Structured JSON; field meanings are stated in the specification.",
    "coverage": "Witness truth table + complete smaller-circuit search",
    "acceptance": [
      "Evaluate the witness circuit in topological signal order.",
      "Compare its complete truth table with the target function.",
      "Enumerate all smaller acyclic circuits, identifying symmetric NAND inputs.",
      "Reject minimality if any smaller circuit implements the target."
    ],
    "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 working circuit proves an upper bound. Minimality additionally requires ruling out every smaller circuit in the stated gate model.",
    "definitions": [
      {
        "term": "Gate basis",
        "definition": "The allowed primitive Boolean operations; this family uses two-input NAND."
      },
      {
        "term": "Truth-table signature",
        "definition": "The complete output function over the four input rows 00, 01, 10, 11."
      },
      {
        "term": "Cost model",
        "definition": "Gate count, with acyclic wiring, reusable signals, and unrestricted fan-out."
      }
    ],
    "reasoning": [
      "Evaluate the witness circuit in topological signal order.",
      "Compare its complete truth table with the target function.",
      "Enumerate all smaller acyclic circuits, identifying symmetric NAND inputs.",
      "Reject minimality if any smaller circuit implements the target."
    ],
    "worked_example": "The four-gate witness yields the XOR truth table. The checker enumerates every topologically ordered circuit with fewer than four gates, identifying symmetric NAND inputs, and finds none that implements XOR.",
    "complexity": "The circuit search grows rapidly with gate count. This family keeps two inputs and at most four witness gates.",
    "common_error": "Gate-count minimality does not imply minimum delay, energy, area, or transistor count.",
    "further_work": "Add independently checked lower bounds and additional gate libraries."
  },
  "related_ids": [
    "KL-FCS-022",
    "KL-FCS-023"
  ]
}
