occam-verify-cli 0.0.936 → 0.0.938

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 (72) hide show
  1. package/lib/conclusion.js +7 -10
  2. package/lib/consequent.js +7 -10
  3. package/lib/context/local.js +1 -1
  4. package/lib/equality.js +2 -5
  5. package/lib/premise.js +15 -21
  6. package/lib/proofStep.js +3 -6
  7. package/lib/rule.js +23 -23
  8. package/lib/substitution/statementForMetavariable.js +3 -6
  9. package/lib/supposition.js +15 -21
  10. package/lib/topLevelAssertion.js +27 -23
  11. package/lib/unifier/equality.js +37 -107
  12. package/lib/unifier/metaLevel.js +48 -121
  13. package/lib/unifier/statementAgainstCombinator.js +41 -123
  14. package/lib/unifier/termAgainstConstructor.js +29 -103
  15. package/lib/unifier.js +60 -41
  16. package/lib/unify/metavariableAgainstStatement.js +5 -5
  17. package/lib/unify/statementAgainstMetaType.js +10 -4
  18. package/lib/unify/statementAtainstStatement.js +3 -6
  19. package/lib/unify/termAgainstTerm.js +1 -1
  20. package/lib/unify/termAgainstType.js +10 -4
  21. package/lib/utilities/string.js +2 -2
  22. package/lib/utilities/unifier.js +51 -0
  23. package/lib/verifier/metaLevel.js +48 -128
  24. package/lib/verifier/statementAsCombinator.js +48 -128
  25. package/lib/verifier/termAsConstructor.js +42 -112
  26. package/lib/verifier.js +50 -33
  27. package/lib/verify/assertion/contained.js +3 -6
  28. package/lib/verify/assertion/defined.js +3 -6
  29. package/lib/verify/assertion/subproof.js +9 -14
  30. package/lib/verify/statement/qualified.js +7 -7
  31. package/lib/verify/statement.js +10 -54
  32. package/lib/verify/statementAsCombinator.js +4 -8
  33. package/lib/verify/term.js +5 -5
  34. package/lib/verify/termAsConstructor.js +30 -23
  35. package/package.json +2 -2
  36. package/src/conclusion.js +8 -12
  37. package/src/consequent.js +8 -12
  38. package/src/context/local.js +7 -7
  39. package/src/equality.js +2 -8
  40. package/src/premise.js +20 -28
  41. package/src/proofStep.js +5 -9
  42. package/src/rule.js +22 -22
  43. package/src/substitution/statementForMetavariable.js +4 -8
  44. package/src/supposition.js +20 -28
  45. package/src/topLevelAssertion.js +29 -22
  46. package/src/unifier/equality.js +31 -59
  47. package/src/unifier/metaLevel.js +50 -83
  48. package/src/unifier/statementAgainstCombinator.js +33 -83
  49. package/src/unifier/termAgainstConstructor.js +19 -57
  50. package/src/unifier.js +57 -31
  51. package/src/unify/metavariableAgainstStatement.js +5 -3
  52. package/src/unify/statementAgainstMetaType.js +8 -3
  53. package/src/unify/statementAtainstStatement.js +4 -8
  54. package/src/unify/termAgainstTerm.js +1 -1
  55. package/src/unify/termAgainstType.js +7 -3
  56. package/src/utilities/string.js +1 -1
  57. package/src/verifier/metaLevel.js +37 -81
  58. package/src/verifier/statementAsCombinator.js +39 -82
  59. package/src/verifier/termAsConstructor.js +33 -62
  60. package/src/verifier.js +47 -21
  61. package/src/verify/assertion/contained.js +2 -7
  62. package/src/verify/assertion/defined.js +2 -7
  63. package/src/verify/assertion/subproof.js +3 -16
  64. package/src/verify/statement/qualified.js +7 -7
  65. package/src/verify/statement.js +10 -78
  66. package/src/verify/statementAsCombinator.js +3 -11
  67. package/src/verify/term.js +8 -8
  68. package/src/verify/termAsConstructor.js +40 -27
  69. package/lib/unify/argumentAgainstArgument.js +0 -24
  70. package/lib/utilities/terminalNodes.js +0 -51
  71. package/src/unify/argumentAgainstArgument.js +0 -15
  72. /package/src/utilities/{terminalNodes.js → unifier.js} +0 -0
