summaryrefslogtreecommitdiff
path: root/examples/attempto/AttemptoI.gf
blob: a10214cf9b2c52fc4484747868ac543a72b26c75 (plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
incomplete concrete AttemptoI of Attempto = open 
  Syntax, 
  Symbolic,
  LexAttempto 
in {

lincat CN = Syntax.CN ;
lincat NP = Syntax.NP ;
lincat Card = Syntax.Card ;
lincat PN = Syntax.PN ;
lincat A = Syntax.A ;
lincat A2 = Syntax.A2 ;
lincat AP = Syntax.AP ;
lincat RS = Syntax.RS ;
lincat Pron = Syntax.Pron ;
lincat Prep = Syntax.Prep ;
lincat S = Syntax.S ;
lincat VP = Syntax.VP ;
lincat V = Syntax.V ;
lincat V2 = Syntax.V2 ;
lincat V3 = Syntax.V3 ;
lincat Adv = Syntax.Adv ;
lincat Conj = Syntax.Conj ;
lincat IP = Syntax.IP ;
lincat IAdv = Syntax.IAdv ;
lincat QS = Syntax.QS ;
lincat Text = Syntax.Text ;
lincat ACEText = Syntax.Text ;

lincat MCN = Syntax.CN ;
--lincat Var = Symb ;
lincat PP = Adv ;

lin aNP = mkNP a_Art ;
lin theNP = mkNP the_Art ;
lin cardNP d = mkNP d ;
--lin noNP : CN -> NP ;
lin everyNP = mkNP every_Det ;
--lin eachNP : CN -> NP ;
--lin notEveryNP : CN -> NP ;
--lin notEachNP : CN -> NP ;
lin theCollNP = mkNP the_Art plNum ;
lin someCollNP = mkNP somePl_Det ;
lin allCollNP cn = mkNP all_Predet (mkNP a_Art plNum cn) ;

--lin noCollNP : CN -> NP ;
--lin eachTheNP : CN -> NP ;
--lin eachSomeNP : CN -> NP ;
--lin eachNumNP : Card -> CN -> NP ;

lin someMassNP = mkNP someSg_Det ;
lin allMassNP cn = mkNP all_Predet (mkNP cn) ;

--lin noMassNP : MCN -> NP ;
--lin notAllMassNP : MCN -> NP ;

lin pnNP = mkNP ;
lin intNP = symb ;
lin floatNP = symb ;
--lin intNegNP : Int -> NP ;

lin it_NP = mkNP it_Pron ;
lin he_NP = mkNP he_Pron ;
lin she_NP = mkNP she_Pron ;
lin they_NP = mkNP they_Pron ;

lin conjNP = mkNP and_Conj ;
lin adjCN = mkCN ;

{-
lin someone_NP : NP ;
lin somebody_NP : NP ;
lin something_NP : NP ;
lin noone_NP : NP ;
lin nothing_NP : NP ;
lin not_everyoneNP : NP ;
lin not_everybodyNP : NP ;
lin not_everythingNP : NP ;

lin at_leastNP : Card -> CN -> NP ;
lin not_at_leastNP : Card -> CN -> NP ;
lin at_mostNP : Card -> CN -> NP ;
lin not_at_mostNP : Card -> CN -> NP ;
lin more_thanNP : Card -> CN -> NP ;
lin not_more_thanNP : Card -> CN -> NP ;

lin nothing_butNP : CN -> NP ; -- nothing but apples
lin nothing_butMassNP : MCN -> NP ; -- nothing but water
lin nobody_butNP : PN -> NP ; -- nobody but John
lin no_butNP : CN -> PN -> NP ; -- no man but John

cat Unit ; -- SI measurement units
cat Var ;

lin unitNP : Card -> Unit -> NP ;
lin unit_ofNP : Card -> Unit -> CN -> NP ;      -- 3 kg of apples
lin unit_ofMassNP : Card -> Unit -> MCN -> NP ; -- 3 l of water
-}
lin apposVarCN cn v = mkCN cn (symb v) ;

lin varNP = symb ;

-- 2.2.1


lin adjCN = mkCN ;
lin positAP = mkAP ;
lin comparAP = Syntax.comparAP ;
lin superlAP a = mkAP (mkOrd a) ;


-- 2.2.2

lin relCN = mkCN ;
--lin relNP = mkNP ;

{-
lin andRS : RS -> RS -> RS ;
lin orRS : RS -> RS -> RS ;
lin eachRS : RS -> RS ; -- each of who
-}

-- 2.2.4

lin genNP = genitiveNP ;
lin ofCN cn np = mkCN cn (mkAdv possess_Prep np) ;
lin genOwnNP np cn = genitiveNP np (mkCN own_A cn) ;

-- 2.3.1

lin vpS np vp = mkS (mkCl np vp) ;
lin neg_vpS np vp = mkS negativePol (mkCl np vp) ;


--lin not_provably_vpS : NP -> VP -> S ;

lin vVP  = mkVP ;
lin v2VP = mkVP ;
lin v3VP = mkVP ;

-- 2.3.2

lin apVP = mkVP ;
lin compVP a np = mkVP (mkAP a np) ;
--lin as_asVP : A -> NP -> S ; -- John is as rich as Mary

-- John is as fond-of Mary as Bill
-- John is more fond-of Mary than Bill
-- John is as fond-of Mary as of Sue
-- John is more fond-of Mary than of Sue


lincat PP = Adv ;
lincat [PP] = Adv ;

lin BasePP p = p ;

lin ppVP = mkVP ;

lin prepPP = mkAdv ;

-- 2.3.5

lin canVP = mkVP can_VV ;
lin mustVP = mkVP must_VV ;

lin have_toVP = mkVP have_VV ;

-- 2.4

lin modVP = mkVP ;

-- 3.2

lin thereNP np = mkS (mkCl np) ;

{-
-- 3.3
-- Boolean formulas = \= < > <= >= 
-}

-- 3.4.1

lin coordS = mkS ;

lin and_Conj = Syntax.and_Conj ;
lin or_Conj = Syntax.or_Conj ;
--lin comma_and_Conj : Conj ; -- lower precedence
--lin comma_or_Conj : Conj ;

-- 3.4.3
{-
lin for_everyS : CN -> S -> S ;
lin for_eachS : CN -> S -> S ;
lin for_each_ofS : Card -> CN -> S -> S ; -- for each of 3 men
lin for_allMassS : MCN -> S -> S ; -- for all water

-- 3.4.4

lin if_thenS : S -> S -> S ;
-}

oper adj_thatCl : A -> S -> Cl = \a,s -> mkCl (mkVP (mkAP (mkAP a) s)) ;

lin falseS s = mkS (adj_thatCl false_A s) ;
lin not_provableS s = mkS negativePol (adj_thatCl provable_A s) ;
lin possibleS s = mkS (adj_thatCl possible_A s) ;
lin not_possibleS s = mkS negativePol (adj_thatCl possible_A s) ;
lin necessaryS s = mkS (adj_thatCl necessary_A s) ;
lin not_necessaryS s = mkS negativePol (adj_thatCl necessary_A s) ;


--lin thatS s t = mkS ;

-- 3.5

lin npQS np vp = mkQS (mkCl np vp) ;
lin ipQS ip vp = mkQS (mkQCl ip vp) ;
lin iadvQS iadv np vp = mkQS (mkQCl iadv (mkCl np vp)) ;

lin where_IAdv = Syntax.where_IAdv ;
lin when_IAdv = Syntax.when_IAdv ;
lin whoSg_IP = Syntax.whoSg_IP ;
lin whoPl_IP = Syntax.whoPl_IP ;

{-
lin there_ipQS : IP -> QS ; -- there is who

lin whoseIP : CN -> IP ;  -- whose dog
-}
-- 3.6

lin impVP np vp = mkText (mkPhr (mkUtt (mkImp vp)) (mkVoc np)) exclMarkPunct ; 
        ---- John, go to the bank!


lin consText = mkText ;
lin baseText t = t ;
lin sText = mkText ;
lin qsText = mkText ;

}