occam-verify-cli 0.0.1066 → 0.0.1067

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.
Files changed (57) hide show
  1. package/lib/assertion/contained.js +2 -1
  2. package/lib/assertion/defined.js +2 -1
  3. package/lib/conclusion.js +6 -2
  4. package/lib/consequent.js +6 -2
  5. package/lib/context/file.js +7 -7
  6. package/lib/context/local.js +12 -25
  7. package/lib/metavariable.js +15 -54
  8. package/lib/mixins/statement/unify.js +17 -2
  9. package/lib/mixins/statement/verify.js +2 -11
  10. package/lib/premise.js +6 -2
  11. package/lib/proofStep.js +22 -13
  12. package/lib/rule.js +6 -2
  13. package/lib/statement/qualified.js +30 -17
  14. package/lib/statement/unqualified.js +5 -5
  15. package/lib/statement.js +18 -9
  16. package/lib/subproof.js +1 -1
  17. package/lib/substitution/frameForMetavariable.js +35 -27
  18. package/lib/substitution/statementForMetavariable.js +93 -54
  19. package/lib/substitution/termForVariable.js +30 -31
  20. package/lib/substitution.js +48 -13
  21. package/lib/substitutions.js +22 -19
  22. package/lib/supposition.js +6 -2
  23. package/lib/unifier/metaLevel.js +14 -11
  24. package/lib/unify/metavariableWithFrame.js +2 -2
  25. package/lib/variable.js +10 -10
  26. package/package.json +2 -2
  27. package/src/assertion/contained.js +2 -0
  28. package/src/assertion/defined.js +2 -0
  29. package/src/conclusion.js +8 -1
  30. package/src/consequent.js +8 -1
  31. package/src/context/file.js +6 -8
  32. package/src/context/local.js +12 -33
  33. package/src/metavariable.js +24 -74
  34. package/src/mixins/statement/unify.js +24 -1
  35. package/src/mixins/statement/verify.js +1 -15
  36. package/src/premise.js +8 -1
  37. package/src/proofStep.js +28 -12
  38. package/src/rule.js +7 -1
  39. package/src/statement/qualified.js +38 -21
  40. package/src/statement/unqualified.js +4 -4
  41. package/src/statement.js +18 -12
  42. package/src/subproof.js +0 -1
  43. package/src/substitution/frameForMetavariable.js +47 -42
  44. package/src/substitution/statementForMetavariable.js +102 -61
  45. package/src/substitution/termForVariable.js +41 -50
  46. package/src/substitution.js +40 -11
  47. package/src/substitutions.js +32 -25
  48. package/src/supposition.js +8 -1
  49. package/src/unifier/metaLevel.js +23 -17
  50. package/src/unify/metavariableWithFrame.js +2 -2
  51. package/src/variable.js +7 -7
  52. package/lib/resolve/complexSubstitutionAgainstSimpleSubstitution.js +0 -62
  53. package/lib/resolve/substitution.js +0 -27
  54. package/lib/resolve/substitutions.js +0 -37
  55. package/src/resolve/complexSubstitutionAgainstSimpleSubstitution.js +0 -79
  56. package/src/resolve/substitution.js +0 -19
  57. package/src/resolve/substitutions.js +0 -31
@@ -113,6 +113,7 @@ export default class Substitutions {
113
113
 
114
114
  return substitution;
115
115
  }