@@ -65,7 +65,7 @@ function verifyQualifiedStatementAAgainstRule(qualifiedStatementNode, substituti
65
65
 
66
66
  localContext.trace(`Verifying the '${qualifiedStatementString}' qualified statement against the '${metavariableString}' rule...`, qualifiedStatementNode);
67
67
 
68
- const ruleMatchesStatement = rule.matchStatement(statementNode, localContext);
68
+ const ruleMatchesStatement = rule.unifyStatement(statementNode, localContext);
69
69
 
70
70
  qualifiedStatementVerifiedAgainstRule = ruleMatchesStatement; ///
71
71
 
@@ -90,7 +90,7 @@ function verifyQualifiedStatementAAgainstAxiom(qualifiedStatementNode, substitut
90
90
 
91
91
  localContext.trace(`Verifying the '${qualifiedStatementString}' qualified statement against the '${metavariableString}' axiom...`, qualifiedStatementNode);
92
92
 
93
- const axiomMatchesStatement = axiom.matchStatement(statementNode, localContext);
93
+ const axiomMatchesStatement = axiom.unifyStatement(statementNode, localContext);
94
94
 
95
95
  qualifiedStatementVerifiedAgainstAxiom = axiomMatchesStatement; ///
96
96
 
@@ -115,7 +115,7 @@ function verifyQualifiedStatementAAgainstLemma(qualifiedStatementNode, substitut
115
115
 
116
116
  localContext.trace(`Verifying the '${qualifiedStatementString}' qualified statement against the '${metavariableString}' lemma...`, qualifiedStatementNode);
117
117
 
118
- const lemmaMatchesStatement = lemma.matchStatement(statementNode, localContext);
118
+ const lemmaMatchesStatement = lemma.unifyStatement(statementNode, localContext);
119
119
 
120
120
  qualifiedStatementVerifiedAgainstLemma = lemmaMatchesStatement; ///
121
121
 
@@ -140,7 +140,7 @@ function verifyQualifiedStatementAAgainstTheorem(qualifiedStatementNode, substit
140
140
 
141
141
  localContext.trace(`Verifying the '${qualifiedStatementString}' qualified statement against the '${metavariableString}' theorem...`, qualifiedStatementNode);
142
142
 
143
- const theoremMatchesStatement = theorem.matchStatement(statementNode, localContext);
143
+ const theoremMatchesStatement = theorem.unifyStatement(statementNode, localContext);
144
144
 
145
145
  qualifiedStatementVerifiedAgainstTheorem = theoremMatchesStatement; ///
146
146
 
@@ -165,7 +165,7 @@ function verifyQualifiedStatementAAgainstConjecture(qualifiedStatementNode, subs
165
165
 
166
166
  localContext.trace(`Verifying the '${qualifiedStatementString}' qualified statement against the '${metavariableString}' conjecture...`, qualifiedStatementNode);
167
167
 
168
- const conjectureMatchesStatement = conjecture.matchStatement(statementNode, localContext);
168
+ const conjectureMatchesStatement = conjecture.unifyStatement(statementNode, localContext);
169
169
 
170
170
  qualifiedStatementVerifiedAgainstConjecture = conjectureMatchesStatement; ///
171
171
 
@@ -192,9 +192,9 @@ function verifyQualifiedStatementAAgainstReference(qualifiedStatementNode, subst
192
192
  localContextA = null,
193
193
  localContextB = localContext, ///
194
194
  statementNodeB = statementNode, ///
195
- substitutionNode = null,
195
+ substitutionNodeA = null,
196
196
  metavariableNodeA = metavariableNode, ///
197
- metavariableVerifiedAgainstStatement = unifyMetavariableAgainstStatement(metavariableNodeA, statementNodeB, substitutionNode, substitutions, localContextA, localContextB, () => {
197
+ metavariableVerifiedAgainstStatement = unifyMetavariableAgainstStatement(metavariableNodeA, statementNodeB, substitutionNodeA, substitutions, localContextA, localContextB, () => {
198
198
  const verifiedAhead = true;
199
199
 
200
200
  return verifiedAhead;
@@ -3,6 +3,7 @@
3
3
  import shim from "../shim";
4
4
  import verifyEquality from "../verify/equality";
5
5
  import verifyJudgement from "../verify/judgement";
6
+ import metaLevelVerifier from "../verifier/metaLevel";
6
7
  import bracketedCombinator from "../ocmbinator/bracketed";
7
8
  import verifyTypeAssertion from "../verify/assertion/type";
8
9
  import verifyDefinedAssertion from "../verify/assertion/defined";
@@ -11,15 +12,11 @@ import verifyContainedAssertion from "../verify/assertion/contained";
11
12
  import statementAgainstCombinatorUnifier from "../unifier/statementAgainstCombinator";
12
13
 
13
14
  import { nodeQuery } from "../utilities/query";
14
- import { STATEMENT_META_TYPE_NAME } from "../metaTypeNames";
15
15
 
16
- const variableNodeQuery = nodeQuery("/substitution/variable!"),
17
- equalityNodeQuery = nodeQuery("/statement/equality!"),
16
+ const equalityNodeQuery = nodeQuery("/statement/equality!"),
18
17
  judgementNodeQuery = nodeQuery("/statement/judgement!"),
19
- metavariableNodeQuery = nodeQuery("/statement/metavariable!"),
20
- substitutionNodeQuery = nodeQuery("/statement/substitution!"),
18
+ metavariableNodeQuery = nodeQuery("/*/metavariable!"),
21
19
  typeAssertionNodeQuery = nodeQuery("/statement/typeAssertion!"),
22
- termVariableNodeQuery = nodeQuery("/substitution/term/variable!"),
23
20
  definedAssertionNodeQuery = nodeQuery("/statement/definedAssertion!"),
24
21
  subproofAssertionNodeQuery = nodeQuery("/statement/subproofAssertion!"),
25
22
  containedAssertionNodeQuery = nodeQuery("/statement/containedAssertion!");
@@ -98,16 +95,9 @@ function verifyStatementAsMetavariable(statementNode, assignments, derived, loca
98
95
 
99
96
  localContext.trace(`Verifying the '${statementString}' statement as a metavariable...`, statementNode);
100
97
 
101
- const metavariableVerified = verifyMetavariable(metavariableNode, localContext);
98
+ const verified = metaLevelVerifier.verify(statementNode, localContext);
102
99
 
103
- if (metavariableVerified) {
104
- const substitutionNode = substitutionNodeQuery(statementNode),
105
- substitutionVerified = verifySubstitution(substitutionNode, localContext);
106
-
107
- if (substitutionVerified) {
108
- statementVerifiedAsMetavariable = true;
109
- }
110
- }
100
+ statementVerifiedAsMetavariable = verified; ///
111
101
 
112
102
  if (statementVerifiedAsMetavariable) {
113
103
  localContext.debug(`...verified the '${statementString}' statement as a metavariable.`, statementNode);
@@ -197,11 +187,7 @@ function verifyStatementAsDefinedAssertion(statementNode, assignments, derived,
197
187
 
198
188
  localContext.trace(`Verifying the '${statementString}' statement as a defined assertion...`, statementNode);
199
189
 
200
- const definedAssertionVerified = verifyDefinedAssertion(definedAssertionNode, assignments, derived, localContext, () => {
201
- const verifiedAhead = true;
202
-
203
- return verifiedAhead;
204
- });
190
+ const definedAssertionVerified = verifyDefinedAssertion(definedAssertionNode, assignments, derived, localContext);
205
191
 
206
192
  statementVerifiedAsDefinedAssertion = definedAssertionVerified; ///
207
193
 
@@ -223,11 +209,7 @@ function verifyStatementAsSubproofAssertion(statementNode, assignments, derived,
223
209
 
224
210
  localContext.trace(`Verifying the '${statementString}' statement as a subproof assertion...`, statementNode);
225
211
 
226
- const subproofAssertionVerified = verifySubproofAssertion(subproofAssertionNode, assignments, derived, localContext, () => {
227
- const verifiedAhead = true;
228
-
229
- return verifiedAhead;
230
- });
212
+ const subproofAssertionVerified = verifySubproofAssertion(subproofAssertionNode, assignments, derived, localContext);
231
213
 
232
214
  statementVerifiedAsSubproofAssertion = subproofAssertionVerified; ///
233
215
 
@@ -249,11 +231,7 @@ function verifyStatementAsContainedAssertion(statementNode, assignments, derived
249
231
 
250
232
  localContext.trace(`Verifying the '${statementString}' statement as a defined assertion...`, statementNode);
251
233
 
252
- const containedAssertionVerified = verifyContainedAssertion(containedAssertionNode, assignments, derived, localContext, () => {
253
- const verifiedAhead = true;
254
-
255
- return verifiedAhead;
256
- });
234
+ const containedAssertionVerified = verifyContainedAssertion(containedAssertionNode, assignments, derived, localContext);
257
235
 
258
236
  statementVerifiedAsContainedAssertion = containedAssertionVerified; ///
259
237
 
@@ -311,16 +289,9 @@ function verifyStatementAgainstCombinator(statementNode, combinator, localContex
311
289
 
312
290
  localContext.trace(`Verifying the '${statementString}' statement against the '${combinatorString}' combinator...`, statementNode);
313
291
 
314
- const combinatorStatementNode = combinator.getStatementNode(),
315
- nonTerminalNodeA = statementNode, ///
316
- nonTerminalNodeB = combinatorStatementNode, ///
317
- nonTerminalNodeUnify = statementAgainstCombinatorUnifier.unifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, localContext, () => {
318
- const verifiedAhead = true;
292
+ const combinatorStatementNode = combinator.getStatementNode();
319
293
 
320
- return verifiedAhead;
321
- });
322
-
323
- statementVerifiedAgainstCombinator = nonTerminalNodeUnify; ///
294
+ statementVerifiedAgainstCombinator = statementAgainstCombinatorUnifier.unify(statementNode, combinatorStatementNode, localContext);
324
295
 
325
296
  if (statementVerifiedAgainstCombinator) {
326
297
  localContext.debug(`...verified the '${statementString}' statement against the '${combinatorString}' combinator.`, statementNode);
@@ -328,42 +299,3 @@ function verifyStatementAgainstCombinator(statementNode, combinator, localContex
328
299
 
329
300
  return statementVerifiedAgainstCombinator;
330
301
  }
331
-
332
- function verifyMetavariable(metavariableNode, localContext) {
333
- let metavariableVerified = false;
334
-
335
- const metavariable = localContext.findMetavariableByMetavariableNode(metavariableNode);
336
-
337
- if (metavariable !== null) {
338
- const metaTypeName = metavariable.getMetaTypeName();
339
-
340
- if (metaTypeName === STATEMENT_META_TYPE_NAME) {
341
- metavariableVerified = true;
342
- }
343
- }
344
-
345
- return metavariableVerified;
346
- }
347
-
348
- function verifySubstitution(substitutionNode, localContext) {
349
- let substitutionVerified = false;
350
-
351
- if (substitutionNode === null) {
352
- substitutionVerified = true;
353
- } else {
354
- const variableNode = variableNodeQuery(substitutionNode),
355
- variablePresent = localContext.isVariablePresentByVariableNode(variableNode);
356
-
357
- if (variablePresent) {
358
- const termVariableNode = termVariableNodeQuery(substitutionNode);
359
-
360
- if (termVariableNode !== null) {
361
- const termVariablePresent = localContext.isVariablePresentByVariableNode(termVariableNode);
362
-
363
- substitutionVerified = termVariablePresent; ///
364
- }
365
- }
366
- }
367
-
368
- return substitutionVerified;
369
- }
@@ -4,27 +4,19 @@ import Combinator from "../combinator";
4
4
  import statementAsCombinatorVerifier from "../verifier/statementAsCombinator";
5
5
 
6
6
  export default function verifyStatementAsCombinator(statementNode, fileContext) {
7
- let statementVerifiedAsCombinator = false;
7
+ let statementVerifiedAsCombinator;
8
8
 
9
9
  const statementString = fileContext.nodeAsString(statementNode);
10
10
 
11
11
  fileContext.trace(`Verifying the '${statementString}' statement as a combinator....`, statementNode);
12
12
 
13
- const nonTerminalNode = statementNode, ///
14
- childNodes = nonTerminalNode.getChildNodes(),
15
- childNodesVerified = statementAsCombinatorVerifier.verifyChildNodes(childNodes, fileContext, () => {
16
- const verifiedAhead = true;
13
+ statementVerifiedAsCombinator = statementAsCombinatorVerifier.verify(statementNode, fileContext);
17
14
 
18
- return verifiedAhead;
19
- });
20
-
21
- if (childNodesVerified) {
15
+ if (statementVerifiedAsCombinator) {
22
16
  const tokens = fileContext.getTokens(),
23
17
  combinator = Combinator.fromStatementNodeAndTokens(statementNode, tokens);
24
18
 
25
19
  fileContext.addCombinator(combinator);
26
-
27
- statementVerifiedAsCombinator = true;
28
20
  }
29
21
 
30
22
  if (statementVerifiedAsCombinator) {
@@ -130,9 +130,9 @@ function verifyTermAgainstBracketedConstructor(termNode, terms, localContext, ve
130
130
  localContext.trace(`Verifying the '${termString}' term against the '${bracketedConstructorString}' bracketed constructor...`, termNode);
131
131
 
132
132
  const bracketedConstructorTermNode = bracketedConstructor.getTermNode(),
133
- nonTerminalNNdeA = termNode, ///
134
- nonTerminalNodeB = bracketedConstructorTermNode, ///
135
- nodeUnified = termAgainstConstructorUnifier.unifyNonTerminalNode(nonTerminalNNdeA, nonTerminalNodeB, localContext, () => {
133
+ termNodeA = termNode, ///
134
+ constructorTermNodeB = bracketedConstructorTermNode, ///
135
+ unified = termAgainstConstructorUnifier.unify(termNodeA, constructorTermNodeB, localContext, () => {
136
136
  let verifiedAhead;
137
137
 
138
138
  const bracketedTermNode = termNode; ///
@@ -175,7 +175,7 @@ function verifyTermAgainstBracketedConstructor(termNode, terms, localContext, ve
175
175
  return verifiedAhead;
176
176
  });
177
177
 
178
- termVerifiedAgainstBracketedConstructor = nodeUnified; ///
178
+ termVerifiedAgainstBracketedConstructor = unified; ///
179
179
 
180
180
  if (termVerifiedAgainstBracketedConstructor) {
181
181
  localContext.debug(`...verified the '${termString}' term against the '${bracketedConstructorString}' constructor.`, termNode);
@@ -193,9 +193,9 @@ function verifyTermAgainstConstructor(termNode, terms, constructor, localContext
193
193
  localContext.trace(`Verifying the '${termString}' term against the '${constructorString}' constructor...`, termNode);
194
194
 
195
195
  const constructorTermNode = constructor.getTermNode(),
196
- nonTerminalNNdeA = termNode, ///
197
- nonTerminalNodeB = constructorTermNode, ///
198
- nodeUnify = termAgainstConstructorUnifier.unifyNonTerminalNode(nonTerminalNNdeA, nonTerminalNodeB, localContext, () => {
196
+ termNodeA = termNode, ///
197
+ constructorTermNodeB = constructorTermNode, ///
198
+ unified = termAgainstConstructorUnifier.unify(termNodeA, constructorTermNodeB, localContext, () => {
199
199
  let verifiedAhead;
200
200
 
201
201
  const type = constructor.getType(),
@@ -212,7 +212,7 @@ function verifyTermAgainstConstructor(termNode, terms, constructor, localContext
212
212
  return verifiedAhead;
213
213
  });
214
214
 
215
- termVerifiedAgainstConstructor = nodeUnify; ///
215
+ termVerifiedAgainstConstructor = unified; ///
216
216
 
217
217
  if (termVerifiedAgainstConstructor) {
218
218
  localContext.debug(`...verified the '${termString}' term against the '${constructorString}' constructor.`, termNode);
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  import Constructor from "../constructor";
4
- import LocalContext from "../context/local";
5
4
  import termAsConstructorVerifier from "../verifier/termAsConstructor";
6
5
 
6
+ import { first } from "../utilities/array";
7
+
7
8
  export default function verifyTermAsConstructor(termNode, typeNode, fileContext) {
8
9
  let termVerifiedAsConstructor = false;
9
10
 
@@ -11,38 +12,24 @@ export default function verifyTermAsConstructor(termNode, typeNode, fileContext)
11
12
 
12
13
  fileContext.debug(`Verifying the '${termString}' term as a constructor...`, termNode);
13
14
 
14
- const localContext = LocalContext.fromFileContext(fileContext),
15
- nonTerminalNode = termNode, ///
16
- childNodes = nonTerminalNode.getChildNodes(),
17
- childNodesVerified = termAsConstructorVerifier.verifyChildNodes(childNodes, localContext, () => {
18
- const verifiedAhead = true;
19
-
20
- return verifiedAhead;
21
- });
15
+ const types = [],
16
+ typeVerified = verifyType(typeNode, types, fileContext);
22
17
 
23
- if (childNodesVerified) {
24
- let type = null;
18
+ let type;
25
19
 
26
- if (typeNode === null) {
27
- termVerifiedAsConstructor = true;
28
- } else {
29
- type = fileContext.findTypeByTypeNode(typeNode);
20
+ if (typeVerified) {
21
+ const firstType = first(types);
30
22
 
31
- if (type !== null) {
32
- termVerifiedAsConstructor = true;
33
- } else {
34
- const typeString = fileContext.nodeAsString(typeNode);
23
+ type = firstType; ///
35
24
 
36
- fileContext.debug(`The '${termString}' constructor's '${typeString}' type is not present.`, termNode);
37
- }
38
- }
25
+ termVerifiedAsConstructor = termAsConstructorVerifier.verify(termNode, fileContext);
26
+ }
39
27
 
40
- if (termVerifiedAsConstructor) {
41
- const tokens = fileContext.getTokens(),
42
- constructor = Constructor.fromTermNodeTypeAndTokens(termNode, type, tokens);
28
+ if (termVerifiedAsConstructor) {
29
+ const tokens = fileContext.getTokens(),
30
+ constructor = Constructor.fromTermNodeTypeAndTokens(termNode, type, tokens);
43
31
 
44
- fileContext.addConstructor(constructor);
45
- }
32
+ fileContext.addConstructor(constructor);
46
33
  }
47
34
 
48
35
  if (termVerifiedAsConstructor) {
@@ -51,3 +38,29 @@ export default function verifyTermAsConstructor(termNode, typeNode, fileContext)
51
38
 
52
39
  return termVerifiedAsConstructor;
53
40
  }
41
+
42
+ function verifyType(typeNode, types, fileContext) {
43
+ let typeVerified = false;
44
+
45
+ if (typeNode === null) {
46
+ const type = null;
47
+
48
+ types.push(type);
49
+
50
+ typeVerified = true;
51
+ } else {
52
+ const type = fileContext.findTypeByTypeNode(typeNode);
53
+
54
+ if (type !== null) {
55
+ types.push(type);
56
+
57
+ typeVerified = true;
58
+ } else {
59
+ const typeString = fileContext.nodeAsString(typeNode);
60
+
61
+ fileContext.debug(`The '${typeString}' type is not present.`, typeNode);
62
+ }
63
+ }
64
+
65
+ return typeVerified;
66
+ }
@@ -1,24 +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 unifyArgumentAgainstArgument;
9
- }
10
- });
11
- var _termAgainstConstructor = /*#__PURE__*/ _interop_require_default(require("../unifier/termAgainstConstructor"));
12
- function _interop_require_default(obj) {
13
- return obj && obj.__esModule ? obj : {
14
- default: obj
15
- };
16
- }
17
- function unifyArgumentAgainstArgument(argumentNodeA, argumentNodeB, localContext, unifyAhead) {
18
- var argumentUnifiedAgainstArgument;
19
- var nonTerminalNodeA = argumentNodeA, nonTerminalNodeB = argumentNodeB, nonTerminalNodeVerified = _termAgainstConstructor.default.unifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, localContext, unifyAhead);
20
- argumentUnifiedAgainstArgument = nonTerminalNodeVerified; ///
21
- return argumentUnifiedAgainstArgument;
22
- }
23
-
24
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5QWhlYWQiLCJhcmd1bWVudFVuaWZpZWRBZ2FpbnN0QXJndW1lbnQiLCJub25UZXJtaW5hbE5vZGVBIiwibm9uVGVybWluYWxOb2RlQiIsIm5vblRlcm1pbmFsTm9kZVZlcmlmaWVkIiwidGVybUFnYWluc3RDb25zdHJ1Y3RvclVuaWZpZXIiLCJ1bmlmeU5vblRlcm1pbmFsTm9kZSJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7K0JBSUE7OztlQUF3QkE7Ozs2RUFGa0I7Ozs7OztBQUUzQixTQUFTQSw2QkFBNkJDLGFBQWEsRUFBRUMsYUFBYSxFQUFFQyxZQUFZLEVBQUVDLFVBQVU7SUFDekcsSUFBSUM7SUFFSixJQUFNQyxtQkFBbUJMLGVBQ25CTSxtQkFBbUJMLGVBQ25CTSwwQkFBMEJDLCtCQUE2QixDQUFDQyxvQkFBb0IsQ0FBQ0osa0JBQWtCQyxrQkFBa0JKLGNBQWNDO0lBRXJJQyxpQ0FBaUNHLHlCQUF5QixHQUFHO0lBRTdELE9BQU9IO0FBQ1QifQ==
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- areTerminalNodeMapsEqual: function() {
13
- return areTerminalNodeMapsEqual;
14
- },
15
- terminalNodeMapFromNodes: function() {
16
- return terminalNodeMapFromNodes;
17
- }
18
- });
19
- var _array = require("../utilities/array");
20
- function terminalNodeMapFromNodes(nodes) {
21
- var terminalNodeMap = {};
22
- nodes.forEach(function(node, index) {
23
- var nodeTerminalNode = node.isTerminalNode();
24
- if (nodeTerminalNode) {
25
- var terminalNode = node; //
26
- terminalNodeMap[index] = terminalNode;
27
- }
28
- });
29
- return terminalNodeMap;
30
- }
31
- function areTerminalNodeMapsEqual(terminalNodeMapA, terminalNodeMapB) {
32
- var terminalNodeMapsEqual = false;
33
- var indexesA = Object.keys(terminalNodeMapA), indexesB = Object.keys(terminalNodeMapB), terminalNodeMapKeysMatch = (0, _array.match)(indexesA, indexesB, function(indexA, indexB) {
34
- var matches = indexA === indexB;
35
- if (matches) {
36
- return true;
37
- }
38
- });
39
- if (terminalNodeMapKeysMatch) {
40
- var terminalNodesA = Object.values(terminalNodeMapA), terminalNodesB = Object.values(terminalNodeMapB), terminalNodeMapValuesMatch = (0, _array.match)(terminalNodesA, terminalNodesB, function(terminalNodeA, terminalNodeB) {
41
- var matches = terminalNodeA.match(terminalNodeB);
42
- if (matches) {
43
- return true;
44
- }
45
- });
46
- terminalNodeMapsEqual = terminalNodeMapValuesMatch; ///
47
- }
48
- return terminalNodeMapsEqual;
49
- }
50
-
51
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvdGVybWluYWxOb2Rlcy5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuaW1wb3J0IHsgbWF0Y2ggfSBmcm9tIFwiLi4vdXRpbGl0aWVzL2FycmF5XCI7XG5cbmV4cG9ydCBmdW5jdGlvbiB0ZXJtaW5hbE5vZGVNYXBGcm9tTm9kZXMobm9kZXMpIHtcbiAgY29uc3QgdGVybWluYWxOb2RlTWFwID0ge307XG5cbiAgbm9kZXMuZm9yRWFjaCgobm9kZSwgaW5kZXgpID0+IHtcbiAgICBjb25zdCBub2RlVGVybWluYWxOb2RlID0gbm9kZS5pc1Rlcm1pbmFsTm9kZSgpO1xuXG4gICAgaWYgKG5vZGVUZXJtaW5hbE5vZGUpIHtcbiAgICAgIGNvbnN0IHRlcm1pbmFsTm9kZSA9IG5vZGU7ICAvL1xuXG4gICAgICB0ZXJtaW5hbE5vZGVNYXBbaW5kZXhdID0gdGVybWluYWxOb2RlO1xuICAgIH1cbiAgfSk7XG5cbiAgcmV0dXJuIHRlcm1pbm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7UUFFNUMsSUFBSUQsa0JBQWtCO1lBQ3BCLElBQU1FLGVBQWVKLE1BQU8sRUFBRTtZQUU5QkYsZUFBZSxDQUFDRyxNQUFNLEdBQUdHO1FBQzNCO0lBQ0Y7SUFFQSxPQUFPTjtBQUNUO0FBRU8sU0FBU0gseUJBQXlCVSxnQkFBZ0IsRUFBRUMsZ0JBQWdCO0lBQ3pFLElBQUlDLHdCQUF3QjtJQUU1QixJQUFNQyxXQUFXQyxPQUFPQyxJQUFJLENBQUNMLG1CQUN2Qk0sV0FBV0YsT0FBT0MsSUFBSSxDQUFDSixtQkFDdkJNLDJCQUEyQkMsSUFBQUEsWUFBSyxFQUFDTCxVQUFVRyxVQUFVLFNBQUNHLFFBQVFDO1FBQzVELElBQU1DLFVBQVdGLFdBQVdDO1FBRTVCLElBQUlDLFNBQVM7WUFDWCxPQUFPO1FBQ1Q7SUFDRjtJQUVOLElBQUlKLDBCQUEwQjtRQUM1QixJQUFNSyxpQkFBaUJSLE9BQU9TLE1BQU0sQ0FBQ2IsbUJBQy9CYyxpQkFBaUJWLE9BQU9TLE1BQU0sQ0FBQ1osbUJBQy9CYyw2QkFBNkJQLElBQUFBLFlBQUssRUFBQ0ksZ0JBQWdCRSxnQkFBZ0IsU0FBQ0UsZUFBZUM7WUFDakYsSUFBTU4sVUFBVUssY0FBY1IsS0FBSyxDQUFDUztZQUVwQyxJQUFJTixTQUFTO2dCQUNYLE9BQU87WUFDVDtRQUNGO1FBRU5ULHdCQUF3QmEsNEJBQTRCLEdBQUc7SUFDekQ7SUFFQSxPQUFPYjtBQUNUIn0=
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- import termAgainstConstructorUnifier from "../unifier/termAgainstConstructor";
4
-
5
- export default function unifyArgumentAgainstArgument(argumentNodeA, argumentNodeB, localContext, unifyAhead) {
6
- let argumentUnifiedAgainstArgument;
7
-
8
- const nonTerminalNodeA = argumentNodeA, ///
9
- nonTerminalNodeB = argumentNodeB, ///
10
- nonTerminalNodeVerified = termAgainstConstructorUnifier.unifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, localContext, unifyAhead);
11
-
12
- argumentUnifiedAgainstArgument = nonTerminalNodeVerified; ///
13
-
14
- return argumentUnifiedAgainstArgument;
15
- }
File without changes