occam-verify-cli 1.0.635 → 1.0.641
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 +15 -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 +30 -24
- package/lib/element/combinator/bracketed.js +3 -3
- package/lib/element/combinator.js +6 -6
- package/lib/element/conclusion.js +6 -2
- package/lib/element/constructor/bracketed.js +5 -3
- package/lib/element/declaration/combinator.js +15 -2
- package/lib/element/declaration/constructor.js +129 -60
- package/lib/element/deduction.js +6 -2
- package/lib/element/derivation.js +4 -5
- package/lib/element/equality.js +37 -31
- package/lib/element/frame.js +26 -21
- package/lib/element/hypothesis.js +8 -10
- package/lib/element/judgement.js +53 -21
- 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 +16 -16
- 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 +18 -15
- 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/element.js +124 -46
- package/lib/utilities/unification.js +6 -6
- package/lib/utilities/validation.js +68 -55
- package/package.json +7 -7
- 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 +13 -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 +32 -24
- package/src/element/combinator/bracketed.js +2 -2
- package/src/element/combinator.js +5 -6
- package/src/element/conclusion.js +7 -2
- package/src/element/constructor/bracketed.js +4 -2
- package/src/element/declaration/combinator.js +19 -1
- package/src/element/declaration/constructor.js +123 -60
- package/src/element/deduction.js +7 -2
- package/src/element/derivation.js +2 -3
- package/src/element/equality.js +45 -36
- package/src/element/frame.js +30 -21
- package/src/element/hypothesis.js +9 -6
- package/src/element/judgement.js +65 -21
- 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 +15 -15
- 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 +18 -14
- 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/element.js +187 -76
- package/src/utilities/unification.js +4 -5
- package/src/utilities/validation.js +83 -75
|
@@ -107,7 +107,7 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
107
107
|
compareMetavariable(metavariable) { return this.targetStatement.compareMetavariable(metavariable); }
|
|
108
108
|
|
|
109
109
|
validate(generalContext, specificContext) {
|
|
110
|
-
let
|
|
110
|
+
let statementSubstitution = null;
|
|
111
111
|
|
|
112
112
|
const context = this.getContext();
|
|
113
113
|
|
|
@@ -117,13 +117,15 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
117
117
|
|
|
118
118
|
context.trace(`Validating the '${statementSubstitutionString}' statement substitution...`);
|
|
119
119
|
|
|
120
|
-
const
|
|
120
|
+
const validSubstitution = this.findValidSubstiution(context);
|
|
121
121
|
|
|
122
|
-
if (
|
|
123
|
-
|
|
122
|
+
if (validSubstitution) {
|
|
123
|
+
statementSubstitution = validSubstitution; ///
|
|
124
124
|
|
|
125
125
|
context.debug(`...the '${statementSubstitutionString}' statement substitution is already valid.`);
|
|
126
126
|
} else {
|
|
127
|
+
let validates = false;
|
|
128
|
+
|
|
127
129
|
const targetStatementValidates = this.validateTargetStatement(generalContext, specificContext);
|
|
128
130
|
|
|
129
131
|
if (targetStatementValidates) {
|
|
@@ -137,13 +139,15 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
137
139
|
if (validates) {
|
|
138
140
|
const substitution = this; ///
|
|
139
141
|
|
|
142
|
+
statementSubstitution = substitution; ///
|
|
143
|
+
|
|
140
144
|
context.addSubstitution(substitution);
|
|
141
145
|
|
|
142
146
|
context.debug(`...validated the '${statementSubstitutionString}' statement substitution.`);
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
149
|
|
|
146
|
-
return
|
|
150
|
+
return statementSubstitution;
|
|
147
151
|
}
|
|
148
152
|
|
|
149
153
|
validateTargetStatement(generalContext, specificContext) {
|
|
@@ -159,9 +163,11 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
159
163
|
|
|
160
164
|
if (targetStatementSingular) {
|
|
161
165
|
const stated = true,
|
|
162
|
-
|
|
166
|
+
targetStatement = this.targetStatement.validate(stated, context);
|
|
163
167
|
|
|
164
|
-
|
|
168
|
+
if (targetStatement !== null) {
|
|
169
|
+
targetStatementValidates = true;
|
|
170
|
+
}
|
|
165
171
|
} else {
|
|
166
172
|
context.debug(`The '${statementSubstitutionString}' statement subtitution's '${targetStatementString}' target statement is not singular.`);
|
|
167
173
|
}
|
|
@@ -183,9 +189,11 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
183
189
|
context.trace(`Validating the '${statementSubstitutionString}' statement subtitution's '${replacementStatementString}' replacement statement...`);
|
|
184
190
|
|
|
185
191
|
const stated = true,
|
|
186
|
-
|
|
192
|
+
replacementStatement = this.replacementStatement.validate(stated, context);
|
|
187
193
|
|
|
188
|
-
|
|
194
|
+
if (replacementStatement !== null) {
|
|
195
|
+
replacementStatementValidates = true;
|
|
196
|
+
}
|
|
189
197
|
|
|
190
198
|
if (replacementStatementValidates) {
|
|
191
199
|
context.debug(`...validated the '${statementSubstitutionString}' statement subtitution's '${replacementStatementString}' replacement statement.`);
|
|
@@ -74,7 +74,7 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
validate(generalContext, specificContext) {
|
|
77
|
-
let
|
|
77
|
+
let termSubstitution = null;
|
|
78
78
|
|
|
79
79
|
const context = this.getContext();
|
|
80
80
|
|
|
@@ -84,13 +84,15 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
84
84
|
|
|
85
85
|
context.trace(`Validating the '${termSubstitutionString}' term substitution...`);
|
|
86
86
|
|
|
87
|
-
const
|
|
87
|
+
const validSubstitution = this.findValidSubstiution(context);
|
|
88
88
|
|
|
89
|
-
if (
|
|
90
|
-
|
|
89
|
+
if (validSubstitution) {
|
|
90
|
+
termSubstitution = validSubstitution; ///
|
|
91
91
|
|
|
92
92
|
context.debug(`...the '${termSubstitutionString}' term substitution is alrady valid.`);
|
|
93
93
|
} else {
|
|
94
|
+
let validates = false;
|
|
95
|
+
|
|
94
96
|
const targetTermValidates = this.validateTargetTerm(generalContext, specificContext);
|
|
95
97
|
|
|
96
98
|
if (targetTermValidates) {
|
|
@@ -104,13 +106,15 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
104
106
|
if (validates) {
|
|
105
107
|
const substitution = this; ///
|
|
106
108
|
|
|
109
|
+
termSubstitution = substitution; ///
|
|
110
|
+
|
|
107
111
|
context.addSubstitution(substitution);
|
|
108
112
|
|
|
109
113
|
context.debug(`...validated the '${termSubstitutionString}' term substitution.`);
|
|
110
114
|
}
|
|
111
115
|
}
|
|
112
116
|
|
|
113
|
-
return
|
|
117
|
+
return termSubstitution;
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
validateTargetTerm(generalContext, specificContext) {
|
|
@@ -125,11 +129,17 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
125
129
|
const targetTermSingular = this.targetTerm.isSingular();
|
|
126
130
|
|
|
127
131
|
if (targetTermSingular) {
|
|
128
|
-
|
|
132
|
+
const targetTerm = this.targetTerm.validate(context, () => {
|
|
129
133
|
const validatesForwards = true;
|
|
130
134
|
|
|
131
135
|
return validatesForwards;
|
|
132
136
|
});
|
|
137
|
+
|
|
138
|
+
if (targetTerm !== null) {
|
|
139
|
+
this.targetTerm = targetTerm;
|
|
140
|
+
|
|
141
|
+
targetTermValidates = true;
|
|
142
|
+
}
|
|
133
143
|
} else {
|
|
134
144
|
context.debug(`The '${termSubstitutionString}' term subtitution's '${targetTermString}' target term is not singular.`);
|
|
135
145
|
}
|
|
@@ -142,7 +152,7 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
142
152
|
}
|
|
143
153
|
|
|
144
154
|
validateReplacementTerm(generalContext, specificContext) {
|
|
145
|
-
let replacementTermValidates;
|
|
155
|
+
let replacementTermValidates = false;
|
|
146
156
|
|
|
147
157
|
const context = specificContext, ///
|
|
148
158
|
replacementTermString = this.replacementTerm.getString(),
|
|
@@ -150,12 +160,18 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
150
160
|
|
|
151
161
|
context.trace(`Validating the '${termSubstitutionString}' term subtitution's '${replacementTermString}' replacement term...`);
|
|
152
162
|
|
|
153
|
-
|
|
163
|
+
const replacementTerm = this.replacementTerm.validate(context, () => {
|
|
154
164
|
const validatesForwards = true;
|
|
155
165
|
|
|
156
166
|
return validatesForwards;
|
|
157
167
|
});
|
|
158
168
|
|
|
169
|
+
if (replacementTerm !== null) {
|
|
170
|
+
this.replacementTerm = replacementTerm;
|
|
171
|
+
|
|
172
|
+
replacementTermValidates = true;
|
|
173
|
+
}
|
|
174
|
+
|
|
159
175
|
if (replacementTermValidates) {
|
|
160
176
|
context.debug(`...validated the '${termSubstitutionString}' term subtitution's '${replacementTermString}' replacement term...`);
|
|
161
177
|
}
|
|
@@ -34,12 +34,12 @@ export default class Substitution extends Element {
|
|
|
34
34
|
return equalTo;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
findValidSubstiution(context) {
|
|
38
38
|
const substitutionNode = this.getSubstitutionNode(),
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
substitution = context.findSubstitutionBySubstitutionNode(substitutionNode),
|
|
40
|
+
validSubstitution = substitution; ///
|
|
41
41
|
|
|
42
|
-
return
|
|
42
|
+
return validSubstitution;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
isEqualTo(substitution) {
|
package/src/element/term.js
CHANGED
|
@@ -68,12 +68,12 @@ export default define(class Term extends Element {
|
|
|
68
68
|
return comparesToVariableIdentifier;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
findValidTerm(context) {
|
|
72
72
|
const termNode = this.getTermNode(),
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
term = context.findTermByTermNode(termNode),
|
|
74
|
+
validTerm = term; ///
|
|
75
75
|
|
|
76
|
-
return
|
|
76
|
+
return validTerm;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
isEqualTo(term) {
|
|
@@ -149,23 +149,27 @@ export default define(class Term extends Element {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
validate(context, validateForwards) {
|
|
152
|
-
let
|
|
152
|
+
let term = null;
|
|
153
153
|
|
|
154
154
|
const termString = this.getString(); ///
|
|
155
155
|
|
|
156
156
|
context.trace(`Validating the '${termString}' term...`);
|
|
157
157
|
|
|
158
|
-
const
|
|
158
|
+
const validTerm = this.findValidTerm(context),
|
|
159
|
+
valid = (validTerm !== null);
|
|
159
160
|
|
|
160
161
|
if (valid) {
|
|
161
|
-
|
|
162
|
+
const validatesForward = validateForwards();
|
|
162
163
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const term = this; ///
|
|
164
|
+
if (validatesForward) {
|
|
165
|
+
term = validTerm; ///
|
|
166
166
|
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
context.debug(`...the '${termString}' term is already valid.`);
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
const validates = validateTerms.some((validateTerm) => { ///
|
|
171
|
+
const term = this, ///
|
|
172
|
+
termValidates = validateTerm(term, context, validateForwards);
|
|
169
173
|
|
|
170
174
|
if (termValidates) {
|
|
171
175
|
return true;
|
|
@@ -173,7 +177,7 @@ export default define(class Term extends Element {
|
|
|
173
177
|
});
|
|
174
178
|
|
|
175
179
|
if (validates) {
|
|
176
|
-
|
|
180
|
+
term = this; ///
|
|
177
181
|
|
|
178
182
|
context.addTerm(term);
|
|
179
183
|
|
|
@@ -181,7 +185,7 @@ export default define(class Term extends Element {
|
|
|
181
185
|
}
|
|
182
186
|
}
|
|
183
187
|
|
|
184
|
-
return
|
|
188
|
+
return term;
|
|
185
189
|
}
|
|
186
190
|
|
|
187
191
|
validateGivenType(type, context) {
|
|
@@ -4,8 +4,6 @@ import { Element } from "occam-languages";
|
|
|
4
4
|
import { arrayUtilities } from "necessary";
|
|
5
5
|
import { asynchronousUtilities } from "occam-languages";
|
|
6
6
|
|
|
7
|
-
import assignAssignments from "../process/assign";
|
|
8
|
-
|
|
9
7
|
import { asyncScope } from "../utilities/context";
|
|
10
8
|
import { labelsFromJSON,
|
|
11
9
|
deductionFromJSON,
|
|
@@ -251,14 +249,13 @@ export default class TopLevelAssertion extends Element {
|
|
|
251
249
|
context.trace(`Verifying the '${topLevelAssertionString}' top level assertion's suppositions...`);
|
|
252
250
|
|
|
253
251
|
suppositionsVerify = await asyncForwardsEvery(this.suppositions, async (supposition) => {
|
|
254
|
-
const
|
|
255
|
-
suppositionVerifies = await supposition.verify(assignments, context)
|
|
252
|
+
const suppositionVerifies = await supposition.verify(context)
|
|
256
253
|
|
|
257
254
|
if (suppositionVerifies) {
|
|
258
|
-
assignAssignments(assignments, context);
|
|
259
|
-
|
|
260
255
|
const subproofOrProofAssertion = supposition; ////
|
|
261
256
|
|
|
257
|
+
context.assignAssignments();
|
|
258
|
+
|
|
262
259
|
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
263
260
|
|
|
264
261
|
return true;
|
|
@@ -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 { asyncScope } from "../utilities/context";
|
|
8
6
|
import { labelFromJSON,
|
|
9
7
|
labelToLabelJSON,
|
|
@@ -155,14 +153,13 @@ export default class TopLevelMetaAssertion extends Element {
|
|
|
155
153
|
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta assertion's suppositions...`);
|
|
156
154
|
|
|
157
155
|
suppositionsVerify = await asyncForwardsEvery(this.suppositions, async (supposition) => {
|
|
158
|
-
const
|
|
159
|
-
suppositionVerifies = await supposition.verify(assignments, context)
|
|
156
|
+
const suppositionVerifies = await supposition.verify(context)
|
|
160
157
|
|
|
161
158
|
if (suppositionVerifies) {
|
|
162
|
-
assignAssignments(assignments, context);
|
|
163
|
-
|
|
164
159
|
const subproofOrProofAssertion = supposition; ////
|
|
165
160
|
|
|
161
|
+
context.assignAssignments();
|
|
162
|
+
|
|
166
163
|
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
167
164
|
|
|
168
165
|
return true;
|
package/src/element/variable.js
CHANGED
|
@@ -166,11 +166,15 @@ export default define(class Variable extends Element {
|
|
|
166
166
|
termTypeEqualToOrSubTypeOfVariableType = termType.isEqualToOrSubTypeOf(variableType);
|
|
167
167
|
|
|
168
168
|
if (termTypeEqualToOrSubTypeOfVariableType) {
|
|
169
|
-
const { TermSubstitution } = elements
|
|
170
|
-
termSubstitution = TermSubstitution.fromTermAndVariable(term, variable, context),
|
|
171
|
-
termSubstitutionValidates = termSubstitution.validate(generalContext, specificContext);
|
|
169
|
+
const { TermSubstitution } = elements;
|
|
172
170
|
|
|
173
|
-
|
|
171
|
+
let termSubstitution;
|
|
172
|
+
|
|
173
|
+
termSubstitution = TermSubstitution.fromTermAndVariable(term, variable, context);
|
|
174
|
+
|
|
175
|
+
termSubstitution = termSubstitution.validate(generalContext, specificContext); ///
|
|
176
|
+
|
|
177
|
+
if (termSubstitution !== null) {
|
|
174
178
|
termUnifies = true;
|
|
175
179
|
}
|
|
176
180
|
}
|
package/src/process/assign.js
CHANGED
|
@@ -105,12 +105,6 @@ export function variableAssignmentFromPrepertyAssertion(propertyAssertion, conte
|
|
|
105
105
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
export default function assignAssignments(assignments, context) {
|
|
109
|
-
assignments.forEach((assignment) => {
|
|
110
|
-
assignment(context);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
108
|
function variableAssignmentFromVariableNodeAndType(variableNode, type, context) {
|
|
115
109
|
const variable = variableFromVariableNode(variableNode, context);
|
|
116
110
|
|
package/src/process/unify.js
CHANGED
|
@@ -149,7 +149,7 @@ class CombinatorPass extends ZipPass {
|
|
|
149
149
|
{
|
|
150
150
|
generalNodeQuery: metaTypeNodeQuery,
|
|
151
151
|
specificNodeQuery: statementNodeQuery,
|
|
152
|
-
run: (generalMetaTypeNode, specificStatementNode,
|
|
152
|
+
run: (generalMetaTypeNode, specificStatementNode, stated, generalContext, specificContext) => {
|
|
153
153
|
let success = false;
|
|
154
154
|
|
|
155
155
|
const metaTypeNode = generalMetaTypeNode, ///
|
|
@@ -165,7 +165,7 @@ class CombinatorPass extends ZipPass {
|
|
|
165
165
|
context = specificContext; ///
|
|
166
166
|
|
|
167
167
|
const statement = statementFromStatementNode(statementNode, context),
|
|
168
|
-
statementValidatesGivenType = statement.validateGivenMetaType(metaType,
|
|
168
|
+
statementValidatesGivenType = statement.validateGivenMetaType(metaType, stated, context);
|
|
169
169
|
|
|
170
170
|
if (statementValidatesGivenType) {
|
|
171
171
|
success = true;
|
|
@@ -177,7 +177,7 @@ class CombinatorPass extends ZipPass {
|
|
|
177
177
|
{
|
|
178
178
|
generalNodeQuery: metaTypeNodeQuery,
|
|
179
179
|
specificNodeQuery: frameNodeQuery,
|
|
180
|
-
run: (generalMetaTypeNode, specificFrameNode,
|
|
180
|
+
run: (generalMetaTypeNode, specificFrameNode, stated, generalContext, specificContext) => {
|
|
181
181
|
let success = false;
|
|
182
182
|
|
|
183
183
|
const metaTypeNode = generalMetaTypeNode, ///
|
|
@@ -193,7 +193,7 @@ class CombinatorPass extends ZipPass {
|
|
|
193
193
|
context = specificContext; ///
|
|
194
194
|
|
|
195
195
|
const frame = frameFromFrameNode(frameNode, context),
|
|
196
|
-
frameValidatesGivenMetaType = frame.validateGivenMetaType(metaType,
|
|
196
|
+
frameValidatesGivenMetaType = frame.validateGivenMetaType(metaType, stated, context);
|
|
197
197
|
|
|
198
198
|
if (frameValidatesGivenMetaType) {
|
|
199
199
|
success = true;
|
|
@@ -205,7 +205,7 @@ class CombinatorPass extends ZipPass {
|
|
|
205
205
|
{
|
|
206
206
|
generalNodeQuery: typeNodeQuery,
|
|
207
207
|
specificNodeQuery: termNodeQuery,
|
|
208
|
-
run: (generalTypeNode, specificTermNode,
|
|
208
|
+
run: (generalTypeNode, specificTermNode, stated, generalContext, specificContext) => {
|
|
209
209
|
let success = false;
|
|
210
210
|
|
|
211
211
|
const typeNode = generalTypeNode, ///
|
|
@@ -412,13 +412,13 @@ export function unifyStatementIntrinsically(generalStatement, specificStatement,
|
|
|
412
412
|
return statementUnifiesIntrinsically;
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
-
export function unifyStatementWithCombinator(statement, combinator,
|
|
415
|
+
export function unifyStatementWithCombinator(statement, combinator, stated, generalContext, specificContext) {
|
|
416
416
|
let statementUnifiesWithCombinator = false;
|
|
417
417
|
|
|
418
418
|
const statementNode = statement.getNode(),
|
|
419
419
|
combinatorStatement = combinator.getStatement(),
|
|
420
420
|
combinatorStatementNode = combinatorStatement.getNode(),
|
|
421
|
-
success = combinatorPass.run(combinatorStatementNode, statementNode,
|
|
421
|
+
success = combinatorPass.run(combinatorStatementNode, statementNode, stated, generalContext, specificContext);
|
|
422
422
|
|
|
423
423
|
if (success) {
|
|
424
424
|
statementUnifiesWithCombinator = true;
|
package/src/process/validate.js
CHANGED
|
@@ -32,10 +32,13 @@ class TermPass extends ForwardPass {
|
|
|
32
32
|
run: (termNode, context, validateForwards) => {
|
|
33
33
|
let success = false;
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
termValidates = term.validate(context, validateForwards);
|
|
35
|
+
let term;
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
term = termFromTermNode(termNode, context);
|
|
38
|
+
|
|
39
|
+
term = term.validate(context, validateForwards); ///
|
|
40
|
+
|
|
41
|
+
if (term !== null) {
|
|
39
42
|
success = true;
|
|
40
43
|
}
|
|
41
44
|
|
|
@@ -91,12 +94,15 @@ class StatementPass extends SimplePass {
|
|
|
91
94
|
run: (statementNode, context) => {
|
|
92
95
|
let success = false;
|
|
93
96
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
let statement;
|
|
98
|
+
|
|
99
|
+
const stated = true;
|
|
100
|
+
|
|
101
|
+
statement = statementFromStatementNode(statementNode, context);
|
|
98
102
|
|
|
99
|
-
|
|
103
|
+
statement = statement.validate(stated, context); ///
|
|
104
|
+
|
|
105
|
+
if (statement !== null) {
|
|
100
106
|
success = true;
|
|
101
107
|
}
|
|
102
108
|
|
|
@@ -108,14 +114,17 @@ class StatementPass extends SimplePass {
|
|
|
108
114
|
run: (termNode, context) => {
|
|
109
115
|
let success = false;
|
|
110
116
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
117
|
+
let term;
|
|
118
|
+
|
|
119
|
+
term = termFromTermNode(termNode, context);
|
|
120
|
+
|
|
121
|
+
term = term.validate(context, () => { ///
|
|
122
|
+
const validatesForwards = true;
|
|
114
123
|
|
|
115
|
-
|
|
116
|
-
|
|
124
|
+
return validatesForwards;
|
|
125
|
+
});
|
|
117
126
|
|
|
118
|
-
if (
|
|
127
|
+
if (term !== null) {
|
|
119
128
|
success = true;
|
|
120
129
|
}
|
|
121
130
|
|
package/src/process/verify.js
CHANGED
|
@@ -294,12 +294,15 @@ class ConbinatorPass extends SimplePass {
|
|
|
294
294
|
run: (statementNode, context) => {
|
|
295
295
|
let success = false;
|
|
296
296
|
|
|
297
|
-
|
|
298
|
-
stated = false,
|
|
299
|
-
assignments = null,
|
|
300
|
-
statementValidates = statement.validate(assignments, stated, context);
|
|
297
|
+
let statement;
|
|
301
298
|
|
|
302
|
-
|
|
299
|
+
const stated = true;
|
|
300
|
+
|
|
301
|
+
statement = statementFromStatementNode(statementNode, context);
|
|
302
|
+
|
|
303
|
+
statement = statement.validate(stated, context);
|
|
304
|
+
|
|
305
|
+
if (statement !== null) {
|
|
303
306
|
success = true;
|
|
304
307
|
}
|
|
305
308
|
|
|
@@ -311,14 +314,17 @@ class ConbinatorPass extends SimplePass {
|
|
|
311
314
|
run: (termNode, context) => {
|
|
312
315
|
let success = false;
|
|
313
316
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
+
let term;
|
|
318
|
+
|
|
319
|
+
term = termFromTermNode(termNode, context);
|
|
317
320
|
|
|
318
|
-
|
|
319
|
-
|
|
321
|
+
term = term.validate(context, () => { ///
|
|
322
|
+
const validatesForwards = true;
|
|
320
323
|
|
|
321
|
-
|
|
324
|
+
return validatesForwards;
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
if (term !== null) {
|
|
322
328
|
success = true;
|
|
323
329
|
}
|
|
324
330
|
|
|
@@ -350,14 +356,17 @@ class ConstructorPass extends SimplePass {
|
|
|
350
356
|
run: (termNode, context) => {
|
|
351
357
|
let success = false;
|
|
352
358
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
359
|
+
let term;
|
|
360
|
+
|
|
361
|
+
term = termFromTermNode(termNode, context);
|
|
362
|
+
|
|
363
|
+
term = term.validate(context, () => { ///
|
|
364
|
+
const validatesForwards = true;
|
|
356
365
|
|
|
357
|
-
|
|
358
|
-
|
|
366
|
+
return validatesForwards;
|
|
367
|
+
});
|
|
359
368
|
|
|
360
|
-
if (
|
|
369
|
+
if (term !== null) {
|
|
361
370
|
success = true;
|
|
362
371
|
}
|
|
363
372
|
|