occam-verify-cli 0.0.682 → 0.0.684

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 (130) hide show
  1. package/lib/assignment/equality.js +60 -0
  2. package/lib/assignment/variable.js +60 -0
  3. package/lib/axiom.js +4 -4
  4. package/lib/axiomLemmaTheoremConjecture.js +29 -29
  5. package/lib/collection.js +154 -0
  6. package/lib/combinator.js +1 -1
  7. package/lib/conclusion.js +5 -5
  8. package/lib/conjecture.js +4 -4
  9. package/lib/consequent.js +3 -3
  10. package/lib/constructor.js +1 -1
  11. package/lib/context/file.js +9 -2
  12. package/lib/context/local.js +330 -0
  13. package/lib/context/localMeta.js +192 -0
  14. package/lib/context/release.js +1 -1
  15. package/lib/equality.js +19 -87
  16. package/lib/label.js +1 -1
  17. package/lib/lemma.js +4 -4
  18. package/lib/log.js +1 -1
  19. package/lib/metaType.js +1 -1
  20. package/lib/metavariable.js +1 -1
  21. package/lib/ocmbinator/bracketed.js +1 -1
  22. package/lib/premise.js +9 -9
  23. package/lib/rule.js +25 -25
  24. package/lib/step/metaproof.js +1 -1
  25. package/lib/step/proof.js +1 -1
  26. package/lib/substitution/metastatementForMetavariable.js +1 -1
  27. package/lib/substitution/statementForMetavariable.js +1 -1
  28. package/lib/substitution/termForVariable.js +1 -1
  29. package/lib/supposition.js +5 -5
  30. package/lib/term.js +68 -0
  31. package/lib/theorem.js +4 -4
  32. package/lib/type.js +5 -5
  33. package/lib/utilities/array.js +4 -4
  34. package/lib/utilities/collection.js +107 -0
  35. package/lib/variable.js +1 -1
  36. package/lib/verifier/node/metastatement.js +9 -9
  37. package/lib/verifier/node/statementAsCombinator.js +1 -1
  38. package/lib/verifier/node/termAsConstructor.js +2 -2
  39. package/lib/verifier/node.js +1 -1
  40. package/lib/verifier/nodes/metastatementForMetavariable/conclusion.js +1 -1
  41. package/lib/verifier/nodes/metastatementForMetavariable/premise.js +1 -1
  42. package/lib/verifier/nodes/metastatementForMetavariable.js +8 -8
  43. package/lib/verifier/nodes/statement.js +1 -1
  44. package/lib/verifier/nodes/statementForMetavariable/conclusion.js +1 -1
  45. package/lib/verifier/nodes/statementForMetavariable/premise.js +1 -1
  46. package/lib/verifier/nodes/statementForMetavariable.js +9 -9
  47. package/lib/verifier/nodes/term.js +3 -3
  48. package/lib/verifier/nodes/termForVariable/consequent.js +1 -1
  49. package/lib/verifier/nodes/termForVariable/supposition.js +1 -1
  50. package/lib/verifier/nodes/termForVariable.js +11 -11
  51. package/lib/verifier/nodes.js +1 -1
  52. package/lib/verify/axiom.js +6 -6
  53. package/lib/verify/conclusion.js +6 -6
  54. package/lib/verify/conjecture.js +7 -7
  55. package/lib/verify/consequent.js +6 -6
  56. package/lib/verify/derivation.js +17 -17
  57. package/lib/verify/equality.js +50 -18
  58. package/lib/verify/lemma.js +7 -7
  59. package/lib/verify/metastatement/qualified.js +7 -7
  60. package/lib/verify/metastatement/unqualified.js +7 -7
  61. package/lib/verify/metastatement.js +12 -12
  62. package/lib/verify/premise.js +7 -7
  63. package/lib/verify/proof.js +10 -7
  64. package/lib/verify/rule.js +6 -6
  65. package/lib/verify/ruleDerivation.js +17 -17
  66. package/lib/verify/ruleProof.js +6 -6
  67. package/lib/verify/statement/qualified.js +15 -15
  68. package/lib/verify/statement/unqualified.js +7 -7
  69. package/lib/verify/supposition.js +8 -8
  70. package/lib/verify/term.js +32 -31
  71. package/lib/verify/terms.js +11 -17
  72. package/lib/verify/theorem.js +7 -7
  73. package/lib/verify/typeAssertion.js +3 -3
  74. package/package.json +2 -2
  75. package/src/assignment/equality.js +21 -0
  76. package/src/assignment/variable.js +21 -0
  77. package/src/axiom.js +1 -1
  78. package/src/axiomLemmaTheoremConjecture.js +26 -26
  79. package/src/collection.js +101 -0
  80. package/src/conclusion.js +6 -6
  81. package/src/conjecture.js +1 -1
  82. package/src/consequent.js +4 -4
  83. package/src/context/file.js +9 -1
  84. package/src/context/local.js +311 -0
  85. package/src/context/{metaproof.js → localMeta.js} +16 -17
  86. package/src/equality.js +17 -111
  87. package/src/lemma.js +1 -1
  88. package/src/premise.js +12 -12
  89. package/src/rule.js +24 -24
  90. package/src/supposition.js +8 -8
  91. package/src/term.js +30 -0
  92. package/src/theorem.js +1 -1
  93. package/src/type.js +3 -3
  94. package/src/utilities/array.js +1 -1
  95. package/src/utilities/collection.js +83 -0
  96. package/src/verifier/node/metastatement.js +8 -8
  97. package/src/verifier/node/termAsConstructor.js +2 -2
  98. package/src/verifier/nodes/metastatementForMetavariable.js +7 -7
  99. package/src/verifier/nodes/statementForMetavariable.js +8 -8
  100. package/src/verifier/nodes/term.js +5 -4
  101. package/src/verifier/nodes/termForVariable.js +15 -14
  102. package/src/verify/axiom.js +5 -5
  103. package/src/verify/conclusion.js +5 -5
  104. package/src/verify/conjecture.js +6 -6
  105. package/src/verify/consequent.js +5 -5
  106. package/src/verify/derivation.js +16 -16
  107. package/src/verify/equality.js +81 -24
  108. package/src/verify/lemma.js +6 -6
  109. package/src/verify/metastatement/qualified.js +7 -7
  110. package/src/verify/metastatement/unqualified.js +6 -6
  111. package/src/verify/metastatement.js +11 -11
  112. package/src/verify/premise.js +6 -6
  113. package/src/verify/proof.js +13 -10
  114. package/src/verify/rule.js +5 -5
  115. package/src/verify/ruleDerivation.js +16 -16
  116. package/src/verify/ruleProof.js +5 -5
  117. package/src/verify/statement/qualified.js +15 -15
  118. package/src/verify/statement/unqualified.js +6 -6
  119. package/src/verify/supposition.js +7 -7
  120. package/src/verify/term.js +38 -35
  121. package/src/verify/terms.js +14 -28
  122. package/src/verify/theorem.js +6 -6
  123. package/src/verify/typeAssertion.js +3 -2
  124. package/lib/assignment.js +0 -74
  125. package/lib/context/metaproof.js +0 -192
  126. package/lib/context/proof.js +0 -245
  127. package/lib/verifier/nodes/equality.js +0 -155
  128. package/src/assignment.js +0 -36
  129. package/src/context/proof.js +0 -205
  130. package/src/verifier/nodes/equality.js +0 -68
