occam-verify-cli 1.0.444 → 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 (173) hide show
  1. package/lib/constants.js +1 -5
  2. package/lib/context/file.js +54 -82
  3. package/lib/context/fragment.js +77 -0
  4. package/lib/context/release.js +5 -9
  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/derivation.js +14 -14
  16. package/lib/element/frame.js +40 -46
  17. package/lib/element/hypothesis.js +14 -55
  18. package/lib/element/judgement.js +35 -56
  19. package/lib/element/metaType.js +5 -4
  20. package/lib/element/metavariable.js +14 -10
  21. package/lib/element/proof.js +10 -10
  22. package/lib/element/proofAssertion/premise.js +308 -0
  23. package/lib/element/proofAssertion/step.js +305 -0
  24. package/lib/element/proofAssertion/supposition.js +322 -0
  25. package/lib/element/proofAssertion.js +199 -0
  26. package/lib/element/reference.js +28 -25
  27. package/lib/element/rule.js +29 -29
  28. package/lib/element/section.js +4 -4
  29. package/lib/element/statement.js +9 -14
  30. package/lib/element/subDerivation.js +14 -14
  31. package/lib/element/subproof.js +14 -14
  32. package/lib/element/substitution/frame.js +7 -7
  33. package/lib/element/substitution/statement.js +15 -39
  34. package/lib/element/substitution.js +5 -5
  35. package/lib/element/term.js +12 -10
  36. package/lib/element/topLevelAssertion/axiom.js +329 -0
  37. package/lib/element/{conjecture.js → topLevelAssertion/conjecture.js} +7 -7
  38. package/lib/element/{lemma.js → topLevelAssertion/lemma.js} +6 -6
  39. package/lib/element/{theorem.js → topLevelAssertion/theorem.js} +7 -7
  40. package/lib/element/topLevelAssertion.js +427 -0
  41. package/lib/element/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +7 -7
  42. package/lib/element/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +7 -7
  43. package/lib/element/topLevelMetaAssertion.js +289 -0
  44. package/lib/element/type.js +4 -4
  45. package/lib/element/variable.js +20 -20
  46. package/lib/metaTypes.js +33 -19
  47. package/lib/node/proofAssertion/premise.js +116 -0
  48. package/lib/node/proofAssertion/step.js +152 -0
  49. package/lib/node/proofAssertion/supposition.js +116 -0
  50. package/lib/node/{premise.js → proofAssertion.js} +11 -18
  51. package/lib/node/statement.js +2 -2
  52. package/lib/node/subDerivation.js +1 -8
  53. package/lib/node/subproof.js +1 -8
  54. package/lib/node/substitution/statement.js +2 -2
  55. package/lib/node/{axiom.js → topLevelAssertion/axiom.js} +7 -7
  56. package/lib/node/{conjecture.js → topLevelAssertion/conjecture.js} +7 -7
  57. package/lib/node/{lemma.js → topLevelAssertion/lemma.js} +7 -7
  58. package/lib/node/{theorem.js → topLevelAssertion/theorem.js} +7 -7
  59. package/lib/node/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +9 -9
  60. package/lib/node/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +7 -7
  61. package/lib/node/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +7 -7
  62. package/lib/node/{metaLemmaMetaTheorem.js → topLevelMetaAssertion.js} +9 -9
  63. package/lib/nonTerminalNodeMap.js +13 -13
  64. package/lib/preamble.js +10 -10
  65. package/lib/process/instantiate.js +6 -9
  66. package/lib/process/unify.js +7 -6
  67. package/lib/types.js +3 -3
  68. package/lib/utilities/bnf.js +5 -5
  69. package/lib/utilities/brackets.js +6 -11
  70. package/lib/utilities/context.js +28 -0
  71. package/lib/utilities/element.js +101 -99
  72. package/lib/utilities/fragment.js +23 -0
  73. package/lib/utilities/instance.js +12 -21
  74. package/lib/utilities/json.js +3 -2
  75. package/lib/utilities/string.js +44 -23
  76. package/lib/utilities/unification.js +36 -36
  77. package/lib/utilities/validation.js +22 -25
  78. package/package.json +6 -6
  79. package/src/constants.js +0 -1
  80. package/src/context/file.js +51 -58
  81. package/src/context/fragment.js +38 -0
  82. package/src/context/release.js +6 -11
  83. package/src/context/{local.js → scoped.js} +35 -127
  84. package/src/context/{temporary.js → transient.js} +9 -131
  85. package/src/element/assumption.js +69 -85
  86. package/src/element/combinator/bracketed.js +0 -7
  87. package/src/element/conclusion.js +14 -10
  88. package/src/element/constructor/bracketed.js +0 -7
  89. package/src/element/declaration/combinator.js +0 -1
  90. package/src/element/declaration/metavariable.js +2 -2
  91. package/src/element/declaration/variable.js +5 -5
  92. package/src/element/deduction.js +22 -15
  93. package/src/element/derivation.js +12 -12
  94. package/src/element/frame.js +36 -48
  95. package/src/element/hypothesis.js +14 -16
  96. package/src/element/judgement.js +33 -58
  97. package/src/element/metaType.js +4 -4
  98. package/src/element/metavariable.js +17 -10
  99. package/src/element/proof.js +9 -9
  100. package/src/element/{premise.js → proofAssertion/premise.js} +107 -75
  101. package/src/element/{step.js → proofAssertion/step.js} +43 -89
  102. package/src/element/{supposition.js → proofAssertion/supposition.js} +89 -88
  103. package/src/element/proofAssertion.js +69 -0
  104. package/src/element/reference.js +27 -23
  105. package/src/element/rule.js +25 -25
  106. package/src/element/section.js +4 -4
  107. package/src/element/statement.js +8 -15
  108. package/src/element/subDerivation.js +12 -12
  109. package/src/element/subproof.js +10 -10
  110. package/src/element/substitution/frame.js +10 -13
  111. package/src/element/substitution/statement.js +20 -52
  112. package/src/element/substitution.js +3 -3
  113. package/src/element/term.js +10 -9
  114. package/src/element/{axiom.js → topLevelAssertion/axiom.js} +41 -41
  115. package/src/element/{conjecture.js → topLevelAssertion/conjecture.js} +4 -4
  116. package/src/element/{lemma.js → topLevelAssertion/lemma.js} +3 -3
  117. package/src/element/{theorem.js → topLevelAssertion/theorem.js} +4 -4
  118. package/src/element/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +30 -49
  119. package/src/element/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +4 -4
  120. package/src/element/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +4 -4
  121. package/src/element/{metaLemmaMetatheorem.js → topLevelMetaAssertion.js} +7 -72
  122. package/src/element/type.js +2 -4
  123. package/src/element/variable.js +17 -17
  124. package/src/metaTypes.js +42 -13
  125. package/src/node/proofAssertion/premise.js +16 -0
  126. package/src/node/{step.js → proofAssertion/step.js} +4 -18
  127. package/src/node/proofAssertion/supposition.js +16 -0
  128. package/src/node/proofAssertion.js +23 -0
  129. package/src/node/statement.js +1 -1
  130. package/src/node/subDerivation.js +0 -7
  131. package/src/node/subproof.js +0 -7
  132. package/src/node/substitution/statement.js +1 -1
  133. package/src/node/topLevelAssertion/axiom.js +13 -0
  134. package/src/node/topLevelAssertion/conjecture.js +13 -0
  135. package/src/node/topLevelAssertion/lemma.js +13 -0
  136. package/src/node/topLevelAssertion/theorem.js +13 -0
  137. package/src/node/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +1 -1
  138. package/src/node/topLevelMetaAssertion/metaLemma.js +13 -0
  139. package/src/node/topLevelMetaAssertion/metatheorem.js +13 -0
  140. package/src/node/{metaLemmaMetaTheorem.js → topLevelMetaAssertion.js} +1 -1
  141. package/src/nonTerminalNodeMap.js +12 -12
  142. package/src/preamble.js +9 -9
  143. package/src/process/instantiate.js +31 -32
  144. package/src/process/unify.js +6 -5
  145. package/src/types.js +4 -2
  146. package/src/utilities/bnf.js +3 -2
  147. package/src/utilities/brackets.js +5 -8
  148. package/src/utilities/context.js +20 -0
  149. package/src/utilities/element.js +169 -162
  150. package/src/utilities/fragment.js +11 -0
  151. package/src/utilities/instance.js +19 -24
  152. package/src/utilities/json.js +3 -1
  153. package/src/utilities/string.js +57 -32
  154. package/src/utilities/unification.js +39 -39
  155. package/src/utilities/validation.js +26 -35
  156. package/lib/context/local.js +0 -605
  157. package/lib/context/temporary.js +0 -752
  158. package/lib/element/axiom.js +0 -329
  159. package/lib/element/axiomLemmaTheoremConjecture.js +0 -434
  160. package/lib/element/metaLemmaMetatheorem.js +0 -322
  161. package/lib/element/premise.js +0 -380
  162. package/lib/element/step.js +0 -390
  163. package/lib/element/supposition.js +0 -410
  164. package/lib/node/step.js +0 -166
  165. package/lib/node/supposition.js +0 -130
  166. package/src/node/axiom.js +0 -13
  167. package/src/node/conjecture.js +0 -13
  168. package/src/node/lemma.js +0 -13
  169. package/src/node/metaLemma.js +0 -13
  170. package/src/node/metatheorem.js +0 -13
  171. package/src/node/premise.js +0 -30
  172. package/src/node/supposition.js +0 -30
  173. package/src/node/theorem.js +0 -13
