occam-verify-cli 0.0.913 → 0.0.915

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 (110) hide show
  1. package/lib/assignment/frameAssertion.js +4 -4
  2. package/lib/axiomLemmaTheoremConjecture.js +4 -3
  3. package/lib/conclusion.js +5 -5
  4. package/lib/context/file.js +3 -3
  5. package/lib/context/local/intrinsicLevel.js +326 -0
  6. package/lib/context/local/metaLevel.js +290 -0
  7. package/lib/metaConsequent.js +4 -4
  8. package/lib/metaLemmaMetatheorem.js +11 -11
  9. package/lib/metaSupposition.js +7 -7
  10. package/lib/metavariable.js +5 -5
  11. package/lib/premise.js +12 -12
  12. package/lib/rule.js +12 -12
  13. package/lib/verifier/node/metaLevel.js +214 -0
  14. package/lib/verifier/node/statementAsCombinator.js +9 -9
  15. package/lib/verifier/node/termAsConstructor.js +7 -7
  16. package/lib/verify/axiom.js +3 -3
  17. package/lib/verify/conclusion.js +7 -7
  18. package/lib/verify/conjecture.js +3 -3
  19. package/lib/verify/containedAssertion.js +23 -4
  20. package/lib/verify/declaration.js +15 -15
  21. package/lib/verify/definedAssertion.js +18 -4
  22. package/lib/verify/derivation.js +3 -3
  23. package/lib/verify/frame.js +16 -16
  24. package/lib/verify/frameAssertion.js +33 -33
  25. package/lib/verify/lemma.js +3 -3
  26. package/lib/verify/metaConsequent.js +7 -7
  27. package/lib/verify/metaDerivation.js +3 -3
  28. package/lib/verify/metaLemma.js +6 -6
  29. package/lib/verify/metaSubDerivation.js +3 -3
  30. package/lib/verify/metaSubproof.js +7 -6
  31. package/lib/verify/metaSupposition.js +9 -9
  32. package/lib/verify/metaSuppositions.js +3 -3
  33. package/lib/verify/metaproof.js +7 -6
  34. package/lib/verify/metaproofStep.js +23 -23
  35. package/lib/verify/metastatement/qualified.js +22 -22
  36. package/lib/verify/metastatement/unqualified.js +7 -7
  37. package/lib/verify/metastatement.js +26 -26
  38. package/lib/verify/metatheorem.js +6 -6
  39. package/lib/verify/metavariable.js +6 -6
  40. package/lib/verify/premise.js +9 -9
  41. package/lib/verify/premises.js +3 -3
  42. package/lib/verify/proof.js +4 -3
  43. package/lib/verify/rule.js +6 -6
  44. package/lib/verify/ruleDerivation.js +3 -3
  45. package/lib/verify/ruleProof.js +7 -6
  46. package/lib/verify/ruleProofStep.js +26 -25
  47. package/lib/verify/ruleSubDerivation.js +3 -3
  48. package/lib/verify/ruleSubproof.js +7 -6
  49. package/lib/verify/statement.js +4 -17
  50. package/lib/verify/subDerivation.js +3 -3
  51. package/lib/verify/subproof.js +4 -3
  52. package/lib/verify/termAsConstructor.js +3 -3
  53. package/lib/verify/theorem.js +4 -4
  54. package/package.json +2 -2
  55. package/src/assignment/frameAssertion.js +5 -5
  56. package/src/axiomLemmaTheoremConjecture.js +4 -2
  57. package/src/conclusion.js +7 -7
  58. package/src/context/file.js +2 -2
  59. package/src/context/{local.js → local/intrinsicLevel.js} +25 -20
  60. package/src/context/{localMeta.js → local/metaLevel.js} +21 -16
  61. package/src/metaConsequent.js +7 -7
  62. package/src/metaLemmaMetatheorem.js +11 -11
  63. package/src/metaSupposition.js +13 -13
  64. package/src/metavariable.js +6 -7
  65. package/src/premise.js +26 -26
  66. package/src/rule.js +12 -12
  67. package/src/verifier/node/{metastatement.js → metaLevel.js} +19 -21
  68. package/src/verifier/node/statementAsCombinator.js +8 -8
  69. package/src/verifier/node/termAsConstructor.js +6 -6
  70. package/src/verify/axiom.js +4 -3
  71. package/src/verify/conclusion.js +5 -6
  72. package/src/verify/conjecture.js +4 -3
  73. package/src/verify/containedAssertion.js +24 -3
  74. package/src/verify/declaration.js +15 -15
  75. package/src/verify/definedAssertion.js +23 -3
  76. package/src/verify/derivation.js +2 -2
  77. package/src/verify/frame.js +15 -15
  78. package/src/verify/frameAssertion.js +33 -33
  79. package/src/verify/lemma.js +4 -3
  80. package/src/verify/metaConsequent.js +5 -6
  81. package/src/verify/metaDerivation.js +2 -2
  82. package/src/verify/metaLemma.js +8 -7
  83. package/src/verify/metaSubDerivation.js +2 -2
  84. package/src/verify/metaSubproof.js +7 -5
  85. package/src/verify/metaSupposition.js +7 -8
  86. package/src/verify/metaSuppositions.js +2 -2
  87. package/src/verify/metaproof.js +7 -5
  88. package/src/verify/metaproofStep.js +21 -25
  89. package/src/verify/metastatement/qualified.js +24 -24
  90. package/src/verify/metastatement/unqualified.js +6 -6
  91. package/src/verify/metastatement.js +25 -25
  92. package/src/verify/metatheorem.js +8 -7
  93. package/src/verify/metavariable.js +5 -5
  94. package/src/verify/premise.js +7 -8
  95. package/src/verify/premises.js +2 -2
  96. package/src/verify/proof.js +4 -2
  97. package/src/verify/rule.js +8 -7
  98. package/src/verify/ruleDerivation.js +2 -2
  99. package/src/verify/ruleProof.js +7 -5
  100. package/src/verify/ruleProofStep.js +22 -25
  101. package/src/verify/ruleSubDerivation.js +2 -2
  102. package/src/verify/ruleSubproof.js +7 -5
  103. package/src/verify/statement.js +2 -22
  104. package/src/verify/subDerivation.js +2 -2
  105. package/src/verify/subproof.js +4 -2
  106. package/src/verify/termAsConstructor.js +4 -3
  107. package/src/verify/theorem.js +5 -4
  108. package/lib/context/local.js +0 -320
  109. package/lib/context/localMeta.js +0 -284
  110. package/lib/verifier/node/metastatement.js +0 -214
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- import LocalContext from "../context/local";
3
+ import IntrinsicLevelLocalContext from "../../context/local/intrinsicLevel";
4
4
 
