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
@@ -10,35 +10,35 @@ import { define } from "../elements";
10
10
  const { last } = arrayUtilities;
11
11
 
12
12
  export default define(class SubDerivation extends Element {
13
- constructor(context, string, node, stepsOrSubproofs) {
13
+ constructor(context, string, node, subproofOrProofAssertions) {
14
14
  super(context, string, node);
15
15
 
16
- this.stepsOrSubproofs = stepsOrSubproofs;
16
+ this.subproofOrProofAssertions = subproofOrProofAssertions;
17
17
  }
18
18
 
19
- getStepsOrSubproofs() {
20
- return this.stepsOrSubproofs;
19
+ getSubproofOrProofAssertions() {
20
+ return this.subproofOrProofAssertions;
21
21
  }
22
22
 
23
- getLastStep() {
24
- const lastStepOrSubproof = last(this.stepsOrSubproofs),
25
- lastStep = lastStepOrSubproof; ///
23
+ getLastProofAssertion() {
24
+ const lastSubproofOrProofAssertion = last(this.subproofOrProofAssertions),
25
+ lastProofAssertion = lastSubproofOrProofAssertion; ///
26
26
 
27
- return lastStep;
27
+ return lastProofAssertion;
28
28
  }
29
29
 
30
30
  verify(substitutions, context) {
31
31
  let verifies;
32
32
 
33
- verifies = this.stepsOrSubproofs.every((stepOrSubproof) => { ///
33
+ verifies = this.subproofOrProofAssertions.every((subproofOrProofAssertion) => { ///
34
34
  const assignments = [],
35
- stepOrSubproofVarifies = stepOrSubproof.verify(substitutions, assignments, context);
35
+ subproofOrProofAssertionVarifies = subproofOrProofAssertion.verify(substitutions, assignments, context);
36
36
 
37
- if (stepOrSubproofVarifies) {
37
+ if (subproofOrProofAssertionVarifies) {
38
38
  const assignmentsAssigned = assignAssignments(assignments, context);
39
39
 
40
40
  if (assignmentsAssigned) {
41
- context.addStepOrSubproof(stepOrSubproof);
41
+ context.addSubproofOrProofAssertion(subproofOrProofAssertion);
42
42
 
43
43
  return true;
44
44
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  import Element from "../element";
4
4
  import elements from "../elements";
5
- import LocalContext from "../context/local";
5
+ import ScopedContext from "../context/scoped";
6
6
 
7
7
  import { define } from "../elements";
8
8
 
@@ -22,36 +22,36 @@ export default define(class Subproof extends Element {
22
22
  return this.subDerivation;
23
23
  }
24
24
 
25
- getLastStep() { return this.subDerivation.getLastStep(); }
25
+ getLastProofAssertion() { return this.subDerivation.getLastProofAssertion(); }
26
26
 
27
27
  getStatements() {
28
- const lastStep = this.getLastStep(),
28
+ const lastProofAssertion = this.getLastProofAssertion(),
29
29
  suppositionStatements = this.suppositions.map((supposition) => {
30
30
  const suppositionStatement = supposition.getStatement();
31
31
 
32
32
  return suppositionStatement;
33
33
  }),
34
- lastStepStatement = lastStep.getStatement(),
34
+ lastProofAssertionStatement = lastProofAssertion.getStatement(),
35
35
  statements = [
36
36
  ...suppositionStatements,
37
- lastStepStatement
37
+ lastProofAssertionStatement
38
38
  ];
39
39
 
40
40
  return statements;
41
41
  }
42
42
 
43
- isStep() {
44
- const sStep = false;
43
+ isProofAssertion() {
44
+ const proofAssertion = false;
45
45
 
46
- return sStep;
46
+ return proofAssertion;
47
47
  }
48
48
 
49
49
  verify(substitutions, assignments, context) {
50
50
  let verifies = false;
51
51
 
52
- const localContext = LocalContext.fromNothing(context); ///
52
+ const scopedContext = ScopedContext.fromNothing(context); ///
53
53
 
54
- context = localContext; ///
54
+ context = scopedContext; ///
55
55
 
56
56
  const suppositionsVerify = this.suppositions.every((supposition) => {
57
57
  const suppositionVerifies = supposition.verify(context);
@@ -3,7 +3,9 @@
3
3
  import Substitution from "../substitution";
4
4
 
5
5
  import { define } from "../../elements";
6
+ import { withinFragment } from "../../utilities/fragment";
6
7
  import { instantiateFrameSubstitution } from "../../process/instantiate";
8
+ import { frameSubstitutionStringFromFrameAndMetavariable } from "../../utilities/string";
7
9
  import { frameSubstitutionFromFrameSubstitutionNode, frameSubstitutionFromStatementNode } from "../../utilities/element";
8
10
 
9
11
  export default define(class FrameSubstitution extends Substitution {
@@ -86,18 +88,13 @@ export default define(class FrameSubstitution extends Substitution {
86
88
  }
87
89
 
88
90
  static fromFrameAndMetavariable(frame, metavariable, context) {
89
- const string = stringFromFrameAndMetavariable(frame, metavariable),
90
- frameSubstitutionNode = instantiateFrameSubstitution(string, context),
91
- frameSubstitution = frameSubstitutionFromFrameSubstitutionNode(frameSubstitutionNode, context);
92
-
93
- return frameSubstitution;
91
+ return withinFragment((context) => {
92
+ const frameAndMetavariableString = frameSubstitutionStringFromFrameAndMetavariable(frame, metavariable),
93
+ string = frameAndMetavariableString, ///
94
+ frameSubstitutionNode = instantiateFrameSubstitution(string, context),
95
+ frameSubstitution = frameSubstitutionFromFrameSubstitutionNode(frameSubstitutionNode, context);
96
+
97
+ return frameSubstitution;
98
+ }, context);
94
99
  }
95
100
  });
96
-
97
- function stringFromFrameAndMetavariable(frame, metavariable) {
98
- const frameString = frame.getString(),
99
- metavariableString = metavariable.getString(),
100
- string = `[${frameString} for [${metavariableString}]]`;
101
-
102
- return string;
103
- }
@@ -4,11 +4,13 @@ import elements from "../../elements";
4
4
  import Substitution from "../substitution";
5
5
 
6
6
  import { define } from "../../elements";
7
+ import { withinFragment } from "../../utilities/fragment";
7
8
  import { unifySubstitution } from "../../process/unify";
8
9
  import { stripBracketsFromStatement } from "../../utilities/brackets";
9
10
  import { instantiateStatementSubstitution } from "../../process/instantiate";
10
11
  import { statementSubstitutionFromStatementSubstitutionNode } from "../../utilities/element";
11
12
  import { statementFromJSON, statementToStatementJSON, metavariableFromJSON, metavariableToMetavariableJSON } from "../../utilities/json";
13
+ import { statementSubstitutionStringFromStatementAndMetavariable, statementSubstitutionStringFromStatementMetavariableAndSubstitution } from "../../utilities/string";
12
14
 
13
15
  export default define(class StatementSubstitution extends Substitution {
14
16
  constructor(context, string, node, resolved, statement, metavariable, substitution) {
@@ -73,12 +75,13 @@ export default define(class StatementSubstitution extends Substitution {
73
75
  return substitutionEqualToSubstitution;
74
76
  }
75
77
 
76
- isStatementEqualToStatement(statement, context) {
78
+ compareStatesment(statement, context) {
77
79
  statement = stripBracketsFromStatement(statement, context); ///
78
80
 
79
- const statementEqualToStatement = this.statement.isEqualTo(statement);
81
+ const statementEqualToStatement = this.statement.isEqualTo(statement),
82
+ comparesToStatement = statementEqualToStatement; ///
80
83
 
81
- return statementEqualToStatement;
84
+ return comparesToStatement;
82
85
  }
83
86
 
84
87
  isSimple() {
@@ -214,18 +217,14 @@ export default define(class StatementSubstitution extends Substitution {
214
217
  static fromStatementAndMetavariable(statement, metavariable, context) {
215
218
  statement = stripBracketsFromStatement(statement, context); ///
216
219
 
217
- const string = stringFromStatementAndMetavariable(statement, metavariable),
218
- statementSubstitutionNode = instantiateStatementSubstitution(string, context);
220
+ const statementSubstitution = withinFragment((context) => {
221
+ const statementSubstitutionString = statementSubstitutionStringFromStatementAndMetavariable(statement, metavariable, context),
222
+ string = statementSubstitutionString, ///
223
+ statementSubstitutionNode = instantiateStatementSubstitution(string, context),
224
+ statementSubstitution = statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, context)
219
225
 
220
- context = {
221
- nodeAsString: () => string
222
- };
223
-
224
- const statementSubstitution = statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, context);
225
-
226
- statementSubstitution.setStatement(statement);
227
-
228
- statementSubstitution.setMetavariable(metavariable);
226
+ return statementSubstitution;
227
+ }, context);
229
228
 
230
229
  return statementSubstitution;
231
230
  }
@@ -233,46 +232,15 @@ export default define(class StatementSubstitution extends Substitution {
233
232
  static fromStatementMetavariableAndSubstitution(statement, metavariable, substitution, context) {
234
233
  statement = stripBracketsFromStatement(statement, context); ///
235
234
 
236
- const string = stringFromStatementMetavariableAndSubstitution(statement, metavariable, substitution, context),
237
- statementSubstitutionNode = instantiateStatementSubstitution(string, context);
238
-
239
- context = {
240
- nodeAsString: () => string
241
- };
235
+ const statementSubstitution = withinFragment((context) => {
236
+ const statementSubstitutionString = statementSubstitutionStringFromStatementMetavariableAndSubstitution(statement, metavariable, substitution),
237
+ string = statementSubstitutionString, ///
238
+ statementSubstitutionNode = instantiateStatementSubstitution(string, context),
239
+ statementSubstitution = statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, context)
242
240
 
243
- const statementSubstitution = statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, context);
244
-
245
- statementSubstitution.setStatement(statement);
246
-
247
- statementSubstitution.setMetavariable(metavariable);
248
-
249
- statementSubstitution.setSubstitution(substitution);
241
+ return statementSubstitution;
242
+ }, context);
250
243
 
251
244
  return statementSubstitution;
252
245
  }
253
246
  });
254
-
255
- function stringFromStatementAndMetavariable(statement, metavariable) {
256
- const statementString = statement.getString(),
257
- metavariableString = metavariable.getString(),
258
- string = `[${statementString} for ${metavariableString}]`;
259
-
260
- return string;
261
- }
262
-
263
- function stringFromStatementMetavariableAndSubstitution(statement, metavariable, substitution) {
264
- let string;
265
-
266
- const statementString = statement.getString(),
267
- metavariableString = metavariable.getString();
268
-
269
- if (substitution === null) {
270
- string = `[${statementString} for ${metavariableString}]`;
271
- } else {
272
- const substitutionString = substitution.getString();
273
-
274
- string = `[${statementString} for ${metavariableString}${substitutionString}]`;
275
- }
276
-
277
- return string;
278
- }
@@ -92,10 +92,10 @@ export default class Substitution extends Element {
92
92
  return referenceEqualToReference;
93
93
  }
94
94
 
95
- isStatementEqualToStatement(statement, context) {
96
- const statementEqualToStatement = false;
95
+ compareStatement(statement, context) {
96
+ const comparesToStatement = false;
97
97
 
98
- return statementEqualToStatement;
98
+ return comparesToStatement;
99
99
  }
100
100
 
101
101
  isMetavariableEqualToMetavariable(metavariable) {
@@ -112,16 +112,15 @@ export default define(class Term extends Element {
112
112
  return validates;
113
113
  }
114
114
 
115
- verifyGivenType(type, generalContext, specificContext) {
116
- let verifiesGivenType;
115
+ validateGivenType(type, context) {
116
+ let validatesGivenType = false;
117
117
 
118
118
  const typeString = type.getString(),
119
119
  termString = this.getString(); ///
120
120
 
121
- specificContext.trace(`Validating the '${termString}' term given the '${typeString}' type...`);
121
+ context.trace(`Validating the '${termString}' term given the '${typeString}' type...`);
122
122
 
123
- const context = specificContext, ///
124
- validates = this.validate(context, () => {
123
+ const validates = this.validate(context, () => {
125
124
  let verifiesAhead;
126
125
 
127
126
  const typeEqualToOrSubTypeOfGivenTypeType = this.type.isEqualToOrSubTypeOf(type);
@@ -133,13 +132,15 @@ export default define(class Term extends Element {
133
132
  return verifiesAhead;
134
133
  });
135
134
 
136
- verifiesGivenType = validates; ///
135
+ if (validates) {
136
+ validatesGivenType = true;
137
+ }
137
138
 
138
- if (verifiesGivenType) {
139
- specificContext.debug(`...validated the '${termString}' term given the '${typeString}' type.`);
139
+ if (validatesGivenType) {
140
+ context.debug(`...validated the '${termString}' term given the '${typeString}' type.`);
140
141
  }
141
142
 
142
- return verifiesGivenType;
143
+ return validatesGivenType;
143
144
  }
144
145
 
145
146
  toJSON() {
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- import AxiomLemmaTheoremConjecture from "./axiomLemmaTheoremConjecture";
3
+ import TopLevelAssertion from "../../node/topLevelAssertion";
4
4
 
5
- import { define } from "../elements";
5
+ import { define } from "../../elements";
6
6
 
7
- export default define(class Axiom extends AxiomLemmaTheoremConjecture {
7
+ export default define(class Axiom extends TopLevelAssertion {
8
8
  isSatisfiable() {
9
9
  const signature = this.getSignature(),
10
10
  satisfiable = (signature !== null);
@@ -110,29 +110,6 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
110
110
  return stepUnifies;
111
111
  }
112
112
 
113
- unifyLastStep(lastStep, substitutions, context) {
114
- let lastStepUnifies = false;
115
-
116
- const node = this.getNode(),
117
- axiomString = this.getString(),
118
- lastStepString = lastStep.getString();
119
-
120
- context.trace(`Unifying the '${lastStepString}' last step with the '${axiomString}' axiom...`, node)
121
-
122
- const statement = lastStep.getStatement(),
123
- statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
124
-
125
- if (statementUnifiesWithDeduction) {
126
- lastStepUnifies = true;
127
- }
128
-
129
- if (lastStepUnifies) {
130
- context.debug(`...unified the '${lastStepString}' last step with the '${axiomString}' axiom.`, node)
131
- }
132
-
133
- return lastStepUnifies;
134
- }
135
-
136
113
  unifySubproof(subproof, substitutions, context) {
137
114
  let subproofUnifies = false;
138
115
 
@@ -147,10 +124,10 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
147
124
  if (unconditional) {
148
125
  context.trace(`Unable to unify the '${subproofString}' subproof with the '${axiomString}' axiom because the axiom is unconditional.`, node);
149
126
  } else {
150
- const lastStep = subproof.getLastStep(),
151
- lastStepUnifies = this.unifyLastStep(lastStep, substitutions, context);
127
+ const lastProofAssertion = subproof.getLastProofAssertion(),
128
+ lastProofAssertionUnifies = this.unifyLastProofAssertion(lastProofAssertion, substitutions, context);
152
129
 
153
- if (lastStepUnifies) {
130
+ if (lastProofAssertionUnifies) {
154
131
  const suppositions = subproof.getSuppositions(),
155
132
  suppositionsUnify = this.unifySuppositions(suppositions, substitutions, context);
156
133
 
@@ -225,19 +202,42 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
225
202
  return suppositionsUnify;
226
203
  }
227
204
 
228
- unifyAxiomLemmaTheoremOrConjecture(axiomLemmaTheoremOrConjecture, substitutions, context) {
229
- let axiomLemmaTheoremOrConjectureUnifies = false;
205
+ unifyLastProofAssertion(lastProofAssertion, substitutions, context) {
206
+ let lastProofAssertionUnifies = false;
207
+
208
+ const node = this.getNode(),
209
+ axiomString = this.getString(),
210
+ lastProofAssertionString = lastProofAssertion.getString();
211
+
212
+ context.trace(`Unifying the '${lastProofAssertionString}' last proof assertion with the '${axiomString}' axiom...`, node)
213
+
214
+ const statement = lastProofAssertion.getStatement(),
215
+ statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
216
+
217
+ if (statementUnifiesWithDeduction) {
218
+ lastProofAssertionUnifies = true;
219
+ }
220
+
221
+ if (lastProofAssertionUnifies) {
222
+ context.debug(`...unified the '${lastProofAssertionString}' last proof assertion with the '${axiomString}' axiom.`, node)
223
+ }
224
+
225
+ return lastProofAssertionUnifies;
226
+ }
227
+
228
+ unifyTopLevelAssertion(topLevelAssertion, substitutions, context) {
229
+ let topLevelAssertionUnifies = false;
230
230
 
231
231
  const node = this.getNode(),
232
232
  axiomString = this.getString(),
233
- axiomLemmaTheoremOrConjectureString = axiomLemmaTheoremOrConjecture.getString();
233
+ topLevelAssertionString = topLevelAssertion.getString();
234
234
 
235
- context.trace(`Unifying the '${axiomLemmaTheoremOrConjectureString}' axiom, lemma, theorem or conjecture with the '${axiomString}' axiom...`, node);
235
+ context.trace(`Unifying the '${topLevelAssertionString}' top level assertion with the '${axiomString}' axiom...`, node);
236
236
 
237
- const hypothesesCorrelate = axiomLemmaTheoremOrConjecture.correlateHypotheses(context);
237
+ const hypothesesCorrelate = topLevelAssertion.correlateHypotheses(context);
238
238
 
239
239
  if (hypothesesCorrelate) {
240
- const deduction = axiomLemmaTheoremOrConjecture.getDeduction(), ///
240
+ const deduction = topLevelAssertion.getDeduction(), ///
241
241
  specificContext = context; ///
242
242
 
243
243
  context = this.getContext();
@@ -246,21 +246,21 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
246
246
  deductionUnifies = this.unifyDeduction(deduction, substitutions, generalContext, specificContext);
247
247
 
248
248
  if (deductionUnifies) {
249
- const suppositions = axiomLemmaTheoremOrConjecture.getSuppositions(),
249
+ const suppositions = topLevelAssertion.getSuppositions(),
250
250
  suppositionsUnify = this.unifySuppositions(suppositions, substitutions, generalContext, specificContext);
251
251
 
252
- axiomLemmaTheoremOrConjectureUnifies = suppositionsUnify; ///
252
+ topLevelAssertionUnifies = suppositionsUnify; ///
253
253
  }
254
254
  }
255
255
 
256
- if (axiomLemmaTheoremOrConjectureUnifies) {
257
- context.debug(`...unified the '${axiomLemmaTheoremOrConjectureString}' axiom, lemma, theorem or conjecture with the '${axiomString}' axiom.`, node);
256
+ if (topLevelAssertionUnifies) {
257
+ context.debug(`...unified the '${topLevelAssertionString}' top level assertion with the '${axiomString}' axiom.`, node);
258
258
  }
259
259
 
260
- return axiomLemmaTheoremOrConjectureUnifies;
260
+ return topLevelAssertionUnifies;
261
261
  }
262
262
 
263
263
  static name = "Axiom";
264
264
 
265
- static fromJSON(json, context) { return AxiomLemmaTheoremConjecture.fromJSON(Axiom, json, context); }
265
+ static fromJSON(json, context) { return TopLevelAssertion.fromJSON(Axiom, json, context); }
266
266
  });
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- import AxiomLemmaTheoremConjecture from "./axiomLemmaTheoremConjecture";
3
+ import TopLevelAssertion from "../topLevelAssertion";
4
4
 
5
- import { define } from "../elements";
5
+ import { define } from "../../elements";
6
6
 
7
- export default define(class Conjecture extends AxiomLemmaTheoremConjecture {
7
+ export default define(class Conjecture extends TopLevelAssertion {
8
8
  verify() {
9
9
  let verifies;
10
10
 
@@ -30,5 +30,5 @@ export default define(class Conjecture extends AxiomLemmaTheoremConjecture {
30
30
 
31
31
  static name = "Conjecture";
32
32
 
33
- static fromJSON(json, context) { return AxiomLemmaTheoremConjecture.fromJSON(Conjecture, json, context); }
33
+ static fromJSON(json, context) { return TopLevelAssertion.fromJSON(Conjecture, json, context); }
34
34
  });
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- import AxiomLemmaTheoremConjecture from "./axiomLemmaTheoremConjecture";
3
+ import TopLevelAssertion from "../topLevelAssertion";
4
4
 
5
- import { define } from "../elements";
5
+ import { define } from "../../elements";
6
6
 
7
- export default define(class Lemma extends AxiomLemmaTheoremConjecture {
7
+ export default define(class Lemma extends TopLevelAssertion {
8
8
  verify() {
9
9
  let verifies;
10
10
 
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- import AxiomLemmaTheoremConjecture from "./axiomLemmaTheoremConjecture";
3
+ import TopLevelAssertion from "../topLevelAssertion";
4
4
 
5
- import { define } from "../elements";
5
+ import { define } from "../../elements";
6
6
 
7
- export default define(class Theorem extends AxiomLemmaTheoremConjecture {
7
+ export default define(class Theorem extends TopLevelAssertion {
8
8
  verify() {
9
9
  let verifies;
10
10
 
@@ -29,5 +29,5 @@ export default define(class Theorem extends AxiomLemmaTheoremConjecture {
29
29
 
30
30
  static name = "Theorem";
31
31
 
32
- static fromJSON(json, context) { return AxiomLemmaTheoremConjecture.fromJSON(Theorem, json, context); }
32
+ static fromJSON(json, context) { return TopLevelAssertion.fromJSON(Theorem, json, context); }
33
33
  });