@@ -1,25 +1,26 @@
1
1
  "use strict";
2
2
 
3
- import Element from "../element";
4
- import elements from "../elements";
5
- import TemporaryContext from "../context/temporary";
6
- import assignAssignments from "../process/assign";
7
-
8
- import { define } from "../elements";
9
- import { termsFromJSON, framesFromJSON, statementFromJSON, procedureCallFromJSON, termsToTermsJSON, framesToFramesJSON, statementToStatementJSON, procedureCallToProcedureCallJSON } from "../utilities/json";
10
-
11
- export default define(class Premise extends Element {
3
+ import ProofAssertion from "../proofAssertion";
4
+ import TransientContext from "../../context/transient";
5
+ import assignAssignments from "../../process/assign";
6
+
7
+ import { define } from "../../elements";
8
+ import { termsFromJSON,
9
+ framesFromJSON,
10
+ termsToTermsJSON,
11
+ statementFromJSON,
12
+ framesToFramesJSON,
13
+ procedureCallFromJSON,
14
+ statementToStatementJSON,
15
+ procedureCallToProcedureCallJSON } from "../../utilities/json";
16
+
17
+ export default define(class Premise extends ProofAssertion {
12
18
  constructor(context, string, node, statement, procedureCall) {
13
- super(context, string, node);
19
+ super(context, string, node, statement);
14
20
 
15
- this.statement = statement;
16
21
  this.procedureCall = procedureCall;
17
22
  }
18
23
 
19
- getStatement() {
20
- return this.statement;
21
- }
22
-
23
24
  getProcedureCall() {
24
25
  return this.procedureCall;
25
26
  }
@@ -27,32 +28,32 @@ export default define(class Premise extends Element {
27
28
  verify(context) {
28
29
  let verifies = false;
29
30
 
30
- const temporaryContext = TemporaryContext.fromNothing(context);
31
+ const transientContext = TransientContext.fromNothing(context);
31
32
 
32
- context = temporaryContext; ///
33
+ context = transientContext; ///
33
34
 
34
35
  const node = this.getNode(),
35
36
  premiseString = this.getString(); ///
36
37
 
37
38
  context.trace(`Verifying the '${premiseString}' premise...`, node);
38
39
 
39
- if ((this.statement === null) && (this.procedureCall === null)) {
40
+ const statement = this.getStatement();
41
+
42
+ if ((statement === null) && (this.procedureCall === null)) {
40
43
  context.debug(`Unable to verify the '${premiseString}' premise because it is nonsense.`, node);
41
44
  } else {
42
- if (this.statement !== null) {
45
+ if (statement !== null) {
43
46
  const stated = true,
44
47
  assignments = [],
45
- statementValidates = this.statement.validate(assignments, stated, context);
48
+ statementValidates = statement.validate(assignments, stated, context);
46
49
 
47
50
  if (statementValidates) {
48
51
  const assignmentsAssigned = assignAssignments(assignments, context);
49
52
 
50
53
  if (assignmentsAssigned) {
51
- const { Step } = elements,
52
- step = Step.fromStatement(this.statement, context),
53
- stepOrSubproof = step; ///
54
+ const subproofOrProofAssertion = this; ///
54
55
 
55
- context.addStepOrSubproof(stepOrSubproof);
56
+ context.addSubproofOrProofAssertion(subproofOrProofAssertion);
56
57
 
57
58
  verifies = true;
58
59
  }
@@ -82,15 +83,22 @@ export default define(class Premise extends Element {
82
83
  unifyIndependently(substitutions, context) {
83
84
  let unifiesIndependently = false;
84
85
 
85
- const node = this.getNode(),
86
- premiseString = this.getString(), ///
87
- generalContext = this.context, ///
88
- specificContext = context; ///
86
+ const premiseString = this.getString(); ///
89
87
 
90
- context.trace(`Unifying the '${premiseString}' premise independently...`, node);
88
+ context.trace(`Unifying the '${premiseString}' premise independently...`);
89
+
90
+ const specificContext = context; ///
91
+
92
+ context = this.getContext();
93
+
94
+ const generalContext = context; ///
95
+
96
+ context = specificContext; ///
91
97
 
92
- if (this.statement !== null) {
93
- const statementUnifiesIndependently = this.statement.unifyIndependently(substitutions, generalContext, specificContext);
98
+ const statement = this.getStatement();
99
+
100
+ if (statement !== null) {
101
+ const statementUnifiesIndependently = statement.unifyIndependently(substitutions, generalContext, specificContext);
94
102
 
95
103
  if (statementUnifiesIndependently) {
96
104
  unifiesIndependently = true;
@@ -106,84 +114,92 @@ export default define(class Premise extends Element {
106
114
  }
107
115
 
108
116
  if (unifiesIndependently) {
109
- context.debug(`...unified the '${premiseString}' premise independenly.`, node);
117
+ context.debug(`...unified the '${premiseString}' premise independenly.`);
110
118
  }
111
119
 
112
120
  return unifiesIndependently;
113
121
  }
114
122
 
115
- unifyStepOrSubproof(stepOrSubproof, substitutions, context) {
116
- let stepOrSubproofUnifies = false;
123
+ unifySubproofOrProofAssertion(subproofOrProofAssertion, substitutions, context) {
124
+ let subproofOrProofAssertionUnifies = false;
117
125
 
118
- const stepOrSubProofStep = stepOrSubproof.isStep(),
119
- subproof = stepOrSubProofStep ?
120
- null :
121
- stepOrSubproof,
122
- step = stepOrSubProofStep ?
123
- stepOrSubproof :
124
- null;
126
+ const subproofOrProofAssertionProofAssertion = subproofOrProofAssertion.isProofAssertion(),
127
+ proofAssertion = subproofOrProofAssertionProofAssertion ?
128
+ subproofOrProofAssertion :
129
+ null,
130
+ subproof = subproofOrProofAssertionProofAssertion ?
131
+ null :
132
+ subproofOrProofAssertion;
125
133
 
126
134
  substitutions.snapshot();
127
135
 
128
136
  if (subproof !== null) {
129
137
  const subproofUnifies = this.unifySubproof(subproof, substitutions, context);
130
138
 
131
- stepOrSubproofUnifies = subproofUnifies; ///
139
+ if (subproofUnifies) {
140
+ subproofOrProofAssertionUnifies = true;
141
+ }
132
142
  }
133
143
 
134
- if (step !== null) {
135
- const statementUnifies = this.unifyStep(step, substitutions, context);
144
+ if (proofAssertion !== null) {
145
+ const proofAssertionUnifies = this.unifyProofAssertion(proofAssertion, substitutions, context);
136
146
 
137
- stepOrSubproofUnifies = statementUnifies; ///
147
+ if (proofAssertionUnifies) {
148
+ subproofOrProofAssertionUnifies = true;
149
+ }
138
150
  }
139
151
 
140
- if (stepOrSubproofUnifies) {
152
+ if (subproofOrProofAssertionUnifies) {
141
153
  substitutions.resolve(context);
142
154
  }
143
155
 
144
- stepOrSubproofUnifies ?
156
+ subproofOrProofAssertionUnifies ?
145
157
  substitutions.continue() :
146
158
  substitutions.rollback(context);
147
159
 
148
- return stepOrSubproofUnifies;
160
+ return subproofOrProofAssertionUnifies;
149
161
  }
150
162
 
151
- unifySubproof(subproof, substitutions, context) {
152
- let subproofUnifies = false;
163
+ unifyProofAssertion(proofAssertion, substitutions, context) {
164
+ let proofAssertionUnifies = false;
153
165
 
154
- const premise = this, ///
155
- subproofString = subproof.getString(),
156
- premiseStatement = premise.getStatement(),
157
- premiseStatementString = premiseStatement.getString();
166
+ const premiseString = this.getString(),
167
+ proofAssertionString = proofAssertion.getString();
158
168
 
159
- context.trace(`Unifying the '${subproofString}' subproof with the premise's '${premiseStatementString}' statement...`);
160
-
161
- const specificContext = context; ///
169
+ context.trace(`Unifying the '${proofAssertionString}' proof assertion with the '${premiseString}' premise...`);
162
170
 
163
171
  context = this.getContext();
164
172
 
165
173
  const generalContext = context; ///
166
174
 
175
+ context = proofAssertion.getContext();
176
+
177
+ const specificContext = context; ///
178
+
167
179
  context = specificContext; ///
168
180
 
169
- if (this.statement !== null) {
170
- const context = generalContext, ///
171
- subproofAssertion = subproofAssertionFromStatement(this.statement, context);
181
+ const statement = proofAssertion.getStatement(),
182
+ statementUnifies = this.unifyStatement(statement, substitutions, generalContext, specificContext);
172
183
 
173
- if (subproofAssertion !== null) {
174
- subproofUnifies = subproofAssertion.unifySubproof(subproof, substitutions, generalContext, specificContext);
175
- }
184
+ if (statementUnifies) {
185
+ proofAssertionUnifies = true;
176
186
  }
177
187
 
178
- if (subproofUnifies) {
179
- context.debug(`...unified the '${subproofString}' subproof with the premise's '${premiseStatementString}' statement.`);
188
+ if (proofAssertionUnifies) {
189
+ context.debug(`...unified the '${proofAssertionString}' proof assertion with the '${premiseString}' premise.`);
180
190
  }
181
191
 
182
- return subproofUnifies;
192
+ return proofAssertionUnifies;
183
193
  }
184
194
 
185
- unifyStep(step, substitutions, context) {
186
- let stepUnifies = false;
195
+ unifySubproof(subproof, substitutions, context) {
196
+ let subproofUnifies = false;
197
+
198
+ const node = this.getNode(),
199
+ premiseString = this.getString(),
200
+ subproofString = subproof.getString();
201
+
202
+ context.trace(`Unifying the '${subproofString}' subproof with the '${premiseString}' premise...`, node);
187
203
 
188
204
  const specificContext = context; ///
189
205
 
@@ -193,14 +209,30 @@ export default define(class Premise extends Element {
193
209
 
194
210
  context = specificContext; ///
195
211
 
196
- const statement = step.getStatement(),
197
- statementUnifies = this.unifyStatement(statement, substitutions, generalContext, specificContext);
212
+ const statement = this.getStatement();
198
213
 
199
- if (statementUnifies) {
200
- stepUnifies = true;
214
+ if (statement !== null) {
215
+ const statementNode = statement.getNode(),
216
+ subproofAssertionNode = statementNode.getSubproofAssertionNode();
217
+
218
+ if (subproofAssertionNode !== null) {
219
+ const context = generalContext, ///
220
+ assertionNode = subproofAssertionNode, ///
221
+ assertion = context.findAssertionByAssertionNode(assertionNode)
222
+
223
+ if (assertion !== null) {
224
+ const subproofAssertion = assertion; ///
225
+
226
+ subproofUnifies = subproofAssertion.unifySubproof(subproof, substitutions, generalContext, specificContext);
227
+ }
228
+ }
201
229
  }
202
230
 
203
- return stepUnifies;
231
+ if (subproofUnifies) {
232
+ context.debug(`...unified the '${subproofString}' subproof with the '${premiseString}' premise.`, node);
233
+ }
234
+
235
+ return subproofUnifies;
204
236
  }
205
237
 
206
238
  toJSON() {
@@ -239,7 +271,7 @@ export default define(class Premise extends Element {
239
271
  frames = framesFromJSON(json, context),
240
272
  statement = statementFromJSON(json, context),
241
273
  procedureCall = procedureCallFromJSON(json, context),
242
- temporaryContext = TemporaryContext.fromTermsAndFrames(terms, frames, context);
274
+ transientContext = TransientContext.fromTermsAndFrames(terms, frames, context);
243
275
 
244
276
  let string;
245
277
 
@@ -253,7 +285,7 @@ export default define(class Premise extends Element {
253
285
 
254
286
  const node = null;
255
287
 
256
- context = temporaryContext; ///
288
+ context = transientContext; ///
257
289
 
258
290
  const premise = new Premise(context, string, node, statement, procedureCall);
259
291
 
@@ -1,29 +1,21 @@
1
1
  "use strict";
2
2
 
3
- import Element from "../element";
4
- import elements from "../elements";
5
- import TemporaryContext from "../context/temporary";
6
-
7
- import { define } from "../elements";
8
- import { instantiateStep } from "../process/instantiate";
9
- import { unifyStatements } from "../utilities/unification";
10
- import { equateStatements } from "../process/equate";
11
- import { stepFromStepNode } from "../utilities/element";
12
- import { propertyAssertionFromStatement } from "../utilities/statement";
13
-
14
- export default define(class Step extends Element {
3
+ import elements from "../../elements";
4
+ import ProofAssertion from "../proofAssertion";
5
+ import TransientContext from "../../context/transient";
6
+
7
+ import { define } from "../../elements";
8
+ import { unifyStatements } from "../../utilities/unification";
9
+ import { propertyAssertionFromStatement } from "../../utilities/statement";
10
+
11
+ export default define(class Step extends ProofAssertion {
15
12
  constructor(context, string, node, statement, reference, satisfiesAssertion) {
16
- super(context, string, node);
13
+ super(context, string, node, statement);
17
14
 
18
- this.statement = statement;
19
15
  this.reference = reference;
20
16
  this.satisfiesAssertion = satisfiesAssertion;
21
17
  }
22
18
 
23
- getStatement() {
24
- return this.statement;
25
- }
26
-
27
19
  getReference() {
28
20
  return this.reference;
29
21
  }
@@ -51,16 +43,11 @@ export default define(class Step extends Element {
51
43
  return stated;
52
44
  }
53
45
 
54
- isStep() {
55
- const step = true;
56
-
57
- return step;
58
- }
59
-
60
46
  compareTermAndPropertyRelation(term, propertyRelation, context) {
61
47
  let comparesToTermAndPropertyRelation = false;
62
48
 
63
- const propertyAssertion = propertyAssertionFromStatement(this.statement, context);
49
+ const statement = this.getStatement(),
50
+ propertyAssertion = propertyAssertionFromStatement(statement, context);
64
51
 
65
52
  if (propertyAssertion !== null) {
66
53
  comparesToTermAndPropertyRelation = propertyAssertion.compareTermAndPropertyRelation(term, propertyRelation, context);
@@ -72,30 +59,32 @@ export default define(class Step extends Element {
72
59
  verify(substitutions, assignments, context) {
73
60
  let verifies = false;
74
61
 
75
- const temporaryContext = TemporaryContext.fromNothing(context);
62
+ const transientContext = TransientContext.fromNothing(context);
76
63
 
77
- context = temporaryContext; ///
64
+ context = transientContext; ///
78
65
 
79
66
  const node = this.getNode(),
80
67
  stepString = this.getString(); ///
81
68
 
82
69
  context.trace(`Verifying the '${stepString}' step...`, node);
83
70
 
84
- if (this.statement === null) {
71
+ const statement = this.getStatement();
72
+
73
+ if (statement === null) {
85
74
  context.debug(`Unable to verify the '${stepString}' step because it is nonsense.`, node);
86
75
  } else {
87
- const referenceVerifies = this.verifyReference(context);
76
+ const referenceValidates = this.validateReference(context);
88
77
 
89
- if (referenceVerifies) {
78
+ if (referenceValidates) {
90
79
  const satisfiesAssertioVeriries = this.verifySatisfiesAssertion(context);
91
80
 
92
81
  if (satisfiesAssertioVeriries) {
93
82
  const stated = this.isStated(),
94
- statementValidates = this.statement.validate(assignments, stated, context);
83
+ statementValidates = statement.validate(assignments, stated, context);
95
84
 
96
85
  if (statementValidates) {
97
86
  const statementUnifies = unifyStatements.some((unifyStatement) => {
98
- const statementUnifies = unifyStatement(this.statement, this.reference, this.satisfiesAssertion, substitutions, context);
87
+ const statementUnifies = unifyStatement(statement, this.reference, this.satisfiesAssertion, substitutions, context);
99
88
 
100
89
  if (statementUnifies) {
101
90
  return true;
@@ -103,14 +92,6 @@ export default define(class Step extends Element {
103
92
  });
104
93
 
105
94
  if (statementUnifies) {
106
- const { Step } = elements,
107
- step = Step.fromStatement(this.statement, context),
108
- stepOrSubproof = step; ///
109
-
110
- context.addStepOrSubproof(stepOrSubproof);
111
-
112
- this.setContext(context);
113
-
114
95
  verifies = true;
115
96
  }
116
97
  }
@@ -119,75 +100,59 @@ export default define(class Step extends Element {
119
100
  }
120
101
 
121
102
  if (verifies) {
103
+ this.setContext(context);
104
+
122
105
  context.debug(`...verified the '${stepString}' step.`, node);
123
106
  }
124
107
 
125
108
  return verifies;
126
109
  }
127
110
 
128
- verifyReference(context) {
129
- let referenceVeriries;
111
+ validateReference(context) {
112
+ let referenceValidates = true;
130
113
 
131
- const node = this.getNode(),
132
- stepString = this.getString(); ///
114
+ if (this.reference !== null) {
115
+ const node = this.getNode(),
116
+ stepString = this.getString();
133
117
 
134
- context.trace(`Verifying the '${stepString}' step's reference... `, node);
118
+ context.trace(`Validating the '${stepString}' step's reference... `, node);
135
119
 
136
- if (this.reference !== null) {
137
- referenceVeriries = this.reference.verify(context);
138
- } else {
139
- referenceVeriries = true;
140
- }
120
+ referenceValidates = this.reference.validate(context);
141
121
 
142
- if (referenceVeriries) {
143
- context.debug(`...verified the '${stepString}' step's reference. `, node);
122
+ if (referenceValidates) {
123
+ context.debug(`...validating the '${stepString}' step's reference. `, node);
124
+ }
144
125
  }
145
126
 
146
- return referenceVeriries;
127
+ return referenceValidates;
147
128
  }
148
129
 
149
130
  verifySatisfiesAssertion(context) {
150
- let satisfiesAssertionVerifies;
131
+ let satisfiesAssertionVerifies = true; ///
151
132
 
152
- const node = this.getNode(),
153
- stepString = this.getString(); ///
133
+ if (this.satisfiesAssertion !== null) {
134
+ const node = this.getNode(),
135
+ stepString = this.getString(); ///
154
136
 
155
- context.trace(`Verifying the '${stepString}' step's satisfies assertion... `, node);
137
+ context.trace(`Verifying the '${stepString}' step's satisfies assertion... `, node);
156
138
 
157
- if (this.satisfiesAssertion !== null) {
158
139
  const stated = true,
159
140
  assignments = null;
160
141
 
161
142
  satisfiesAssertionVerifies = this.satisfiesAssertion.validate(assignments, stated, context);
162
- } else {
163
- satisfiesAssertionVerifies = true;
164
- }
165
143
 
166
- if (satisfiesAssertionVerifies) {
167
- context.debug(`...verified the '${stepString}' step's satisfies assertion. `, node);
144
+ if (satisfiesAssertionVerifies) {
145
+ context.debug(`...verified the '${stepString}' step's satisfies assertion. `, node);
146
+ }
168
147
  }
169
148
 
170
149
  return satisfiesAssertionVerifies;
171
150
  }
172
151
 
173
- compareStatment(statement, context) {
174
- let comparesToStatement;
175
-
176
- const leftStatement = statement, ///
177
- rightStatement = this.statement, ///
178
- leftStatementNode = leftStatement.getNode(),
179
- rightStatementNode = rightStatement.getNode(),
180
- statementsEquate = equateStatements(leftStatementNode, rightStatementNode, context);
181
-
182
- comparesToStatement = statementsEquate; ///
183
-
184
- return comparesToStatement;
185
- }
186
-
187
152
  unifyWithSatisfiesAssertion(satisfiesAssertion, context) {
188
153
  let unifiesWithSatisfiesAssertion = false;
189
154
 
190
- const stepString = this.string, ///
155
+ const stepString = this.getString(), ///
191
156
  satisfiesAssertionString = satisfiesAssertion.getString();
192
157
 
193
158
  context.trace(`Unifying the '${stepString}' step with the '${satisfiesAssertionString}' satisfies assertion...`, this.node);
@@ -218,15 +183,4 @@ export default define(class Step extends Element {
218
183
  }
219
184
 
220
185
  static name = "Step";
221
-
222
- static fromStatement(statement, context) {
223
- const statementString = statement.getString(),
224
- stepString = statementString, ///
225
- string = `${stepString}
226
- `,
227
- stepNode = instantiateStep(string, context),
228
- step = stepFromStepNode(stepNode, context);
229
-
230
- return step;;
231
- }
232
186
  });