Type a Boolean identity applicationExact type reconstruction · 1 judgment
The problem
Reconstruct the type of (λx:Bool. x) true in the simply typed lambda fragment.
The checked result
Reconstructed type: Bool.
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.
Why the checker accepts it
- 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.
Formal 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 and evidence
{
"claim": {
"type": "Bool"
},
"witness": {
"method": "syntax-directed reconstruction"
}
}Dataset construction
Deterministic finite fixture; full enumeration or witness replay as stated. Structured JSON; field meanings are stated in the specification. Acceptance covers 1 checker units for this record; the unit type is stated in its verification scope.
Complexity and limits
The syntax-directed checker visits each term node; context lookup and type comparison add implementation-dependent cost.
A single typing judgment; no proof of type soundness, normalization, or full language implementation.
A boundary to investigate
Being well typed is not, by itself, a proof of preservation or progress. Add independently checked derivation trees and a broader type grammar.