occam-verify-cli 0.0.909 → 0.0.911

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 (88) hide show
  1. package/lib/axiomLemmaTheoremConjecture.js +6 -6
  2. package/lib/conclusion.js +7 -7
  3. package/lib/consequent.js +3 -3
  4. package/lib/context/file.js +7 -35
  5. package/lib/context/local.js +14 -19
  6. package/lib/context/localMeta.js +16 -21
  7. package/lib/declaration.js +10 -10
  8. package/lib/equivalence.js +15 -15
  9. package/lib/frame.js +5 -5
  10. package/lib/frameAssertion.js +3 -3
  11. package/lib/metaConsequent.js +4 -4
  12. package/lib/metaLemmaMetatheorem.js +10 -10
  13. package/lib/metaSupposition.js +10 -10
  14. package/lib/metaType.js +7 -7
  15. package/lib/metavariable.js +7 -7
  16. package/lib/mixins/nodesVerifier/intrinsiclevel.js +3 -3
  17. package/lib/mixins/nodesVerifier/metaLevel.js +3 -3
  18. package/lib/premise.js +19 -19
  19. package/lib/rule.js +21 -21
  20. package/lib/step/metaproof.js +14 -53
  21. package/lib/step/proof.js +10 -22
  22. package/lib/substitution/metastatementForMetavariable.js +11 -11
  23. package/lib/substitution/statementForMetavariable.js +9 -8
  24. package/lib/substitution/termForVariable.js +9 -9
  25. package/lib/substitution.js +11 -11
  26. package/lib/supposition.js +3 -3
  27. package/lib/type.js +7 -7
  28. package/lib/utilities/match.js +96 -0
  29. package/lib/variable.js +8 -8
  30. package/lib/verify/containedAssertion.js +54 -20
  31. package/lib/verify/definedAssertion.js +67 -33
  32. package/lib/verify/frame.js +2 -2
  33. package/lib/verify/frameAssertion.js +3 -3
  34. package/lib/verify/metaDerivation.js +7 -7
  35. package/lib/verify/metaSubDerivation.js +6 -6
  36. package/lib/verify/metaproofStep.js +98 -0
  37. package/lib/verify/metastatement/unqualified.js +4 -7
  38. package/lib/verify/metastatement.js +35 -6
  39. package/lib/verify/ruleProofStep.js +25 -14
  40. package/lib/verify/statement/unqualified.js +3 -3
  41. package/lib/verify/statement.js +4 -7
  42. package/package.json +2 -2
  43. package/src/axiomLemmaTheoremConjecture.js +6 -6
  44. package/src/conclusion.js +6 -6
  45. package/src/consequent.js +2 -2
  46. package/src/context/file.js +6 -30
  47. package/src/context/local.js +13 -19
  48. package/src/context/localMeta.js +15 -21
  49. package/src/declaration.js +12 -12
  50. package/src/equivalence.js +14 -14
  51. package/src/frame.js +4 -4
  52. package/src/frameAssertion.js +2 -2
  53. package/src/metaConsequent.js +3 -3
  54. package/src/metaLemmaMetatheorem.js +10 -10
  55. package/src/metaSupposition.js +9 -9
  56. package/src/metaType.js +7 -7
  57. package/src/metavariable.js +6 -6
  58. package/src/mixins/nodesVerifier/intrinsiclevel.js +2 -2
  59. package/src/mixins/nodesVerifier/metaLevel.js +2 -2
  60. package/src/premise.js +18 -18
  61. package/src/rule.js +22 -22
  62. package/src/step/metaproof.js +12 -73
  63. package/src/step/proof.js +8 -26
  64. package/src/substitution/metastatementForMetavariable.js +10 -10
  65. package/src/substitution/statementForMetavariable.js +6 -4
  66. package/src/substitution/termForVariable.js +8 -8
  67. package/src/substitution.js +10 -10
  68. package/src/supposition.js +2 -2
  69. package/src/type.js +7 -7
  70. package/src/utilities/match.js +100 -0
  71. package/src/variable.js +11 -11
  72. package/src/verify/containedAssertion.js +76 -27
  73. package/src/verify/definedAssertion.js +90 -41
  74. package/src/verify/frame.js +1 -1
  75. package/src/verify/frameAssertion.js +2 -2
  76. package/src/verify/metaDerivation.js +6 -6
  77. package/src/verify/metaSubDerivation.js +6 -6
  78. package/src/verify/{metaProofStep.js → metaproofStep.js} +60 -19
  79. package/src/verify/metastatement/unqualified.js +3 -7
  80. package/src/verify/metastatement.js +46 -5
  81. package/src/verify/ruleProofStep.js +22 -1
  82. package/src/verify/statement/unqualified.js +2 -2
  83. package/src/verify/statement.js +2 -6
  84. package/lib/utilities/metaproof.js +0 -59
  85. package/lib/utilities/proof.js +0 -59
  86. package/lib/verify/metaProofStep.js +0 -76
  87. package/src/utilities/metaproof.js +0 -53
  88. package/src/utilities/proof.js +0 -53
