occam-verify-cli 1.0.457 → 1.0.472
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/constants.js +13 -1
- package/lib/context/ephemeral.js +270 -0
- package/lib/context/file.js +102 -66
- package/lib/context/liminal.js +120 -0
- package/lib/context/literal.js +92 -0
- package/lib/context/nominal.js +15 -1
- package/lib/context/release.js +66 -7
- package/lib/context/scoped.js +48 -40
- package/lib/context/synthetic.js +133 -0
- package/lib/element/assertion/contained.js +66 -66
- package/lib/element/assertion/defined.js +32 -32
- package/lib/element/assertion/property.js +39 -39
- package/lib/element/assertion/satisfies.js +22 -22
- package/lib/element/assumption.js +5 -8
- package/lib/element/conclusion.js +14 -13
- package/lib/element/constructor.js +2 -2
- package/lib/element/deduction.js +14 -13
- package/lib/element/derivation.js +3 -3
- package/lib/element/equality.js +5 -5
- package/lib/element/equivalence.js +112 -107
- package/lib/element/equivalences.js +24 -10
- package/lib/element/error.js +3 -3
- package/lib/element/frame.js +38 -21
- package/lib/element/hypothesis.js +2 -2
- package/lib/element/judgement.js +6 -5
- package/lib/element/metaType.js +1 -2
- package/lib/element/metavariable.js +46 -35
- package/lib/element/parameter.js +13 -5
- package/lib/element/procedureCall.js +16 -16
- package/lib/element/proof.js +14 -13
- package/lib/element/proofAssertion/premise.js +41 -30
- package/lib/element/proofAssertion/step.js +39 -35
- package/lib/element/proofAssertion/supposition.js +43 -32
- package/lib/element/proofAssertion.js +19 -5
- package/lib/element/propertyRelation.js +2 -2
- package/lib/element/reference.js +50 -9
- package/lib/element/rule.js +26 -28
- package/lib/element/section.js +2 -2
- package/lib/element/signature.js +9 -6
- package/lib/element/statement.js +44 -31
- package/lib/element/subproof.js +18 -17
- package/lib/element/substitution/frame.js +83 -46
- package/lib/element/substitution/reference.js +101 -19
- package/lib/element/substitution/statement.js +122 -75
- package/lib/element/substitution/term.js +93 -57
- package/lib/element/substitution.js +20 -69
- package/lib/element/substitutions.js +49 -34
- package/lib/element/term.js +30 -21
- package/lib/element/topLevelAssertion/axiom.js +8 -6
- package/lib/element/topLevelAssertion/conjecture.js +4 -4
- package/lib/element/topLevelAssertion/lemma.js +4 -4
- package/lib/element/topLevelAssertion/theorem.js +2 -2
- package/lib/element/topLevelAssertion.js +30 -23
- package/lib/element/topLevelMetaAssertion/metaLemma.js +2 -2
- package/lib/element/topLevelMetaAssertion/metatheorem.js +2 -2
- package/lib/element/topLevelMetaAssertion.js +16 -12
- package/lib/element/variable.js +30 -22
- package/lib/index.js +3 -3
- package/lib/main.js +3 -3
- package/lib/node/frame.js +2 -2
- package/lib/node/metavariable.js +4 -4
- package/lib/node/parameter.js +28 -7
- package/lib/node/substitution/frame.js +9 -31
- package/lib/node/substitution/reference.js +137 -0
- package/lib/node/substitution/statement.js +9 -31
- package/lib/node/substitution/term.js +9 -23
- package/lib/nonTerminalNodeMap.js +3 -2
- package/lib/process/instantiate.js +2 -14
- package/lib/process/unify.js +5 -5
- package/lib/tokenTypes.js +22 -0
- package/lib/utilities/context.js +54 -19
- package/lib/utilities/element.js +161 -336
- package/lib/utilities/instance.js +4 -4
- package/lib/utilities/string.js +18 -4
- package/lib/utilities/unification.js +24 -18
- package/lib/utilities/validation.js +31 -31
- package/package.json +2 -2
- package/src/constants.js +12 -0
- package/src/context/{transient.js → ephemeral.js} +15 -112
- package/src/context/file.js +66 -67
- package/src/context/liminal.js +67 -0
- package/src/context/{fragment.js → literal.js} +17 -4
- package/src/context/nominal.js +12 -0
- package/src/context/release.js +44 -6
- package/src/context/scoped.js +41 -31
- package/src/context/synthetic.js +60 -0
- package/src/element/assertion/contained.js +49 -47
- package/src/element/assertion/defined.js +29 -27
- package/src/element/assertion/property.js +35 -35
- package/src/element/assertion/satisfies.js +19 -18
- package/src/element/assumption.js +4 -10
- package/src/element/conclusion.js +16 -19
- package/src/element/constructor.js +1 -1
- package/src/element/deduction.js +16 -21
- package/src/element/derivation.js +2 -2
- package/src/element/equality.js +4 -4
- package/src/element/equivalence.js +115 -135
- package/src/element/equivalences.js +9 -7
- package/src/element/error.js +4 -2
- package/src/element/frame.js +50 -23
- package/src/element/hypothesis.js +1 -1
- package/src/element/judgement.js +9 -4
- package/src/element/metaType.js +0 -1
- package/src/element/metavariable.js +54 -53
- package/src/element/parameter.js +10 -5
- package/src/element/procedureCall.js +20 -18
- package/src/element/proof.js +14 -16
- package/src/element/proofAssertion/premise.js +46 -42
- package/src/element/proofAssertion/step.js +45 -40
- package/src/element/proofAssertion/supposition.js +56 -45
- package/src/element/proofAssertion.js +23 -5
- package/src/element/propertyRelation.js +1 -1
- package/src/element/reference.js +64 -16
- package/src/element/rule.js +31 -37
- package/src/element/section.js +1 -1
- package/src/element/signature.js +8 -8
- package/src/element/statement.js +51 -40
- package/src/element/subproof.js +16 -18
- package/src/element/substitution/frame.js +99 -42
- package/src/element/substitution/reference.js +120 -20
- package/src/element/substitution/statement.js +160 -89
- package/src/element/substitution/term.js +104 -63
- package/src/element/substitution.js +16 -58
- package/src/element/substitutions.js +43 -41
- package/src/element/term.js +37 -32
- package/src/element/topLevelAssertion/axiom.js +8 -6
- package/src/element/topLevelAssertion/conjecture.js +1 -2
- package/src/element/topLevelAssertion/lemma.js +2 -3
- package/src/element/topLevelAssertion/theorem.js +1 -1
- package/src/element/topLevelAssertion.js +31 -27
- package/src/element/topLevelMetaAssertion/metaLemma.js +1 -2
- package/src/element/topLevelMetaAssertion/metatheorem.js +1 -2
- package/src/element/topLevelMetaAssertion.js +15 -13
- package/src/element/variable.js +30 -31
- package/src/index.js +2 -1
- package/src/main.js +2 -1
- package/src/node/frame.js +1 -1
- package/src/node/metavariable.js +3 -3
- package/src/node/parameter.js +32 -5
- package/src/node/substitution/frame.js +6 -32
- package/src/node/substitution/reference.js +38 -0
- package/src/node/substitution/statement.js +6 -32
- package/src/node/substitution/term.js +6 -22
- package/src/nonTerminalNodeMap.js +3 -0
- package/src/process/instantiate.js +0 -8
- package/src/process/unify.js +4 -4
- package/src/tokenTypes.js +4 -0
- package/src/utilities/context.js +43 -17
- package/src/utilities/element.js +187 -401
- package/src/utilities/instance.js +3 -3
- package/src/utilities/string.js +21 -5
- package/src/utilities/unification.js +26 -23
- package/src/utilities/validation.js +47 -47
- package/lib/context/fragment.js +0 -77
- package/lib/context/transient.js +0 -371
- package/lib/log.js +0 -150
- package/lib/utilities/fragment.js +0 -23
- package/src/log.js +0 -118
- package/src/utilities/fragment.js +0 -11
|
@@ -6,7 +6,7 @@ import { define } from "../../elements";
|
|
|
6
6
|
import { termFromTermAndSubstitutions, frameFromFrameAndSubstitutions, statementFromStatementAndSubstitutions } from "../../utilities/substitutions";
|
|
7
7
|
|
|
8
8
|
export default define(class ContainedAssertion extends Assertion {
|
|
9
|
-
constructor(
|
|
9
|
+
constructor(context, string, node, term, frame, negated, statement) {
|
|
10
10
|
super(context, string, node);
|
|
11
11
|
|
|
12
12
|
this.term = term;
|
|
@@ -31,46 +31,47 @@ export default define(class ContainedAssertion extends Assertion {
|
|
|
31
31
|
return this.statement;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
let
|
|
34
|
+
validate(assignments, stated, context) {
|
|
35
|
+
let validates = false;
|
|
36
36
|
|
|
37
37
|
const containedAssertionString = this.getString(); ///
|
|
38
38
|
|
|
39
|
-
context.trace(`
|
|
39
|
+
context.trace(`Validating the '${containedAssertionString}' contained assertion...`);
|
|
40
40
|
|
|
41
41
|
const termValidates = this.validateTerm(assignments, stated, context),
|
|
42
|
-
frameVerifies = this.
|
|
42
|
+
frameVerifies = this.validateFrame(assignments, stated, context),
|
|
43
43
|
statementValidates = this.validateStatement(assignments, stated, context)
|
|
44
44
|
|
|
45
45
|
if (termValidates || frameVerifies || statementValidates) {
|
|
46
|
-
let
|
|
47
|
-
|
|
46
|
+
let validatesWhenStated = false,
|
|
47
|
+
validatesWhenDerived = false;
|
|
48
48
|
|
|
49
49
|
if (stated) {
|
|
50
|
-
|
|
50
|
+
validatesWhenStated = this.validateWhenStated(assignments, context);
|
|
51
51
|
} else {
|
|
52
|
-
|
|
52
|
+
validatesWhenDerived = this.validateWhenDerived(context);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
if (
|
|
56
|
-
|
|
55
|
+
if (validatesWhenStated || validatesWhenDerived) {
|
|
56
|
+
validates = true;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
if (
|
|
61
|
-
context.debug(`...
|
|
60
|
+
if (validates) {
|
|
61
|
+
context.debug(`...validated the '${containedAssertionString}' contained assertion.`);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
return
|
|
64
|
+
return validates;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
validateTerm(assignments, stated, context) {
|
|
68
68
|
let termValidates = false;
|
|
69
69
|
|
|
70
70
|
if (this.term !== null) {
|
|
71
|
-
const termString = this.term.getString()
|
|
71
|
+
const termString = this.term.getString(),
|
|
72
|
+
containedAssertionString = this.getString(); ///
|
|
72
73
|
|
|
73
|
-
context.trace(`Validating the '${termString}' term...`);
|
|
74
|
+
context.trace(`Validating the '${containedAssertionString}' contained assertino's '${termString}' term...`);
|
|
74
75
|
|
|
75
76
|
const termSingular = this.term.isSingular();
|
|
76
77
|
|
|
@@ -78,13 +79,13 @@ export default define(class ContainedAssertion extends Assertion {
|
|
|
78
79
|
context.debug(`The '${termString}' term is not singular.`);
|
|
79
80
|
} else {
|
|
80
81
|
termValidates = this.term.validate(context, () => {
|
|
81
|
-
const
|
|
82
|
+
const validatesAhead = true;
|
|
82
83
|
|
|
83
|
-
return
|
|
84
|
+
return validatesAhead;
|
|
84
85
|
});
|
|
85
86
|
|
|
86
87
|
if (termValidates) {
|
|
87
|
-
context.debug(`...validated the '${termString}' term.`);
|
|
88
|
+
context.debug(`...validated the '${containedAssertionString}' contained assertino's '${termString}' term.`);
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
}
|
|
@@ -92,13 +93,14 @@ export default define(class ContainedAssertion extends Assertion {
|
|
|
92
93
|
return termValidates;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
validateFrame(assignments, stated, context) {
|
|
96
97
|
let frameVerifies = false;
|
|
97
98
|
|
|
98
99
|
if (this.frame !== null) {
|
|
99
|
-
const frameString = this.frame.getString()
|
|
100
|
+
const frameString = this.frame.getString(),
|
|
101
|
+
containedAssertionString = this.getString(); ///
|
|
100
102
|
|
|
101
|
-
context.trace(`
|
|
103
|
+
context.trace(`Validating the '${containedAssertionString}' contained assertino's '${frameString}' frame...`);
|
|
102
104
|
|
|
103
105
|
const frameSingular = this.frame.isSingular();
|
|
104
106
|
|
|
@@ -109,10 +111,10 @@ export default define(class ContainedAssertion extends Assertion {
|
|
|
109
111
|
|
|
110
112
|
assignments = null; ///
|
|
111
113
|
|
|
112
|
-
frameVerifies = this.frame.
|
|
114
|
+
frameVerifies = this.frame.validate(assignments, stated, context);
|
|
113
115
|
|
|
114
116
|
if (frameVerifies) {
|
|
115
|
-
context.debug(`...
|
|
117
|
+
context.debug(`...validated the '${containedAssertionString}' contained assertino's '${frameString}' frame.`);
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
120
|
}
|
|
@@ -142,39 +144,39 @@ export default define(class ContainedAssertion extends Assertion {
|
|
|
142
144
|
return statementValidates;
|
|
143
145
|
}
|
|
144
146
|
|
|
145
|
-
|
|
146
|
-
let
|
|
147
|
+
validateWhenStated(assignments, context) {
|
|
148
|
+
let validatesWhenStated;
|
|
147
149
|
|
|
148
150
|
const containedAssertionString = this.getString(); ///
|
|
149
151
|
|
|
150
|
-
context.trace(`
|
|
152
|
+
context.trace(`Validating the '${containedAssertionString}' stated contained assertion...`);
|
|
151
153
|
|
|
152
|
-
|
|
154
|
+
validatesWhenStated = true;
|
|
153
155
|
|
|
154
|
-
if (
|
|
155
|
-
context.debug(`...
|
|
156
|
+
if (validatesWhenStated) {
|
|
157
|
+
context.debug(`...validated the '${containedAssertionString}' stated contained assertion.`);
|
|
156
158
|
}
|
|
157
159
|
|
|
158
|
-
return
|
|
160
|
+
return validatesWhenStated;
|
|
159
161
|
}
|
|
160
162
|
|
|
161
|
-
|
|
162
|
-
let
|
|
163
|
+
validateWhenDerived(context) {
|
|
164
|
+
let validatesWhenDerived;
|
|
163
165
|
|
|
164
166
|
const containedAssertionString = this.getString(); ///
|
|
165
167
|
|
|
166
|
-
context.trace(`
|
|
168
|
+
context.trace(`Validating the '${containedAssertionString}' derived contained assertion...`);
|
|
167
169
|
|
|
168
170
|
const generalCotnext = null,
|
|
169
171
|
specificContext = context; ///
|
|
170
172
|
|
|
171
|
-
|
|
173
|
+
validatesWhenDerived = validateWhenDerived(this.term, this.frame, this.statement, this.negated, generalCotnext, specificContext);
|
|
172
174
|
|
|
173
|
-
if (
|
|
174
|
-
context.debug(`...
|
|
175
|
+
if (validatesWhenDerived) {
|
|
176
|
+
context.debug(`...validated the '${containedAssertionString}' derived contained assertion.`);
|
|
175
177
|
}
|
|
176
178
|
|
|
177
|
-
return
|
|
179
|
+
return validatesWhenDerived;
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
unifyIndependently(substitutions, generalContext, specificContext) {
|
|
@@ -188,9 +190,9 @@ export default define(class ContainedAssertion extends Assertion {
|
|
|
188
190
|
const term = termFromTermAndSubstitutions(this.term, substitutions, generalContext, specificContext),
|
|
189
191
|
frame = frameFromFrameAndSubstitutions(this.frame, substitutions, generalContext, specificContext),
|
|
190
192
|
statement = statementFromStatementAndSubstitutions(this.statement, substitutions, generalContext, specificContext),
|
|
191
|
-
|
|
193
|
+
validatesWhenDerived = validateWhenDerived(term, frame, statement, this.negated, generalContext, specificContext);
|
|
192
194
|
|
|
193
|
-
unifiesIndependently =
|
|
195
|
+
unifiesIndependently = validatesWhenDerived; ///
|
|
194
196
|
|
|
195
197
|
if (unifiesIndependently) {
|
|
196
198
|
context.debug(`...unified the '${containedAssertionString}' contained assertion independently.`);
|
|
@@ -202,8 +204,8 @@ export default define(class ContainedAssertion extends Assertion {
|
|
|
202
204
|
static name = "ContainedAssertion";
|
|
203
205
|
});
|
|
204
206
|
|
|
205
|
-
function
|
|
206
|
-
let
|
|
207
|
+
function validateWhenDerived(term, frame, statement, negated, generalContext, specificContext) {
|
|
208
|
+
let validatesWhenDerived = false;
|
|
207
209
|
|
|
208
210
|
const context = specificContext; ///
|
|
209
211
|
|
|
@@ -212,11 +214,11 @@ function verifyWhenDerived(term, frame, statement, negated, generalContext, spec
|
|
|
212
214
|
const termContained = statement.isTermContained(term, context);
|
|
213
215
|
|
|
214
216
|
if (!negated && termContained) {
|
|
215
|
-
|
|
217
|
+
validatesWhenDerived = true;
|
|
216
218
|
}
|
|
217
219
|
|
|
218
220
|
if (negated && !termContained) {
|
|
219
|
-
|
|
221
|
+
validatesWhenDerived = true;
|
|
220
222
|
}
|
|
221
223
|
}
|
|
222
224
|
|
|
@@ -224,14 +226,14 @@ function verifyWhenDerived(term, frame, statement, negated, generalContext, spec
|
|
|
224
226
|
const frameContained = statement.isFrameContained(frame, context);
|
|
225
227
|
|
|
226
228
|
if (!negated && frameContained) {
|
|
227
|
-
|
|
229
|
+
validatesWhenDerived = true;
|
|
228
230
|
}
|
|
229
231
|
|
|
230
232
|
if (negated && !frameContained) {
|
|
231
|
-
|
|
233
|
+
validatesWhenDerived = true;
|
|
232
234
|
}
|
|
233
235
|
}
|
|
234
236
|
}
|
|
235
237
|
|
|
236
|
-
return
|
|
238
|
+
return validatesWhenDerived;
|
|
237
239
|
}
|
|
@@ -27,45 +27,46 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
27
27
|
return this.negated;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
let
|
|
30
|
+
validate(assignments, stated, context) {
|
|
31
|
+
let validated = false;
|
|
32
32
|
|
|
33
33
|
const definedAssertionString = this.getString(); ///
|
|
34
34
|
|
|
35
|
-
context.trace(`
|
|
35
|
+
context.trace(`Validating the '${definedAssertionString}' defined assertion...`);
|
|
36
36
|
|
|
37
37
|
const termValidates = this.validateTerm(assignments, stated, context),
|
|
38
|
-
frameVerifies = this.
|
|
38
|
+
frameVerifies = this.validateFrame(assignments, stated, context);
|
|
39
39
|
|
|
40
40
|
if (termValidates || frameVerifies) {
|
|
41
41
|
let verifiesWhenStated = false,
|
|
42
42
|
verifiesWhenDerived = false;
|
|
43
43
|
|
|
44
44
|
if (stated) {
|
|
45
|
-
verifiesWhenStated = this.
|
|
45
|
+
verifiesWhenStated = this.validateWhenStated(assignments, context);
|
|
46
46
|
} else {
|
|
47
|
-
verifiesWhenDerived = this.
|
|
47
|
+
verifiesWhenDerived = this.validateWhenDerived(context);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (verifiesWhenStated || verifiesWhenDerived) {
|
|
51
|
-
|
|
51
|
+
validated = true;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
if (
|
|
56
|
-
context.debug(`...
|
|
55
|
+
if (validated) {
|
|
56
|
+
context.debug(`...validated the '${definedAssertionString}' defined assertion.`);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
return
|
|
59
|
+
return validated;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
validateTerm(assignments, stated, context) {
|
|
63
63
|
let termValidates = false;
|
|
64
64
|
|
|
65
65
|
if (this.term !== null) {
|
|
66
|
-
const termString = this.term.getString()
|
|
66
|
+
const termString = this.term.getString(), ///
|
|
67
|
+
definedAssertionString = this.getString(); ///
|
|
67
68
|
|
|
68
|
-
context.trace(`Validating the '${termString}' term...`);
|
|
69
|
+
context.trace(`Validating the '${definedAssertionString}' defined assertino's '${termString}' term...`);
|
|
69
70
|
|
|
70
71
|
const termSingular = this.term.isSingular();
|
|
71
72
|
|
|
@@ -79,7 +80,7 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
79
80
|
});
|
|
80
81
|
|
|
81
82
|
if (termValidates) {
|
|
82
|
-
context.debug(`...validated the '${termString}' term.`);
|
|
83
|
+
context.debug(`...validated the'${definedAssertionString}' defined assertino's '${termString}' term.`);
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
}
|
|
@@ -87,13 +88,14 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
87
88
|
return termValidates;
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
|
|
91
|
+
validateFrame(assignments, stated, context) {
|
|
91
92
|
let frameVerifies = false;
|
|
92
93
|
|
|
93
94
|
if (this.frame !== null) {
|
|
94
|
-
const frameString = this.frame.getString()
|
|
95
|
+
const frameString = this.frame.getString(), ///
|
|
96
|
+
definedAssertionString = this.getString(); ///
|
|
95
97
|
|
|
96
|
-
context.trace(`
|
|
98
|
+
context.trace(`Validating the'${definedAssertionString}' defined assertino's '${frameString}' frame...`);
|
|
97
99
|
|
|
98
100
|
const frameSingular = this.frame.isSingular();
|
|
99
101
|
|
|
@@ -104,10 +106,10 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
104
106
|
|
|
105
107
|
assignments = null; ///
|
|
106
108
|
|
|
107
|
-
frameVerifies = this.frame.
|
|
109
|
+
frameVerifies = this.frame.validate(assignments, stated, context);
|
|
108
110
|
|
|
109
111
|
if (frameVerifies) {
|
|
110
|
-
context.debug(`...
|
|
112
|
+
context.debug(`...validated the'${definedAssertionString}' defined assertino's '${frameString}' frame.`);
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
}
|
|
@@ -115,36 +117,36 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
115
117
|
return frameVerifies;
|
|
116
118
|
}
|
|
117
119
|
|
|
118
|
-
|
|
120
|
+
validateWhenStated(assignments, context) {
|
|
119
121
|
let verifiesWhenStated;
|
|
120
122
|
|
|
121
123
|
const definedAssertionString = this.getString(); ///
|
|
122
124
|
|
|
123
|
-
context.trace(`
|
|
125
|
+
context.trace(`Validating the '${definedAssertionString}' stated defined assertion...`);
|
|
124
126
|
|
|
125
127
|
verifiesWhenStated = true;
|
|
126
128
|
|
|
127
129
|
if (verifiesWhenStated) {
|
|
128
|
-
context.debug(`...
|
|
130
|
+
context.debug(`...validated the '${definedAssertionString}' stated defined assertion.`);
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
return verifiesWhenStated;
|
|
132
134
|
}
|
|
133
135
|
|
|
134
|
-
|
|
136
|
+
validateWhenDerived(context) {
|
|
135
137
|
let verifiesWhenDerived;
|
|
136
138
|
|
|
137
139
|
const definedAssertionString = this.getString(); ///
|
|
138
140
|
|
|
139
|
-
context.trace(`
|
|
141
|
+
context.trace(`Validating the '${definedAssertionString}' derived defined assertion...`);
|
|
140
142
|
|
|
141
143
|
const generalContext = null,
|
|
142
144
|
specificContext = context; ///
|
|
143
145
|
|
|
144
|
-
verifiesWhenDerived =
|
|
146
|
+
verifiesWhenDerived = validateWhenDerived(this.term, this.frame, this.negated, generalContext, specificContext);
|
|
145
147
|
|
|
146
148
|
if (verifiesWhenDerived) {
|
|
147
|
-
context.debug(`...
|
|
149
|
+
context.debug(`...validated the '${definedAssertionString}' derived defined assertion.`);
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
return verifiesWhenDerived;
|
|
@@ -160,7 +162,7 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
160
162
|
|
|
161
163
|
const term = termFromTermAndSubstitutions(this.term, substitutions, generalContext, specificContext),
|
|
162
164
|
frame = frameFromFrameAndSubstitutions(this.frame, substitutions, generalContext, specificContext),
|
|
163
|
-
verifiesWhenDerived =
|
|
165
|
+
verifiesWhenDerived = validateWhenDerived(term, frame, this.negated, generalContext, specificContext);
|
|
164
166
|
|
|
165
167
|
unifiesIndependently = verifiesWhenDerived; ///
|
|
166
168
|
|
|
@@ -174,7 +176,7 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
174
176
|
static name = "DefinedAssertion";
|
|
175
177
|
});
|
|
176
178
|
|
|
177
|
-
function
|
|
179
|
+
function validateWhenDerived(term, frame, negated, generalContext, specificContext) {
|
|
178
180
|
let verifiesWhenDerived = false;
|
|
179
181
|
|
|
180
182
|
const context = specificContext; ///
|
|
@@ -48,45 +48,45 @@ export default define(class PropertyAssertion extends Assertion {
|
|
|
48
48
|
return comparesToTermAndPropertyRelation;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
let
|
|
51
|
+
validate(assignments, stated, context) {
|
|
52
|
+
let validates = false;
|
|
53
53
|
|
|
54
54
|
const propertyAssertionString = this.getString(); ///
|
|
55
55
|
|
|
56
|
-
context.trace(`
|
|
56
|
+
context.trace(`Validating the '${propertyAssertionString}' property assertion...`);
|
|
57
57
|
|
|
58
58
|
const termValidates = this.validateTerm(assignments, stated, context);
|
|
59
59
|
|
|
60
60
|
if (termValidates) {
|
|
61
|
-
const propertyRelationVerifies = this.
|
|
61
|
+
const propertyRelationVerifies = this.validatePropertyRelation(assignments, stated, context);
|
|
62
62
|
|
|
63
63
|
if (propertyRelationVerifies) {
|
|
64
|
-
let
|
|
65
|
-
|
|
64
|
+
let validatesWhenStated = false,
|
|
65
|
+
validatesWhenDerived = false;
|
|
66
66
|
|
|
67
67
|
if (stated) {
|
|
68
|
-
|
|
68
|
+
validatesWhenStated = this.validateWhenStated(assignments, context);
|
|
69
69
|
} else {
|
|
70
|
-
|
|
70
|
+
validatesWhenDerived = this.validateWhenDerived(context);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
if (
|
|
74
|
-
|
|
73
|
+
if (validatesWhenStated || validatesWhenDerived) {
|
|
74
|
+
validates = true;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
if (
|
|
79
|
+
if (validates) {
|
|
80
80
|
if (stated) {
|
|
81
81
|
this.assign(assignments, context);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
if (
|
|
86
|
-
context.debug(`...
|
|
85
|
+
if (validates) {
|
|
86
|
+
context.debug(`...validated the '${propertyAssertionString}' property assertion.`);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
return
|
|
89
|
+
return validates;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
validateTerm(assignments, stated, context) {
|
|
@@ -96,10 +96,10 @@ export default define(class PropertyAssertion extends Assertion {
|
|
|
96
96
|
|
|
97
97
|
context.trace(`Validating the '${termString}' term...`);
|
|
98
98
|
|
|
99
|
-
termValidates = this.term.
|
|
100
|
-
const
|
|
99
|
+
termValidates = this.term.validate(context, () => {
|
|
100
|
+
const validatesAhead = true;
|
|
101
101
|
|
|
102
|
-
return
|
|
102
|
+
return validatesAhead;
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
if (termValidates) {
|
|
@@ -109,52 +109,52 @@ export default define(class PropertyAssertion extends Assertion {
|
|
|
109
109
|
return termValidates;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
validatePropertyRelation(assignments, stated, context) {
|
|
113
113
|
let propertyRelationVerifies;
|
|
114
114
|
|
|
115
115
|
const propertyRelationString = this.propertyRelation.getString();
|
|
116
116
|
|
|
117
|
-
context.trace(`
|
|
117
|
+
context.trace(`Validating the '${propertyRelationString}' property relation...`);
|
|
118
118
|
|
|
119
|
-
propertyRelationVerifies = this.propertyRelation.
|
|
119
|
+
propertyRelationVerifies = this.propertyRelation.validate(context);
|
|
120
120
|
|
|
121
121
|
if (propertyRelationVerifies) {
|
|
122
|
-
context.debug(`...
|
|
122
|
+
context.debug(`...validated the '${propertyRelationString}' property relation.`);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
return propertyRelationVerifies;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
let
|
|
128
|
+
validateWhenStated(assignments, context) {
|
|
129
|
+
let validatesWhenStated;
|
|
130
130
|
|
|
131
131
|
const propertyAssertionString = this.getString(); ///
|
|
132
132
|
|
|
133
|
-
context.trace(`
|
|
133
|
+
context.trace(`Validating the '${propertyAssertionString}' stated property assertion...`);
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
validatesWhenStated = true;
|
|
136
136
|
|
|
137
|
-
if (
|
|
138
|
-
context.debug(`...
|
|
137
|
+
if (validatesWhenStated) {
|
|
138
|
+
context.debug(`...validated the '${propertyAssertionString}' stated property assertion.`);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
return
|
|
141
|
+
return validatesWhenStated;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
let
|
|
144
|
+
validateWhenDerived(context) {
|
|
145
|
+
let validatesWhenDerived;
|
|
146
146
|
|
|
147
147
|
const propertyAssertionString = this.getString(); ///
|
|
148
148
|
|
|
149
|
-
context.trace(`
|
|
149
|
+
context.trace(`Validating the '${propertyAssertionString}' derived property assertion...`);
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
validatesWhenDerived = true;
|
|
152
152
|
|
|
153
|
-
if (
|
|
154
|
-
context.debug(`...
|
|
153
|
+
if (validatesWhenDerived) {
|
|
154
|
+
context.debug(`...validated the '${propertyAssertionString}' derived property assertion.`);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
return
|
|
157
|
+
return validatesWhenDerived;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
assign(assignments, context) {
|
|
@@ -25,40 +25,41 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
25
25
|
|
|
26
26
|
correlateSubstitutions(substitutions, context) { return this.signature.correlateSubstitutions(substitutions, context); }
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
let
|
|
28
|
+
validate(assignments, stated, context) {
|
|
29
|
+
let validates = false;
|
|
30
30
|
|
|
31
31
|
const satisfiesAssertionString = this.getString(); ///
|
|
32
32
|
|
|
33
|
-
context.trace(`
|
|
33
|
+
context.trace(`Validating the '${satisfiesAssertionString}' satisfies assertion...`);
|
|
34
34
|
|
|
35
|
-
const signatureVerifies = this.
|
|
35
|
+
const signatureVerifies = this.validateSignature(assignments, stated, context);
|
|
36
36
|
|
|
37
37
|
if (signatureVerifies) {
|
|
38
|
-
const referenceVerifies = this.
|
|
38
|
+
const referenceVerifies = this.validateReference(assignments, stated, context);
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
validates = referenceVerifies; ///
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
if (
|
|
44
|
-
context.debug(`...
|
|
43
|
+
if (validates) {
|
|
44
|
+
context.debug(`...validated the '${satisfiesAssertionString}' satisfies assertion.`);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
return
|
|
47
|
+
return validates;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
const signatureVerifies = this.signature.
|
|
50
|
+
validateSignature(assignments, stated, context) {
|
|
51
|
+
const signatureVerifies = this.signature.validate(context);
|
|
52
52
|
|
|
53
53
|
return signatureVerifies;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
validateReference(assignments, stated, context) {
|
|
57
57
|
let referenceVerifies = false;
|
|
58
58
|
|
|
59
|
-
const referenceString = this.reference.getString()
|
|
59
|
+
const referenceString = this.reference.getString(),
|
|
60
|
+
satisfiesAssertionString = this.getString(); ///
|
|
60
61
|
|
|
61
|
-
context.trace(`
|
|
62
|
+
context.trace(`Validating the '${satisfiesAssertionString}' satisfies assertino's '${referenceString}' reference...`);
|
|
62
63
|
|
|
63
64
|
const axiom = context.findAxiomByReference(this.reference, context);
|
|
64
65
|
|
|
@@ -71,7 +72,7 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
if (referenceVerifies) {
|
|
74
|
-
context.debug(`...
|
|
75
|
+
context.debug(`...validated the '${satisfiesAssertionString}' satisfies assertino's '${referenceString}' reference.`);
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
return referenceVerifies;
|
|
@@ -85,7 +86,7 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
85
86
|
|
|
86
87
|
context.trace(`Unifying the '${statementString}' statement with the '${satisfiesAssertionString}' satisfies assertion...`);
|
|
87
88
|
|
|
88
|
-
this.signature.
|
|
89
|
+
this.signature.validate(context);
|
|
89
90
|
|
|
90
91
|
const axiom = context.findAxiomByReference(this.reference),
|
|
91
92
|
satisfiable = axiom.isSatisfiable();
|
|
@@ -95,14 +96,14 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
95
96
|
|
|
96
97
|
const { Substitutions } = elements;
|
|
97
98
|
|
|
98
|
-
substitutions = Substitutions.fromNothing();
|
|
99
|
+
substitutions = Substitutions.fromNothing(context);
|
|
99
100
|
|
|
100
101
|
const axiomComparesToSignature = axiom.compareSignature(this.signature, substitutions, context);
|
|
101
102
|
|
|
102
103
|
if (axiomComparesToSignature) {
|
|
103
104
|
const substitutionsB = substitutions; ///
|
|
104
105
|
|
|
105
|
-
substitutions = Substitutions.fromNothing();
|
|
106
|
+
substitutions = Substitutions.fromNothing(context);
|
|
106
107
|
|
|
107
108
|
statementUnifies = axiom.unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, substitutions, context);
|
|
108
109
|
|
|
@@ -140,20 +140,14 @@ export default define(class Assumption extends Element {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
validateReferenceAsMetavariable(assignments, stated, context) {
|
|
143
|
-
let referenceValidatesAsMetavariable
|
|
143
|
+
let referenceValidatesAsMetavariable;
|
|
144
144
|
|
|
145
145
|
const referenceString = this.reference.getString(),
|
|
146
146
|
assumptionString = this.getString(); ///
|
|
147
147
|
|
|
148
148
|
context.trace(`Validating the '${assumptionString}' assumption's '${referenceString}' reference as s metavariable...`);
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
metavariableName = metavariable.getName(),
|
|
152
|
-
metavariablePresent = context.isMetavariablePresentByMetavariableName(metavariableName);
|
|
153
|
-
|
|
154
|
-
if (metavariablePresent) {
|
|
155
|
-
referenceValidatesAsMetavariable = true;
|
|
156
|
-
}
|
|
150
|
+
referenceValidatesAsMetavariable = this.reference.validateAsMetavariable(context);
|
|
157
151
|
|
|
158
152
|
if (referenceValidatesAsMetavariable) {
|
|
159
153
|
context.debug(`...validated the '${assumptionString}' assumption's '${referenceString}' reference as a metavariable.`);
|
|
@@ -273,13 +267,13 @@ export default define(class Assumption extends Element {
|
|
|
273
267
|
|
|
274
268
|
const { Substitutions } = elements,
|
|
275
269
|
specificContext = context, ///
|
|
276
|
-
labelSubstitutions = Substitutions.fromNothing(),
|
|
270
|
+
labelSubstitutions = Substitutions.fromNothing(context),
|
|
277
271
|
label = topLevelMetaAssertion.getLabel(),
|
|
278
272
|
substitutions = labelSubstitutions, ///
|
|
279
273
|
labelUnifies = this.unifyLabel(label, substitutions, generalContext, specificContext);
|
|
280
274
|
|
|
281
275
|
if (labelUnifies) {
|
|
282
|
-
const statementSubstitutions = Substitutions.fromNothing(),
|
|
276
|
+
const statementSubstitutions = Substitutions.fromNothing(context),
|
|
283
277
|
statement = topLevelMetaAssertion.getStatement(),
|
|
284
278
|
substitutions = statementSubstitutions, ///
|
|
285
279
|
statementUUnifies = this.unifyStatement(statement, substitutions, generalContext, specificContext);
|