Reading Terms
Parsing compound terms. Parenthesization drills. Scope of the dot.
Reading lambda expressions correctly is a prerequisite for everything that follows. Every lambda term, no matter how complex, has exactly one outermost form: it is a variable, an abstraction, or an application. Learning to see that outermost structure at a glance is the first parsing skill.
Outermost Form
Every lambda term is exactly one of three forms:
- Variable: a single name like
x - Abstraction: starts with
λ— e.g.,λx.x y - Application: one term applied to another — e.g.,
f x
The outermost form is determined by the topmost constructor.
In λx.x y, the outermost form is an abstraction (the λ governs
the entire expression). The body x y happens to be an application,
but that is internal structure.
Parsing Applications
Application is left-associative. When you see a chain of terms without explicit parentheses, group from the left:
a b cmeans(a b) c— applyatobfirst, then apply the result tocf x y zmeans((f x) y) z
This convention avoids parentheses everywhere. Without it, every application would need explicit grouping.
Parsing with Lambda
The body of a lambda abstraction extends as far right as possible. The dot after the parameter is greedy — it claims everything to its right, unless parentheses say otherwise.
λx.x ymeansλx.(x y)— the body isx y, not justx(λx.x) ymeans something different — parentheses end the body atx, andyis a separate argument
This convention minimizes parentheses. Without it, you would need to
write (λx.(x y)) every time.
Full Parenthesization
Full parenthesization makes all implicit grouping explicit. Apply the two conventions:
- Application is left-associative:
a b cbecomes((a b) c) - The body of $\lambda$ extends right:
λx.M Nbecomes(λx.(M N))
Examples:
f a b$\to$((f a) b)λx.x y$\to$(λx.(x y))a b$\to$(a b)
Identify Subterms
A subterm of a lambda expression is any well-formed piece of it, including the expression itself. To count subterms, identify every node in the expression's syntax tree.
For example, (λx.x) y has these subterms:
(λx.x) y— the whole expression (an application)λx.x— the function part (an abstraction)x— the body of the abstraction (a variable)y— the argument (a variable)
That is 4 subterms total.
Application vs Abstraction
When an expression contains both λ and application, the outermost
form depends on where the λ sits.
λx.f x— theλgoverns the whole expression. Outermost form: abstraction. The bodyf xis an application, but that is internal.(λx.x) f— theλis inside parentheses. Outermost form: application. The abstractionλx.xis applied tof.
The key question: does the λ at the front govern the entire
expression, or is it contained inside a subterm?
Where Does the Body End?
Without parentheses, the body of λ extends to the end of the
expression. Parentheses override this — a closing parenthesis
ends the body.
Compare:
λx.x y— body isx y(extends to the end)(λx.x) y— body is justx(parenthesis ends it)(λx.x) (λy.y)— first body isx, second body isy; the whole expression is an application
Getting this wrong changes the meaning entirely.
Classify Expression
Every lambda term has exactly one outermost form:
- variable — a single name:
x,f,y - abstraction — starts with
λthat governs the whole expression:λx.M - application — one term applied to another:
M N
To classify a compound expression, find its outermost constructor. Ignore internal structure — only the top level matters.
Ready to test your understanding?
Bitwit uses spaced repetition to help you truly master concepts like this—not just read about them. Each card generates with different values, so you can't just memorize answers.
Practice Reading Terms →