@@ -37,13 +37,13 @@ export default class Metavariable {
37
37
  }
38
38
 
39
39
  matchName(name) {
40
- const nameMatches = (this.name === name);
40
+ const matchesName = (this.name === name);
41
41
 
42
- return nameMatches;
42
+ return matchesName;
43
43
  }
44
44
 
45
45
  matchNode(node, localMetaContext) {
46
- let nodeMatches = false;
46
+ let matchesNode = false;
47
47
 
48
48
  const metavariableNode = node, ///
49
49
  typeNode = typeNodeQuery(metavariableNode);
@@ -57,16 +57,16 @@ export default class Metavariable {
57
57
  if (false) {
58
58
  ///
59
59
  } else if ((termNode === null) && (this.termType === null)) {
60
- nodeMatches = true;
60
+ matchesNode = true;
61
61
  } else if ((termNode !== null) && (this.termType !== null)) {
62
62
  const termVerifiedAgainstTermType = verifyTermAgainstTermType(termNode, this.termType, localMetaContext);
63
63
 
64
- nodeMatches = termVerifiedAgainstTermType; ///
64
+ matchesNode = termVerifiedAgainstTermType; ///
65
65
  }
66
66
  }
67
67
  }
68
68
 
69
- return nodeMatches;
69
+ return matchesNode;
70
70
  }
71
71
 