@@ -0,0 +1,311 @@
1
+ "use strict";
2
+
3
+ import Variable from "../variable";
4
+ import Equality from "../equality";
5
+ import Collection from "../collection";
6
+ import fileMixins from "../mixins/file";
7
+ import loggingMixins from "../mixins/logging";
8
+
9
+ import { last, filter } from "../utilities/array";
10
+ import { mergeCollections, findCollectionByType, findCollectionByTerm, findCollectionByTerms } from "../utilities/collection";
11
+
12
+ class LocalContext {
13
+ constructor(context, variables, proofSteps, collections) {
14
+ this.context = context;
15
+ this.variables = variables;
16
+ this.proofSteps = proofSteps;
17
+ this.collections = collections;
18
+ }
19
+
20
+ getContext() {
21
+ return this.context;
22
+ }
23
+
24
+ getVariables() {
25
+ let variables = this.context.getVariables();
26
+
27
+ variables = [ ///
28
+ ...variables,
29
+ ...this.variables
30
+ ];
31
+
32
+ return variables;
33
+ }
34
+
35
+ getProofSteps() {
36
+ let proofSteps = this.context.getProofSteps();
37
+
38
+ proofSteps = [ ///
39
+ ...proofSteps,
40
+ ...this.proofSteps
41
+ ];
42
+
43
+ return proofSteps;
44
+ }
45
+
46
+ getCollections() {
47
+ let collections = this.context.getCollections();
48
+
49
+ const collectionsA = collections, ///
50
+ collectionsB = this.collections;
51
+
52
+ collections = mergeCollections(collectionsA, collectionsB); ///
53
+
54
+ return collections;
55
+ }
56
+
57
+ getEqualities() {
58
+ const equalities = this.context.getEqualities();
59
+
60
+ this.proofSteps.forEach((proofStep) => {
61
+ const equality = Equality.fromProofStep(proofStep);
62
+
63
+ if (equality !== null) {
64
+ equalities.push(equality);
65
+ }
66
+ });
67
+
68
+ return equalities;
69
+ }
70
+
71
+ getLastProofStep() {
72
+ let lastProofStep = null;
73
+
74
+ const proofStepsLength = this.proofSteps.length;
75
+
76
+ if (proofStepsLength > 0) {
77
+ lastProofStep = last(this.proofSteps);
78
+ }
79
+
80
+ return lastProofStep;
81
+ }
82
+
83
+ getMetavariables() { return this.context.getMetavariables(); }
84
+
85
+ addEquality(equality) {
86
+ const equalityReflexive = equality.isReflexive();
87
+
88
+ if (equalityReflexive) {
89
+ ///
90
+ } else {
91
+ const leftTerm = equality.getLeftTerm(),
92
+ rightTerm = equality.getRightTerm(),
93
+ leftCollection = this.findCollectionByTerm(leftTerm),
94
+ rightCollection = this.findCollectionByTerm(rightTerm);
95
+
96
+ if (false) {
97
+ ///
98
+ } else if ((leftCollection === null) && (rightCollection === null)) {
99
+ const collection = Collection.fromEquality(equality);
100
+
101
+ this.addCollection(collection);
102
+ } else if ((leftCollection !== null) && (rightCollection === null)) {
103
+ const term = rightTerm, ///
104
+ collection = leftCollection; ///
105
+
106
+ collection.addTerm(term);
107
+ } else if ((leftCollection === null) && (rightCollection !== null)) {
108
+ const term = leftTerm, ///
109
+ collection = rightCollection; ///
110
+
111
+ collection.addTerm(term);
112
+ } else if ((leftCollection !== null) && (rightCollection !== null)) {
113
+
114
+ debugger
115
+
116
+ }
117
+ }
118
+ }
119
+
120
+ addVariable(variable) {
121
+ const variableName = variable.getName();
122
+
123
+ filter(this.variables, (variable) => {
124
+ const name = variable.getName(),
125
+ nameVariableName = (name === variableName);
126
+
127
+ if (!nameVariableName) {
128
+ return true;
129
+ }
130
+ });
131
+
132
+ this.variables.push(variable);
133
+ }
134
+
135
+ addProofStep(proofStep) {
136
+ this.proofSteps.push(proofStep);
137
+ }
138
+
139
+ addCollection(collection) {
140
+ this.collections.push(collection);
141
+ }
142
+
143
+ matchStatement(statementNode) {
144
+ let statementMatches = false;
145
+
146
+ if (!statementMatches) {
147
+ const proofStepMatchesStatement = this.proofSteps.some((proofStep) => {
148
+ const proofStepMatchesStatement = proofStep.match(statementNode);
149
+
150
+ if (proofStepMatchesStatement) {
151
+ return true;
152
+ }
153
+ });
154
+
155
+ statementMatches = proofStepMatchesStatement; ///
156
+ }
157
+
158
+ if (!statementMatches) {
159
+ statementMatches = this.context.matchStatement(statementNode);
160
+ }
161
+
162
+ return statementMatches;
163
+ }
164
+
165
+ findCollectionByType(type) {
166
+ const collections = this.getCollections(),
167
+ collection = findCollectionByType(collections, type);
168
+
169
+ return collection;
170
+ }
171
+
172
+ findCollectionByTerm(term) {
173
+ const collections = this.getCollections(),
174
+ collection = findCollectionByTerm(collections, term);
175
+
176
+ return collection;
177
+ }
178
+
179
+ findCollectionByTerms(terms) {
180
+ const collections = this.getCollections(),
181
+ collection = findCollectionByTerms(collections, terms);
182
+
183
+ return collection;
184
+ }
185
+
186
+ findVariableByVariableName(variableName) {
187
+ const name = variableName, ///
188
+ variables = this.getVariables(),
189
+ variable = variables.find((variable) => {
190
+ const matches = variable.matchName(name);
191
+
192
+ if (matches) {
193
+ return true;
194
+ }
195
+ }) || null;
196
+
197
+ return variable;
198
+ }
199
+
200
+ isVariablePresentByVariableName(variableName) {
201
+ const variable = this.findVariableByVariableName(variableName),
202
+ variablePresent = (variable !== null);
203
+
204
+ return variablePresent;
205
+ }
206
+
207
+ isEqualityEqual(equality) {
208
+ let equalityEqual;
209
+
210
+ const equalityReflexive = equality.isReflexive();
211
+
212
+ if (equalityReflexive) {
213
+ equalityEqual = true;
214
+ } else {
215
+ const leftTerm = equality.getLeftTerm(),
216
+ rightTerm = equality.getRightTerm(),
217
+ terms = [
218
+ leftTerm,
219
+ rightTerm
220
+ ],
221
+ termsEqual = this.areTermsEqual(terms);
222
+
223
+ equalityEqual = termsEqual; ///
224
+ }
225
+
226
+ return equalityEqual;
227
+ }
228
+
229
+ areTermsEqual(terms) {
230
+ const collection = this.findCollectionByTerms(terms),
231
+ termsEqual = (collection !== null);
232
+
233
+ return termsEqual;
234
+ }
235
+
236
+ toJSON(tokens) {
237
+ const variables = this.variables.map((variable) => {
238
+ const variableJSON = variable.toJSON(tokens);
239
+
240
+ variable = variableJSON;
241
+
242
+ return variable;
243
+ }),
244
+ json = {
245
+ variables
246
+ };
247
+
248
+ return json;
249
+ }
250
+
251
+ static fromFileContext(fileContext) {
252
+ const context = fileContext, ///
253
+ variables = [],
254
+ proofSteps = [],
255
+ collections = [],
256
+ localContext = new LocalContext(context, variables, proofSteps, collections);
257
+
258
+ return localContext;
259
+ }
260
+
261
+ static fromLocalContext(localContext) {
262
+ const context = localContext, ///
263
+ variables = [],
264
+ proofSteps = [],
265
+ collections = [];
266
+
267
+ localContext = new LocalContext(context, variables, proofSteps, collections);
268
+
269
+ return localContext;
270
+ }
271
+
272
+ static fromJSONAndFileContext(json, fileContext) {
273
+ let { variables } = json;
274
+
275
+ const variablesJSON = variables;
276
+
277
+ variables = variablesJSON.map((variableJSON) => {
278
+ const json = variableJSON, ///
279
+ variable = Variable.fromJSONAndFileContext(json, fileContext);
280
+
281
+ return variable;
282
+ });
283
+
284
+ const context = fileContext, ///
285
+ proofSteps = [],
286
+ collections = [],
287
+ localContext = new LocalContext(context, variables, proofSteps, collections);
288
+
289
+ return localContext;
290
+ }
291
+
292
+ static fromLocalContextAndAssignments(localContext, assignments) {
293
+ const context = localContext, ///
294
+ variables = assignments.map((assignment) => {
295
+ const variable = assignment.getVariable();
296
+
297
+ return variable;
298
+ }),
299
+ proofSteps = [],
300
+ collections = [];
301
+
302
+ localContext = new LocalContext(context, variables, proofSteps, collections);
303
+
304
+ return localContext;
305
+ }
306
+ }
307
+
308
+ Object.assign(LocalContext.prototype, fileMixins);
309
+ Object.assign(LocalContext.prototype, loggingMixins);
310
+
311
+ export default LocalContext;
@@ -3,9 +3,9 @@
3
3
  import fileMixins from "../mixins/file";
