occam-grammars 1.0.677 → 1.0.680

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,388 +1,388 @@
1
1
  "use strict";
2
2
 
3
- const bnf = `document ::= ( topLevelDeclaration | verticalSpace | error )+ ;
3
+ const bnf = `document ::= ( topLevelDeclaration | verticalSpace | error )+ ;
4
4
 
5
5
 
6
6
 
7
- topLevelDeclaration ::= typeDeclaration
7
+ topLevelDeclaration ::= typeDeclaration
8
8
 
9
- | variableDeclaration
9
+ | variableDeclaration
10
10
 
11
- | combinatorDeclaration
11
+ | combinatorDeclaration
12
12
 
13
- | constructorDeclaration
13
+ | constructorDeclaration
14
14
 
15
- | disjointTypeDeclaration
15
+ | disjointTypeDeclaration
16
16
 
17
- | metavariableDeclaration
17
+ | metavariableDeclaration
18
18
 
19
- | dependentTypeDeclaration
19
+ | dependentTypeDeclaration
20
20
 
21
- | rule
21
+ | rule
22
22
 
23
- | axiom
23
+ | axiom
24
24
 
25
- | lemma
25
+ | lemma
26
26
 
27
- | theorem
27
+ | theorem
28
28
 
29
- | conjecture
29
+ | conjecture
30
30
 
31
- | metalemma
31
+ | metalemma
32
32
 
33
- | metatheorem
33
+ | metatheorem
34
34
 
35
35
  ;
36
36
 
37
37
 
38
38
 
39
- verticalSpace ::= <END_OF_LINE>+ ;
39
+ verticalSpace ::= <END_OF_LINE>+ ;
40
40
 
41
41
 
42
42
 
43
- error. ::= . ;
43
+ error. ::= . ;
44
44
 
45
45
 
46
46
 
47
- typeDeclaration ::= "Type" type ( ":" type )? <END_OF_LINE> ;
47
+ typeDeclaration ::= "Type" type ( ":" type )? <END_OF_LINE> ;
48
48
 
49
- variableDeclaration ::= "Variable" variable ( ":" type )? <END_OF_LINE> ;
49
+ variableDeclaration ::= "Variable" variable ( ":" type )? <END_OF_LINE> ;
50
50
 
51
- combinatorDeclaration ::= "Combinator" statement... <END_OF_LINE> ;
51
+ combinatorDeclaration ::= "Combinator" statement... <END_OF_LINE> ;
52
52
 
53
- constructorDeclaration ::= "Constructor" term... ( ":" type )? <END_OF_LINE> ;
53
+ constructorDeclaration ::= "Constructor" term... ( ":" type )? <END_OF_LINE> ;
54
54
 
55
- disjointTypeDeclaration ::= "DisjointType" disjointType ":" type ( "," type )+ <END_OF_LINE> ;
55
+ disjointTypeDeclaration ::= "DisjointType" disjointType ":" type ( "," type )+ <END_OF_LINE> ;
56
56
 
57
- metavariableDeclaration ::= "Metavariable" metavariable ":" metaType <END_OF_LINE> ;
57
+ metavariableDeclaration ::= "Metavariable" metavariable ":" metaType <END_OF_LINE> ;
58
58
 
59
- dependentTypeDeclaration ::= "DependentType" dependentType ":" type <END_OF_LINE> ;
59
+ dependentTypeDeclaration ::= "DependentType" dependentType ":" type <END_OF_LINE> ;
60
60
 
61
61
 
62
62
 
63
- rule ::= "Rule" parenthesisedLabels <END_OF_LINE>
63
+ rule ::= "Rule" parenthesisedLabels <END_OF_LINE>
64
64
 
65
- (
65
+ (
66
66
 
67
- ( "Premises" <END_OF_LINE> premise premise+ )
67
+ ( "Premises" <END_OF_LINE> premise premise+ )
68
68
 
69
- |
69
+ |
70
70
 
71
- ( "Premise" <END_OF_LINE> premise )
71
+ ( "Premise" <END_OF_LINE> premise )
72
72
 
73
- )?
73
+ )?
74
74
 
