occam-verify-cli 1.0.638 → 1.0.641
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.
- package/lib/context.js +8 -1
- package/lib/element/assumption.js +3 -3
- package/lib/element/combinator.js +4 -4
- package/lib/element/declaration/combinator.js +15 -2
- package/lib/element/declaration/constructor.js +129 -60
- package/lib/element/equality.js +18 -17
- package/lib/element/frame.js +1 -1
- package/lib/element/judgement.js +3 -3
- package/lib/element/reference.js +3 -3
- package/lib/element/statement.js +3 -3
- package/lib/element/term.js +7 -4
- package/lib/utilities/element.js +124 -46
- package/package.json +7 -7
- package/src/context.js +7 -0
- package/src/element/assumption.js +1 -1
- package/src/element/combinator.js +3 -4
- package/src/element/declaration/combinator.js +19 -1
- package/src/element/declaration/constructor.js +123 -60
- package/src/element/equality.js +18 -20
- package/src/element/frame.js +0 -1
- package/src/element/judgement.js +1 -1
- package/src/element/reference.js +1 -1
- package/src/element/statement.js +1 -1
- package/src/element/term.js +7 -3
- package/src/utilities/element.js +187 -76
package/src/utilities/element.js
CHANGED
|
@@ -5,7 +5,6 @@ import elements from "../elements";
|
|
|
5
5
|
import { literally } from "../utilities/context";
|
|
6
6
|
import { baseTypeFromNothing } from "../utilities/type";
|
|
7
7
|
import { instantiateReference } from "../process/instantiate";
|
|
8
|
-
import { findMetaTypeByMetaTypeName } from "../metaTypes";
|
|
9
8
|
import { equivalenceStringFromTerms,
|
|
10
9
|
typeStringFromNominalTypeName,
|
|
11
10
|
rulsStringFromLabelsPremisesAndConclusion,
|
|
@@ -34,6 +33,8 @@ export function typeFromTypeNode(typeNode, context) {
|
|
|
34
33
|
typeString = typeStringFromNominalTypeName(nominalTypeName),
|
|
35
34
|
string = typeString; ///
|
|
36
35
|
|
|
36
|
+
context = null;
|
|
37
|
+
|
|
37
38
|
type = new Type(context, string, node, name, prefixName, superTypes, properties, provisional);
|
|
38
39
|
}
|
|
39
40
|
|
|
@@ -44,8 +45,11 @@ export function termFromTermNode(termNode, context) {
|
|
|
44
45
|
const { Term } = elements,
|
|
45
46
|
node = termNode, ///
|
|
46
47
|
string = context.nodeAsString(node),
|
|
47
|
-
type = typeFromTermNode(termNode, context)
|
|
48
|
-
|
|
48
|
+
type = typeFromTermNode(termNode, context);
|
|
49
|
+
|
|
50
|
+
context = null;
|
|
51
|
+
|
|
52
|
+
const term = new Term(context, string, node, type);
|
|
49
53
|
|
|
50
54
|
return term;
|
|
51
55
|
}
|
|
@@ -56,8 +60,11 @@ export function stepFromStepNode(stepNode, context) {
|
|
|
56
60
|
string = context.nodeAsString(node),
|
|
57
61
|
statement = statementFromStepNode(stepNode, context),
|
|
58
62
|
reference = referenceFromStepNode(stepNode, context),
|
|
59
|
-
satisfiesAssertion = satisfiesAssertionFromStepNode(stepNode, context)
|
|
60
|
-
|
|
63
|
+
satisfiesAssertion = satisfiesAssertionFromStepNode(stepNode, context);
|
|
64
|
+
|
|
65
|
+
context = null;
|
|
66
|
+
|
|
67
|
+
const step = new Step(context, string, node, statement, reference, satisfiesAssertion);
|
|
61
68
|
|
|
62
69
|
return step;
|
|
63
70
|
}
|
|
@@ -117,8 +124,11 @@ export function frameFromFrameNode(frameNode, context) {
|
|
|
117
124
|
node = frameNode, ///
|
|
118
125
|
string = context.nodeAsString(node),
|
|
119
126
|
assumptions = assumptionsFromFrameNode(frameNode, context),
|
|
120
|
-
metavariable = metavariableFromFrameNode(frameNode, context)
|
|
121
|
-
|
|
127
|
+
metavariable = metavariableFromFrameNode(frameNode, context);
|
|
128
|
+
|
|
129
|
+
context = null;
|
|
130
|
+
|
|
131
|
+
const frame = new Frame(context, string, node, assumptions, metavariable);
|
|
122
132
|
|
|
123
133
|
return frame;
|
|
124
134
|
}
|
|
@@ -127,8 +137,11 @@ export function proofFromProofNode(proofNode, context) {
|
|
|
127
137
|
const { Proof } = elements,
|
|
128
138
|
node = proofNode, ///
|
|
129
139
|
string = null,
|
|
130
|
-
derivation = derivationFromProofNode(proofNode, context)
|
|
131
|
-
|
|
140
|
+
derivation = derivationFromProofNode(proofNode, context);
|
|
141
|
+
|
|
142
|
+
context = null;
|
|
143
|
+
|
|
144
|
+
const proof = new Proof(context, string, node, derivation);
|
|
132
145
|
|
|
133
146
|
return proof;
|
|
134
147
|
}
|
|
@@ -159,8 +172,11 @@ export function sectionFromSectionNode(sectionNode, context) {
|
|
|
159
172
|
conjecture = conjectureFromSectionNode(sectionNode, context),
|
|
160
173
|
sectionString = sectionStringFromHypothesesTopLevelAssertion(hypotheses, axiom, lemma, theorem, conjecture),
|
|
161
174
|
node = sectionNode, ///
|
|
162
|
-
string = sectionString
|
|
163
|
-
|
|
175
|
+
string = sectionString; ///
|
|
176
|
+
|
|
177
|
+
context = null;
|
|
178
|
+
|
|
179
|
+
const section = new Section(context, string, node, hypotheses, axiom, lemma, theorem, conjecture);
|
|
164
180
|
|
|
165
181
|
return section;
|
|
166
182
|
}
|
|
@@ -170,8 +186,11 @@ export function premiseFromPremiseNode(premiseNode, context) {
|
|
|
170
186
|
node = premiseNode, ///
|
|
171
187
|
string = context.nodeAsString(node),
|
|
172
188
|
statement = statementFromPremiseNode(premiseNode, context),
|
|
173
|
-
procedureCall = procedureCallFromPremiseNode(premiseNode, context)
|
|
174
|
-
|
|
189
|
+
procedureCall = procedureCallFromPremiseNode(premiseNode, context);
|
|
190
|
+
|
|
191
|
+
context = null;
|
|
192
|
+
|
|
193
|
+
const premise = new Premise(context, string, node, statement, procedureCall);
|
|
175
194
|
|
|
176
195
|
return premise
|
|
177
196
|
}
|
|
@@ -206,8 +225,11 @@ export function propertyFromPropertyNode(propertyNode, context) {
|
|
|
206
225
|
string = context.nodeAsString(node),
|
|
207
226
|
propertyName = propertyNode.getPropertyName(),
|
|
208
227
|
nominalTypeName = null,
|
|
209
|
-
name = propertyName
|
|
210
|
-
|
|
228
|
+
name = propertyName; ///
|
|
229
|
+
|
|
230
|
+
context = null;
|
|
231
|
+
|
|
232
|
+
const property = new Property(context, string, node, name, nominalTypeName);
|
|
211
233
|
|
|
212
234
|
return property;
|
|
213
235
|
}
|
|
@@ -218,8 +240,11 @@ export function variableFromVariableNode(variableNode, context) {
|
|
|
218
240
|
string = context.nodeAsString(node),
|
|
219
241
|
type = null,
|
|
220
242
|
identifier = identifierFromVarialbeNode(variableNode, context),
|
|
221
|
-
propertyRelations = []
|
|
222
|
-
|
|
243
|
+
propertyRelations = [];
|
|
244
|
+
|
|
245
|
+
context = null;
|
|
246
|
+
|
|
247
|
+
const variable = new Variable(context, string, node, type, identifier, propertyRelations);
|
|
223
248
|
|
|
224
249
|
return variable;
|
|
225
250
|
}
|
|
@@ -230,8 +255,11 @@ export function subproofFromSubproofNode(subproofNode, context) {
|
|
|
230
255
|
suppositions = suppositionsFromSubproofNode(subproofNode, context),
|
|
231
256
|
subDerivation = subDerivationFromSubproofNode(subproofNode, context),
|
|
232
257
|
subproofString = subproofStringFromSuppositionsAndSubDerivation(suppositions, subDerivation, context),
|
|
233
|
-
string = subproofString
|
|
234
|
-
|
|
258
|
+
string = subproofString; ///
|
|
259
|
+
|
|
260
|
+
context = null;
|
|
261
|
+
|
|
262
|
+
const subproof = new Subproof(context, string, node, suppositions, subDerivation);
|
|
235
263
|
|
|
236
264
|
return subproof;
|
|
237
265
|
}
|
|
@@ -241,18 +269,24 @@ export function equalityFromEqualityNode(equalityNode, context) {
|
|
|
241
269
|
node = equalityNode, ///
|
|
242
270
|
string = context.nodeAsString(node),
|
|
243
271
|
leftTerm = leftTermFromEqualityNode(equalityNode, context),
|
|
244
|
-
rightTerm = rightTermFromEqualityNode(equalityNode, context)
|
|
245
|
-
subproof = new Equality(context, string, node, leftTerm, rightTerm);
|
|
272
|
+
rightTerm = rightTermFromEqualityNode(equalityNode, context);
|
|
246
273
|
|
|
247
|
-
|
|
274
|
+
context = null;
|
|
275
|
+
|
|
276
|
+
const equality = new Equality(context, string, node, leftTerm, rightTerm);
|
|
277
|
+
|
|
278
|
+
return equality;
|
|
248
279
|
}
|
|
249
280
|
|
|
250
281
|
export function deductionFromDeductionNode(deductionNode, context) {
|
|
251
282
|
const { Deduction } = elements,
|
|
252
283
|
node = deductionNode, ///
|
|
253
284
|
string = context.nodeAsString(node),
|
|
254
|
-
statement = statementFromDeductionNode(deductionNode, context)
|
|
255
|
-
|
|
285
|
+
statement = statementFromDeductionNode(deductionNode, context);
|
|
286
|
+
|
|
287
|
+
context = null;
|
|
288
|
+
|
|
289
|
+
const deduction = new Deduction(context, string, node, statement);
|
|
256
290
|
|
|
257
291
|
return deduction;
|
|
258
292
|
}
|
|
@@ -260,8 +294,11 @@ export function deductionFromDeductionNode(deductionNode, context) {
|
|
|
260
294
|
export function statementFromStatementNode(statementNode, context) {
|
|
261
295
|
const { Statement } = elements,
|
|
262
296
|
node = statementNode, ///
|
|
263
|
-
string = context.nodeAsString(node)
|
|
264
|
-
|
|
297
|
+
string = context.nodeAsString(node);
|
|
298
|
+
|
|
299
|
+
context = null;
|
|
300
|
+
|
|
301
|
+
const statement = new Statement(context, string, node);
|
|
265
302
|
|
|
266
303
|
return statement;
|
|
267
304
|
}
|
|
@@ -270,8 +307,11 @@ export function signatureFromSignatureNode(signatureNode, context) {
|
|
|
270
307
|
const { Signature } = elements,
|
|
271
308
|
node = signatureNode, ///
|
|
272
309
|
string = context.nodeAsString(node),
|
|
273
|
-
terms = termsFromSignatureNode(signatureNode, context)
|
|
274
|
-
|
|
310
|
+
terms = termsFromSignatureNode(signatureNode, context);
|
|
311
|
+
|
|
312
|
+
context = null;
|
|
313
|
+
|
|
314
|
+
const signature = new Signature(context, string, node, terms);
|
|
275
315
|
|
|
276
316
|
return signature;
|
|
277
317
|
}
|
|
@@ -291,8 +331,11 @@ export function judgementFromJudgementNode(judgementNode, context) {
|
|
|
291
331
|
node = judgementNode, ///
|
|
292
332
|
string = context.nodeAsString(node),
|
|
293
333
|
frame = frameFromJudgementNode(judgementNode, context),
|
|
294
|
-
assumption = assumptionFromJudgementNode(judgementNode, context)
|
|
295
|
-
|
|
334
|
+
assumption = assumptionFromJudgementNode(judgementNode, context);
|
|
335
|
+
|
|
336
|
+
context = null;
|
|
337
|
+
|
|
338
|
+
const judgement = new Judgement(context, string, node, frame, assumption);
|
|
296
339
|
|
|
297
340
|
return judgement;
|
|
298
341
|
}
|
|
@@ -318,8 +361,11 @@ export function parameterFromParameterNode(parameterNode, context) {
|
|
|
318
361
|
node = parameterNode, ///
|
|
319
362
|
string = context.nodeAsString(node),
|
|
320
363
|
name = parameterNode.getName(),
|
|
321
|
-
identifier = parameterNode.getIdentifier()
|
|
322
|
-
|
|
364
|
+
identifier = parameterNode.getIdentifier();
|
|
365
|
+
|
|
366
|
+
context = null;
|
|
367
|
+
|
|
368
|
+
const parameter = new Parameter(context, string, node, name, identifier);
|
|
323
369
|
|
|
324
370
|
return parameter;
|
|
325
371
|
}
|
|
@@ -328,10 +374,13 @@ export function hypothesisFromHypothesisNode(hypotheseNode, context) {
|
|
|
328
374
|
const { Hypothsis } = elements,
|
|
329
375
|
node = hypotheseNode, ///
|
|
330
376
|
string = context.nodeAsString(node),
|
|
331
|
-
statement = statementFromHypothesisNode(hypotheseNode, context)
|
|
332
|
-
parameter = new Hypothsis(context, string, node, statement);
|
|
377
|
+
statement = statementFromHypothesisNode(hypotheseNode, context);
|
|
333
378
|
|
|
334
|
-
|
|
379
|
+
context = null;
|
|
380
|
+
|
|
381
|
+
const hypohtesis = new Hypothsis(context, string, node, statement);
|
|
382
|
+
|
|
383
|
+
return hypohtesis;
|
|
335
384
|
}
|
|
336
385
|
|
|
337
386
|
export function conjectureFromConjectureNode(conjectureNode, context) {
|
|
@@ -365,8 +414,11 @@ export function conclusionFromConclusionNode(conclusionNode, context) {
|
|
|
365
414
|
const { Conclusion } = elements,
|
|
366
415
|
node = conclusionNode, ///
|
|
367
416
|
string = context.nodeAsString(node),
|
|
368
|
-
statement = statementFromConclusionNode(conclusionNode, context)
|
|
369
|
-
|
|
417
|
+
statement = statementFromConclusionNode(conclusionNode, context);
|
|
418
|
+
|
|
419
|
+
context = null;
|
|
420
|
+
|
|
421
|
+
const conclusion = new Conclusion(context, string, node, statement);
|
|
370
422
|
|
|
371
423
|
return conclusion;
|
|
372
424
|
}
|
|
@@ -376,8 +428,11 @@ export function assumptionFromAssumptionNode(assumptionNode, context) {
|
|
|
376
428
|
node = assumptionNode, ///
|
|
377
429
|
string = context.nodeAsString(node),
|
|
378
430
|
reference = referenceFromAssumptionNode(assumptionNode, context),
|
|
379
|
-
statement = statementFromAssumptionNode(assumptionNode, context)
|
|
380
|
-
|
|
431
|
+
statement = statementFromAssumptionNode(assumptionNode, context);
|
|
432
|
+
|
|
433
|
+
context = null;
|
|
434
|
+
|
|
435
|
+
const assumption = new Assumption(context, string, node, reference, statement);
|
|
381
436
|
|
|
382
437
|
return assumption;
|
|
383
438
|
}
|
|
@@ -386,8 +441,11 @@ export function derivationFromDerivationNode(derivationNode, context) {
|
|
|
386
441
|
const { Derivation } = elements,
|
|
387
442
|
node = derivationNode, ///
|
|
388
443
|
string = null,
|
|
389
|
-
stepsOrSubproofs = stepsOrSubproofsFromDerivationNode(derivationNode, context)
|
|
390
|
-
|
|
444
|
+
stepsOrSubproofs = stepsOrSubproofsFromDerivationNode(derivationNode, context);
|
|
445
|
+
|
|
446
|
+
context = null;
|
|
447
|
+
|
|
448
|
+
const derivation = new Derivation(context, string, node, stepsOrSubproofs);
|
|
391
449
|
|
|
392
450
|
return derivation;
|
|
393
451
|
}
|
|
@@ -397,8 +455,11 @@ export function typePrefixFromTypePrefixNode(typePrefixNode, context) {
|
|
|
397
455
|
node = typePrefixNode, ///
|
|
398
456
|
string = context.nodeAsString(node),
|
|
399
457
|
term = termFromTypePrefixNode(typePrefixNode, context),
|
|
400
|
-
type = typeFromTypePrefixNode(typePrefixNode, context)
|
|
401
|
-
|
|
458
|
+
type = typeFromTypePrefixNode(typePrefixNode, context);
|
|
459
|
+
|
|
460
|
+
context = null;
|
|
461
|
+
|
|
462
|
+
const typePrefix = new TypePrefix(context, string, node, term, type);
|
|
402
463
|
|
|
403
464
|
return typePrefix;
|
|
404
465
|
}
|
|
@@ -418,8 +479,11 @@ export function suppositionFromSuppositionNode(suppositionNode, context) {
|
|
|
418
479
|
node = suppositionNode, ///
|
|
419
480
|
string = context.nodeAsString(node),
|
|
420
481
|
statement = statementFromSuppositionNode(suppositionNode, context),
|
|
421
|
-
procedureCall = procedureCallFromSuppositionNode(suppositionNode, context)
|
|
422
|
-
|
|
482
|
+
procedureCall = procedureCallFromSuppositionNode(suppositionNode, context);
|
|
483
|
+
|
|
484
|
+
context = null;
|
|
485
|
+
|
|
486
|
+
const supposition = new Supposition(context, string, node, statement, procedureCall);
|
|
423
487
|
|
|
424
488
|
return supposition
|
|
425
489
|
}
|
|
@@ -429,8 +493,11 @@ export function equivalenceFromEquivalenceNode(equivalenceNode, context) {
|
|
|
429
493
|
node = equivalenceNode, ///
|
|
430
494
|
terms = termsFromEquivalenceNode(equivalenceNode, context),
|
|
431
495
|
equivalenceString = equivalenceStringFromTerms(terms),
|
|
432
|
-
string = equivalenceString
|
|
433
|
-
|
|
496
|
+
string = equivalenceString; ///
|
|
497
|
+
|
|
498
|
+
context = null;
|
|
499
|
+
|
|
500
|
+
const equivalence = new Equivalence(context, string, node, terms);
|
|
434
501
|
|
|
435
502
|
return equivalence;
|
|
436
503
|
}
|
|
@@ -443,9 +510,9 @@ export function metatheoremFromMetatheoremNode(metatheoremNode, context) {
|
|
|
443
510
|
deduction = deductionFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
444
511
|
suppositions = suppositionsFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
445
512
|
topLevelMetaAssertionString = topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction(label, suppositions, deduction),
|
|
446
|
-
|
|
447
|
-
node = metaLemmaNode, ///
|
|
513
|
+
node = metatheoremNode, ///
|
|
448
514
|
string = topLevelMetaAssertionString, ///
|
|
515
|
+
substitutions = null,
|
|
449
516
|
metatheorem = new Metatehorem(context, string, node, label, suppositions, deduction, proof, substitutions);
|
|
450
517
|
|
|
451
518
|
return metatheorem;
|
|
@@ -468,11 +535,13 @@ export function subDerivationFromSubDerivationNode(subDerivationNode, context) {
|
|
|
468
535
|
const { SubDerivation } = elements,
|
|
469
536
|
node = subDerivationNode, ///
|
|
470
537
|
string = null,
|
|
471
|
-
stepsOrSubproofs = stepsOrSubproofsFromSubDerivationNode(subDerivationNode, context)
|
|
472
|
-
subDerivation = new SubDerivation(context, string, node, stepsOrSubproofs);
|
|
538
|
+
stepsOrSubproofs = stepsOrSubproofsFromSubDerivationNode(subDerivationNode, context);
|
|
473
539
|
|
|
474
|
-
|
|
540
|
+
context = null;
|
|
541
|
+
|
|
542
|
+
const subDerivation = new SubDerivation(context, string, node, stepsOrSubproofs);
|
|
475
543
|
|
|
544
|
+
return subDerivation;
|
|
476
545
|
}
|
|
477
546
|
|
|
478
547
|
export function typeAssertionFromTypeAssertionNode(typeAssertionNode, context) {
|
|
@@ -480,8 +549,11 @@ export function typeAssertionFromTypeAssertionNode(typeAssertionNode, context) {
|
|
|
480
549
|
node = typeAssertionNode, ///
|
|
481
550
|
string = context.nodeAsString(node),
|
|
482
551
|
term = termFromTypeAssertionNode(typeAssertionNode, context),
|
|
483
|
-
type = typeFromTypeAssertionNode(typeAssertionNode, context)
|
|
484
|
-
|
|
552
|
+
type = typeFromTypeAssertionNode(typeAssertionNode, context);
|
|
553
|
+
|
|
554
|
+
context = null;
|
|
555
|
+
|
|
556
|
+
const typeAssertion = new TypeAssertion(context, string, node, term, type);
|
|
485
557
|
|
|
486
558
|
return typeAssertion;
|
|
487
559
|
}
|
|
@@ -492,13 +564,16 @@ export function procedureCallFromProcedureCallNode(procedureCallNode, context) {
|
|
|
492
564
|
procedureReference = procedureReferenceFromProcedureCallNode(procedureCallNode, context),
|
|
493
565
|
procedureCallString = procedureCallStringFromProcedureReferenceAndParameters(procedureReference, parameters),
|
|
494
566
|
node = procedureCallNode, ///
|
|
495
|
-
string = procedureCallString
|
|
496
|
-
|
|
567
|
+
string = procedureCallString; ///
|
|
568
|
+
|
|
569
|
+
context = null;
|
|
570
|
+
|
|
571
|
+
const procedureCall = new ProcedureCall(context, string, node, parameters, procedureReference);
|
|
497
572
|
|
|
498
573
|
return procedureCall;
|
|
499
574
|
}
|
|
500
575
|
|
|
501
|
-
export function
|
|
576
|
+
export function stepOrSubproofFromStepOrSubproofNode(stepOrSubproofNode, context) {
|
|
502
577
|
const step = stepFromStepOrSubproofNode(stepOrSubproofNode, context),
|
|
503
578
|
subproof = subproofFromStepOrSubproofNode(stepOrSubproofNode, context),
|
|
504
579
|
stepOrSubproof = (step || subproof);
|
|
@@ -512,8 +587,11 @@ export function definedAssertionFromDefinedAssertionNode(definedAssertionNode, c
|
|
|
512
587
|
string = context.nodeAsString(node),
|
|
513
588
|
negated = definedAssertionNode.isNegated(),
|
|
514
589
|
term = termFromDefinedAssertionNode(definedAssertionNode, context),
|
|
515
|
-
frame = frameFromDefinedAssertionNode(definedAssertionNode, context)
|
|
516
|
-
|
|
590
|
+
frame = frameFromDefinedAssertionNode(definedAssertionNode, context);
|
|
591
|
+
|
|
592
|
+
context = null;
|
|
593
|
+
|
|
594
|
+
const definedAssertion = new DefinedAssertion(context, string, node, term, frame, negated);
|
|
517
595
|
|
|
518
596
|
return definedAssertion;
|
|
519
597
|
}
|
|
@@ -523,8 +601,11 @@ export function propertyRelationFromPropertyRelationNode(propertyRelationNode, c
|
|
|
523
601
|
node = propertyRelationNode, ///
|
|
524
602
|
string = context.nodeAsString(node),
|
|
525
603
|
property = propertyFromPropertyRelationNode(propertyRelationNode, context),
|
|
526
|
-
term = termFromPropertyRelationNode(propertyRelationNode, context)
|
|
527
|
-
|
|
604
|
+
term = termFromPropertyRelationNode(propertyRelationNode, context);
|
|
605
|
+
|
|
606
|
+
context = null;
|
|
607
|
+
|
|
608
|
+
const propertyRelation = new PropertyRelation(context, string, node, property, term);
|
|
528
609
|
|
|
529
610
|
return propertyRelation;
|
|
530
611
|
}
|
|
@@ -556,8 +637,11 @@ export function propertyAssertionFromPropertyAssertionNode(propertyAssertionNode
|
|
|
556
637
|
node = propertyAssertionNode, ///
|
|
557
638
|
string = context.nodeAsString(node),
|
|
558
639
|
term = termFromPropertyAssertionNode(propertyAssertionNode, context),
|
|
559
|
-
propertyRelation = propertyRelationFromPropertyAssertionNode(propertyAssertionNode, context)
|
|
560
|
-
|
|
640
|
+
propertyRelation = propertyRelationFromPropertyAssertionNode(propertyAssertionNode, context);
|
|
641
|
+
|
|
642
|
+
context = null;
|
|
643
|
+
|
|
644
|
+
const propertyAssertion = new PropertyAssertion(context, string, node, term, propertyRelation);
|
|
561
645
|
|
|
562
646
|
return propertyAssertion;
|
|
563
647
|
}
|
|
@@ -566,8 +650,11 @@ export function subproofAssertionFromSubproofAssertionNode(subproofAssertionNode
|
|
|
566
650
|
const { SubproofAssertion } = elements,
|
|
567
651
|
node = subproofAssertionNode, ///
|
|
568
652
|
string = context.nodeAsString(node),
|
|
569
|
-
statements = statementsFromSubproofAssertionNode(subproofAssertionNode, context)
|
|
570
|
-
|
|
653
|
+
statements = statementsFromSubproofAssertionNode(subproofAssertionNode, context);
|
|
654
|
+
|
|
655
|
+
context = null;
|
|
656
|
+
|
|
657
|
+
const subproofAssertion = new SubproofAssertion(context, string, node, statements);
|
|
571
658
|
|
|
572
659
|
return subproofAssertion;
|
|
573
660
|
}
|
|
@@ -579,8 +666,11 @@ export function containedAssertionFromContainedAssertionNode(containedAssertionN
|
|
|
579
666
|
negated = containedAssertionNode.isNegated(),
|
|
580
667
|
term = termFromContainedAssertionNode(containedAssertionNode, context),
|
|
581
668
|
frame = frameFromContainedAssertionNode(containedAssertionNode, context),
|
|
582
|
-
statement = statementFromContainedAssertionNode(containedAssertionNode, context)
|
|
583
|
-
|
|
669
|
+
statement = statementFromContainedAssertionNode(containedAssertionNode, context);
|
|
670
|
+
|
|
671
|
+
context = null;
|
|
672
|
+
|
|
673
|
+
const containedAssertion = new ContainedAssertion(context, string, node, term, frame, negated, statement);
|
|
584
674
|
|
|
585
675
|
return containedAssertion;
|
|
586
676
|
}
|
|
@@ -590,8 +680,11 @@ export function satisfiesAssertionFromSatisfiesAssertionNode(satisfiesAssertionN
|
|
|
590
680
|
node = satisfiesAssertionNode, ///
|
|
591
681
|
string = context.nodeAsString(node),
|
|
592
682
|
signature = signatureFromSatisfiesAssertionNode(satisfiesAssertionNode, context),
|
|
593
|
-
reference = referenceFromSatisfiesAssertionNode(satisfiesAssertionNode, context)
|
|
594
|
-
|
|
683
|
+
reference = referenceFromSatisfiesAssertionNode(satisfiesAssertionNode, context);
|
|
684
|
+
|
|
685
|
+
context = null;
|
|
686
|
+
|
|
687
|
+
const satisfiesAssertion = new SatisfiesAssertion(context, string, node, signature, reference);
|
|
595
688
|
|
|
596
689
|
return satisfiesAssertion;
|
|
597
690
|
}
|
|
@@ -600,10 +693,13 @@ export function procedureReferenceFromProcedureReferenceNode(procedureReferenceN
|
|
|
600
693
|
const { ProcedureReference } = elements,
|
|
601
694
|
node = procedureReferenceNode, ///
|
|
602
695
|
string = context.nodeAsString(node),
|
|
603
|
-
name = nameFromProcedureReferenceNode(procedureReferenceNode, context)
|
|
604
|
-
|
|
696
|
+
name = nameFromProcedureReferenceNode(procedureReferenceNode, context);
|
|
697
|
+
|
|
698
|
+
context = null;
|
|
605
699
|
|
|
606
|
-
|
|
700
|
+
const procedureRefereence = new ProcedureReference(context, string, node, name);
|
|
701
|
+
|
|
702
|
+
return procedureRefereence;
|
|
607
703
|
}
|
|
608
704
|
|
|
609
705
|
export function variableDeclarationFromVariableDeclarationNode(variableDeclarationNode, context) {
|
|
@@ -679,8 +775,10 @@ export function constructorDeclarationFromConstructorDeclarationNode(constructor
|
|
|
679
775
|
const { ConstructorDeclaration } = elements,
|
|
680
776
|
node = constructorDeclarationNode, ///
|
|
681
777
|
string = context.nodeAsString(node),
|
|
778
|
+
type = typeFromConstructorDeclarationNode(constructorDeclarationNode, context),
|
|
779
|
+
provisional = provisionalFromConstructorDeclarationNode(constructorDeclarationNode, context),
|
|
682
780
|
constructor = constructorFromConstructorDeclarationNode(constructorDeclarationNode, context),
|
|
683
|
-
constructorDeclaration = new ConstructorDeclaration(context, string, node, constructor);
|
|
781
|
+
constructorDeclaration = new ConstructorDeclaration(context, string, node, type, provisional, constructor);
|
|
684
782
|
|
|
685
783
|
return constructorDeclaration;
|
|
686
784
|
}
|
|
@@ -709,7 +807,7 @@ export function metavariableDeclarationFromMetavariableDeclarationNode(metavaria
|
|
|
709
807
|
|
|
710
808
|
export function nameFromTypeNode(typeNode, context) {
|
|
711
809
|
const typeName = typeNode.getTypeName(),
|
|
712
|
-
|
|
810
|
+
name = typeName; ///
|
|
713
811
|
|
|
714
812
|
return name;
|
|
715
813
|
}
|
|
@@ -1406,6 +1504,13 @@ export function typeFromComplexTypeDeclarationNode(complexTypeDeclarationNode, c
|
|
|
1406
1504
|
return type;
|
|
1407
1505
|
}
|
|
1408
1506
|
|
|
1507
|
+
export function typeFromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
1508
|
+
const typeNode = constructorDeclarationNode.getTypeNode(),
|
|
1509
|
+
type = typeFromTypeNode(typeNode, context);
|
|
1510
|
+
|
|
1511
|
+
return type;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1409
1514
|
export function containedAssertionFromStatementNode(statementNode, context) {0
|
|
1410
1515
|
let containedAssertion = null;
|
|
1411
1516
|
|
|
@@ -1538,6 +1643,12 @@ export function metaTypeFromMetavariableDeclarationNode(metavariableDeclarationN
|
|
|
1538
1643
|
return metaType;
|
|
1539
1644
|
}
|
|
1540
1645
|
|
|
1646
|
+
export function provisionalFromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
1647
|
+
const provisional = constructorDeclarationNode.isProvisional();
|
|
1648
|
+
|
|
1649
|
+
return provisional;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1541
1652
|
export function replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context) {
|
|
1542
1653
|
const replacementFrameNode = frameSubstitutionNode.getReplacementFrameNode(),
|
|
1543
1654
|
replacementFrame = frameFromFrameNode(replacementFrameNode, context);
|
|
@@ -1716,7 +1827,7 @@ export function suppositionsFromSuppositionNodes(suppositionNodes, context) {
|
|
|
1716
1827
|
export function stepsOrSubproofsFromDerivationNode(derivationNode, context) {
|
|
1717
1828
|
const stepOrSubproofNodes = derivationNode.getStepOrSubproofNodes(),
|
|
1718
1829
|
stepsOrSubproofs = stepOrSubproofNodes.map((stepOrSubproofNode) => {
|
|
1719
|
-
const stepOrSubproof =
|
|
1830
|
+
const stepOrSubproof = stepOrSubproofFromStepOrSubproofNode(stepOrSubproofNode, context);
|
|
1720
1831
|
|
|
1721
1832
|
return stepOrSubproof;
|
|
1722
1833
|
});
|
|
@@ -1727,7 +1838,7 @@ export function stepsOrSubproofsFromDerivationNode(derivationNode, context) {
|
|
|
1727
1838
|
export function stepsOrSubproofsFromSubDerivationNode(subDerivationNode, context) {
|
|
1728
1839
|
const stepOrSubproofNodes = subDerivationNode.getStepOrSubproofNodes(),
|
|
1729
1840
|
stepsOrSubproofs = stepOrSubproofNodes.map((stepOrSubproofNode) => {
|
|
1730
|
-
const stepOrSubproof =
|
|
1841
|
+
const stepOrSubproof = stepOrSubproofFromStepOrSubproofNode(stepOrSubproofNode, context);
|
|
1731
1842
|
|
|
1732
1843
|
return stepOrSubproof;
|
|
1733
1844
|
});
|