116
+
116
117
  findSubstitutionsByMetavariableNode(metavariableNode) {
117
118
  const substitutions = this.findSubstitutions((substitution) => {
118
119
  const metavariableNodeMatches = substitution.matchMetavariableNode(metavariableNode);
@@ -153,31 +154,25 @@ export default class Substitutions {
153
154
  return complexSubstitutions;
154
155
  }
155
156
 
156
- findSubstitutionsByMetavariableNodeAndSubstitutionNode(metavariableNode, substitutionNode) {
157
+ findSubstitutionByMetavariableNodeAndSubstitutionNode(metavariableNode, substitutionNode) {
157
158
  const substitutions = this.findSubstitutions((substitution) => {
158
- const metavariableNodeAndSubstitutionNodeMatch = substitution.matchMetavariableNodeAndSubstitutionNode(metavariableNode, substitutionNode);
159
-
160
- if (metavariableNodeAndSubstitutionNodeMatch) {
161
- return true;
162
- }
163
- });
164
-
165
- return substitutions;
166
- }
167
-
168
- findComplexSubstitutionByMetavariableNodeAndSubstitutionNode(metavariableNode, substitutionNode) {
169
- const substitutions = this.findSubstitutionsByMetavariableNodeAndSubstitutionNode(metavariableNode, substitutionNode),
170
- complexSubstitutions = substitutions.filterSubstitution((substitution) => {
171
- const substitutionComplex = substitution.isComplex();
159
+ const metavariableNodeAndSubstitutionNodeMatch = substitution.matchMetavariableNodeAndSubstitutionNode(metavariableNode, substitutionNode);
172
160
 
173
- if (substitutionComplex) {
161
+ if (metavariableNodeAndSubstitutionNodeMatch) {
174
162
  return true;
175
163
  }
176
164
  }),
177
- firstComplexSubstitution = complexSubstitutions.getFirstSubstitution(),
178
- complexSubstitution = firstComplexSubstitution; ///
165
+ firstSubstitution = substitutions.getFirstSubstitution(),
166
+ substitution = firstSubstitution; ///
167
+
168
+ return substitution;
169
+ }
170
+
171
+ isSubstitutionPresentByMetavariableNodeAndSubstitutionNode(metavariableNode, substitutionNode) {
172
+ const substitution = this.findSubstitutionByMetavariableNodeAndSubstitutionNode(metavariableNode, substitutionNode),
173
+ substitutionPresent = (substitution !== null);
179
174
 
180
- return complexSubstitution;
175
+ return substitutionPresent;
181
176
  }
182
177
 
183
178
  addSubstitution(substitution, localContext) {
@@ -218,12 +213,24 @@ export default class Substitutions {
218
213
  return unifiedWithEquivalences;
219
214
  }
220
215
 
221
- areResolved() {
222
- const resolved = this.everySubstitution((substitution) => {
223
- const substitutionResolved = substitution.isResolved();
224
-
225
- return substitutionResolved;
226
- });
216
+ resolve(localContext) {
217
+ const metavariableNodes = this.getMetavariableNodes(),
218
+ resolved = metavariableNodes.every((metavariableNode) => {
219
+ const complexSubstitutions = this.findComplexSubstitutionsByMetavariableNode(metavariableNode),
220
+ complexSubstitutionsResolved = complexSubstitutions.everySubstitution((complexSubstitution) => {
221
+ const substitution = complexSubstitution, ///
222
+ substitutions = this, ///
223
+ substitutionResolved = substitution.resolve(substitutions, localContext);
224
+
225
+ if (substitutionResolved) {
226
+ return true;
227
+ }
228
+ });
229
+
230
+ if (complexSubstitutionsResolved) {
231
+ return true;
232
+ }
233
+ });
227
234
 
228
235
  return resolved;
229
236
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import shim from "./shim";
4
+ import LocalContext from "./context/local";
4
5
  import SubproofAssertion from "./assertion/subproof";
5
6
  import UnqualifiedStatement from "./statement/unqualified";
6
7
 
@@ -114,7 +115,13 @@ export default class Supposition {
114
115
 
115
116
  localContext.trace(`Unifying the '${statementString}' statement with the '${suppositionString}' supposition...`);
116
117
 
117
- statementUnified = this.unqualifiedStatement.unifyStatement(statement, substitutions, this.fileContext, localContext);
118
+ const localContextB = localContext;
119
+
120
+ localContext = LocalContext.fromFileContext(this.fileContext);
121
+
122
+ const localContextA = localContext; ///
123
+
124
+ statementUnified = this.unqualifiedStatement.unifyStatement(statement, substitutions, localContextA, localContextB);
118
125
 
119
126
  if (statementUnified) {
120
127
  localContext.debug(`...unified the '${statementString}' statement with the '${suppositionString}' supposition.`);
@@ -2,7 +2,8 @@
2
2
 
3
3
  import shim from "../shim";
4
4
  import Unifier from "../unifier";
5
- import unifyMetavariableWithFrame from "../unify/metavariableWithFrame";
5
+ import TermForVariableSubstitution from "../substitution/termForVariable";
6
+ import FrameForMetavariableSubstitution from "../substitution/frameForMetavariable";
6
7
 
7
8
  import { nodeQuery } from "../utilities/query";
8
9
  import { variableNameFromVariableNode, metavariableNameFromMetavariableNode } from "../utilities/name";
@@ -39,27 +40,32 @@ class MetaLevelUnifier extends Unifier {
39
40
  if (matches) {
40
41
  statementUnified = true;
41
42
  } else {
42
- const statementNode = statementNodeA, ///
43
- statementSubstitution = null, ///
44
- statementMetavariableNode = statementMetavariableNodeQuery(statementNode);
43
+ let localContext,
44
+ statementNode;
45
+
46
+ localContext = localContextA; ///
47
+
48
+ statementNode = statementNodeA; ///
49
+
50
+ const statementMetavariableNode = statementMetavariableNodeQuery(statementNode);
45
51
 
46
52
  if (statementMetavariableNode !== null) {
53
+ const substitution = FrameForMetavariableSubstitution.fromStatementNode(statementNode, localContext) ||
54
+ TermForVariableSubstitution.fromStatementNode(statementNode, localContext) ||
55
+ null;
56
+
47
57
  const { Statement } = shim,
48
58
  metavariableNode = statementMetavariableNode, ///
49
59
  metavariableName = metavariableNameFromMetavariableNode(metavariableNode),
50
- metavariable = localContextA.findMetavariableByMetavariableName(metavariableName),
51
- substitution = statementSubstitution, ///
52
- localContext = localContextB, ///
53
- statementNode = statementNodeB, ///
54
- statement = Statement.fromStatementNode(statementNode, localContext);
55
-
56
- if (substitution === null) {
57
- statementUnified = metavariable.unifyStatement(statement, substitutions, localContext);
58
- } else {
59
- const statementUnifiedGivenSubstitution = metavariable.unifyStatementGivenSubstitution(statement, substitution, substitutions, localContext);
60
-
61
- statementUnified = statementUnifiedGivenSubstitution; ///
62
- }
60
+ metavariable = localContextA.findMetavariableByMetavariableName(metavariableName);
61
+
62
+ localContext = localContextB; ///
63
+
64
+ statementNode = statementNodeB; ///
65
+
66
+ const statement = Statement.fromStatementNode(statementNode, localContext);
67
+
68
+ statementUnified = metavariable.unifyStatement(statement, substitution, substitutions, localContext);
63
69
  } else {
64
70
  statementUnified = unifyStatementWithStatement(statementNodeA, statementNodeB, substitutions, localContextA, localContextB);
65
71
  }
@@ -26,8 +26,8 @@ export default function unifyMetavariableWithFrame(metavariableNodeA, frameNodeB
26
26
  metavariableUnifiedWithFrame = true;
27
27
  } else {
28
28
  const frameNode = frameNodeB, ///
29
- metavariableNode = metavariableNodeA, ///
30
- frameForMetavariableSubstitution = FrameForMetavariableSubstitution.fromFrameNodeAndMetavariableNode(frameNode, metavariableNode, localContextA, localContextB),
29
+ metavariable = metavariableA, ///
30
+ frameForMetavariableSubstitution = FrameForMetavariableSubstitution.fromFrameAndMetavariable(frame, metavariable, localContextA, localContextB),
31
31
  substitution = frameForMetavariableSubstitution; ///
32
32
 
33
33
  substitutions.addSubstitution(substitution, localContextA, localContextB);
package/src/variable.js CHANGED
@@ -46,16 +46,16 @@ class Variable {
46
46
  this.type = type;
47
47
  }
48
48
 
49
- matchNode(node) {
50
- const nodeMatches = this.node.match(node);
49
+ matchVariableName(variableName) {
50
+ const variableNameMatches = (this.name === variableName);
51
51
 
52
- return nodeMatches;
52
+ return variableNameMatches;
53
53
  }
54
54
 
55
- matchName(name) {
56
- const nameMatches = (this.name === name);
55
+ matchVariableNode(variableNode) {
56
+ const variableNodeMatches = this.node.match(variableNode);
57
57
 
58
- return nameMatches;
58
+ return variableNodeMatches;
59
59
  }
60
60
 
61
61
  verify(localContext) {
@@ -165,7 +165,7 @@ class Variable {
165
165
  if (termVariable === variable) {
166
166
  termUnified = true;
167
167
  } else {
168
- const termForVariableSubstitution = TermForVariableSubstitution.fromTernAndVariable(term, variable),
168
+ const termForVariableSubstitution = TermForVariableSubstitution.fromTernAndVariable(term, variable, localContext),
169
169
  substitution = termForVariableSubstitution; ///
170
170
 
171
171
  substitutions.addSubstitution(substitution, localContext);
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return resolveComplexSubstitutionAgainstSimpleSubstitution;
9
- }
10
- });
11
- var _substitutions = /*#__PURE__*/ _interop_require_default(require("../substitutions"));
12
- var _simpleSubstitutionStatementWithComplexSubstitutionStatement = /*#__PURE__*/ _interop_require_default(require("../unify/simpleSubstitutionStatementWithComplexSubstitutionStatement"));
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- function resolveComplexSubstitutionAgainstSimpleSubstitution(complexSubstitution, simpleSubstitution, substitutions, localContextA, localContextB) {
19
- var complexSubstitutionResolvedAgainstSimpleSubstitution = false;
20
- var statementNode = complexSubstitution.getStatementNode(), simpleSubstitutionString = simpleSubstitution.asString(localContextA, localContextB), complexSubstitutionString = complexSubstitution.asString(localContextA, localContextB);
21
- localContextB.trace("Resolving the complex ".concat(complexSubstitutionString, " substitution against the simple ").concat(simpleSubstitutionString, " substitution..."), statementNode);
22
- var transformedSubstitution = transformedSubstitutionFromComplexSubstitution(complexSubstitution, substitutions, localContextA, localContextB);
23
- if (transformedSubstitution !== null) {
24
- var substitution = substitutionFromComplexSubstitutionAndAndSimpleSubstitution(complexSubstitution, simpleSubstitution, localContextA, localContextB);
25
- if (substitution !== null) {
26
- var substitutionString = substitution.asString(localContextB, localContextB), transformedSubstitutionString = transformedSubstitution.asString(localContextB, localContextB);
27
- localContextB.trace("Equating the ".concat(substitutionString, " substitution to the transformed ").concat(transformedSubstitutionString, " substitution..."), statementNode);
28
- var substitutionEqualToTransformedSubstitution = substitution.isEqualTo(transformedSubstitution);
29
- complexSubstitutionResolvedAgainstSimpleSubstitution = substitutionEqualToTransformedSubstitution; ///
30
- }
31
- }
32
- if (complexSubstitutionResolvedAgainstSimpleSubstitution) {
33
- localContextB.debug("...resolved the complex ".concat(complexSubstitutionString, " substitution against the simple ").concat(simpleSubstitutionString, " substitution."), statementNode);
34
- }
35
- return complexSubstitutionResolvedAgainstSimpleSubstitution;
36
- }
37
- function transformedSubstitutionFromComplexSubstitution(complexSubstitution, substitutions, localContextA, localContextB) {
38
- var substitution = complexSubstitution.getSubstitution(), substitutionString = substitution.asString(localContextA, localContextA), complexSubstitutionStatementNode = complexSubstitution.getStatementNode();
39
- localContextB.trace("Transforming the complex substitution's '".concat(substitutionString, "' substitution...."), complexSubstitutionStatementNode);
40
- var transformedSubstitution = substitution.transformed(substitutions);
41
- if (transformedSubstitution !== null) {
42
- var transformedSubstitutionString = transformedSubstitution.asString(localContextB, localContextB);
43
- localContextB.debug("Transformed the complex substitution's '".concat(substitutionString, "' substitution into the '").concat(transformedSubstitutionString, "' substitution."), complexSubstitutionStatementNode);
44
- }
45
- return transformedSubstitution;
46
- }
47
- function substitutionFromComplexSubstitutionAndAndSimpleSubstitution(complexSubstitution, simpleSubstitution, localContextA, localContextB) {
48
- var substitution = null;
49
- var substitutions = _substitutions.default.fromNothing(), simpleSubstitutionStatementNode = simpleSubstitution.getStatementNode(), complexSubstitutionStatementNode = complexSubstitution.getStatementNode();
50
- localContextA = localContextB; ///
51
- var simpleSubstitutionStatementUnifiedWithComplexSubstitutionStatement = (0, _simpleSubstitutionStatementWithComplexSubstitutionStatement.default)(complexSubstitutionStatementNode, simpleSubstitutionStatementNode, substitutions, localContextA, localContextB);
52
- if (simpleSubstitutionStatementUnifiedWithComplexSubstitutionStatement) {
53
- var substitutionsLength = substitutions.getLength();
54
- if (substitutionsLength === 1) {
55
- var firstSubstitution = substitutions.getFirstSubstitution();
56
- substitution = firstSubstitution; ///
57
- }
58
- }
59
- return substitution;
60
- }
61
-
62
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZXNvbHZlL2NvbXBsZXhTdWJzdGl0dXRpb25BZ2FpbnN0U2ltcGxlU3Vic3RpdHV0aW9uLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5pbXBvcnQgU3Vic3RpdHV0aW9ucyBmcm9tIFwiLi4vc3Vic3RpdHV0aW9uc1wiO1xuaW1wb3J0IHVuaWZ5Q29tcGxleFN1YnN0aXR1dGlvblN0YXRlbWVudFdpdGhTaW1wbGVTdWJzdGl0dXRpb25TdGF0ZW1lbnQgZnJvbSBcIi4uL3VuaWZ5L3NpbXBsZVN1YnN0aXR1dGlvblN0YXRlbWVudFdpdGhDb21wbGV4U3Vic3RpdHV0aW9uU3RhdGVtZW50XCI7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHJlc29sdmVDb21wbGV4U3Vic3RpdHV0aW9uQWdhaW5zdFNpbXBsZVN1YnN0aXR1dGlvbihjb21wbGV4U3Vic3RpdHV0aW9uLCBzaW1wbGVTdWJzdGl0dXRpb24sIHN1YnN0aXR1dGlvbnMsIGxvY2FsQ29udGV4dEEsIGxvY2FsQ29udGV4dEIpIHtcbiAgbGV0IGNvbXBsZXhTdWJzdGl0dXRpb25SZXNvbHZlZEFnYWluc3RTaW1wbGVTdWJzdGl0dXRpb24gPSBmYWxzZTtcblxuICBjb25zdCBzdGF0ZW1lbnROb2RlID0gY29tcGxleFN1YnN0aXR1dGlvbi5nZXRTdGF0ZW1lbnROb2RlKCksXG4gICAgICAgIHNpbXBsZVN1YnN0aXR1dGlvblN0cmluZyA9IHNpbXBsZVN1YnN0aXR1dGlvbi5hc1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yxBQUFDLDRDQUE4RCxPQUFuQkssb0JBQW1CLHVCQUFxQk07SUFFeEcsSUFBTVYsMEJBQTBCRSxhQUFhUyxXQUFXLENBQUNyQjtJQUV6RCxJQUFJVSw0QkFBNEIsTUFBTTtRQUNwQyxJQUFNSyxnQ0FBZ0NMLHdCQUF3QkgsUUFBUSxDQUFDTCxlQUFlQTtRQUV0RkEsY0FBY2dCLEtBQUssQ0FBQyxBQUFDLDJDQUF3RkgsT0FBOUNELG9CQUFtQiw2QkFBeUQsT0FBOUJDLCtCQUE4QixvQkFBa0JLO0lBQy9KO0lBRUEsT0FBT1Y7QUFDVDtBQUVBLFNBQVNHLDREQUE0RGYsbUJBQW1CLEVBQUVDLGtCQUFrQixFQUFFRSxhQUFhLEVBQUVDLGFBQWE7SUFDeEksSUFBSVUsZUFBZTtJQUVuQixJQUFNWixnQkFBZ0JzQixzQkFBYSxDQUFDQyxXQUFXLElBQ3pDQyxrQ0FBa0N6QixtQkFBbUJNLGdCQUFnQixJQUNyRWUsbUNBQW1DdEIsb0JBQW9CTyxnQkFBZ0I7SUFFN0VKLGdCQUFnQkMsZUFBZ0IsR0FBRztJQUVuQyxJQUFNdUIscUVBQXFFQyxJQUFBQSxvRUFBZ0UsRUFBQ04sa0NBQWtDSSxpQ0FBaUN4QixlQUFlQyxlQUFlQztJQUU3TyxJQUFJdUIsb0VBQW9FO1FBQ3RFLElBQU1FLHNCQUFzQjNCLGNBQWM0QixTQUFTO1FBRW5ELElBQUlELHdCQUF3QixHQUFHO1lBQzdCLElBQU1FLG9CQUFvQjdCLGNBQWM4QixvQkFBb0I7WUFFNURsQixlQUFlaUIsbUJBQW1CLEdBQUc7UUFDdkM7SUFDRjtJQUVBLE9BQU9qQjtBQUNUIn0=
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return resolveSubstitution;
9
- }
10
- });
11
- var _complexSubstitutionAgainstSimpleSubstitution = /*#__PURE__*/ _interop_require_default(require("../resolve/complexSubstitutionAgainstSimpleSubstitution"));
12
- function _interop_require_default(obj) {
13
- return obj && obj.__esModule ? obj : {
14
- default: obj
15
- };
16
- }
17
- function resolveSubstitution(substitution, substitutions, localContextA, localContextB) {
18
- var complexSubstitutionResolved = false;
19
- var metavariableNode = substitution.getMetavariableNode(), simpleSubstitution = substitutions.findSimpleSubstitutionByMetavariableNode(metavariableNode);
20
- if (simpleSubstitution !== null) {
21
- var complexSubstitution = substitution, complexSubstitutionResolvedAgainstSimpleSubstitution = (0, _complexSubstitutionAgainstSimpleSubstitution.default)(complexSubstitution, simpleSubstitution, substitutions, localContextA, localContextB);
22
- complexSubstitutionResolved = complexSubstitutionResolvedAgainstSimpleSubstitution; ///
23
- }
24
- return complexSubstitutionResolved;
25
- }
26
-
27
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZXNvbHZlL3N1YnN0aXR1dGlvbi5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuaW1wb3J0IHJlc29sdmVDb21wbGV4U3Vic3RpdHV0aW9uQWdhaW5zdFNpbXBsZVN1YnN0aXR1dGlvbiBmcm9tIFwiLi4vcmVzb2x2ZS9jb21wbGV4U3Vic3RpdHV0aW9uQWdhaW5zdFNpbXBsZVN1YnN0aXR1dGlvblwiO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiByZXNvbHZlU3Vic3RpdHV0aW9uKHN1YnN0aXR1dGlvbiwgc3Vic3RpdHV0aW9ucywgbG9jYWxDb250ZXh0QSwgbG9jYWxDb250ZXh0Qikge1xuICBsZXQgY29tcGxleFN1YnN0aXR1dGlvblJlc29sdmVkID0gZmFsc2U7XG5cbiAgY29uc3QgbWV0YXZhcmlhYmxlTm9kZSA9IHN1YnN0aXR1dGlvbi5nZXRNZXRhd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IiwiY29tcGxleFN1YnN0aXR1dGlvblJlc29sdmVkQWdhaW5zdFNpbXBsZVN1YnN0aXR1dGlvbiIsInJlc29sdmVDb21wbGV4U3Vic3RpdHV0aW9uQWdhaW5zdFNpbXBsZVN1YnN0aXR1dGlvbiJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7K0JBSUE7OztlQUF3QkE7OzttR0FGd0M7Ozs7OztBQUVqRCxTQUFTQSxvQkFBb0JDLFlBQVksRUFBRUMsYUFBYSxFQUFFQyxhQUFhLEVBQUVDLGFBQWE7SUFDbkcsSUFBSUMsOEJBQThCO0lBRWxDLElBQU1DLG1CQUFtQkwsYUFBYU0sbUJBQW1CLElBQ25EQyxxQkFBcUJOLGNBQWNPLHdDQUF3QyxDQUFDSDtJQUVsRixJQUFJRSx1QkFBdUIsTUFBTTtRQUMvQixJQUFNRSxzQkFBc0JULGNBQ3RCVSx1REFBdURDLElBQUFBLHFEQUFtRCxFQUFDRixxQkFBcUJGLG9CQUFvQk4sZUFBZUMsZUFBZUM7UUFFeExDLDhCQUE4Qk0sc0RBQXNELEdBQUc7SUFDekY7SUFFQSxPQUFPTjtBQUNUIn0=
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return resolveSubstitutions;
9
- }
10
- });
11
- var _local = /*#__PURE__*/ _interop_require_default(require("../context/local"));
12
- var _substitution = /*#__PURE__*/ _interop_require_default(require("../resolve/substitution"));
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- function resolveSubstitutions(substitutions, fileContextA, localContextB) {
19
- var substitutionsResolved = substitutions.areResolved();
20
- if (!substitutionsResolved) {
21
- var localContextA = _local.default.fromFileContext(fileContextA), metavariableNodes = substitutions.getMetavariableNodes();
22
- substitutionsResolved = metavariableNodes.every(function(metavariableNode) {
23
- var complexSubstitutions = substitutions.findComplexSubstitutionsByMetavariableNode(metavariableNode), complexSubstitutionsResolved = complexSubstitutions.everySubstitution(function(complexSubstitution) {
24
- var substitution = complexSubstitution, complexSubstitutionResolved = (0, _substitution.default)(substitution, substitutions, localContextA, localContextB);
25
- if (complexSubstitutionResolved) {
26
- return true;
27
- }
28
- });
29
- if (complexSubstitutionsResolved) {
30
- return true;
31
- }
32
- });
33
- }
34
- return substitutionsResolved;
35
- }
36
-
37
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZXNvbHZlL3N1YnN0aXR1dGlvbnMuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmltcG9ydCBMb2NhbENvbnRleHQgZnJvbSBcIi4uL2NvbnRleHQvbG9jYWxcIjtcbmltcG9ydCByZXNvbHZlU3Vic3RpdHV0aW9uIGZyb20gXCIuLi9yZXNvbHZlL3N1YnN0aXR1dGlvblwiO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiByZXNvbHZlU3Vic3RpdHV0aW9ucyhzdWJzdGl0dXRpb25zLCBmaWxlQ29udGV4dEEsIGxvY2FsQ29udGV4dEIpIHtcbiAgbGV0IHN1YnN0aXR1dGlvbnNSZXNvbHZlZCA9IHN1YnN0aXR1dGlvbnMuYXJlUmVzb2x2ZWQoKTtcblxuICBpZiAoIXN1YnN0aXR1dGlvbnNSZXNvbHZlZCkge1xuICAgIGNvbnN0IGxvY2FsQ29udGV4dEEgPSBMb2NhbENvbnRleHQuZnJvbUZpbGVDb250ZXh0KGZpbGVDb250ZXh0QSksXG4gICAgICAgICAgbWV0YXZhcmlhYmxlTm9kZXMgPSBzdWJzdGl0dXRpb25zLmdldE1ldGF2YXJpYWJsZU5vZGVzKCk7XG5cbiAgICBzdWJzdGl0dXRpb25zUmVzb2x2ZWQgPSBtZXRhdmFyaWFibGVOb2Rlcy5ldmVyeSgobWV0YX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0FBTztZQUNUO1FBQ0Y7SUFDRjtJQUVBLE9BQU9YO0FBQ1QifQ==
@@ -1,79 +0,0 @@
1
- "use strict";
2
-
3
- import Substitutions from "../substitutions";
4
- import unifyComplexSubstitutionStatementWithSimpleSubstitutionStatement from "../unify/simpleSubstitutionStatementWithComplexSubstitutionStatement";
5
-
6
- export default function resolveComplexSubstitutionAgainstSimpleSubstitution(complexSubstitution, simpleSubstitution, substitutions, localContextA, localContextB) {
7
- let complexSubstitutionResolvedAgainstSimpleSubstitution = false;
8
-
9
- const statementNode = complexSubstitution.getStatementNode(),
10
- simpleSubstitutionString = simpleSubstitution.asString(localContextA, localContextB),
11
- complexSubstitutionString = complexSubstitution.asString(localContextA, localContextB);
12
-
13
- localContextB.trace(`Resolving the complex ${complexSubstitutionString} substitution against the simple ${simpleSubstitutionString} substitution...`, statementNode);
14
-
15
- const transformedSubstitution = transformedSubstitutionFromComplexSubstitution(complexSubstitution, substitutions, localContextA, localContextB);
16
-
17
- if (transformedSubstitution !== null) {
18
- const substitution = substitutionFromComplexSubstitutionAndAndSimpleSubstitution(complexSubstitution, simpleSubstitution, localContextA, localContextB);
19
-
20
- if (substitution !== null) {
21
- const substitutionString = substitution.asString(localContextB, localContextB),
22
- transformedSubstitutionString = transformedSubstitution.asString(localContextB, localContextB);
23
-
24
- localContextB.trace(`Equating the ${substitutionString} substitution to the transformed ${transformedSubstitutionString} substitution...`, statementNode);
25
-
26
- const substitutionEqualToTransformedSubstitution = substitution.isEqualTo(transformedSubstitution);
27
-
28
- complexSubstitutionResolvedAgainstSimpleSubstitution = substitutionEqualToTransformedSubstitution; ///
29
- }
30
- }
31
-
32
- if (complexSubstitutionResolvedAgainstSimpleSubstitution) {
33
- localContextB.debug(`...resolved the complex ${complexSubstitutionString} substitution against the simple ${simpleSubstitutionString} substitution.`, statementNode);
34
- }
35
-
36
- return complexSubstitutionResolvedAgainstSimpleSubstitution;
37
- }
38
-
39
- function transformedSubstitutionFromComplexSubstitution(complexSubstitution, substitutions, localContextA, localContextB) {
40
- const substitution = complexSubstitution.getSubstitution(),
41
- substitutionString = substitution.asString(localContextA, localContextA),
42
- complexSubstitutionStatementNode = complexSubstitution.getStatementNode();
43
-
44
- localContextB.trace(`Transforming the complex substitution's '${substitutionString}' substitution....`, complexSubstitutionStatementNode);
45
-
46
- const transformedSubstitution = substitution.transformed(substitutions);
47
-
48
- if (transformedSubstitution !== null) {
49
- const transformedSubstitutionString = transformedSubstitution.asString(localContextB, localContextB);
50
-
51
- localContextB.debug(`Transformed the complex substitution's '${substitutionString}' substitution into the '${transformedSubstitutionString}' substitution.`, complexSubstitutionStatementNode);
52
- }
53
-
54
- return transformedSubstitution;
55
- }
56
-
57
- function substitutionFromComplexSubstitutionAndAndSimpleSubstitution(complexSubstitution, simpleSubstitution, localContextA, localContextB) {
58
- let substitution = null;
59
-
60
- const substitutions = Substitutions.fromNothing(), ///
61
- simpleSubstitutionStatementNode = simpleSubstitution.getStatementNode(),
62
- complexSubstitutionStatementNode = complexSubstitution.getStatementNode();
63
-
64
- localContextA = localContextB; ///
65
-
66
- const simpleSubstitutionStatementUnifiedWithComplexSubstitutionStatement = unifyComplexSubstitutionStatementWithSimpleSubstitutionStatement(complexSubstitutionStatementNode, simpleSubstitutionStatementNode, substitutions, localContextA, localContextB);
67
-
68
- if (simpleSubstitutionStatementUnifiedWithComplexSubstitutionStatement) {
69
- const substitutionsLength = substitutions.getLength();
70
-
71
- if (substitutionsLength === 1) {
72
- const firstSubstitution = substitutions.getFirstSubstitution();
73
-
74
- substitution = firstSubstitution; ///
75
- }
76
- }
77
-
78
- return substitution;
79
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- import resolveComplexSubstitutionAgainstSimpleSubstitution from "../resolve/complexSubstitutionAgainstSimpleSubstitution";
4
-
5
- export default function resolveSubstitution(substitution, substitutions, localContextA, localContextB) {
6
- let complexSubstitutionResolved = false;
7
-
8
- const metavariableNode = substitution.getMetavariableNode(),
9
- simpleSubstitution = substitutions.findSimpleSubstitutionByMetavariableNode(metavariableNode);
10
-
11
- if (simpleSubstitution !== null) {
12
- const complexSubstitution = substitution, ///
13
- complexSubstitutionResolvedAgainstSimpleSubstitution = resolveComplexSubstitutionAgainstSimpleSubstitution(complexSubstitution, simpleSubstitution, substitutions, localContextA, localContextB);
14
-
15
- complexSubstitutionResolved = complexSubstitutionResolvedAgainstSimpleSubstitution; ///
16
- }
17
-
18
- return complexSubstitutionResolved;
19
- }
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- import LocalContext from "../context/local";
4
- import resolveSubstitution from "../resolve/substitution";
5
-
6
- export default function resolveSubstitutions(substitutions, fileContextA, localContextB) {
7
- let substitutionsResolved = substitutions.areResolved();
8
-
9
- if (!substitutionsResolved) {
10
- const localContextA = LocalContext.fromFileContext(fileContextA),
11
- metavariableNodes = substitutions.getMetavariableNodes();
12
-
13
- substitutionsResolved = metavariableNodes.every((metavariableNode) => {
14
- const complexSubstitutions = substitutions.findComplexSubstitutionsByMetavariableNode(metavariableNode),
15
- complexSubstitutionsResolved = complexSubstitutions.everySubstitution((complexSubstitution) => {
16
- const substitution = complexSubstitution, ///
17
- complexSubstitutionResolved = resolveSubstitution(substitution, substitutions, localContextA, localContextB);
18
-
19
- if (complexSubstitutionResolved) {
20
- return true;
21
- }
22
- });
23
-
24
- if (complexSubstitutionsResolved) {
25
- return true;
26
- }
27
- });
28
- }
29
-
30
- return substitutionsResolved;
31
- }