75
- "Conclusion" <END_OF_LINE> conclusion
75
+ "Conclusion" <END_OF_LINE> conclusion
76
76
 
77
- ruleProof? ;
77
+ ruleProof? ;
78
78
 
79
79
 
80
80
 
81
- ruleProof ::= "Proof" <END_OF_LINE> ruleDerivation ;
81
+ ruleProof ::= "Proof" <END_OF_LINE> ruleDerivation ;
82
82
 
83
- ruleSubproof ::= (
83
+ ruleSubproof ::= (
84
84
 
85
- ( "Premises" <END_OF_LINE> premise premise+ )
85
+ ( "Premises" <END_OF_LINE> premise premise+ )
86
86
 
87
- |
87
+ |
88
88
 
89
- ( "Premise" <END_OF_LINE> premise )
89
+ ( "Premise" <END_OF_LINE> premise )
90
90
 
91
- )
91
+ )
92
92
 
93
- ruleSubDerivation ;
93
+ ruleSubDerivation ;
94
94
 
95
- ruleDerivation ::= (
95
+ ruleDerivation ::= (
96
96
 
97
- ( ruleSubproof | qualifiedMetastatement | unqualifiedMetastatement )+
97
+ ( ruleSubproof | qualifiedMetastatement | unqualifiedMetastatement )+
98
98
 
99
- "Therefore" <END_OF_LINE>
99
+ "Therefore" <END_OF_LINE>
100
100
 
101
- )?
101
+ )?
102
102
 
103
- ( qualifiedMetastatement | unqualifiedMetastatement ) ;
103
+ ( qualifiedMetastatement | unqualifiedMetastatement ) ;
104
104
 
105
- ruleSubDerivation ::= (
105
+ ruleSubDerivation ::= (
106
106
 
107
- "Hence" <END_OF_LINE>
107
+ "Hence" <END_OF_LINE>
108
108
 
109
- ( ruleSubproof | qualifiedMetastatement | unqualifiedMetastatement )+
109
+ ( ruleSubproof | qualifiedMetastatement | unqualifiedMetastatement )+
110
110
 
111
- )?
111
+ )?
112
112
 
113
- "Then" <END_OF_LINE>
113
+ "Then" <END_OF_LINE>
114
114
 
115
- ( qualifiedMetastatement | unqualifiedMetastatement ) ;
115
+ ( qualifiedMetastatement | unqualifiedMetastatement ) ;
116
116
 
117
117
 
118
118
 
119
- metalemma ::= "Metalemma" parenthesisedLabels? <END_OF_LINE>
119
+ metalemma ::= "Metalemma" parenthesisedLabels? <END_OF_LINE>
120
120
 
121
- (
121
+ (
122
122
 
123
- (
123
+ (
124
124
 
125
- "Suppose" <END_OF_LINE> metaSupposition+
125
+ "Suppose" <END_OF_LINE> metaSupposition+
126
126
 
127
- "Then" <END_OF_LINE> metaConsequent
127
+ "Then" <END_OF_LINE> metaConsequent
128
128
 
129
- )
129
+ )
130
130
 
131
- |
131
+ |
132
132
 
133
- metaConsequent
133
+ metaConsequent
134
134
 
135
- )
135
+ )
136
136
 
137
- metaproof ;
137
+ metaproof ;
138
138
 
139
- metatheorem ::= "Metatheorem" parenthesisedLabels <END_OF_LINE>
139
+ metatheorem ::= "Metatheorem" parenthesisedLabels <END_OF_LINE>
140
140
 
141
- (
141
+ (
142
142
 
143
- (
143
+ (
144
144
 
145
- "Suppose" <END_OF_LINE> metaSupposition+
145
+ "Suppose" <END_OF_LINE> metaSupposition+
146
146
 
147
- "Then" <END_OF_LINE> metaConsequent
147
+ "Then" <END_OF_LINE> metaConsequent
148
148
 
149
- )
149
+ )
150
150
 
151
- |
151
+ |
152
152
 
153
- metaConsequent
153
+ metaConsequent
154
154
 
155
- )
155
+ )
156
156
 
