occam-verify-cli 1.0.405 → 1.0.415

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 (132) hide show
  1. package/lib/constants.js +1 -5
  2. package/lib/context/file.js +7 -8
  3. package/lib/context/local.js +3 -3
  4. package/lib/context/release.js +2 -2
  5. package/lib/context/temporary.js +103 -54
  6. package/lib/mixins/statement/verify.js +2 -2
  7. package/lib/mixins/step/unify.js +2 -2
  8. package/lib/node/argument.js +2 -2
  9. package/lib/node/assumption.js +6 -6
  10. package/lib/node/frame.js +19 -7
  11. package/lib/node/judgement.js +8 -1
  12. package/lib/node/statement.js +34 -15
  13. package/lib/node/substitution/term.js +3 -11
  14. package/lib/node/term.js +20 -8
  15. package/lib/nonTerminalNode.js +3 -3
  16. package/lib/ontology/assertion/contained.js +7 -7
  17. package/lib/ontology/assertion/defined.js +8 -8
  18. package/lib/ontology/assertion/subproof.js +3 -3
  19. package/lib/ontology/assumption.js +49 -45
  20. package/lib/ontology/combinator.js +3 -3
  21. package/lib/ontology/constructor.js +3 -3
  22. package/lib/ontology/declaration/combinator.js +3 -3
  23. package/lib/ontology/declaration/constructor.js +3 -3
  24. package/lib/ontology/equality.js +4 -4
  25. package/lib/ontology/equivalence.js +2 -2
  26. package/lib/ontology/frame.js +37 -12
  27. package/lib/ontology/judgement.js +13 -6
  28. package/lib/ontology/metavariable.js +75 -76
  29. package/lib/ontology/propertyRelation.js +2 -2
  30. package/lib/ontology/reference.js +33 -4
  31. package/lib/ontology/signature.js +2 -2
  32. package/lib/ontology/statement.js +33 -8
  33. package/lib/ontology/step.js +4 -4
  34. package/lib/ontology/substitution/frame.js +13 -15
  35. package/lib/ontology/substitution/statement.js +31 -32
  36. package/lib/ontology/substitution/term.js +26 -25
  37. package/lib/ontology/substitution.js +2 -2
  38. package/lib/ontology/substitutions.js +4 -4
  39. package/lib/ontology/term.js +26 -12
  40. package/lib/ontology/variable.js +2 -2
  41. package/lib/process/equate.js +322 -0
  42. package/lib/process/unify.js +623 -0
  43. package/lib/process/verify.js +612 -0
  44. package/lib/utilities/brackets.js +3 -8
  45. package/lib/utilities/context.js +4 -14
  46. package/lib/utilities/json.js +18 -1
  47. package/lib/utilities/pass.js +68 -0
  48. package/lib/utilities/substitutions.js +11 -16
  49. package/package.json +11 -11
  50. package/src/constants.js +0 -1
  51. package/src/context/file.js +8 -8
  52. package/src/context/local.js +2 -2
  53. package/src/context/release.js +1 -1
  54. package/src/context/temporary.js +124 -54
  55. package/src/mixins/statement/verify.js +3 -1
  56. package/src/mixins/step/unify.js +0 -1
  57. package/src/node/argument.js +1 -1
  58. package/src/node/assumption.js +4 -4
  59. package/src/node/frame.js +19 -5
  60. package/src/node/judgement.js +7 -0
  61. package/src/node/statement.js +35 -13
  62. package/src/node/substitution/term.js +4 -14
  63. package/src/node/term.js +20 -6
  64. package/src/nonTerminalNode.js +1 -1
  65. package/src/ontology/assertion/contained.js +6 -6
  66. package/src/ontology/assertion/defined.js +7 -7
  67. package/src/ontology/assertion/subproof.js +1 -1
  68. package/src/ontology/assumption.js +52 -57
  69. package/src/ontology/combinator.js +1 -1
  70. package/src/ontology/constructor.js +1 -1
  71. package/src/ontology/declaration/combinator.js +2 -3
  72. package/src/ontology/declaration/constructor.js +2 -2
  73. package/src/ontology/equality.js +3 -3
  74. package/src/ontology/equivalence.js +1 -1
  75. package/src/ontology/frame.js +44 -10
  76. package/src/ontology/judgement.js +8 -3
  77. package/src/ontology/metavariable.js +108 -102
  78. package/src/ontology/propertyRelation.js +3 -2
  79. package/src/ontology/reference.js +39 -1
  80. package/src/ontology/signature.js +3 -3
  81. package/src/ontology/statement.js +38 -4
  82. package/src/ontology/step.js +7 -7
  83. package/src/ontology/substitution/frame.js +13 -17
  84. package/src/ontology/substitution/statement.js +45 -48
  85. package/src/ontology/substitution/term.js +19 -19
  86. package/src/ontology/substitution.js +3 -2
  87. package/src/ontology/substitutions.js +3 -3
  88. package/src/ontology/term.js +26 -5
  89. package/src/ontology/variable.js +3 -2
  90. package/src/process/equate.js +212 -0
  91. package/src/process/unify.js +634 -0
  92. package/src/process/verify.js +584 -0
  93. package/src/utilities/brackets.js +2 -11
  94. package/src/utilities/context.js +1 -21
  95. package/src/utilities/json.js +19 -0
  96. package/src/utilities/{unifier.js → pass.js} +17 -1
  97. package/src/utilities/substitutions.js +10 -20
  98. package/lib/unifier/equantional.js +0 -170
  99. package/lib/unifier/intrinsicLevel.js +0 -144
  100. package/lib/unifier/metaLevel.js +0 -197
  101. package/lib/unifier/metavariable.js +0 -140
  102. package/lib/unifier/statementWithCombinator.js +0 -177
  103. package/lib/unifier/termWithConstructor.js +0 -145
  104. package/lib/unifier.js +0 -241
  105. package/lib/utilities/arguments.js +0 -28
  106. package/lib/utilities/frame.js +0 -18
  107. package/lib/utilities/metavariable.js +0 -18
  108. package/lib/utilities/statement.js +0 -18
  109. package/lib/utilities/unification.js +0 -109
  110. package/lib/utilities/unifier.js +0 -51
  111. package/lib/utilities/variable.js +0 -18
  112. package/lib/verifier/combinator.js +0 -158
  113. package/lib/verifier/constructor.js +0 -230
  114. package/lib/verifier/topLevel.js +0 -242
  115. package/lib/verifier.js +0 -219
  116. package/src/unifier/equantional.js +0 -90
  117. package/src/unifier/intrinsicLevel.js +0 -52
  118. package/src/unifier/metaLevel.js +0 -151
  119. package/src/unifier/metavariable.js +0 -50
  120. package/src/unifier/statementWithCombinator.js +0 -114
  121. package/src/unifier/termWithConstructor.js +0 -56
  122. package/src/unifier.js +0 -183
  123. package/src/utilities/arguments.js +0 -21
  124. package/src/utilities/frame.js +0 -13
  125. package/src/utilities/metavariable.js +0 -13
  126. package/src/utilities/statement.js +0 -13
  127. package/src/utilities/unification.js +0 -136
  128. package/src/utilities/variable.js +0 -13
  129. package/src/verifier/combinator.js +0 -72
  130. package/src/verifier/constructor.js +0 -96
  131. package/src/verifier/topLevel.js +0 -204
  132. package/src/verifier.js +0 -150
