-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample3.txt
More file actions
85 lines (62 loc) · 2.43 KB
/
Copy pathexample3.txt
File metadata and controls
85 lines (62 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# 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 <e,t> : P-Q X-Z
variables of type <e,et> : 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 ] ] ]