157
- metaproof ;
157
+ metaproof ;
158
158
 
159
159
 
160
160
 
161
- metaproof ::= "Proof" <END_OF_LINE> metaDerivation ;
161
+ metaproof ::= "Proof" <END_OF_LINE> metaDerivation ;
162
162
 
163
- metaSubproof ::= "Suppose" <END_OF_LINE> metaSupposition+ metaSubDerivation ;
163
+ metaSubproof ::= "Suppose" <END_OF_LINE> metaSupposition+ metaSubDerivation ;
164
164
 
165
- metaDerivation ::= (
165
+ metaDerivation ::= (
166
166
 
167
- ( metaSubproof | qualifiedMetastatement | unqualifiedMetastatement )+
167
+ ( metaSubproof | qualifiedMetastatement | unqualifiedMetastatement )+
168
168
 
169
- "Therefore" <END_OF_LINE>
169
+ "Therefore" <END_OF_LINE>
170
170
 
171
- )?
171
+ )?
172
172
 
173
- ( qualifiedMetastatement | unqualifiedMetastatement ) ;
173
+ ( qualifiedMetastatement | unqualifiedMetastatement ) ;
174
174
 
175
- metaSubDerivation ::= (
175
+ metaSubDerivation ::= (
176
176
 
177
- "Hence" <END_OF_LINE>
177
+ "Hence" <END_OF_LINE>
178
178
 
179
- ( metaSubproof | qualifiedMetastatement | unqualifiedMetastatement )+
179
+ ( metaSubproof | qualifiedMetastatement | unqualifiedMetastatement )+
180
180
 
181
- )?
181
+ )?
182
182
 
183
- "Then" <END_OF_LINE>
183
+ "Then" <END_OF_LINE>
184
184
 
185
- ( qualifiedMetastatement | unqualifiedMetastatement ) ;
185
+ ( qualifiedMetastatement | unqualifiedMetastatement ) ;
186
186
 
187
- axiom ::= "Axiom" parenthesisedLabels <END_OF_LINE>
187
+ axiom ::= "Axiom" parenthesisedLabels <END_OF_LINE>
188
188
 
189
- (
189
+ (
190
190
 
191
- (
191
+ (
192
192
 
193
- "Suppose" <END_OF_LINE> supposition+
193
+ "Suppose" <END_OF_LINE> supposition+
194
194
 
195
- "Then" <END_OF_LINE> consequent
195
+ "Then" <END_OF_LINE> consequent
196
196
 
197
- )
197
+ )
198
198
 
199
- |
199
+ |
200
200
 
201
- consequent
201
+ consequent
202
202
 
203
- ) ;
203
+ ) ;
204
204
 
205
- lemma ::= "Lemma" parenthesisedLabels? <END_OF_LINE>
205
+ lemma ::= "Lemma" parenthesisedLabels? <END_OF_LINE>
206
206
 
207
- (
207
+ (
208
208
 
209
- (
209
+ (
210
210
 
211
- "Suppose" <END_OF_LINE> supposition+
211
+ "Suppose" <END_OF_LINE> supposition+
212
212
 
213
- "Then" <END_OF_LINE> consequent
213
+ "Then" <END_OF_LINE> consequent
214
214
 
215
- )
215
+ )
216
216
 
217
- |
218
-
219
- consequent
217
+ |
218
+
219
+ consequent
220
220
 
221
- )
221
+ )
222
222
 
223
- proof ;
223
+ proof ;
224
224
 
225
- theorem ::= "Theorem" parenthesisedLabels <END_OF_LINE>
225
+ theorem ::= "Theorem" parenthesisedLabels <END_OF_LINE>
226
226
 
