Lambda Prose
Collection
Datasets from the Lambda-alpha repo rewritten as word problem sets. The fields remain the same. • 5 items • Updated
Question stringlengths 1.42k 6.04k | Answer stringlengths 1 904 | Expression Solution Steps listlengths 3 24 |
|---|---|---|
An instructor is preparing a demonstration of lexical binding during function application. The class will construct and normalize the expression from these notes. Replace every part reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the sa... | y | [
"Represent the functions and applications as ((λx.y) ((λx.(x x)) (λx.(x x)))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λx.y) ((λx.(x x)) (λx.(x x))))`. The parameter x binds no occurrences in its body. Discard the argument without evaluating it. The result has no remaining beta ... |
A developer is debugging a symbolic evaluator whose output still contains a function call that can be contracted. The input is described below. 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 stays ... | (f (g z)) | [
"Translate the description into ((((λf.(λg.(λx.(f (g x))))) (λx.(f x))) (λy.(g y))) z).",
"From the whole term, follow the function side, then the function side. Contract the redex `((λf.(λg.(λx.(f (g x))))) (λx.(f x)))`. Substitute the unevaluated argument for the single occurrence bound by f in the function bod... |
An instructor is preparing a demonstration of lexical binding during function application. The class will construct and normalize the expression from these notes. 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 a... | (f (f (f z))) | [
"Represent the functions and applications as (((((λm.(λn.(λf.(λx.((m f) ((n f) x)))))) (λf.(λx.(f x)))) (λf.(λx.(f (f x))))) f) z).",
"From the whole term, follow the function side, then the function side, then the function side. Contract the redex `((λm.(λn.(λf.(λx.((m f) ((n f) x)))))) (λf.(λx.(f x))))`. Substi... |
A symbolic debugger has recorded a test expression as a series of small construction instructions. The operator needs the result of reducing the entire term. Replace every part reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the same na... | (λf.(λh.(λk.(λm.(λn.(λb.(((b h) (h (λc.m))) (λq.(λy.((((k q) b) ((q (q b)) k)) (λb.(f n)))))))))))) | [
"Represent the functions and applications as (λf.(λh.(λk.(λm.(λn.((λp.p) ((λj.(λb.(((b h) (h (λc.m))) (λq.(λy.((((k q) b) ((q (q b)) k)) (λb.(f n)))))))) ((λd.(d d)) (λd.(d d)))))))))).",
"From the whole term, follow the body of lambda f, then the body of lambda h, then the body of lambda k, then the body of lamb... |
A lesson author wants students to read a functional program described in words, then perform the evaluator's substitutions. This example begins with the following definitions. Whenever a numbered fragment is mentioned, insert its description at that position. Determine scope in the resulting expression, using the neare... | (λf.(λg.(λm.(λn.(λs.(λv0.((n (s (λy.(((y (λc.(λx.y))) y) (λw.g))))) (f (m (v0 (λp0.(v0 (v0 f))))))))))))) | [
"Start the normal-order reduction from (λf.(λg.(λm.(λn.(λs.((λq.q) ((λs.s) ((λw.(λs.((n w) (f (m (s (λp0.(s (s f))))))))) (s (λy.(((y (λc.(λx.y))) y) (λw.g)))))))))))).",
"From the whole term, follow the body of lambda f, then the body of lambda g, then the body of lambda m, then the body of lambda n, then the bo... |
A toolkit maintainer is building a demonstration of symbolic evaluation for the documentation. The demonstration specifies its starting expression in prose. Whenever a numbered piece is mentioned, insert its description at that position. Determine scope in the resulting expression, using the nearest enclosing parameter... | (λv0.(λv1.((k (λr0.((((v0 (λc.n)) (v0 r0)) n) ((v1 r0) (v0 (k v0)))))) ((c y1) ((k (λc.c)) (λp.(λd2.(p (d2 (n k)))))))))) | [
"Translate the description into ((λa.a) ((λs.s) ((λd.(λc.(λy1.((k (λr0.((((c (λc.n)) (c r0)) n) ((y1 r0) (c (k c)))))) d)))) ((c y1) ((k (λc.c)) (λp.(λd2.(p (d2 (n k)))))))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λa.a) ((λs.s) ((λd.(λc.(λy1.((k (λr0.((((c (λc.n)) (c r0)) n) ... |
A verification engineer is recording an expected result for a capture-avoiding evaluator. The test begins with the expression assembled 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 that name. A name wi... | (λf.(λg.(λh.(λk.(λm.(λn.((n ((h (g k)) ((f (λy.y)) (h m)))) ((m (λy.((y (y k)) (g y)))) (m ((h (λu.u)) ((k (λa.a)) (λt.t)))))))))))) | [
"Start the normal-order reduction from (λf.(λg.(λh.(λk.(λm.(λn.((λw.w) ((((λf.(λg.(λx.(f (g x))))) (λz.((n ((h (g k)) ((f (λy.y)) (h m)))) z))) (λp.((m p) (m ((h (λu.u)) ((k (λa.a)) (λt.t))))))) (λy.((y (y k)) (g y))))))))))).",
"From the whole term, follow the body of lambda f, then the body of lambda g, then th... |
A library author is documenting the reducer's precise choice of fresh names. The worked example begins by constructing the following 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 name ... | ((((h f) ((h h) (λr.f))) (λa.((a (λw.(a w))) ((a a) a)))) (g ((m (λd.(λr1.(λx.n)))) (k h)))) | [
"Represent the functions and applications as ((λr.r) (((λa.(λx.((((h f) ((h h) (λr.f))) a) x))) ((λp.p) (λa.((a (λw.(a w))) ((a a) a))))) (g ((m (λd.(λr1.(λx.n)))) (k h))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λr.r) (((λa.(λx.((((h f) ((h h) (λr.f))) a) x))) ((λp.p) (λa.((a... |
A colleague described a test term at a design review. The evaluator's author needs the normal form that follows under the team's reduction convention. Whenever a numbered component is mentioned, insert its description at that position. Determine scope in the resulting expression, using the nearest enclosing parameter o... | (λf.(λg.(λk.(λm.(λn.((f f) (λa.((g (a (k m))) (a a))))))))) | [
"The original lambda term is (λf.(λg.(λk.(λm.(λn.((λd.d) ((λu.u) (((λt.(λf.t)) ((λp1.p1) ((λb.b) ((f f) (λa.((g (a (k m))) (a a))))))) (λb.(λd.(λr.((d (λx.d)) ((b (r (λs.r))) ((g b) n)))))))))))))).",
"From the whole term, follow the body of lambda f, then the body of lambda g, then the body of lambda k, then the... |
A researcher is making a reproducibility fixture for two implementations of beta reduction. Both implementations will start with the expression described 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 th... | ((m ((m g) (f (((f h) (n g)) (λr.(r ((r (λp.(λz.p))) (λz.h)))))))) (λb.((k b) (((k (λx.(x h))) (λp.(p (h (λa.g))))) (b b))))) | [
"Translate the description into ((λp.p) ((λr.r) ((λb.((m b) (λb.((k b) (((k (λx.(x h))) (λp.(p (h (λa.g))))) (b b)))))) ((m g) (f (((f h) (n g)) (λr.(r ((r (λp.(λz.p))) (λz.h)))))))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λp.p) ((λr.r) ((λb.((m b) (λb.((k b) (((k (λx.(x h)))... |
A test designer wants an evaluator to continue searching through the whole expression after an initial reduction. The input for the test is specified 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 that n... | (λv0.((n (((((k v0) v0) (v0 (g v0))) (λr.(λz.v0))) (λr.r))) (w2 (λa.(f (λq.((k (n (λd.g))) (a (λb.m))))))))) | [
"The original lambda term is ((λs.s) ((λc.c) ((λq.(λw2.((n (((((k w2) w2) (w2 (g w2))) (λr.(λz.w2))) (λr.r))) q))) (w2 (λa.(f (λq.((k (n (λd.g))) (a (λb.m)))))))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λs.s) ((λc.c) ((λq.(λw2.((n (((((k w2) w2) (w2 (g w2))) (λr.(λz.w2))) (λr... |
A software team is migrating a symbolic evaluator and needs a common regression case. The archived fixture gives the input in words. 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 parameter i... | (λa.(λf.(λh.(λk.(λm.(λu.(λv0.(λv1.((m (((v0 f) m) ((k (v0 (λw.(λz.(k z))))) (f m)))) ((a u) (λw.(((f (m w)) (λq.h)) w)))))))))))) | [
"The original lambda term is (λa.(λf.(λh.(λk.(λm.(λu.((λw.w) ((λq.(λa.(λu.((m (((a f) m) ((k (a (λw.(λz.(k z))))) (f m)))) q)))) ((a u) (λw.(((f (m w)) (λq.h)) w))))))))))).",
"From the whole term, follow the body of lambda a, then the body of lambda f, then the body of lambda h, then the body of lambda k, then t... |
A symbolic debugger has recorded a test expression as a series of small construction instructions. The operator needs the result of reducing the entire term. 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 w... | (λf.(λg.(λk.(λm.(λn.((k ((n k) ((g (f (λd.d))) (g f)))) ((m ((((m m) f) (λr.r)) m)) ((f (λd.f)) g)))))))) | [
"Start the normal-order reduction from (λf.(λg.(λk.(λm.(λn.((λw.w) ((λz.z) ((((λf.(λg.(λx.(f (g x))))) (λw.((k ((n k) ((g (f (λd.d))) (g f)))) w))) (λp.((m p) ((f (λd.f)) g)))) ((((m m) f) (λr.r)) m))))))))).",
"From the whole term, follow the body of lambda f, then the body of lambda g, then the body of lambda k... |
A colleague described a test term at a design review. The evaluator's author needs the normal form that follows under the team's reduction convention. 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 ... | (λf.(λh.(λk.(λm.((m (k h)) ((m (k h)) ((m (k h)) ((m (k h)) (((m (λq.q)) m) ((f f) (λc.c))))))))))) | [
"Translate the description into (λf.(λh.(λk.(λm.((λd1.d1) (((((λm.(λn.(λf.(λx.((m f) ((n f) x)))))) (λf.(λx.(f (f (f x)))))) (λf.(λx.(f x)))) (m (k h))) (((m (λq.q)) m) ((f f) (λc.c))))))))).",
"From the whole term, follow the body of lambda f, then the body of lambda h, then the body of lambda k, then the body o... |
A compiler engineer is checking the normalizer on a functional program specified in prose. The test report needs its final form. 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 p... | (λx.(((((((m (λs.(λy.s))) (λd.d)) (m (n h))) (λp.(λt.((t (λp.p)) (t (h t)))))) (λs.((f (f (λr.k))) (v1 f)))) (λb.(λx1.(λs.(λp.((h (x1 g)) (h p))))))) (λs.((f (k f)) (m n))))) | [
"Represent the functions and applications as ((λy.y) (λx.(((((((m (λs.(λy.s))) (λd.d)) (m (n h))) (λp.((λr.r) ((λz.z) (λt.((t (λp.p)) (t (h t)))))))) (λs.((λy.y) ((λp.p) ((f (f (λr.k))) (v1 f)))))) (λb.((λr.r) ((λx.x) (λx1.(λs.(λp.((h (x1 g)) (h p))))))))) (λs.((λp.p) ((f (k f)) (m n))))))).",
"The leftmost outer... |
A toolkit maintainer is building a demonstration of symbolic evaluation for the documentation. The demonstration specifies its starting expression in prose. 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 n... | ((k (λy.y)) (((((m k) (m h)) (f m)) (g ((g k) (λc.(λb.g))))) (λd.n))) | [
"Start the normal-order reduction from ((λq.q) ((λj.((k (λy.y)) (((((m k) (m h)) (f m)) (g ((g k) (λc.(λb.g))))) (λd.n)))) ((λz.(z z)) (λz.(z z))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λq.q) ((λj.((k (λy.y)) (((((m k) (m h)) (f m)) (g ((g k) (λc.(λb.g))))) (λd.n)))) ((λz.(z... |
A symbolic debugger has recorded a test expression as a series of small construction instructions. The operator needs the result of reducing the entire term. Whenever a numbered component is mentioned, insert its description at that position. Determine scope in the resulting expression, using the nearest enclosing para... | (((((n ((h (λq.q)) (m m))) (((h k) (λy2.y2)) m)) (λw1.(λz.(λp2.(v0 (λq.p2)))))) (λw1.(λz.(λp2.(v0 (λq.p2)))))) (λw1.(λz.(λp2.(v0 (λq.p2)))))) | [
"The original lambda term is ((λq.q) ((λx.(((((n ((h (λq.q)) (m m))) (((h k) (λy2.y2)) m)) x) x) x)) ((λw.w) (λw1.(λz.(λp2.(v0 (λq.p2)))))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λq.q) ((λx.(((((n ((h (λq.q)) (m m))) (((h k) (λy2.y2)) m)) x) x) x)) ((λw.w) (λw1.(λz.(λp2.(v0 ... |
An editor has a verbal example for a chapter about substituting function arguments. They need its full normal form for the answer key. 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 parameter... | ((m ((((f (f k)) f) m) (λx.x))) (λb.((n b) (λs0.(λu.(((n s0) b) (λw.k))))))) | [
"Represent the functions and applications as ((λb.((m b) (λb.((n b) (λs0.(λu.(((n s0) b) (λw.k)))))))) ((((f (f k)) f) m) (λx.x))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λb.((m b) (λb.((n b) (λs0.(λu.(((n s0) b) (λw.k)))))))) ((((f (f k)) f) m) (λx.x)))`. A nested binder named... |
A student solving an assignment has written down the expression's components before reducing it. Their submission must give the final compact 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, o... | ((v0 v1) (λv3.((m (λy.((h (h (y y))) (λs.v2)))) (d (k ((g k) (m (n f)))))))) | [
"Translate the description into ((v0 v1) ((λt.(λd.((m (λy.((h (h (y y))) (λs.v2)))) t))) (d (k ((g k) (m (n f))))))).",
"From the whole term, follow the argument side. Contract the redex `((λt.(λd.((m (λy.((h (h (y y))) (λs.v2)))) t))) (d (k ((g k) (m (n f))))))`. Skip v0, v1, v2 because those names already occur... |
A software team is migrating a symbolic evaluator and needs a common regression case. The archived fixture gives the input in words. 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 parameter i... | (λg.(λk.(λm.(λn.(λc.(λz.((m ((m (λy2.(λc.(λr.(((((g (g (λz.n))) (λp.k)) ((r n) (λz.(λy.y2)))) c) (y2 (λw.(g w)))))))) ((m (λa.g)) (z z)))) ((z (m ((z z) (λw.w)))) ((g z) n))))))))) | [
"Represent the functions and applications as (λg.(λk.(λm.(λn.(λc.(λz.((m ((λq.q) ((λs.((m s) ((m (λa.g)) (z z)))) (λy2.(λc.(λr.(((((g (g (λz.n))) (λp.k)) ((r n) (λz.(λy.y2)))) c) (y2 (λw.(g w)))))))))) ((z (m ((z z) (λw.w)))) ((g z) n))))))))).",
"From the whole term, follow the body of lambda g, then the body of... |
A researcher is making a reproducibility fixture for two implementations of beta reduction. Both implementations will start with the expression described 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 occurrenc... | ((m ((m (m (h (f (v0 n))))) (((h h) f) (λa.((g a) (λb1.h)))))) ((h f) (λx1.(λw.w)))) | [
"Represent the functions and applications as ((λt1.t1) ((λy.y) ((((λf.(λg.(λx.(f (g x))))) (λa1.((m a1) ((h f) (λx1.(λw.w)))))) (λq.((m q) (((h h) f) (λa.((g a) (λb1.h))))))) (m (h (f (v0 n))))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λt1.t1) ((λy.y) ((((λf.(λg.(λx.(f (g x)))... |
A course grader has an exercise about the order in which function calls are reduced. The exercise gives the input through a sequence of construction descriptions. Replace every part reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the sa... | (((((h (λz.(λd.z))) (m (n f))) (((f h) (λd.g)) (λz.v0))) ((v1 (λw.f)) (λx.f))) (λw2.(λx.(λc.(λt.(λt1.(λq.f))))))) | [
"Represent the functions and applications as ((λy.y) ((((λp.(λb.(λa.(((((h (λz.(λd.z))) (m (n f))) p) b) a)))) ((λd.d) (((f h) (λd.g)) (λz.v0)))) ((λd.d) ((v1 (λw.f)) (λx.f)))) (λw2.(λx.(λc.(λt.(λt1.(λq.f)))))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λy.y) ((((λp.(λb.(λa.((((... |
A developer is debugging a symbolic evaluator whose output still contains a function call that can be contracted. The input is described 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 sta... | (λz.(((((n h) (n f)) (λz.(n (((k (m (k m))) (g h)) (h n))))) (λy.((k (h ((n g) (v2 m)))) (λt.t)))) (λc.((f h) (m ((n n) h)))))) | [
"Start the normal-order reduction from (λz.(((((n h) (n f)) (λz.((λd.d) ((λr.r) ((λb.b) (n (((k (m (k m))) (g h)) (h n)))))))) (λy.((λr.r) ((λr0.r0) ((λy.y) ((k (h ((n g) (v2 m)))) (λt.t))))))) (λc.((λd.d) ((λz.z) ((λs.s) ((f h) (m ((n n) h))))))))).",
"From the whole term, follow the body of lambda z, then the f... |
An instructor is preparing a demonstration of lexical binding during function application. The class will construct and normalize the expression from these notes. Treat the numbered labels as shorthand for expressions. Once those labels are expanded, a variable belongs to the nearest enclosing parameter of the same nam... | ((m (((n g) (m f)) ((((v0 (λd.f)) (f (λw0.(w0 (w0 (λa.w0)))))) (g (h k))) (λc.c)))) (((h n) f) ((h g) (λu.h)))) | [
"The original lambda term is ((λt.((m t) (((h n) f) ((h g) (λu.h))))) ((λt.t) (((n g) (m f)) ((((v0 (λd.f)) (f (λw0.(w0 (w0 (λa.w0)))))) (g (h k))) (λc.c))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λt.((m t) (((h n) f) ((h g) (λu.h))))) ((λt.t) (((n g) (m f)) ((((v0 (λd.f)) (f... |
A compiler engineer is checking the normalizer on a functional program specified in prose. The test report needs its final form. 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 para... | (((k m) (λr0.(λz.h))) (λs.(λy.(λp.((y s) (λp.((p p) (λp.(h (λp.p)))))))))) | [
"The original lambda term is ((λy.y) ((λy.y) ((λj.(((k m) (λr0.(λz.h))) (λs.(λy.(λp.((y s) (λp.((p p) (λp.(h (λp.p))))))))))) ((λr.(r r)) (λr.(r r)))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λy.y) ((λy.y) ((λj.(((k m) (λr0.(λz.h))) (λs.(λy.(λp.((y s) (λp.((p p) (λp.(h (λp.p))... |
A technical writer is turning a walkthrough of a functional evaluator into a runnable example. The start of the example is given as construction notes. 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... | (λx.(λx.((k (λs.(((h n) (g s)) x))) ((k ((((k (λp.(x (p (λd.p))))) (x ((x x) (λq.(q (λs.s)))))) ((k (λp.(x (p (λd.p))))) (x ((x x) (λq.(q (λs.s))))))) (((k (λp.(x (p (λd.p))))) (x ((x x) (λq.(q (λs.s)))))) (n (λy.((k (λp.(x (p (λd.p))))) (x ((x x) (λq.(q (λs.s))))))))))) ((k (λp.(x (p (λd.p))))) (x ((x x) (λq.(q (λs.s)... | [
"Represent the functions and applications as ((λp.p) ((λy1.y1) (λx.(λx.((k (λs.(((h n) (g s)) x))) ((λx.((k ((x x) (x (n (λy.x))))) x)) ((k (λp.(x (p (λd.p))))) (x ((x x) (λq.(q (λs.s)))))))))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λp.p) ((λy1.y1) (λx.(λx.((k (λs.(((h n) (g... |
An engineer is checking a reducer on an expression that may retain free variables. The input can be assembled as described below. Whenever a numbered component is mentioned, insert its description at that position. Determine scope in the resulting expression, using the nearest enclosing parameter of the same name for e... | ((n ((m (((n g) (((f (λs.n)) (k h)) (λp.n))) ((h m) (λx.x)))) (((f f) (k f)) (λz.z)))) ((g h) (n (λz.(λu.u))))) | [
"The original lambda term is ((((λf.(λg.(λx.(f (g x))))) (λa.((n a) ((g h) (n (λz.(λu.u))))))) (λz.((m z) (((f f) (k f)) (λz.z))))) (((n g) (((f (λs.n)) (k h)) (λp.n))) ((h m) (λx.x)))).",
"From the whole term, follow the function side, then the function side. Contract the redex `((λf.(λg.(λx.(f (g x))))) (λa.((n... |
A lesson author wants students to read a functional program described in words, then perform the evaluator's substitutions. This example begins with the following definitions. Treat the numbered labels as shorthand for expressions. Once those labels are expanded, a variable belongs to the nearest enclosing parameter of... | ((((h ((k (n g)) (f m))) f) (λs.(((m m) n) g))) (λb.((f (n k)) ((k (λa.g)) h)))) | [
"Translate the description into ((λt.t) ((((h ((k (n g)) (f m))) f) (λs.((λz.z) ((λp.p) ((λq.q) (((m m) n) g)))))) (λb.((λp2.p2) ((λy.y) ((λa.a) ((f (n k)) ((k (λa.g)) h)))))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λt.t) ((((h ((k (n g)) (f m))) f) (λs.((λz.z) ((λp.p) ((λq.q... |
A library author is documenting the reducer's precise choice of fresh names. The worked example begins by constructing the following expression. 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 its cl... | (λg.(λk.(λm.(λn.((m ((g n) ((m (k g)) (g (λs.k))))) (λp.((m ((((k p) (λx.x)) p) (λa.a))) p))))))) | [
"Translate the description into (λg.(λk.(λm.(λn.((λp.((m p) (λp.((m ((((k p) (λx.x)) p) (λa.a))) p)))) ((g n) ((m (k g)) (g (λs.k))))))))).",
"From the whole term, follow the body of lambda g, then the body of lambda k, then the body of lambda m, then the body of lambda n. Contract the redex `((λp.((m p) (λp.((m ... |
A colleague described a test term at a design review. The evaluator's author needs the normal form that follows under the team's reduction convention. 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.((m (t (λu.(g (g (λz.h)))))) ((v2 ((v2 (λs0.h)) (λr.((r f) v2)))) (λq.(λc.n)))))) | [
"Start the normal-order reduction from ((λy.y) ((v0 v1) ((λq.(λt.((m q) ((t ((t (λs0.h)) (λr.((r f) t)))) (λq.(λc.n)))))) (t (λu.(g (g (λz.h)))))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λy.y) ((v0 v1) ((λq.(λt.((m q) ((t ((t (λs0.h)) (λr.((r f) t)))) (λq.(λc.n)))))) (t (λu.(... |
A toolkit maintainer is building a demonstration of symbolic evaluation for the documentation. The demonstration specifies its starting expression in prose. Replace every piece reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with the same na... | (λk.(λn.(λq.(λw.(λv0.(λv1.(λv2.((k ((v2 v2) (λy0.(y0 (λr.n))))) ((q w) ((k (λq.(k q))) (λw.w))))))))))) | [
"Translate the description into (λk.(λn.(λq.(λw.((λs.s) ((λu.(λq.(λw.(λq.((k ((q q) (λy0.(y0 (λr.n))))) u))))) ((q w) ((k (λq.(k q))) (λw.w))))))))).",
"From the whole term, follow the body of lambda k, then the body of lambda n, then the body of lambda q, then the body of lambda w. Contract the redex `((λs.s) ((... |
A reviewer needs to check an interpreter's handling of nested functions. The notes specify the expression to feed into its normal-order evaluator. 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 fr... | (λu.((k ((k ((((g (u (λw1.u))) (λb.m)) (m (u h))) (u g))) (λw.((u w) (λz.(k (λd.z))))))) ((f u) (λd.d)))) | [
"Translate the description into ((λb.b) (λu.((k ((λs.s) ((λd.d) ((λs.((k s) (λw.((u w) (λz.(k (λd.z))))))) ((((g (u (λw1.u))) (λb.m)) (m (u h))) (u g)))))) ((f u) (λd.d))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λb.b) (λu.((k ((λs.s) ((λd.d) ((λs.((k s) (λw.((u w) (λz.(k (λd.... |
A pair of developers are comparing the output of two reducers. They have agreed to reconstruct the following expression from its description. 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... | (((((((h (h h)) (g (m n))) (((g (λp.(λt.n))) (λw.(λp.(k p)))) (n k))) (g (m (n (λt.(n t)))))) ((h (λs.v1)) (k (λz.z)))) ((h (g (λz.k))) (((h v1) (λs.s)) (λz.(λy1.z))))) ((g (λz.f)) (n (λy.y)))) | [
"Represent the functions and applications as ((λq.q) ((((((λz.(λx.(λq.(λy.(λd.(((((((h (h h)) (g (m n))) z) x) q) y) d)))))) ((λs.s) (((g (λp.(λt.n))) (λw.(λp.(k p)))) (n k)))) ((λc.c) (g (m (n (λt.(n t))))))) ((h (λs.v1)) (k (λz.z)))) ((λb.b) ((h (g (λz.k))) (((h v1) (λs.s)) (λz.(λy1.z)))))) ((g (λz.f)) (n (λy.y))... |
An instructor is preparing a demonstration of lexical binding during function application. The class will construct and normalize the expression from these notes. Replace every fragment reference with the expression it describes before deciding scope. Each variable then refers to the nearest enclosing parameter with th... | ((((g f) (λd1.(λr.r))) ((n k) g)) (λx.f)) | [
"Start the normal-order reduction from ((λx.x) ((λq.q) (((λt.(λf.f)) ((λt.(t t)) (λt.(t t)))) ((((g f) (λd1.(λr.r))) ((n k) g)) (λx.f))))).",
"The leftmost outermost redex is at the top level. Contract the redex `((λx.x) ((λq.q) (((λt.(λf.f)) ((λt.(t t)) (λt.(t t)))) ((((g f) (λd1.(λr.r))) ((n k) g)) (λx.f)))))`.... |
A verification engineer is recording an expected result for a capture-avoiding evaluator. The test begins with the expression assembled 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 without such a p... | (((n (λq.(v0 (q (λr.n))))) ((h (f (λs.(λy.(λb.(g s)))))) (λu.k))) (λw.((w w) (λr.w)))) | [
"Start the normal-order reduction from (((n (λq.(v0 (q (λr.n))))) ((λw.w) ((λx.x) ((λr.r) ((h (f (λs.(λy.(λb.(g s)))))) (λu.k)))))) ((λu0.u0) ((λq.q) ((λy.y) (λw.((w w) (λr.w))))))).",
"From the whole term, follow the function side, then the argument side. Contract the redex `((λw.w) ((λx.x) ((λr.r) ((h (f (λs.(λ... |
Each record has a prose Question, a lambda-only Answer, and an Expression Solution Steps array that explains each normal-order contraction and ends with the exact answer.
Verified all 100,000 unique questions against their source terms, including 435,443 beta contractions and 35,592 capture-avoiding renames.
Dataset created with ChatGPT sol 6.1 ultra