occam-verify-cli 1.0.448 → 1.0.457

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 (161) hide show
  1. package/lib/constants.js +1 -5
  2. package/lib/context/file.js +50 -78
  3. package/lib/context/fragment.js +77 -0
  4. package/lib/context/release.js +3 -3
  5. package/lib/context/scoped.js +314 -0
  6. package/lib/context/transient.js +371 -0
  7. package/lib/element/assumption.js +71 -84
  8. package/lib/element/combinator/bracketed.js +1 -10
  9. package/lib/element/conclusion.js +11 -8
  10. package/lib/element/constructor/bracketed.js +1 -10
  11. package/lib/element/declaration/combinator.js +1 -2
  12. package/lib/element/declaration/metavariable.js +3 -3
  13. package/lib/element/declaration/variable.js +3 -3
  14. package/lib/element/deduction.js +18 -13
  15. package/lib/element/frame.js +40 -46
  16. package/lib/element/judgement.js +35 -56
  17. package/lib/element/metaType.js +5 -4
  18. package/lib/element/metavariable.js +6 -6
  19. package/lib/element/proof.js +4 -4
  20. package/lib/element/proofAssertion/premise.js +308 -0
  21. package/lib/element/proofAssertion/step.js +305 -0
  22. package/lib/element/proofAssertion/supposition.js +322 -0
  23. package/lib/element/proofAssertion.js +5 -9
  24. package/lib/element/reference.js +24 -23
  25. package/lib/element/rule.js +4 -4
  26. package/lib/element/section.js +4 -4
  27. package/lib/element/statement.js +2 -7
  28. package/lib/element/subproof.js +4 -4
  29. package/lib/element/substitution/frame.js +7 -7
  30. package/lib/element/substitution/statement.js +15 -39
  31. package/lib/element/substitution.js +5 -5
  32. package/lib/element/term.js +12 -10
  33. package/lib/element/topLevelAssertion/axiom.js +329 -0
  34. package/lib/element/{conjecture.js → topLevelAssertion/conjecture.js} +7 -7
  35. package/lib/element/{lemma.js → topLevelAssertion/lemma.js} +6 -6
  36. package/lib/element/{theorem.js → topLevelAssertion/theorem.js} +7 -7
  37. package/lib/element/topLevelAssertion.js +427 -0
  38. package/lib/element/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +7 -7
  39. package/lib/element/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +7 -7
  40. package/lib/element/topLevelMetaAssertion.js +289 -0
  41. package/lib/element/type.js +4 -4
  42. package/lib/element/variable.js +20 -20
  43. package/lib/metaTypes.js +18 -15
  44. package/lib/node/proofAssertion/premise.js +116 -0
  45. package/lib/node/proofAssertion/step.js +152 -0
  46. package/lib/node/proofAssertion/supposition.js +116 -0
  47. package/lib/node/{premise.js → proofAssertion.js} +11 -18
  48. package/lib/node/statement.js +2 -2
  49. package/lib/node/substitution/statement.js +2 -2
  50. package/lib/node/{axiom.js → topLevelAssertion/axiom.js} +7 -7
  51. package/lib/node/{conjecture.js → topLevelAssertion/conjecture.js} +7 -7
  52. package/lib/node/{lemma.js → topLevelAssertion/lemma.js} +7 -7
  53. package/lib/node/{theorem.js → topLevelAssertion/theorem.js} +7 -7
  54. package/lib/node/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +9 -9
  55. package/lib/node/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +7 -7
  56. package/lib/node/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +7 -7
  57. package/lib/node/{metaLemmaMetaTheorem.js → topLevelMetaAssertion.js} +9 -9
  58. package/lib/nonTerminalNodeMap.js +13 -13
  59. package/lib/preamble.js +10 -10
  60. package/lib/process/instantiate.js +6 -9
  61. package/lib/process/unify.js +7 -6
  62. package/lib/types.js +3 -3
  63. package/lib/utilities/bnf.js +5 -5
  64. package/lib/utilities/context.js +28 -0
  65. package/lib/utilities/element.js +101 -99
  66. package/lib/utilities/fragment.js +23 -0
  67. package/lib/utilities/instance.js +12 -34
  68. package/lib/utilities/json.js +3 -2
  69. package/lib/utilities/string.js +42 -21
  70. package/lib/utilities/unification.js +17 -17
  71. package/lib/utilities/validation.js +22 -25
  72. package/package.json +2 -2
  73. package/src/constants.js +0 -1
  74. package/src/context/file.js +48 -55
  75. package/src/context/fragment.js +38 -0
  76. package/src/context/release.js +4 -2
  77. package/src/context/{local.js → scoped.js} +8 -100
  78. package/src/context/{temporary.js → transient.js} +9 -131
  79. package/src/element/assumption.js +69 -85
  80. package/src/element/combinator/bracketed.js +0 -7
  81. package/src/element/conclusion.js +14 -10
  82. package/src/element/constructor/bracketed.js +0 -7
  83. package/src/element/declaration/combinator.js +0 -1
  84. package/src/element/declaration/metavariable.js +2 -2
  85. package/src/element/declaration/variable.js +5 -5
  86. package/src/element/deduction.js +22 -15
  87. package/src/element/frame.js +36 -48
  88. package/src/element/judgement.js +33 -58
  89. package/src/element/metaType.js +4 -4
  90. package/src/element/metavariable.js +8 -6
  91. package/src/element/proof.js +3 -3
  92. package/src/element/{premise.js → proofAssertion/premise.js} +23 -23
  93. package/src/element/{step.js → proofAssertion/step.js} +32 -40
  94. package/src/element/{supposition.js → proofAssertion/supposition.js} +24 -24
  95. package/src/element/proofAssertion.js +6 -13
  96. package/src/element/reference.js +23 -21
  97. package/src/element/rule.js +3 -3
  98. package/src/element/section.js +4 -4
  99. package/src/element/statement.js +2 -9
  100. package/src/element/subproof.js +3 -3
  101. package/src/element/substitution/frame.js +10 -13
  102. package/src/element/substitution/statement.js +20 -52
  103. package/src/element/substitution.js +3 -3
  104. package/src/element/term.js +10 -9
  105. package/src/element/{axiom.js → topLevelAssertion/axiom.js} +15 -15
  106. package/src/element/{conjecture.js → topLevelAssertion/conjecture.js} +4 -4
  107. package/src/element/{lemma.js → topLevelAssertion/lemma.js} +3 -3
  108. package/src/element/{theorem.js → topLevelAssertion/theorem.js} +4 -4
  109. package/src/element/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +9 -9
  110. package/src/element/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +4 -4
  111. package/src/element/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +4 -4
  112. package/src/element/{metaLemmaMetatheorem.js → topLevelMetaAssertion.js} +7 -7
  113. package/src/element/type.js +2 -4
  114. package/src/element/variable.js +17 -17
  115. package/src/metaTypes.js +25 -9
  116. package/src/node/proofAssertion/premise.js +16 -0
  117. package/src/node/{step.js → proofAssertion/step.js} +4 -18
  118. package/src/node/proofAssertion/supposition.js +16 -0
  119. package/src/node/proofAssertion.js +23 -0
  120. package/src/node/statement.js +1 -1
  121. package/src/node/substitution/statement.js +1 -1
  122. package/src/node/topLevelAssertion/axiom.js +13 -0
  123. package/src/node/topLevelAssertion/conjecture.js +13 -0
  124. package/src/node/topLevelAssertion/lemma.js +13 -0
  125. package/src/node/topLevelAssertion/theorem.js +13 -0
  126. package/src/node/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +1 -1
  127. package/src/node/topLevelMetaAssertion/metaLemma.js +13 -0
  128. package/src/node/topLevelMetaAssertion/metatheorem.js +13 -0
  129. package/src/node/{metaLemmaMetaTheorem.js → topLevelMetaAssertion.js} +1 -1
  130. package/src/nonTerminalNodeMap.js +12 -12
  131. package/src/preamble.js +9 -9
  132. package/src/process/instantiate.js +31 -32
  133. package/src/process/unify.js +6 -5
  134. package/src/types.js +4 -2
  135. package/src/utilities/bnf.js +3 -2
  136. package/src/utilities/context.js +20 -0
  137. package/src/utilities/element.js +169 -162
  138. package/src/utilities/fragment.js +11 -0
  139. package/src/utilities/instance.js +19 -42
  140. package/src/utilities/json.js +3 -1
  141. package/src/utilities/string.js +53 -28
  142. package/src/utilities/unification.js +16 -16
  143. package/src/utilities/validation.js +26 -35
  144. package/lib/context/local.js +0 -605
  145. package/lib/context/temporary.js +0 -752
  146. package/lib/element/axiom.js +0 -329
  147. package/lib/element/axiomLemmaTheoremConjecture.js +0 -427
  148. package/lib/element/metaLemmaMetatheorem.js +0 -289
  149. package/lib/element/premise.js +0 -307
  150. package/lib/element/step.js +0 -311
  151. package/lib/element/supposition.js +0 -320
  152. package/lib/node/step.js +0 -166
  153. package/lib/node/supposition.js +0 -130
  154. package/src/node/axiom.js +0 -13
  155. package/src/node/conjecture.js +0 -13
  156. package/src/node/lemma.js +0 -13
  157. package/src/node/metaLemma.js +0 -13
  158. package/src/node/metatheorem.js +0 -13
  159. package/src/node/premise.js +0 -30
  160. package/src/node/supposition.js +0 -30
  161. package/src/node/theorem.js +0 -13
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import Element from "../element";
4
- import TemporaryContext from "../context/temporary";
4
+ import TransientContext from "../context/transient";
5
5
 