227
- (
227
+ (
228
228
 
229
- (
229
+ (
230
230
 
231
- "Suppose" <END_OF_LINE> supposition+
231
+ "Suppose" <END_OF_LINE> supposition+
232
232
 
233
- "Then" <END_OF_LINE> consequent
233
+ "Then" <END_OF_LINE> consequent
234
234
 
235
- )
235
+ )
236
236
 
237
- |
237
+ |
238
238
 
239
- consequent
239
+ consequent
240
240
 
241
- )
241
+ )
242
242
 
243
- proof ;
243
+ proof ;
244
244
 
245
- conjecture ::= "Conjecture" parenthesisedLabels <END_OF_LINE>
245
+ conjecture ::= "Conjecture" parenthesisedLabels <END_OF_LINE>
246
246
 
247
- (
247
+ (
248
248
 
249
- (
249
+ (
250
250
 
251
- "Suppose" <END_OF_LINE> supposition+
251
+ "Suppose" <END_OF_LINE> supposition+
252
252
 
253
- "Then" <END_OF_LINE> consequent
253
+ "Then" <END_OF_LINE> consequent
254
254
 
255
- )
255
+ )
256
256
 
257
- |
257
+ |
258
258
 
259
- consequent
259
+ consequent
260
260
 
261
- )
261
+ )
262
262
 
263
- proof? ;
263
+ proof? ;
264
264
 
265
265
 
266
266
 
267
- proof ::= "Proof" <END_OF_LINE> derivation ;
267
+ proof ::= "Proof" <END_OF_LINE> derivation ;
268
268
 
269
- subproof ::= "Suppose" <END_OF_LINE> supposition+ subDerivation ;
269
+ subproof ::= "Suppose" <END_OF_LINE> supposition+ subDerivation ;
270
270
 
271
- derivation ::= (
271
+ derivation ::= (
272
272
 
273
- ( subproof | qualifiedStatement | unqualifiedStatement )+
273
+ ( subproof | qualifiedStatement | unqualifiedStatement )+
274
274
 
275
- "Therefore" <END_OF_LINE>
275
+ "Therefore" <END_OF_LINE>
276
276
 
277
- )?
277
+ )?
278
278
 
279
- ( qualifiedStatement | unqualifiedStatement ) ;
279
+ ( qualifiedStatement | unqualifiedStatement ) ;
280
280
 
281
- subDerivation ::= (
281
+ subDerivation ::= (
282
282
 
283
- "Hence" <END_OF_LINE>
283
+ "Hence" <END_OF_LINE>
284
284
 
285
- ( subproof | qualifiedStatement | unqualifiedStatement )+
285
+ ( subproof | qualifiedStatement | unqualifiedStatement )+
286
286
 
287
- )?
287
+ )?
288
288
 
289
- "Then" <END_OF_LINE>
289
+ "Then" <END_OF_LINE>
290
290
 
291
- ( qualifiedStatement | unqualifiedStatement ) ;
291
+ ( qualifiedStatement | unqualifiedStatement ) ;
292
292
 
293
293
 
294
294
 
295
- premise ::= unqualifiedMetastatement ;
295
+ premise ::= unqualifiedMetastatement ;
296
296
 
297
- conclusion ::= unqualifiedMetastatement ;
297
+ conclusion ::= unqualifiedMetastatement ;
298
298
 
299
299
 
300
300
 
301
- metaSupposition ::= unqualifiedMetastatement ;
301
+ metaSupposition ::= unqualifiedMetastatement ;
302
302
 
303
- metaConsequent ::= unqualifiedMetastatement ;
303
+ metaConsequent ::= unqualifiedMetastatement ;
304
304
 
305
305
 
306
306
 
307
- supposition ::= unqualifiedStatement ;
307
+ supposition ::= unqualifiedStatement ;
308
308
 
309
- consequent ::= unqualifiedStatement ;
309
+ consequent ::= unqualifiedStatement ;
310
310
 
311
311
 
312
312
 
