The simply typed lambda-calculus (STLC) is a tiny core
calculus embodying the key concept of functional abstraction.
This concept shows up in pretty much every real-world programming
language in some form (functions, procedures, methods, etc.).
We will follow exactly the same pattern as in the previous chapter
when formalizing this calculus (syntax, small-step semantics,
typing rules) and its main properties (progress and preservation).
The new technical challenges arise from the mechanisms of
variable binding and substitution. It will take some work to
deal with these.
The STLC lives in the lower-left front corner of the famous
lambda cube (also called the Barendregt Cube), which
visualizes three sets of features that can be added to its
simple core:
Moving from bottom to top in the cube corresponds to adding
polymorphic types like ∀α:Type,α→α. Adding just
polymorphism gives us the famous Girard-Reynolds calculus, System F.
Moving from front to back corresponds to adding type operators
like List.
Moving from left to right corresponds to adding dependent types
like ∀nm:Nat,n=m.
The top right corner on the back, which combines all three features,
is called the Calculus of Constructions. First studied by
Coquand and Huet, it forms the foundation of Lean's logic.
The STLC is built on some collection of base types:
booleans, numbers, strings, etc. The exact choice of base types
doesn't matter much — the definition of the language as well as
its theoretical properties work out the same no matter what we
choose — so for the sake of brevity let's take just Bool for
the moment. In the next chapter we'll see how to add more
base types, and in later chapters we'll enrich the pure STLC with
other useful constructs like pairs, records, subtyping, and
mutable state.
Starting from boolean constants and conditionals, we add three
things:
variables
function abstractions
application
This gives us the following collection of abstract syntax
constructors (written out first in informal BNF notation — we'll
formalize it below) for STLC terms t.
t
::=
x
(variable)
|
λx:T.t
(abstraction)
|
tt
(application)
|
true
(constant true)
|
false
(constant false)
|
iftthentelset
(conditional)
The Greek letter λ ("lambda") in a function abstraction λx:T. t is what gives
the calculus its name. The variable x is called the parameter to the
function; the term t is its body. The annotation :T
specifies the type of arguments that the function can be applied to.
The types of the STLC include Bool, which classifies the
boolean constants true and false as well as more complex
computations that yield booleans, plus arrow types that classify
functions (as is the case in Lean).
T
::=
Bool
|
T→T
Some examples of STLC terms:
λx:Bool. x
The identity function for booleans.
(λx:Bool. x) true
The identity function for booleans, applied to the boolean true.
λx:Bool. if x then false else true
The boolean "not" function.
λx:Bool. true
The constant function that takes every (boolean) argument to
true.
λx:Bool. λy:Bool. x
A two-argument function that takes two booleans and returns
the first one.
(As in Lean, a two-argument function in the
lambda-calculus is really a one-argument function whose body
is also a one-argument function.)
(λx:Bool. λy:Bool. x) false true
A two-argument function that takes two booleans and returns
the first one, applied to the booleans false and true.
(As in Lean, application associates to the left — i.e., this
expression is parsed as ((λx:Bool. λy:Bool. x) false) true.)
λf:Bool → Bool. f (f true)
A higher-order function that takes a functionf (from
booleans to booleans) as an argument, applies f to true,
and applies f again to the result.
(λf:Bool → Bool. f (f true)) (λx:Bool. false)
The same higher-order function, applied to the constantly
false function.
The last two examples show, the STLC is a language of
higher-order functions: we can write down functions that take
other functions as arguments and/or return other functions as results.
The STLC doesn't provide any primitive syntax for defining named
functions: i.e., all functions are "anonymous." We'll see in chapter
MoreStlc that it is easy to add named functions — indeed, the
fundamental naming and binding mechanisms are exactly the same.
Now reconsider our examples, each along with its type:
λx:Bool. x has type Bool → Bool
(λx:Bool. x) true has type Bool
λx:Bool. if x then false else true has type Bool → Bool
λx:Bool. true has type Bool → Bool
λx:Bool. λy:Bool. x has type Bool → Bool → Bool
(i.e., Bool → (Bool → Bool))
(λx:Bool. λy:Bool. x) false true has type Bool
The last two, higher-order examples are left off the list on purpose — working out
their types is the subject of the quizzes that follow.
The constructors above give us a precise representation of STLC syntax, but
expressions written directly with them quickly become hard to read.
We need some notation magic to set up the concrete syntax, as
we did in the Types chapter...
We will write STLC syntax inside <{ ... }> brackets. For example,
<{ λ X : Bool . X }> represents the term
Tm.abs"X"Ty.bool(Tm.var"X").
This notation must also support definitions and proofs about arbitrary piece of STLC
syntax. For example, a theorem may introduce Lean variables t : Tm and
τ : Ty, representing an arbitrary STLC term and type. Inside the brackets,
we can then write <{ λ X : τ . t }>.
Here X is the name of a variable in the
STLC term being represented, while τ and t refer to the Lean variables in
the surrounding theorem.
The notation distinguishes these two uses by naming convention, which we will follow
throughout the STLC chapters:
A name beginning with a capital Latin letter is taken literally as a name in
the STLC syntax. Thus X, Y, and Z are STLC term variables. Such a
name must be a single Lean identifier and cannot contain a dot. In languages
with named base types, which we will see in the Sub chapter,
names such as A, Int, and Bool name those types.
A name beginning with a lowercase letter or a Greek letter refers to a Lean
variable in the surrounding definition or proof. This lets us use the usual
names x and y for strings, t and u for terms, τ for types, and Γ
for contexts without additional punctuation.
To insert a larger Lean expression, prefix it with ~. For example,
<{ ~(Tm.var "X") t }> inserts the expression Tm.var"X" as the function
and the Lean variable t as its argument. The same escape is needed to
insert a capitalized Lean variable, since an unescaped capitalized name is
assumed to be an STLC name.
This capitalization convention applies to actual variable names in concrete
STLC examples and inside <{ ... }> brackets. In grammars, inference rules,
and general explanations, symbols such as x, t, and T instead stand for
an arbitrary variable name, term, or type. We keep the conventional lowercase
notation for these schematic symbols.
Notation encodingsyntax:50"if "stlcTm:51" then "stlcTm:50" else "stlcTm:50:stlcTmnamespaceElabopenStlcCommonopenLeanMetaElabTermdeflanguage:LanguagewheretyType:=``TytmType:=``TmarrowCtor:=``Ty.arrowvarCtor:=``Tm.varappCtor:=``Tm.appabsCtor:=``Tm.abs-- defined latersubst:=`Stlc.substhasType:=`Stlc.HasTypedefboolTyHandler:TyElabHandler:=fun_recurkT=>domatchTwith|`(stlcTy|Bool)=>returnmkConst``Ty.bool|_=>kTdeftyHandlers:TyElabHandler:=boolTyHandler.orElse(commonTyHandlerlanguage)partialdefelabTy:TyElab:=tyHandlerselabTy<|unsupportedTylanguagedefboolTmHandler:TmElabHandler:=funrecurkΓfreet=>domatchtwith|`(stlcTm|true)=>doreturn(mkConst``Tm.tru,free)|`(stlcTm|false)=>doreturn(mkConst``Tm.fls,free)|`(stlcTm|Bool)=>dothrowError"`Bool` is not a valid term."|`(stlcTm|if$c:stlcTmthen$t:stlcTmelse$e:stlcTm)=>dolet(c,free)←recurΓfreeclet(t,free)←recurΓfreetlet(e,free)←recurΓfreeereturn(mkApp3(mkConst``Tm.ite)cte,free)|_=>kΓfreetdeftmHandlers:TmElabHandler:=boolTmHandler.orElse(commonTmHandlerlanguageelabTy)partialdefelabTm:TmElab:=tmHandlerselabTmunsupportedTmdefelabCtx:CtxElab:=elabCtxCommonlanguageelabTy@[scopedterm_elabStlcCommon.bracket]defelabBracket:TermElab:=funstxexpectedType?=>dolet`(<{$q:stlcQuoted}>):=stx|throwUnsupportedSyntaxelabQuotedlanguageelabTyelabTmelabCtxqexpectedType?endElabopenscopedElabnamespaceDelabopenStlcCommonDelabopenLeanPrettyPrinterDelaborator@[app_unexpanderTy.bool]privatedefTy.unexpandBool:Unexpander|_=>doletT←`(stlcTy|$(mkIdent`Bool):ident)`(<{$T:stlcTy}>)@[app_unexpanderTy.arrow]privatedefTy.unexpandArrow:Unexpander:=Delab.unexpandArrow@[app_unexpanderTm.tru]privatedefTm.unexpandTru:Unexpander|_=>dolett←`(stlcTm|$(mkIdent`true):ident)`(<{$t:stlcTm}>)@[app_unexpanderTm.fls]privatedefTm.unexpandFls:Unexpander|_=>dolett←`(stlcTm|$(mkIdent`false):ident)`(<{$t:stlcTm}>)privatedefreservedNames:String→Bool|"true"|"false"|"Bool"=>true|_=>false@[app_unexpanderTm.var]privatedefTm.unexpandVar:Unexpander:=Delab.unexpandVarreservedNames``Tm.var@[app_delabTm.var]privatedefTm.delabVar:Delab:=Delab.delabVar``Tm.var@[app_unexpanderTm.app]privatedefTm.unexpandApp:Unexpander:=Delab.unexpandApp@[app_unexpanderTm.abs]privatedefTm.unexpandAbs:Unexpander:=Delab.unexpandAbs@[app_unexpanderTm.ite]privatedefTm.unexpandIte:Unexpander|`($_$c$t$e)=>`(<{if$(getTmc)then$(getTmt)else$(getTme)}>)|_=>throw()endDelab
Here are the terms we will use as running examples, written in the new
notation:
Note that an abstraction λ x : T . t (formally, Tm.abs applied to
x, T, and t) is
always annotated with the type T of its parameter, in contrast
to Lean (and other functional languages like ML, Haskell, etc.),
which use type inference to fill in missing annotations. We're
not considering type inference at all here.
To define the small-step semantics of STLC terms, we begin,
as always, by defining the set of values. Next, we define the
critical notions of free variables and substitution, which are
used in the reduction rule for application expressions. And
finally we give the small-step relation itself.
To define the values of the STLC, we have a few cases to consider.
First, for the boolean part of the language, the situation is
clear: true and false are the only values. An if expression
is never a value.
Second, an application is not a value: it represents a function
being invoked on some argument, which clearly still has work left
to do.
Third, for abstractions, we have a choice:
We can say that λx:T. t is a value only when t is a
value — i.e., only if the function's body has been
reduced (as much as it can be without knowing what argument it
is going to be applied to).
Or we can say that λx:T. t is always a value, no matter
whether t is one or not — in other words, we can say that
reduction stops at abstractions.
Our usual way of evaluating expressions in Lean makes the first
choice — for example,
fun_x=>7#reducefun_x:Bool=>3+4
yields:
fun _x => 7
But Lean is rather unusual in this respect. Most functional
programming languages make the second choice — reduction of a
function's body only begins when the function is actually applied
to an argument.
The example terms named above are all abstractions, hence all values. We
record that once each, so that the reduction examples can cite the fact by name
instead of unfolding the definition again at every use.
Finally, we must consider what constitutes a complete program.
Intuitively, a "complete program" must not refer to any undefined
variables. We'll see shortly how to define the free variables
in a STLC term. A complete program, then, is one that is
closed — that is, that contains no free variables.
(Conversely, a term that may contain free variables is often
called an open term.)
Note to developers (Chris Henson @chenson2018, before next release)
Is the "shortly" above setting wrong expectations?
Where exactly are we defining the free variables in a STLC term?
BCP 25: Indeed, we need to define "free"!
Having made the choice not to reduce under abstractions, we don't
need to worry about whether variables are values, since we'll
always be reducing programs "from the outside in," and that means
the step relation will always be working with closed terms.
Now we come to the heart of the STLC: the operation of
substituting one term for a variable in another term. This
operation is used below to define the operational semantics of
function application, where we will need to substitute the
argument term for the function parameter in the function's body.
For example, we reduce
(λX:Bool. if X then true else X) false
to
if false then true else false
by substituting false for the parameter X in the body of the
function.
In general, we need to be able to substitute some given term s
for occurrences of some variable x in another term t.
Informally, this is written [x:=s]t and pronounced "substitute
s for x in t."
Here are some examples:
[X:=true] (if X then true else false)
yields if true then true else false
[X:=true] X yields true
[X:=true] (if X then X else Y) yields if true then true else Y
[X:=true] (λY:Bool. if Y then X else false)
yields λY:Bool. if Y then true else false
[X:=true] (λY:Bool. X) yields λY:Bool. true
[X:=true] (λY:Bool. Y) yields λY:Bool. Y
[X:=true] (λX:Bool. X) yields λX:Bool. X
The last example is illuminating: substituting X with true in
λX:Bool. X does not yield λX:Bool. true! The reason for
this is that the X in the body of λX:Bool. X is bound by the
abstraction: it is a new, local name that just happens to be
spelled the same as some global name X.
Here is the definition, informally...
[x:=s]x = s
[x:=s]y = y if x ≠ y
[x:=s](λx:T. t) = λx:T. t
[x:=s](λy:T. t) = λy:T. [x:=s]t if x ≠ y
[x:=s](t₁ t₂) = ([x:=s]t₁) ([x:=s]t₂)
[x:=s]true = true
[x:=s]false = false
[x:=s](if t₁ then t₂ else t₃) =
if [x:=s]t₁ then [x:=s]t₂ else [x:=s]t₃
Note that due to an unfortunate limitation of Lean's notation system, we
must use constructor names for match statements rather than our custom syntax.
As we did for the evaluators in the Slang chapter, we pair the
definition with one simplification lemma per constructor, saying how subst
behaves on that constructor. The variable and abstraction cases
each need two lemmas, since substitution treats a bound name differently
depending on whether it is the name being substituted for.
Technical note: Substitution becomes trickier to define if
we consider the case where s, the term being substituted for a
variable in some other term, may itself contain free variables.
We say that s is an open term.
Here is an example. Using the above definition to substitute the open term
s = λX:Bool. R
(where R is a free reference to some global resource) for
the free variable Z in the term
t = λR:Bool. Z
where R is a bound variable, we would get
λR:Bool. λX:Bool. R
where the free reference to R in s has been "captured" by the
binder at the beginning of t.
Why would this be bad? Because it violates the principle that the
names of bound variables do not matter. For example, if we rename
the bound variable in t, e.g., let
t' = λW:Bool. Z
then [Z:=s]t' is
λW:Bool. λX:Bool. R
which does not behave the same as the substituting in the original t:
[Z:=s]t = λR:Bool. λX:Bool. R
That is, renaming a bound variable in t would change how t
behaves under our simple substitution. So substitution gets more
complicated in that setting, but fortunately we don't have that
problem in our STLC variant.
Fortunately, since we are only interested here in defining the
step relation on closed terms (i.e., terms like λX:Bool. X
that include binders for all of the variables they mention), we
can sidestep this extra complexity, but it must be dealt with when
formalizing richer languages.
Exercise★★★(substi_correct)
The definition that we gave above defines substitution as a
function. Suppose, instead, we wanted to define substitution as an
inductive relationSubsti.
We've begun the definition by providing the inductive header and
one of the constructors; your job is to fill in the rest of the
constructors and prove that the relation you've defined coincides
with the function given above.
The small-step reduction relation for STLC now follows the
same pattern as the ones we have seen before. Intuitively, to
reduce a function application, we first reduce its left-hand
side (the function) until it becomes an abstraction; then we
reduce its right-hand side (the argument) until it is also a
value; and finally we substitute the argument for the bound
variable in the body of the abstraction. This last rule, written
informally as
-------------------------------- (ifTrue)
(if true then t₁ else t₂) ⟶ t₁
--------------------------------- (ifFalse)
(if false then t₁ else t₂) ⟶ t₂
t₁ ⟶ t₁'
---------------------------------------------------- (ifStep)
(if t₁ then t₂ else t₃) ⟶ (if t₁' then t₂ else t₃)
This is call by value reduction: to reduce an
application (t₁ t₂), we
first reduce t₁ to a value: a function λx:T. t
then reduce the argument t₂ to a value v
then reduce the application itself by substituting v for
the bound variable x in the body t.
Formally:
sectionset_optionhygienefalseinlocalnotation:40t:41" ⟶ "t':41=>Steptt'inductiveStep:Tm→Tm→Propwhere|appAbs(x:String)(τ:Ty)(tv:Tm)(hv:v.IsValue):<{(λx:τ.t)v}>⟶<{[x:=v]t}>|app1(t₁t₁'t₂:Tm)(h:t₁⟶t₁'):<{t₁t₂}>⟶<{t₁'t₂}>|app2(v₁t₂t₂':Tm)(hv:v₁.IsValue)(h:t₂⟶t₂'):<{v₁t₂}>⟶<{v₁t₂'}>|ifTrue(t₁t₂:Tm):<{iftruethent₁elset₂}>⟶t₁|ifFalse(t₁t₂:Tm):<{iffalsethent₁elset₂}>⟶t₂|ifStep(t₁t₁'t₂t₃:Tm)(h:t₁⟶t₁'):<{ift₁thent₂elset₃}>⟶<{ift₁'thent₂elset₃}>endscopednotation:40t:41" ⟶ "t':41=>Steptt'scopednotation:40t:41" ⟶* "t':41=>MultiSteptt'-- for later use with `normalize`attribute[StlcEval]Step.appAbsStep.app1Step.app2Step.ifTrueStep.ifFalseStep.ifStep
As in the Smallstep chapter, ⟶* is the multi-step closure
of ⟶ — that is, Multi applied to this chapter's step relation. We
inherit its reflexivity lemma along with it, so a zero-step execution goal
t ⟶* t is closed by rfl.
Although we are primarily interested in the binary relation
⊢ t ⦂ T, relating a closed term t to its type T, we need
to generalize a bit to make the definitions work.
Consider checking that λx:T₁₁. t₁₂ has type
T₁₁ → T₁₂. Intuitively, we need to check that t₁₂ has type
T₁₂. However, we have removed the binder λx, so x may occur
free in t₁₂ (that is, t₁₂ may be open). While checking that
t₁₂ has type T₁₂, we must remember that x has type T₁₁, in
order to deal with these free occurrences of x. Similarly, t₁₂
itself could contain abstractions, and typechecking their bodies
could require looking up the declared types of yet more free
variables.
To keep track of all this, we add a third element to the relation,
a typing contextΓ, which records the types of the
variables that may occur free in a term — that is, Γ is a
partial map from variables to types.
The new typing judgment is written Γ ⊢ t ⦂ T and
informally read as "term t has type T, given the types of free
variables in t as specified by Γ".
We'll also write x ↦ T ; Γ for "update the partial map
Γ so that it maps x to T," following the notation from
the Typeclasses chapter.
With these refinements, we are ready to give informal and formal
specifications of the typing relation.
Note to developers (Chris Henson @chenson2018, before next release)
I find the FULL explanation above much better than the
TERSE one below, since the question below seems ill-posed without
extra context. Why would one want to type a term X Y if we've
just said that we will just look at closed terms as our programs?
A context is a PartialMap from variable names to types — the partial
maps of the Typeclasses chapter, which are total maps whose values are
optional, so that none at a variable means "not bound here".
We can read the three-place relation Γ ⊢ t ⦂ T as:
"under the assumptions in Γ, the term t has the type T."
In the formal development, we write this judgment inside the same
<{ .. }> brackets we use for types and terms, as introduced by the
following notational conventions.
A context is written ∅ when empty and x ↦ τ ; Γ when extended with a
binding. The whole judgment then goes inside the same <{ … }> brackets as terms, written
with the turnstile and colon of the Types chapter:
<{ Γ ⊢ t ⦂ τ }>.
The derivation is small enough to write out directly: an abstraction rule
whose premise is the variable rule, and the variable rule's premise — that the
extended context maps X to Bool — holds by computation, hence rfl.
Much like reduction sequences, long derivations of typing rules can grow
quite tedious to prove. Luckily, we can have Lean automate proofs of this sort,
using another tactic: apply_rules. This tactic works much like
normalize, but is more efficient and will make progress even if it cannot
solve the goal outright. Like normalize, apply_rules also
takes a using argument which tells Lean which set of constructors to draw from.
It's worth noting that apply_rules relies on an important property
of our typing rules - namely, that they are syntax directed. A syntax directed
judgment is one where the syntax of a term completely determines which rule
can be applied at any given time; only one rule can be applied to each term.
This is important because apply_rules just applies the first rule in
its set of constructors or lemmas that it can - it doesn't backtrack if that rule
isn't correct. So, making sure that only one rule can apply to any given term
is important to ensure that apply_rules always discovers a valid
derivation, if one exists.
Exercise★★(typing_example_2_full) (Optional)
Prove the same result, applying one rule at a time and
naming the argument type of each application explicitly.
We can also show that some terms are not typable. For example,
we can check that there is no typing derivation assigning a type
to the term λX:Bool. λY:Bool. X Y — i.e.,
example:¬∃τσ,<{∅⊢λX:τ.XX⦂σ}>:=x:Stringy:Strings:Tmt:Tmt₁:Tmt₂:Tmt₃:Tmτ:Ty⊢ ¬∃τσ,<{∅⊢λX:τ.XX⦂σ}>solution!-- The two occurrences of `X` force its type `τ` to satisfy `τ = τ → σ`,-- and no (finite) type does.x:Stringy:Strings:Tmt:Tmt₁:Tmt₂:Tmt₃:Tmτ:Tyarrow_ne:∀(τ₁τ₂:Ty),τ₁≠<{τ₁→τ₂}>⊢ ¬∃τσ,<{∅⊢λX:τ.XX⦂σ}>intro⟨τ,σ,hc⟩x:Stringy:Strings:Tmt:Tmt₁:Tmt₂:Tmt₃:Tmτ✝:Tyarrow_ne:∀(τ₁τ₂:Ty),τ₁≠<{τ₁→τ₂}>τ:Tyσ:Tyhc:<{∅⊢λX:τ.XX⦂σ}>⊢ Falsecaseshcwith|abs_____h₁=>absx:Stringy:Strings:Tmt:Tmt₁:Tmt₂:Tmt₃:Tmτ✝:Tyarrow_ne:∀(τ₁τ₂:Ty),τ₁≠<{τ₁→τ₂}>τ:Tyτ₁✝:Tyh₁:<{X↦τ;∅⊢XX⦂τ₁✝}>⊢ Falsecasesh₁with|app_____hfha=>abs.appx:Stringy:Strings:Tmt:Tmt₁:Tmt₂:Tmt₃:Tmτ✝:Tyarrow_ne:∀(τ₁τ₂:Ty),τ₁≠<{τ₁→τ₂}>τ:Tyτ₁✝:Tyτ₂✝:Tyha:<{X↦τ;∅⊢X⦂τ₂✝}>hf:<{X↦τ;∅⊢X⦂τ₂✝→τ₁✝}>⊢ Falsecaseshfwith|var___hx=>abs.app.varx:Stringy:Strings:Tmt:Tmt₁:Tmt₂:Tmt₃:Tmτ✝:Tyarrow_ne:∀(τ₁τ₂:Ty),τ₁≠<{τ₁→τ₂}>τ:Tyτ₁✝:Tyτ₂✝:Tyha:<{X↦τ;∅⊢X⦂τ₂✝}>hx:("X"→ₚτ)["X"]=some(<{τ₂✝→τ₁✝}>)⊢ Falsecaseshawith|var___hy=>abs.app.var.varx:Stringy:Strings:Tmt:Tmt₁:Tmt₂:Tmt₃:Tmτ✝:Tyarrow_ne:∀(τ₁τ₂:Ty),τ₁≠<{τ₁→τ₂}>τ:Tyτ₁✝:Tyτ₂✝:Tyhx:("X"→ₚτ)["X"]=some(<{τ₂✝→τ₁✝}>)hy:("X"→ₚτ)["X"]=someτ₂✝⊢ Falseexactarrow_ne__((Option.some.injhy).symm.trans(Option.some.injhx))All goals completed! 🐙
Quiz
Which of the following propositions is not provable?
(A) Y ↦ Bool ; ∅ ⊢ λX:Bool. X ⦂ Bool → Bool
(B) ∃ τ, ∅ ⊢ λY:Bool → Bool. λX:Bool. Y X ⦂ τ
(C) ∃ τ, ∅ ⊢ λY:Bool → Bool. λX:Bool. X Y ⦂ τ
(D) ∃ σ, X ↦ σ ; ∅ ⊢ λY:Bool → Bool. Y X ⦂ (Bool → Bool) → σ
Quiz
Which of these is not provable?
(A) ∃ τ, ∅ ⊢ λY:Bool → Bool → Bool. λX:Bool. Y X ⦂ τ
(B) ∃ σ τ, X ↦ σ ; ∅ ⊢ X X X ⦂ τ
(C) ∃ σ υ τ, X ↦ σ ; Y ↦ υ ; ∅ ⊢ λZ:Bool. X (Y Z) ⦂ τ
(D) ∃ σ τ, X ↦ σ ; ∅ ⊢ λY:Bool. X (X Y) ⦂ τ
endStlc
Source revision: e85fe77, committed 2026-10-06 21:16 UTC