# This is an example exercise file for the Penn Lambda # Calculator. Exercise files are plain-text files (saved # in the Unicode UTF-8 character encoding). # # Remember that because you will send this file to students, # do not include the answers to the problems in here! # # Lines beginning with hashes are ignored by the program. # # The first (non-hashed) line is the title of the problem set. Penn Lambda Calculator Example Exercise File # Following the title, you will usually specify typing conventions. # If you specify no conventions, default conventions are used. # Also note the "; display as:" command which you can use on any # type line to specify how the type should be shown to the students # on screen. # # The defaults are specified explicitly here: constants of type e : a b c constants of type : P-Q constants of type : R; display as: two-place predicate variables of type e : u-z variables of type : X Y # The first problem group will be for the "semantic types" # exercise type, where the student is asked to provide the # type of an expression (e, , etc.). # # A problem group begins with a directive indicating the # type of problems in the group. # # It is followed by a "title" directive to give a name # to the group. # # Then, provide directions for the group, spread across lines # that begin with the "directions" directive. exercise semantic types title Semantic Types directions Give the semantic type of the following lambda-expressions. directions For instance, the type of "x" is e, and the type of "P(x)" directions is t. directions You may want to simplify the expressions in your mind if directions necessary before assigning a type. directions You may omit commas between single-letter types only. Angled directions brackets around single-letter type combinations can be omitted directions as well. Thus directions you can abbreviate <,> as <,> or simply directions . # You can also specify how many points each exercise below is worth # so that scores can be automatically computed in the teacher tool. # This is optional. The point value applies for all exercises until # another "points per exercise" directive is found in the file. points per exercise 5 # After introducing the group with the "exercise", "title", and "directions" # lines above, put each problem on a separate line. The answers are # automatically computed by the program. # # See the exercise file documentation on the website for how to enter # lambda expressions here. In short, the letters L, A, E, I, and V # mean lambda, for-all, exists, iota, and disjunction. P(a) -> Q(b) Lx[P(x) & Q(x)] Lx.Ly.R(x,y) Lx.Ez[Ly.R(x,y) (z)] Iy[(Lz[P(z)]) (y)] LX.LY.Ix[X(x) V Y(x)] # If this were the last problem in the homework, this file would end # here. However, we'll demonstrate how to create the other kinds of # exercises as well. # The second problem group will be for the "lambda conversion" # exercise type, where the student is asked to reduce expressions. # # The "exercise", "title", and "directions" directives start off # the group, and then the problems are given one per line. exercise lambda conversion title Lambda Conversion I directions After checking that the type of the function and the type of the directions argument(s) match, simplify the following expressions performing directions one lambda-conversion at a time. # Another "points per exercise" directive changes the point values of # the remaining exercises in this file. points per exercise 10 Lx.Ly.[R(x,y) & R(y,x)] (a) (b) Lx.Ly.Ey[R(x,y) & Q(x)] (a) (b) Ly.Lx.~Ey[Q(y) & Ax(R(x,y))] (a) (b) Lx.Ly.Lx.[R(x,b) & T(y)] (a) (b) (c) Lx.Ey[Q(x) V T(y)] (y) Lx.Ly.[ExEy[R(x,y)] -> P(x) & Q(y)] (a) (b) # You can have multiple problem groups for the same exercise type. # Below we'll have a second group of more difficult lambda conversions. exercise lambda conversion title Lambda Conversion II directions Here are some more difficult lambda expressions. directions After checking that the type of the function and the type of the directions argument(s) match, simplify the following expressions performing directions one lambda-conversion at a time. Lx.Ly.Lz.[P(x) & Ey[P(y)] -> AzEx[R(z,y) & Q(x)]] (a) (b) (c) LX.Lx.X(x) (Ly.R(y,a)) (b) Lx.Ly. [R(z,y) -> Az[R(x,z)]] (b) (z) LX.Ly.X(y) (Lz. P(z) & Q(y)) (a) Lx.Ly. [[R(z,y) & P(x)] -> [Az[R(x,z)] V ~Ax[Q(x)]]] (z) (a) LX.LY.Ax[X(x) -> Y(x)] (Ly.P(y)) (Lz.Q(z)) LX.Lz.[Az[P(z)] V ~Ev[X(v)]] (Lu.R(v,u)) (a) # In a fourth problem group we'll have tree derivation exercises. # To be sure, we'll specify the types of all of the variables # we'll need in this part: constants of type e : c p r s variables of type e : x-z variables of type v : e variables of type : P-Q X-Z variables of type : R variables of type > : S variables of type : T # Up till now, constants and variables in expressions could only # be a single letter. We can turn this off to allow for constants # like "sleeps" like this: multiple letter identifiers # "use rule" directives indicate which composition rules are available # for students to choose from. We'll include all of the composition # rules in this assignment: use rule function application use rule non-branching nodes use rule predicate modification use rule lambda abstraction # Next, lexical entries provided to the student are given. The student # can always enter his or her own, so you don't need to list any here. # A word (i.e. "sleep") can be given any number of lexical entry choices # by repeating the "define" directive multiple times. define Carlos : c define Paco : p define shaves : LxLy[shaves(y,x)] define introduces : LxLyLz[introduces(z,x,y)] # We'll introduce this problem group as usual with the "exercise", # "title", and "directions" directives. exercise tree title Formulating NatLg denotations as lambda-expressions directions In some languages, there is a morpheme directions that attaches to the verb stem and reduces its arity by one. Let us directions take the following imaginary morphemes α, β, γ, and δ. directions Assuming the syntactic structure given, give a denotation for each of directions these morphemes (in lambda-notation, for any arbitrary situation). \\ directions \\ directions Note the typing conventions of P, R and S. # Next come each of the tree exercises. Each exercise is given # as the labeled-brackets notation of the tree that the student # is going to be presented with. The labeled brackets notation # must appear on a single line. Nonterminal labels are given by # putting a dot after the opening bracket, and then the label. # Before any individual exercise, you can use "instructions" directives # to provide instructions for that particular problem. That is, "directions" # directives are applicable to a whole problem group (all of the exercises # in this part), while "instructions" are used for the very next problem # only. instructions For the sentence in (1), make the structure below yield instructions the meaning in (2) by supplying the denotation of α. instructions (1) Carlos-SU α-shaves \\ instructions (2) “Carlos shaves Carlos” (i.e., Carlos shaves himself) [.IP Carlos [.VP α shaves]] # That was the instructions and tree for the first problem. Now the # second one: instructions For the sentence in (1), make the structure below yield instructions the meaning in (2) by supplying the denotation of β. instructions Check your answer by having Lambda step through the instructions derivation. \\ instructions (1) Carlos-SU β-introduces Paco-DO. \\ instructions (2) “Carlos introduces Paco to Carlos (himself).” [.IP Carlos [.VP [.V^0 β introduces] Paco ]] # And the third and fourth ones... instructions For the sentence in (1), make the structure below yield instructions the meaning in (2) by supplying the denotation of γ. instructions Check your answer by having Lambda step through the instructions derivation. \\ instructions (1) Carlos-SU γ-introduces Paco-DO. \\ instructions (2) “Carlos introduces Paco to Paco (himself).” [.IP Carlos [.VP [.V^0 γ introduces] Paco ]] instructions For the sentence in (1), make the structure below yield instructions the meaning in (2) by supplying the denotation of δ. instructions Check your answer by having Lambda step through the instructions derivation. \\ instructions (1) Carlos-SU δ-introduces Paco-IO. \\ instructions (2) “Carlos introduces nobody but Carlos (himself) to Paco.” [.IP Carlos [.VP [.V^0 δ introduces] Paco ]] # That is the end of this sample exercise file.