313
- unqualifiedMetastatement.. ::= metastatement... <END_OF_LINE>
313
+ unqualifiedMetastatement.. ::= metastatement... <END_OF_LINE>
314
314
 
315
- | nonsense... <END_OF_LINE>
315
+ | nonsense... <END_OF_LINE>
316
316
 
317
317
  ;
318
318
 
319
- qualifiedMetastatement.. ::= metastatement... qualification <END_OF_LINE>
319
+ qualifiedMetastatement.. ::= metastatement... qualification <END_OF_LINE>
320
320
 
321
- | nonsense... qualification <END_OF_LINE>
321
+ | nonsense... qualification <END_OF_LINE>
322
322
 
323
323
  ;
324
324
 
325
325
 
326
326
 
327
- unqualifiedStatement.. ::= statement... <END_OF_LINE>
327
+ unqualifiedStatement.. ::= statement... <END_OF_LINE>
328
328
 
329
- | nonsense... <END_OF_LINE>
329
+ | nonsense... <END_OF_LINE>
330
330
 
331
331
  ;
332
332
 
333
- qualifiedStatement.. ::= statement... qualification <END_OF_LINE>
333
+ qualifiedStatement.. ::= statement... qualification <END_OF_LINE>
334
334
 
335
- | nonsense... qualification <END_OF_LINE>
335
+ | nonsense... qualification <END_OF_LINE>
336
336
 
337
337
  ;
338
338
 
339
339
 
340
340
 
341
- qualification ::= ( "by" | "from" ) reference ;
341
+ qualification ::= ( "by" | "from" ) reference ;
342
342
 
343
343
 
344
344
 
345
- dependentType ::= [type]<NO_WHITESPACE>"(" argument... ")" ;
345
+ dependentType ::= [type]<NO_WHITESPACE>"(" argument... ")" ;
346
346
 
347
- disjointType ::= [type] ( "|" [type] )+ ;
347
+ disjointType ::= [type] ( "|" [type] )+ ;
348
348
 
349
- metaType ::= [meta-type] ;
349
+ metaType ::= [meta-type] ;
350
350
 
351
- type ::= [type] ;
351
+ type ::= [type] ;
352
352
 
353
353
 
354
354
 
355
355
  parenthesisedLabels ::= "(" labels... ")" ;
356
356
 
357
- labels ::= label ( "," label )* ;
357
+ labels ::= label ( "," label )* ;
358
358
 
359
359
 
360
360
 
361
- reference. ::= [name] ( <NO_WHITESPACE>"(" term... ")" )? ;
361
+ reference. ::= [name] ( <NO_WHITESPACE>"(" term... ")" )? ;
362
362
 
363
- label. ::= [name] ( <NO_WHITESPACE>"(" term... ")" )? ;
363
+ label. ::= [name] ( <NO_WHITESPACE>"(" term... ")" )? ;
364
364
 
365
365
 
366
366
 
367
- nonsense. ::= ( [type] | [symbol] | [operator] | [special] | [secondary-keyword] | [meta-type] | [name] | [unassigned] )+ ;
367
+ nonsense. ::= ( [type] | [symbol] | [operator] | [special] | [secondary-keyword] | [meta-type] | [name] | [unassigned] )+ ;
368
368
 
369
369
 
370
370
 
371
- metavariable ::= [name] ( <NO_WHITESPACE>"(" argument... ")" )? ;
371
+ metavariable ::= [name] ( <NO_WHITESPACE>"(" argument... ")" )? ;
372
372
 
373
- variable ::= [name] ;
373
+ variable ::= [name] ;
374
374
 
375
375
 
376
376
 
377
- metaArgument ::= statement ( )
377
+ metaArgument ::= statement ( )
378
378
 
379
- | metaType ( )
379
+ | metaType ( )
380
380
 
381
381
  ;
382
382
 
383
- argument ::= term ( )
383
+ argument ::= term ( )
384
384
 
385
- | type ( )
385
+ | type ( )
386
386
 
387
387
  ;`;
388
388