occam-verify-cli 1.0.617 → 1.0.632
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/ephemeral.js +152 -47
- package/lib/context/file/nominal.js +136 -140
- package/lib/context/liminal.js +16 -26
- package/lib/context/scoped.js +26 -55
- package/lib/context.js +103 -53
- package/lib/element/assertion/contained.js +3 -1
- package/lib/element/assertion/defined.js +5 -3
- package/lib/element/assertion/property.js +10 -58
- package/lib/element/assertion/satisfies.js +3 -1
- package/lib/element/assertion/subproof.js +3 -1
- package/lib/element/assertion/type.js +65 -109
- package/lib/element/assumption.js +40 -16
- package/lib/element/constructor/bracketed.js +13 -53
- package/lib/element/constructor.js +5 -5
- package/lib/element/declaration/constructor.js +5 -2
- package/lib/element/derivation.js +8 -10
- package/lib/element/equality.js +102 -62
- package/lib/element/equivalence.js +6 -6
- package/lib/element/equivalences.js +4 -4
- package/lib/element/frame.js +21 -21
- package/lib/element/hypothesis.js +5 -7
- package/lib/element/judgement.js +47 -25
- package/lib/element/metaType.js +2 -2
- package/lib/element/metavariable.js +12 -3
- package/lib/element/propertyRelation.js +3 -3
- package/lib/element/reference.js +9 -21
- package/lib/element/rule.js +13 -15
- package/lib/element/signature.js +5 -5
- package/lib/element/statement.js +23 -25
- package/lib/element/subDerivation.js +4 -6
- package/lib/element/substitution/frame.js +4 -4
- package/lib/element/substitution/reference.js +4 -4
- package/lib/element/substitution/statement.js +4 -4
- package/lib/element/substitution/term.js +9 -3
- package/lib/element/substitution.js +71 -43
- package/lib/element/term.js +20 -6
- package/lib/element/topLevelAssertion.js +9 -11
- package/lib/element/topLevelMetaAssertion.js +9 -11
- package/lib/element/variable.js +44 -3
- package/lib/process/assign.js +96 -26
- package/lib/process/unify.js +3 -4
- package/lib/process/validate.js +7 -7
- package/lib/process/verify.js +2 -2
- package/lib/ruleNames.js +5 -1
- package/lib/utilities/element.js +74 -12
- package/lib/utilities/json.js +2 -2
- package/lib/utilities/string.js +9 -24
- package/lib/utilities/substitutions.js +14 -22
- package/lib/utilities/validation.js +3 -3
- package/package.json +4 -4
- package/src/context/ephemeral.js +170 -50
- package/src/context/file/nominal.js +136 -141
- package/src/context/liminal.js +22 -34
- package/src/context/scoped.js +33 -74
- package/src/context.js +97 -46
- package/src/element/assertion/contained.js +4 -0
- package/src/element/assertion/defined.js +6 -2
- package/src/element/assertion/property.js +15 -26
- package/src/element/assertion/satisfies.js +4 -0
- package/src/element/assertion/subproof.js +4 -0
- package/src/element/assertion/type.js +69 -77
- package/src/element/assumption.js +48 -16
- package/src/element/constructor/bracketed.js +11 -12
- package/src/element/constructor.js +4 -4
- package/src/element/declaration/constructor.js +5 -1
- package/src/element/derivation.js +3 -5
- package/src/element/equality.js +109 -74
- package/src/element/equivalence.js +7 -7
- package/src/element/equivalences.js +7 -5
- package/src/element/frame.js +25 -25
- package/src/element/hypothesis.js +4 -6
- package/src/element/judgement.js +54 -24
- package/src/element/metaType.js +1 -1
- package/src/element/metavariable.js +16 -3
- package/src/element/propertyRelation.js +2 -2
- package/src/element/reference.js +12 -26
- package/src/element/rule.js +8 -10
- package/src/element/signature.js +4 -4
- package/src/element/statement.js +27 -30
- package/src/element/subDerivation.js +3 -5
- package/src/element/substitution/frame.js +1 -1
- package/src/element/substitution/reference.js +1 -1
- package/src/element/substitution/statement.js +1 -1
- package/src/element/substitution/term.js +4 -2
- package/src/element/substitution.js +60 -36
- package/src/element/term.js +24 -5
- package/src/element/topLevelAssertion.js +4 -6
- package/src/element/topLevelMetaAssertion.js +4 -6
- package/src/element/variable.js +2 -0
- package/src/process/assign.js +114 -37
- package/src/process/unify.js +2 -3
- package/src/process/validate.js +5 -5
- package/src/process/verify.js +1 -1
- package/src/ruleNames.js +1 -0
- package/src/utilities/element.js +83 -26
- package/src/utilities/json.js +1 -1
- package/src/utilities/string.js +7 -29
- package/src/utilities/substitutions.js +18 -29
- package/src/utilities/validation.js +2 -2
package/src/context/scoped.js
CHANGED
|
@@ -17,21 +17,17 @@ class ScopedContext extends Context {
|
|
|
17
17
|
this.subproofOrProofAssertions = subproofOrProofAssertions;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
getVariables(
|
|
20
|
+
getVariables() {
|
|
21
21
|
let variables;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
const context = this.getContext();
|
|
23
|
+
const context = this.getContext();
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
variables = context.getVariables();
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} else {
|
|
33
|
-
variables = this.variables;
|
|
34
|
-
}
|
|
27
|
+
variables = [
|
|
28
|
+
...this.variables,
|
|
29
|
+
...variables
|
|
30
|
+
];
|
|
35
31
|
|
|
36
32
|
return variables;
|
|
37
33
|
}
|
|
@@ -67,6 +63,21 @@ class ScopedContext extends Context {
|
|
|
67
63
|
return equivalences;
|
|
68
64
|
}
|
|
69
65
|
|
|
66
|
+
getSubproofOrProofAssertions() {
|
|
67
|
+
let subproofOrProofAssertions;
|
|
68
|
+
|
|
69
|
+
const context = this.getContext();
|
|
70
|
+
|
|
71
|
+
subproofOrProofAssertions = context.getSubproofOrProofAssertions();
|
|
72
|
+
|
|
73
|
+
subproofOrProofAssertions = [ ///
|
|
74
|
+
...subproofOrProofAssertions,
|
|
75
|
+
...this.subproofOrProofAssertions
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
return subproofOrProofAssertions;
|
|
79
|
+
}
|
|
80
|
+
|
|
70
81
|
getProofAssertions() {
|
|
71
82
|
const subproofOrProofAssertions = this.getSubproofOrProofAssertions(),
|
|
72
83
|
proofAssertions = subproofOrProofAssertions.filter((subproofOrProofAssertion) => {
|
|
@@ -93,24 +104,7 @@ class ScopedContext extends Context {
|
|
|
93
104
|
return lastProofAssertion;
|
|
94
105
|
}
|
|
95
106
|
|
|
96
|
-
getSubproofOrProofAssertions() {
|
|
97
|
-
let subproofOrProofAssertions;
|
|
98
|
-
|
|
99
|
-
const context = this.getContext();
|
|
100
|
-
|
|
101
|
-
subproofOrProofAssertions = context.getSubproofOrProofAssertions();
|
|
102
|
-
|
|
103
|
-
subproofOrProofAssertions = [ ///
|
|
104
|
-
...subproofOrProofAssertions,
|
|
105
|
-
...this.subproofOrProofAssertions
|
|
106
|
-
];
|
|
107
|
-
|
|
108
|
-
return subproofOrProofAssertions;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
107
|
addEquality(equality) {
|
|
112
|
-
let equalityAdded = false;
|
|
113
|
-
|
|
114
108
|
const context = this, ///
|
|
115
109
|
equalityString = equality.getString();
|
|
116
110
|
|
|
@@ -122,69 +116,34 @@ class ScopedContext extends Context {
|
|
|
122
116
|
context.trace(`The '${equalityString}' equality is reflexive and will not added to the scoped context.`);
|
|
123
117
|
} else {
|
|
124
118
|
const { Equivalence } = elements,
|
|
125
|
-
equivalence = Equivalence.fromEquality(equality)
|
|
126
|
-
context = this; ///
|
|
119
|
+
equivalence = Equivalence.fromEquality(equality, context);
|
|
127
120
|
|
|
128
121
|
this.equivalences = this.equivalences.mergedWithEquivalence(equivalence, context);
|
|
129
122
|
|
|
130
|
-
equalityAdded = true;
|
|
131
|
-
|
|
132
123
|
context.debug(`...added the '${equalityString}' equality to the scoped context.`);
|
|
133
124
|
}
|
|
134
|
-
|
|
135
|
-
return equalityAdded;
|
|
136
125
|
}
|
|
137
126
|
|
|
138
127
|
addVariable(variable) {
|
|
139
128
|
const context = this, ///
|
|
140
|
-
variableA = variable, ///
|
|
141
129
|
variableString = variable.getString();
|
|
142
130
|
|
|
143
131
|
context.trace(`Adding the '${variableString}' variable to the scoped context...`);
|
|
144
132
|
|
|
145
|
-
|
|
146
|
-
const variableB = variable, ///
|
|
147
|
-
variableAComparesToVariableB = variableA.compare(variableB);
|
|
148
|
-
|
|
149
|
-
if (variableAComparesToVariableB) {
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
}) || null;
|
|
153
|
-
|
|
154
|
-
if (variableB !== null) {
|
|
155
|
-
context.trace(`The '${variableString}' variable has already been added to the scoped context.`);
|
|
156
|
-
} else {
|
|
157
|
-
this.variables.push(variable);
|
|
133
|
+
this.variables.push(variable);
|
|
158
134
|
|
|
159
|
-
|
|
160
|
-
}
|
|
135
|
+
context.debug(`...added the '${variableString}' variable to the scoped context.`);
|
|
161
136
|
}
|
|
162
137
|
|
|
163
138
|
addJudgement(judgement) {
|
|
164
|
-
let judgementAdded = false;
|
|
165
|
-
|
|
166
139
|
const context = this, ///
|
|
167
140
|
judgementString = judgement.getString();
|
|
168
141
|
|
|
169
142
|
context.trace(`Adding the '${judgementString}' judgement to the scoped context...`);
|
|
170
143
|
|
|
171
|
-
|
|
172
|
-
metavariableName = metavariable.getMetavariableName(),
|
|
173
|
-
judgementPresent = this.isJudgementPresentByMetavariableName(metavariableName);
|
|
174
|
-
|
|
175
|
-
if (judgementPresent) {
|
|
176
|
-
const metavariableString = metavariable.getString();
|
|
177
|
-
|
|
178
|
-
context.trace(`A '${judgementString}' judgement for the '${metavariableString}' metavariable is already present.`);
|
|
179
|
-
} else {
|
|
180
|
-
this.judgements.push(judgement);
|
|
181
|
-
|
|
182
|
-
judgementAdded = true;
|
|
183
|
-
|
|
184
|
-
context.debug(`...added the '${judgementString}' judgement to the scoped context.`);
|
|
185
|
-
}
|
|
144
|
+
this.judgements.push(judgement);
|
|
186
145
|
|
|
187
|
-
|
|
146
|
+
context.debug(`...added the '${judgementString}' judgement to the scoped context.`);
|
|
188
147
|
}
|
|
189
148
|
|
|
190
149
|
addSubproofOrProofAssertion(subproofOrProofAssertion) {
|
|
@@ -203,7 +162,7 @@ class ScopedContext extends Context {
|
|
|
203
162
|
findJudgementByMetavariableName(metavariableName) {
|
|
204
163
|
const judgements = this.getJudgements(),
|
|
205
164
|
judgement = judgements.find((judgement) => {
|
|
206
|
-
const judgementMetavariableComparesToMetavariable = judgement.
|
|
165
|
+
const judgementMetavariableComparesToMetavariable = judgement.compareMetavariableName(metavariableName);
|
|
207
166
|
|
|
208
167
|
if (judgementMetavariableComparesToMetavariable) {
|
|
209
168
|
return true;
|
|
@@ -213,8 +172,8 @@ class ScopedContext extends Context {
|
|
|
213
172
|
return judgement;
|
|
214
173
|
}
|
|
215
174
|
|
|
216
|
-
findVariableByVariableIdentifier(variableIdentifier
|
|
217
|
-
const variables = this.getVariables(
|
|
175
|
+
findVariableByVariableIdentifier(variableIdentifier) {
|
|
176
|
+
const variables = this.getVariables(),
|
|
218
177
|
variable = variables.find((variable) => {
|
|
219
178
|
const variableComparesToVariableIdentifier = variable.compareVariableIdentifier(variableIdentifier);
|
|
220
179
|
|
|
@@ -236,7 +195,7 @@ class ScopedContext extends Context {
|
|
|
236
195
|
|
|
237
196
|
const termMatchesGroundedTerm = groundedTerms.some((groundedTerm) => {
|
|
238
197
|
const groundedTermNode = groundedTerm.getNode(),
|
|
239
|
-
groundedTermNodeMatches = term.
|
|
198
|
+
groundedTermNodeMatches = term.matchTermNode(groundedTermNode);
|
|
240
199
|
|
|
241
200
|
if (groundedTermNodeMatches) {
|
|
242
201
|
return true;
|
|
@@ -254,8 +213,8 @@ class ScopedContext extends Context {
|
|
|
254
213
|
return judgementPresent;
|
|
255
214
|
}
|
|
256
215
|
|
|
257
|
-
isVariablePresentByVariableIdentifier(variableIdentifier
|
|
258
|
-
const variable = this.findVariableByVariableIdentifier(variableIdentifier
|
|
216
|
+
isVariablePresentByVariableIdentifier(variableIdentifier) {
|
|
217
|
+
const variable = this.findVariableByVariableIdentifier(variableIdentifier),
|
|
259
218
|
variablePresent = (variable !== null);
|
|
260
219
|
|
|
261
220
|
return variablePresent;
|
package/src/context.js
CHANGED
|
@@ -33,11 +33,18 @@ export default class Context extends ContextBase {
|
|
|
33
33
|
|
|
34
34
|
getFrames() {
|
|
35
35
|
const context = this.getContext(),
|
|
36
|
-
|
|
36
|
+
frames = context.getFrames();
|
|
37
37
|
|
|
38
38
|
return frames;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
getEqualities() {
|
|
42
|
+
const context = this.getContext(),
|
|
43
|
+
equalities = context.getEqualities();
|
|
44
|
+
|
|
45
|
+
return equalities;
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
getStatements() {
|
|
42
49
|
const context = this.getContext(),
|
|
43
50
|
statements = context.getStatements();
|
|
@@ -52,6 +59,13 @@ export default class Context extends ContextBase {
|
|
|
52
59
|
return references;
|
|
53
60
|
}
|
|
54
61
|
|
|
62
|
+
getEquivalences() {
|
|
63
|
+
const context = this.getContext(),
|
|
64
|
+
equivalences = context.getEquivalences();
|
|
65
|
+
|
|
66
|
+
return equivalences;
|
|
67
|
+
}
|
|
68
|
+
|
|
55
69
|
getSubstitutions() {
|
|
56
70
|
const context = this.getContext(),
|
|
57
71
|
substitutions = context.getSubstitutions();
|
|
@@ -102,20 +116,55 @@ export default class Context extends ContextBase {
|
|
|
102
116
|
return metavariable;
|
|
103
117
|
}
|
|
104
118
|
|
|
105
|
-
|
|
119
|
+
findRuleByReference(reference) {
|
|
106
120
|
const context = this.getContext(),
|
|
107
|
-
|
|
121
|
+
rule = context.findRuleByReference(reference);
|
|
108
122
|
|
|
109
|
-
return
|
|
123
|
+
return rule;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
findTopLevelAssertionByReference(reference) {
|
|
127
|
+
const context = this.getContext(),
|
|
128
|
+
topLevelAssertion = context.findTopLevelAssertionByReference(reference);
|
|
129
|
+
|
|
130
|
+
return topLevelAssertion;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
findMetaTypeByMetaTypeName(metaTypeName) {
|
|
134
|
+
const context = this.getContext(),
|
|
135
|
+
metaType = context.findMetaTypeByMetaTypeName(metaTypeName);
|
|
136
|
+
|
|
137
|
+
return metaType;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
findTermByTermNode(termNode) {
|
|
141
|
+
const context = this.getContext(),
|
|
142
|
+
term = context.findTermByTermNode(termNode);
|
|
143
|
+
|
|
144
|
+
return term;
|
|
110
145
|
}
|
|
111
146
|
|
|
112
147
|
findFrameByFrameNode(frameNode) {
|
|
113
148
|
const context = this.getContext(),
|
|
114
|
-
|
|
149
|
+
frame = context.findFrameByFrameNode(frameNode);
|
|
115
150
|
|
|
116
151
|
return frame;
|
|
117
152
|
}
|
|
118
153
|
|
|
154
|
+
findEqualityByEqualityNode(equalityNode) {
|
|
155
|
+
const context = this.getContext(),
|
|
156
|
+
equality = context.findEqualityByEqualityNode(equalityNode);
|
|
157
|
+
|
|
158
|
+
return equality;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
findJudgementByJudgementNode(judgementNode) {
|
|
162
|
+
const context = this.getContext(),
|
|
163
|
+
judgement = context.findJudgementByJudgementNode(judgementNode);
|
|
164
|
+
|
|
165
|
+
return judgement;
|
|
166
|
+
}
|
|
167
|
+
|
|
119
168
|
findStatementByStatementNode(statementNode) {
|
|
120
169
|
const context = this.getContext(),
|
|
121
170
|
statement = context.findStatementByStatementNode(statementNode);
|
|
@@ -180,32 +229,40 @@ export default class Context extends ContextBase {
|
|
|
180
229
|
return substitution;
|
|
181
230
|
}
|
|
182
231
|
|
|
183
|
-
|
|
232
|
+
findProcedureByProcedureName(procedureName) {
|
|
184
233
|
const context = this.getContext(),
|
|
185
|
-
|
|
234
|
+
procedure = context.findProcedureByProcedureName(procedureName);
|
|
186
235
|
|
|
187
|
-
return
|
|
236
|
+
return procedure;
|
|
188
237
|
}
|
|
189
238
|
|
|
190
|
-
|
|
239
|
+
isMetavariablePresent(metavariable) {
|
|
240
|
+
metavariable = this.findMetavariable(metavariable); ///
|
|
241
|
+
|
|
242
|
+
const metavariablePresent = (metavariable !== null);
|
|
243
|
+
|
|
244
|
+
return metavariablePresent;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
isLabelPresentByReference(reference) {
|
|
191
248
|
const context = this.getContext(),
|
|
192
|
-
|
|
249
|
+
labelPresent = context.isLabelPresentByReference(reference);
|
|
193
250
|
|
|
194
|
-
return
|
|
251
|
+
return labelPresent;
|
|
195
252
|
}
|
|
196
253
|
|
|
197
|
-
|
|
254
|
+
isMetavariablePresentByReference(reference) {
|
|
198
255
|
const context = this.getContext(),
|
|
199
|
-
|
|
256
|
+
metavariablePresent = context.isMetavariablePresentByReference(reference);
|
|
200
257
|
|
|
201
|
-
return
|
|
258
|
+
return metavariablePresent;
|
|
202
259
|
}
|
|
203
260
|
|
|
204
|
-
|
|
261
|
+
isTermPresentByTermNode(termNode) {
|
|
205
262
|
const context = this.getContext(),
|
|
206
|
-
|
|
263
|
+
termPresent = context.isTermPresentByTermNode(termNode);
|
|
207
264
|
|
|
208
|
-
return
|
|
265
|
+
return termPresent;
|
|
209
266
|
}
|
|
210
267
|
|
|
211
268
|
isFramePresentByFrameNode(frameNode) {
|
|
@@ -215,6 +272,20 @@ export default class Context extends ContextBase {
|
|
|
215
272
|
return framePresent;
|
|
216
273
|
}
|
|
217
274
|
|
|
275
|
+
isJudgementPresentByJudgementNode(judgementNode) {
|
|
276
|
+
const context = this.getContext(),
|
|
277
|
+
judgementPresent = context.isJudgementPresentByJudgementNode(judgementNode);
|
|
278
|
+
|
|
279
|
+
return judgementPresent;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
isEqualityPresentByEqualityNode(equalityNode) {
|
|
283
|
+
const context = this.getContext(),
|
|
284
|
+
equalityPresent = context.isEqualityPresentByEqualityNode(equalityNode);
|
|
285
|
+
|
|
286
|
+
return equalityPresent;
|
|
287
|
+
}
|
|
288
|
+
|
|
218
289
|
isStatementPresentByStatementNode(statementNode) {
|
|
219
290
|
const context = this.getContext(),
|
|
220
291
|
statementPresent = context.isStatementPresentByStatementNode(statementNode);
|
|
@@ -229,9 +300,9 @@ export default class Context extends ContextBase {
|
|
|
229
300
|
return assertionPresent;
|
|
230
301
|
}
|
|
231
302
|
|
|
232
|
-
|
|
303
|
+
isReferencePresentByMetavariableNode(metvvariableNode) {
|
|
233
304
|
const context = this.getContext(),
|
|
234
|
-
referencePresent = context.
|
|
305
|
+
referencePresent = context.isReferencePresentByMetavariableNode(metvvariableNode);
|
|
235
306
|
|
|
236
307
|
return referencePresent;
|
|
237
308
|
}
|
|
@@ -250,30 +321,17 @@ export default class Context extends ContextBase {
|
|
|
250
321
|
return substitutionPresent;
|
|
251
322
|
}
|
|
252
323
|
|
|
253
|
-
|
|
254
|
-
const context = this.getContext(),
|
|
255
|
-
labelPresent = context.isLabelPresentByReference(reference);
|
|
256
|
-
|
|
257
|
-
return labelPresent;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
isMetavariablePresentByReference(reference) {
|
|
324
|
+
isProcedurePresentByProcedureName(procedureName) {
|
|
261
325
|
const context = this.getContext(),
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return metavariablePresent;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
addRule(rule) {
|
|
268
|
-
const context = this.getContext();
|
|
326
|
+
procedurePresent = context.isProcedurePresentByProcedureName(procedureName);
|
|
269
327
|
|
|
270
|
-
|
|
328
|
+
return procedurePresent;
|
|
271
329
|
}
|
|
272
330
|
|
|
273
|
-
|
|
331
|
+
addTerm(term) {
|
|
274
332
|
const context = this.getContext();
|
|
275
333
|
|
|
276
|
-
context.
|
|
334
|
+
context.addTerm(term);
|
|
277
335
|
}
|
|
278
336
|
|
|
279
337
|
addFrame(frame) {
|
|
@@ -295,10 +353,9 @@ export default class Context extends ContextBase {
|
|
|
295
353
|
}
|
|
296
354
|
|
|
297
355
|
addJudgement(judgement) {
|
|
298
|
-
const context = this.getContext()
|
|
299
|
-
judgementAdded = context.addJudgement(judgement);
|
|
356
|
+
const context = this.getContext();
|
|
300
357
|
|
|
301
|
-
|
|
358
|
+
context.addJudgement(judgement);
|
|
302
359
|
}
|
|
303
360
|
|
|
304
361
|
addSubstitution(substitution) {
|
|
@@ -307,12 +364,6 @@ export default class Context extends ContextBase {
|
|
|
307
364
|
context.addSubstitution(substitution);
|
|
308
365
|
}
|
|
309
366
|
|
|
310
|
-
removeSubstitution(substitution) {
|
|
311
|
-
const context = this.getContext();
|
|
312
|
-
|
|
313
|
-
context.removeSubstitution(substitution);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
367
|
addSubproofOrProofAssertion(subproofOrProofAssertion) {
|
|
317
368
|
const context = this.getContext();
|
|
318
369
|
|
|
@@ -72,6 +72,10 @@ export default define(class ContainedAssertion extends Assertion {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
if (validates) {
|
|
75
|
+
const assertion = this; ///
|
|
76
|
+
|
|
77
|
+
context.addAssertion(assertion);
|
|
78
|
+
|
|
75
79
|
context.debug(`...validated the '${containedAssertionString}' contained assertion.`);
|
|
76
80
|
}
|
|
77
81
|
}
|
|
@@ -66,6 +66,10 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
if (validates) {
|
|
69
|
+
const assertion = this; ///
|
|
70
|
+
|
|
71
|
+
context.addAssertion(assertion);
|
|
72
|
+
|
|
69
73
|
context.debug(`...validates the '${definedAssertionString}' defined assertion.`);
|
|
70
74
|
}
|
|
71
75
|
}
|
|
@@ -88,9 +92,9 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
88
92
|
context.debug(`The '${termString}' term is not singular.`);
|
|
89
93
|
} else {
|
|
90
94
|
termValidates = this.term.validate(context, () => {
|
|
91
|
-
const
|
|
95
|
+
const validatesForwards = true;
|
|
92
96
|
|
|
93
|
-
return
|
|
97
|
+
return validatesForwards;
|
|
94
98
|
});
|
|
95
99
|
|
|
96
100
|
if (termValidates) {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import elements from "../../elements";
|
|
4
3
|
import Assertion from "../assertion";
|
|
5
4
|
|
|
6
5
|
import { define } from "../../elements";
|
|
7
|
-
import {
|
|
6
|
+
import { variableAssignmentFromPrepertyAssertion } from "../../process/assign";
|
|
8
7
|
|
|
9
8
|
export default define(class PropertyAssertion extends Assertion {
|
|
10
9
|
constructor(context, string, node, term, propertyRelation) {
|
|
@@ -76,7 +75,7 @@ export default define(class PropertyAssertion extends Assertion {
|
|
|
76
75
|
|
|
77
76
|
if (propertyRelationVerifies) {
|
|
78
77
|
let validatesWhenStated = false,
|
|
79
|
-
|
|
78
|
+
validatesWhenDerived = false;
|
|
80
79
|
|
|
81
80
|
if (stated) {
|
|
82
81
|
validatesWhenStated = this.validateWhenStated(assignments, context);
|
|
@@ -91,12 +90,12 @@ export default define(class PropertyAssertion extends Assertion {
|
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
if (validates) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
const assertion = this; ///
|
|
94
|
+
|
|
95
|
+
context.addAssertion(assertion);
|
|
96
|
+
|
|
97
|
+
this.assign(assignments, stated, context);
|
|
98
98
|
|
|
99
|
-
if (validates) {
|
|
100
99
|
context.debug(`...validated the '${propertyAssertionString}' property assertion.`);
|
|
101
100
|
}
|
|
102
101
|
}
|
|
@@ -172,30 +171,20 @@ export default define(class PropertyAssertion extends Assertion {
|
|
|
172
171
|
return validatesWhenDerived;
|
|
173
172
|
}
|
|
174
173
|
|
|
175
|
-
assign(assignments, context) {
|
|
174
|
+
assign(assignments, stated, context) {
|
|
176
175
|
if (assignments === null) {
|
|
177
176
|
return;
|
|
178
177
|
}
|
|
179
178
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
termNode = this.term.getNode();
|
|
184
|
-
|
|
185
|
-
variable = Variable.fromTermNode(termNode, context);
|
|
186
|
-
|
|
187
|
-
if (variable !== null) {
|
|
188
|
-
const variableIdentifier = variable.getIdentifier();
|
|
189
|
-
|
|
190
|
-
variable = context.findVariableByVariableIdentifier(variableIdentifier);
|
|
191
|
-
|
|
192
|
-
variable = Variable.fromVariableAndPropertyRelation(variable, this.propertyRelation);
|
|
179
|
+
if (!stated) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
193
182
|
|
|
194
|
-
|
|
195
|
-
|
|
183
|
+
const propertyAssertion = this, ///
|
|
184
|
+
variableAssigment = variableAssignmentFromPrepertyAssertion(propertyAssertion, context),
|
|
185
|
+
assignment = variableAssigment; ///
|
|
196
186
|
|
|
197
|
-
|
|
198
|
-
}
|
|
187
|
+
assignments.push(assignment);
|
|
199
188
|
}
|
|
200
189
|
|
|
201
190
|
static name = "PropertyAssertion";
|
|
@@ -54,6 +54,10 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
if (validates) {
|
|
57
|
+
const assertion = this; ///
|
|
58
|
+
|
|
59
|
+
context.addAssertion(assertion);
|
|
60
|
+
|
|
57
61
|
context.debug(`...validated the '${satisfiesAssertionString}' satisfies assertion.`);
|
|
58
62
|
}
|
|
59
63
|
}
|
|
@@ -48,6 +48,10 @@ export default define(class SubproofAssertion extends Assertion {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (validates) {
|
|
51
|
+
const assertion = this; ///
|
|
52
|
+
|
|
53
|
+
context.addAssertion(assertion);
|
|
54
|
+
|
|
51
55
|
context.debug(`...validated the '${subproofAssertionString}' subproof assertion.`);
|
|
52
56
|
}
|
|
53
57
|
}
|