5
- import { last, reverse } from "../utilities/array";
5
+ import { last, reverse } from "../../utilities/array";
6
6
 
7
- class LocalMetaContext extends LocalContext {
7
+ class MetaLevelLocalContext extends IntrinsicLevelLocalContext {
8
8
  constructor(context, variables, proofSteps, equivalences, metavariables, metaproofSteps, frameAssertions) {
9
9
  super(context, variables, proofSteps, equivalences);
10
10
 
@@ -46,6 +46,12 @@ class LocalMetaContext extends LocalContext {
46
46
  return frameAssertions;
47
47
  }
48
48
 
49
+ isIntrinsicLevel() {
50
+ const intrinsicLevel = false;
51
+
52
+ return intrinsicLevel;
53
+ }
54
+
49
55
  getLastMetaproofStep() {
50
56
  let lastMetaproofStep = null;
51
57
 
@@ -114,11 +120,11 @@ class LocalMetaContext extends LocalContext {
114
120
  return matchesMetastatementNode;
115
121
  }
116
122
 
117
- findMetavariableByMetavariableNode(metavariableNode, localMetaContext) {
123
+ findMetavariableByMetavariableNode(metavariableNode, metaLevelLocalContext) {
118
124
  const node = metavariableNode, ///
119
125
  metavariables = this.getMetavariables(),
120
126
  metavariable = metavariables.find((metavariable) => {
121
- const matches = metavariable.matchNode(node, localMetaContext);
127
+ const matches = metavariable.matchNode(node, metaLevelLocalContext);
122
128
 
123
129
  if (matches) {
124
130
  return true;
@@ -141,8 +147,8 @@ class LocalMetaContext extends LocalContext {
141
147
  return frameAssertion;
142
148
  }
143
149
 
144
- isMetavariablePresentByMetavariableNode(metavariableNode, localMetaContext) {
145
- const metavariable = this.findMetavariableByMetavariableNode(metavariableNode, localMetaContext),
150
+ isMetavariablePresentByMetavariableNode(metavariableNode, metaLevelLocalContext) {
151
+ const metavariable = this.findMetavariableByMetavariableNode(metavariableNode, metaLevelLocalContext),
146
152
  metavariablePresent = (metavariable !== null);
147
153
 
148
154
  return metavariablePresent;
@@ -163,24 +169,23 @@ class LocalMetaContext extends LocalContext {
163
169
  metavariables = [],
164
170
  metaproofSteps = [],
165
171
  frameAssertions = [],
166
- localMetaContext = new LocalMetaContext(context, variables, proofSteps, equivalences, metavariables, metaproofSteps, frameAssertions);
172
+ metaLevelLocalContext = new MetaLevelLocalContext(context, variables, proofSteps, equivalences, metavariables, metaproofSteps, frameAssertions);
167
173
 
168
- return localMetaContext;
174
+ return metaLevelLocalContext;
169
175
  }
170
176
 
171
- static fromLocalMetaContext(localMetaContext) {
172
- const context = localMetaContext, ///
177
+ static fromLocalContext(localContext) {
178
+ const context = localContext, ///
173
179
  variables = [],
174
180
  proofSteps = [],
175
181
  equivalences = [],
176
182
  metavariables = [],
177
183
  metaproofSteps = [],
178
- frameAssertions = [];
179
-
180
- localMetaContext = new LocalMetaContext(context, variables, proofSteps, equivalences, metavariables, metaproofSteps, frameAssertions); ///
184
+ frameAssertions = [],
185
+ metaLevelLocalContext = new MetaLevelLocalContext(context, variables, proofSteps, equivalences, metavariables, metaproofSteps, frameAssertions); ///
181
186
 
182
- return localMetaContext;
187
+ return metaLevelLocalContext;
183
188
  }
184
189
  }
185
190
 
186
- export default LocalMetaContext;
191
+ export default MetaLevelLocalContext;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
- import LocalMetaContext from "./context/localMeta";
4
3
  import metaLevelNodesVerifier from "./verifier/nodes/metaLevel";
4
+ import MetaLevelLocalContext from "./context/local/metaLevel";
5
5
 
6
6
  import { nodeAsString } from "./utilities/string";
7
7
  import { statementNodeFromStatementString, metastatementNodeFromMetastatementString } from "./utilities/node";
@@ -20,16 +20,16 @@ export default class MetaConsequent {
20
20
  return this.statementNode;
21
21
  }
22
22
 
23
- matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
23
+ matchMetastatementNode(metastatementNode, substitutions, fileContext, localContext) {
24
24
  let matchesMetastatementNode = false;
25
25
 
26
26
  if (this.metastatementNode !== null) {
27
- const nonTerminalNodeA = this.metastatementNode, ///
27
+ const metaLevelLocalContext = MetaLevelLocalContext.fromFileContext(fileContext),
28
+ nonTerminalNodeA = this.metastatementNode, ///
28
29
  nonTerminalNodeB = metastatementNode, ///
29
- fileContextA = fileContext, ///
30
- localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
31
- localMetaContextB = localMetaContext, ///
32
- nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
30
+ localContextA = metaLevelLocalContext, ///
31
+ localContextB = localContext, ///
32
+ nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localContextA, localContextB, () => {
33
33
  const verifiedAhead = true;
34
34
 
35
35
  return verifiedAhead;
@@ -36,15 +36,15 @@ export default class MetaLemmaMetatheorem {
36
36
  return this.fileContext;
37
37
  }
38
38
 
39
- matchMetastatement(metastatementNode, localMetaContext) {
39
+ matchMetastatement(metastatementNode, localContext) {
40
40
  let metastatementNatches = false;
41
41
 
42
- const metaproofSteps = localMetaContext.getProofSteps(),
42
+ const metaproofSteps = localContext.getProofSteps(),
43
43
  substitutions = [],
44
- metaSuppositionsMatch = matchMetaSuppositions(this.metaSuppositions, metaproofSteps, substitutions, this.fileContext, localMetaContext);
44
+ metaSuppositionsMatch = matchMetaSuppositions(this.metaSuppositions, metaproofSteps, substitutions, this.fileContext, localContext);
45
45
 
46
46
  if (metaSuppositionsMatch) {
47
- const metaConsequentMatches = matchMetaConsequent(this.metaConsequent, metastatementNode, substitutions, this.fileContext, localMetaContext);
47
+ const metaConsequentMatches = matchMetaConsequent(this.metaConsequent, metastatementNode, substitutions, this.fileContext, localContext);
48
48
 
49
49
  metastatementNatches = metaConsequentMatches; ///
50
50
  }
@@ -143,13 +143,13 @@ export default class MetaLemmaMetatheorem {
143
143
  static fromLabelsMetaSuppositionsMetaConsequentSubstitutionsAndFileContext(Class, labels, metaSuppositions, metaConsequent, substitutions, fileContext) { return new Class(labels, metaSuppositions, metaConsequent, substitutions, fileContext); }
144
144
  }
145
145
 
146
- function matchMetaSuppositions(metaSuppositions, metaproofSteps, substitutions, fileContext, localMetaContext) {
146
+ function matchMetaSuppositions(metaSuppositions, metaproofSteps, substitutions, fileContext, localContext) {
147
147
  metaSuppositions = reverse(metaSuppositions); ///
148
148
 
149
149
  metaproofSteps = reverse(metaproofSteps); ///
150
150
 
151
151
  const metaSuppositionsMatch = correlate(metaSuppositions, metaproofSteps, (metaSupposition, metaproofStep) => {
152
- const metaSuppositionMatches = matchMetaSupposition(metaSupposition, metaproofStep, substitutions, fileContext, localMetaContext);
152
+ const metaSuppositionMatches = matchMetaSupposition(metaSupposition, metaproofStep, substitutions, fileContext, localContext);
153
153
 
154
154
  if (metaSuppositionMatches) {
155
155
  return true;
@@ -159,20 +159,20 @@ function matchMetaSuppositions(metaSuppositions, metaproofSteps, substitutions,
159
159
  return metaSuppositionsMatch;
160
160
  }
161
161
 
162
- function matchMetaSupposition(metaSupposition, metaproofStep, substitutions, fileContext, localMetaContext) {
162
+ function matchMetaSupposition(metaSupposition, metaproofStep, substitutions, fileContext, localContext) {
163
163
  let matchesMetaSupposition = false;
164
164
 
165
165
  const metaSubproofNode = metaproofStep.getMetaSubproofNode(),
166
166
  metastatementNode = metaproofStep.getMetastatementNode();
167
167
 
168
168
  if (metaSubproofNode !== null) {
169
- const metaSuppositionMatchesMetaSubproofNode = metaSupposition.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext);
169
+ const metaSuppositionMatchesMetaSubproofNode = metaSupposition.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localContext);
170
170
 
171
171
  matchesMetaSupposition - metaSuppositionMatchesMetaSubproofNode; ///
172
172
  }
173
173
 
174
174
  if (metastatementNode !== null) {
175
- const metaSuppositionMatchesMetastatementNode = metaSupposition.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext);
175
+ const metaSuppositionMatchesMetastatementNode = metaSupposition.matchMetastatementNode(metastatementNode, substitutions, fileContext, localContext);
176
176
 
177
177
  matchesMetaSupposition - metaSuppositionMatchesMetastatementNode; ///
178
178
  }
@@ -180,8 +180,8 @@ function matchMetaSupposition(metaSupposition, metaproofStep, substitutions, fil
180
180
  return matchesMetaSupposition;
181
181
  }
182
182
 
183
- function matchMetaConsequent(metaConsequent, metastatementNode, substitutions, fileContext, localMetaContext) {
184
- const metaConsequentMatchesMetastatementNode = metaConsequent.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext),
183
+ function matchMetaConsequent(metaConsequent, metastatementNode, substitutions, fileContext, localContext) {
184
+ const metaConsequentMatchesMetastatementNode = metaConsequent.matchMetastatementNode(metastatementNode, substitutions, fileContext, localContext),
185
185
  metaConsequentMatches = metaConsequentMatchesMetastatementNode; ///
186
186
 
187
187
  return metaConsequentMatches;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import LocalMetaContext from "./context/localMeta";
3
+ import MetaLevelLocalContext from "./context/local/metaLevel";
4
4
  import metaLevelNodesVerifier from "./verifier/nodes/metaLevel";
5
5
 
6
6
  import { match } from "./utilities/array";
@@ -27,7 +27,7 @@ export default class MetaSupposition {
27
27
  return this.statementNode;
28
28
  }
29
29
 
30
- matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext) {
30
+ matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localContext) {
31
31
  let matchesMetaSubproofNode = false;
32
32
 
33
33
  if (this.metastatementNode !== null) {
@@ -43,12 +43,12 @@ export default class MetaSupposition {
43
43
  subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
44
44
 
45
45
  matchesMetaSubproofNode = match(subproofAssertionMetastatementNodes, metaSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
46
- const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
46
+ const metaLevelLocalContext = MetaLevelLocalContext.fromFileContext(fileContext),
47
+ nonTerminalNodeA = subproofAssertionMetastatementNode, ///
47
48
  nonTerminalNodeB = ruleSubproofMetastatementNode, ///
48
- fileContextA = fileContext, ///
49
- localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
50
- localMetaContextB = localMetaContext, ///
51
- nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
49
+ localContextA = metaLevelLocalContext, ///
50
+ localContextB = localContext, ///
51
+ nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localContextA, localContextB, () => {
52
52
  const verifiedAhead = true;
53
53
 
54
54
  return verifiedAhead;
@@ -64,16 +64,16 @@ export default class MetaSupposition {
64
64
  return matchesMetaSubproofNode;
65
65
  }
66
66
 
67
- matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
67
+ matchMetastatementNode(metastatementNode, substitutions, fileContext, localContext) {
68
68
  let matchesMetastatementNode = false;
69
69
 
70
70
  if (this.metastatementNode !== null) {
71
- const nonTerminalNodeA = this.metastatementNode, ///
71
+ const metaLevelLocalContext = MetaLevelLocalContext.fromFileContext(fileContext),
72
+ nonTerminalNodeA = this.metastatementNode, ///
72
73
  nonTerminalNodeB = metastatementNode, ///
73
- fileContextA = fileContext, ///
74
- localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
75
- localMetaContextB = localMetaContext, ///
76
- nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
74
+ localContextA = metaLevelLocalContext, ///
75
+ localContextB = localContext, ///
76
+ nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localContextA, localContextB, () => {
77
77
  const verifiedAhead = true;
78
78
 
79
79
  return verifiedAhead;
@@ -42,7 +42,7 @@ export default class Metavariable {
42
42
  return matchesName;
43
43
  }
44
44
 
45
- matchNode(node, localMetaContext) {
45
+ matchNode(node, localContext) {
46
46
  let matchesNode = false;
47
47
 
48
48
  const metavariableNode = node, ///
@@ -59,7 +59,7 @@ export default class Metavariable {
59
59
  } else if ((termNode === null) && (this.termType === null)) {
60
60
  matchesNode = true;
61
61
  } else if ((termNode !== null) && (this.termType !== null)) {
62
- const termVerifiedAgainstTermType = verifyTermAgainstTermType(termNode, this.termType, localMetaContext);
62
+ const termVerifiedAgainstTermType = verifyTermAgainstTermType(termNode, this.termType, localContext);
63
63
 
64
64
  matchesNode = termVerifiedAgainstTermType; ///
65
65
  }
@@ -122,12 +122,11 @@ export default class Metavariable {
122
122
  }
123
123
  }
124
124
 
125
- function verifyTermAgainstTermType(termNode, termType, localMetaContext) {
125
+ function verifyTermAgainstTermType(termNode, termType, localContext) {
126
126
  let termVerifiedAgainstTermType;
127
127
 
128
128
  const type = termType, ///
129
- terms = [],
130
- localContext = localMetaContext; ///
129
+ terms = [];
131
130
 
132
131
  termVerifiedAgainstTermType = verifyTerm(termNode, terms, localContext, () => {
133
132
  let verifiedAhead = false;
@@ -153,9 +152,9 @@ function termTypeFromMetavariableNode(metavariableNode, fileContext) {
153
152
  const typeNode = typeNodeQuery(metavariableNode);
154
153
 
155
154
  if (typeNode !== null) {
156
- const type = fileContext.findTypeByTypeNode(typeNode);
155
+ const type = fileContext.findTypeByTypeNode(typeNode);
157
156
 
158
- termType = type; ///
157
+ termType = type; ///
159
158
  }
160
159
 
161
160
  return termType;
package/src/premise.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
- import LocalContext from "./context/local";
4
- import LocalMetaContext from "./context/localMeta";
3
+ import MetaLevelLocalContext from "./context/local/metaLevel";
5
4
  import metaLevelNodesVerifier from "./verifier/nodes/metaLevel";
5
+ import IntrinsicLevelLocalContext from "./context/local/intrinsicLevel";
6
6
  import intrinsicLevelAgainstMetaLevelNodesVerifier from "./verifier/nodes/intrinsicLevelAgainstMetaLevel";
7
7
 
8
8
  import { match } from "./utilities/array";
@@ -37,10 +37,10 @@ export default class Premise {
37
37
  let matchesStatementNode = false;
38
38
 
39
39
  if (this.metastatementNode !== null) {
40
- const nonTerminalNodeA = this.metastatementNode, ///
40
+ const intrinsicLevelLocalContext = IntrinsicLevelLocalContext.fromFileContext(fileContext),
41
+ nonTerminalNodeA = this.metastatementNode, ///
41
42
  nonTerminalNodeB = statementNode, ///
42
- fileContextA = fileContext, ///
43
- localContextA = LocalContext.fromFileContext(fileContextA),
43
+ localContextA = intrinsicLevelLocalContext, ///
44
44
  localContextB = localContext, ///
45
45
  nonTerminalNodeVerified = intrinsicLevelAgainstMetaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localContextA, localContextB, () => {
46
46
  const verifiedAhead = true;
@@ -70,10 +70,10 @@ export default class Premise {
70
70
  subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
71
71
 
72
72
  matchesSubproofNode = match(subproofAssertionMetastatementNodes, subproofStatementNodes, (subproofAssertionMetastatementNode, subproofStatementNode) => {
73
- const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
73
+ const metaLevelLocalContext = MetaLevelLocalContext.fromFileContext(fileContext),
74
+ nonTerminalNodeA = subproofAssertionMetastatementNode, ///
74
75
  nonTerminalNodeB = subproofStatementNode, ///
75
- fileContextA = fileContext, ///
76
- localContextA = LocalMetaContext.fromFileContext(fileContextA),
76
+ localContextA = metaLevelLocalContext, ///
77
77
  localContextB = localContext, ///
78
78
  nonTerminalNodeVerified = intrinsicLevelAgainstMetaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localContextA, localContextB, () => {
79
79
  const verifiedAhead = true;
@@ -91,7 +91,7 @@ export default class Premise {
91
91
  return matchesSubproofNode;
92
92
  }
93
93
 
94
- matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localMetaContext) {
94
+ matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localContext) {
95
95
  let matchesRuleSubproofNode = false;
96
96
 
97
97
  if (this.metastatementNode !== null) {
@@ -107,12 +107,12 @@ export default class Premise {
107
107
  subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
108
108
 
109
109
  matchesRuleSubproofNode = match(subproofAssertionMetastatementNodes, ruleSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
110
- const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
110
+ const metaLevelLocalContext = MetaLevelLocalContext.fromFileContext(fileContext),
111
+ nonTerminalNodeA = subproofAssertionMetastatementNode, ///
111
112
  nonTerminalNodeB = ruleSubproofMetastatementNode, ///
112
- fileContextA = fileContext, ///
113
- localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
114
- localMetaContextB = localMetaContext, ///
115
- nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
113
+ localContextA = metaLevelLocalContext, ///
114
+ localContextB = localContext, ///
115
+ nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localContextA, localContextB, () => {
116
116
  const verifiedAhead = true;
117
117
 
118
118
  return verifiedAhead;
@@ -128,7 +128,7 @@ export default class Premise {
128
128
  return matchesRuleSubproofNode;
129
129
  }
130
130
 
131
- matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext) {
131
+ matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localContext) {
132
132
  let matchesMetaSubproofNode = false;
133
133
 
134
134
  if (this.metastatementNode !== null) {
@@ -144,12 +144,12 @@ export default class Premise {
144
144
  subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
145
145
 
146
146
  matchesMetaSubproofNode = match(subproofAssertionMetastatementNodes, metaSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
147
- const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
147
+ const metaLevelLocalContext = MetaLevelLocalContext.fromFileContext(fileContext),
148
+ nonTerminalNodeA = subproofAssertionMetastatementNode, ///
148
149
  nonTerminalNodeB = ruleSubproofMetastatementNode, ///
149
- fileContextA = fileContext, ///
150
- localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
151
- localMetaContextB = localMetaContext, ///
152
- nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
150
+ localContextA = metaLevelLocalContext, ///
151
+ localContextB = localContext, ///
152
+ nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localContextA, localContextB, () => {
153
153
  const verifiedAhead = true;
154
154
 
155
155
  return verifiedAhead;
@@ -165,16 +165,16 @@ export default class Premise {
165
165
  return matchesMetaSubproofNode;
166
166
  }
167
167
 
168
- matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
168
+ matchMetastatementNode(metastatementNode, substitutions, fileContext, localContext) {
169
169
  let matchesMetastatementNode = false;
170
170
 
171
171
  if (this.metastatementNode !== null) {
172
- const nonTerminalNodeA = this.metastatementNode, ///
172
+ const metaLevelLocalContext = MetaLevelLocalContext.fromFileContext(fileContext),
173
+ nonTerminalNodeA = this.metastatementNode, ///
173
174
  nonTerminalNodeB = metastatementNode, ///
174
- fileContextA = fileContext, ///
175
- localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
176
- localMetaContextB = localMetaContext, ///
177
- nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
175
+ localContextA = metaLevelLocalContext, ///
176
+ localContextB = localContext, ///
177
+ nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localContextA, localContextB, () => {
178
178
  const verifiedAhead = true;
179
179
 
180
180
  return verifiedAhead;
package/src/rule.js CHANGED
@@ -46,15 +46,15 @@ export default class Rule {
46
46
  return matchesStatement;
47
47
  }
48
48
 
49
- matchMetastatement(metastatementNode, localMetaContext) {
49
+ matchMetastatement(metastatementNode, localContext) {
50
50
  let matchesMetastatement = false;
51
51
 
52
- const metaproofSteps = localMetaContext.getMetaproofSteps(),
52
+ const metaproofSteps = localContext.getMetaproofSteps(),
53
53
  substitutions = [],
54
- premisesMatch = metaMatchPremises(this.premises, metaproofSteps, substitutions, this.fileContext, localMetaContext);
54
+ premisesMatch = metaMatchPremises(this.premises, metaproofSteps, substitutions, this.fileContext, localContext);
55
55
 
56
56
  if (premisesMatch) {
57
- const conclusionMatches = metaMatchConclusion(this.conclusion, metastatementNode, substitutions, this.fileContext, localMetaContext);
57
+ const conclusionMatches = metaMatchConclusion(this.conclusion, metastatementNode, substitutions, this.fileContext, localContext);
58
58
 
59
59
  matchesMetastatement = conclusionMatches; ///
60
60
  }
@@ -187,7 +187,7 @@ function matchConclusion(conclusion, statementNode, substitutions, fileContext,
187
187
  return conclusionMatches;
188
188
  }
189
189
 
190
- function metaMatchPremise(premise, metaproofStep, substitutions, fileContext, localMetaContext) {
190
+ function metaMatchPremise(premise, metaproofStep, substitutions, fileContext, localContext) {
191
191
  let premiseMatches = false;
192
192
 
193
193
  const ruleSubproofNode = metaproofStep.getRuleSubproofNode(),
@@ -195,19 +195,19 @@ function metaMatchPremise(premise, metaproofStep, substitutions, fileContext, lo
195
195
  metastatementNode = metaproofStep.getMetastatementNode()
196
196
 
197
197
  if (ruleSubproofNode !== null) {
198
- const premiseMatchesRuleSubproofNode = premise.matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localMetaContext);
198
+ const premiseMatchesRuleSubproofNode = premise.matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localContext);
199
199
 
200
200
  premiseMatches = premiseMatchesRuleSubproofNode; ///
201
201
  }
202
202
 
203
203
  if (metaSubproofNode !== null) {
204
- const premiseMatchesMetaSubproofNode = premise.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext);
204
+ const premiseMatchesMetaSubproofNode = premise.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localContext);
205
205
 
206
206
  premiseMatches = premiseMatchesMetaSubproofNode; ///
207
207
  }
208
208
 
209
209
  if (metastatementNode !== null) {
210
- const premiseMatchesMetastatementNode = premise.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext);
210
+ const premiseMatchesMetastatementNode = premise.matchMetastatementNode(metastatementNode, substitutions, fileContext, localContext);
211
211
 
212
212
  premiseMatches = premiseMatchesMetastatementNode; ///
213
213
  }
@@ -215,13 +215,13 @@ function metaMatchPremise(premise, metaproofStep, substitutions, fileContext, lo
215
215
  return premiseMatches;
216
216
  }
217
217
 
218
- function metaMatchPremises(premises, metaproofSteps, substitutions, fileContext, localMetaContext) {
218
+ function metaMatchPremises(premises, metaproofSteps, substitutions, fileContext, localContext) {
219
219
  premises = reverse(premises); ///
220
220
 
221
221
  metaproofSteps = reverse(metaproofSteps); ///
222
222
 
223
223
  const premisesMatch = correlate(premises, metaproofSteps, (premise, metaproofStep) => {
224
- const premiseMatches = metaMatchPremise(premise, metaproofStep, substitutions, fileContext, localMetaContext);
224
+ const premiseMatches = metaMatchPremise(premise, metaproofStep, substitutions, fileContext, localContext);
225
225
 
226
226
  if (premiseMatches) {
227
227
  return true;
@@ -231,8 +231,8 @@ function metaMatchPremises(premises, metaproofSteps, substitutions, fileContext,
231
231
  return premisesMatch;
232
232
  }
233
233
 
234
- function metaMatchConclusion(conclusion, metastatementNode, substitutions, fileContext, localMetaContext) {
235
- const conclusionMatchesMetastatementNode = conclusion.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext),
234
+ function metaMatchConclusion(conclusion, metastatementNode, substitutions, fileContext, localContext) {
235
+ const conclusionMatchesMetastatementNode = conclusion.matchMetastatementNode(metastatementNode, substitutions, fileContext, localContext),
236
236
  conclusionMatches = conclusionMatchesMetastatementNode; ///
237
237
 
238
238
  return conclusionMatches;
@@ -13,18 +13,18 @@ const termNodeQuery = nodeQuery("/term!"),
13
13
  nonTerminalNodeQuery = nodeQuery("/*"),
14
14
  metavariableNodeQuery = nodeQuery("/metavariable!");
15
15
 
16
- class MetastatementNodeVerifier extends NodeVerifier {
17
- verifyNonTerminalNode(nonTerminalNode, localMetaContext, verifyAhead) {
16
+ class MetaLevelNodeVerifier extends NodeVerifier {
17
+ verifyNonTerminalNode(nonTerminalNode, localContext, verifyAhead) {
18
18
  let nonTerminalNodeVerified;
19
19
 
20
20
  const nodeQueryMaps = [
21
21
  {
22
22
  nodeQuery: termNodeQuery,
23
- verifyNode: (node, localMetaContext, verifyAhead) => {
23
+ verifyNode: (node, localContext, verifyAhead) => {
24
24
  let nonTerminalNodeVerified;
25
25
 
26
26
  const termNode = node, ///
27
- termNodeVerified = this.verifyTermNode(termNode, localMetaContext, verifyAhead);
27
+ termNodeVerified = this.verifyTermNode(termNode, localContext, verifyAhead);
28
28
 
29
29
  nonTerminalNodeVerified = termNodeVerified; ///
30
30
 
@@ -33,11 +33,11 @@ class MetastatementNodeVerifier extends NodeVerifier {
33
33
  },
34
34
  {
35
35
  nodeQuery: variableNodeQuery,
36
- verifyNode: (node, localMetaContext, verifyAhead) => {
36
+ verifyNode: (node, localContext, verifyAhead) => {
37
37
  let nonTerminalNodeVerified;
38
38
 
39
39
  const variableNode = node, ///
40
- variableNodeVerified = this.verifyVariableNode(variableNode, localMetaContext, verifyAhead);
40
+ variableNodeVerified = this.verifyVariableNode(variableNode, localContext, verifyAhead);
41
41
 
42
42
  nonTerminalNodeVerified = variableNodeVerified; ///
43
43
 
@@ -46,11 +46,11 @@ class MetastatementNodeVerifier extends NodeVerifier {
46
46
  },
47
47
  {
48
48
  nodeQuery: metavariableNodeQuery,
49
- verifyNode: (node, localMetaContext, verifyAhead) => {
49
+ verifyNode: (node, localContext, verifyAhead) => {
50
50
  let nonTerminalNodeVerified;
51
51
 
52
52
  const metavariableNode = node, ///
53
- metavariableNodeVerified = this.verifyMetavariableNode(metavariableNode, localMetaContext, verifyAhead);
53
+ metavariableNodeVerified = this.verifyMetavariableNode(metavariableNode, localContext, verifyAhead);
54
54
 
55
55
  nonTerminalNodeVerified = metavariableNodeVerified; ///
56
56
 
@@ -59,51 +59,49 @@ class MetastatementNodeVerifier extends NodeVerifier {
59
59
  },
60
60
  {
61
61
  nodeQuery: nonTerminalNodeQuery,
62
- verifyNode: (node, localMetaContext, verifyAhead) => {
62
+ verifyNode: (node, localContext, verifyAhead) => {
63
63
  let nonTerminalNodeVerified;
64
64
 
65
65
  const nonTerminalNode = node; ///
66
66
 
67
67
  nonTerminalNodeVerified =
68
68
 
69
- super.verifyNonTerminalNode(nonTerminalNode, localMetaContext, verifyAhead);
69
+ super.verifyNonTerminalNode(nonTerminalNode, localContext, verifyAhead);
70
70
 
71
71
  return nonTerminalNodeVerified;
72
72
  }
73
73
  }
74
74
  ];
75
75
 
76
- const nodeVerified = verifyNode(nodeQueryMaps, nonTerminalNode, localMetaContext, verifyAhead);
76
+ const nodeVerified = verifyNode(nodeQueryMaps, nonTerminalNode, localContext, verifyAhead);
77
77
 
78
78
  nonTerminalNodeVerified = nodeVerified; ///
79
79
 
80
80
  return nonTerminalNodeVerified;
81
81
  }
82
82
 
83
- verifyMetavariableNode(metavariableNode, localMetaContext, verifyAhead) {
84
- const standaloneMetavariableVerified = verifyStandaloneMetavariable(metavariableNode, localMetaContext, verifyAhead),
83
+ verifyMetavariableNode(metavariableNode, localContext, verifyAhead) {
84
+ const standaloneMetavariableVerified = verifyStandaloneMetavariable(metavariableNode, localContext, verifyAhead),
85
85
  metavariableNodeVerified = standaloneMetavariableVerified; ///
86
86
 
87
87
  return metavariableNodeVerified;
88
88
  }
89
89
 
90
- verifyVariableNode(variableNode, localMetaContext, verifyAhead) {
91
- const localContext = localMetaContext, ///
92
- standaloneVariableVerified = verifyStandaloneVariable(variableNode, localContext, verifyAhead),
90
+ verifyVariableNode(variableNode, localContext, verifyAhead) {
91
+ const standaloneVariableVerified = verifyStandaloneVariable(variableNode, localContext, verifyAhead),
93
92
  variableNodeVerified = standaloneVariableVerified; ///
94
93
 
95
94
  return variableNodeVerified;
96
95
  }
97
96
 
98
- verifyTermNode(termNode, localMetaContext, verifyAhead) {
99
- const localContext = localMetaContext, ///
100
- standaloneTermVerified = verifyStandaloneTerm(termNode, localContext, verifyAhead),
97
+ verifyTermNode(termNode, localContext, verifyAhead) {
98
+ const standaloneTermVerified = verifyStandaloneTerm(termNode, localContext, verifyAhead),
101
99
  termNodeVerified = standaloneTermVerified; ///
102
100
 
103
101
  return termNodeVerified;
104
102
  }
105
103
  }
106
104
 
107
- const metastatementNodeVerifier = new MetastatementNodeVerifier();
105
+ const metaLevelNodeVerifier = new MetaLevelNodeVerifier();
108
106
 
109
- export default metastatementNodeVerifier;
107
+ export default metaLevelNodeVerifier;