-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathenglish.lgf
384 lines (222 loc) · 6.87 KB
/
english.lgf
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
##
## _ ____ _ ___ _ ___ ___
## | | | |_ \ \_/ / / \ | |\ | / / \ __ _) )
## |_|__ |_|__ /_/ \ \_\_/ |_| \| \_\_/ (_() _)_)
##
##
## Lexon — natural language programming
##
## Copyright (C) 2016-24 Henning Diedrich. Licensed to you under
## AGPL3 subject to the conditions described in the file LICENSE.
##
## Also see https://www.lexon.org/license-0.3.html
##
##
##
## english.lgf — Lexon controlled English grammar
##
## Version 0.2.20 / subset 0.3.8 alpha 79 - English / Reyes
##
## This document is in Lexon Grammar Form, a variation of BNF.
## Square brackets indicate optionality, 'or' separates variants.
## Literals in quotes are case-insensitive.
##
## Document Head
document: head terms [covenants]
head: lex [lexon] [authors] [comment] [preamble]
lex: "LEX" ":" name separator
lexon: "LEXON" ":" description separator
authors: "AUTHOR"["S"] ":" description separator
comment: "COMMENT"["S"] ":" description separator
preamble: "PREAMBLE" ":" description separator
## Sections
t e r m s: ["GENERAL"] ["TERMS" ":"] [separator] provisions
covenants: [covenants] covenant
c o v e n a n t: ["TERMS"] "PER" name ":" [separator] provisions
## Provisions
p r o v i s i o n s: definitions [statements] [clauses]
## Definitions
definitions: [definitions] definition
definition: [article] quote name quote "is" type_term separator
or [article] quote name quote "is" this_contract separator
type_term: [article] type
## Types
type: person or amount or time or binary or text or data
person: "person"
amount: "amount"
time: "time"
binary: "binary"
text: "text"
data: "data"
this_contract: this "contract"
or this name
all_contracts: "all" "contracts"
this: "this" or "these"
## Clauses
clauses: [clauses] clause
c l a u s e : "CLAUSE" ":" name separator body
body: statements or function
## FUNCTION
function: [article] quote name quote illocutor [":"] expression separator
# IV. SENTENCE LEVEL
## STATEMENT
s t a t e m e n t s : [statements] statement
statement: action or flagging
## ACTION
action: subject [permission [comma] [condition [comma] [":"]]] predicates separator
# V. PHRASE LEVEL
## SUBJECT
subject: symbols
## SYMBOLS
symbols: [symbols catena] symbol
symbol: [article] name
or [article] type
catena: "or" or comma
## OBJECT
object: symbol or reflexive or "escrow"
reflexive: "myself" or "yourself" or "herself" or "himself" or "oneself" or "itself" or "themself" or "ourselves" or "yourselves" or "themselves"
## SELF-REFERENCE
contract: this_contract
or all_contracts
## PREDICATE
predicates: predicates comma ["and" ["also"]] ["if" "so"] ["afterwards"] predicate
or predicates comma "and" "with" "this" predicate
or predicate
predicate: certification
or declaration
or filing
or registration
or grantment
or appointment
or fixture
or setting
or payment
or sending
or notification
or termination
permission: "may"
## CERTIFICATION PREDICATE
certification: certify symbol [["as"] expression]
or certify contract ["as"] symbol
certify: "certify" or "certifies"
## DECLARAION PREDICATE
declaration: declare symbol [["to" "be"] expression]
or declare contract ["as"] symbol
declare: "declare" or "declares"
## FILING PREDICATE
filing: file ["for"] symbol [["to" "be"] expression]
or file ["for"] contract ["to" "be"] symbol
file: "file" or "files"
## REGISTRATION PREDICATE
registration: register symbol [["as"] expression]
or register contract ["as"] symbol
register: "register" or "registers"
## GRANT PREDICATE
grantment: grant symbol
grant: "grant" or "grants"
## APPOINTMENT PREDICATE
appointment: appoint symbol
appoint: "appoint" or "appoints"
## FIXTURE PREDICATE
fixture: fix symbol ["as" expression]
or fix contract "as" symbol
fix: "fix" or "fixes"
fixed: "fixed"
## FIXTURE PREDICATE / PASSIVE
setting: illocutor ["then"] ["therefor"["e"]] symbol
illocutor: be ["defined"] ["as"]
be: "be" or "is"
## PAYMENT PREDICATE
payment: pay [from_escrow] expression preposition object
or pay expression from_escrow preposition object
or pay escrow preposition object
pay: "pay" or "pays" or "return" or "returns"
preposition: "to" or "into"
escrow: ["the"] ["remainder" "of" "the"] "escrow"
from_escrow: "from" ["the"] ["remainder" "of" "the"] "escrow"
## SENDING PREDICATE
sending: send expression preposition object
send: "send" or "sends"
## NOTIFICATION PREDICATE
notification: notify object preposition expression
notify: "notify" or "notifies"
## TERMINATION PREDICATE
termination: terminate this_contract
or terminate all_contracts
terminate: "terminate" or "terminates"
## FLAGGING
flagging: [this_contract] illocutor ["then"] ["therefore"] symbol separator
# VI. EXPRESSION LEVEL
## CONDITIONS
condition: if expression [[comma] "then"]
if: "if" or "given" "that" or "provided"
## EXPRESSION
expression: combination
## COMPARISON
scalar_comparison: scalar_expression comparison_operator scalar_expression
comparison_operator: equal
or later
equal: "equal" ["to"]
or "equaling"
or "is" ["equal" ["to"]]
or "being" ["equal" ["to"]]
later: "is" "at" ["the"] "least"
or "lies" "at" ["the"] "least"
scalar_expression: symbol or scalar or point_in_time
## LOGIC EXPRESSIONS
combination: combinor [comma [combinator] combination]
combinor: combinand [combinator combinor]
combinand: symbol [expiration]
or scalar_comparison
or negation
or existence
or point_in_time
or expiration
combinator: or_
or and
or neither
or nor
or_: "or"
and: "and"
neither: "neither"
nor: "nor"
existence: symbol equal fixed
or "there" be symbol
or contract be symbol
or symbol being true
negation: negator symbol
or symbol negator fixed
or "there" negator symbol
or contract negator symbol
negator: [be] "not"
or [be] "no"
being: "is"
or "has" "been"
or "was"
true: "true"
or "yes"
or "certified"
or "declared"
or "announced"
or "filed" ["for"]
or "signed" "off" ["on"]
## FILLERS
article: "a" or "an" or "the"
## TIME
point_in_time: current_time
or relative_time
current_time: "the" ["respective"] ["then"] "current" "time"
or "now"
relative_time: duration ["in" "the"] "past" [symbol]
or duration "after" symbol
duration: scalar_expression time_unit
time_unit: years or months or weeks or days or hours or minutes or seconds or milliseconds
years: "year"["s"]
months: "month"["s"]
weeks: "week"["s"]
days: "day"["s"]
hours: "hour"["s"]
minutes: "minute"["s"]
seconds: "second"["s"]
milliseconds: "millisecond"["s"]
expiration: "has" "passed" or ["is"] "past"