Lambda Prose
Collection
Datasets from the Lambda-alpha repo rewritten as word problem sets. The fields remain the same. • 5 items • Updated
Question stringlengths 936 3.91k | Answer stringlengths 28 268 | Expression Solution Steps listlengths 3 17 |
|---|---|---|
A reviewer has notes from a demonstration of functions with local parameters. They want to turn the notes into one expression with standardized names. Replace every part reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the same name, or ... | (λv0.(((v0 (v0 v0)) (v0 (v0 v0))) (((v0 v0) v0) (((v0 (v0 v0)) (v0 h)) v0)))) | [
"Translate the description into the lambda term (λb.(((b (b b)) (b (b b))) (((b b) b) (((b (b b)) (b h)) b)))). The free variable h keeps its name.",
"For binder 1 in preorder, use v0 in place of b at the binding site and at all 14 occurrences it binds.",
"(λv0.(((v0 (v0 v0)) (v0 (v0 v0))) (((v0 v0) v0) (((v0 (... |
A teaching assistant has a verbal description of an expression from an advanced programming exercise. The students need its standardized spelling. Replace every piece reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the same name, or sta... | (λv0.(λv1.(λv2.(λv3.(λv4.(λv5.(λv6.(λv7.(((v7 v5) ((v7 v0) v5)) (v0 h)))))))))) | [
"Represent the original routine as (λq2.(λu.(λd.(λe2.(λp3.(λt.(λy.(λb.(((b t) ((b q2) t)) (q2 h)))))))))). The free variable h keeps its name.",
"Rename binder 1 in preorder from q2 to v0, updating the two occurrences it binds. This gives (λv0.(λu.(λd.(λe2.(λp3.(λt.(λy.(λb.(((b t) ((b v0) t)) (v0 h)))))))))).",
... |
A reviewer has notes from a demonstration of functions with local parameters. They want to turn the notes into one expression with standardized names. A reference to a numbered part means to insert the described expression there. Read names in the assembled expression under lexical scope, so an occurrence attaches to i... | (λv0.((v0 ((λv1.((v1 (v1 n)) ((λv2.v1) v1))) ((λv3.v0) v0))) (λv4.(v4 ((λv5.((λv6.m) v4)) (λv7.(λv8.((v7 (v7 v7)) n)))))))) | [
"Translate the description into the lambda term (λq3.((q3 ((λq3.((q3 (q3 n)) ((λy.q3) q3))) ((λd.q3) q3))) (λq3.(q3 ((λb.((λb3.m) q3)) (λq3.(λa.((q3 (q3 q3)) n)))))))). The free variables n and m keep their names.",
"For binder 1 in preorder, use v0 in place of q3 at the binding site and at all 3 occurrences it b... |
A developer saved a functional expression as a series of construction notes. It must now be entered into a tool that assigns a standard spelling to local parameters. Replace every part reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the... | (λv0.(λv1.((((v1 (v1 (λv2.(λv3.v3)))) (k ((λv4.v1) (λv5.v1)))) (((v1 v1) (f v1)) ((v1 (λv6.((v1 v6) v6))) (λv7.((λv8.((v8 n) (λv9.v9))) v7))))) (λv10.((((v10 m) v10) v1) ((m v1) v1)))))) | [
"Translate the description into the lambda term (λj.(λe.((((e (e (λw.(λe.e)))) (k ((λw.e) (λf1.e)))) (((e e) (f e)) ((e (λr.((e r) r))) (λe.((λe.((e n) (λe.e))) e))))) (λh.((((h m) h) e) ((m e) e)))))). Preserve the free names k, f, n, and m throughout.",
"Rename binder 1 in preorder from j to v0. It binds zero o... |
A curriculum designer has recorded a functional construction verbally. The exercise asks students to give it a standardized spelling without changing its structure. Whenever a numbered fragment is mentioned, insert its description at that position. Determine scope in the resulting expression, using the nearest enclosin... | (v0 (λv4.(v1 (v2 (v3 (((λv5.v5) (((λv6.h) v2) v4)) ((λv7.v7) ((λv8.((λv9.v9) v1)) v4)))))))) | [
"Start from the original expression (v0 (λs3.(v1 (v2 (v3 (((λd.d) (((λs3.h) v2) s3)) ((λs3.s3) ((λp.((λp.p) v1)) s3)))))))). Preserve the free names v0, v1, v2, v3, and h throughout.",
"Skip v0, v1, v2, and v3 because they occur free in the original expression. Rename binder 1 in preorder from s3 to v4, updating ... |
A software team records a symbolic expression as a series of small construction instructions. A technician must reconstruct the expression for a reproducibility check. Whenever a numbered piece is mentioned, insert its description at that position. Determine scope in the resulting expression, using the nearest enclosin... | (λv0.(((λv1.((((λv2.v1) v1) (λv3.v0)) ((((λv4.k) v1) (λv5.v5)) (m (g v0))))) v0) (λv6.(λv7.((v6 (v6 v6)) (v6 (k (v6 (v6 v6))))))))) | [
"Represent the original routine as (λw.(((λx.((((λw.x) x) (λh.w)) ((((λx.k) x) (λa.a)) (m (g w))))) w) (λw.(λp.((w (w w)) (w (k (w (w w))))))))). Preserve the free names k, m, and g throughout.",
"For binder 1 in preorder, use v0 in place of w at the binding site and at all 3 occurrences it binds. Inner binders n... |
A code reviewer has asked for stable parameter names so two versions of a functional expression can be compared. A colleague left the construction notes below. The labels are for assembling the expression. After expanding a label at every place it is used, resolve each variable to its closest enclosing parameter of tha... | (λv0.((v0 ((λv1.((λv2.v2) (k v1))) ((λv3.v3) v0))) (λv4.(v4 ((((v4 v4) v4) ((v4 (λv5.v5)) (v4 k))) ((λv6.v6) (λv7.f))))))) | [
"Start from the original expression (λw.((w ((λw.((λw.w) (k w))) ((λe.e) w))) (λw.(w ((((w w) w) ((w (λw.w)) (w k))) ((λw.w) (λa3.f))))))). The free variables k and f keep their names.",
"Give binder 1 in preorder the name v0 in place of w. Update the two occurrences it binds to match. Inner binders named w keep ... |
A researcher needs a stable printed form of a term for an appendix. The notes below explain how to rebuild the term before assigning the printed names. The labels are for assembling the expression. After expanding a label at every place it is used, resolve each variable to its closest enclosing parameter of that name. ... | ((λv0.(v0 ((k ((λv1.v1) (((v0 v0) g) (λv2.v2)))) ((v0 v0) (λv3.v3))))) (λv4.(((((λv5.(h v5)) (v4 v4)) (v4 (λv6.v6))) ((v4 (λv7.v4)) (λv8.v4))) v4))) | [
"Translate the description into the lambda term ((λq.(q ((k ((λq.q) (((q q) g) (λq.q)))) ((q q) (λq.q))))) (λq.(((((λq.(h q)) (q q)) (q (λq.q))) ((q (λx.q)) (λe2.q))) q))). Preserve the free names k, g, and h throughout.",
"Give binder 1 in preorder the name v0 in place of q. Update all 5 occurrences it binds to ... |
A program transformation test is being written from a plain-language specification. The expected result must preserve the specification's variable bindings. Whenever a numbered component is mentioned, insert its description at that position. Determine scope in the resulting expression, using the nearest enclosing param... | (λv0.(((λv1.(((n v1) (v1 m)) m)) (λv2.(((λv3.g) ((v2 g) (h v2))) ((λv4.(v4 ((λv5.v5) v4))) (λv6.v2))))) (λv7.((v7 (λv8.(λv9.v7))) (λv10.v10))))) | [
"The described functions and applications form the term (λj.(((λw.(((n w) (w m)) m)) (λq.(((λh.g) ((q g) (h q))) ((λx.(x ((λp.p) x))) (λu1.q))))) (λw.((w (λz1.(λt.w))) (λw.w))))). Preserve the free names n, m, g, and h throughout.",
"Binder 1 in preorder has the unused parameter j. Change its name to v0. The term... |
A course grader is preparing an answer key for an exercise about parameter names. The input consists of the following descriptions of an expression. The labels are for assembling the expression. After expanding a label at every place it is used, resolve each variable to its closest enclosing parameter of that name. A n... | (λv0.((v0 (λv1.(λv2.(v2 (v1 ((λv3.(v2 (v3 v1))) (λv4.(v1 (λv5.v0))))))))) (λv6.(((λv7.v6) (λv8.v6)) (v6 ((λv9.((v6 (λv10.(λv11.(v10 v11)))) ((v6 v0) (v6 (v0 v9))))) v0)))))) | [
"Represent the original routine as (λy2.((y2 (λd.(λr.(r (d ((λu.(r (u d))) (λr.(d (λx.y2))))))))) (λs.(((λy2.s) (λy2.s)) (s ((λp.((s (λy2.(λs.(y2 s)))) ((s y2) (s (y2 p))))) y2)))))). The term is closed, so every canonical name is initially available.",
"Give binder 1 in preorder the name v0 in place of y2. Updat... |
A programming exercise describes an expression as a series of smaller parts. A teaching assistant needs its form after the course's parameter naming rule has been applied. The labels are for assembling the expression. After expanding a label at every place it is used, resolve each variable to its closest enclosing para... | (k (λv0.(((λv1.(λv2.(λv3.((λv4.v1) (λv5.((v0 v0) v0)))))) (λv6.((v0 (λv7.v6)) (λv8.f)))) (((v0 v0) (λv9.v0)) ((λv10.v0) v0))))) | [
"The described functions and applications form the term (k (λq.(((λt.(λw.(λw.((λb.t) (λa.((q q) q)))))) (λp.((q (λw.p)) (λr0.f)))) (((q q) (λx.q)) ((λc2.q) q))))). Preserve the free names k and f throughout.",
"Give binder 1 in preorder the name v0 in place of q. Update all 9 occurrences it binds to match. The cu... |
A symbolic debugger produces verbal descriptions of small parts of one expression. An operator needs to assemble the expression and normalize its parameter names. Expand the numbered descriptions in place. In the assembled term, an occurrence is bound by the nearest enclosing parameter of the same name, and any occurre... | (v0 (λv3.(v1 (v2 ((((λv4.(λv5.(λv6.v5))) (λv7.((λv8.v8) f))) v3) ((λv9.(λv10.(((((λv11.v11) v10) (((λv12.v9) v9) ((v10 m) v9))) v9) (v9 v9)))) (v3 v3))))))) | [
"The described functions and applications form the term (v0 (λc.(v1 (v2 ((((λd0.(λx.(λs3.x))) (λz.((λz.z) f))) c) ((λc.(λg.(((((λs.s) g) (((λw.c) c) ((g m) c))) c) (c c)))) (c c))))))). Preserve the free names v0, v1, v2, f, and m throughout.",
"Skip v0, v1, and v2 because they occur free in the original expressi... |
A developer saved a functional expression as a series of construction notes. It must now be entered into a tool that assigns a standard spelling to local parameters. Expand the numbered descriptions in place. In the assembled term, an occurrence is bound by the nearest enclosing parameter of the same name, and any occu... | ((λv0.(v0 (((λv1.(λv2.(v2 v2))) ((λv3.n) (λv4.(v4 f)))) ((n v0) (v0 v0))))) (λv5.(((v5 (λv6.v5)) (λv7.(((λv8.(λv9.(v9 (v9 v8)))) (v7 (g v5))) ((v7 v7) v5)))) v5))) | [
"Start from the original expression ((λy.(y (((λa.(λa.(a a))) ((λr.n) (λy.(y f)))) ((n y) (y y))))) (λy.(((y (λr.y)) (λs.(((λy.(λg.(g (g y)))) (s (g y))) ((s s) y)))) y))). Preserve the free names n, f, and g throughout.",
"At binder 1 in preorder, change the parameter y to v0 and update all 4 occurrences it bind... |
A program transformation test is being written from a plain-language specification. The expected result must preserve the specification's variable bindings. Expand the numbered descriptions in place. In the assembled term, an occurrence is bound by the nearest enclosing parameter of the same name, and any occurrence wi... | ((((c k) (g ((n f) f))) h) (λv0.(v0 (λv1.(h ((v0 ((λv2.k) ((λv3.v3) (λv4.v0)))) (λv5.v5))))))) | [
"Represent the original routine as ((((c k) (g ((n f) f))) h) (λc.(c (λs.(h ((c ((λb.k) ((λp.p) (λd.c)))) (λc.c))))))). The free variables c, k, g, n, f, and h keep their names.",
"For binder 1 in preorder, use v0 in place of c at the binding site and at all 3 occurrences it binds. The inner binder named c keeps ... |
A maintainer is preparing a functional expression for export. The review notes describe it in smaller pieces. A reference to a numbered part means to insert the described expression there. Read names in the assembled expression under lexical scope, so an occurrence attaches to its closest enclosing parameter of the sam... | (λv0.((n (λv1.(λv2.((λv3.((v2 ((λv4.(λv5.(v5 (λv6.f)))) (v2 (λv7.v7)))) ((v2 (λv8.v8)) v2))) (λv9.(v2 ((λv10.(v10 (v9 v9))) (v2 v2)))))))) f)) | [
"Translate the description into the lambda term (λj.((n (λs.(λs.((λx.((s ((λr.(λx.(x (λs.f)))) (s (λs.s)))) ((s (λs.s)) s))) (λx.(s ((λu.(u (x x))) (s s)))))))) f)). The free variables n and f keep their names.",
"Change j to v0 at binder 1 in preorder. Its parameter is unused in its body. The current expression ... |
A software team records a symbolic expression as a series of small construction instructions. A technician must reconstruct the expression for a reproducibility check. The labels are for assembling the expression. After expanding a label at every place it is used, resolve each variable to its closest enclosing paramete... | (v0 (λv3.(v1 (v2 (((λv4.((λv5.(v3 (k h))) (((λv6.h) ((v4 (λv7.v3)) (λv8.v3))) v4))) (λv9.((λv10.((v3 v3) v3)) (λv11.(λv12.((v11 v9) v1)))))) ((v3 (v3 h)) (v3 v3))))))) | [
"Start from the original expression (v0 (λu.(v1 (v2 (((λb.((λf.(u (k h))) (((λb.h) ((b (λr1.u)) (λb.u))) b))) (λe.((λr.((u u) u)) (λh.(λu.((h e) v1)))))) ((u (u h)) (u u))))))). Preserve the free names v0, v1, v2, k, and h throughout.",
"Skip v0, v1, and v2 because they occur free in the original expression. Give... |
A developer saved a functional expression as a series of construction notes. It must now be entered into a tool that assigns a standard spelling to local parameters. Whenever a numbered component is mentioned, insert its description at that position. Determine scope in the resulting expression, using the nearest enclos... | (λv0.(λv1.(λv2.(λv3.(λv4.(((((λv5.(λv6.(λv7.((((λv8.v7) (λv9.(v2 v5))) ((λv10.v6) (((v5 g) (λv11.v7)) (((λv12.f) (λv13.v5)) k)))) (λv14.((v14 v7) v14)))))) (v3 v1)) ((k ((v2 v3) (v2 (v2 v2)))) v3)) v3) ((v2 (v3 (k v1))) m))))))) | [
"The described functions and applications form the term (λq.(λt.(λu.(λq.(λd.(((((λx.(λr0.(λq.((((λr0.q) (λp2.(u x))) ((λu2.r0) (((x g) (λp.q)) (((λu.f) (λq.x)) k)))) (λy.((y q) y)))))) (q t)) ((k ((u q) (u (u u)))) q)) q) ((u (q (k t))) m))))))). Preserve the free names g, f, k, and m throughout.",
"Binder 1 in p... |
An engineer is moving a symbolic program between two tools. The handoff notes describe how to assemble the expression that will be exported. Expand the numbered descriptions in place. In the assembled term, an occurrence is bound by the nearest enclosing parameter of the same name, and any occurrence without such a par... | (λv0.(λv1.(λv2.(λv3.(λv4.(λv5.(λv6.(λv7.(λv8.((v3 v3) ((v8 v3) ((n v3) v7)))))))))))) | [
"Translate the description into the lambda term (λb.(λg.(λb.(λb.(λs.(λu.(λq.(λg.(λh.((b b) ((h b) ((n b) g)))))))))))). The free variable n keeps its name.",
"Change b to v0 at binder 1 in preorder. Its parameter is unused in its body. The inner binder named b keeps its own references until its turn. This gives (... |
A student is converting a draft of a functional program to a form suitable for an example sheet. The draft gives names to intermediate pieces for convenience. Replace every piece reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the same ... | (λv0.((v0 ((λv1.v1) ((λv2.(v0 ((v0 v0) v0))) (v0 v0)))) (λv3.(v3 ((λv4.(v3 ((λv5.v5) (λv6.h)))) v3))))) | [
"Represent the original routine as (λb.((b ((λb.b) ((λh.(b ((b b) b))) (b b)))) (λb.(b ((λy.(b ((λc.c) (λb.h)))) b))))). The free variable h keeps its name.",
"At binder 1 in preorder, change the parameter b to v0 and update all 7 occurrences it binds. Inner binders named b keep their own references until their t... |
A symbolic debugger produces verbal descriptions of small parts of one expression. An operator needs to assemble the expression and normalize its parameter names. Expand the numbered descriptions in place. In the assembled term, an occurrence is bound by the nearest enclosing parameter of the same name, and any occurre... | ((λv0.(v0 ((v0 v0) ((λv1.(λv2.v0)) (λv3.(h (f m))))))) (λv4.((((λv5.v5) (λv6.(((((λv7.(v7 n)) (λv8.v6)) (v6 f)) v4) v6))) v4) v4))) | [
"Translate the description into the lambda term ((λs.(s ((s s) ((λy.(λh3.s)) (λs.(h (f m))))))) (λs.((((λb.b) (λe.(((((λr3.(r3 n)) (λc.e)) (e f)) s) e))) s) s))). Preserve the free names h, f, m, and n throughout.",
"Rename binder 1 in preorder from s to v0, updating all 4 occurrences it binds. The inner binder n... |
A course grader is preparing an answer key for an exercise about parameter names. The input consists of the following descriptions of an expression. Expand the numbered descriptions in place. In the assembled term, an occurrence is bound by the nearest enclosing parameter of the same name, and any occurrence without su... | (n (λv0.(((v0 (λv1.m)) ((v0 v0) (λv2.(λv3.((λv4.v4) (λv5.(λv6.h))))))) (λv7.((λv8.h) (λv9.v0)))))) | [
"Translate the description into the lambda term (n (λx.(((x (λx.m)) ((x x) (λd2.(λy.((λu0.u0) (λc.(λz.h))))))) (λb.((λt.h) (λu.x)))))). Preserve the free names n, m, and h throughout.",
"Give binder 1 in preorder the name v0 in place of x. Update all 4 occurrences it binds to match. The inner binder named x keeps... |
A library author is documenting an example built from nested functions and applications. The publication uses a standard naming convention for local parameters. Replace every part reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the same... | (λv0.((λv1.(((v1 m) (λv2.(λv3.(v2 v1)))) (v1 ((λv4.v0) ((λv5.v5) (v0 (λv6.v0))))))) (((f g) (((v0 (h v0)) (v0 m)) (λv7.v0))) ((((λv8.v8) m) (λv9.v0)) (λv10.((v10 (λv11.((λv12.k) v11))) (λv13.((λv14.v13) v13)))))))) | [
"Translate the description into the lambda term (λc.((λz.(((z m) (λc.(λh.(c z)))) (z ((λx3.c) ((λc.c) (c (λw3.c))))))) (((f g) (((c (h c)) (c m)) (λq0.c))) ((((λx.x) m) (λu0.c)) (λc.((c (λt.((λq.k) t))) (λc.((λw.c) c)))))))). The free variables m, f, g, h, and k keep their names.",
"Rename binder 1 in preorder fr... |
A teaching assistant has a verbal description of an expression from an advanced programming exercise. The students need its standardized spelling. Replace every fragment reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the same name, or ... | ((λv0.(v0 ((λv1.(λv2.(λv3.((v0 (v2 (λv4.v1))) (λv5.((v5 (v3 n)) (λv6.(v3 v1)))))))) (v0 (λv7.(λv8.(v8 v0))))))) (((e f) ((((g k) f) m) f)) m)) | [
"Start from the original expression ((λe.(e ((λh.(λr.(λe2.((e (r (λt.h))) (λc.((c (e2 n)) (λu1.(e2 h)))))))) (e (λs.(λc.(c e))))))) (((e f) ((((g k) f) m) f)) m)). The free variables n, e, f, g, k, and m keep their names.",
"Rename binder 1 in preorder from e to v0, updating all 4 occurrences it binds. Free occur... |
A reviewer has notes from a demonstration of functions with local parameters. They want to turn the notes into one expression with standardized names. Treat the numbered labels as shorthand for expressions. Once those labels are expanded, a variable belongs to the nearest enclosing parameter of the same name and remain... | (λv0.((((g h) (λv1.(λv2.(m (λv3.v2))))) (f (λv4.((v4 v4) v4)))) ((((f (λv5.(λv6.v6))) ((n f) (k (λv7.v7)))) ((n (λv8.v8)) m)) (λv9.(v9 ((λv10.v10) (v9 f))))))) | [
"The described functions and applications form the term (λj.((((g h) (λz.(λz.(m (λw.z))))) (f (λe.((e e) e)))) ((((f (λh.(λh.h))) ((n f) (k (λq2.q2)))) ((n (λd.d)) m)) (λd.(d ((λw.w) (d f))))))). The free variables g, h, m, f, n, and k keep their names.",
"Rename binder 1 in preorder from j to v0. It binds zero o... |
A maintainer is preparing a functional expression for export. The review notes describe it in smaller pieces. Treat the numbered labels as shorthand for expressions. Once those labels are expanded, a variable belongs to the nearest enclosing parameter of the same name and remains free if no such parameter encloses it.
... | (λv0.((λv1.((v1 v1) (v1 v1))) (((λv2.(((v2 v2) v0) v2)) ((λv3.v3) v0)) (v0 (λv4.((λv5.((λv6.v5) v0)) v4)))))) | [
"The described functions and applications form the term (λt.((λt.((t t) (t t))) (((λg.(((g g) t) g)) ((λt.t) t)) (t (λx.((λz.((λy.z) t)) x)))))). Every variable occurrence is bound in this term.",
"At binder 1 in preorder, change the parameter t to v0 and update all 4 occurrences it binds. Inner binders named t k... |
An editor is converting a set of programming notes into a worked example. The notes identify reusable pieces that must be assembled into a single term. Treat the numbered labels as shorthand for expressions. Once those labels are expanded, a variable belongs to the nearest enclosing parameter of the same name and remai... | (m (λv0.((((λv1.(v0 (λv2.v2))) (λv3.((((v3 v3) v3) (λv4.((λv5.v4) v4))) (k (λv6.k))))) v0) ((((λv7.(v7 ((((v7 v7) g) (λv8.v7)) n))) (v0 (λv9.v0))) v0) (((v0 v0) (λv10.v10)) ((v0 v0) (v0 (v0 v0)))))))) | [
"Translate the description into the lambda term (m (λz.((((λa.(z (λx2.x2))) (λz.((((z z) z) (λe2.((λp.e2) e2))) (k (λb.k))))) z) ((((λz.(z ((((z z) g) (λt.z)) n))) (z (λq.z))) z) (((z z) (λz.z)) ((z z) (z (z z)))))))). The free variables m, k, g, and n keep their names.",
"Give binder 1 in preorder the name v0 in... |
A tool vendor is preparing a portable test for a symbolic expression reader. The test description specifies what to assemble and how to name the parameters. Whenever a numbered component is mentioned, insert its description at that position. Determine scope in the resulting expression, using the nearest enclosing param... | (λv0.((v0 ((λv1.(λv2.(λv3.((v2 v2) v2)))) (((v0 v0) m) (v0 v0)))) (λv4.(v4 ((λv5.(v4 (λv6.v6))) (λv7.g)))))) | [
"The described functions and applications form the term (λc.((c ((λc.(λc.(λe.((c c) c)))) (((c c) m) (c c)))) (λc.(c ((λu.(c (λu.u))) (λh0.g)))))). Preserve the free names m and g throughout.",
"For binder 1 in preorder, use v0 in place of c at the binding site and at all 5 occurrences it binds. Inner binders nam... |
A curriculum designer has recorded a functional construction verbally. The exercise asks students to give it a standardized spelling without changing its structure. Treat the numbered labels as shorthand for expressions. Once those labels are expanded, a variable belongs to the nearest enclosing parameter of the same n... | ((λv0.(v0 (((((λv1.v1) (λv2.v2)) ((((λv3.(λv4.f)) v0) ((λv5.(λv6.k)) v0)) (λv7.v7))) v0) (λv8.v0)))) (((q (h h)) (f (k (h n)))) (h m))) | [
"Represent the original routine as ((λq.(q (((((λp.p) (λq.q)) ((((λq.(λq.f)) q) ((λq.(λq.k)) q)) (λf2.f2))) q) (λw.q)))) (((q (h h)) (f (k (h n)))) (h m))). The free variables f, k, q, h, n, and m keep their names.",
"At binder 1 in preorder, change the parameter q to v0 and update all 5 occurrences it binds. Inn... |
A researcher needs a stable printed form of a term for an appendix. The notes below explain how to rebuild the term before assigning the printed names. A reference to a numbered piece means to insert the described expression there. Read names in the assembled expression under lexical scope, so an occurrence attaches to... | (λv0.((((λv1.(λv2.(λv3.((v3 (λv4.v0)) v3)))) v0) v0) (((λv5.v0) (((v0 v0) (λv6.v6)) (v0 (λv7.v7)))) ((λv8.(λv9.v9)) ((λv10.(((λv11.v11) v10) (v10 v10))) ((v0 v0) (((v0 v0) ((((v0 v0) (v0 v0)) v0) (v0 v0))) (v0 (v0 v0))))))))) | [
"Represent the original routine as (λg.((((λe.(λa.(λb.((b (λe.g)) b)))) g) g) (((λq.g) (((g g) (λh.h)) (g (λg.g)))) ((λc1.(λg.g)) ((λg.(((λh.h) g) (g g))) ((g g) (((g g) ((((g g) (g g)) g) (g g))) (g (g g))))))))). The term is closed, so every canonical name is initially available.",
"For binder 1 in preorder, us... |
A program transformation test is being written from a plain-language specification. The expected result must preserve the specification's variable bindings. Replace every fragment reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the same... | (v0 (λv3.(v1 (v2 (v3 ((λv4.((((λv5.g) (g v4)) (λv6.v4)) (v3 v3))) (λv7.(((λv8.v8) ((λv9.(λv10.v3)) v3)) ((λv11.v11) g))))))))) | [
"Start from the original expression (v0 (λc.(v1 (v2 (c ((λy.((((λp.g) (g y)) (λa.y)) (c c))) (λe.(((λz.z) ((λb.(λy.c)) c)) ((λe.e) g))))))))). The free variables v0, v1, v2, and g keep their names.",
"Skip v0, v1, and v2 because they occur free in the original expression. At binder 1 in preorder, change the param... |
A software team records a symbolic expression as a series of small construction instructions. A technician must reconstruct the expression for a reproducibility check. Replace every piece reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with ... | (λv0.(λv1.(λv2.(λv3.(λv4.(λv5.(λv6.(λv7.(λv8.((((v1 v8) v5) (f v6)) (v7 (((v3 v6) (k v7)) ((v6 v8) (v8 (v7 (v7 v8)))))))))))))))) | [
"Represent the original routine as (λu.(λe.(λu.(λr.(λx.(λc0.(λu.(λt.(λy.((((e y) c0) (f u)) (t (((r u) (k t)) ((u y) (y (t (t y)))))))))))))))). Preserve the free names f and k throughout.",
"Rename binder 1 in preorder from u to v0. It binds zero occurrences, so the body stays as it is. The inner binder named u ... |
A formatter's regression test needs an expected output. The test case is a functional expression described by these building instructions. Treat the numbered labels as shorthand for expressions. Once those labels are expanded, a variable belongs to the nearest enclosing parameter of the same name and remains free if no... | (λv0.((v0 ((λv1.(((v1 f) h) ((v1 (λv2.v1)) (v1 h)))) (λv3.m))) (λv4.(v4 (v4 ((v4 (λv5.(m (λv6.v4)))) v4)))))) | [
"Represent the original routine as (λt.((t ((λt.(((t f) h) ((t (λg.t)) (t h)))) (λs.m))) (λt.(t (t ((t (λg2.(m (λs0.t)))) t)))))). The free variables f, h, and m keep their names.",
"At binder 1 in preorder, change the parameter t to v0 and update the single occurrence it binds. Inner binders named t keep their o... |
A developer is updating a suite of examples that illustrate how name binding works. One new example is described by the construction notes below. Treat the numbered labels as shorthand for expressions. Once those labels are expanded, a variable belongs to the nearest enclosing parameter of the same name and remains fre... | (λv0.((λv1.((v1 (λv2.v1)) (((v1 (λv3.(λv4.((((v3 v4) v3) v4) ((λv5.g) v4))))) (v1 v1)) v1))) (λv6.(λv7.(((n (v7 v7)) (λv8.((λv9.((λv10.v10) (v7 ((m v9) v8)))) (n (v7 v7))))) k))))) | [
"Translate the description into the lambda term (λj.((λs.((s (λh1.s)) (((s (λg0.(λp.((((g0 p) g0) p) ((λs.g) p))))) (s s)) s))) (λh.(λh.(((n (h h)) (λz.((λu.((λu.u) (h ((m u) z)))) (n (h h))))) k))))). The free variables g, n, m, and k keep their names.",
"Binder 1 in preorder has the unused parameter j. Change i... |
A reviewer has notes from a demonstration of functions with local parameters. They want to turn the notes into one expression with standardized names. Replace every fragment reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the same name,... | (λv0.((λv1.(λv2.(λv3.(λv4.((((λv5.(λv6.((λv7.(λv8.v5)) (v5 v5)))) ((v1 v1) (v4 v1))) (v2 ((v1 v4) v4))) ((v1 (v1 v1)) (v0 ((v4 v4) (v4 (v4 v1)))))))))) (v0 (v0 (v0 v0))))) | [
"Start from the original expression (λh.((λs0.(λy.(λt.(λt.((((λt.(λy.((λr.(λh.t)) (t t)))) ((s0 s0) (t s0))) (y ((s0 t) t))) ((s0 (s0 s0)) (h ((t t) (t (t s0)))))))))) (h (h (h h))))). Every variable occurrence is bound in this term.",
"At binder 1 in preorder, change the parameter h to v0 and update all 5 occurr... |
A code reviewer has asked for stable parameter names so two versions of a functional expression can be compared. A colleague left the construction notes below. Expand the numbered descriptions in place. In the assembled term, an occurrence is bound by the nearest enclosing parameter of the same name, and any occurrence... | (n (λv0.((((λv1.v1) (v0 m)) (λv2.v2)) ((((λv3.m) (v0 v0)) (((λv4.(v4 v4)) (λv5.(λv6.(v5 (λv7.((v5 v6) g)))))) ((λv8.v0) (λv9.v0)))) (v0 v0))))) | [
"Start from the original expression (n (λb0.((((λb.b) (b0 m)) (λb0.b0)) ((((λs.m) (b0 b0)) (((λw.(w w)) (λb0.(λu.(b0 (λa3.((b0 u) g)))))) ((λs.b0) (λs.b0)))) (b0 b0))))). The free variables n, m, and g keep their names.",
"For binder 1 in preorder, use v0 in place of b0 at the binding site and at all 7 occurrence... |
A compiler engineer is building a fixture for the pass that renames local parameters. The fixture is specified by the descriptions below. Replace every fragment reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the same name, or stays fre... | (λv0.((v0 ((((v0 v0) (v0 n)) (v0 (v0 (v0 h)))) v0)) ((v0 (v0 (v0 (v0 v0)))) (v0 v0)))) | [
"Start from the original expression (λx2.((x2 ((((x2 x2) (x2 n)) (x2 (x2 (x2 h)))) x2)) ((x2 (x2 (x2 (x2 x2)))) (x2 x2)))). The free variables n and h keep their names.",
"Rename binder 1 in preorder from x2 to v0, updating all 15 occurrences it binds.",
"(λv0.((v0 ((((v0 v0) (v0 n)) (v0 (v0 (v0 h)))) v0)) ((v0... |
A program transformation test is being written from a plain-language specification. The expected result must preserve the specification's variable bindings. Expand the numbered descriptions in place. In the assembled term, an occurrence is bound by the nearest enclosing parameter of the same name, and any occurrence wi... | (λv0.(λv1.(λv2.(λv3.(λv4.(λv5.(λv6.(λv7.((((v3 v6) g) ((v7 (v5 (v4 v0))) m)) ((v7 v6) (v0 (v4 v6)))))))))))) | [
"Represent the original routine as (λh.(λs.(λt.(λb.(λt.(λd.(λy.(λf.((((b y) g) ((f (d (t h))) m)) ((f y) (h (t y)))))))))))). The free variables g and m keep their names.",
"For binder 1 in preorder, use v0 in place of h at the binding site and at the two occurrences it binds. This gives (λv0.(λs.(λt.(λb.(λt.(λd.... |
A course grader is preparing an answer key for an exercise about parameter names. The input consists of the following descriptions of an expression. Expand the numbered descriptions in place. In the assembled term, an occurrence is bound by the nearest enclosing parameter of the same name, and any occurrence without su... | ((((r ((n g) m)) (((m h) m) g)) h) (λv0.(v0 (λv1.(λv2.((λv3.v3) ((λv4.((λv5.v2) v2)) (λv6.((λv7.v7) (v2 (λv8.v8))))))))))) | [
"The described functions and applications form the term ((((r ((n g) m)) (((m h) m) g)) h) (λr.(r (λh.(λf.((λh.h) ((λh.((λh.f) f)) (λd.((λs.s) (f (λc.c))))))))))). Preserve the free names r, n, g, m, and h throughout.",
"Rename binder 1 in preorder from r to v0, updating the single occurrence it binds. Free occur... |
Each record has a prose Question, a bare lambda-calculus Answer, and an Expression Solution Steps array with a prose walkthrough ending in that exact answer. The dataset preserves the original shard and row order.
Verified that all 100,000 questions are unique and reconstruct their source terms, and that all 825,083 renaming steps match the original traces.
Dataset created with ChatGPT sol 6.1 ultra