occam-verify-cli 1.0.635 → 1.0.638
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/file/nominal.js +1 -1
- package/lib/context/liminal.js +3 -3
- package/lib/context/scoped.js +25 -3
- package/lib/context.js +8 -1
- package/lib/element/assertion/contained.js +34 -23
- package/lib/element/assertion/defined.js +30 -21
- package/lib/element/assertion/property.js +24 -21
- package/lib/element/assertion/satisfies.js +19 -14
- package/lib/element/assertion/subproof.js +18 -13
- package/lib/element/assertion/type.js +23 -20
- package/lib/element/assertion.js +5 -5
- package/lib/element/assumption.js +31 -25
- package/lib/element/combinator/bracketed.js +3 -3
- package/lib/element/combinator.js +3 -3
- package/lib/element/conclusion.js +6 -2
- package/lib/element/constructor/bracketed.js +5 -3
- package/lib/element/deduction.js +6 -2
- package/lib/element/derivation.js +4 -5
- package/lib/element/equality.js +32 -27
- package/lib/element/frame.js +26 -21
- package/lib/element/hypothesis.js +8 -10
- package/lib/element/judgement.js +54 -22
- package/lib/element/metavariable.js +18 -10
- package/lib/element/proofAssertion/premise.js +8 -8
- package/lib/element/proofAssertion/step.js +16 -11
- package/lib/element/proofAssertion/supposition.js +7 -7
- package/lib/element/proofAssertion.js +7 -5
- package/lib/element/propertyRelation.js +7 -3
- package/lib/element/reference.js +28 -21
- package/lib/element/rule.js +4 -11
- package/lib/element/signature.js +10 -4
- package/lib/element/statement.js +17 -17
- package/lib/element/subDerivation.js +4 -11
- package/lib/element/subproof.js +37 -29
- package/lib/element/substitution/frame.js +18 -10
- package/lib/element/substitution/reference.js +17 -9
- package/lib/element/substitution/statement.js +16 -10
- package/lib/element/substitution/term.js +19 -9
- package/lib/element/substitution.js +5 -5
- package/lib/element/term.js +14 -14
- package/lib/element/topLevelAssertion.js +4 -11
- package/lib/element/topLevelMetaAssertion.js +4 -11
- package/lib/element/variable.js +6 -3
- package/lib/process/assign.js +1 -9
- package/lib/process/unify.js +8 -8
- package/lib/process/validate.js +14 -7
- package/lib/process/verify.js +14 -7
- package/lib/utilities/unification.js +6 -6
- package/lib/utilities/validation.js +68 -55
- package/package.json +1 -1
- package/src/context/file/nominal.js +2 -2
- package/src/context/liminal.js +2 -2
- package/src/context/scoped.js +20 -2
- package/src/context.js +6 -0
- package/src/element/assertion/contained.js +40 -24
- package/src/element/assertion/defined.js +38 -24
- package/src/element/assertion/property.js +28 -22
- package/src/element/assertion/satisfies.js +21 -13
- package/src/element/assertion/subproof.js +21 -13
- package/src/element/assertion/type.js +28 -22
- package/src/element/assertion.js +4 -4
- package/src/element/assumption.js +31 -23
- package/src/element/combinator/bracketed.js +2 -2
- package/src/element/combinator.js +2 -2
- package/src/element/conclusion.js +7 -2
- package/src/element/constructor/bracketed.js +4 -2
- package/src/element/deduction.js +7 -2
- package/src/element/derivation.js +2 -3
- package/src/element/equality.js +45 -34
- package/src/element/frame.js +31 -21
- package/src/element/hypothesis.js +9 -6
- package/src/element/judgement.js +64 -20
- package/src/element/metavariable.js +31 -16
- package/src/element/proofAssertion/premise.js +7 -7
- package/src/element/proofAssertion/step.js +16 -10
- package/src/element/proofAssertion/supposition.js +6 -6
- package/src/element/proofAssertion.js +7 -4
- package/src/element/propertyRelation.js +8 -2
- package/src/element/reference.js +31 -21
- package/src/element/rule.js +3 -6
- package/src/element/signature.js +21 -10
- package/src/element/statement.js +14 -14
- package/src/element/subDerivation.js +2 -5
- package/src/element/subproof.js +9 -3
- package/src/element/substitution/frame.js +21 -9
- package/src/element/substitution/reference.js +20 -8
- package/src/element/substitution/statement.js +17 -9
- package/src/element/substitution/term.js +24 -8
- package/src/element/substitution.js +4 -4
- package/src/element/term.js +13 -13
- package/src/element/topLevelAssertion.js +3 -6
- package/src/element/topLevelMetaAssertion.js +3 -6
- package/src/element/variable.js +8 -4
- package/src/process/assign.js +0 -6
- package/src/process/unify.js +7 -7
- package/src/process/validate.js +23 -14
- package/src/process/verify.js +26 -17
- package/src/utilities/unification.js +4 -5
- package/src/utilities/validation.js +83 -75
package/src/element/frame.js
CHANGED
|
@@ -56,14 +56,15 @@ export default define(class Frame extends Element {
|
|
|
56
56
|
return frameNodeMatches;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
findValidFrame(context) {
|
|
60
60
|
const frameNode = this.getFrameNode(),
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
frame = context.findFrameByFrameNode(frameNode),
|
|
62
|
+
validFrame = frame; ///
|
|
63
63
|
|
|
64
|
-
return
|
|
64
|
+
return validFrame;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
|
|
67
68
|
isEqualTo(frame) {
|
|
68
69
|
const frameNode = frame.getNode(),
|
|
69
70
|
frameNodeMatches = this.matchFrameNode(frameNode),
|
|
@@ -165,29 +166,32 @@ export default define(class Frame extends Element {
|
|
|
165
166
|
return comparesToMetavariableName;
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
validate(
|
|
169
|
-
let
|
|
169
|
+
validate(stated, context) {
|
|
170
|
+
let frame = null;
|
|
170
171
|
|
|
171
172
|
const frameString = this.getString(); ///
|
|
172
173
|
|
|
173
174
|
context.trace(`Validating the '${frameString}' frame...`);
|
|
174
175
|
|
|
175
|
-
const
|
|
176
|
+
const validFrame = this.findValidFrame(context),
|
|
177
|
+
valid = (validFrame !== null);
|
|
176
178
|
|
|
177
179
|
if (valid) {
|
|
178
|
-
|
|
180
|
+
frame = validFrame; ///
|
|
179
181
|
|
|
180
182
|
context.debug(`...the '${frameString}' frame is already valid.`);
|
|
181
183
|
} else {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
+
let validates = false;
|
|
185
|
+
|
|
186
|
+
const assumptionsValidate = this.validateAssumptions(stated, context),
|
|
187
|
+
metavariablevalidates = this.validateMetavariable(stated, context);
|
|
184
188
|
|
|
185
189
|
if (assumptionsValidate && metavariablevalidates) {
|
|
186
190
|
let validatesWhenStated = false,
|
|
187
191
|
validatesWhenDerived = false;
|
|
188
192
|
|
|
189
193
|
if (stated) {
|
|
190
|
-
validatesWhenStated = this.validateWhenStated(
|
|
194
|
+
validatesWhenStated = this.validateWhenStated(context);
|
|
191
195
|
} else {
|
|
192
196
|
validatesWhenDerived = this.validateWhenDerived(context);
|
|
193
197
|
}
|
|
@@ -198,7 +202,7 @@ export default define(class Frame extends Element {
|
|
|
198
202
|
}
|
|
199
203
|
|
|
200
204
|
if (validates) {
|
|
201
|
-
|
|
205
|
+
frame = this; ///
|
|
202
206
|
|
|
203
207
|
context.addFrame(frame);
|
|
204
208
|
|
|
@@ -206,10 +210,10 @@ export default define(class Frame extends Element {
|
|
|
206
210
|
}
|
|
207
211
|
}
|
|
208
212
|
|
|
209
|
-
return
|
|
213
|
+
return frame;
|
|
210
214
|
}
|
|
211
215
|
|
|
212
|
-
validateWhenStated(
|
|
216
|
+
validateWhenStated(context) {
|
|
213
217
|
let validatesWhenStated = false;
|
|
214
218
|
|
|
215
219
|
const frameString = this.getString(); ///
|
|
@@ -247,7 +251,7 @@ export default define(class Frame extends Element {
|
|
|
247
251
|
return validatesWhenDerived;
|
|
248
252
|
}
|
|
249
253
|
|
|
250
|
-
validateAssumptions(
|
|
254
|
+
validateAssumptions(stated, context) {
|
|
251
255
|
let assumptionsValidate;
|
|
252
256
|
|
|
253
257
|
const singular = this.isSingular();
|
|
@@ -260,15 +264,21 @@ export default define(class Frame extends Element {
|
|
|
260
264
|
|
|
261
265
|
stated = true; ///
|
|
262
266
|
|
|
263
|
-
|
|
267
|
+
const assumptions = [];
|
|
264
268
|
|
|
265
269
|
assumptionsValidate = this.assumptions.every((assumption) => {
|
|
266
|
-
const
|
|
270
|
+
const assumptionValidates = assumption.validate(stated, context);
|
|
267
271
|
|
|
268
|
-
|
|
272
|
+
if (assumptionValidates) {
|
|
273
|
+
assumptions.push(assumption);
|
|
274
|
+
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
269
277
|
});
|
|
270
278
|
|
|
271
279
|
if (assumptionsValidate) {
|
|
280
|
+
this.assumptions = assumptions;
|
|
281
|
+
|
|
272
282
|
context.debug(`...validated the '${assumptionsString}' assumptions of the '${frameString}' frame.`);
|
|
273
283
|
}
|
|
274
284
|
} else {
|
|
@@ -278,7 +288,7 @@ export default define(class Frame extends Element {
|
|
|
278
288
|
return assumptionsValidate;
|
|
279
289
|
}
|
|
280
290
|
|
|
281
|
-
validateMetavariable(
|
|
291
|
+
validateMetavariable(stated, context) {
|
|
282
292
|
let metavariableValidates = false;
|
|
283
293
|
|
|
284
294
|
const singular = this.isSingular();
|
|
@@ -313,7 +323,7 @@ export default define(class Frame extends Element {
|
|
|
313
323
|
return metavariableValidates;
|
|
314
324
|
}
|
|
315
325
|
|
|
316
|
-
validateGivenMetaType(metaType,
|
|
326
|
+
validateGivenMetaType(metaType, stated, context) {
|
|
317
327
|
let validatesGivenMetaType = false;
|
|
318
328
|
|
|
319
329
|
const frameString = this.getString(), ///
|
|
@@ -324,7 +334,7 @@ export default define(class Frame extends Element {
|
|
|
324
334
|
const metaTypeName = metaType.getName();
|
|
325
335
|
|
|
326
336
|
if (metaTypeName === FRAME_META_TYPE_NAME) {
|
|
327
|
-
const validates = this.validate(
|
|
337
|
+
const validates = this.validate(stated, context)
|
|
328
338
|
|
|
329
339
|
validatesGivenMetaType = validates; ///
|
|
330
340
|
}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { Element } from "occam-languages";
|
|
4
4
|
|
|
5
|
-
import assignAssignments from "../process/assign";
|
|
6
|
-
|
|
7
5
|
import { define } from "../elements";
|
|
8
6
|
import { statementFromJSON, statementToStatementJSON } from "../utilities/json";
|
|
9
7
|
|
|
@@ -37,15 +35,20 @@ export default define(class Hypothesis extends Element {
|
|
|
37
35
|
if (false) {
|
|
38
36
|
///
|
|
39
37
|
} else if (this.statement !== null) {
|
|
38
|
+
let statementValidates = false;
|
|
39
|
+
|
|
40
40
|
const stated = true,
|
|
41
|
-
|
|
42
|
-
statementValidates = this.statement.validate(assignments, stated, context);
|
|
41
|
+
statement = this.statement.validate(stated, context);
|
|
43
42
|
|
|
44
|
-
if (
|
|
45
|
-
|
|
43
|
+
if (statement !== null) {
|
|
44
|
+
statementValidates = true;
|
|
45
|
+
}
|
|
46
46
|
|
|
47
|
+
if (statementValidates) {
|
|
47
48
|
const subproofOrProofAssertion = this; ///
|
|
48
49
|
|
|
50
|
+
context.assignAssignments();
|
|
51
|
+
|
|
49
52
|
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
50
53
|
|
|
51
54
|
verifies = true;
|
package/src/element/judgement.js
CHANGED
|
@@ -51,39 +51,41 @@ export default define(class Judgement extends Element {
|
|
|
51
51
|
return judgementNodeMatches;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
findValidJudgement(context) {
|
|
55
55
|
const judgementNode = this.getJudgementNode(),
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
judgement = context.findJudgementByJudgementNode(judgementNode),
|
|
57
|
+
validJudgemenet = judgement; ///
|
|
58
58
|
|
|
59
|
-
return
|
|
59
|
+
return validJudgemenet;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
validate(
|
|
63
|
-
let
|
|
62
|
+
validate(stated, context) {
|
|
63
|
+
let judgement = null;
|
|
64
64
|
|
|
65
65
|
const judgementString = this.getString(); ///
|
|
66
66
|
|
|
67
67
|
context.trace(`Validating the '${judgementString}' judgement...`);
|
|
68
68
|
|
|
69
|
-
const
|
|
69
|
+
const validJudgement = this.findValidJudgement(context);
|
|
70
70
|
|
|
71
|
-
if (
|
|
72
|
-
|
|
71
|
+
if (validJudgement !== null) {
|
|
72
|
+
judgement = validJudgement; ///
|
|
73
73
|
|
|
74
74
|
context.debug(`...the '${judgementString}' judgement is already valid.`);
|
|
75
75
|
} else {
|
|
76
|
-
|
|
76
|
+
let validates = false;
|
|
77
|
+
|
|
78
|
+
const frameValidates = this.validateFrame(stated, context);
|
|
77
79
|
|
|
78
80
|
if (frameValidates) {
|
|
79
|
-
const assumptionValidates = this.
|
|
81
|
+
const assumptionValidates = this.validateAssumption(stated, context);
|
|
80
82
|
|
|
81
83
|
if (assumptionValidates) {
|
|
82
84
|
let validatesWhenStated = false,
|
|
83
85
|
validatesWhenDerived = false;
|
|
84
86
|
|
|
85
87
|
if (stated) {
|
|
86
|
-
validatesWhenStated = this.validateWhenStated(
|
|
88
|
+
validatesWhenStated = this.validateWhenStated(context);
|
|
87
89
|
} else {
|
|
88
90
|
validatesWhenDerived = this.validateWhenDerived(context);
|
|
89
91
|
}
|
|
@@ -103,10 +105,56 @@ export default define(class Judgement extends Element {
|
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
return
|
|
108
|
+
return judgement;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
validateFrame(stated, context) {
|
|
112
|
+
let frameValidates = false;
|
|
113
|
+
|
|
114
|
+
const frameString = this.frame.getString(),
|
|
115
|
+
judgementString = this.getString(); ///
|
|
116
|
+
|
|
117
|
+
context.trace(`Validating the '${judgementString}' judgement's '${frameString}' frame...`);
|
|
118
|
+
|
|
119
|
+
const frame = this.frame.validate(stated, context);
|
|
120
|
+
|
|
121
|
+
if (frame !== null) {
|
|
122
|
+
this.frame = frame;
|
|
123
|
+
|
|
124
|
+
frameValidates = true;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (frameValidates) {
|
|
128
|
+
context.trace(`...validated the '${judgementString}' judgement's '${frameString}' frame.`);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return frameValidates;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
validateAssumption(stated, context) {
|
|
135
|
+
let assumptionValidates = false;
|
|
136
|
+
|
|
137
|
+
const assumptionString = this.assumption.getString(),
|
|
138
|
+
judgementString = this.getString(); ///
|
|
139
|
+
|
|
140
|
+
context.trace(`Validating the '${judgementString}' judgement's '${assumptionString}' assumption...`);
|
|
141
|
+
|
|
142
|
+
const assumption = this.assumption.validate(stated, context);
|
|
143
|
+
|
|
144
|
+
if (assumption !== null) {
|
|
145
|
+
this.assumption = assumption;
|
|
146
|
+
|
|
147
|
+
assumptionValidates = true;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (assumptionValidates) {
|
|
151
|
+
context.trace(`...validated the '${judgementString}' judgement's '${assumptionString}' assumption.`);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return assumptionValidates;
|
|
107
155
|
}
|
|
108
156
|
|
|
109
|
-
validateWhenStated(
|
|
157
|
+
validateWhenStated(context) {
|
|
110
158
|
let validatesWhenStated;
|
|
111
159
|
|
|
112
160
|
const judgementString = this.getString(); ///
|
|
@@ -146,11 +194,7 @@ export default define(class Judgement extends Element {
|
|
|
146
194
|
return validatesWhenDerived;
|
|
147
195
|
}
|
|
148
196
|
|
|
149
|
-
assign(
|
|
150
|
-
if (assignments === null) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
|
|
197
|
+
assign(stated, context) {
|
|
154
198
|
if (!stated) {
|
|
155
199
|
return;
|
|
156
200
|
}
|
|
@@ -159,7 +203,7 @@ export default define(class Judgement extends Element {
|
|
|
159
203
|
judgementAssignment = judgementAssignmentFromJudgement(judgement, context),
|
|
160
204
|
assignment = judgementAssignment; ///
|
|
161
205
|
|
|
162
|
-
|
|
206
|
+
context.addAssignment(assignment);
|
|
163
207
|
}
|
|
164
208
|
|
|
165
209
|
static name = "Judgement";
|
|
@@ -156,11 +156,15 @@ export default define(class Metavariable extends Element {
|
|
|
156
156
|
}
|
|
157
157
|
} else {
|
|
158
158
|
const { FrameSubstitution } = elements,
|
|
159
|
-
metavariable = this
|
|
160
|
-
frameSubstitution = FrameSubstitution.fromFrameAndMetavariable(frame, metavariable, context),
|
|
161
|
-
framesubstitutionValidates = frameSubstitution.validate(generalContext, specificContext);
|
|
159
|
+
metavariable = this; ///
|
|
162
160
|
|
|
163
|
-
|
|
161
|
+
let frameSubstitution;
|
|
162
|
+
|
|
163
|
+
frameSubstitution = FrameSubstitution.fromFrameAndMetavariable(frame, metavariable, context);
|
|
164
|
+
|
|
165
|
+
frameSubstitution = frameSubstitution.validate(generalContext, specificContext); ///
|
|
166
|
+
|
|
167
|
+
if (frameSubstitution !== null) {
|
|
164
168
|
frameUnifies = true;
|
|
165
169
|
}
|
|
166
170
|
}
|
|
@@ -194,10 +198,14 @@ export default define(class Metavariable extends Element {
|
|
|
194
198
|
statementUnifies = true;
|
|
195
199
|
} else {
|
|
196
200
|
const metavariableName = metavariable.getName(),
|
|
197
|
-
substitutionPresent =
|
|
201
|
+
substitutionPresent = (substitution !== null) ?
|
|
202
|
+
context.isSubstitutionPresentByMetavariableNameAndSubstitution(metavariableName, substitution) :
|
|
203
|
+
context.findSubstitutionByMetavariableName(metavariableName);
|
|
198
204
|
|
|
199
205
|
if (substitutionPresent) {
|
|
200
|
-
substitution =
|
|
206
|
+
substitution = (substitution !== null) ?
|
|
207
|
+
context.findSubstitutionByMetavariableNameAndSubstitution(metavariableName, substitution) :
|
|
208
|
+
context.findSubstitutionByMetavariableName(metavariableName);
|
|
201
209
|
|
|
202
210
|
const substitutionComparesToStatement = substitution.compareStatement(statement, context);
|
|
203
211
|
|
|
@@ -205,10 +213,13 @@ export default define(class Metavariable extends Element {
|
|
|
205
213
|
statementUnifies = true;
|
|
206
214
|
}
|
|
207
215
|
} else {
|
|
208
|
-
const { StatementSubstitution } = elements
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
216
|
+
const { StatementSubstitution } = elements;
|
|
217
|
+
|
|
218
|
+
let statementSubstitution;
|
|
219
|
+
|
|
220
|
+
statementSubstitution = (substitution !== null) ?
|
|
221
|
+
StatementSubstitution.fromStatementMetavariableAndSubstitution(statement, metavariable, substitution, context) :
|
|
222
|
+
StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, context);
|
|
212
223
|
|
|
213
224
|
if (substitution !== null) {
|
|
214
225
|
const context = generalContext; ///
|
|
@@ -218,9 +229,9 @@ export default define(class Metavariable extends Element {
|
|
|
218
229
|
substitution.setContext(context);
|
|
219
230
|
}
|
|
220
231
|
|
|
221
|
-
|
|
232
|
+
statementSubstitution = statementSubstitution.validate(generalContext, specificContext); ///
|
|
222
233
|
|
|
223
|
-
if (
|
|
234
|
+
if (statementSubstitution !== null) {
|
|
224
235
|
statementUnifies = true;
|
|
225
236
|
}
|
|
226
237
|
}
|
|
@@ -260,11 +271,15 @@ export default define(class Metavariable extends Element {
|
|
|
260
271
|
}
|
|
261
272
|
} else {
|
|
262
273
|
const { ReferenceSubstitution } = elements,
|
|
263
|
-
metavariable = this
|
|
264
|
-
|
|
265
|
-
|
|
274
|
+
metavariable = this; ///
|
|
275
|
+
|
|
276
|
+
let referenceSubstitution;
|
|
277
|
+
|
|
278
|
+
referenceSubstitution = ReferenceSubstitution.fromReferenceAndMetavariable(reference, metavariable, context);
|
|
279
|
+
|
|
280
|
+
referenceSubstitution = referenceSubstitution.validate(generalContext, specificContext); ///
|
|
266
281
|
|
|
267
|
-
if (
|
|
282
|
+
if (referenceSubstitution !== null) {
|
|
268
283
|
referenceUnifies = true;
|
|
269
284
|
|
|
270
285
|
}
|
|
@@ -30,7 +30,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
30
30
|
return stated;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
validate(
|
|
33
|
+
validate(context) {
|
|
34
34
|
let validates = false;
|
|
35
35
|
|
|
36
36
|
const premiseString = this.getString(); ///
|
|
@@ -43,13 +43,13 @@ export default define(class Premise extends ProofAssertion {
|
|
|
43
43
|
if (false) {
|
|
44
44
|
///
|
|
45
45
|
} else if (statement !== null) {
|
|
46
|
-
const statementValidates = this.validateStatement(
|
|
46
|
+
const statementValidates = this.validateStatement(context);
|
|
47
47
|
|
|
48
48
|
if (statementValidates) {
|
|
49
49
|
validates = true;
|
|
50
50
|
}
|
|
51
51
|
} else if (procedureCall !== null) {
|
|
52
|
-
const procedureCallValidates = this.validateProcedureCall(
|
|
52
|
+
const procedureCallValidates = this.validateProcedureCall(context);
|
|
53
53
|
|
|
54
54
|
if (procedureCallValidates) {
|
|
55
55
|
validates = true;
|
|
@@ -65,7 +65,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
65
65
|
return validates;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
validateProcedureCall(
|
|
68
|
+
validateProcedureCall(context) {
|
|
69
69
|
let procedureCallValidates = false;
|
|
70
70
|
|
|
71
71
|
const premiseString = this.getString(), ///
|
|
@@ -182,7 +182,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
182
182
|
if (assertion !== null) {
|
|
183
183
|
const subproofAssertion = assertion; ///
|
|
184
184
|
|
|
185
|
-
subproofUnifies = subproofAssertion.unifySubproof(subproof,
|
|
185
|
+
subproofUnifies = subproofAssertion.unifySubproof(subproof, generalContext, specificContext);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
}
|
|
@@ -194,7 +194,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
194
194
|
return subproofUnifies;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
async verify(
|
|
197
|
+
async verify(context) {
|
|
198
198
|
let verifies = false;
|
|
199
199
|
|
|
200
200
|
await this.break(context);
|
|
@@ -204,7 +204,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
204
204
|
context.trace(`Verifying the '${premiseString}' premise...`);
|
|
205
205
|
|
|
206
206
|
attempt((context) => {
|
|
207
|
-
const validates = this.validate(
|
|
207
|
+
const validates = this.validate(context);
|
|
208
208
|
|
|
209
209
|
if (validates) {
|
|
210
210
|
this.setContext(context);
|
|
@@ -66,7 +66,7 @@ export default define(class Step extends ProofAssertion {
|
|
|
66
66
|
return comparesToTermAndPropertyRelation;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
validate(
|
|
69
|
+
validate(context) {
|
|
70
70
|
let validates = false;
|
|
71
71
|
|
|
72
72
|
const stepString = this.getString(); ///
|
|
@@ -82,7 +82,7 @@ export default define(class Step extends ProofAssertion {
|
|
|
82
82
|
const satisfiesAssertioValidates = this.validateSatisfiesAssertion(context);
|
|
83
83
|
|
|
84
84
|
if (satisfiesAssertioValidates) {
|
|
85
|
-
const statementValidates = this.validateStatement(
|
|
85
|
+
const statementValidates = this.validateStatement(context);
|
|
86
86
|
|
|
87
87
|
if (statementValidates) {
|
|
88
88
|
validates = true;
|
|
@@ -109,7 +109,11 @@ export default define(class Step extends ProofAssertion {
|
|
|
109
109
|
|
|
110
110
|
context.trace(`Validating the '${stepString}' step's '${referenceString}' reference... `);
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
const reference = this.reference.validate(context);
|
|
113
|
+
|
|
114
|
+
if (reference === null) {
|
|
115
|
+
referenceValidates = false;
|
|
116
|
+
}
|
|
113
117
|
|
|
114
118
|
if (referenceValidates) {
|
|
115
119
|
context.debug(`...validated the '${stepString}' step's '${referenceString}' reference. `);
|
|
@@ -124,17 +128,19 @@ export default define(class Step extends ProofAssertion {
|
|
|
124
128
|
|
|
125
129
|
if (this.satisfiesAssertion !== null) {
|
|
126
130
|
const stepString = this.getString(), ///
|
|
127
|
-
|
|
131
|
+
satisfiesAssertionString = this.satisfiesAssertion.getString();
|
|
128
132
|
|
|
129
|
-
context.trace(`Validating the '${stepString}' step's '${
|
|
133
|
+
context.trace(`Validating the '${stepString}' step's '${satisfiesAssertionString}' satisfies assertion... `);
|
|
130
134
|
|
|
131
135
|
const stated = true,
|
|
132
|
-
|
|
136
|
+
satisfiesAssertion = this.satisfiesAssertion.validate(stated, context);
|
|
133
137
|
|
|
134
|
-
|
|
138
|
+
if (satisfiesAssertion !== null) {
|
|
139
|
+
satisfiesAssertionValidates = true;
|
|
140
|
+
}
|
|
135
141
|
|
|
136
142
|
if (satisfiesAssertionValidates) {
|
|
137
|
-
context.debug(`...validating the '${stepString}' step's '${
|
|
143
|
+
context.debug(`...validating the '${stepString}' step's '${satisfiesAssertionString}' satisfies assertion. `);
|
|
138
144
|
}
|
|
139
145
|
}
|
|
140
146
|
|
|
@@ -173,7 +179,7 @@ export default define(class Step extends ProofAssertion {
|
|
|
173
179
|
return unifiesWithSatisfiesAssertion;
|
|
174
180
|
}
|
|
175
181
|
|
|
176
|
-
async verify(
|
|
182
|
+
async verify(context) {
|
|
177
183
|
let verifies = false;
|
|
178
184
|
|
|
179
185
|
await this.break(context);
|
|
@@ -183,7 +189,7 @@ export default define(class Step extends ProofAssertion {
|
|
|
183
189
|
context.trace(`Verifying the '${stepString}' step...`);
|
|
184
190
|
|
|
185
191
|
await asyncAttempt(async (context) => {
|
|
186
|
-
const validates = this.validate(
|
|
192
|
+
const validates = this.validate(context);
|
|
187
193
|
|
|
188
194
|
if (validates) {
|
|
189
195
|
const unifies = await this.unify(context);
|
|
@@ -30,7 +30,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
30
30
|
return stated;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
validate(
|
|
33
|
+
validate(context) {
|
|
34
34
|
let validates = false;
|
|
35
35
|
|
|
36
36
|
const suppositionString = this.getString(); ///
|
|
@@ -43,13 +43,13 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
43
43
|
if (false) {
|
|
44
44
|
///
|
|
45
45
|
} else if (statement !== null) {
|
|
46
|
-
const statementValidates = this.validateStatement(
|
|
46
|
+
const statementValidates = this.validateStatement(context);
|
|
47
47
|
|
|
48
48
|
if (statementValidates) {
|
|
49
49
|
validates = true;
|
|
50
50
|
}
|
|
51
51
|
} else if (procedureCall !== null) {
|
|
52
|
-
const procedureCallValidates = this.validateProcedureCall(
|
|
52
|
+
const procedureCallValidates = this.validateProcedureCall(context);
|
|
53
53
|
|
|
54
54
|
if (procedureCallValidates) {
|
|
55
55
|
validates = true;
|
|
@@ -65,7 +65,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
65
65
|
return validates;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
validateProcedureCall(
|
|
68
|
+
validateProcedureCall(context) {
|
|
69
69
|
let procedureCallValidates = false;
|
|
70
70
|
|
|
71
71
|
const suppositionString = this.getString(), ///
|
|
@@ -216,7 +216,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
216
216
|
return subproofUnifies;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
async verify(
|
|
219
|
+
async verify(context) {
|
|
220
220
|
let verifies = false;
|
|
221
221
|
|
|
222
222
|
await this.break(context);
|
|
@@ -226,7 +226,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
226
226
|
context.trace(`Verifying the '${suppositionString}' supposition...`);
|
|
227
227
|
|
|
228
228
|
attempt((context) => {
|
|
229
|
-
const validates = this.validate(
|
|
229
|
+
const validates = this.validate(context);
|
|
230
230
|
|
|
231
231
|
if (validates) {
|
|
232
232
|
this.setContext(context);
|
|
@@ -53,17 +53,20 @@ export default class ProofAssertion extends Element {
|
|
|
53
53
|
return comparesToStatement;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
validateStatement(
|
|
57
|
-
let statementValidates;
|
|
56
|
+
validateStatement(context) {
|
|
57
|
+
let statementValidates = false;
|
|
58
58
|
|
|
59
59
|
const statementString = this.statement.getString(),
|
|
60
60
|
proofAssertionString = this.getString(); ///
|
|
61
61
|
|
|
62
62
|
context.trace(`Validating the '${proofAssertionString}' proof assertion's '${statementString}' statement... `);
|
|
63
63
|
|
|
64
|
-
const stated = this.isStated()
|
|
64
|
+
const stated = this.isStated(),
|
|
65
|
+
statement = this.statement.validate(stated, context);
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
if (statement !== null) {
|
|
68
|
+
statementValidates = true;
|
|
69
|
+
}
|
|
67
70
|
|
|
68
71
|
if (statementValidates) {
|
|
69
72
|
context.debug(`...validated the '${proofAssertionString}' proof assertion's '${statementString}' statement. `);
|
|
@@ -50,18 +50,24 @@ export default define(class PropertyRelation extends Element {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
validateTerm(context) {
|
|
53
|
-
let termValidates;
|
|
53
|
+
let termValidates = false;
|
|
54
54
|
|
|
55
55
|
const termString = this.term.getString();
|
|
56
56
|
|
|
57
57
|
context.trace(`Validating the '${termString}' term...`);
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
const term = this.term.validate(context, () => {
|
|
60
60
|
const validatesForwards = true;
|
|
61
61
|
|
|
62
62
|
return validatesForwards;
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
+
if (term !== null) {
|
|
66
|
+
this.term = term;
|
|
67
|
+
|
|
68
|
+
termValidates = true;
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
if (termValidates) {
|
|
66
72
|
context.debug(`...validated the '${termString}' term.`);
|
|
67
73
|
}
|