occam-verify-cli 1.0.906 → 1.0.911
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 +5 -1
- package/lib/element/assertion/contained.js +6 -3
- package/lib/element/assertion/defined.js +6 -3
- package/lib/element/assertion/property.js +6 -3
- package/lib/element/assertion/signature.js +165 -0
- package/lib/element/assertion/subproof.js +5 -3
- package/lib/element/assertion/type.js +6 -3
- package/lib/element/assumption/metaLevel.js +5 -3
- package/lib/element/assumption.js +6 -3
- package/lib/element/equality.js +6 -3
- package/lib/element/frame.js +8 -5
- package/lib/element/judgement.js +6 -3
- package/lib/element/metavariable.js +8 -5
- package/lib/element/proofAssertion/step.js +29 -29
- package/lib/element/property.js +12 -5
- package/lib/element/propertyRelation.js +6 -3
- package/lib/element/reference.js +8 -4
- package/lib/element/signature.js +73 -60
- package/lib/element/statement.js +7 -3
- package/lib/element/subproof.js +11 -11
- package/lib/element/substitution/frame.js +7 -4
- package/lib/element/substitution/reference.js +7 -4
- package/lib/element/substitution/statement.js +7 -4
- package/lib/element/substitution/term.js +6 -4
- package/lib/element/term.js +26 -7
- package/lib/element/topLevelAssertion/axiom.js +14 -16
- package/lib/element/variable.js +2 -2
- package/lib/node/assertion/{satisfies.js → signature.js} +4 -4
- package/lib/node/qualification.js +2 -2
- package/lib/node/statement.js +2 -2
- package/lib/nonTerminalNodeMap.js +3 -3
- package/lib/preamble.js +2 -2
- package/lib/process/instantiate.js +6 -6
- package/lib/process/unify.js +56 -24
- package/lib/ruleNames.js +5 -5
- package/lib/utilities/element.js +43 -54
- package/lib/utilities/json.js +3 -3
- package/lib/utilities/unification.js +30 -30
- package/lib/utilities/validation.js +15 -15
- package/package.json +4 -4
- package/src/context.js +7 -0
- package/src/element/assertion/contained.js +8 -4
- package/src/element/assertion/defined.js +8 -4
- package/src/element/assertion/property.js +8 -4
- package/src/element/assertion/{satisfies.js → signature.js} +68 -43
- package/src/element/assertion/subproof.js +6 -4
- package/src/element/assertion/type.js +8 -4
- package/src/element/assumption/metaLevel.js +6 -4
- package/src/element/assumption.js +8 -4
- package/src/element/equality.js +8 -4
- package/src/element/frame.js +10 -7
- package/src/element/judgement.js +8 -4
- package/src/element/metavariable.js +10 -7
- package/src/element/proofAssertion/step.js +28 -28
- package/src/element/property.js +14 -6
- package/src/element/propertyRelation.js +8 -4
- package/src/element/reference.js +11 -5
- package/src/element/signature.js +118 -37
- package/src/element/statement.js +9 -3
- package/src/element/subproof.js +10 -10
- package/src/element/substitution/frame.js +9 -5
- package/src/element/substitution/reference.js +9 -5
- package/src/element/substitution/statement.js +9 -5
- package/src/element/substitution/term.js +7 -5
- package/src/element/term.js +39 -9
- package/src/element/topLevelAssertion/axiom.js +23 -26
- package/src/element/variable.js +2 -2
- package/src/node/assertion/{satisfies.js → signature.js} +2 -2
- package/src/node/qualification.js +2 -2
- package/src/node/statement.js +2 -2
- package/src/nonTerminalNodeMap.js +3 -3
- package/src/preamble.js +1 -1
- package/src/process/instantiate.js +3 -3
- package/src/process/unify.js +84 -35
- package/src/ruleNames.js +1 -1
- package/src/utilities/element.js +30 -47
- package/src/utilities/json.js +2 -2
- package/src/utilities/unification.js +29 -29
- package/src/utilities/validation.js +14 -14
- package/lib/element/assertion/satisfies.js +0 -148
|
@@ -4,10 +4,10 @@ import Assertion from "../assertion";
|
|
|
4
4
|
|
|
5
5
|
import { define } from "../../elements";
|
|
6
6
|
import { instantiate } from "../../utilities/context";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { instantiateSignatureAssertion } from "../../process/instantiate";
|
|
8
|
+
import { signatureFromJSignatureAssertionNode, referenceFromJSignatureAssertionNode, signatureAssertionFromStatementNode } from "../../utilities/element";
|
|
9
9
|
|
|
10
|
-
export default define(class
|
|
10
|
+
export default define(class SignatureAssertion extends Assertion {
|
|
11
11
|
constructor(context, string, node, lineIndex, signature, reference) {
|
|
12
12
|
super(context, string, node, lineIndex);
|
|
13
13
|
|
|
@@ -23,11 +23,11 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
23
23
|
return this.reference;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
getSignatureAssertionNode() {
|
|
27
27
|
const node = this.getNode(),
|
|
28
|
-
|
|
28
|
+
signatureAssertionNode = node; ///
|
|
29
29
|
|
|
30
|
-
return
|
|
30
|
+
return signatureAssertionNode;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
compareSubstitutions(substitutions, context) { return this.signature.compareSubstitutions(substitutions, context); }
|
|
@@ -35,21 +35,23 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
35
35
|
correlateSubstitutions(substitutions, context) { return this.signature.correlateSubstitutions(substitutions, context); }
|
|
36
36
|
|
|
37
37
|
validate(context) {
|
|
38
|
-
let
|
|
38
|
+
let signatureAssertion = null;
|
|
39
39
|
|
|
40
|
-
const
|
|
40
|
+
const signatureAssertionString = this.getString(); ///
|
|
41
41
|
|
|
42
|
-
context.trace(`Validating the '${
|
|
42
|
+
context.trace(`Validating the '${signatureAssertionString}' signature assertion...`);
|
|
43
|
+
|
|
44
|
+
let validates = true;
|
|
43
45
|
|
|
44
46
|
const validAssertion = this.findValidAssertion(context);
|
|
45
47
|
|
|
46
48
|
if (validAssertion) {
|
|
47
|
-
|
|
49
|
+
validates = true;
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
} else {
|
|
51
|
-
let validates = true;
|
|
51
|
+
signatureAssertion = validAssertion; ///
|
|
52
52
|
|
|
53
|
+
context.debug(`...the '${signatureAssertionString}' signature assertion is already valid.`);
|
|
54
|
+
} else {
|
|
53
55
|
const signatureVerifies = this.validateSignature(context);
|
|
54
56
|
|
|
55
57
|
if (signatureVerifies) {
|
|
@@ -65,32 +67,36 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
65
67
|
if (validates) {
|
|
66
68
|
const assertion = this; ///
|
|
67
69
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
context.addAssertion(satisfiesAssertion);
|
|
70
|
+
signatureAssertion = assertion; ///
|
|
71
71
|
|
|
72
|
-
context.
|
|
72
|
+
context.addAssertion(signatureAssertion);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
if (validates) {
|
|
77
|
+
context.debug(`...validated the '${signatureAssertionString}' signature assertion.`);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return signatureAssertion;
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
validateSignature(context) {
|
|
80
84
|
let signatureValidates = false;
|
|
81
85
|
|
|
82
|
-
const
|
|
86
|
+
const signatureAssertionString = this.getString(); ///
|
|
83
87
|
|
|
84
|
-
context.trace(`Validating the '${
|
|
88
|
+
context.trace(`Validating the '${signatureAssertionString}' signature assertion's signature...`);
|
|
85
89
|
|
|
86
90
|
const signature = this.signature.validate(context);
|
|
87
91
|
|
|
88
92
|
if (signature !== null) {
|
|
93
|
+
this.signature = signature;
|
|
94
|
+
|
|
89
95
|
signatureValidates = true;
|
|
90
96
|
}
|
|
91
97
|
|
|
92
98
|
if (signatureValidates) {
|
|
93
|
-
context.debug(`...validated the '${
|
|
99
|
+
context.debug(`...validated the '${signatureAssertionString}' signature assertion's signature.`);
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
return signatureValidates;
|
|
@@ -99,22 +105,41 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
99
105
|
validateReference(context) {
|
|
100
106
|
let referenceVerifies = false;
|
|
101
107
|
|
|
102
|
-
const
|
|
108
|
+
const signatureAssertionString = this.getString(); ///
|
|
109
|
+
|
|
110
|
+
context.trace(`Validating the '${signatureAssertionString}' signature assertion's reference...`);
|
|
103
111
|
|
|
104
|
-
|
|
112
|
+
const reference = this.reference.validate(context);
|
|
105
113
|
|
|
106
|
-
|
|
114
|
+
if (reference !== null) {
|
|
115
|
+
const axiom = context.findAxiomByReference(reference);
|
|
116
|
+
|
|
117
|
+
if (axiom !== null) {
|
|
118
|
+
const satisfiable = axiom.isSatisfiable();
|
|
119
|
+
|
|
120
|
+
if (satisfiable) {
|
|
121
|
+
const signatureUnifies = axiom.unifySignature(this.signature, context);
|
|
122
|
+
|
|
123
|
+
if (signatureUnifies) {
|
|
124
|
+
this.reference = reference;
|
|
125
|
+
|
|
126
|
+
referenceVerifies = true;
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
const axiomString = axiom.getString();
|
|
130
|
+
|
|
131
|
+
context.debug(`The '${axiomString}' axiom is not satisfiable.`);
|
|
132
|
+
}
|
|
107
133
|
|
|
108
|
-
|
|
109
|
-
|
|
134
|
+
} else {
|
|
135
|
+
const referencdString = reference.getString();
|
|
110
136
|
|
|
111
|
-
|
|
112
|
-
referenceVerifies = true;
|
|
137
|
+
context.debug(`There is no axiom for the '${referencdString}' reference.`);
|
|
113
138
|
}
|
|
114
139
|
}
|
|
115
140
|
|
|
116
141
|
if (referenceVerifies) {
|
|
117
|
-
context.debug(`...validated the '${
|
|
142
|
+
context.debug(`...validated the '${signatureAssertionString}' signature assertion's reference.`);
|
|
118
143
|
}
|
|
119
144
|
|
|
120
145
|
return referenceVerifies;
|
|
@@ -124,9 +149,9 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
124
149
|
let stepAndSubproofOrProofAssertionsUnify = false;
|
|
125
150
|
|
|
126
151
|
const steptString = step.getString(),
|
|
127
|
-
|
|
152
|
+
signatureAssertionString = this.getString(); ///
|
|
128
153
|
|
|
129
|
-
context.trace(`Unifying the '${steptString}' step with the '${
|
|
154
|
+
context.trace(`Unifying the '${steptString}' step with the '${signatureAssertionString}' signature assertion...`);
|
|
130
155
|
|
|
131
156
|
this.signature.validate(context);
|
|
132
157
|
|
|
@@ -158,47 +183,47 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
158
183
|
}
|
|
159
184
|
|
|
160
185
|
if (stepAndSubproofOrProofAssertionsUnify) {
|
|
161
|
-
context.debug(`...unified the '${steptString}' step with the '${
|
|
186
|
+
context.debug(`...unified the '${steptString}' step with the '${signatureAssertionString}' signature assertion.`);
|
|
162
187
|
}
|
|
163
188
|
|
|
164
189
|
return stepAndSubproofOrProofAssertionsUnify;
|
|
165
190
|
}
|
|
166
191
|
|
|
167
|
-
static name = "
|
|
192
|
+
static name = "SignatureAssertion";
|
|
168
193
|
|
|
169
194
|
static fromJSON(json, context) {
|
|
170
|
-
let
|
|
195
|
+
let signatureAssertion = null;
|
|
171
196
|
|
|
172
197
|
const { name } = json;
|
|
173
198
|
|
|
174
199
|
if (this.name === name) {
|
|
175
200
|
instantiate((context) => {
|
|
176
201
|
const { string, lineIndex } = json,
|
|
177
|
-
definedAssertionNode =
|
|
202
|
+
definedAssertionNode = instantiateSignatureAssertion(string, context),
|
|
178
203
|
node = definedAssertionNode, ///
|
|
179
|
-
signature =
|
|
180
|
-
reference =
|
|
204
|
+
signature = signatureFromJSignatureAssertionNode(definedAssertionNode, context),
|
|
205
|
+
reference = referenceFromJSignatureAssertionNode(definedAssertionNode, context);
|
|
181
206
|
|
|
182
207
|
context = null;
|
|
183
208
|
|
|
184
|
-
|
|
209
|
+
signatureAssertion = new SignatureAssertion(context, string, node, lineIndex, signature, reference);
|
|
185
210
|
}, context);
|
|
186
211
|
}
|
|
187
212
|
|
|
188
|
-
return
|
|
213
|
+
return signatureAssertion;
|
|
189
214
|
}
|
|
190
215
|
|
|
191
216
|
static fromStep(step, context) {
|
|
192
217
|
const statementNode = step.getStatementNode(),
|
|
193
|
-
|
|
218
|
+
signatureAssertion = signatureAssertionFromStatementNode(statementNode, context);
|
|
194
219
|
|
|
195
|
-
return
|
|
220
|
+
return signatureAssertion;
|
|
196
221
|
}
|
|
197
222
|
|
|
198
223
|
static fromStatement(statement, context) {
|
|
199
224
|
const statementNode = statement.getNode(),
|
|
200
|
-
|
|
225
|
+
signatureAssertion = signatureAssertionFromStatementNode(statementNode, context);
|
|
201
226
|
|
|
202
|
-
return
|
|
227
|
+
return signatureAssertion;
|
|
203
228
|
}
|
|
204
229
|
});
|
|
@@ -57,6 +57,8 @@ export default define(class SubproofAssertion extends Assertion {
|
|
|
57
57
|
|
|
58
58
|
context.trace(`Validating the '${subproofAssertionString}' subproof assertion...`);
|
|
59
59
|
|
|
60
|
+
let validates = false;
|
|
61
|
+
|
|
60
62
|
const validAssertion = this.findValidAssertion(context);
|
|
61
63
|
|
|
62
64
|
if (validAssertion) {
|
|
@@ -64,8 +66,6 @@ export default define(class SubproofAssertion extends Assertion {
|
|
|
64
66
|
|
|
65
67
|
context.debug(`...the '${subproofAssertionString}' subproof assertion is already valid.`);
|
|
66
68
|
} else {
|
|
67
|
-
let validates = false;
|
|
68
|
-
|
|
69
69
|
const statementsValidate = this.validateStatements(context);
|
|
70
70
|
|
|
71
71
|
if (statementsValidate) {
|
|
@@ -78,11 +78,13 @@ export default define(class SubproofAssertion extends Assertion {
|
|
|
78
78
|
subproofAssertion = assertion; ///
|
|
79
79
|
|
|
80
80
|
context.addAssertion(assertion);
|
|
81
|
-
|
|
82
|
-
context.debug(`...validated the '${subproofAssertionString}' subproof assertion.`);
|
|
83
81
|
}
|
|
84
82
|
}
|
|
85
83
|
|
|
84
|
+
if (validates) {
|
|
85
|
+
context.debug(`...validated the '${subproofAssertionString}' subproof assertion.`);
|
|
86
|
+
}
|
|
87
|
+
|
|
86
88
|
return subproofAssertion;
|
|
87
89
|
}
|
|
88
90
|
|
|
@@ -39,15 +39,17 @@ export default define(class TypeAssertion extends Assertion {
|
|
|
39
39
|
|
|
40
40
|
context.trace(`Validating the '${typeAssertionString}' type assertion...`);
|
|
41
41
|
|
|
42
|
+
let validates = false;
|
|
43
|
+
|
|
42
44
|
const validAssertion = this.findValidAssertion(context);
|
|
43
45
|
|
|
44
46
|
if (validAssertion) {
|
|
47
|
+
validates = true;
|
|
48
|
+
|
|
45
49
|
typeAssertion = validAssertion; ///
|
|
46
50
|
|
|
47
51
|
context.debug(`...the '${typeAssertionString}' type assertion is already valid.`);
|
|
48
52
|
} else {
|
|
49
|
-
let validates = false;
|
|
50
|
-
|
|
51
53
|
const typeValidates = this.validateType(context);
|
|
52
54
|
|
|
53
55
|
if (typeValidates) {
|
|
@@ -75,11 +77,13 @@ export default define(class TypeAssertion extends Assertion {
|
|
|
75
77
|
this.assign(context);
|
|
76
78
|
|
|
77
79
|
context.addAssertion(assertion);
|
|
78
|
-
|
|
79
|
-
context.debug(`...verified the '${typeAssertionString}' type assertion.`);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
if (validates) {
|
|
84
|
+
context.debug(`...verified the '${typeAssertionString}' type assertion.`);
|
|
85
|
+
}
|
|
86
|
+
|
|
83
87
|
return typeAssertion;
|
|
84
88
|
}
|
|
85
89
|
|
|
@@ -105,13 +105,15 @@ export default define(class MetaLevelAssumption extends Element {
|
|
|
105
105
|
this.commit(context);
|
|
106
106
|
}
|
|
107
107
|
}, context);
|
|
108
|
-
}
|
|
109
108
|
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
if (validates) {
|
|
110
|
+
metaLevelAssumption = this; ///
|
|
112
111
|
|
|
113
|
-
|
|
112
|
+
context.addMetaLevelAssumption(metaLevelAssumption);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
114
115
|
|
|
116
|
+
if (validates) {
|
|
115
117
|
context.debug(`...validated the '${metaLevelAssumptionString}' meta-level assumption.`);
|
|
116
118
|
}
|
|
117
119
|
|
|
@@ -64,15 +64,17 @@ export default define(class Assumption extends Element {
|
|
|
64
64
|
|
|
65
65
|
context.trace(`Validating the '${assumptionString}' assumption...`);
|
|
66
66
|
|
|
67
|
+
let validates = false;
|
|
68
|
+
|
|
67
69
|
const validAssumption = this.findValidAssumption(context);
|
|
68
70
|
|
|
69
71
|
if (validAssumption) {
|
|
72
|
+
validates = true;
|
|
73
|
+
|
|
70
74
|
assumption = validAssumption; ///
|
|
71
75
|
|
|
72
76
|
context.debug(`...the '${assumptionString}' assumption is already valid.`);
|
|
73
77
|
} else {
|
|
74
|
-
let validates = false;
|
|
75
|
-
|
|
76
78
|
const statementValidates = this.validateStatement(context);
|
|
77
79
|
|
|
78
80
|
if (statementValidates) {
|
|
@@ -100,11 +102,13 @@ export default define(class Assumption extends Element {
|
|
|
100
102
|
assumption = this; ///
|
|
101
103
|
|
|
102
104
|
context.addAssumption(assumption);
|
|
103
|
-
|
|
104
|
-
context.debug(`...validated the '${assumptionString}' assumption.`);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
if (validates) {
|
|
109
|
+
context.debug(`...validated the '${assumptionString}' assumption.`);
|
|
110
|
+
}
|
|
111
|
+
|
|
108
112
|
return assumption;
|
|
109
113
|
}
|
|
110
114
|
|
package/src/element/equality.js
CHANGED
|
@@ -123,15 +123,17 @@ export default define(class Equality extends Element {
|
|
|
123
123
|
|
|
124
124
|
context.trace(`Validating the '${equalityString}' equality...`);
|
|
125
125
|
|
|
126
|
+
let validates = false;
|
|
127
|
+
|
|
126
128
|
const validEquality = this.findValidEquality(context);
|
|
127
129
|
|
|
128
130
|
if (validEquality !== null) {
|
|
131
|
+
validates = true;
|
|
132
|
+
|
|
129
133
|
equality = validEquality; ///
|
|
130
134
|
|
|
131
135
|
context.debug(`...the '${equalityString}' equality is already valid.`);
|
|
132
136
|
} else {
|
|
133
|
-
let validates = false;
|
|
134
|
-
|
|
135
137
|
const termsValidate = this.validateTerms(context);
|
|
136
138
|
|
|
137
139
|
if (termsValidate) {
|
|
@@ -157,11 +159,13 @@ export default define(class Equality extends Element {
|
|
|
157
159
|
this.assign(context);
|
|
158
160
|
|
|
159
161
|
context.addEquality(equality);
|
|
160
|
-
|
|
161
|
-
context.debug(`...validated the '${equalityString}' equality.`);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
if (validates) {
|
|
166
|
+
context.debug(`...validated the '${equalityString}' equality.`);
|
|
167
|
+
}
|
|
168
|
+
|
|
165
169
|
return equality;
|
|
166
170
|
}
|
|
167
171
|
|
package/src/element/frame.js
CHANGED
|
@@ -120,16 +120,17 @@ export default define(class Frame extends Element {
|
|
|
120
120
|
|
|
121
121
|
context.trace(`Validating the '${frameString}' frame...`);
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
let validates = false;
|
|
124
|
+
|
|
125
|
+
const validFrame = this.findValidFrame(context);
|
|
126
|
+
|
|
127
|
+
if (validFrame !== null) {
|
|
128
|
+
validates = true;
|
|
125
129
|
|
|
126
|
-
if (valid) {
|
|
127
130
|
frame = validFrame; ///
|
|
128
131
|
|
|
129
132
|
context.debug(`...the '${frameString}' frame is already valid.`);
|
|
130
133
|
} else {
|
|
131
|
-
let validates = false;
|
|
132
|
-
|
|
133
134
|
const metavariableValidates = this.validatMetavariable(context);
|
|
134
135
|
|
|
135
136
|
if (metavariableValidates) {
|
|
@@ -157,11 +158,13 @@ export default define(class Frame extends Element {
|
|
|
157
158
|
frame = this; ///
|
|
158
159
|
|
|
159
160
|
context.addFrame(frame);
|
|
160
|
-
|
|
161
|
-
context.debug(`...validated the '${frameString}' frame.`);
|
|
162
161
|
}
|
|
163
162
|
}
|
|
164
163
|
|
|
164
|
+
if (validates) {
|
|
165
|
+
context.debug(`...validated the '${frameString}' frame.`);
|
|
166
|
+
}
|
|
167
|
+
|
|
165
168
|
return frame;
|
|
166
169
|
}
|
|
167
170
|
|
package/src/element/judgement.js
CHANGED
|
@@ -81,15 +81,17 @@ export default define(class Judgement extends Element {
|
|
|
81
81
|
|
|
82
82
|
context.trace(`Validating the '${judgementString}' judgement...`);
|
|
83
83
|
|
|
84
|
+
let validates = false;
|
|
85
|
+
|
|
84
86
|
const validJudgement = this.findValidJudgement(context);
|
|
85
87
|
|
|
86
88
|
if (validJudgement !== null) {
|
|
89
|
+
validates = true;
|
|
90
|
+
|
|
87
91
|
judgement = validJudgement; ///
|
|
88
92
|
|
|
89
93
|
context.debug(`...the '${judgementString}' judgement is already valid.`);
|
|
90
94
|
} else {
|
|
91
|
-
let validates = false;
|
|
92
|
-
|
|
93
95
|
const frameValidates = this.validateFrame(context);
|
|
94
96
|
|
|
95
97
|
if (frameValidates) {
|
|
@@ -119,11 +121,13 @@ export default define(class Judgement extends Element {
|
|
|
119
121
|
this.assign(context);
|
|
120
122
|
|
|
121
123
|
context.addJudgement(judgement);
|
|
122
|
-
|
|
123
|
-
context.debug(`...validated the '${judgementString}' judgement.`);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
if (validates) {
|
|
128
|
+
context.debug(`...validated the '${judgementString}' judgement.`);
|
|
129
|
+
}
|
|
130
|
+
|
|
127
131
|
return judgement;
|
|
128
132
|
}
|
|
129
133
|
|
|
@@ -182,16 +182,17 @@ export default define(class Metavariable extends Element {
|
|
|
182
182
|
|
|
183
183
|
context.trace(`Validating the '${metavariableString}' metavariable...`);
|
|
184
184
|
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
let validates = false;
|
|
186
|
+
|
|
187
|
+
const validMetavariable = this.findValidMetavariable(context);
|
|
188
|
+
|
|
189
|
+
if (validMetavariable !== null) {
|
|
190
|
+
validates = true;
|
|
187
191
|
|
|
188
|
-
if (valid) {
|
|
189
192
|
metavariable = validMetavariable; ///
|
|
190
193
|
|
|
191
194
|
context.debug(`...the '${metavariableString}' metavariable is already valid.`);
|
|
192
195
|
} else {
|
|
193
|
-
let validates = false;
|
|
194
|
-
|
|
195
196
|
const nameValidates = this.validateName(strict, context);
|
|
196
197
|
|
|
197
198
|
if (nameValidates) {
|
|
@@ -214,11 +215,13 @@ export default define(class Metavariable extends Element {
|
|
|
214
215
|
if (declared) {
|
|
215
216
|
context.addMetavariable(metavariable);
|
|
216
217
|
}
|
|
217
|
-
|
|
218
|
-
context.debug(`...validated the '${metavariableString}' metavariable.`);
|
|
219
218
|
}
|
|
220
219
|
}
|
|
221
220
|
|
|
221
|
+
if (validates) {
|
|
222
|
+
context.debug(`...validated the '${metavariableString}' metavariable.`);
|
|
223
|
+
}
|
|
224
|
+
|
|
222
225
|
return metavariable;
|
|
223
226
|
}
|
|
224
227
|
|
|
@@ -14,19 +14,19 @@ const { asyncSome } = asynchronousUtilities,
|
|
|
14
14
|
{ backwardsSome } = arrayUtilities;
|
|
15
15
|
|
|
16
16
|
export default define(class Step extends ProofAssertion {
|
|
17
|
-
constructor(context, string, node, lineIndex, statement, reference,
|
|
17
|
+
constructor(context, string, node, lineIndex, statement, reference, signatureAssertion) {
|
|
18
18
|
super(context, string, node, lineIndex, statement);
|
|
19
19
|
|
|
20
20
|
this.reference = reference;
|
|
21
|
-
this.
|
|
21
|
+
this.signatureAssertion = signatureAssertion;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
getReference() {
|
|
25
25
|
return this.reference;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
return this.
|
|
28
|
+
getSignatureAssertion() {
|
|
29
|
+
return this.signatureAssertion;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
getStepNode() {
|
|
@@ -44,7 +44,7 @@ export default define(class Step extends ProofAssertion {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
isSatisfied() {
|
|
47
|
-
const satisfied = (this.
|
|
47
|
+
const satisfied = (this.signatureAssertion !== null);
|
|
48
48
|
|
|
49
49
|
return satisfied;
|
|
50
50
|
}
|
|
@@ -143,9 +143,9 @@ export default define(class Step extends ProofAssertion {
|
|
|
143
143
|
const referenceValidates = this.validateReference(context);
|
|
144
144
|
|
|
145
145
|
if (referenceValidates) {
|
|
146
|
-
const
|
|
146
|
+
const signatureAssertionValidates = this.validateSignatureAssertion(context);
|
|
147
147
|
|
|
148
|
-
if (
|
|
148
|
+
if (signatureAssertionValidates) {
|
|
149
149
|
validates = true;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -211,27 +211,27 @@ export default define(class Step extends ProofAssertion {
|
|
|
211
211
|
return statementValidates;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
|
|
215
|
-
let
|
|
214
|
+
validateSignatureAssertion(context) {
|
|
215
|
+
let signatureAssertionValidates = true; ///
|
|
216
216
|
|
|
217
|
-
if (this.
|
|
217
|
+
if (this.signatureAssertion !== null) {
|
|
218
218
|
const stepString = this.getString(), ///
|
|
219
|
-
|
|
219
|
+
signatureAssertionString = this.signatureAssertion.getString();
|
|
220
220
|
|
|
221
|
-
context.trace(`Validating the '${stepString}' step's '${
|
|
221
|
+
context.trace(`Validating the '${stepString}' step's '${signatureAssertionString}' signature assertion... `);
|
|
222
222
|
|
|
223
|
-
const
|
|
223
|
+
const signatureAssertion = this.signatureAssertion.validate(context);
|
|
224
224
|
|
|
225
|
-
if (
|
|
226
|
-
|
|
225
|
+
if (signatureAssertion === null) {
|
|
226
|
+
signatureAssertionValidates = false;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
if (
|
|
230
|
-
context.debug(`...validating the '${stepString}' step's '${
|
|
229
|
+
if (signatureAssertionValidates) {
|
|
230
|
+
context.debug(`...validating the '${stepString}' step's '${signatureAssertionString}' signature assertion. `);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
return
|
|
234
|
+
return signatureAssertionValidates;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
async unify(context) {
|
|
@@ -264,15 +264,15 @@ export default define(class Step extends ProofAssertion {
|
|
|
264
264
|
return unifies;
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
|
|
268
|
-
let
|
|
267
|
+
unifyWithSignatureAssertion(signatureAssertion, context) {
|
|
268
|
+
let unifiesWithSignatureAssertion = false;
|
|
269
269
|
|
|
270
270
|
const stepString = this.getString(), ///
|
|
271
|
-
|
|
271
|
+
signatureAssertionString = signatureAssertion.getString();
|
|
272
272
|
|
|
273
|
-
context.trace(`Unifying the '${stepString}' step with the '${
|
|
273
|
+
context.trace(`Unifying the '${stepString}' step with the '${signatureAssertionString}' signature assertion...`);
|
|
274
274
|
|
|
275
|
-
const reference =
|
|
275
|
+
const reference = signatureAssertion.getReference(),
|
|
276
276
|
axiom = context.findAxiomByReference(reference);
|
|
277
277
|
|
|
278
278
|
if (axiom !== null) {
|
|
@@ -280,19 +280,19 @@ export default define(class Step extends ProofAssertion {
|
|
|
280
280
|
stepUnifies = axiom.unifyStep(step, context);
|
|
281
281
|
|
|
282
282
|
if (stepUnifies) {
|
|
283
|
-
const substitutionsCompare =
|
|
283
|
+
const substitutionsCompare = signatureAssertion.compareSubstitutions(context);
|
|
284
284
|
|
|
285
285
|
if (substitutionsCompare) {
|
|
286
|
-
|
|
286
|
+
unifiesWithSignatureAssertion = true;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
if (
|
|
292
|
-
context.debug(`...unified the '${stepString}' step with the '${
|
|
291
|
+
if (unifiesWithSignatureAssertion) {
|
|
292
|
+
context.debug(`...unified the '${stepString}' step with the '${signatureAssertionString}' signature assertion.`);
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
return
|
|
295
|
+
return unifiesWithSignatureAssertion;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
static name = "Step";
|
package/src/element/property.js
CHANGED
|
@@ -129,27 +129,31 @@ export default define(class Property extends Element {
|
|
|
129
129
|
|
|
130
130
|
context.trace(`Validating the '${propertyString}' property...`);
|
|
131
131
|
|
|
132
|
+
let validates = false;
|
|
133
|
+
|
|
132
134
|
const validProperty = this.findValidProperty(context);
|
|
133
135
|
|
|
134
|
-
if (validProperty) {
|
|
136
|
+
if (validProperty !== null) {
|
|
135
137
|
property = validProperty; ///
|
|
136
138
|
|
|
137
|
-
context.debug(`...the '${propertyString}' property is already valid.`);
|
|
138
|
-
|
|
139
139
|
const validatesForward = validateForwards(property);
|
|
140
140
|
|
|
141
|
-
if (
|
|
141
|
+
if (validatesForward) {
|
|
142
|
+
validates = true;
|
|
143
|
+
|
|
144
|
+
context.debug(`...the '${propertyString}' property is already valid.`);
|
|
145
|
+
} else {
|
|
142
146
|
property = null;
|
|
143
147
|
}
|
|
144
148
|
} else {
|
|
145
|
-
let validates = false;
|
|
146
|
-
|
|
147
149
|
property = this; ///
|
|
148
150
|
|
|
149
151
|
const validatesForward = validateForwards(property);
|
|
150
152
|
|
|
151
153
|
if (validatesForward) {
|
|
152
154
|
validates = true;
|
|
155
|
+
} else {
|
|
156
|
+
property = null;
|
|
153
157
|
}
|
|
154
158
|
|
|
155
159
|
if (validates) {
|
|
@@ -159,6 +163,10 @@ export default define(class Property extends Element {
|
|
|
159
163
|
}
|
|
160
164
|
}
|
|
161
165
|
|
|
166
|
+
if (validates) {
|
|
167
|
+
context.debug(`...validated the '${propertyString}' property.`);
|
|
168
|
+
}
|
|
169
|
+
|
|
162
170
|
return property;
|
|
163
171
|
}
|
|
164
172
|
|