72
72
  toJSON(tokens) {
@@ -18,9 +18,9 @@ function verifyVariableNode(variableNodeA, termNodeB, substitutions, localContex
18
18
 
19
19
  if (substitution !== null) {
20
20
  const termNode = termNodeB, ///
21
- termNodeMatches = substitution.matchTermNode(termNode);
21
+ substitutionMatchesTermNode = substitution.matchTermNode(termNode);
22
22
 
23
- if (termNodeMatches) {
23
+ if (substitutionMatchesTermNode) {
24
24
  const verifiedAhead = verifyAhead();
25
25
 
26
26
  variableNodeVerified = verifiedAhead; ///
@@ -15,9 +15,9 @@ function verifyMetavariableNode(metavariableNodeA, metastatementNodeB, substitut
15
15
 
16
16
  if (substitution !== null) {
17
17
  const metastatementNode = metastatementNodeB, ///
18
- metastatementNodeMatches = substitution.matchMetastatementNode(metastatementNode);
18
+ substitutionMetastatementNode = substitution.matchMetastatementNode(metastatementNode);
19
19
 
20
- metavariableNodeVerified = metastatementNodeMatches; ///
20
+ metavariableNodeVerified = substitutionMetastatementNode; ///
21
21
  } else {
22
22
  const metavariableNode = metavariableNodeA, ///
23
23
  metastatementNode = metastatementNodeB, ///
package/src/premise.js CHANGED
@@ -17,7 +17,7 @@ const subproofAssertionNodeQuery = nodeQuery("/metastatement/subproofAssertion!"
17
17
  ruleSubproofPremiseMetastatementNodesQuery = nodesQuery("/ruleSubproof/premise/unqualifiedMetastatement!/metastatement!"),
18
18
  metaSubproofMetaSuppositionMetastatementNodesQuery = nodesQuery("/metaSubproof/metaSupposition/unqualifiedMetastatement!/metastatement!"),
19
19
  ruleSubproofLastRuleProofStepMetastatementNodeQuery = nodeQuery("/ruleSubproof/ruleSubDerivation/lastRuleProofStep/unqualifiedMetastatement|qualifiedMetastatement/metastatement!"),
20
- metaSubproofLastMetaProofStepMetastatementNodeQuery = nodeQuery("/metaSubproof/metaSubDerivation/lastMetaProofStep/unqualifiedMetastatement|qualifiedMetastatement/metastatement!");
20
+ metaSubproofLastMetaproofStepMetastatementNodeQuery = nodeQuery("/metaSubproof/metaSubDerivation/lastMetaproofStep/unqualifiedMetastatement|qualifiedMetastatement/metastatement!");
21
21
 
22
22
  export default class Premise {
23
23
  constructor(metastatementNode, statementNode) {
@@ -34,7 +34,7 @@ export default class Premise {
34
34
  }
35
35
 
36
36
  matchStatementNode(statementNode, substitutions, fileContext, localContext) {
37
- let statementNodeMatches = false;
37
+ let matchesStatementNode = false;
38
38
 
39
39
  if (this.metastatementNode !== null) {
40
40
  const nonTerminalNodeA = this.metastatementNode, ///
@@ -48,14 +48,14 @@ export default class Premise {
48
48
  return verifiedAhead;
49
49
  });
50
50
 
51
- statementNodeMatches = nonTerminalNodeVerified; ///
51
+ matchesStatementNode = nonTerminalNodeVerified; ///
52
52
  }
53
53
 
54
- return statementNodeMatches;
54
+ return matchesStatementNode;
55
55
  }
56
56
 
57
57
  matchSubproofNode(subproofNode, substitutions, fileContext, localContext) {
58
- let subproofNodeMatches = false;
58
+ let matchesSubproofNode = false;
59
59
 
60
60
  if (this.metastatementNode !== null) {
61
61
  const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
@@ -69,7 +69,7 @@ export default class Premise {
69
69
  ],
70
70
  subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
71
71
 
72
- subproofNodeMatches = match(subproofAssertionMetastatementNodes, subproofStatementNodes, (subproofAssertionMetastatementNode, subproofStatementNode) => {
72
+ matchesSubproofNode = match(subproofAssertionMetastatementNodes, subproofStatementNodes, (subproofAssertionMetastatementNode, subproofStatementNode) => {
73
73
  const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
74
74
  nonTerminalNodeB = subproofStatementNode, ///
75
75
  fileContextA = fileContext, ///
@@ -88,11 +88,11 @@ export default class Premise {
88
88
  }
89
89
  }
90
90
 
91
- return subproofNodeMatches;
91
+ return matchesSubproofNode;
92
92
  }
93
93
 
94
94
  matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localMetaContext) {
95
- let ruleSubproofNodeMatches = false;
95
+ let matchesRuleSubproofNode = false;
96
96
 
97
97
  if (this.metastatementNode !== null) {
98
98
  const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
@@ -106,7 +106,7 @@ export default class Premise {
106
106
  ],
107
107
  subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
108
108
 
109
- ruleSubproofNodeMatches = match(subproofAssertionMetastatementNodes, ruleSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
109
+ matchesRuleSubproofNode = match(subproofAssertionMetastatementNodes, ruleSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
110
110
  const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
111
111
  nonTerminalNodeB = ruleSubproofMetastatementNode, ///
112
112
  fileContextA = fileContext, ///
@@ -125,25 +125,25 @@ export default class Premise {
125
125
  }
126
126
  }
127
127
 
128
- return ruleSubproofNodeMatches;
128
+ return matchesRuleSubproofNode;
129
129
  }
130
130
 
131
131
  matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext) {
132
- let metaSubproofNodeMatches = false;
132
+ let matchesMetaSubproofNode = false;
133
133
 
134
134
  if (this.metastatementNode !== null) {
135
135
  const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
136
136
 
137
137
  if (subproofAssertionNode !== null) {
138
138
  const metaSubproofMetaSuppositionMetastatementNodes = metaSubproofMetaSuppositionMetastatementNodesQuery(metaSubproofNode),
139
- metaSubproofLastMetaProofStepMetastatementNode = metaSubproofLastMetaProofStepMetastatementNodeQuery(metaSubproofNode),
139
+ metaSubproofLastMetaproofStepMetastatementNode = metaSubproofLastMetaproofStepMetastatementNodeQuery(metaSubproofNode),
140
140
  metaSubproofMetastatementNodes = [
141
141
  ...metaSubproofMetaSuppositionMetastatementNodes,
142
- metaSubproofLastMetaProofStepMetastatementNode
142
+ metaSubproofLastMetaproofStepMetastatementNode
143
143
  ],
144
144
  subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
145
145
 
146
- metaSubproofNodeMatches = match(subproofAssertionMetastatementNodes, metaSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
146
+ matchesMetaSubproofNode = match(subproofAssertionMetastatementNodes, metaSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
147
147
  const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
148
148
  nonTerminalNodeB = ruleSubproofMetastatementNode, ///
149
149
  fileContextA = fileContext, ///
@@ -162,11 +162,11 @@ export default class Premise {
162
162
  }
163
163
  }
164
164
 
165
- return metaSubproofNodeMatches;
165
+ return matchesMetaSubproofNode;
166
166
  }
167
167
 
168
168
  matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
169
- let metastatementNodeMatches = false;
169
+ let matchesMetastatementNode = false;
170
170
 
171
171
  if (this.metastatementNode !== null) {
172
172
  const nonTerminalNodeA = this.metastatementNode, ///
@@ -180,10 +180,10 @@ export default class Premise {
180
180
  return verifiedAhead;
181
181
  });
182
182
 
183
- metastatementNodeMatches = nonTerminalNodeVerified; ///
183
+ matchesMetastatementNode = nonTerminalNodeVerified; ///
184
184
  }
185
185
 
186
- return metastatementNodeMatches;
186
+ return matchesMetastatementNode;
187
187
  }
188
188
 
189
189
  toJSON(tokens) {
package/src/rule.js CHANGED
@@ -31,7 +31,7 @@ export default class Rule {
31
31
  }
32
32
 
33
33
  matchStatement(statementNode, localContext) {
34
- let statementNatches = false;
34
+ let matchesStatement = false;
35
35
 
36
36
  const proofSteps = localContext.getProofSteps(),
37
37
  substitutions = [],
@@ -40,14 +40,14 @@ export default class Rule {
40
40
  if (premisesMatch) {
41
41
  const conclusionMatches = matchConclusion(this.conclusion, statementNode, substitutions, this.fileContext, localContext);
42
42
 
43
- statementNatches = conclusionMatches; ///
43
+ matchesStatement = conclusionMatches; ///
44
44
  }
45
45
 
46
- return statementNatches;
46
+ return matchesStatement;
47
47
  }
48
48
 
49
49
  matchMetastatement(metastatementNode, localMetaContext) {
50
- let metastatementNatches = false;
50
+ let matchesMetastatement = false;
51
51
 
52
52
  const metaproofSteps = localMetaContext.getMetaproofSteps(),
53
53
  substitutions = [],
@@ -56,14 +56,14 @@ export default class Rule {
56
56
  if (premisesMatch) {
57
57
  const conclusionMatches = metaMatchConclusion(this.conclusion, metastatementNode, substitutions, this.fileContext, localMetaContext);
58
58
 
59
- metastatementNatches = conclusionMatches; ///
59
+ matchesMetastatement = conclusionMatches; ///
60
60
  }
61
61
 
62
- return metastatementNatches;
62
+ return matchesMetastatement;
63
63
  }
64
64
 
65
65
  matchMetavariableNode(metavariableNode) {
66
- const metavariableNodeMatches = this.labels.some((label) => {
66
+ const matchesMetavariableNode = this.labels.some((label) => {
67
67
  const labelMatchesMetavariableNode = label.matchMetavariableNode(metavariableNode);
68
68
 
69
69
  if (labelMatchesMetavariableNode) {
@@ -71,7 +71,7 @@ export default class Rule {
71
71
  }
72
72
  });
73
73
 
74
- return metavariableNodeMatches;
74
+ return matchesMetavariableNode;
75
75
  }
76
76
 
77
77
  toJSON(tokens) {
@@ -150,15 +150,15 @@ function matchPremise(premise, proofStep, substitutions, fileContext, localConte
150
150
  statementNode = proofStep.getStatementNode();
151
151
 
152
152
  if (subproofNode !== null) {
153
- const subproofNodeMatches = premise.matchSubproofNode(subproofNode, substitutions, fileContext, localContext);
153
+ const premiseMatchesSubproofNode = premise.matchSubproofNode(subproofNode, substitutions, fileContext, localContext);
154
154
 
155
- premiseMatches = subproofNodeMatches; ///
155
+ premiseMatches = premiseMatchesSubproofNode; ///
156
156
  }
157
157
 
158
158
  if (statementNode !== null) {
159
- const statementNodeMatches = premise.matchStatementNode(statementNode, substitutions, fileContext, localContext);
159
+ const premiseMatchesStatementNode = premise.matchStatementNode(statementNode, substitutions, fileContext, localContext);
160
160
 
161
- premiseMatches = statementNodeMatches; ///
161
+ premiseMatches = premiseMatchesStatementNode; ///
162
162
  }
163
163
 
164
164
  return premiseMatches;
@@ -181,8 +181,8 @@ function matchPremises(premises, proofSteps, substitutions, fileContext, localCo
181
181
  }
182
182
 
183
183
  function matchConclusion(conclusion, statementNode, substitutions, fileContext, localContext) {
184
- const statementNodeMatches = conclusion.matchStatementNode(statementNode, substitutions, fileContext, localContext),
185
- conclusionMatches = statementNodeMatches; ///
184
+ const conclusionMatchesStatementNode = conclusion.matchStatementNode(statementNode, substitutions, fileContext, localContext),
185
+ conclusionMatches = conclusionMatchesStatementNode; ///
186
186
 
187
187
  return conclusionMatches;
188
188
  }
@@ -195,21 +195,21 @@ function metaMatchPremise(premise, metaproofStep, substitutions, fileContext, lo
195
195
  metastatementNode = metaproofStep.getMetastatementNode()
196
196
 
197
197
  if (ruleSubproofNode !== null) {
198
- const ruleSubProofNodeMatches = premise.matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localMetaContext);
198
+ const premiseMatchesRuleSubproofNode = premise.matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localMetaContext);
199
199
 
200
- premiseMatches = ruleSubProofNodeMatches; ///
200
+ premiseMatches = premiseMatchesRuleSubproofNode; ///
201
201
  }
202
202
 
203
203
  if (metaSubproofNode !== null) {
204
- const metaSubProofNodeMatches = premise.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext);
204
+ const premiseMatchesMetaSubproofNode = premise.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext);
205
205
 
206
- premiseMatches = metaSubProofNodeMatches; ///
206
+ premiseMatches = premiseMatchesMetaSubproofNode; ///
207
207
  }
208
208
 
209
209
  if (metastatementNode !== null) {
210
- const metastatementNodeMatches = premise.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext);
210
+ const premiseMatchesMetastatementNode = premise.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext);
211
211
 
212
- premiseMatches = metastatementNodeMatches; ///
212
+ premiseMatches = premiseMatchesMetastatementNode; ///
213
213
  }
214
214
 
215
215
  return premiseMatches;
@@ -232,8 +232,8 @@ function metaMatchPremises(premises, metaproofSteps, substitutions, fileContext,
232
232
  }
233
233
 
234
234
  function metaMatchConclusion(conclusion, metastatementNode, substitutions, fileContext, localMetaContext) {
235
- const metastatementNodeMatches = conclusion.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext),
236
- conclusionMatches = metastatementNodeMatches; ///
235
+ const conclusionMatchesMetastatementNode = conclusion.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext),
236
+ conclusionMatches = conclusionMatchesMetastatementNode; ///
237
237
 
238
238
  return conclusionMatches;
239
239
  }
@@ -1,13 +1,5 @@
1
1
  "use strict";
2
2
 
3
- import { first, second } from "../utilities/array";
4
- import { matchMetastatement } from "../utilities/metaproof";
5
- import { nodeQuery, nodesQuery } from "../utilities/query";
6
-
7
- const metastatementNodesQuery = nodesQuery("/subproofAssertion/metastatement"),
8
- ruleSubproofAssertionNodeQuery = nodeQuery("/metastatement/subproofAssertion"),
9
- qualifiedOrUnqualifiedMetastatementMetastatementNodesQuery = nodesQuery("/ruleSubproof/qualifiedMetastatement|unqualifiedMetastatement/metastatement!");
10
-
11
3
  export default class MetaproofStep {
12
4
  constructor(statementNode, ruleSubproofNode, metaSubproofNode, metastatementNode) {
13
5
  this.statementNode = statementNode;
@@ -32,94 +24,41 @@ export default class MetaproofStep {
32
24
  return this.metastatementNode;
33
25
  }
34
26
 
35
- match(metastatementNode) {
36
- let matches = false;
37
-
38
- if (!matches) {
39
- const ruleSubproofAssertionNode = ruleSubproofAssertionNodeQuery(metastatementNode);
40
-
41
- if (ruleSubproofAssertionNode !== null) {
42
- const ruleSubproofAssertionMatches = this.matchRuleSubproofAssertion(ruleSubproofAssertionNode);
43
-
44
- matches = ruleSubproofAssertionMatches; ///
45
- }
46
- }
47
-
48
- if (!matches) {
49
- const metastatementMatches = this.matchMetastatement(metastatementNode);
50
-
51
- matches = metastatementMatches; ///
52
- }
53
-
54
- return matches;
55
- }
56
-
57
- matchMetastatement(metastatementNode) {
58
- let metastatementMatches = false;
27
+ matchMetastatementNode(metastatementNode) {
28
+ let matchesMetastatementNode = false;
59
29
 
60
30
  if (this.metastatementNode !== null) {
61
- const metastatementNodeA = metastatementNode, ///
62
- metastatementNodeB = this.metastatementNode; ///
63
-
64
- metastatementMatches = matchMetastatement(metastatementNodeA, metastatementNodeB);
65
- }
66
-
67
- return metastatementMatches;
68
- }
69
-
70
- matchRuleSubproofAssertion(ruleSubproofAssertionNode) {
71
- let ruleSubproofAssertionMatches = false;
72
-
73
- if (this.ruleSubproofNode !== null) {
74
- const ruleSubproofAssertionMetastatementNodes = metastatementNodesQuery(ruleSubproofAssertionNode),
75
- firstRuleSubproofAssertionMetastatementNode = first(ruleSubproofAssertionMetastatementNodes),
76
- qualifiedOrUnqualifiedMetastatementMetastatementNodes = qualifiedOrUnqualifiedMetastatementMetastatementNodesQuery(this.ruleSubproofNode),
77
- firstQualifiedOrUnqualifiedMetastatementMetastatementNode = first(qualifiedOrUnqualifiedMetastatementMetastatementNodes);
78
-
79
- const metastatementNodeA = firstRuleSubproofAssertionMetastatementNode, ///
80
- metastatementNodeB = firstQualifiedOrUnqualifiedMetastatementMetastatementNode, ///
81
- metastatementMatches = matchMetastatement(metastatementNodeA, metastatementNodeB);
82
-
83
- if (metastatementMatches) {
84
- const secondRuleSubproofAssertionMetastatementNode = second(ruleSubproofAssertionMetastatementNodes),
85
- secondQualifiedOrUnqualifiedMetastatementMetastatementNode = second(qualifiedOrUnqualifiedMetastatementMetastatementNodes);
86
-
87
- const metastatementNodeA = secondRuleSubproofAssertionMetastatementNode, ///
88
- metastatementNodeB = secondQualifiedOrUnqualifiedMetastatementMetastatementNode, ///
89
- metastatementMatches = matchMetastatement(metastatementNodeA, metastatementNodeB);
90
-
91
- ruleSubproofAssertionMatches = metastatementMatches; ///
92
- }
31
+ matchesMetastatementNode = this.metastatementNode.match(metastatementNode);
93
32
  }
94
33
 
95
- return ruleSubproofAssertionMatches;
34
+ return matchesMetastatementNode;
96
35
  }
97
36
 
98
37
  static fromStatementNode(statementNode) {
99
38
  const ruleSubproofNode = null,
100
39
  metaSubproofNode = null,
101
40
  metastatementNode = null,
102
- metaProofStep = new MetaproofStep(statementNode, ruleSubproofNode, metaSubproofNode, metastatementNode);
41
+ metaproofStep = new MetaproofStep(statementNode, ruleSubproofNode, metaSubproofNode, metastatementNode);
103
42
 
104
- return metaProofStep;
43
+ return metaproofStep;
105
44
  }
106
45
 
107
46
  static fromRuleSubproofNode(ruleSubproofNode) {
108
47
  const statementNode = null,
109
48
  metaSubproofNode = null,
110
49
  metastatementNode = null,
111
- metaProofStep = new MetaproofStep(statementNode, ruleSubproofNode, metaSubproofNode, metastatementNode);
50
+ metaproofStep = new MetaproofStep(statementNode, ruleSubproofNode, metaSubproofNode, metastatementNode);
112
51
 
113
- return metaProofStep;
52
+ return metaproofStep;
114
53
  }
115
54
 
116
55
  static fromMetaSubproofNode(metaSubproofNode) {
117
56
  const statementNode = null,
118
57
  ruleSubproofNode = null,
119
58
  metastatementNode = null,
120
- metaProofStep = new MetaproofStep(statementNode, ruleSubproofNode, metaSubproofNode, metastatementNode);
59
+ metaproofStep = new MetaproofStep(statementNode, ruleSubproofNode, metaSubproofNode, metastatementNode);
121
60
 
122
- return metaProofStep;
61
+ return metaproofStep;
123
62
 
124
63
  }
125
64
 
@@ -127,8 +66,8 @@ export default class MetaproofStep {
127
66
  const statementNode = null,
128
67
  ruleSubproofNode = null,
129
68
  metaSubproofNode = null,
130
- metaProofStep = new MetaproofStep(statementNode, ruleSubproofNode, metaSubproofNode, metastatementNode);
69
+ metaproofStep = new MetaproofStep(statementNode, ruleSubproofNode, metaSubproofNode, metastatementNode);
131
70
 
132
- return metaProofStep;
71
+ return metaproofStep;
133
72
  }
134
73
  }
package/src/step/proof.js CHANGED
@@ -1,8 +1,5 @@
1
1
  "use strict";
2
2
 
3
- import { META_ARGUMENT_RULE_NAME } from "../ruleNames";
4
- import { matchStatementModuloBrackets } from "../utilities/proof";
5
-
6
3
  export default class ProofStep {
7
4
  constructor(subproofNode, statementNode) {
8
5
  this.subproofNode = subproofNode;
@@ -17,42 +14,27 @@ export default class ProofStep {
17
14
  return this.statementNode;
18
15
  }
19
16
 
20
- match(statementNode) {
21
- let matches;
22
-
23
- const statementMatches = this.matchStatement(statementNode);
24
-
25
- matches = statementMatches; //
26
-
27
- return matches;
28
- }
29
-
30
- matchStatement(statementNode) {
31
- let statementMatches = false;
17
+ matchStatementNode(statementNode) {
18
+ let matchesStatementNode = false;
32
19
 
33
20
  if (this.statementNode !== null) {
34
- const ruleName = META_ARGUMENT_RULE_NAME,
35
- statementNodeA = statementNode, ///
36
- statementNodeB = this.statementNode, ///
37
- statementMatchesModuloBrackets = matchStatementModuloBrackets(statementNodeA, statementNodeB, ruleName);
38
-
39
- statementMatches = statementMatchesModuloBrackets; ///
21
+ matchesStatementNode = this.statementNode.match(statementNode);
40
22
  }
41
23
 
42
- return statementMatches;
24
+ return matchesStatementNode;
43
25
  }
44
26
 
45
27
  static fromSubproofNode(subproofNode) {
46
28
  const statementNode = null,
47
- metaProofStep = new ProofStep(subproofNode, statementNode);
29
+ proofStep = new ProofStep(subproofNode, statementNode);
48
30
 
49
- return metaProofStep;
31
+ return proofStep;
50
32
  }
51
33
 
52
34
  static fromStatementNode(statementNode) {
53
35
  const subproofNode = null,
54
- metaProofStep = new ProofStep(subproofNode, statementNode);
36
+ proofStep = new ProofStep(subproofNode, statementNode);
55
37
 
56
- return metaProofStep;
38
+ return proofStep;
57
39
  }
58
40
  }
@@ -2,9 +2,9 @@
2
2
 
3
3
  import Substitution from "../substitution";
4
4
 
5
- import { bracketedMetastatementChildNodeFromMetastatementNode } from "../utilities/metaproof";
6
- import {nodeAsString} from "../utilities/string";
7
- import {metastatementNodeFromMetastatementString, metavariableNodeFromMetavariableString} from "../utilities/node";
5
+ import { nodeAsString } from "../utilities/string";
6
+ import { bracketedMetastatementChildNodeFromMetastatementNode } from "../utilities/match";
7
+ import { metavariableNodeFromMetavariableString, metastatementNodeFromMetastatementString } from "../utilities/node";
8
8
 
9
9
  export default class MetastatementForMetavariableSubstitution extends Substitution {
10
10
  constructor(metavariableNode, metastatementNode) {
@@ -23,27 +23,27 @@ export default class MetastatementForMetavariableSubstitution extends Substituti
23
23
  }
24
24
 
25
25
  matchMetavariableNode(metavariableNode) {
26
- const metavariableNodeMatches = this.metavariableNode.match(metavariableNode);
26
+ const matchesMetavariableNode = this.metavariableNode.match(metavariableNode);
27
27
 
28
- return metavariableNodeMatches;
28
+ return matchesMetavariableNode;
29
29
  }
30
30
 
31
31
  matchMetastatementNode(metastatementNode) {
32
- let metastatementNodeMatches;
32
+ let matchesMetastatementNode;
33
33
 
34
- metastatementNodeMatches = this.metastatementNode.match(metastatementNode)
34
+ matchesMetastatementNode = this.metastatementNode.match(metastatementNode)
35
35
 
36
- if (!metastatementNodeMatches) {
36
+ if (!matchesMetastatementNode) {
37
37
  const bracketedMetastatementChildNode = bracketedMetastatementChildNodeFromMetastatementNode(metastatementNode);
38
38
 
39
39
  if (bracketedMetastatementChildNode !== null) {
40
40
  const metastatementNode = bracketedMetastatementChildNode; ///
41
41
 
42
- metastatementNodeMatches = this.metastatementNode.match(metastatementNode);
42
+ matchesMetastatementNode = this.metastatementNode.match(metastatementNode);
43
43
  }
44
44
  }
45
45
 
46
- return metastatementNodeMatches;
46
+ return matchesMetastatementNode;
47
47
  }
48
48
 
49
49
  toJSON(tokens) {
@@ -4,7 +4,7 @@ import Substitution from "../substitution";
4
4
  import TermForVariableSubstitution from "./termForVariable";
5
5
  import verifyStatementAgainstStatement from "../verify/statementAtainstStatement";
6
6
 
7
- import { bracketedStatementChildNodeFromStatementNode } from "../utilities/proof";
7
+ import { bracketedStatementChildNodeFromStatementNode } from "../utilities/match";
8
8
 
9
9
  export default class StatementForMetavariableSubstitution extends Substitution {
10
10
  constructor(metavariableNode, statementNode, substitution) {
@@ -50,9 +50,9 @@ export default class StatementForMetavariableSubstitution extends Substitution {
50
50
  }
51
51
 
52
52
  matchMetavariableNode(metavariableNode) {
53
- const metavariableNodeMatches = this.metavariableNode.match(metavariableNode);
53
+ const matchesMetavariableNode = this.metavariableNode.match(metavariableNode);
54
54
 
55
- return metavariableNodeMatches;
55
+ return matchesMetavariableNode;
56
56
  }
57
57
 
58
58
  static fromMetavariableNodeAndStatementNode(metavariableNode, statementNode) {
@@ -102,7 +102,9 @@ function matchStatementNode(statementNodeA, statementNodeB, substitution, substi
102
102
  let statementNodeMatches;
103
103
 
104
104
  if (substitution === null) {
105
- statementNodeMatches = statementNodeB.match(statementNodeA);
105
+ const statementNodeAMatchesStatementNodeB = statementNodeB.match(statementNodeA);
106
+
107
+ statementNodeMatches = statementNodeAMatchesStatementNodeB; ///
106
108
  } else {
107
109
  const statementVerifiedAgainstStatement = verifyStatementAgainstStatement(statementNodeA, statementNodeB, substitution, substitutions, localContextA, localContextB);
108
110
 
@@ -34,15 +34,15 @@ export default class TermForVariableSubstitution extends Substitution {
34
34
  }
35
35
 
36
36
  matchTermNode(termNode) {
37
- const termNodeMatches = this.termNode.match(termNode);
37
+ const matchesTermNode = this.termNode.match(termNode);
38
38
 
39
- return termNodeMatches;
39
+ return matchesTermNode;
40
40
  }
41
41
 
42
42
  matchVariableNode(variableNode) {
43
- const variableNodeMatches = this.variableNode.match(variableNode);
43
+ const matchesVariableNode = this.variableNode.match(variableNode);
44
44
 
45
- return variableNodeMatches;
45
+ return matchesVariableNode;
46
46
  }
47
47
 
48
48
  static fromSubstitutionNode(substitutionNode) {
@@ -91,9 +91,9 @@ function substituteTermNode(termNode, substitutions) {
91
91
 
92
92
  if (termVariableNode !== null) {
93
93
  substitutions.some((substitution) => {
94
- const variableNodeMatches = substitution.matchVariableNode(termVariableNode);
94
+ const substitutionMatchesVariableNode = substitution.matchVariableNode(termVariableNode);
95
95
 
96
- if (variableNodeMatches) {
96
+ if (substitutionMatchesVariableNode) {
97
97
  termNode = substitution.getTermNode(); ///
98
98
 
99
99
  return true;
@@ -106,9 +106,9 @@ function substituteTermNode(termNode, substitutions) {
106
106
 
107
107
  function substituteVariableNode(variableNode, substitutions) {
108
108
  substitutions.some((substitution) => {
109
- const variableNodeMatches = substitution.matchVariableNode(variableNode);
109
+ const substitutionMatchesVariableNode = substitution.matchVariableNode(variableNode);
110
110
 
111
- if (variableNodeMatches) {
111
+ if (substitutionMatchesVariableNode) {
112
112
  const termNode = substitution.getTermNode(),
113
113
  termVariableNode = variableNodeQuery(termNode);
114
114
 
@@ -2,32 +2,32 @@
2
2
 
3
3
  export default class Substitution {
4
4
  matchTermNode(termNode) {
5
- const termNodeMatches = false;
5
+ const matchesTermNode = false;
6
6
 
7
- return termNodeMatches;
7
+ return matchesTermNode;
8
8
  }
9
9
 
10
10
  matchVariableNode(variableNode) {
11
- const variableNodeMatches = false;
11
+ const matchesMetavariableNode = false;
12
12
 
13
- return variableNodeMatches;
13
+ return matchesMetavariableNode;
14
14
  }
15
15
 
16
16
  matchStatementNode(statementNode) {
17
- const statementNodeMatches = false;
17
+ const matchesStatementNode = false;
18
18
 
19
- return statementNodeMatches;
19
+ return matchesStatementNode;
20
20
  }
21
21
 
22
22
  matchMetavariableNode(metavariableNode) {
23
- const metavariableNodeMatches = false;
23
+ const matchesMetavariableNode = false;
24
24
 
25
- return metavariableNodeMatches;
25
+ return matchesMetavariableNode;
26
26
  }
27
27
 
28
28
  matchMetastatementNode(metastatementNode) {
29
- const metastatementNodeMatches = false;
29
+ const matchesMetastatementNode = false;
30
30
 
31
- return metastatementNodeMatches;
31
+ return matchesMetastatementNode;
32
32
  }
33
33
  }