occam-verify-cli 1.0.13 → 1.0.15

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.
@@ -43,10 +43,11 @@ function unifyAWithReference(statement, reference, substitutions, context) {
43
43
  context.trace(`Unifying the '${statementString}' statement with the '${referenceString}' reference...`);
44
44
 
45
45
  const metavariable = reference.getMetavariable(),
46
+ specificContext = context, ///
46
47
  statementSubstitution = StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, context),
47
48
  substitution = statementSubstitution; ///
48
49
 
49
- substitutions.addSubstitution(substitution, context);
50
+ substitutions.addSubstitution(substitution, specificContext);
50
51
 
51
52
  unifiedWithReference = true;
52
53
 
@@ -76,10 +77,11 @@ function unifyAWithAxiomLemmaTheoremOrConjecture(statement, reference, substitut
76
77
 
77
78
  if (statementAndProofStepsUnified) {
78
79
  const metavariable = reference.getMetavariable(),
80
+ specificContext = context, ///
79
81
  statementSubstitution = StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, context),
80
- substitution = statementSubstitution; ///
82
+ substitution = statementSubstitution; ///
81
83
 
82
- substitutions.addSubstitution(substitution, context);
84
+ substitutions.addSubstitution(substitution, specificContext);
83
85
 
84
86
  unifiedWithAxiomLemmaTheoremOrConjecture = true;
85
87
  }
@@ -122,11 +122,9 @@ export default class StatementSubstitution extends Substitution {
122
122
  specificContext.trace(`...unified the '${specificSubstitutionString}' substitution with the '${generalSubstitutionString}' substitution.`);
123
123
  }
124
124
 
125
- const context = specificContext; ///
126
-
127
125
  substitutionUnified ?
128
126
  substitutions.continue() :
129
- substitutions.rollback(context);
127
+ substitutions.rollback(specificContext);
130
128
 
131
129
  substitutionResolved = substitutionUnified; ///
132
130
  }
@@ -176,15 +176,15 @@ export default class Substitutions {
176
176
  return substitutionPresent;
177
177
  }
178
178
 
179
- addSubstitution(substitution, context) {
179
+ addSubstitution(substitution, specificContext) {
180
180
  this.array.push(substitution);
181
181
 
182
182
  const substitutionString = substitution.getString();
183
183
 
184
- context.trace(`Added the ${substitutionString} substitution.`);
184
+ specificContext.trace(`Added the ${substitutionString} substitution.`);
185
185
  }
186
186
 
187
- removeSubstitution(substitution, context) {
187
+ removeSubstitution(substitution, specificContext) {
188
188
  const substitutionA = substitution; ///
189
189
 
190
190
  prune(this.array, (substitution) => {
@@ -197,7 +197,7 @@ export default class Substitutions {
197
197
 
198
198
  const substitutionString = substitution.getString();
199
199
 
200
- context.trace(`Removed the ${substitutionString} substitution.`);
200
+ specificContext.trace(`Removed the ${substitutionString} substitution.`);
201
201
  }
202
202
 
203
203
  matchSubstitutions(substitutions) {
@@ -270,7 +270,7 @@ export default class Substitutions {
270
270
  ];
271
271
  }
272
272
 
273
- rollback(context) {
273
+ rollback(specificContext) {
274
274
  const array = [
275
275
  ...this.array
276
276
  ];
@@ -278,7 +278,7 @@ export default class Substitutions {
278
278
  leftDifference(array, this.savedArray);
279
279
 
280
280
  array.forEach((substitution) => {
281
- this.removeSubstitution(substitution, context);
281
+ this.removeSubstitution(substitution, specificContext);
282
282
  });
283
283
 
284
284
  this.array = [