occam-verify-cli 1.0.708 → 1.0.714
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/element/assertion/property.js +8 -5
- package/lib/element/assertion/satisfies.js +13 -12
- package/lib/element/assumption.js +3 -3
- package/lib/element/combinator.js +20 -20
- package/lib/element/conclusion.js +8 -8
- package/lib/element/constructor.js +21 -21
- package/lib/element/declaration/combinator.js +10 -10
- package/lib/element/declaration/constructor.js +10 -10
- package/lib/element/deduction.js +10 -10
- package/lib/element/frame.js +19 -7
- package/lib/element/metavariable.js +1 -1
- package/lib/element/proofAssertion/premise.js +29 -24
- package/lib/element/proofAssertion/step.js +15 -14
- package/lib/element/proofAssertion/supposition.js +30 -25
- package/lib/element/reference.js +4 -7
- package/lib/element/rule.js +2 -2
- package/lib/element/signature.js +7 -7
- package/lib/element/statement.js +5 -3
- package/lib/element/subproof.js +2 -2
- package/lib/element/term.js +8 -9
- package/lib/element/topLevelAssertion/axiom.js +19 -19
- package/lib/pass/zip.js +23 -0
- package/lib/process/unify.js +11 -21
- package/lib/process/validate.js +116 -2
- package/lib/process/verify.js +6 -125
- package/lib/utilities/context.js +1 -9
- package/lib/utilities/unification.js +2 -11
- package/lib/utilities/validation.js +6 -6
- package/package.json +1 -1
- package/src/element/assertion/property.js +8 -4
- package/src/element/assertion/satisfies.js +10 -10
- package/src/element/assumption.js +2 -2
- package/src/element/combinator.js +19 -19
- package/src/element/conclusion.js +8 -8
- package/src/element/constructor.js +21 -20
- package/src/element/declaration/combinator.js +9 -9
- package/src/element/declaration/constructor.js +9 -9
- package/src/element/deduction.js +10 -10
- package/src/element/frame.js +26 -7
- package/src/element/metavariable.js +0 -1
- package/src/element/proofAssertion/premise.js +43 -33
- package/src/element/proofAssertion/step.js +17 -16
- package/src/element/proofAssertion/supposition.js +44 -34
- package/src/element/reference.js +6 -11
- package/src/element/rule.js +1 -1
- package/src/element/signature.js +6 -6
- package/src/element/statement.js +4 -2
- package/src/element/subproof.js +1 -2
- package/src/element/term.js +9 -10
- package/src/element/topLevelAssertion/axiom.js +18 -18
- package/src/pass/zip.js +19 -0
- package/src/process/unify.js +4 -34
- package/src/process/validate.js +161 -1
- package/src/process/verify.js +2 -166
- package/src/utilities/context.js +0 -9
- package/src/utilities/unification.js +1 -15
- package/src/utilities/validation.js +5 -5
package/src/element/frame.js
CHANGED
|
@@ -252,6 +252,25 @@ export default define(class Frame extends Element {
|
|
|
252
252
|
return validatesWhenDerived;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
validateAssumption(assumption, context) {
|
|
256
|
+
let assumptionValidates;
|
|
257
|
+
|
|
258
|
+
const frameString = this.getString(), ///
|
|
259
|
+
assumptionstring = assumption.getString();
|
|
260
|
+
|
|
261
|
+
context.trace(`Validating the '${frameString}' frame's '${assumptionstring}' assumption.`);
|
|
262
|
+
|
|
263
|
+
const stated = true; ///
|
|
264
|
+
|
|
265
|
+
assumptionValidates = assumption.validate(stated, context);
|
|
266
|
+
|
|
267
|
+
if (assumptionValidates) {
|
|
268
|
+
context.debug(`...validated the '${frameString}' frame's '${assumptionstring}' assumption.`);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return assumptionValidates;
|
|
272
|
+
}
|
|
273
|
+
|
|
255
274
|
validateAssumptions(stated, context) {
|
|
256
275
|
let assumptionsValidate;
|
|
257
276
|
|
|
@@ -261,14 +280,12 @@ export default define(class Frame extends Element {
|
|
|
261
280
|
const frameString = this.getString(), ///
|
|
262
281
|
assumptionsString = assumptionsStringFromAssumptions(this.assumptions);
|
|
263
282
|
|
|
264
|
-
context.trace(`Validating the '${
|
|
265
|
-
|
|
266
|
-
stated = true; ///
|
|
283
|
+
context.trace(`Validating the '${frameString}' frame's '${assumptionsString}' assumptions...`);
|
|
267
284
|
|
|
268
285
|
const assumptions = [];
|
|
269
286
|
|
|
270
287
|
assumptionsValidate = this.assumptions.every((assumption) => {
|
|
271
|
-
const assumptionValidates =
|
|
288
|
+
const assumptionValidates = this.validateAssumption(assumption, context);
|
|
272
289
|
|
|
273
290
|
if (assumptionValidates) {
|
|
274
291
|
assumptions.push(assumption);
|
|
@@ -280,7 +297,7 @@ export default define(class Frame extends Element {
|
|
|
280
297
|
if (assumptionsValidate) {
|
|
281
298
|
this.assumptions = assumptions;
|
|
282
299
|
|
|
283
|
-
context.debug(`...validated the '${
|
|
300
|
+
context.debug(`...validated the '${frameString}' frame's '${assumptionsString}' assumptions.`);
|
|
284
301
|
}
|
|
285
302
|
} else {
|
|
286
303
|
assumptionsValidate = true;
|
|
@@ -335,9 +352,11 @@ export default define(class Frame extends Element {
|
|
|
335
352
|
const metaTypeName = metaType.getName();
|
|
336
353
|
|
|
337
354
|
if (metaTypeName === FRAME_META_TYPE_NAME) {
|
|
338
|
-
const
|
|
355
|
+
const frame = this.validate(stated, context);
|
|
339
356
|
|
|
340
|
-
|
|
357
|
+
if (frame !== null) {
|
|
358
|
+
validatesGivenMetaType = true;
|
|
359
|
+
}
|
|
341
360
|
}
|
|
342
361
|
|
|
343
362
|
if (validatesGivenMetaType) {
|
|
@@ -41,18 +41,17 @@ export default define(class Premise extends ProofAssertion {
|
|
|
41
41
|
|
|
42
42
|
context.trace(`Verifying the '${premiseString}' premise...`);
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
const statement = this.getStatement(),
|
|
45
|
+
procedureCall = this.getProcedureCall();
|
|
46
|
+
|
|
47
|
+
if ((statement !== null) || (procedureCall !== null)) {
|
|
45
48
|
const validates = this.validate(context);
|
|
46
49
|
|
|
47
50
|
if (validates) {
|
|
48
|
-
this.setContext(context);
|
|
49
|
-
|
|
50
51
|
verifies = true;
|
|
51
52
|
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (verifies) {
|
|
55
|
-
context.debug(`...verified the '${premiseString}' premise.`);
|
|
53
|
+
} else {
|
|
54
|
+
context.debug(`Unable to validate the '${premiseString}' premise because it is nonsense.`);
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
return verifies;
|
|
@@ -65,26 +64,30 @@ export default define(class Premise extends ProofAssertion {
|
|
|
65
64
|
|
|
66
65
|
context.trace(`Validatting the '${premiseString}' premise...`);
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
attempt((context) => {
|
|
68
|
+
const statement = this.getStatement(),
|
|
69
|
+
procedureCall = this.getProcedureCall();
|
|
70
|
+
|
|
71
|
+
if (statement !== null) {
|
|
72
|
+
const statementValidates = this.validateStatement(context);
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} else if (statement !== null) {
|
|
74
|
-
const statementValidates = this.validateStatement(context);
|
|
74
|
+
if (statementValidates) {
|
|
75
|
+
this.setContext(context);
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
validates = true;
|
|
78
|
+
}
|
|
78
79
|
}
|
|
79
|
-
} else if (procedureCall !== null) {
|
|
80
|
-
const procedureCallValidates = this.validateProcedureCall(context);
|
|
81
80
|
|
|
82
|
-
if (
|
|
83
|
-
|
|
81
|
+
if (procedureCall !== null) {
|
|
82
|
+
const procedureCallValidates = this.validateProcedureCall(context);
|
|
83
|
+
|
|
84
|
+
if (procedureCallValidates) {
|
|
85
|
+
this.setContext(context);
|
|
86
|
+
|
|
87
|
+
validates = true;
|
|
88
|
+
}
|
|
84
89
|
}
|
|
85
|
-
}
|
|
86
|
-
context.debug(`Unable to validate the '${premiseString}' premise because it is nonsense.`);
|
|
87
|
-
}
|
|
90
|
+
}, context);
|
|
88
91
|
|
|
89
92
|
if (validates) {
|
|
90
93
|
context.debug(`...validated the '${premiseString}' premise.`);
|
|
@@ -101,7 +104,11 @@ export default define(class Premise extends ProofAssertion {
|
|
|
101
104
|
|
|
102
105
|
context.trace(`Validatting the '${premiseString}' premise's '${procedureCallString}' procedure call...`);
|
|
103
106
|
|
|
104
|
-
|
|
107
|
+
const procedureCall = this.procedureCall.validate(context);
|
|
108
|
+
|
|
109
|
+
if (procedureCall !== null) {
|
|
110
|
+
procedureCallValidates = true;
|
|
111
|
+
}
|
|
105
112
|
|
|
106
113
|
if (procedureCallValidates) {
|
|
107
114
|
context.debug(`...validated the '${premiseString}' premise's '${procedureCallString}' procedure call.`);
|
|
@@ -150,7 +157,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
150
157
|
}
|
|
151
158
|
|
|
152
159
|
unifyProofAssertion(proofAssertion, context) {
|
|
153
|
-
let proofAssertionUnifies;
|
|
160
|
+
let proofAssertionUnifies = false;
|
|
154
161
|
|
|
155
162
|
const premiseString = this.getString(), ///
|
|
156
163
|
proofAssertionString = proofAssertion.getString();
|
|
@@ -160,18 +167,21 @@ export default define(class Premise extends ProofAssertion {
|
|
|
160
167
|
const proofAssertionContext = proofAssertion.getContext(),
|
|
161
168
|
premiseContext = this.getContext(),
|
|
162
169
|
generalContext = premiseContext, ///
|
|
163
|
-
specificContext = proofAssertionContext
|
|
170
|
+
specificContext = proofAssertionContext,
|
|
171
|
+
statementUnifies = liminally((specificContext) => {
|
|
172
|
+
const statement = proofAssertion.getStatement(),
|
|
173
|
+
statementUnifies = this.unifyStatement(statement, generalContext, specificContext);
|
|
164
174
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
statementUnifies = this.unifyStatement(statement, generalContext, specificContext);
|
|
175
|
+
if (statementUnifies) {
|
|
176
|
+
specificContext.commit(context);
|
|
168
177
|
|
|
169
|
-
|
|
170
|
-
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
}, specificContext);
|
|
171
181
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
182
|
+
if (statementUnifies) {
|
|
183
|
+
proofAssertionUnifies = true;
|
|
184
|
+
}
|
|
175
185
|
|
|
176
186
|
if (proofAssertionUnifies) {
|
|
177
187
|
context.debug(`...unified the '${proofAssertionString}' proof assertion with the '${premiseString}' premise.`);
|
|
@@ -6,7 +6,7 @@ import ProofAssertion from "../proofAssertion";
|
|
|
6
6
|
|
|
7
7
|
import { define } from "../../elements";
|
|
8
8
|
import { unifyStatements } from "../../utilities/unification";
|
|
9
|
-
import {
|
|
9
|
+
import { attempt, asyncLiminally } from "../../utilities/context";
|
|
10
10
|
import { propertyAssertionFromStatement } from "../../utilities/statement";
|
|
11
11
|
|
|
12
12
|
const { asyncSome } = asynchronousUtilities;
|
|
@@ -75,19 +75,23 @@ export default define(class Step extends ProofAssertion {
|
|
|
75
75
|
|
|
76
76
|
context.trace(`Verifying the '${stepString}' step...`);
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
const statement = this.getStatement();
|
|
79
|
+
|
|
80
|
+
if (statement !== null) {
|
|
79
81
|
const validates = this.validate(context);
|
|
80
82
|
|
|
81
83
|
if (validates) {
|
|
82
|
-
|
|
84
|
+
context = this.getContext();
|
|
83
85
|
|
|
84
|
-
|
|
85
|
-
this.setContext(context);
|
|
86
|
+
const unifiies = await this.unify(context);
|
|
86
87
|
|
|
88
|
+
if (unifiies) {
|
|
87
89
|
verifies = true;
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
|
-
}
|
|
92
|
+
} else {
|
|
93
|
+
context.debug(`Unable to verify the '${stepString}' step because it is nonsense.`);
|
|
94
|
+
}
|
|
91
95
|
|
|
92
96
|
if (verifies) {
|
|
93
97
|
context.debug(`...verified the '${stepString}' step.`);
|
|
@@ -103,9 +107,7 @@ export default define(class Step extends ProofAssertion {
|
|
|
103
107
|
|
|
104
108
|
context.trace(`Validating the '${stepString}' step...`);
|
|
105
109
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (statement !== null) {
|
|
110
|
+
attempt((context) => {
|
|
109
111
|
const referenceValidates = this.validateReference(context);
|
|
110
112
|
|
|
111
113
|
if (referenceValidates) {
|
|
@@ -115,16 +117,16 @@ export default define(class Step extends ProofAssertion {
|
|
|
115
117
|
const statementValidates = this.validateStatement(context);
|
|
116
118
|
|
|
117
119
|
if (statementValidates) {
|
|
120
|
+
this.setContext(context);
|
|
121
|
+
|
|
118
122
|
validates = true;
|
|
119
123
|
}
|
|
120
124
|
}
|
|
121
125
|
}
|
|
122
|
-
}
|
|
123
|
-
context.debug(`Unable to validate the '${stepString}' step because it is nonsense.`);
|
|
124
|
-
}
|
|
126
|
+
}, context);
|
|
125
127
|
|
|
126
128
|
if (validates) {
|
|
127
|
-
context.debug(`...
|
|
129
|
+
context.debug(`...validated the '${stepString}' step.`);
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
return validates;
|
|
@@ -223,11 +225,10 @@ export default define(class Step extends ProofAssertion {
|
|
|
223
225
|
|
|
224
226
|
if (axiom !== null) {
|
|
225
227
|
const step = this, ///
|
|
226
|
-
|
|
227
|
-
stepUnifies = axiom.unifyStep(step, substitutions, context);
|
|
228
|
+
stepUnifies = axiom.unifyStep(step, context);
|
|
228
229
|
|
|
229
230
|
if (stepUnifies) {
|
|
230
|
-
const substitutionsCompare = satisfiesAssertion.compareSubstitutions(
|
|
231
|
+
const substitutionsCompare = satisfiesAssertion.compareSubstitutions(context);
|
|
231
232
|
|
|
232
233
|
if (substitutionsCompare) {
|
|
233
234
|
unifiesWithSatisfiesAssertion = true;
|
|
@@ -37,22 +37,21 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
37
37
|
|
|
38
38
|
await this.break(context);
|
|
39
39
|
|
|
40
|
-
const suppositionString = this.getString();
|
|
40
|
+
const suppositionString = this.getString();
|
|
41
41
|
|
|
42
42
|
context.trace(`Verifying the '${suppositionString}' supposition...`);
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
const statement = this.getStatement(),
|
|
45
|
+
procedureCall = this.getProcedureCall();
|
|
46
|
+
|
|
47
|
+
if ((statement !== null) || (procedureCall !== null)) {
|
|
45
48
|
const validates = this.validate(context);
|
|
46
49
|
|
|
47
50
|
if (validates) {
|
|
48
|
-
this.setContext(context);
|
|
49
|
-
|
|
50
51
|
verifies = true;
|
|
51
52
|
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (verifies) {
|
|
55
|
-
context.debug(`...verified the '${suppositionString}' supposition.`);
|
|
53
|
+
} else {
|
|
54
|
+
context.debug(`Unable to validate the '${suppositionString}' supposition because it is nonsense.`);
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
return verifies;
|
|
@@ -65,26 +64,30 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
65
64
|
|
|
66
65
|
context.trace(`Validatting the '${suppositionString}' supposition...`);
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
attempt((context) => {
|
|
68
|
+
const statement = this.getStatement(),
|
|
69
|
+
procedureCall = this.getProcedureCall();
|
|
70
|
+
|
|
71
|
+
if (statement !== null) {
|
|
72
|
+
const statementValidates = this.validateStatement(context);
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} else if (statement !== null) {
|
|
74
|
-
const statementValidates = this.validateStatement(context);
|
|
74
|
+
if (statementValidates) {
|
|
75
|
+
this.setContext(context);
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
validates = true;
|
|
78
|
+
}
|
|
78
79
|
}
|
|
79
|
-
} else if (procedureCall !== null) {
|
|
80
|
-
const procedureCallValidates = this.validateProcedureCall(context);
|
|
81
80
|
|
|
82
|
-
if (
|
|
83
|
-
|
|
81
|
+
if (procedureCall !== null) {
|
|
82
|
+
const procedureCallValidates = this.validateProcedureCall(context);
|
|
83
|
+
|
|
84
|
+
if (procedureCallValidates) {
|
|
85
|
+
this.setContext(context);
|
|
86
|
+
|
|
87
|
+
validates = true;
|
|
88
|
+
}
|
|
84
89
|
}
|
|
85
|
-
}
|
|
86
|
-
context.debug(`Unable to validate the '${suppositionString}' supposition because it is nonsense.`);
|
|
87
|
-
}
|
|
90
|
+
}, context);
|
|
88
91
|
|
|
89
92
|
if (validates) {
|
|
90
93
|
context.debug(`...validated the '${suppositionString}' supposition.`);
|
|
@@ -101,7 +104,11 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
101
104
|
|
|
102
105
|
context.trace(`Validatting the '${suppositionString}' supposition's '${procedureCallString}' procedure call...`);
|
|
103
106
|
|
|
104
|
-
|
|
107
|
+
const procedureCall = this.procedureCall.validate(context);
|
|
108
|
+
|
|
109
|
+
if (procedureCall !== null) {
|
|
110
|
+
procedureCallValidates =true;
|
|
111
|
+
}
|
|
105
112
|
|
|
106
113
|
if (procedureCallValidates) {
|
|
107
114
|
context.debug(`...validated the '${suppositionString}' supposition's '${procedureCallString}' procedure call.`);
|
|
@@ -172,7 +179,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
172
179
|
}
|
|
173
180
|
|
|
174
181
|
unifyProofAssertion(proofAssertion, context) {
|
|
175
|
-
let proofAssertionUnifies;
|
|
182
|
+
let proofAssertionUnifies = false;
|
|
176
183
|
|
|
177
184
|
const suppositionString = this.getString(), ///
|
|
178
185
|
proofAssertionString = proofAssertion.getString();
|
|
@@ -182,18 +189,21 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
182
189
|
const proofAssertionContext = proofAssertion.getContext(),
|
|
183
190
|
suppositionContext = this.getContext(),
|
|
184
191
|
generalContext = suppositionContext, ///
|
|
185
|
-
specificContext = proofAssertionContext
|
|
192
|
+
specificContext = proofAssertionContext,
|
|
193
|
+
statementUnifies = liminally((specificContext) => {
|
|
194
|
+
const statement = proofAssertion.getStatement(),
|
|
195
|
+
statementUnifies = this.unifyStatement(statement, generalContext, specificContext);
|
|
186
196
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
statementUnifies = this.unifyStatement(statement, generalContext, specificContext);
|
|
197
|
+
if (statementUnifies) {
|
|
198
|
+
specificContext.commit(context);
|
|
190
199
|
|
|
191
|
-
|
|
192
|
-
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
}, specificContext);
|
|
193
203
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
204
|
+
if (statementUnifies) {
|
|
205
|
+
proofAssertionUnifies = true;
|
|
206
|
+
}
|
|
197
207
|
|
|
198
208
|
if (proofAssertionUnifies) {
|
|
199
209
|
context.debug(`...unified the '${proofAssertionString}' proof assertion with the '${suppositionString}' supposition.`);
|
package/src/element/reference.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { Element } from "occam-languages";
|
|
4
4
|
|
|
5
5
|
import { define } from "../elements";
|
|
6
|
-
import {
|
|
6
|
+
import { literally } from "../utilities/context";
|
|
7
7
|
import { instantiateReference } from "../process/instantiate";
|
|
8
8
|
import { REFERENCE_META_TYPE_NAME } from "../metaTypeNames";
|
|
9
9
|
import { metavariableFromReferenceNode } from "../utilities/element";
|
|
@@ -160,7 +160,7 @@ export default define(class Reference extends Element {
|
|
|
160
160
|
const referenceString = this.getString(), ///
|
|
161
161
|
metavariableString = this.metavariable.getString();
|
|
162
162
|
|
|
163
|
-
context.trace(`Validating the '${referenceString}' reference's '${metavariableString}' metavariable
|
|
163
|
+
context.trace(`Validating the '${referenceString}' reference's '${metavariableString}' metavariable...'`);
|
|
164
164
|
|
|
165
165
|
const metaTypeName = REFERENCE_META_TYPE_NAME,
|
|
166
166
|
referenceMetaType = context.findMetaTypeByMetaTypeName(metaTypeName),
|
|
@@ -249,13 +249,9 @@ export default define(class Reference extends Element {
|
|
|
249
249
|
|
|
250
250
|
context.trace(`Unifying the '${metavariableString}' metavariable with the '${referenceString}' reference...`);
|
|
251
251
|
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
metavariableUnifiesIntrinsically = unifyMetavariableIntrinsically(generalMetavariable, specificMetavariable, generalContext, specificContext);
|
|
256
|
-
|
|
257
|
-
return metavariableUnifiesIntrinsically;
|
|
258
|
-
}, specificContext);
|
|
252
|
+
const generalMetavariable = this.metavariable, ///
|
|
253
|
+
specificMetavariable = metavariable, ///
|
|
254
|
+
metavariableUnifiesIntrinsically = unifyMetavariableIntrinsically(generalMetavariable, specificMetavariable, generalContext, specificContext);
|
|
259
255
|
|
|
260
256
|
if (metavariableUnifiesIntrinsically) {
|
|
261
257
|
metavariableUnifies = true;
|
|
@@ -278,8 +274,7 @@ export default define(class Reference extends Element {
|
|
|
278
274
|
context.trace(`Unifying the '${topLevelMetaAssertionString}' top level meta-assertion with the '${referenceString}' reference...`);
|
|
279
275
|
|
|
280
276
|
const label = topLevelMetaAssertion.getLabel(),
|
|
281
|
-
|
|
282
|
-
labelUnifies = this.unifyLabel(label, substitutions, context);
|
|
277
|
+
labelUnifies = this.unifyLabel(label, context);
|
|
283
278
|
|
|
284
279
|
topLevelMetaAssertionUnifies = labelUnifies; ///
|
|
285
280
|
|
package/src/element/rule.js
CHANGED
package/src/element/signature.js
CHANGED
|
@@ -35,9 +35,9 @@ export default define(class Signature extends Element {
|
|
|
35
35
|
|
|
36
36
|
context.trace(`Verifying the '${signatureString}' signature...`);
|
|
37
37
|
|
|
38
|
-
const
|
|
38
|
+
const signature = this.validate(context);
|
|
39
39
|
|
|
40
|
-
if (
|
|
40
|
+
if (signature !== null) {
|
|
41
41
|
verifies = true;
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -49,7 +49,7 @@ export default define(class Signature extends Element {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
validate(context) {
|
|
52
|
-
let
|
|
52
|
+
let signature = null;
|
|
53
53
|
|
|
54
54
|
const signatureString = this.getString(); ///
|
|
55
55
|
|
|
@@ -61,14 +61,14 @@ export default define(class Signature extends Element {
|
|
|
61
61
|
if (termsValidate) {
|
|
62
62
|
this.terms = terms;
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
signature = this; ///
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
if (
|
|
67
|
+
if (signature) {
|
|
68
68
|
context.debug(`...validated the '${signatureString}' signature.`);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
return
|
|
71
|
+
return signature
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
validateTerm(term, terms, context) {
|
package/src/element/statement.js
CHANGED
|
@@ -220,9 +220,11 @@ export default define(class Statement extends Element {
|
|
|
220
220
|
const metaTypeName = metaType.getName();
|
|
221
221
|
|
|
222
222
|
if (metaTypeName === STATEMENT_META_TYPE_NAME) {
|
|
223
|
-
const
|
|
223
|
+
const statement = this.validate(stated, context)
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
if (statement !== null) {
|
|
226
|
+
validatesGivenMetaType = true;
|
|
227
|
+
}
|
|
226
228
|
}
|
|
227
229
|
|
|
228
230
|
if (validatesGivenMetaType) {
|
package/src/element/subproof.js
CHANGED
|
@@ -106,8 +106,7 @@ export default define(class Subproof extends Element {
|
|
|
106
106
|
|
|
107
107
|
if (axiomSatisfiable) {
|
|
108
108
|
const subproof = this, ///
|
|
109
|
-
|
|
110
|
-
statementUnifies = axiom.unifySubproof(subproof, substitutions, context);
|
|
109
|
+
statementUnifies = axiom.unifySubproof(subproof, context);
|
|
111
110
|
|
|
112
111
|
if (statementUnifies) {
|
|
113
112
|
const substitutionsCompare = satisfiesAssertion.compareSubstitutions(substitutions, context);
|
package/src/element/term.js
CHANGED
|
@@ -199,20 +199,19 @@ export default define(class Term extends Element {
|
|
|
199
199
|
|
|
200
200
|
context.trace(`Validating the '${termString}' term given the '${typeString}' type...`);
|
|
201
201
|
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const typeEqualToOrSubTypeOfGivenTypeType = this.type.isEqualToOrSubTypeOf(type);
|
|
206
|
-
|
|
207
|
-
if (typeEqualToOrSubTypeOfGivenTypeType) {
|
|
208
|
-
validatesForwards = true;
|
|
209
|
-
}
|
|
202
|
+
const term = this.validate(context, () => {
|
|
203
|
+
const validatesForwards = true;
|
|
210
204
|
|
|
211
205
|
return validatesForwards;
|
|
212
206
|
});
|
|
213
207
|
|
|
214
|
-
if (
|
|
215
|
-
|
|
208
|
+
if (term !== null) {
|
|
209
|
+
const termType = term.getType(),
|
|
210
|
+
termTypeEqualToOrSubTypeOfGivenTypeType = termType.isEqualToOrSubTypeOf(type);
|
|
211
|
+
|
|
212
|
+
if (termTypeEqualToOrSubTypeOfGivenTypeType) {
|
|
213
|
+
validatesGivenType = true;
|
|
214
|
+
}
|
|
216
215
|
}
|
|
217
216
|
|
|
218
217
|
if (validatesGivenType) {
|