# One can write arbitrary comments in this file after hashes,
# but keep in mind that students will be able to see such comments.
# The first non-comment line of the file is the title of the
# assignment.
Homework 3: Generalized Quantifiers
# Next, typing conventions are entered. If no typing conventions
# are given, some defaults are used.
constants of type e : a b c
constants of type n : k
variables of type e : x-z
variables of type <'a,'b> : d-f
variables of type : P-Q X-Z
variables of type : R-W
# The following directive instructs the program to
# interpret multiple-letter constants and variables
# properly.
multiple letter identifiers
# "use rule" directives are for tree evaluation exercises.
# They indicate which composition rules are available
# at nonterminals.
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.
# A word (i.e. "sleep") can be given any number of lexical
# entry choices by repeating the "define" directive multiple
# times. Students are able to add their own lexical entries
# as well.
define happy : Lx.happy(x)
define boy,boys : Lx.boy(x)
define girl,girls : Lx.girl(x)
define love, loves : LyLx.love(x,y)
define someone, somebody : LP.Ex[P(x)]
define everyone, everybody : Lf.Ax[f(x)]
define no-one, nobody : LP.~Ex[P(x)]
define some,a : LP.LQ.Ex[P(x) & Q(x)]
define some,a : LP.LR.Ly.Ex[P(x) & R(x)(y)]
define every : LP.LQ.P << Q
define every : LP.LQ.{x | P(x)} << {x | Q(x)}
define every : LP.LR.Ly.{x | P(x)} << {x | R(x)(y)}
define most : LP.LQ.[|P ^^ Q| >= k*|P|]
define most : LP.LQ.[|{x | P(x)} ^^ {x | Q(x)}| >= k*|{x|P(x)}|]
define no : LP.LQ.~Ex[P(x) & Q(x)]
define no : LP.LQ.P ^^ Q = \emptyset
define no : LP.LQ.|P ^^ Q| = 0
define Alice : a
define Betty : b
define Connor : c
# Finally, the exercises themselves are entered.
exercise tree
title Formulating NatLg denotations as lambda-expressions
directions Do the derivation.
[.S [.NP everyone] [.VP (is) [.VP happy] ] ]
[.S [.NP every boy] [.VP (is) [.VP happy] ] ]
[.S [.NP every boy] [.VP loves [.NP some girl ] ] ]
[.S [.NP every boy] [.VP loves [.NP every girl ] ] ]
[.S [.NP some boy] [.VP loves [.NP some girl ] ] ]
[.S [.NP some boy] [.VP loves [.NP every girl ] ] ]
[.S [.NP most boys] [.VP love [.NP some girl ] ] ]
[.S [.NP no boy] [.VP loves [.NP a girl ] ] ]
[.S [.NP no boy] [.VP loves [.NP every girl ] ] ]