package/src/node/term.js CHANGED
@@ -5,16 +5,30 @@ import NonTerminalNode from "../nonTerminalNode";
5
5
  import { ARGUMENT_RULE_NAME, VARIABLE_RULE_NAME } from "../ruleNames";
6
6
 
7
7
  export default class TermNode extends NonTerminalNode {
8
- isSimple() {
9
- let simple = false;
8
+ getVariableIdentifier() {
9
+ let variableIdentifier = null;
10
+
11
+ const singular = this.isSingular();
12
+
13
+ if (singular) {
14
+ const singularVariableNode = this.getSingularVariableNode();
15
+
16
+ variableIdentifier = singularVariableNode.getVariableIdentifier();
17
+ }
18
+
19
+ return variableIdentifier;
20
+ }
21
+
22
+ isSingular() {
23
+ let singular = false;
10
24
 
11
25
  const singularVariableNode = this.getSingularVariableNode();
12
26
 
13
27
  if (singularVariableNode !== null) {
14
- simple = true;
28
+ singular = true;
15
29
  }
16
30
 
17
- return simple;
31
+ return singular;
18
32
  }
19
33
 
20
34
  getVariableNodes() {
@@ -38,14 +52,14 @@ export default class TermNode extends NonTerminalNode {
38
52
 
39
53
  getSingularArgumentNode() {
40
54
  const ruleName = ARGUMENT_RULE_NAME,
41
- singularArgumentNode = this.getSingularTNodeByRuleName(ruleName);
55
+ singularArgumentNode = this.getSingularNodeByRuleName(ruleName);
42
56
 
43
57
  return singularArgumentNode;
44
58
  }
45
59
 
46
60
  getSingularVariableNode() {
47
61
  const ruleName = VARIABLE_RULE_NAME,
48
- singularVariableNode = this.getSingularTNodeByRuleName(ruleName);
62
+ singularVariableNode = this.getSingularNodeByRuleName(ruleName);
49
63
 
50
64
  return singularVariableNode;
51
65
  }
@@ -87,7 +87,7 @@ export default class NonTerminalNode extends NonTerminalNodeBase {
87
87
  return firstNode;
88
88
  }
89
89
 
90
- getSingularTNodeByRuleName(...ruleNames) {
90
+ getSingularNodeByRuleName(...ruleNames) {
91
91
  let singularNode = null;
92
92
 
93
93
  const nodes = this.filterChildNode((childNode) => {
@@ -73,10 +73,10 @@ export default define(class ContainedAssertion extends Assertion {
73
73
 
74
74
  context.trace(`Verifying the '${termString}' term...`);
75
75
 
76
- const termSimple = this.term.isSimple();
76
+ const termSingular = this.term.isSingular();
77
77
 
78
- if (!termSimple) {
79
- context.debug(`The '${termString}' term is not simple.`);
78
+ if (!termSingular) {
79
+ context.debug(`The '${termString}' term is not singular.`);
80
80
  } else {
81
81
  termVerifies = this.term.verify(context, () => {
82
82
  const verifiesAhead = true;
@@ -101,10 +101,10 @@ export default define(class ContainedAssertion extends Assertion {
101
101
 
102
102
  context.trace(`Verifying the '${frameString}' frame...`);
103
103
 
104
- const frameSimple = this.frame.isSimple();
104
+ const frameSingular = this.frame.isSingular();
105
105
 
106
- if (!frameSimple) {
107
- context.debug(`The '${frameString}' frame is not simple.`);
106
+ if (!frameSingular) {
107
+ context.debug(`The '${frameString}' frame is not singular.`);
108
108
  } else {
109
109
  stated = true; ///
110
110
 
@@ -67,10 +67,10 @@ export default define(class DefinedAssertion extends Assertion {
67
67
 
68
68
  context.trace(`Verifying the '${termString}' term...`);
69
69
 
70
- const termSimple = this.term.isSimple();
70
+ const termSingular = this.term.isSingular();
71
71
 
72
- if (!termSimple) {
73
- context.debug(`The '${termString}' term is not simple.`);
72
+ if (!termSingular) {
73
+ context.debug(`The '${termString}' term is not singular.`);
74
74
  } else {
75
75
  termVerifies = this.term.verify(context, () => {
76
76
  const verifiesAhead = true;
@@ -95,10 +95,10 @@ export default define(class DefinedAssertion extends Assertion {
95
95
 
96
96
  context.trace(`Verifying the '${frameString}' frame...`);
97
97
 
98
- const frameSimple = this.frame.isSimple();
98
+ const frameSingular = this.frame.isSingular();
99
99
 
100
- if (!frameSimple) {
101
- context.debug(`The '${frameString}' frame is not simple.`);
100
+ if (!frameSingular) {
101
+ context.debug(`The '${frameString}' frame is not singular.`);
102
102
  } else {
103
103
  stated = true; ///
104
104
 
@@ -153,7 +153,7 @@ export default define(class DefinedAssertion extends Assertion {
153
153
  unifyIndependently(substitutions, generalContext, specificContext) {
154
154
  let unifiesIndependently;
155
155
 
156
- const context = generalContext, ///
156
+ const context = specificContext, ///
157
157
  definedAssertionString = this.getString(); ///
158
158
 
159
159
  context.trace(`Unifying the '${definedAssertionString}' defined assertion independently...`);
@@ -6,7 +6,7 @@ import ontology from "../../ontology";
6
6
  import Assertion from "../assertion";
7
7
 
8
8
  import { define } from "../../ontology";
9
- import { unifyStatement } from "../../utilities/unification";
9
+ import { unifyStatement } from "../../process/unify";
10
10
 
11
11
  const { match } = arrayUtilities;
12
12
 
@@ -3,15 +3,15 @@
3
3
  import ontology from "../ontology";
4
4
 
5
5
  import { define } from "../ontology";
6
- import { unifyStatementIntrinsically } from "../utilities/unification";
7
- import { metavariableFromJSON, metavariableToMetavariableJSON } from "../utilities/json";
6
+ import { unifyStatementIntrinsically } from "../process/unify";
7
+ import { referenceFromJSON, referenceToReferenceJSON } from "../utilities/json";
8
8
 
9
9
  export default define(class Assumption {
10
- constructor(string, node, statement, metavariable) {
10
+ constructor(string, node, statement, reference) {
11
11
  this.string = string;
12
12
  this.node = node;
13
13
  this.statement = statement;
14
- this.metavariable = metavariable;
14
+ this.reference = reference;
15
15
  }
16
16
 
17
17
  getString() {
@@ -26,10 +26,12 @@ export default define(class Assumption {
26
26
  return this.statement;
27
27
  }
28
28
 
29
- getMetavariable() {
30
- return this.metavariable;
29
+ getReference() {
30
+ return this.reference;
31
31
  }
32
32
 
33
+ getMetavariable() { return this.reference.getMetavariable(); }
34
+
33
35
  isSimple() {
34
36
  const simple = (this.statement === null);
35
37
 
@@ -47,7 +49,8 @@ export default define(class Assumption {
47
49
  const simple = this.isSimple();
48
50
 
49
51
  if (simple) {
50
- const judgement = context.findJudgementByMetavariable(this.metavariable);
52
+ const metavariable = this.reference.getMetavariable(),
53
+ judgement = context.findJudgementByMetavariable(metavariable);
51
54
 
52
55
  if (judgement !== null) {
53
56
  const assumption = judgement.getDeclaration();
@@ -58,9 +61,9 @@ export default define(class Assumption {
58
61
  const statement = substitution.getStatement(),
59
62
  metavariable = substitution.getMetavariable(),
60
63
  statementEqualToStatement = this.statement.isEqualTo(statement),
61
- metavariableEqualToMetavariable = this.metavariable.isEqualTo(metavariable);
64
+ referenceMetavariableEqualToMetavariable = this.reference.isMetavariableEqualToMetavariable(metavariable);
62
65
 
63
- if (metavariableEqualToMetavariable && statementEqualToStatement) {
66
+ if (statementEqualToStatement && referenceMetavariableEqualToMetavariable) {
64
67
  substitutionMatches = true;
65
68
  }
66
69
  }
@@ -82,13 +85,13 @@ export default define(class Assumption {
82
85
  const simple = this.isSimple();
83
86
 
84
87
  if (simple) {
85
- const verifiesAsMetavariable = this.verifyAsMetavariable(assignments, stated, context);
88
+ const referenceVerifiesAsMetavariable = this.verifyReferenceAsMetavariable(assignments, stated, context);
86
89
 
87
- verifies = verifiesAsMetavariable; ///
90
+ verifies = referenceVerifiesAsMetavariable; ///
88
91
  } else {
89
- const metavariableVerifiesAsReference = this.verifyMetavariableAsReference(assignments, stated, context);
92
+ const referenceVerified = this.verifyReference(assignments, stated, context);
90
93
 
91
- if (metavariableVerifiesAsReference) {
94
+ if (referenceVerified) {
92
95
  const statementVerifies = this.verifyStatement(assignments, stated, context);
93
96
 
94
97
  if (statementVerifies) {
@@ -115,24 +118,21 @@ export default define(class Assumption {
115
118
  return verifies;
116
119
  }
117
120
 
118
- verifyMetavariableAsReference(assignments, stated, context) {
119
- let metavariableVerifiesAsReference;
120
-
121
- const assumptionString = this.string,
122
- metavariableString = this.metavariable.getString();
121
+ verifyReference(assignments, stated, context) {
122
+ let referenceVerified;
123
123
 
124
- context.trace(`Verifying the '${assumptionString}' assumption's '${metavariableString}' metavariable as a reference...`);
124
+ const referenceString = this.reference.getString(),
125
+ assumptionString = this.string; ///
125
126
 
126
- const reference = referenceFromMetavariable(this.metavariable, context),
127
- referenceVerifies = reference.verify(context);
127
+ context.trace(`Verifying the '${assumptionString}' assumption's '${referenceString}' reference...`);
128
128
 
129
- metavariableVerifiesAsReference = referenceVerifies; ///
129
+ referenceVerified = this.reference.verify(context);
130
130
 
131
- if (metavariableVerifiesAsReference) {
132
- context.debug(`...verified the '${assumptionString}' assumption's '${metavariableString}' metavariable as a reference.`);
131
+ if (referenceVerified) {
132
+ context.debug(`...verified the '${assumptionString}' assumption's '${referenceString}' reference.`);
133
133
  }
134
134
 
135
- return metavariableVerifiesAsReference;
135
+ return referenceVerified;
136
136
  }
137
137
 
138
138
  verifyStatement(assignments, stated, context) {
@@ -159,21 +159,27 @@ export default define(class Assumption {
159
159
  return statementVerifies;
160
160
  }
161
161
 
162
- verifyAsMetavariable(assignments, stated, context) {
163
- let verifiesAsMetavariable;
162
+ verifyReferenceAsMetavariable(assignments, stated, context) {
163
+ let referenceVerifiesAsMetavariable = false;
164
164
 
165
- const assumptionString = this.string, ///
166
- metavariableString = this.metavariable.getString();
165
+ const referenceString = this.reference.getString(),
166
+ assumptionString = this.string; ///
167
167
 
168
- context.trace(`Verifying the '${assumptionString}' assumption's '${metavariableString}' metavariable...`);
168
+ context.trace(`Verifying the '${assumptionString}' assumption's '${referenceString}' reference as s metavariable...`);
169
169
 
170
- verifiesAsMetavariable = this.metavariable.verify(context);
170
+ const metavariable = this.reference.getMetavariable(),
171
+ metavariableName = metavariable.getName(),
172
+ metavariablePresent = context.isMetavariablePresentByMetavariableName(metavariableName);
171
173
 
172
- if (verifiesAsMetavariable) {
173
- context.debug(`...verified the '${assumptionString}' assumption's '${metavariableString}' metavariable.`);
174
+ if (metavariablePresent) {
175
+ referenceVerifiesAsMetavariable = true;
174
176
  }
175
177
 
176
- return verifiesAsMetavariable;
178
+ if (referenceVerifiesAsMetavariable) {
179
+ context.debug(`...verified the '${assumptionString}' assumption's '${referenceString}' reference as a metavariable.`);
180
+ }
181
+
182
+ return referenceVerifiesAsMetavariable;
177
183
  }
178
184
 
179
185
  verifyWhenStated(assignments, context) {
@@ -183,13 +189,12 @@ export default define(class Assumption {
183
189
 
184
190
  context.trace(`Verifying the '${assumptionString}' stated assumption...`);
185
191
 
186
- const reference = referenceFromMetavariable(this.metavariable, context),
187
- metavariablePresent = context.isMetavariablePresentByReference(reference);
192
+ const metavariablePresent = context.isMetavariablePresentByReference(this.reference);
188
193
 
189
194
  if (metavariablePresent) {
190
195
  verifiesWhenStated = true;
191
196
  } else {
192
- const metaLemmaMetatheorems = context.findMetaLemmaMetatheoremsByReference(reference),
197
+ const metaLemmaMetatheorems = context.findMetaLemmaMetatheoremsByReference(this.reference),
193
198
  metaLemmaMetatheoremsUnify = metaLemmaMetatheorems.every((metaLemmaMetatheorem) => {
194
199
  const metaLemmaMetatheoremUnifies = this.unifyMetaLemmaMetatheorem(metaLemmaMetatheorem, context);
195
200
 
@@ -215,8 +220,7 @@ export default define(class Assumption {
215
220
 
216
221
  context.trace(`Verifying the '${assumptionString}' derived assumption...`);
217
222
 
218
- const reference = referenceFromMetavariable(this.metavariable, context),
219
- metaLemmaMetatheoremPresent = context.isMetaLemmaMetatheoremPresentByReference(reference);
223
+ const metaLemmaMetatheoremPresent = context.isMetaLemmaMetatheoremPresentByReference(this.reference);
220
224
 
221
225
  verifiesWhenDerived = metaLemmaMetatheoremPresent; ///
222
226
 
@@ -264,8 +268,7 @@ export default define(class Assumption {
264
268
 
265
269
  context.trace(`Unifying the '${labelString}' label with the '${assumptionString}' assumption...`);
266
270
 
267
- const reference = referenceFromMetavariable(this.metavariable, context),
268
- labelUnifies = reference.unifyLabel(label, substitutions, context);
271
+ const labelUnifies = this.reference.unifyLabel(label, substitutions, context);
269
272
 
270
273
  labelUnifiesWithReference = labelUnifies; ///
271
274
 
@@ -325,10 +328,10 @@ export default define(class Assumption {
325
328
  const simple = this.isSimple();
326
329
 
327
330
  if (simple) {
328
- const metavariable = this.getMetavariable(),
329
- metavariableJSON = metavariableToMetavariableJSON(metavariable);
331
+ const reference = this, ///
332
+ referenceJSON = referenceToReferenceJSON(reference);
330
333
 
331
- json = metavariableJSON; ///
334
+ json = referenceJSON; ///
332
335
  }
333
336
 
334
337
  return json;
@@ -343,9 +346,9 @@ export default define(class Assumption {
343
346
  const string = null,
344
347
  node = null,
345
348
  statement = null,
346
- metavariable = metavariableFromJSON(json, context);
349
+ reference = referenceFromJSON(json, context);
347
350
 
348
- assumption = new Assumption(string, node, statement, metavariable)
351
+ assumption = new Assumption(string, node, statement, reference)
349
352
  }
350
353
 
351
354
  return assumption;
@@ -365,21 +368,13 @@ export default define(class Assumption {
365
368
  }
366
369
  });
367
370
 
368
- function referenceFromMetavariable(metavariable, context) {
369
- const { Reference } = ontology,
370
- metavariableNode = metavariable.getNode(),
371
- reference = Reference.fromMetavariableNode(metavariableNode, context);
372
-
373
- return reference;
374
- }
375
-
376
371
  function assumptionFromAssumptionNode(assumptionNode, context) {
377
- const { Metavariable, Assumption, Statement } = ontology,
372
+ const { Reference, Assumption, Statement } = ontology,
378
373
  node = assumptionNode, ///
379
374
  string = context.nodeAsString(node),
380
375
  statement = Statement.fromAssumptionNode(assumptionNode, context),
381
- metavariable = Metavariable.fromAssumptionNode(assumptionNode, context),
382
- assumption = new Assumption(string, node, statement, metavariable);
376
+ reference = Reference.fromAssumptionNode(assumptionNode, context),
377
+ assumption = new Assumption(string, node, statement, reference);
383
378
 
384
379
  return assumption;
385
380
  }
@@ -3,7 +3,7 @@
3
3
  import ontology from "../ontology";
4
4
 
5
5
  import { define } from "../ontology";
6
- import { unifyStatementWithCombinator } from "../utilities/unification";
6
+ import { unifyStatementWithCombinator } from "../process/unify";
7
7
  import { statementFromJSON, statementToStatementJSON } from "../utilities/json";
8
8
 
9
9
  export default define(class Combinator {
@@ -4,7 +4,7 @@ import ontology from "../ontology";
4
4
 
5
5
  import { define } from "../ontology";
6
6
  import { baseType } from ".//type";
7
- import { unifyTermWithConstructor } from "../utilities/unification";
7
+ import { unifyTermWithConstructor } from "../process/unify";
8
8
  import { termFromJSON, termToTermJSON } from "../utilities/json";
9
9
 
10
10
  export default define(class Constructor {
@@ -4,8 +4,7 @@ import ontology from "../../ontology";
4
4
  import Declaration from "../declaration";
5
5
 
6
6
  import { define } from "../../ontology";
7
-
8
- import combinatorVerifier from "../../verifier/combinator";
7
+ import { verifyStatement } from "../../process/verify";
9
8
 
10
9
  export default define(class CombinatorDeclaration extends Declaration {
11
10
  constructor(context, node, string, combinator) {
@@ -53,7 +52,7 @@ export default define(class CombinatorDeclaration extends Declaration {
53
52
  const statement = this.combinator.getStatement(),
54
53
  statementNode = statement.getNode();
55
54
 
56
- statementVerifies = combinatorVerifier.verifyStatement(statementNode, context);
55
+ statementVerifies = verifyStatement(statementNode, context);
57
56
 
58
57
  if (statementVerifies) {
59
58
  context.debug(`...verified the '${combinatorString}' combinator.`, node);
@@ -2,9 +2,9 @@
2
2
 
3
3
  import ontology from "../../ontology";
4
4
  import Declaration from "../declaration";
5
- import constructorVerifier from "../../verifier/constructor";
6
5
 
7
6
  import { define } from "../../ontology";
7
+ import { verifyTerm } from "../../process/verify";
8
8
 
9
9
  export default define(class ConstructorDeclaration extends Declaration {
10
10
  constructor(context, node, string, constructor) {
@@ -57,7 +57,7 @@ export default define(class ConstructorDeclaration extends Declaration {
57
57
  const term = this.constructor.getTerm(),
58
58
  termNode = term.getNode();
59
59
 
60
- constructorVerifies = constructorVerifier.verifyTerm(termNode, context);
60
+ constructorVerifies = verifyTerm(termNode, context);
61
61
 
62
62
  if (constructorVerifies) {
63
63
  context.debug(`...verified the '${constructorString}' constructor.`, node);
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  import ontology from "../ontology";
4
- import equationalUnifier from "../unifier/equantional";
5
4
  import EqualityAssignment from "../assignment/equality";
6
5
  import VariableAssignment from "../assignment/variable";
7
6
 
8
7
  import { define } from "../ontology";
8
+ import { equateTerms } from "../process/equate";
9
9
 
10
10
  export default define(class Equality {
11
11
  constructor(string, leftTerm, rightTerm) {
@@ -67,9 +67,9 @@ export default define(class Equality {
67
67
 
68
68
  const leftTermNode = this.leftTerm.getNode(),
69
69
  rightTermNode = this.rightTerm.getNode(),
70
- termsEquates = equationalUnifier.equateTerms(leftTermNode, rightTermNode, context);
70
+ termsEquate = equateTerms(leftTermNode, rightTermNode, context);
71
71
 
72
- if (termsEquates) {
72
+ if (termsEquate) {
73
73
  equal = true;
74
74
  }
75
75
 
@@ -143,7 +143,7 @@ export default define(class Equivalence {
143
143
  compress(terms, (termA, termB) => {
144
144
  const termAEqualToTermB = termA.isEqualTo(termB);
145
145
 
146
- if (termAEqualToTermB) {
146
+ if (!termAEqualToTermB) {
147
147
  return true;
148
148
  }
149
149
  });
@@ -53,9 +53,9 @@ export default define(class Frame {
53
53
  getMetavariable() {
54
54
  let metavariable = null;
55
55
 
56
- const simple = this.isSimple();
56
+ const singular = this.isSingular();
57
57
 
58
- if (simple) {
58
+ if (singular) {
59
59
  const assumption = this.getAssumption();
60
60
 
61
61
  metavariable = assumption.getMetavariable();
@@ -64,15 +64,49 @@ export default define(class Frame {
64
64
  return metavariable;
65
65
  }
66
66
 
67
- isSimple() { return this.node.isSimple();}
67
+ getMetavariableName() {
68
+ let metavariableName = null;
69
+
70
+ const singular = this.isSingular();
71
+
72
+ if (singular) {
73
+ metavariableName = this.node.getMetavariableName();
74
+ }
75
+
76
+ return metavariableName;
77
+ }
78
+
79
+ isSingular() { return this.node.isSingular(); }
68
80
 
69
81
  isEqualTo(frame) {
70
- const frameString = frame.getString(),
71
- equalTo = (frameString === this.string);
82
+ const frameNode = frame.getNode(),
83
+ matches = this.node.match(frameNode),
84
+ equalTo = matches; ///
72
85
 
73
86
  return equalTo;
74
87
  }
75
88
 
89
+ isMetavariableEqualToMetavariable(metavariable, context) {
90
+ let metavariableEqualToMetavariable;
91
+
92
+ const singular = this.isSingular();
93
+
94
+ if (singular) {
95
+ const metavariableA = metavariable, ///
96
+ singularMetavariableNode = this.node.getSingularMetavariableNode(),
97
+ metavariableName = singularMetavariableNode.getMetavariableName();
98
+
99
+ metavariable = context.findMetavariableByMetavariableName(metavariableName)
100
+
101
+ const metavariableB = metavariable,
102
+ equalTo = metavariableA.isEqualTo(metavariableB);
103
+
104
+ metavariableEqualToMetavariable = equalTo; ///
105
+ }
106
+
107
+ return metavariableEqualToMetavariable;
108
+ }
109
+
76
110
  matchFrameNode(frameNode) { return this.node.match(frameNode); }
77
111
 
78
112
  matchSubstitution(substitution, context) {
@@ -165,10 +199,10 @@ export default define(class Frame {
165
199
 
166
200
  context.trace(`Verifying the '${frameString}' stated frame...`);
167
201
 
168
- const simple = this.isSimple();
202
+ const singular = this.isSingular();
169
203
 
170
- if (!simple) {
171
- context.trace(`The '${frameString}' stated frame must be simple.`);
204
+ if (!singular) {
205
+ context.trace(`The '${frameString}' stated frame must be singular.`);
172
206
  } else {
173
207
  verifiesWhenStated = true;
174
208
  }
@@ -253,9 +287,9 @@ export default define(class Frame {
253
287
  toJSON() {
254
288
  let json = null;
255
289
 
256
- const simple = this.isSimple();
290
+ const singular = this.isSingular();
257
291
 
258
- if (simple) {
292
+ if (singular) {
259
293
  const assumption = this.getAssumption(),
260
294
  assumptionJSON = assumption.toJSON();
261
295
 
@@ -6,8 +6,9 @@ import JudgementAssignment from "../assignment/judgement";
6
6
  import { define } from "../ontology";
7
7
 
8
8
  export default define(class Judgement {
9
- constructor(string, frame, assumption) {
9
+ constructor(string, node, frame, assumption) {
10
10
  this.string = string;
11
+ this.node = node;
11
12
  this.frame = frame;
12
13
  this.assumption = assumption;
13
14
  }
@@ -16,6 +17,10 @@ export default define(class Judgement {
16
17
  return this.string;
17
18
  }
18
19
 
20
+ getNode() {
21
+ return this.node;
22
+ }
23
+
19
24
  getFrame() {
20
25
  return this.frame;
21
26
  }
@@ -24,7 +29,7 @@ export default define(class Judgement {
24
29
  return this.assumption;
25
30
  }
26
31
 
27
- isSimple() { return this.frame.isSimple(); }
32
+ isSingular() { return this.node.isSingular(); }
28
33
 
29
34
  getMetavariable() { return this.frame.getMetavariable(); }
30
35
 
@@ -157,7 +162,7 @@ export default define(class Judgement {
157
162
  frame = Frame.fromJudgementNode(judgementNode, context),
158
163
  assumption = Assumption.fromJudgementNode(judgementNode, context);
159
164
 
160
- judgement = new Judgement(string, frame, assumption);
165
+ judgement = new Judgement(string, node, frame, assumption);
161
166
  }
162
167
 
163
168
  return judgement;