4
4
  import loggingMixins from "../mixins/logging";
5
5
 
6
- import { push, last, filter } from "../utilities/array";
6
+ import { last, filter } from "../utilities/array";
7
7
 
8
- class MetaproofContext {
8
+ class LocalMetaContext {
9
9
  constructor(context, metavariables, metaproofSteps) {
10
10
  this.context = context;
11
11
  this.metavariables = metavariables;
@@ -17,13 +17,12 @@ class MetaproofContext {
17
17
  }
18
18
 
19
19
  getMetavariables() {
20
- const metavariables = [];
20
+ let metavariables = this.context.getMetavariables();
21
21
 
22
- push(metavariables, this.metavariables);
23
-
24
- const contextMetavariables = this.context.getMetavariables();
25
-
26
- push(metavariables, contextMetavariables);
22
+ metavariables = [ ///
23
+ ...metavariables,
24
+ this.metavariables
25
+ ]
27
26
 
28
27
  return metavariables;
29
28
  }
@@ -119,23 +118,23 @@ class MetaproofContext {
119
118
  const context = fileContext, ///
120
119
  metavariables = [],
121
120
  metaproofSteps = [],
122
- metaproofContext = new MetaproofContext(context, metavariables, metaproofSteps);
121
+ localMetaContext = new LocalMetaContext(context, metavariables, metaproofSteps);
123
122
 
124
- return metaproofContext;
123
+ return localMetaContext;
125
124
  }
126
125
 
127
- static fromMetaproofContext(metaproofContext) {
128
- const context = metaproofContext, ///
126
+ static fromLocalMetaContext(localMetaContext) {
127
+ const context = localMetaContext, ///
129
128
  metavariables = [],
130
129
  metaproofSteps = [];
131
130
 
132
- metaproofContext = new MetaproofContext(context, metavariables, metaproofSteps); ///
131
+ localMetaContext = new LocalMetaContext(context, metavariables, metaproofSteps); ///
133
132
 
134
- return metaproofContext;
133
+ return localMetaContext;
135
134
  }
136
135
  }
137
136
 
138
- Object.assign(MetaproofContext.prototype, fileMixins);
139
- Object.assign(MetaproofContext.prototype, loggingMixins);
137
+ Object.assign(LocalMetaContext.prototype, fileMixins);
138
+ Object.assign(LocalMetaContext.prototype, loggingMixins);
140
139
 
141
- export default MetaproofContext;
140
+ export default LocalMetaContext;
package/src/equality.js CHANGED
@@ -1,131 +1,37 @@
1
1
  "use strict";
2
2
 
3
- import equalityNodesVerifier from "./verifier/nodes/equality";
4
-
5
- import { nodeQuery } from "./utilities/query";
6
-
7
- const equalityNodeQuery = nodeQuery("/statement/equality!"),
8
- leftTermNodeQuery = nodeQuery("/equality/argument[0]/term!"),
9
- rightTermNodeQuery = nodeQuery("/equality/argument[1]/term!");
10
-
11
3
  export default class Equality {
12
- constructor(leftTermNode, rightTermNode) {
13
- this.leftTermNode = leftTermNode;
14
- this.rightTermNode = rightTermNode;
15
- }
16
-
17
- getLeftTermNode() {
18
- return this.leftTermNode;
4
+ constructor(leftTerm, rightTerm) {
5
+ this.leftTerm = leftTerm;
6
+ this.rightTerm = rightTerm;
19
7
  }
20
8
 
21
- getRightTermNode() {
22
- return this.rightTermNode;
9
+ getLeftTerm() {
10
+ return this.leftTerm;
23
11
  }
24
12
 
25
- matchTermNodes(leftTermNode, rightTermNode, reversed, equalities, context) {
26
- let termNodesMatch = true;
27
-
28
- if (termNodesMatch) {
29
- const leftNonTerminalNode = reversed ?
30
- this.rightTermNode :
31
- this.leftTermNode, ///
32
- rightNonTerminalNode = leftTermNode, ///
33
- nonTerminalNodeVerified = equalityNodesVerifier.verifyNonTerminalNode(leftNonTerminalNode, rightNonTerminalNode, equalities, context);
34
-
35
- termNodesMatch = nonTerminalNodeVerified; ///
36
- }
37
-
38
- if (termNodesMatch) {
39
- const leftNonTerminalNode = reversed ?
40
- this.leftTermNode :
41
- this.rightTermNode, ///
42
- rightNonTerminalNode = rightTermNode, ///
43
- nonTerminalNodeVerified = equalityNodesVerifier.verifyNonTerminalNode(leftNonTerminalNode, rightNonTerminalNode, equalities, context);
44
-
45
- termNodesMatch = nonTerminalNodeVerified; ///
46
- }
47
-
48
- return termNodesMatch;
13
+ getRightTerm() {
14
+ return this.rightTerm;
49
15
  }
50
16
 
51
- match(equality, equalities, context) {
52
- let matches = false;
53
-
54
- const leftTermNode = equality.getLeftTermNode(),
55
- rightTermNode = equality.getRightTermNode();
56
-
57
- equalities = filterEqualities(equalities, equality); ///
58
-
59
- if (!matches) {
60
- const reversed = false,
61
- leftTermNodeAndRightTermNodeMatch = this.matchTermNodes(leftTermNode, rightTermNode, reversed, equalities, context);
62
-
63
- matches = leftTermNodeAndRightTermNodeMatch; ///
64
- }
65
-
66
- if (!matches) {
67
- const reversed = true,
68
- leftTermNodeAndRightTermNodeMatch = this.matchTermNodes(leftTermNode, rightTermNode, reversed, equalities, context);
69
-
70
- matches = leftTermNodeAndRightTermNodeMatch; ///
71
- }
17
+ isReflexive() {
18
+ const leftTermMatchesRightTerm = this.leftTerm.match(this.rightTerm),
19
+ reflexive = leftTermMatchesRightTerm;
72
20
 
73
- return matches;
21
+ return reflexive;
74
22
  }
75
23
 
76
- verify(equalities, context, verifyAhead) {
77
- const leftNonTerminalNode = this.leftTermNode, ///
78
- rightNonTerminalNode = this.rightTermNode, ///
79
- nonTerminalNodeVerified = equalityNodesVerifier.verifyNonTerminalNode(leftNonTerminalNode, rightNonTerminalNode, equalities, context, verifyAhead),
80
- verified = nonTerminalNodeVerified; ///
81
-
82
- return verified;
83
- }
84
-
85
- static fromProofStep(proofStep) {
24
+ static fromLeftTermAndRightTerm(leftTerm, rightTerm) {
86
25
  let equality = null;
87
26
 
88
- const statementNode = proofStep.getStatementNode();
89
-
90
- if (statementNode !== null) {
91
- const equalityNode = equalityNodeQuery(statementNode);
92
-
93
- if (equalityNode !== null) {
94
- const leftTermNode = leftTermNodeQuery(statementNode),
95
- rightTermNode = rightTermNodeQuery(statementNode);
27
+ const leftTermType = leftTerm.getType(),
28
+ rightTermType = rightTerm.getType(),
29
+ leftTermTypeEqualToSubTypeOfOrSuperTypeOfRightTermType = leftTermType.isEqualToSubTypeOfOrSuperTypeOf(rightTermType);
96
30
 
97
- equality = new Equality(leftTermNode, rightTermNode);
98
- }
31
+ if (leftTermTypeEqualToSubTypeOfOrSuperTypeOfRightTermType) {
32
+ equality = new Equality(leftTerm, rightTerm);
99
33
  }
100
34
 
101
35
  return equality;
102
36
  }
103
-
104
- static fromEqualityNode(equalityNode) {
105
- const leftTermNode = leftTermNodeQuery(equalityNode),
106
- rightTermNode = rightTermNodeQuery(equalityNode),
107
- equality = new Equality(leftTermNode, rightTermNode);
108
-
109
- return equality;
110
- }
111
-
112
- static fromLeftTermNodeAndRightTermNode(leftTermNode, rightTermNode) {
113
- const equality = new Equality(leftTermNode, rightTermNode);
114
-
115
- return equality;
116
- }
117
- }
118
-
119
- function filterEqualities(equalities, equality) {
120
- const equalityA = equality; ///
121
-
122
- equalities = equalities.filter((equality) => {
123
- const equalityB = equality; ///
124
-
125
- if (equalityA !== equalityB) {
126
- return true;
127
- }
128
- });
129
-
130
- return equalities;
131
37
  }
package/src/lemma.js CHANGED
@@ -5,5 +5,5 @@ import AxiomLemmaTheoremConjecture from "./axiomLemmaTheoremConjecture";
5
5
  export default class Lemma extends AxiomLemmaTheoremConjecture {
6
6
  static fromJSONAndFileContext(json, fileContext) { return AxiomLemmaTheoremConjecture.fromJSONAndFileContext(Lemma,json, fileContext); }
7
7
 
8
- static fromLabelsSuppositionsConsequentAndProofContext(labels, suppositions, consequent, proofContext) { return AxiomLemmaTheoremConjecture.fromLabelsSuppositionsConsequentAndProofContext(Lemma, labels, suppositions, consequent, proofContext); }
8
+ static fromLabelsSuppositionsConsequentAndLocalContext(labels, suppositions, consequent, localContext) { return AxiomLemmaTheoremConjecture.fromLabelsSuppositionsConsequentAndLocalContext(Lemma, labels, suppositions, consequent, localContext); }
9
9
  }
package/src/premise.js CHANGED
@@ -23,7 +23,7 @@ export default class Premise {
23
23
  return this.metastatementNode;
24
24
  }
25
25
 
26
- matchSubproofNode(subproofNode, substitutions, fileContext, statementProofContext) {
26
+ matchSubproofNode(subproofNode, substitutions, fileContext, statementLocalContext) {
27
27
  let subproofNodeMatches = false;
28
28
 
29
29
  const subproofAssertionNode = ruleSubproofAssertionNodeQuery(this.metastatementNode);
@@ -45,8 +45,8 @@ export default class Premise {
45
45
  nonTerminalNodeA = ruleSubproofAssertionMetastatementNode, ///
46
46
  nonTerminalNodeB = subproofStatementNode, ///
47
47
  fileContextA = fileContext, ///
48
- proofContextB = statementProofContext, ///
49
- nonTerminalNodeVerified = premiseStatementForMetavariableNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, fileContextA, proofContextB, () => {
48
+ localContextB = statementLocalContext, ///
49
+ nonTerminalNodeVerified = premiseStatementForMetavariableNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, fileContextA, localContextB, () => {
50
50
  const verifiedAhead = true;
51
51
 
52
52
  return verifiedAhead;
@@ -62,12 +62,12 @@ export default class Premise {
62
62
  return subproofNodeMatches;
63
63
  }
64
64
 
65
- matchStatementNode(statementNode, substitutions, fileContext, statementProofContext) {
65
+ matchStatementNode(statementNode, substitutions, fileContext, statementLocalContext) {
66
66
  const nonTerminalNodeA = this.metastatementNode, ///
67
67
  nonTerminalNodeB = statementNode, ///
68
68
  fileContextA = fileContext, ///
69
- proofContextB = statementProofContext, ///
70
- nonTerminalNodeVerified = premiseStatementForMetavariableNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, fileContextA, proofContextB, () => {
69
+ localContextB = statementLocalContext, ///
70
+ nonTerminalNodeVerified = premiseStatementForMetavariableNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, fileContextA, localContextB, () => {
71
71
  const verifiedAhead = true;
72
72
 
73
73
  return verifiedAhead;
@@ -77,7 +77,7 @@ export default class Premise {
77
77
  return statementNodeMatches;
78
78
  }
79
79
 
80
- matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, metastatementMetaproofContext) {
80
+ matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, metastatementMetalocalContext) {
81
81
  let ruleSubproofNodeMatches = false;
82
82
 
83
83
  const ruleSubproofAssertionNode = ruleSubproofAssertionNodeQuery(this.metastatementNode);
@@ -99,8 +99,8 @@ export default class Premise {
99
99
  nonTerminalNodeA = ruleSubproofAssertionMetastatementNode, ///
100
100
  nonTerminalNodeB = ruleSubproofMetastatementNode, ///
101
101
  fileContextA = fileContext, ///
102
- metaproofContextB = metastatementMetaproofContext, ///
103
- nonTerminalNodeVerified = premiseMetastatementForMetavariableNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, fileContextA, metaproofContextB, () => {
102
+ metalocalContextB = metastatementMetalocalContext, ///
103
+ nonTerminalNodeVerified = premiseMetastatementForMetavariableNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, fileContextA, metalocalContextB, () => {
104
104
  const verifiedAhead = true;
105
105
 
106
106
  return verifiedAhead;
@@ -116,12 +116,12 @@ export default class Premise {
116
116
  return ruleSubproofNodeMatches;
117
117
  }
118
118
 
119
- matchMetastatementNode(metastatementNode, substitutions, fileContext, metastatementMetaproofContext) {
119
+ matchMetastatementNode(metastatementNode, substitutions, fileContext, metastatementMetalocalContext) {
120
120
  const nonTerminalNodeA = this.metastatementNode, ///
121
121
  nonTerminalNodeB = metastatementNode, ///
122
122
  fileContextA = fileContext, ///
123
- metaproofContextB = metastatementMetaproofContext, ///
124
- nonTerminalNodeVerified = premiseMetastatementForMetavariableNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, fileContextA, metaproofContextB, () => {
123
+ metalocalContextB = metastatementMetalocalContext, ///
124
+ nonTerminalNodeVerified = premiseMetastatementForMetavariableNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, fileContextA, metalocalContextB, () => {
125
125
  const verifiedAhead = true;
126
126
 
127
127
  return verifiedAhead;