occam-verify-cli 1.0.696 → 1.0.703
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/action/verify.js +3 -2
- package/lib/context/ephemeral.js +14 -5
- package/lib/context.js +9 -1
- package/lib/element/assertion/contained.js +6 -9
- package/lib/element/assertion/defined.js +6 -8
- package/lib/element/assertion/property.js +11 -5
- package/lib/element/assertion/satisfies.js +9 -3
- package/lib/element/assertion/subproof.js +4 -5
- package/lib/element/assertion/type.js +12 -7
- package/lib/element/assumption.js +22 -4
- package/lib/element/combinator.js +6 -6
- package/lib/element/conclusion.js +5 -5
- package/lib/element/constructor.js +17 -13
- package/lib/element/declaration/constructor.js +2 -2
- package/lib/element/declaration/simpleType.js +18 -4
- package/lib/element/deduction.js +5 -5
- package/lib/element/equality.js +26 -1
- package/lib/element/frame.js +14 -7
- package/lib/element/hypothesis.js +13 -6
- package/lib/element/judgement.js +69 -3
- package/lib/element/label.js +27 -22
- package/lib/element/metaType.js +1 -1
- package/lib/element/metavariable.js +4 -4
- package/lib/element/parameter.js +7 -7
- package/lib/element/procedureCall.js +7 -7
- package/lib/element/procedureReference.js +7 -6
- package/lib/element/proofAssertion/premise.js +6 -7
- package/lib/element/proofAssertion/supposition.js +6 -7
- package/lib/element/property.js +12 -4
- package/lib/element/propertyRelation.js +28 -6
- package/lib/element/reference.js +10 -6
- package/lib/element/rule.js +26 -16
- package/lib/element/signature.js +59 -19
- package/lib/element/statement.js +4 -2
- package/lib/element/substitution/frame.js +16 -7
- package/lib/element/substitution/reference.js +17 -8
- package/lib/element/substitution/statement.js +17 -8
- package/lib/element/substitution/term.js +17 -8
- package/lib/element/term.js +6 -4
- package/lib/element/topLevelAssertion.js +28 -17
- package/lib/element/topLevelMetaAssertion.js +7 -8
- package/lib/element/type.js +16 -7
- package/lib/element/typePrefix.js +13 -6
- package/lib/element/variable.js +8 -11
- package/lib/process/instantiate.js +81 -11
- package/lib/utilities/element.js +101 -7
- package/lib/utilities/json.js +22 -1
- package/package.json +1 -1
- package/src/action/verify.js +3 -1
- package/src/context/ephemeral.js +19 -4
- package/src/context.js +15 -1
- package/src/element/assertion/contained.js +8 -25
- package/src/element/assertion/defined.js +7 -14
- package/src/element/assertion/property.js +16 -5
- package/src/element/assertion/satisfies.js +14 -3
- package/src/element/assertion/subproof.js +3 -5
- package/src/element/assertion/type.js +16 -8
- package/src/element/assumption.js +37 -3
- package/src/element/combinator.js +6 -13
- package/src/element/conclusion.js +5 -7
- package/src/element/constructor.js +25 -16
- package/src/element/declaration/constructor.js +2 -1
- package/src/element/declaration/simpleType.js +30 -6
- package/src/element/deduction.js +7 -9
- package/src/element/equality.js +43 -0
- package/src/element/frame.js +21 -12
- package/src/element/hypothesis.js +19 -7
- package/src/element/judgement.js +45 -0
- package/src/element/label.js +35 -26
- package/src/element/metaType.js +1 -1
- package/src/element/metavariable.js +3 -6
- package/src/element/parameter.js +9 -12
- package/src/element/procedureCall.js +9 -12
- package/src/element/procedureReference.js +8 -8
- package/src/element/proofAssertion/premise.js +8 -14
- package/src/element/proofAssertion/supposition.js +6 -12
- package/src/element/property.js +20 -6
- package/src/element/propertyRelation.js +43 -6
- package/src/element/reference.js +16 -9
- package/src/element/rule.js +41 -24
- package/src/element/signature.js +87 -22
- package/src/element/statement.js +5 -2
- package/src/element/substitution/frame.js +26 -9
- package/src/element/substitution/reference.js +29 -11
- package/src/element/substitution/statement.js +27 -10
- package/src/element/substitution/term.js +27 -10
- package/src/element/term.js +7 -4
- package/src/element/topLevelAssertion.js +44 -25
- package/src/element/topLevelMetaAssertion.js +7 -8
- package/src/element/type.js +32 -15
- package/src/element/typePrefix.js +19 -7
- package/src/element/variable.js +9 -22
- package/src/process/instantiate.js +64 -10
- package/src/utilities/element.js +105 -10
- package/src/utilities/json.js +19 -1
package/src/element/type.js
CHANGED
|
@@ -4,8 +4,11 @@ import { Element } from "occam-languages";
|
|
|
4
4
|
import { arrayUtilities } from "necessary";
|
|
5
5
|
|
|
6
6
|
import { define } from "../elements";
|
|
7
|
+
import { literally } from "../utilities/context";
|
|
8
|
+
import { instantiateType } from "../process/instantiate";
|
|
7
9
|
import { baseTypeFromNothing } from "../utilities/type";
|
|
8
|
-
import {
|
|
10
|
+
import { nameFromTypeNode, prefixNameFromTypeNode } from "../utilities/element";
|
|
11
|
+
import { superTypesFromJSON, provisionalFromJSON, propertiesFromJSON, provisionalToProvisionalJSON, superTypesToSuperTypesJSON, propertiesToPropertiesJSON } from "../utilities/json";
|
|
9
12
|
|
|
10
13
|
const { push, first } = arrayUtilities;
|
|
11
14
|
|
|
@@ -292,23 +295,17 @@ export default define(class Type extends Element {
|
|
|
292
295
|
}
|
|
293
296
|
|
|
294
297
|
toJSON() {
|
|
295
|
-
const
|
|
296
|
-
prefixNameJSON = nameToNameJSON(this.prefixName),
|
|
298
|
+
const superTypesJSON = superTypesToSuperTypesJSON(this.superTypes),
|
|
297
299
|
propertiesJSON = propertiesToPropertiesJSON(this.properties),
|
|
298
|
-
|
|
299
|
-
provisionalJSON = provisionalToProvisionalJSON(this.provisional),
|
|
300
|
-
name = nameJSON, ///
|
|
301
|
-
prefixName = prefixNameJSON, ///
|
|
302
|
-
properties = propertiesJSON, ///
|
|
300
|
+
provisinoalJSOM = provisionalToProvisionalJSON(this.provisional),
|
|
303
301
|
superTypes = superTypesJSON, ///
|
|
304
|
-
|
|
302
|
+
properties = propertiesJSON, ///
|
|
303
|
+
provisional = provisinoalJSOM, ///
|
|
305
304
|
string = this.getString(),
|
|
306
305
|
json = {
|
|
307
306
|
string,
|
|
308
|
-
name,
|
|
309
|
-
prefixName,
|
|
310
|
-
properties,
|
|
311
307
|
superTypes,
|
|
308
|
+
properties,
|
|
312
309
|
provisional
|
|
313
310
|
};
|
|
314
311
|
|
|
@@ -318,7 +315,24 @@ export default define(class Type extends Element {
|
|
|
318
315
|
static name = "Type";
|
|
319
316
|
|
|
320
317
|
static fromJSON(json, context) {
|
|
321
|
-
|
|
318
|
+
const type = literally((context) => {
|
|
319
|
+
const { string } = json,
|
|
320
|
+
typeNode = instantiateType(string, context),
|
|
321
|
+
node = typeNode, ///
|
|
322
|
+
name = nameFromTypeNode(typeNode, context),
|
|
323
|
+
prefixName = prefixNameFromTypeNode(typeNode, context),
|
|
324
|
+
superTypes = superTypesFromJSON(json, context),
|
|
325
|
+
properties = propertiesFromJSON(json, context),
|
|
326
|
+
provisional = provisionalFromJSON(json);
|
|
327
|
+
|
|
328
|
+
context = null; ///
|
|
329
|
+
|
|
330
|
+
const type = new Type(context, string, node, name, prefixName, superTypes, properties, provisional);
|
|
331
|
+
|
|
332
|
+
return type;
|
|
333
|
+
}, context);
|
|
334
|
+
|
|
335
|
+
return type;
|
|
322
336
|
}
|
|
323
337
|
|
|
324
338
|
static fromName(name, context) {
|
|
@@ -327,8 +341,11 @@ export default define(class Type extends Element {
|
|
|
327
341
|
prefixName = null,
|
|
328
342
|
superTypes = [],
|
|
329
343
|
properties = [],
|
|
330
|
-
provisional = false
|
|
331
|
-
|
|
344
|
+
provisional = false;
|
|
345
|
+
|
|
346
|
+
context = null;
|
|
347
|
+
|
|
348
|
+
const type = new Type(context, string, node, name, prefixName, superTypes, properties, provisional);
|
|
332
349
|
|
|
333
350
|
return type;
|
|
334
351
|
}
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
import { Element } from "occam-languages";
|
|
4
4
|
|
|
5
5
|
import { define } from "../elements";
|
|
6
|
-
import {
|
|
6
|
+
import { literally } from "../utilities/context";
|
|
7
|
+
import { instantiateTypePrefix } from "../process/instantiate";
|
|
8
|
+
import { nameFromTypePrefixNode } from "../utilities/element";
|
|
7
9
|
|
|
8
10
|
export default define(class TypePrefix extends Element {
|
|
9
11
|
constructor(context, string, node, name) {
|
|
@@ -30,12 +32,9 @@ export default define(class TypePrefix extends Element {
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
toJSON() {
|
|
33
|
-
const
|
|
34
|
-
name = nameJSON, ///
|
|
35
|
-
string = this.getString(),
|
|
35
|
+
const string = this.getString(),
|
|
36
36
|
json = {
|
|
37
|
-
string
|
|
38
|
-
name
|
|
37
|
+
string
|
|
39
38
|
};
|
|
40
39
|
|
|
41
40
|
return json;
|
|
@@ -44,6 +43,19 @@ export default define(class TypePrefix extends Element {
|
|
|
44
43
|
static name = "TypePrefix";
|
|
45
44
|
|
|
46
45
|
static fromJSON(json, context) {
|
|
47
|
-
|
|
46
|
+
const typePrefix = literally((context) => {
|
|
47
|
+
const { string } = json,
|
|
48
|
+
typePrefixNode = instantiateTypePrefix(string, context),
|
|
49
|
+
node = typePrefixNode, ///
|
|
50
|
+
name = nameFromTypePrefixNode(typePrefixNode, context);
|
|
51
|
+
|
|
52
|
+
context = null; ///
|
|
53
|
+
|
|
54
|
+
const typePrefix = new TypePrefix(context, string, node, name);
|
|
55
|
+
|
|
56
|
+
return typePrefix;
|
|
57
|
+
}, context);
|
|
58
|
+
|
|
59
|
+
return typePrefix;
|
|
48
60
|
}
|
|
49
61
|
});
|
package/src/element/variable.js
CHANGED
|
@@ -7,20 +7,15 @@ import elements from "../elements";
|
|
|
7
7
|
import { define } from "../elements";
|
|
8
8
|
import { literally } from "../utilities/context";
|
|
9
9
|
import { instantiateVariable } from "../process/instantiate";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
identifierFromJSON,
|
|
13
|
-
propertyRelationsFromJSON,
|
|
14
|
-
identifierToIdentifierJSON,
|
|
15
|
-
propertyRelationsToPropertyRelationsJSON } from "../utilities/json";
|
|
10
|
+
import { identifierFromVarialbeNode } from "../utilities/element";
|
|
11
|
+
import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
|
|
16
12
|
|
|
17
13
|
export default define(class Variable extends Element {
|
|
18
|
-
constructor(context, string, node, type, identifier
|
|
14
|
+
constructor(context, string, node, type, identifier) {
|
|
19
15
|
super(context, string, node);
|
|
20
16
|
|
|
21
17
|
this.type = type;
|
|
22
18
|
this.identifier = identifier;
|
|
23
|
-
this.propertyRelations = propertyRelations;
|
|
24
19
|
}
|
|
25
20
|
|
|
26
21
|
getIdentifier() {
|
|
@@ -31,10 +26,6 @@ export default define(class Variable extends Element {
|
|
|
31
26
|
return this.type;
|
|
32
27
|
}
|
|
33
28
|
|
|
34
|
-
getPropertyRelations() {
|
|
35
|
-
return this.propertyRelations;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
29
|
setType(type) {
|
|
39
30
|
this.type = type;
|
|
40
31
|
}
|
|
@@ -196,17 +187,11 @@ export default define(class Variable extends Element {
|
|
|
196
187
|
|
|
197
188
|
toJSON() {
|
|
198
189
|
const typeJSON = typeToTypeJSON(this.type),
|
|
199
|
-
identifierJSON = identifierToIdentifierJSON(this.identifier),
|
|
200
|
-
propertyRelationsJSON = propertyRelationsToPropertyRelationsJSON(this.propertyRelations),
|
|
201
190
|
type = typeJSON, ///
|
|
202
|
-
identifier = identifierJSON, ///
|
|
203
|
-
propertyRelations = propertyRelationsJSON, ///
|
|
204
191
|
string = this.getString(), ///
|
|
205
192
|
json = {
|
|
206
193
|
string,
|
|
207
|
-
type
|
|
208
|
-
identifier,
|
|
209
|
-
propertyRelations
|
|
194
|
+
type
|
|
210
195
|
};
|
|
211
196
|
|
|
212
197
|
return json;
|
|
@@ -220,9 +205,11 @@ export default define(class Variable extends Element {
|
|
|
220
205
|
variableNode = instantiateVariable(string, context),
|
|
221
206
|
node = variableNode, ///
|
|
222
207
|
type = typeFromJSON(json, context),
|
|
223
|
-
identifier =
|
|
224
|
-
|
|
225
|
-
|
|
208
|
+
identifier = identifierFromVarialbeNode(variableNode, context);
|
|
209
|
+
|
|
210
|
+
context = null;
|
|
211
|
+
|
|
212
|
+
const variable = new Variable(context, string, node, type, identifier);
|
|
226
213
|
|
|
227
214
|
return variable;
|
|
228
215
|
}, context);
|
|
@@ -2,66 +2,117 @@
|
|
|
2
2
|
|
|
3
3
|
import { ruleFromRuleName } from "../utilities/bnf";
|
|
4
4
|
import { TERM_RULE_NAME,
|
|
5
|
+
TYPE_RULE_NAME,
|
|
5
6
|
FRAME_RULE_NAME,
|
|
6
7
|
LABEL_RULE_NAME,
|
|
7
8
|
PREMISE_RULE_NAME,
|
|
8
9
|
VARIABLE_RULE_NAME,
|
|
10
|
+
EQUALITY_RULE_NAME,
|
|
11
|
+
PROPERTY_RULE_NAME,
|
|
12
|
+
JUDGEMENT_RULE_NAME,
|
|
13
|
+
DEDUCTION_RULE_NAME,
|
|
9
14
|
PARAMETER_RULE_NAME,
|
|
10
15
|
STATEMENT_RULE_NAME,
|
|
11
16
|
REFERENCE_RULE_NAME,
|
|
12
17
|
COMBINATOR_RULE_NAME,
|
|
13
18
|
CONCLUSION_RULE_NAME,
|
|
19
|
+
HYPOTHESIS_RULE_NAME,
|
|
20
|
+
ASSUMPTION_RULE_NAME,
|
|
21
|
+
TYPE_PREFIX_RULE_NAME,
|
|
22
|
+
SUPPOSITION_RULE_NAME,
|
|
14
23
|
CONSTRUCTOR_RULE_NAME,
|
|
15
24
|
EQUIVALENCE_RULE_NAME,
|
|
16
25
|
METAVARIABLE_RULE_NAME,
|
|
17
26
|
PROCEDURE_CALL_RULE_NAME,
|
|
27
|
+
PROPERTY_RELATION_RULE_NAME,
|
|
18
28
|
DEFINED_ASSERTION_RULE_NAME,
|
|
19
29
|
TERM_SUBSTITUTION_RULE_NAME,
|
|
20
30
|
SUBPROOF_ASSERTION_RULE_NAME,
|
|
21
31
|
FRAME_SUBSTITUTION_RULE_NAME,
|
|
22
32
|
PROCEDURE_REFERENCE_RULE_NAME,
|
|
23
33
|
CONTAINED_ASSERTION_RULE_NAME,
|
|
34
|
+
SATISFIES_ASSERTION_RULE_NAME,
|
|
24
35
|
STATEMENT_SUBSTITUTION_RULE_NAME,
|
|
25
36
|
REFERENCE_SUBSTITUTION_RULE_NAME } from "../ruleNames";
|
|
26
37
|
|
|
27
38
|
const termPlaceholderRule = ruleFromRuleName(TERM_RULE_NAME),
|
|
39
|
+
typePlaceholderRule = ruleFromRuleName(TYPE_RULE_NAME),
|
|
28
40
|
framePlaceholderRule = ruleFromRuleName(FRAME_RULE_NAME),
|
|
29
41
|
labelPlaceholderRule = ruleFromRuleName(LABEL_RULE_NAME),
|
|
30
42
|
premisePlaceholderRule = ruleFromRuleName(PREMISE_RULE_NAME),
|
|
31
43
|
variablePlaceholderRule = ruleFromRuleName(VARIABLE_RULE_NAME),
|
|
44
|
+
equalityPlaceholderRule = ruleFromRuleName(EQUALITY_RULE_NAME),
|
|
45
|
+
propertyPlaceholderRule = ruleFromRuleName(PROPERTY_RULE_NAME),
|
|
46
|
+
judgementlaceholderRule = ruleFromRuleName(JUDGEMENT_RULE_NAME),
|
|
47
|
+
deductionPlaceholderRule = ruleFromRuleName(DEDUCTION_RULE_NAME),
|
|
32
48
|
parameterPlaceholderRule = ruleFromRuleName(PARAMETER_RULE_NAME),
|
|
33
49
|
statementPlaceholderRule = ruleFromRuleName(STATEMENT_RULE_NAME),
|
|
34
50
|
referencePlaceholderRule = ruleFromRuleName(REFERENCE_RULE_NAME),
|
|
35
51
|
combinatorPlaceholderRule = ruleFromRuleName(COMBINATOR_RULE_NAME),
|
|
36
52
|
conclusionPlaceholderRule = ruleFromRuleName(CONCLUSION_RULE_NAME),
|
|
53
|
+
hypothesisPlaceholderRule = ruleFromRuleName(HYPOTHESIS_RULE_NAME),
|
|
54
|
+
assumptionPlaceholderRule = ruleFromRuleName(ASSUMPTION_RULE_NAME),
|
|
55
|
+
typePrefixPlaceholderRule = ruleFromRuleName(TYPE_PREFIX_RULE_NAME),
|
|
56
|
+
suppositionPlaceholderRule = ruleFromRuleName(SUPPOSITION_RULE_NAME),
|
|
37
57
|
constructorPlaceholderRule = ruleFromRuleName(CONSTRUCTOR_RULE_NAME),
|
|
38
58
|
equivalencePlaceholderRule = ruleFromRuleName(EQUIVALENCE_RULE_NAME),
|
|
39
59
|
metavariablePlaceholderRule = ruleFromRuleName(METAVARIABLE_RULE_NAME),
|
|
40
60
|
procedureCalllaceholderRule = ruleFromRuleName(PROCEDURE_CALL_RULE_NAME),
|
|
61
|
+
propertyRelationlaceholderRule = ruleFromRuleName(PROPERTY_RELATION_RULE_NAME),
|
|
41
62
|
definedAssertionPlaceholderRule = ruleFromRuleName(DEFINED_ASSERTION_RULE_NAME),
|
|
42
63
|
termSubstitutionPlaceholderRule = ruleFromRuleName(TERM_SUBSTITUTION_RULE_NAME),
|
|
43
64
|
subproofAssertionlaceholderRule = ruleFromRuleName(SUBPROOF_ASSERTION_RULE_NAME),
|
|
44
65
|
frameSubstitutionPlaceholderRule = ruleFromRuleName(FRAME_SUBSTITUTION_RULE_NAME),
|
|
45
66
|
procedureReferencelaceholderRule = ruleFromRuleName(PROCEDURE_REFERENCE_RULE_NAME),
|
|
46
67
|
containedAssertionPlaceholderRule = ruleFromRuleName(CONTAINED_ASSERTION_RULE_NAME),
|
|
68
|
+
satisfiesAssertionPlaceholderRule = ruleFromRuleName(SATISFIES_ASSERTION_RULE_NAME),
|
|
47
69
|
statementSubstitutionPlaceholderRule = ruleFromRuleName(STATEMENT_SUBSTITUTION_RULE_NAME),
|
|
48
70
|
referenceSubstitutionPlaceholderRule = ruleFromRuleName(REFERENCE_SUBSTITUTION_RULE_NAME);
|
|
49
71
|
|
|
50
|
-
export function
|
|
72
|
+
export function instantiatePremise(string, context) {
|
|
73
|
+
string = `${string}
|
|
74
|
+
`; ///
|
|
51
75
|
|
|
52
|
-
|
|
76
|
+
return instantiate(premisePlaceholderRule, string, context);
|
|
77
|
+
}
|
|
53
78
|
|
|
54
|
-
export function
|
|
79
|
+
export function instantiateDeduction(string, context) {
|
|
80
|
+
string = `${string}
|
|
81
|
+
`; ///
|
|
55
82
|
|
|
56
|
-
|
|
83
|
+
return instantiate(deductionPlaceholderRule, string, context);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function instantiateConclusion(string, context) {
|
|
57
87
|
string = `${string}
|
|
58
88
|
`; ///
|
|
59
89
|
|
|
60
|
-
return instantiate(
|
|
90
|
+
return instantiate(conclusionPlaceholderRule, string, context);
|
|
61
91
|
}
|
|
62
92
|
|
|
93
|
+
export function instantiateSupposition(string, context) {
|
|
94
|
+
string = `${string}
|
|
95
|
+
`; ///
|
|
96
|
+
|
|
97
|
+
return instantiate(suppositionPlaceholderRule, string, context);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function instantiateTerm(string, context) { return instantiate(termPlaceholderRule, string, context); }
|
|
101
|
+
|
|
102
|
+
export function instantiateType(string, context) { return instantiate(typePlaceholderRule, string, context); }
|
|
103
|
+
|
|
104
|
+
export function instantiateFrame(string, context) { return instantiate(framePlaceholderRule, string, context); }
|
|
105
|
+
|
|
106
|
+
export function instantiateLabel(string, context) { return instantiate(labelPlaceholderRule, string, context); }
|
|
107
|
+
|
|
63
108
|
export function instantiateVariable(string, context) { return instantiate(variablePlaceholderRule, string, context); }
|
|
64
109
|
|
|
110
|
+
export function instantiateEquality(string, context) { return instantiate(equalityPlaceholderRule, string, context); }
|
|
111
|
+
|
|
112
|
+
export function instantiateProperty(string, context) { return instantiate(propertyPlaceholderRule, string, context); }
|
|
113
|
+
|
|
114
|
+
export function instantiateJudgement(string, context) { return instantiate(judgementlaceholderRule, string, context); }
|
|
115
|
+
|
|
65
116
|
export function instantiateParameter(string, context) { return instantiate(parameterPlaceholderRule, string, context); }
|
|
66
117
|
|
|
67
118
|
export function instantiateStatement(string, context) { return instantiate(statementPlaceholderRule, string, context); }
|
|
@@ -70,12 +121,11 @@ export function instantiateReference(string, context) { return instantiate(refer
|
|
|
70
121
|
|
|
71
122
|
export function instantiateCombinator(string, context) { return instantiate(combinatorPlaceholderRule, string, context); }
|
|
72
123
|
|
|
73
|
-
export function
|
|
74
|
-
string = `${string}
|
|
75
|
-
`; ///
|
|
124
|
+
export function instantiateHypothesis(string, context) { return instantiate(hypothesisPlaceholderRule, string, context); }
|
|
76
125
|
|
|
77
|
-
|
|
78
|
-
|
|
126
|
+
export function instantiateAssumption(string, context) { return instantiate(assumptionPlaceholderRule, string, context); }
|
|
127
|
+
|
|
128
|
+
export function instantiateTypePrefix(string, context) { return instantiate(typePrefixPlaceholderRule, string, context); }
|
|
79
129
|
|
|
80
130
|
export function instantiateConstructor(string, context) { return instantiate(constructorPlaceholderRule, string, context); }
|
|
81
131
|
|
|
@@ -85,6 +135,8 @@ export function instantiateMetavariable(string, context) { return instantiate(me
|
|
|
85
135
|
|
|
86
136
|
export function instantiateProcedureCall(string, context) { return instantiate(procedureCalllaceholderRule, string, context); }
|
|
87
137
|
|
|
138
|
+
export function instantiatePropertyRelation(string, context) { return instantiate(propertyRelationlaceholderRule, string, context); }
|
|
139
|
+
|
|
88
140
|
export function instantiateDefinedAssertion(string, context) { return instantiate(definedAssertionPlaceholderRule, string, context); }
|
|
89
141
|
|
|
90
142
|
export function instantiateTermSubstitution(string, context) { return instantiate(termSubstitutionPlaceholderRule, string, context); }
|
|
@@ -97,6 +149,8 @@ export function instantiateProcedureReference(string, context) { return instanti
|
|
|
97
149
|
|
|
98
150
|
export function instantiateContainedAssertion(string, context) { return instantiate(containedAssertionPlaceholderRule, string, context); }
|
|
99
151
|
|
|
152
|
+
export function instantiateSatisfiesAssertion(string, context) { return instantiate(satisfiesAssertionPlaceholderRule, string, context); }
|
|
153
|
+
|
|
100
154
|
export function instantiateStatementSubstitution(string, context) { return instantiate(statementSubstitutionPlaceholderRule, string, context); }
|
|
101
155
|
|
|
102
156
|
export function instantiateReferenceSubstitution(string, context) { return instantiate(referenceSubstitutionPlaceholderRule, string, context); }
|
package/src/utilities/element.js
CHANGED
|
@@ -370,6 +370,19 @@ export function parameterFromParameterNode(parameterNode, context) {
|
|
|
370
370
|
return parameter;
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
+
export function signatureFromJSignatureNode(signatureNode, context) {
|
|
374
|
+
const { Signature } = elements,
|
|
375
|
+
node = signatureNode,
|
|
376
|
+
string = context.nodeAsString(node),
|
|
377
|
+
terms = termsFromSignatureNode(signatureNode, context);
|
|
378
|
+
|
|
379
|
+
context = null;
|
|
380
|
+
|
|
381
|
+
const signature = new Signature(context, string, node, terms);
|
|
382
|
+
|
|
383
|
+
return signature;
|
|
384
|
+
}
|
|
385
|
+
|
|
373
386
|
export function hypothesisFromHypothesisNode(hypotheseNode, context) {
|
|
374
387
|
const { Hypothsis } = elements,
|
|
375
388
|
node = hypotheseNode, ///
|
|
@@ -600,12 +613,12 @@ export function propertyRelationFromPropertyRelationNode(propertyRelationNode, c
|
|
|
600
613
|
const { PropertyRelation } = elements,
|
|
601
614
|
node = propertyRelationNode, ///
|
|
602
615
|
string = context.nodeAsString(node),
|
|
603
|
-
|
|
604
|
-
|
|
616
|
+
term = termFromPropertyRelationNode(propertyRelationNode, context),
|
|
617
|
+
property = propertyFromPropertyRelationNode(propertyRelationNode, context);
|
|
605
618
|
|
|
606
619
|
context = null;
|
|
607
620
|
|
|
608
|
-
const propertyRelation = new PropertyRelation(context, string, node,
|
|
621
|
+
const propertyRelation = new PropertyRelation(context, string, node, term, property);
|
|
609
622
|
|
|
610
623
|
return propertyRelation;
|
|
611
624
|
}
|
|
@@ -870,6 +883,12 @@ export function lemmaFromSectionNode(sectionNode, context) {
|
|
|
870
883
|
return lemma;
|
|
871
884
|
}
|
|
872
885
|
|
|
886
|
+
export function nameFromPropertyNode(propertyNode, context) {
|
|
887
|
+
const name = propertyNode.getName();
|
|
888
|
+
|
|
889
|
+
return name;
|
|
890
|
+
}
|
|
891
|
+
|
|
873
892
|
export function statementFromStepNode(stepNode, context) {
|
|
874
893
|
let statement = null;
|
|
875
894
|
|
|
@@ -894,6 +913,19 @@ export function referenceFromStepNode(stepNode, context) {
|
|
|
894
913
|
return reference;
|
|
895
914
|
}
|
|
896
915
|
|
|
916
|
+
export function nameFromParaneterNode(parameterNode, context) {
|
|
917
|
+
const name = parameterNode.getName();
|
|
918
|
+
|
|
919
|
+
return name;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
export function nameFromTypePrefixNode(typePrefixNode, context) {
|
|
923
|
+
const typePrefixName = typePrefixNode.getTypePrefixName(),
|
|
924
|
+
name = typePrefixName; ///
|
|
925
|
+
|
|
926
|
+
return name;
|
|
927
|
+
}
|
|
928
|
+
|
|
897
929
|
export function superTypesFromTypeNode(typeNode, context) {
|
|
898
930
|
const superTypes = null;
|
|
899
931
|
|
|
@@ -908,7 +940,7 @@ export function propertiesFromTypeNode(typeNode, context) {
|
|
|
908
940
|
|
|
909
941
|
export function prefixNameFromTypeNode(typeNode, context) {
|
|
910
942
|
const typePrefixName = typeNode.getTypePrefixName(),
|
|
911
|
-
|
|
943
|
+
prefixName = typePrefixName; ///
|
|
912
944
|
|
|
913
945
|
return prefixName;
|
|
914
946
|
}
|
|
@@ -946,6 +978,12 @@ export function termsFromSignatureNode(signatureNode, context) {
|
|
|
946
978
|
return terms;
|
|
947
979
|
}
|
|
948
980
|
|
|
981
|
+
export function provisionalFromTypeNode(typeNode, context) {
|
|
982
|
+
const provisional = null;
|
|
983
|
+
|
|
984
|
+
return provisional;
|
|
985
|
+
}
|
|
986
|
+
|
|
949
987
|
export function derivationFromProofNode(proofNode, context) {
|
|
950
988
|
const derivationNode = proofNode.getDerivationNode(),
|
|
951
989
|
derivation = derivationFromDerivationNode(derivationNode, context);
|
|
@@ -953,12 +991,6 @@ export function derivationFromProofNode(proofNode, context) {
|
|
|
953
991
|
return derivation;
|
|
954
992
|
}
|
|
955
993
|
|
|
956
|
-
export function provisionalFromTypeNode(typeNode, context) {
|
|
957
|
-
const provisional = null;
|
|
958
|
-
|
|
959
|
-
return provisional;
|
|
960
|
-
}
|
|
961
|
-
|
|
962
994
|
export function termFromConstructorNode(ocnstructorNode, context) {
|
|
963
995
|
const termNode = ocnstructorNode.getTermNode(),
|
|
964
996
|
term = termFromTermNode(termNode, context);
|
|
@@ -999,6 +1031,13 @@ export function termsFromEquivalenceNode(equivalenceNode, context) {
|
|
|
999
1031
|
return terms;
|
|
1000
1032
|
}
|
|
1001
1033
|
|
|
1034
|
+
export function nameFromMetavariableNode(metavariableNode, context) {
|
|
1035
|
+
const metavaraibleName = metavariableNode.getMetavariableName(),
|
|
1036
|
+
name = metavaraibleName; ///
|
|
1037
|
+
|
|
1038
|
+
return name;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1002
1041
|
export function metavariableFromFrameNode(frameNode, context) {
|
|
1003
1042
|
let metavariable = null;
|
|
1004
1043
|
|
|
@@ -1121,6 +1160,12 @@ export function assumptionFromJudgementNode(judgementNode, context) {
|
|
|
1121
1160
|
return assumption;
|
|
1122
1161
|
}
|
|
1123
1162
|
|
|
1163
|
+
export function identifierFromParameterNode(parameterNode, context) {
|
|
1164
|
+
const identifier = parameterNode.getIdentifier();
|
|
1165
|
+
|
|
1166
|
+
return identifier;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1124
1169
|
export function referenceFromAssumptionNode(assumptionNode, context) {
|
|
1125
1170
|
const metavariableNode = assumptionNode.getMetavariableNode(),
|
|
1126
1171
|
reference = referenceFromMetavariableNode(metavariableNode, context);
|
|
@@ -1260,6 +1305,18 @@ export function referenceFromMetavariableNode(metavariableNode, context) {
|
|
|
1260
1305
|
}, context);
|
|
1261
1306
|
}
|
|
1262
1307
|
|
|
1308
|
+
export function termFromJDefinedAssertionNode(definedAssertionNode, context) {
|
|
1309
|
+
let term = null;
|
|
1310
|
+
|
|
1311
|
+
const termNode = definedAssertionNode.getTermNode();
|
|
1312
|
+
|
|
1313
|
+
if (termNode !== null) {
|
|
1314
|
+
term = termFromTermNode(termNode, context);
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
return term
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1263
1320
|
export function frameFromDefinedAssertionNode(definedAssertionNode, context) {
|
|
1264
1321
|
let frame = null;
|
|
1265
1322
|
|
|
@@ -1303,6 +1360,18 @@ export function typeAssertionFromStatementNode(statementNode, context) {
|
|
|
1303
1360
|
return typeAssertion;
|
|
1304
1361
|
}
|
|
1305
1362
|
|
|
1363
|
+
export function frameFromJDefinedAssertionNode(definedAssertionNode, context) {
|
|
1364
|
+
let frame = null;
|
|
1365
|
+
|
|
1366
|
+
const frameNode = definedAssertionNode.getFrameNode();
|
|
1367
|
+
|
|
1368
|
+
if (frameNode !== null) {
|
|
1369
|
+
frame = frameFromFrameNode(frameNode, context);
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
return frame
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1306
1375
|
export function proofFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1307
1376
|
let proof = null;
|
|
1308
1377
|
|
|
@@ -1385,6 +1454,12 @@ export function procedureCallFromSuppositionNode(suppositionNode, context) {
|
|
|
1385
1454
|
return procedureCall;
|
|
1386
1455
|
}
|
|
1387
1456
|
|
|
1457
|
+
export function negatedFromJDefinedAssertionNode(definedAssertionNode, context) {
|
|
1458
|
+
const negated = definedAssertionNode.isNegated();
|
|
1459
|
+
|
|
1460
|
+
return negated
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1388
1463
|
export function propertyFromPropertyRelationNode(propertyRelationNode, context) {
|
|
1389
1464
|
const propertyNode = propertyRelationNode.getTermNode(),
|
|
1390
1465
|
property = propertyFromPropertyNode(propertyNode, context);
|
|
@@ -1416,6 +1491,12 @@ export function termSubstitutionFromStatementNode(statementNode, context) {
|
|
|
1416
1491
|
return termSubstitution;
|
|
1417
1492
|
}
|
|
1418
1493
|
|
|
1494
|
+
export function negatedFromContainedAssertionNode(containedAssertionNode, context) {
|
|
1495
|
+
const negated = containedAssertionNode.isNegated();
|
|
1496
|
+
|
|
1497
|
+
return negated;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1419
1500
|
export function typeFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
|
|
1420
1501
|
const typeNode = simpleTypeDeclarationNode.getTypeNode(),
|
|
1421
1502
|
type = typeFromTypeNode(typeNode, context);
|
|
@@ -1571,6 +1652,20 @@ export function hypothesesFromTopLevelAssertionNode(topLevelAsssertionNode, cont
|
|
|
1571
1652
|
return ypotheses;
|
|
1572
1653
|
}
|
|
1573
1654
|
|
|
1655
|
+
export function signatureFromJSatisfiesAssertionNode(sasisfiesAssertionNode, context) {
|
|
1656
|
+
const signatureNode = sasisfiesAssertionNode.getSignatureNode(),
|
|
1657
|
+
signature = signatureFromJSignatureNode(signatureNode, context);
|
|
1658
|
+
|
|
1659
|
+
return signature;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
export function referenceFromJSatisfiesAssertionNode(sasisfiesAssertionNode, context) {
|
|
1663
|
+
const referenceNode = sasisfiesAssertionNode.getReferenceNode(),
|
|
1664
|
+
reference = referenceFromReferenceNode(referenceNode, context);
|
|
1665
|
+
|
|
1666
|
+
return reference;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1574
1669
|
export function targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, context) {
|
|
1575
1670
|
const targetFrameNode = frameSubstitutionNode.getTargetFrameNode(),
|
|
1576
1671
|
targetFrame = frameFromFrameNode(targetFrameNode, context);
|
package/src/utilities/json.js
CHANGED
|
@@ -170,6 +170,12 @@ export function conclusionFromJSON(json, context) {
|
|
|
170
170
|
return conclusion;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
export function provisionalFromJSON(json, context) {
|
|
174
|
+
const { provisional } = json;
|
|
175
|
+
|
|
176
|
+
return provisional;
|
|
177
|
+
}
|
|
178
|
+
|
|
173
179
|
export function metavariableFromJSON(json, context) {
|
|
174
180
|
let { metavariable } = json;
|
|
175
181
|
|
|
@@ -198,6 +204,12 @@ export function procedureCallFromJSON(json, context) {
|
|
|
198
204
|
return procedureCall;
|
|
199
205
|
}
|
|
200
206
|
|
|
207
|
+
export function nominalTypeNameFromJSON(json, context) {
|
|
208
|
+
const { nominalTypeName } = json;
|
|
209
|
+
|
|
210
|
+
return nominalTypeName;
|
|
211
|
+
}
|
|
212
|
+
|
|
201
213
|
export function procedureReferenceFromJSON(json, context) {
|
|
202
214
|
let { procedureReference } = json;
|
|
203
215
|
|
|
@@ -277,7 +289,7 @@ export function framesFromJSON(json, context) {
|
|
|
277
289
|
|
|
278
290
|
frames = framesJSON.map((frameJSON) => {
|
|
279
291
|
const json = frameJSON, ///
|
|
280
|
-
|
|
292
|
+
frame = Frame.fromJSON(json, context);
|
|
281
293
|
|
|
282
294
|
return frame;
|
|
283
295
|
});
|
|
@@ -798,6 +810,12 @@ export function procedureCallToProcedureCallJSON(procedureCall) {
|
|
|
798
810
|
return procedureCallJSON;
|
|
799
811
|
}
|
|
800
812
|
|
|
813
|
+
export function nominalTypeNameToNominalTypeNameJSON(nominalTypeName) {
|
|
814
|
+
const nominalTypeNameJSON = nominalTypeName; ///
|
|
815
|
+
|
|
816
|
+
return nominalTypeNameJSON;
|
|
817
|
+
}
|
|
818
|
+
|
|
801
819
|
export function procedureReferenceToProcedureReferenceJSON(procedureReference) {
|
|
802
820
|
const procedureReferenceJSON = procedureReference.toJSON();
|
|
803
821
|
|