6
6
  import { define } from "../elements";
7
7
  import { termsFromJSON, framesFromJSON, statementFromJSON, termsToTermsJSON, framesToFramesJSON, statementToStatementJSON } from "../utilities/json";
@@ -20,9 +20,9 @@ export default define(class Deduction extends Element {
20
20
  verify(context) {
21
21
  let verifies = false;
22
22
 
23
- const temporaryContext = TemporaryContext.fromNothing(context);
23
+ const transientContext = TransientContext.fromNothing(context);
24
24
 
25
- context = temporaryContext; ///
25
+ context = transientContext; ///
26
26
 
27
27
  const node = this.getNode(),
28
28
  deductionString = this.getString(); ///
@@ -53,14 +53,18 @@ export default define(class Deduction extends Element {
53
53
  unifyStatement(statement, substitutions, context) {
54
54
  let statementUnifies;
55
55
 
56
- const deduction = this, ///
57
- statementString = statement.getString(),
58
- deductionString = deduction.getString();
56
+ const statementString = statement.getString(),
57
+ deductionString = this.getString(); ///
59
58
 
60
59
  context.trace(`Unifying the '${statementString}' statement with the '${deductionString}' deduction...`);
61
60
 
62
- const generalContext = this.context, ///
63
- specificContext = context; ///
61
+ const specificContext = context; ///
62
+
63
+ context = this.getContext();
64
+
65
+ const generalContext = context; ///
66
+
67
+ context = specificContext; ///
64
68
 
65
69
  statementUnifies = this.statement.unifyStatement(statement, substitutions, generalContext, specificContext);
66
70
 
@@ -72,22 +76,25 @@ export default define(class Deduction extends Element {
72
76
  }
73
77
 
74
78
  unifyDeduction(deduction, substitutions, generalContext, specificContext) {
75
- let deductionUnifies;
79
+ let deductionUnifies = false;
76
80
 
77
81
  const context = specificContext, ///
82
+ generalDeduction = this, ///
78
83
  specificDeduction = deduction, ///
79
- generalDeductionString = this.string, ///
84
+ generalDeductionString = generalDeduction.getString(),
80
85
  specificDeductionString = specificDeduction.getString();
81
86
 
82
- context.trace(`Unifying the '${specificDeductionString}' deduction with the '${generalDeductionString}' deduction...`, this.node);
87
+ context.trace(`Unifying the '${specificDeductionString}' deduction with the '${generalDeductionString}' deduction...`);
83
88
 
84
89
  const statement = specificDeduction.getStatement(),
85
90
  statementUnifies = this.unifyStatement(statement, substitutions, generalContext, specificContext);
86
91
 
87
- deductionUnifies = statementUnifies; ///
92
+ if (statementUnifies) {
93
+ deductionUnifies = true;
94
+ }
88
95
 
89
96
  if (deductionUnifies) {
90
- context.debug(`...unified the '${specificDeductionString}' deduction with the '${generalDeductionString}' deduction.`, this.node);
97
+ context.debug(`...unified the '${specificDeductionString}' deduction with the '${generalDeductionString}' deduction.`);
91
98
  }
92
99
 
93
100
  return deductionUnifies;
@@ -127,9 +134,9 @@ export default define(class Deduction extends Element {
127
134
  statement = statementFromJSON(json, context),
128
135
  node = null,
129
136
  string = statement.getString(),
130
- temporaryContext = TemporaryContext.fromTermsAndFrames(terms, frames, context);
137
+ transientContext = TransientContext.fromTermsAndFrames(terms, frames, context);
131
138
 
132
- context = temporaryContext; ///
139
+ context = transientContext; ///
133
140
 
134
141
  const deduction = new Deduction(context, string, statement);
135
142
 
@@ -6,7 +6,6 @@ import Element from "../element";
6
6
  import elements from "../elements";
7
7
 
8
8
  import { define } from "../elements";
9
- import { S, NOTHING } from "../constants";
10
9
  import { FRAME_META_TYPE_NAME } from "../metaTypeNames";
11
10
 
12
11
  const { first } = arrayUtilities;
@@ -115,7 +114,7 @@ export default define(class Frame extends Element {
115
114
  compareSubstitutions(substitutions, context) {
116
115
  let comparesToSubstitutions;
117
116
 
118
- const frameString = this.string, ///
117
+ const frameString = this.getString(), ///
119
118
  substitutionsString = substitutions.asString();
120
119
 
121
120
  context.trace(`Comparing the '${frameString}' frame to the '${substitutionsString}' substitutions...`);
@@ -135,114 +134,103 @@ export default define(class Frame extends Element {
135
134
  return comparesToSubstitutions;
136
135
  }
137
136
 
138
- verify(assignments, stated, context) {
139
- let verifies = false;
137
+ validate(assignments, stated, context) {
138
+ let validates = false;
140
139
 
141
- const frameString = this.string; ///
140
+ const frameString = this.getString(); ///
142
141
 
143
- context.trace(`Verifying the '${frameString}' frame...`);
142
+ context.trace(`Validating the '${frameString}' frame...`);
144
143
 
145
- const assumptionsVerify = this.verifyAssumptions(assignments, stated, context);
144
+ const assumptionsValidate = this.validateAssumptions(assignments, stated, context);
146
145
 
147
- if (assumptionsVerify) {
148
- let verifiesWhenStated = false,
149
- verifiesWhenDerived = false;
146
+ if (assumptionsValidate) {
147
+ let validatesWhenStated = false,
148
+ validatesWhenDerived = false;
150
149
 
151
150
  if (stated) {
152
- verifiesWhenStated = this.verifyWhenStated(assignments, context);
151
+ validatesWhenStated = this.validateWhenStated(assignments, context);
153
152
  } else {
154
- verifiesWhenDerived = this.verifyWhenDerived(context);
153
+ validatesWhenDerived = this.validateWhenDerived(context);
155
154
  }
156
155
 
157
- if (verifiesWhenStated || verifiesWhenDerived) {
158
- verifies = true;
156
+ if (validatesWhenStated || validatesWhenDerived) {
157
+ validates = true;
159
158
  }
160
159
  }
161
160
 
162
- if (verifies) {
161
+ if (validates) {
163
162
  const frame = this; ///
164
163
 
165
164
  context.addFrame(frame);
166
165
 
167
- context.debug(`...verified the '${frameString}' frame.`);
166
+ context.debug(`...validated the '${frameString}' frame.`);
168
167
  }
169
168
 
170
- return verifies;
169
+ return validates;
171
170
  }
172
171
 
173
- verifyWhenStated(assignments, context) {
174
- let verifiesWhenStated = false;
172
+ validateWhenStated(assignments, context) {
173
+ let validatesWhenStated = false;
175
174
 
176
- const frameString = this.string; ///
175
+ const frameString = this.getString(); ///
177
176
 
178
- context.trace(`Verifying the '${frameString}' stated frame...`);
177
+ context.trace(`Validating the '${frameString}' stated frame...`);
179
178
 
180
179
  const singular = this.isSingular();
181
180
 
182
181
  if (!singular) {
183
182
  context.trace(`The '${frameString}' stated frame must be singular.`);
184
183
  } else {
185
- verifiesWhenStated = true;
184
+ validatesWhenStated = true;
186
185
  }
187
186
 
188
- if (verifiesWhenStated) {
189
- context.debug(`...verified the '${frameString}' stated frame.`);
187
+ if (validatesWhenStated) {
188
+ context.debug(`...validated the '${frameString}' stated frame.`);
190
189
  }
191
190
 
192
- return verifiesWhenStated;
191
+ return validatesWhenStated;
193
192
  }
194
193
 
195
- verifyWhenDerived(context) {
196
- let verifiesWhenDerived;
194
+ validateWhenDerived(context) {
195
+ let validatesWhenDerived;
197
196
 
198
- const frameString = this.string; ///
197
+ const frameString = this.getString(); ///
199
198
 
200
199
  context.trace(`Verifying the '${frameString}' derived frame...`);
201
200
 
202
- verifiesWhenDerived = true;
201
+ validatesWhenDerived = true;
203
202
 
204
- if (verifiesWhenDerived) {
203
+ if (validatesWhenDerived) {
205
204
  context.debug(`...verified the '${frameString}' derived frame.`);
206
205
  }
207
206
 
208
- return verifiesWhenDerived;
207
+ return validatesWhenDerived;
209
208
  }
210
209
 
211
- verifyAssumptions(assignments, stated, context) {
212
- let assumptionsVerify = true; ///
210
+ validateAssumptions(assignments, stated, context) {
211
+ let assumptionsValidate = true; ///
213
212
 
214
213
  const length = this.getLength();
215
214
 
216
215
  if (length > 0) {
217
- const sOrNothing = (length > 1) ?
218
- S :
219
- NOTHING,
220
- assumptionsString = assumptionsStringFromAssumptions(this.assumptions);
221
-
222
- context.trace(`Verifying the '${assumptionsString}' assumption${sOrNothing}...`);
223
-
224
216
  stated = true; ///
225
217
 
226
218
  assignments = null; ///
227
219
 
228
- assumptionsVerify = this.assumptions.every((assumption) => {
229
- const assumptionVerifies = assumption.verify(assignments, stated, context);
220
+ assumptionsValidate = this.assumptions.every((assumption) => {
221
+ const assumptionVerifies = assumption.validate(assignments, stated, context);
230
222
 
231
223
  return assumptionVerifies;
232
224
  });
233
-
234
- if (assumptionsVerify) {
235
- context.debug(`...verified the '${assumptionsString}' assumption${sOrNothing}.`);
236
- }
237
225
  }
238
226
 
239
- return assumptionsVerify;
227
+ return assumptionsValidate;
240
228
  }
241
229
 
242
230
  validateGivenMetaType(metaType, assignments, stated, context) {
243
231
  let validatesGivenMetaType = false;
244
232
 
245
- const frameString = this.string, ///
233
+ const frameString = this.getString(), ///
246
234
  metaTypeString = metaType.getString();
247
235
 
248
236
  context.trace(`Validatin the '${frameString}' frame given the '${metaTypeString}' meta-type...`);
@@ -26,110 +26,85 @@ export default define(class Judgement extends Element {
26
26
 
27
27
  getMetavariable() { return this.frame.getMetavariable(); }
28
28
 
29
- verify(assignments, stated, context) {
30
- let verifies = false;
29
+ validate(assignments, stated, context) {
30
+ let validates = false;
31
31
 
32
32
  const judgementString = this.string; ///
33
33
 
34
- context.trace(`Verifying the '${judgementString}' judgement...`);
34
+ context.trace(`Validating the '${judgementString}' judgement...`);
35
35
 
36
- const frameVerifies = this.verifyFrame(assignments, stated, context);
36
+ const frameValidates = this.frame.validate(assignments, stated, context);
37
37
 
38
- if (frameVerifies) {
39
- const declarationVerifies = this.verifyDeclaration(assignments, stated, context);
38
+ if (frameValidates) {
39
+ const assumptionValidates = this.assumption.validate(assignments, stated, context);
40
40
 
41
- if (declarationVerifies) {
42
- let verifiesWhenStated = false,
43
- verifiesWhenDerived = false;
41
+ if (assumptionValidates) {
42
+ let validatesWhenStated = false,
43
+ validatesWhenDerived = false;
44
44
 
45
45
  if (stated) {
46
- verifiesWhenStated = this.verifyWhenStated(assignments, context);
46
+ validatesWhenStated = this.validateWhenStated(assignments, context);
47
47
  } else {
48
- verifiesWhenDerived = this.verifyWhenDerived(context);
48
+ validatesWhenDerived = this.validateWhenDerived(context);
49
49
  }
50
50
 
51
- if (verifiesWhenStated || verifiesWhenDerived) {
52
- verifies = true;
51
+ if (validatesWhenStated || validatesWhenDerived) {
52
+ validates = true;
53
53
  }
54
54
  }
55
55
  }
56
56
 
57
- if (verifies) {
57
+ if (validates) {
58
58
  if (stated) {
59
59
  this.assign(assignments, context);
60
60
  }
61
61
  }
62
62
 
63
- if (verifies) {
64
- context.debug(`...verified the '${judgementString}' judgement.`);
63
+ if (validates) {
64
+ context.debug(`...validated the '${judgementString}' judgement.`);
65
65
  }
66
66
 
67
- return verifies;
67
+ return validates;
68
68
  }
69
69
 
70
- verifyFrame(assignments, stated, context) {
71
- let frameVerifies;
72
-
73
- const frameString = this.frame.getString();
74
-
75
- context.trace(`Verifying the '${frameString}' frame...`);
76
-
77
- frameVerifies = this.frame.verify(assignments, stated, context);
78
-
79
- if (frameVerifies) {
80
- context.debug(`...verified the '${frameString}' frame.`);
81
- }
82
-
83
- return frameVerifies;
84
- }
85
-
86
- verifyDeclaration(assignments, stated, context) {
87
- let declarationVerifies;
88
-
89
- declarationVerifies = this.assumption.verify(assignments, stated, context);
90
-
91
- return declarationVerifies;
92
- }
93
-
94
- verifyWhenStated(assignments, context) {
95
- let verifiesWhenStated;
70
+ validateWhenStated(assignments, context) {
71
+ let validatesWhenStated;
96
72
 
97
73
  const judgementString = this.string; ///
98
74
 
99
- context.trace(`Verifying the '${judgementString}' stated judgement...`);
75
+ context.trace(`Validating the '${judgementString}' stated judgement...`);
100
76
 
101
- verifiesWhenStated = true;
77
+ validatesWhenStated = true;
102
78
 
103
- if (verifiesWhenStated) {
104
- context.debug(`...verified the '${judgementString}' stated judgement.`);
79
+ if (validatesWhenStated) {
80
+ context.debug(`...validated the '${judgementString}' stated judgement.`);
105
81
  }
106
82
 
107
- return verifiesWhenStated;
83
+ return validatesWhenStated;
108
84
  }
109
85
 
110
- verifyWhenDerived(context) {
111
- let verifiesWhenDerived = false;
86
+ validateWhenDerived(context) {
87
+ let validatesWhenDerived = false;
112
88
 
113
89
  const judgementString = this.string; ///
114
90
 
115
- context.trace(`Verifying the '${judgementString}' derived judgement...`);
91
+ context.trace(`Validating the '${judgementString}' derived judgement...`);
116
92
 
117
93
  const metavariable = this.assumption.getMetavariable(),
118
94
  reference = referenceFromMetavariable(metavariable, context),
119
- metaLemmaMetatheorem = context.findMetaLemmaMetatheoremByReference(reference),
120
- substitutions = metaLemmaMetatheorem.getSubstitutions(),
95
+ topLevelMetaAssertion = context.findTopLevelMetaAssertionByReference(reference),
96
+ substitutions = topLevelMetaAssertion.getSubstitutions(),
121
97
  frameComparesToSubstitutions = this.frame.compareSubstitutions(substitutions, context);
122
98
 
123
99
  if (frameComparesToSubstitutions) {
124
- verifiesWhenDerived = true;
125
-
100
+ validatesWhenDerived = true;
126
101
  }
127
102
 
128
- if (verifiesWhenDerived) {
129
- context.debug(`...verified the '${judgementString}' derived judgement.`);
103
+ if (validatesWhenDerived) {
104
+ context.debug(`...validated the '${judgementString}' derived judgement.`);
130
105
  }
131
106
 
132
- return verifiesWhenDerived;
107
+ return validatesWhenDerived;
133
108
  }
134
109
 
135
110
  assign(assignments, context) {
@@ -3,6 +3,7 @@
3
3
  import Element from "../element";
4
4
 
5
5
  import { define } from "../elements";
6
+ import { findMetaTypeFromTypeName } from "../metaTypes";
6
7
 
7
8
  export default define(class MetaType extends Element {
8
9
  constructor(context, string, node, name) {
@@ -41,14 +42,13 @@ export default define(class MetaType extends Element {
41
42
  static fromJSON(json, context) {
42
43
  const { name } = json,
43
44
  metaTypeName = name, ///
44
- metaType = metaTypeFromMetaTypeName(metaTypeName);
45
+ metaType = findMetaTypeByMetaTypeName(metaTypeName);
45
46
 
46
47
  return metaType;
47
48
  }
48
49
 
49
- static fromName(name) {
50
- const context = null,
51
- string = name,
50
+ static fromName(name, context) {
51
+ const string = name,
52
52
  node = null,
53
53
  metaType = new MetaType(context, string, node, name);
54
54
 
@@ -78,8 +78,8 @@ export default define(class Metavariable extends Element {
78
78
  validateGivenMetaType(metaType, context) {
79
79
  let validatesGivenMetaType = false;
80
80
 
81
- const metavariableString = this.getString(), ///
82
- metaTypeString = metaType.getString();
81
+ const metaTypeString = metaType.getString(),
82
+ metavariableString = this.getString(); ///
83
83
 
84
84
  context.trace(`Validating the '${metavariableString}' metavariable given the '${metaTypeString}' meta-type...`);
85
85
 
@@ -169,15 +169,17 @@ export default define(class Metavariable extends Element {
169
169
  if (substitutionPresent) {
170
170
  substitution = substitutions.findSubstitutionByMetavariableAndSubstitution(metavariable, substitution); ///
171
171
 
172
- const substitutionStatementEqualToStatement = substitution.isStatementEqualToStatement(statement, context);
172
+ const substitutionComparesToStatement = substitution.compareStatement(statement, context);
173
173
 
174
- if (substitutionStatementEqualToStatement) {
174
+ if (substitutionComparesToStatement) {
175
175
  statementUnifies = true;
176
176
  }
177
177
  } else {
178
178
  const { StatementSubstitution } = elements,
179
179
  metavariable = this,
180
- statementSubstitution = StatementSubstitution.fromStatementMetavariableAndSubstitution(statement, metavariable, substitution, context);
180
+ statementSubstitution = (substitution !== null ) ?
181
+ StatementSubstitution.fromStatementMetavariableAndSubstitution(statement, metavariable, substitution, context) :
182
+ StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, context);
181
183
 
182
184
  substitution = statementSubstitution; ///
183
185
 
@@ -308,7 +310,7 @@ export default define(class Metavariable extends Element {
308
310
 
309
311
  if (generalContextFilePath === specificContextFilePath) {
310
312
  const metavariable = this, ///
311
- metavariableString = this.getString(), ///
313
+ metavariableString = metavariable.getString(),
312
314
  statementMetavariableEqualToMetvariable = statement.isMetavariableEqualToMetavariable(metavariable, context);
313
315
 
314
316
  if (statementMetavariableEqualToMetvariable) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import Element from "../element";
4
- import LocalContext from "../context/local";
4
+ import ScopedContext from "../context/scoped";
5
5
 
6
6
  import { define } from "../elements";
7
7
 
@@ -29,9 +29,9 @@ export default define(class Proof extends Element {
29
29
  verify(substitutions, conclusion, context) {
30
30
  let verifies = false;
31
31
 
32
- const localContext = LocalContext.fromNothing(context); ///
32
+ const scopedContext = ScopedContext.fromNothing(context); ///
33
33
 
34
- context = localContext; ///
34
+ context = scopedContext; ///
35
35
 
36
36
  const derivationVerifies = this.derivation.verify(substitutions, context);
37
37
 
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- import ProofAssertion from "./proofAssertion";
4
- import TemporaryContext from "../context/temporary";
5
- import assignAssignments from "../process/assign";
3
+ import ProofAssertion from "../proofAssertion";
4
+ import TransientContext from "../../context/transient";
5
+ import assignAssignments from "../../process/assign";
6
6
 
7
- import { define } from "../elements";
7
+ import { define } from "../../elements";
8
8
  import { termsFromJSON,
9
9
  framesFromJSON,
10
10
  termsToTermsJSON,
@@ -12,7 +12,7 @@ import { termsFromJSON,
12
12
  framesToFramesJSON,
13
13
  procedureCallFromJSON,
14
14
  statementToStatementJSON,
15
- procedureCallToProcedureCallJSON } from "../utilities/json";
15
+ procedureCallToProcedureCallJSON } from "../../utilities/json";
16
16
 
17
17
  export default define(class Premise extends ProofAssertion {
18
18
  constructor(context, string, node, statement, procedureCall) {
@@ -28,9 +28,9 @@ export default define(class Premise extends ProofAssertion {
28
28
  verify(context) {
29
29
  let verifies = false;
30
30
 
31
- const temporaryContext = TemporaryContext.fromNothing(context);
31
+ const transientContext = TransientContext.fromNothing(context);
32
32
 
33
- context = temporaryContext; ///
33
+ context = transientContext; ///
34
34
 
35
35
  const node = this.getNode(),
36
36
  premiseString = this.getString(); ///
@@ -83,16 +83,15 @@ export default define(class Premise extends ProofAssertion {
83
83
  unifyIndependently(substitutions, context) {
84
84
  let unifiesIndependently = false;
85
85
 
86
- const node = this.getNode(),
87
- premiseString = this.getString(); ///
86
+ const premiseString = this.getString(); ///
88
87
 
89
- context.trace(`Unifying the '${premiseString}' premise independently...`, node);
88
+ context.trace(`Unifying the '${premiseString}' premise independently...`);
90
89
 
91
- const generalContext = context; ///
90
+ const specificContext = context; ///
92
91
 
93
92
  context = this.getContext();
94
93
 
95
- const specificContext = context; ///
94
+ const generalContext = context; ///
96
95
 
97
96
  context = specificContext; ///
98
97
 
@@ -115,7 +114,7 @@ export default define(class Premise extends ProofAssertion {
115
114
  }
116
115
 
117
116
  if (unifiesIndependently) {
118
- context.debug(`...unified the '${premiseString}' premise independenly.`, node);
117
+ context.debug(`...unified the '${premiseString}' premise independenly.`);
119
118
  }
120
119
 
121
120
  return unifiesIndependently;
@@ -126,8 +125,8 @@ export default define(class Premise extends ProofAssertion {
126
125
 
127
126
  const subproofOrProofAssertionProofAssertion = subproofOrProofAssertion.isProofAssertion(),
128
127
  proofAssertion = subproofOrProofAssertionProofAssertion ?
129
- subproofOrProofAssertion :
130
- null,
128
+ subproofOrProofAssertion :
129
+ null,
131
130
  subproof = subproofOrProofAssertionProofAssertion ?
132
131
  null :
133
132
  subproofOrProofAssertion;
@@ -164,18 +163,19 @@ export default define(class Premise extends ProofAssertion {
164
163
  unifyProofAssertion(proofAssertion, substitutions, context) {
165
164
  let proofAssertionUnifies = false;
166
165
 
167
- const node = this.getNode(),
168
- premiseString = this.getString(),
166
+ const premiseString = this.getString(),
169
167
  proofAssertionString = proofAssertion.getString();
170
168
 
171
- context.trace(`Unifying the '${proofAssertionString}' proof assertion with the '${premiseString}' premise...`, node);
172
-
173
- const specificContext = context; ///
169
+ context.trace(`Unifying the '${proofAssertionString}' proof assertion with the '${premiseString}' premise...`);
174
170
 
175
171
  context = this.getContext();
176
172
 
177
173
  const generalContext = context; ///
178
174
 
175
+ context = proofAssertion.getContext();
176
+
177
+ const specificContext = context; ///
178
+
179
179
  context = specificContext; ///
180
180
 
181
181
  const statement = proofAssertion.getStatement(),
@@ -186,7 +186,7 @@ export default define(class Premise extends ProofAssertion {
186
186
  }
187
187
 
188
188
  if (proofAssertionUnifies) {
189
- context.debug(`...unified the '${proofAssertionString}' proof assertion with the '${premiseString}' premise.`, node);
189
+ context.debug(`...unified the '${proofAssertionString}' proof assertion with the '${premiseString}' premise.`);
190
190
  }
191
191
 
192
192
  return proofAssertionUnifies;
@@ -271,7 +271,7 @@ export default define(class Premise extends ProofAssertion {
271
271
  frames = framesFromJSON(json, context),
272
272
  statement = statementFromJSON(json, context),
273
273
  procedureCall = procedureCallFromJSON(json, context),
274
- temporaryContext = TemporaryContext.fromTermsAndFrames(terms, frames, context);
274
+ transientContext = TransientContext.fromTermsAndFrames(terms, frames, context);
275
275
 
276
276
  let string;
277
277
 
@@ -285,7 +285,7 @@ export default define(class Premise extends ProofAssertion {
285
285
 
286
286
  const node = null;
287
287
 
288
- context = temporaryContext; ///
288
+ context = transientContext; ///
289
289
 
290
290
  const premise = new Premise(context, string, node, statement, procedureCall);
291
291