occam-verify-cli 1.0.220 → 1.0.224
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.js +19 -19
- package/lib/context/local.js +5 -43
- package/lib/context/release.js +11 -11
- package/lib/dom/assertion/contained.js +44 -44
- package/lib/dom/assertion/defined.js +40 -40
- package/lib/dom/assertion/property.js +37 -35
- package/lib/dom/assertion/satisfies.js +26 -25
- package/lib/dom/assertion/subproof.js +16 -16
- package/lib/dom/assertion/type.js +34 -32
- package/lib/dom/axiom.js +52 -52
- package/lib/dom/combinator/bracketed.js +5 -5
- package/lib/dom/combinator.js +6 -6
- package/lib/dom/conclusion.js +10 -10
- package/lib/dom/conjecture.js +5 -5
- package/lib/dom/constructor/bracketed.js +12 -12
- package/lib/dom/constructor.js +9 -9
- package/lib/dom/declaration/combinator.js +11 -11
- package/lib/dom/declaration/complexType.js +133 -63
- package/lib/dom/declaration/constructor.js +17 -17
- package/lib/dom/declaration/metavariable.js +17 -17
- package/lib/dom/declaration/simpleType.js +229 -0
- package/lib/dom/declaration/variable.js +17 -17
- package/lib/dom/declaration.js +54 -52
- package/lib/dom/deduction.js +15 -15
- package/lib/dom/derivation.js +8 -8
- package/lib/dom/equality.js +49 -34
- package/lib/dom/error.js +3 -3
- package/lib/dom/frame.js +38 -38
- package/lib/dom/judgement.js +31 -29
- package/lib/dom/label.js +5 -5
- package/lib/dom/lemma.js +5 -5
- package/lib/dom/metaLemma.js +5 -5
- package/lib/dom/metatheorem.js +5 -5
- package/lib/dom/metavariable.js +55 -55
- package/lib/dom/premise.js +36 -34
- package/lib/dom/procedureCall.js +9 -9
- package/lib/dom/proof.js +6 -6
- package/lib/dom/propertyRelation.js +18 -18
- package/lib/dom/reference.js +28 -28
- package/lib/dom/rule.js +63 -48
- package/lib/dom/signature.js +17 -17
- package/lib/dom/statement.js +36 -36
- package/lib/dom/step.js +32 -35
- package/lib/dom/subDerivation.js +8 -8
- package/lib/dom/subproof.js +27 -30
- package/lib/dom/substitution/statement.js +7 -7
- package/lib/dom/substitution/term.js +2 -16
- package/lib/dom/substitution.js +1 -15
- package/lib/dom/supposition.js +39 -39
- package/lib/dom/term.js +15 -15
- package/lib/dom/theorem.js +5 -5
- package/lib/dom/topLevelAssertion.js +60 -71
- package/lib/dom/topLevelMetaAssertion.js +28 -20
- package/lib/dom/type.js +18 -24
- package/lib/dom/variable.js +16 -16
- package/lib/equivalence.js +54 -33
- package/lib/equivalences.js +57 -101
- package/lib/index.js +2 -2
- package/lib/mixins/statement/verify.js +52 -52
- package/lib/mixins/step/unify.js +79 -61
- package/lib/mixins/term/verify.js +17 -17
- package/lib/substitutions.js +7 -7
- package/lib/unifier/equantional.js +170 -0
- package/lib/unifier/intrinsicLevel.js +8 -8
- package/lib/unifier/metaLevel.js +21 -21
- package/lib/unifier/metavariable.js +9 -9
- package/lib/unifier/statementWithCombinator.js +18 -18
- package/lib/unifier/termWithConstructor.js +10 -10
- package/lib/unifier.js +41 -41
- package/lib/utilities/brackets.js +2 -2
- package/lib/utilities/release.js +18 -17
- package/lib/utilities/subproof.js +2 -2
- package/lib/utilities/type.js +2 -2
- package/lib/utilities/unification.js +28 -34
- package/lib/verifier/combinator.js +14 -14
- package/lib/verifier/constructor.js +18 -18
- package/lib/verifier/topLevel.js +38 -38
- package/lib/verifier.js +30 -30
- package/package.json +1 -1
- package/src/context/file.js +18 -18
- package/src/context/local.js +5 -48
- package/src/context/release.js +11 -11
- package/src/dom/assertion/contained.js +46 -46
- package/src/dom/assertion/defined.js +41 -41
- package/src/dom/assertion/property.js +37 -35
- package/src/dom/assertion/satisfies.js +26 -25
- package/src/dom/assertion/subproof.js +15 -15
- package/src/dom/assertion/type.js +34 -32
- package/src/dom/axiom.js +56 -54
- package/src/dom/combinator/bracketed.js +4 -4
- package/src/dom/combinator.js +5 -5
- package/src/dom/conclusion.js +9 -9
- package/src/dom/conjecture.js +4 -4
- package/src/dom/constructor/bracketed.js +11 -11
- package/src/dom/constructor.js +8 -8
- package/src/dom/declaration/combinator.js +10 -10
- package/src/dom/declaration/complexType.js +129 -64
- package/src/dom/declaration/constructor.js +16 -16
- package/src/dom/declaration/metavariable.js +16 -16
- package/src/dom/declaration/simpleType.js +179 -0
- package/src/dom/declaration/variable.js +16 -16
- package/src/dom/declaration.js +54 -52
- package/src/dom/deduction.js +14 -14
- package/src/dom/derivation.js +7 -7
- package/src/dom/equality.js +55 -38
- package/src/dom/error.js +2 -2
- package/src/dom/frame.js +38 -38
- package/src/dom/judgement.js +31 -29
- package/src/dom/label.js +4 -4
- package/src/dom/lemma.js +4 -4
- package/src/dom/metaLemma.js +4 -4
- package/src/dom/metatheorem.js +4 -4
- package/src/dom/metavariable.js +54 -54
- package/src/dom/premise.js +35 -33
- package/src/dom/procedureCall.js +8 -8
- package/src/dom/proof.js +5 -5
- package/src/dom/propertyRelation.js +17 -17
- package/src/dom/reference.js +27 -27
- package/src/dom/rule.js +72 -49
- package/src/dom/signature.js +15 -15
- package/src/dom/statement.js +34 -34
- package/src/dom/step.js +42 -48
- package/src/dom/subDerivation.js +7 -7
- package/src/dom/subproof.js +30 -40
- package/src/dom/substitution/statement.js +6 -6
- package/src/dom/substitution/term.js +1 -19
- package/src/dom/substitution.js +0 -13
- package/src/dom/supposition.js +38 -38
- package/src/dom/term.js +14 -14
- package/src/dom/theorem.js +4 -4
- package/src/dom/topLevelAssertion.js +62 -81
- package/src/dom/topLevelMetaAssertion.js +35 -20
- package/src/dom/type.js +23 -33
- package/src/dom/variable.js +16 -15
- package/src/equivalence.js +69 -46
- package/src/equivalences.js +53 -115
- package/src/index.js +1 -1
- package/src/mixins/statement/verify.js +51 -51
- package/src/mixins/step/unify.js +88 -67
- package/src/mixins/term/verify.js +16 -16
- package/src/substitutions.js +5 -6
- package/src/unifier/equantional.js +90 -0
- package/src/unifier/intrinsicLevel.js +7 -7
- package/src/unifier/metaLevel.js +20 -21
- package/src/unifier/metavariable.js +8 -8
- package/src/unifier/statementWithCombinator.js +17 -17
- package/src/unifier/termWithConstructor.js +9 -9
- package/src/unifier.js +40 -40
- package/src/utilities/brackets.js +1 -1
- package/src/utilities/release.js +18 -18
- package/src/utilities/subproof.js +1 -1
- package/src/utilities/type.js +1 -1
- package/src/utilities/unification.js +27 -37
- package/src/verifier/combinator.js +13 -13
- package/src/verifier/constructor.js +17 -17
- package/src/verifier/topLevel.js +41 -41
- package/src/verifier.js +29 -29
- package/lib/dom/declaration/type.js +0 -209
- package/lib/unifier/equality.js +0 -155
- package/src/dom/declaration/type.js +0 -150
- package/src/unifier/equality.js +0 -70
package/src/context/release.js
CHANGED
|
@@ -447,20 +447,20 @@ export default class ReleaseContext {
|
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
verify() {
|
|
450
|
-
let
|
|
450
|
+
let verifies = false;
|
|
451
451
|
|
|
452
452
|
const verifiedFileContexts = [],
|
|
453
|
-
|
|
453
|
+
fileContextsVerify = verifyFileContexts(this.fileContexts, verifiedFileContexts);
|
|
454
454
|
|
|
455
|
-
if (
|
|
455
|
+
if (fileContextsVerify) {
|
|
456
456
|
this.fileContexts = verifiedFileContexts; ///
|
|
457
457
|
|
|
458
458
|
this.verified = true;
|
|
459
459
|
|
|
460
|
-
|
|
460
|
+
verifies = true;
|
|
461
461
|
}
|
|
462
462
|
|
|
463
|
-
return
|
|
463
|
+
return verifies;
|
|
464
464
|
}
|
|
465
465
|
|
|
466
466
|
toJSON() {
|
|
@@ -477,12 +477,12 @@ export default class ReleaseContext {
|
|
|
477
477
|
static fromLogNameJSONAndEntries(log, name, json, entries) {
|
|
478
478
|
const lexer = null,
|
|
479
479
|
parser = null,
|
|
480
|
-
|
|
480
|
+
verifies = false,
|
|
481
481
|
initialised = false,
|
|
482
482
|
fileContexts = [],
|
|
483
483
|
customGrammar = customGrammarFromNameAndEntries(name, entries),
|
|
484
484
|
dependencyReleaseContexts = null,
|
|
485
|
-
releaseContext = new ReleaseContext(log, name, json, entries, lexer, parser,
|
|
485
|
+
releaseContext = new ReleaseContext(log, name, json, entries, lexer, parser, verifies, initialised, fileContexts, customGrammar, dependencyReleaseContexts);
|
|
486
486
|
|
|
487
487
|
return releaseContext;
|
|
488
488
|
}
|
|
@@ -490,15 +490,15 @@ export default class ReleaseContext {
|
|
|
490
490
|
|
|
491
491
|
function verifyFileContexts(fileContexts, verifiedFileContexts) {
|
|
492
492
|
const resolved = resolve(fileContexts, verifiedFileContexts, (fileContext) => {
|
|
493
|
-
const
|
|
493
|
+
const fileContextVerifies = fileContext.verify();
|
|
494
494
|
|
|
495
|
-
if (
|
|
495
|
+
if (fileContextVerifies) {
|
|
496
496
|
return true;
|
|
497
497
|
}
|
|
498
498
|
}),
|
|
499
|
-
|
|
499
|
+
fileContextsVerify = resolved; ///
|
|
500
500
|
|
|
501
|
-
return
|
|
501
|
+
return fileContextsVerify;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
504
|
function fileContextsFromJSON(json,fileContexts, releaseContext) {
|
|
@@ -46,40 +46,40 @@ export default domAssigned(class ContainedAssertion {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
verify(assignments, stated, context) {
|
|
49
|
-
let
|
|
49
|
+
let verifies = false;
|
|
50
50
|
|
|
51
51
|
const containedAssertionString = this.string; ///
|
|
52
52
|
|
|
53
53
|
context.trace(`Verifying the '${containedAssertionString}' contained assertion...`);
|
|
54
54
|
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
const termVerifies = this.verifyTerm(assignments, stated, context),
|
|
56
|
+
frameVerifies = this.verifyFrame(assignments, stated, context),
|
|
57
|
+
statementVerifies = this.verifyStatement(assignments, stated, context)
|
|
58
58
|
|
|
59
|
-
if (
|
|
60
|
-
let
|
|
61
|
-
|
|
59
|
+
if (termVerifies || frameVerifies || statementVerifies) {
|
|
60
|
+
let verifiesWhenStated = false,
|
|
61
|
+
verifiesWhenDerived = false;
|
|
62
62
|
|
|
63
63
|
if (stated) {
|
|
64
|
-
|
|
64
|
+
verifiesWhenStated = this.verifyWhenStated(assignments, context);
|
|
65
65
|
} else {
|
|
66
|
-
|
|
66
|
+
verifiesWhenDerived = this.verifyWhenDerived(context);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
if (
|
|
70
|
-
|
|
69
|
+
if (verifiesWhenStated || verifiesWhenDerived) {
|
|
70
|
+
verifies = true;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
if (
|
|
74
|
+
if (verifies) {
|
|
75
75
|
context.debug(`...verified the '${containedAssertionString}' contained assertion.`);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
return
|
|
78
|
+
return verifies;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
verifyTerm(assignments, stated, context) {
|
|
82
|
-
let
|
|
82
|
+
let termVerifies = false;
|
|
83
83
|
|
|
84
84
|
if (this.term !== null) {
|
|
85
85
|
const termString = this.term.getString();
|
|
@@ -91,23 +91,23 @@ export default domAssigned(class ContainedAssertion {
|
|
|
91
91
|
if (!termSimple) {
|
|
92
92
|
context.debug(`The '${termString}' term is not simple.`);
|
|
93
93
|
} else {
|
|
94
|
-
|
|
95
|
-
const
|
|
94
|
+
termVerifies = this.term.verify(context, () => {
|
|
95
|
+
const verifiesAhead = true;
|
|
96
96
|
|
|
97
|
-
return
|
|
97
|
+
return verifiesAhead;
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
if (
|
|
100
|
+
if (termVerifies) {
|
|
101
101
|
context.debug(`...verified the '${termString}' term.`);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
return
|
|
106
|
+
return termVerifies;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
verifyFrame(assignments, stated, context) {
|
|
110
|
-
let
|
|
110
|
+
let frameVerifies = false;
|
|
111
111
|
|
|
112
112
|
if (this.frame !== null) {
|
|
113
113
|
const frameString = this.frame.getString();
|
|
@@ -123,19 +123,19 @@ export default domAssigned(class ContainedAssertion {
|
|
|
123
123
|
|
|
124
124
|
assignments = null; ///
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
frameVerifies = this.frame.verify(assignments, stated, context);
|
|
127
127
|
|
|
128
|
-
if (
|
|
128
|
+
if (frameVerifies) {
|
|
129
129
|
context.debug(`...verified the '${frameString}' frame.`);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
return
|
|
134
|
+
return frameVerifies;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
verifyStatement(assignments, stated, context) {
|
|
138
|
-
let
|
|
138
|
+
let statementVerifies = false;
|
|
139
139
|
|
|
140
140
|
if (this.statement !== null) {
|
|
141
141
|
const statementString = this.statement.getString();
|
|
@@ -146,50 +146,50 @@ export default domAssigned(class ContainedAssertion {
|
|
|
146
146
|
|
|
147
147
|
assignments = null; ///
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
statementVerifies = this.statement.verify(assignments, stated, context);
|
|
150
150
|
|
|
151
|
-
if (
|
|
151
|
+
if (statementVerifies) {
|
|
152
152
|
context.debug(`...verified the '${statementString}' statement.`);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
return
|
|
156
|
+
return statementVerifies;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
verifyWhenStated(assignments, context) {
|
|
160
|
-
let
|
|
160
|
+
let verifiesWhenStated;
|
|
161
161
|
|
|
162
162
|
const containedAssertionString = this.string; ///
|
|
163
163
|
|
|
164
164
|
context.trace(`Verifying the '${containedAssertionString}' stated contained assertion...`);
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
verifiesWhenStated = true;
|
|
167
167
|
|
|
168
|
-
if (
|
|
168
|
+
if (verifiesWhenStated) {
|
|
169
169
|
context.debug(`...verified the '${containedAssertionString}' stated contained assertion.`);
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
return
|
|
172
|
+
return verifiesWhenStated;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
verifyWhenDerived(context) {
|
|
176
|
-
let
|
|
176
|
+
let verifiesWhenDerived;
|
|
177
177
|
|
|
178
178
|
const containedAssertionString = this.string; ///
|
|
179
179
|
|
|
180
180
|
context.trace(`Verifying the '${containedAssertionString}' derived contained assertion...`);
|
|
181
181
|
|
|
182
|
-
|
|
182
|
+
verifiesWhenDerived = verifyWhenDerived(this.term, this.frame, this.statement, this.negated, context);
|
|
183
183
|
|
|
184
|
-
if (
|
|
184
|
+
if (verifiesWhenDerived) {
|
|
185
185
|
context.debug(`...verified the '${containedAssertionString}' derived contained assertion.`);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
return
|
|
188
|
+
return verifiesWhenDerived;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
unifyIndependently(substitutions, context) {
|
|
192
|
-
let
|
|
192
|
+
let unifiesIndependently;
|
|
193
193
|
|
|
194
194
|
const containedAssertionString = this.string; ///
|
|
195
195
|
|
|
@@ -202,15 +202,15 @@ export default domAssigned(class ContainedAssertion {
|
|
|
202
202
|
const term = termFromTermAndSubstitutions(this.term, substitutions, context),
|
|
203
203
|
frame = frameFromFrameAndSubstitutions(this.frame, substitutions, context),
|
|
204
204
|
statement = statementFromStatementAndSubstitutions(this.statement, substitutions, context),
|
|
205
|
-
|
|
205
|
+
verifiesWhenDerived = verifyWhenDerived(term, frame, statement, this.negated, context);
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
unifiesIndependently = verifiesWhenDerived; ///
|
|
208
208
|
|
|
209
|
-
if (
|
|
209
|
+
if (unifiesIndependently) {
|
|
210
210
|
context.debug(`...unified the '${containedAssertionString}' contained assertion independently.`);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
return
|
|
213
|
+
return unifiesIndependently;
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
static name = "ContainedAssertion";
|
|
@@ -238,18 +238,18 @@ export default domAssigned(class ContainedAssertion {
|
|
|
238
238
|
});
|
|
239
239
|
|
|
240
240
|
function verifyWhenDerived(term, frame, statement, negated, context) {
|
|
241
|
-
let
|
|
241
|
+
let verifiesWhenDerived = false;
|
|
242
242
|
|
|
243
243
|
if (statement !== null) {
|
|
244
244
|
if (term !== null) {
|
|
245
245
|
const termContained = statement.isTermContained(term, context);
|
|
246
246
|
|
|
247
247
|
if (!negated && termContained) {
|
|
248
|
-
|
|
248
|
+
verifiesWhenDerived = true;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
if (negated && !termContained) {
|
|
252
|
-
|
|
252
|
+
verifiesWhenDerived = true;
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
|
|
@@ -257,14 +257,14 @@ function verifyWhenDerived(term, frame, statement, negated, context) {
|
|
|
257
257
|
const frameContained = statement.isFrameContained(frame, context);
|
|
258
258
|
|
|
259
259
|
if (!negated && frameContained) {
|
|
260
|
-
|
|
260
|
+
verifiesWhenDerived = true;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
if (negated && !frameContained) {
|
|
264
|
-
|
|
264
|
+
verifiesWhenDerived = true;
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
return
|
|
269
|
+
return verifiesWhenDerived;
|
|
270
270
|
}
|
|
@@ -41,39 +41,39 @@ export default domAssigned(class DefinedAssertion {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
verify(assignments, stated, context) {
|
|
44
|
-
let
|
|
44
|
+
let verifies = false;
|
|
45
45
|
|
|
46
46
|
const definedAssertionString = this.string; ///
|
|
47
47
|
|
|
48
48
|
context.trace(`Verifying the '${definedAssertionString}' defined assertion...`);
|
|
49
49
|
|
|
50
|
-
const
|
|
51
|
-
|
|
50
|
+
const termVerifies = this.verifyTerm(assignments, stated, context),
|
|
51
|
+
frameVerifies = this.verifyFrame(assignments, stated, context);
|
|
52
52
|
|
|
53
|
-
if (
|
|
54
|
-
let
|
|
55
|
-
|
|
53
|
+
if (termVerifies || frameVerifies) {
|
|
54
|
+
let verifiesWhenStated = false,
|
|
55
|
+
verifiesWhenDerived = false;
|
|
56
56
|
|
|
57
57
|
if (stated) {
|
|
58
|
-
|
|
58
|
+
verifiesWhenStated = this.verifyWhenStated(assignments, context);
|
|
59
59
|
} else {
|
|
60
|
-
|
|
60
|
+
verifiesWhenDerived = this.verifyWhenDerived(context);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
if (
|
|
64
|
-
|
|
63
|
+
if (verifiesWhenStated || verifiesWhenDerived) {
|
|
64
|
+
verifies = true;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
if (
|
|
68
|
+
if (verifies) {
|
|
69
69
|
context.debug(`...verified the '${definedAssertionString}' defined assertion.`);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
return
|
|
72
|
+
return verifies;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
verifyTerm(assignments, stated, context) {
|
|
76
|
-
let
|
|
76
|
+
let termVerifies = false;
|
|
77
77
|
|
|
78
78
|
if (this.term !== null) {
|
|
79
79
|
const termString = this.term.getString(); ///
|
|
@@ -85,23 +85,23 @@ export default domAssigned(class DefinedAssertion {
|
|
|
85
85
|
if (!termSimple) {
|
|
86
86
|
context.debug(`The '${termString}' term is not simple.`);
|
|
87
87
|
} else {
|
|
88
|
-
|
|
89
|
-
const
|
|
88
|
+
termVerifies = this.term.verify(context, () => {
|
|
89
|
+
const verifiesAhead = true;
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return verifiesAhead;
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
-
if (
|
|
94
|
+
if (termVerifies) {
|
|
95
95
|
context.debug(`...verified the '${termString}' term.`);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
return
|
|
100
|
+
return termVerifies;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
verifyFrame(assignments, stated, context) {
|
|
104
|
-
let
|
|
104
|
+
let frameVerifies = false;
|
|
105
105
|
|
|
106
106
|
if (this.frame !== null) {
|
|
107
107
|
const frameString = this.frame.getString(); ///
|
|
@@ -117,51 +117,51 @@ export default domAssigned(class DefinedAssertion {
|
|
|
117
117
|
|
|
118
118
|
assignments = null; ///
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
frameVerifies = this.frame.verify(assignments, stated, context);
|
|
121
121
|
|
|
122
|
-
if (
|
|
122
|
+
if (frameVerifies) {
|
|
123
123
|
context.debug(`...verified the '${frameString}' frame.`);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
return
|
|
128
|
+
return frameVerifies;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
verifyWhenStated(assignments, context) {
|
|
132
|
-
let
|
|
132
|
+
let verifiesWhenStated;
|
|
133
133
|
|
|
134
134
|
const definedAssertionString = this.string; ///
|
|
135
135
|
|
|
136
136
|
context.trace(`Verifying the '${definedAssertionString}' stated defined assertion...`);
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
verifiesWhenStated = true;
|
|
139
139
|
|
|
140
|
-
if (
|
|
140
|
+
if (verifiesWhenStated) {
|
|
141
141
|
context.debug(`...verified the '${definedAssertionString}' stated defined assertion.`);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
return
|
|
144
|
+
return verifiesWhenStated;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
verifyWhenDerived(context) {
|
|
148
|
-
let
|
|
148
|
+
let verifiesWhenDerived;
|
|
149
149
|
|
|
150
150
|
const definedAssertionString = this.string; ///
|
|
151
151
|
|
|
152
152
|
context.trace(`Verifying the '${definedAssertionString}' derived defined assertion...`);
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
verifiesWhenDerived = verifyWhenDerived(this.term, this.frame, this.negated, context);
|
|
155
155
|
|
|
156
|
-
if (
|
|
156
|
+
if (verifiesWhenDerived) {
|
|
157
157
|
context.debug(`...verified the '${definedAssertionString}' derived defined assertion.`);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
return
|
|
160
|
+
return verifiesWhenDerived;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
unifyIndependently(substitutions, context) {
|
|
164
|
-
let
|
|
164
|
+
let unifiesIndependently;
|
|
165
165
|
|
|
166
166
|
const definedAssertionString = this.string; ///
|
|
167
167
|
|
|
@@ -173,15 +173,15 @@ export default domAssigned(class DefinedAssertion {
|
|
|
173
173
|
|
|
174
174
|
const term = termFromTermAndSubstitutions(this.term, substitutions, context),
|
|
175
175
|
frame = frameFromFrameAndSubstitutions(this.frame, substitutions, context),
|
|
176
|
-
|
|
176
|
+
verifiesWhenDerived = verifyWhenDerived(term, frame, this.negated, context);
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
unifiesIndependently = verifiesWhenDerived; ///
|
|
179
179
|
|
|
180
|
-
if (
|
|
180
|
+
if (unifiesIndependently) {
|
|
181
181
|
context.debug(`...unified the '${definedAssertionString}' defined assertion independently.`);
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
return
|
|
184
|
+
return unifiesIndependently;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
static name = "DefinedAssertion";
|
|
@@ -208,7 +208,7 @@ export default domAssigned(class DefinedAssertion {
|
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
function verifyWhenDerived(term, frame, negated, context) {
|
|
211
|
-
let
|
|
211
|
+
let verifiesWhenDerived = false;
|
|
212
212
|
|
|
213
213
|
if (term !== null) {
|
|
214
214
|
const { Variable } = dom,
|
|
@@ -218,11 +218,11 @@ function verifyWhenDerived(term, frame, negated, context) {
|
|
|
218
218
|
variableDefined = generalContext.isVariableDefined(variable);
|
|
219
219
|
|
|
220
220
|
if (!negated && variableDefined) {
|
|
221
|
-
|
|
221
|
+
verifiesWhenDerived = true;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
if (negated && !variableDefined) {
|
|
225
|
-
|
|
225
|
+
verifiesWhenDerived = true;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
|
|
@@ -233,13 +233,13 @@ function verifyWhenDerived(term, frame, negated, context) {
|
|
|
233
233
|
metavariableDefined = context.isMetavariableDefined(metavariable);
|
|
234
234
|
|
|
235
235
|
if (!negated && metavariableDefined) {
|
|
236
|
-
|
|
236
|
+
verifiesWhenDerived = true;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
if (negated && !metavariableDefined) {
|
|
240
|
-
|
|
240
|
+
verifiesWhenDerived = true;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
return
|
|
244
|
+
return verifiesWhenDerived;
|
|
245
245
|
}
|
|
@@ -36,7 +36,7 @@ export default domAssigned(class PropertyAssertion {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
matchTermAndPropertyRelation(term, propertyRelation, context) {
|
|
39
|
-
let
|
|
39
|
+
let verifiesAsPropertyAssertion = false;
|
|
40
40
|
|
|
41
41
|
const termString = term.getString(),
|
|
42
42
|
propertyRelationString = propertyRelation.getString(),
|
|
@@ -51,121 +51,123 @@ export default domAssigned(class PropertyAssertion {
|
|
|
51
51
|
if (termAEqualToTermB) {
|
|
52
52
|
const propertyRelationEqualToPropertyRelation = this.propertyRelation.isEqualTo(propertyRelation);
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
verifiesAsPropertyAssertion = propertyRelationEqualToPropertyRelation; ///
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
if (
|
|
57
|
+
if (verifiesAsPropertyAssertion) {
|
|
58
58
|
context.debug(`...matched the '${termString}' term and '${propertyRelationString}' property relation against the '${propertyAssertionString}' property assertion.`);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
return
|
|
61
|
+
return verifiesAsPropertyAssertion;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
verify(assignments, stated, context) {
|
|
65
|
-
let
|
|
65
|
+
let verifies = false;
|
|
66
66
|
|
|
67
67
|
const propertyAssertionString = this.string; ///
|
|
68
68
|
|
|
69
69
|
context.trace(`Verifying the '${propertyAssertionString}' property assertion...`);
|
|
70
70
|
|
|
71
|
-
const
|
|
71
|
+
const termVerifies = this.verifyTerm(assignments, stated, context);
|
|
72
72
|
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
73
|
+
if (termVerifies) {
|
|
74
|
+
const propertyRelationVerifies = this.verifyPropertyRelation(assignments, stated, context);
|
|
75
75
|
|
|
76
|
-
if (
|
|
77
|
-
let
|
|
78
|
-
|
|
76
|
+
if (propertyRelationVerifies) {
|
|
77
|
+
let verifiesWhenStated = false,
|
|
78
|
+
verifiesWhenDerived = false;
|
|
79
79
|
|
|
80
80
|
if (stated) {
|
|
81
|
-
|
|
81
|
+
verifiesWhenStated = this.verifyWhenStated(assignments, context);
|
|
82
82
|
} else {
|
|
83
|
-
|
|
83
|
+
verifiesWhenDerived = this.verifyWhenDerived(context);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
if (verifiesWhenStated || verifiesWhenDerived) {
|
|
87
|
+
verifies = true;
|
|
88
|
+
}
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
if (
|
|
92
|
+
if (verifies) {
|
|
91
93
|
if (stated) {
|
|
92
94
|
this.assign(assignments, context);
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
|
|
96
|
-
if (
|
|
98
|
+
if (verifies) {
|
|
97
99
|
context.debug(`...verified the '${propertyAssertionString}' property assertion.`);
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
return
|
|
102
|
+
return verifies;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
verifyTerm(assignments, stated, context) {
|
|
104
|
-
let
|
|
106
|
+
let termVerifies;
|
|
105
107
|
|
|
106
108
|
const termString = this.term.getString();
|
|
107
109
|
|
|
108
110
|
context.trace(`Verifying the '${termString}' term...`);
|
|
109
111
|
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
+
termVerifies = this.term.verify(context, () => {
|
|
113
|
+
const verifiesAhead = true;
|
|
112
114
|
|
|
113
|
-
return
|
|
115
|
+
return verifiesAhead;
|
|
114
116
|
});
|
|
115
117
|
|
|
116
|
-
if (
|
|
118
|
+
if (termVerifies) {
|
|
117
119
|
context.debug(`...verified the '${termString}' term.`);
|
|
118
120
|
}
|
|
119
121
|
|
|
120
|
-
return
|
|
122
|
+
return termVerifies;
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
verifyPropertyRelation(assignments, stated, context) {
|
|
124
|
-
let
|
|
126
|
+
let propertyRelationVerifies;
|
|
125
127
|
|
|
126
128
|
const propertyRelationString = this.propertyRelation.getString();
|
|
127
129
|
|
|
128
130
|
context.trace(`Verifying the '${propertyRelationString}' property relation...`);
|
|
129
131
|
|
|
130
|
-
|
|
132
|
+
propertyRelationVerifies = this.propertyRelation.verify(context);
|
|
131
133
|
|
|
132
|
-
if (
|
|
134
|
+
if (propertyRelationVerifies) {
|
|
133
135
|
context.debug(`...verified the '${propertyRelationString}' property relation.`);
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
return
|
|
138
|
+
return propertyRelationVerifies;
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
verifyWhenStated(assignments, context) {
|
|
140
|
-
let
|
|
142
|
+
let verifiesWhenStated;
|
|
141
143
|
|
|
142
144
|
const propertyAssertionString = this.string; ///
|
|
143
145
|
|
|
144
146
|
context.trace(`Verifying the '${propertyAssertionString}' stated property assertion...`);
|
|
145
147
|
|
|
146
|
-
|
|
148
|
+
verifiesWhenStated = true;
|
|
147
149
|
|
|
148
|
-
if (
|
|
150
|
+
if (verifiesWhenStated) {
|
|
149
151
|
context.debug(`...verified the '${propertyAssertionString}' stated property assertion.`);
|
|
150
152
|
}
|
|
151
153
|
|
|
152
|
-
return
|
|
154
|
+
return verifiesWhenStated;
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
verifyWhenDerived(context) {
|
|
156
|
-
let
|
|
158
|
+
let verifiesWhenDerived;
|
|
157
159
|
|
|
158
160
|
const propertyAssertionString = this.string; ///
|
|
159
161
|
|
|
160
162
|
context.trace(`Verifying the '${propertyAssertionString}' derived property assertion...`);
|
|
161
163
|
|
|
162
|
-
|
|
164
|
+
verifiesWhenDerived = true;
|
|
163
165
|
|
|
164
|
-
if (
|
|
166
|
+
if (verifiesWhenDerived) {
|
|
165
167
|
context.debug(`...verified the '${propertyAssertionString}' derived property assertion.`);
|
|
166
168
|
}
|
|
167
169
|
|
|
168
|
-
return
|
|
170
|
+
return verifiesWhenDerived;
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
assign(assignments, context) {
|