{
  "id": "KL-FCS-004",
  "version": "1.0.0",
  "domain": "Type systems",
  "kind": "types",
  "title": "Type a Boolean identity application",
  "problem": "Reconstruct the type of (λx:Bool. x) true in the simply typed lambda fragment.",
  "specification": {
    "term": [
      "app",
      [
        "lam",
        "x",
        "Bool",
        [
          "var",
          "x"
        ]
      ],
      [
        "bool",
        true
      ]
    ],
    "rules": "Boolean literals have Bool; variables use the context; abstractions form arrows; applications require an exact domain match."
  },
  "claim": {
    "type": "Bool"
  },
  "witness": {
    "method": "syntax-directed reconstruction"
  },
  "verification_scope": "Exact type reconstruction · 1 judgment",
  "explanation": "The abstraction has type Bool → Bool. Its argument has type Bool, so application produces Bool. The checker reconstructs these types from syntax and an initially empty context.",
  "limitations": "A single typing judgment; no proof of type soundness, normalization, or full language implementation.",
  "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/Stlc.html"
  ],
  "license_status": "not-yet-selected",
  "dataset": {
    "family": "type-systems",
    "task": "Reconstruct the type of (λx:Bool. x) true in the simply typed lambda fragment.",
    "input_encoding": "Structured JSON; field meanings are stated in the specification.",
    "coverage": "Exact type reconstruction · 1 judgment",
    "acceptance": [
      "Walk the term recursively from an empty context.",
      "Extend the context when entering an annotated lambda.",
      "Construct arrow types for abstractions.",
      "At each application, check the argument type and return the codomain."
    ],
    "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": "Reconstruct a typing judgment from syntax, annotations, and context. Separate the validity of one judgment from the soundness of a language.",
    "definitions": [
      {
        "term": "Context",
        "definition": "A map assigning types to variables currently in scope."
      },
      {
        "term": "Arrow type",
        "definition": "A function domain and codomain, written A → B."
      },
      {
        "term": "Application rule",
        "definition": "A function may be applied only to an argument matching its domain type."
      }
    ],
    "reasoning": [
      "Walk the term recursively from an empty context.",
      "Extend the context when entering an annotated lambda.",
      "Construct arrow types for abstractions.",
      "At each application, check the argument type and return the codomain."
    ],
    "worked_example": "The abstraction has type Bool → Bool. Its argument has type Bool, so application produces Bool. The checker reconstructs these types from syntax and an initially empty context.",
    "complexity": "The syntax-directed checker visits each term node; context lookup and type comparison add implementation-dependent cost.",
    "common_error": "Being well typed is not, by itself, a proof of preservation or progress.",
    "further_work": "Add independently checked derivation trees and a broader type grammar."
  },
  "related_ids": [
    "KL-FCS-018",
    "KL-FCS-019"
  ]
}
