{
  "name": "Type systems",
  "version": "1.0.0",
  "area": {
    "name": "Type systems",
    "slug": "type-systems",
    "group": "Languages & logic",
    "kind": "types",
    "summary": "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."
      }
    ],
    "methodology": [
      "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."
    ],
    "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.",
    "next_question": "Add independently checked derivation trees and a broader type grammar.",
    "references": [
      "https://softwarefoundations.cis.upenn.edu/plf-current/Stlc.html"
    ]
  },
  "records": [
    {
      "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"
      ]
    },
    {
      "id": "KL-FCS-018",
      "version": "1.0.0",
      "domain": "Type systems",
      "kind": "types",
      "title": "The Boolean identity function",
      "problem": "Reconstruct the type under Boolean binders and lexical scope.",
      "specification": {
        "term": [
          "lam",
          "x",
          "Bool",
          [
            "var",
            "x"
          ]
        ],
        "rules": "Boolean literals, contextual variables, annotated lambdas, and exact-domain applications."
      },
      "claim": {
        "type": [
          "arrow",
          "Bool",
          "Bool"
        ]
      },
      "witness": {
        "method": "syntax-directed reconstruction"
      },
      "verification_scope": "Exact syntax-directed typing judgment",
      "explanation": "The binder extends the context for its body. The inner lambda preserves access to outer bindings, and the resulting type records each input separately.",
      "limitations": "Only the declared lambda fragment is checked; no inference of polymorphic or dependent types occurs.",
      "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 under Boolean binders and lexical scope.",
        "input_encoding": "Structured JSON; field meanings are stated in the specification.",
        "coverage": "Exact syntax-directed typing 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 binder extends the context for its body. The inner lambda preserves access to outer bindings, and the resulting type records each input separately.",
        "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-004",
        "KL-FCS-019"
      ]
    },
    {
      "id": "KL-FCS-019",
      "version": "1.0.0",
      "domain": "Type systems",
      "kind": "types",
      "title": "A curried constant function",
      "problem": "Reconstruct the type under Boolean binders and lexical scope.",
      "specification": {
        "term": [
          "lam",
          "x",
          "Bool",
          [
            "lam",
            "y",
            "Bool",
            [
              "var",
              "x"
            ]
          ]
        ],
        "rules": "Boolean literals, contextual variables, annotated lambdas, and exact-domain applications."
      },
      "claim": {
        "type": [
          "arrow",
          "Bool",
          [
            "arrow",
            "Bool",
            "Bool"
          ]
        ]
      },
      "witness": {
        "method": "syntax-directed reconstruction"
      },
      "verification_scope": "Exact syntax-directed typing judgment",
      "explanation": "The binder extends the context for its body. The inner lambda preserves access to outer bindings, and the resulting type records each input separately.",
      "limitations": "Only the declared lambda fragment is checked; no inference of polymorphic or dependent types occurs.",
      "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 under Boolean binders and lexical scope.",
        "input_encoding": "Structured JSON; field meanings are stated in the specification.",
        "coverage": "Exact syntax-directed typing 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 binder extends the context for its body. The inner lambda preserves access to outer bindings, and the resulting type records each input separately.",
        "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-004",
        "KL-FCS-018"
      ]
    }
  ],
  "verification": [
    {
      "id": "KL-FCS-004",
      "status": "mechanically-checked",
      "check_units": 1,
      "scope": "Exact type reconstruction · 1 judgment",
      "review_status": "awaiting-independent-review"
    },
    {
      "id": "KL-FCS-018",
      "status": "mechanically-checked",
      "check_units": 1,
      "scope": "Exact syntax-directed typing judgment",
      "review_status": "awaiting-independent-review"
    },
    {
      "id": "KL-FCS-019",
      "status": "mechanically-checked",
      "check_units": 1,
      "scope": "Exact syntax-directed typing judgment",
      "review_status": "awaiting-independent-review"
    }
  ]
}
