occam-verify-cli 0.0.910 → 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 (79) 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 -7
  5. package/lib/context/local.js +9 -9
  6. package/lib/context/localMeta.js +11 -11
  7. package/lib/declaration.js +9 -9
  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 +7 -7
  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 +16 -16
  19. package/lib/rule.js +21 -21
  20. package/lib/step/metaproof.js +6 -6
  21. package/lib/step/proof.js +6 -6
  22. package/lib/substitution/metastatementForMetavariable.js +8 -8
  23. package/lib/substitution/statementForMetavariable.js +5 -4
  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 +3 -3
  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/metaproofStep.js +37 -15
  35. package/lib/verify/metastatement/unqualified.js +3 -3
  36. package/lib/verify/metastatement.js +35 -6
  37. package/lib/verify/ruleProofStep.js +25 -14
  38. package/lib/verify/statement/unqualified.js +3 -3
  39. package/lib/verify/statement.js +4 -7
  40. package/package.json +2 -2
  41. package/src/axiomLemmaTheoremConjecture.js +6 -6
  42. package/src/conclusion.js +6 -6
  43. package/src/consequent.js +2 -2
  44. package/src/context/file.js +6 -6
  45. package/src/context/local.js +7 -7
  46. package/src/context/localMeta.js +9 -9
  47. package/src/declaration.js +10 -10
  48. package/src/equivalence.js +14 -14
  49. package/src/frame.js +4 -4
  50. package/src/frameAssertion.js +2 -2
  51. package/src/metaConsequent.js +3 -3
  52. package/src/metaLemmaMetatheorem.js +10 -10
  53. package/src/metaSupposition.js +6 -6
  54. package/src/metaType.js +7 -7
  55. package/src/metavariable.js +6 -6
  56. package/src/mixins/nodesVerifier/intrinsiclevel.js +2 -2
  57. package/src/mixins/nodesVerifier/metaLevel.js +2 -2
  58. package/src/premise.js +15 -15
  59. package/src/rule.js +22 -22
  60. package/src/step/metaproof.js +4 -4
  61. package/src/step/proof.js +4 -4
  62. package/src/substitution/metastatementForMetavariable.js +7 -7
  63. package/src/substitution/statementForMetavariable.js +5 -3
  64. package/src/substitution/termForVariable.js +8 -8
  65. package/src/substitution.js +10 -10
  66. package/src/supposition.js +2 -2
  67. package/src/type.js +7 -7
  68. package/src/utilities/match.js +2 -2
  69. package/src/variable.js +11 -11
  70. package/src/verify/containedAssertion.js +76 -27
  71. package/src/verify/definedAssertion.js +90 -41
  72. package/src/verify/frame.js +1 -1
  73. package/src/verify/frameAssertion.js +2 -2
  74. package/src/verify/metaproofStep.js +43 -2
  75. package/src/verify/metastatement/unqualified.js +2 -2
  76. package/src/verify/metastatement.js +46 -5
  77. package/src/verify/ruleProofStep.js +22 -1
  78. package/src/verify/statement/unqualified.js +2 -2
  79. package/src/verify/statement.js +2 -6
@@ -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
  }
@@ -24,9 +24,9 @@ export default class Supposition {
24
24
 
25
25
  return verifiedAhead;
26
26
  }),
27
- statementNodeMatches = nonTerminalNodeVerified; ///
27
+ matchesStatementNode = nonTerminalNodeVerified; ///
28
28
 
29
- return statementNodeMatches;
29
+ return matchesStatementNode;
30
30
  }
31
31
 
32
32
  toJSON(tokens) {
package/src/type.js CHANGED
@@ -92,23 +92,23 @@ export default class Type {
92
92
  }
93
93
 
94
94
  matchName(name) {
95
- const nameMatches = (this.name === name);
95
+ const matchesName = (this.name === name);
96
96
 
97
- return nameMatches;
97
+ return matchesName;
98
98
  }
99
99
 
100
100
  matchTypeName(typeName) {
101
- const typeNameMatches = (this.name === typeName);
101
+ const matchesTypeName = (this.name === typeName);
102
102
 
103
- return typeNameMatches;
103
+ return matchesTypeName;
104
104
  }
105
105
 
106
106
  matchTypeNode(typeNode) {
107
107
  const typeName = typeNameFromTypeNode(typeNode),
108
- typeNameMatches = this.matchTypeName(typeName),
109
- typeNodeMatches = typeNameMatches; ///
108
+ matchesTypeName = this.matchTypeName(typeName),
109
+ matchesTypeNode = matchesTypeName; ///
110
110
 
111
- return typeNodeMatches;
111
+ return matchesTypeNode;
112
112
  }
113
113
 
114
114
  asString(tokens, noSuperType = false) {
@@ -13,9 +13,9 @@ export function matchStatementModuloBrackets(statementNodeA, statementNodeB) {
13
13
  let statementMatchesModuloBrackets = false;
14
14
 
15
15
  if (!statementMatchesModuloBrackets) {
16
- const statementNodeMatches = statementNodeA.match(statementNodeB);
16
+ const statementNodeAMatchesStatementNodeB = statementNodeA.match(statementNodeB);
17
17
 
18
- statementMatchesModuloBrackets = statementNodeMatches; ///
18
+ statementMatchesModuloBrackets = statementNodeAMatchesStatementNodeB; ///
19
19
  }
20
20
 
21
21
  if (!statementMatchesModuloBrackets) {
package/src/variable.js CHANGED
@@ -21,31 +21,31 @@ export default class Variable {
21
21
  match(variable) {
22
22
  const type = variable.getType(),
23
23
  node = variable.getNode(),
24
- typeMatches = this.matchType(type),
25
- nodeMatches = this.matchNode(node),
26
- matches = nodeMatches && typeMatches;
24
+ matchesType = this.matchType(type),
25
+ matchesNode = this.matchNode(node),
26
+ matches = matchesNode && matchesType;
27
27
 
28
28
  return matches;
29
29
  }
30
30
 
31
31
  matchNode(node) {
32
- const nodeMatches = this.node.match(node);
32
+ const matchesNode = this.node.match(node);
33
33
 
34
- return nodeMatches;
34
+ return matchesNode;
35
35
  }
36
36
 
37
37
  matchType(type) {
38
- const typeMatches = this.type.match(type);
38
+ const matchesType = this.type.match(type);
39
39
 
40
- return typeMatches;
40
+ return matchesType;
41
41
  }
42
42
 
43
43
  matchNodeAndType(node, type) {
44
- const nodeMatches = this.matchNode(node),
45
- typeMatches = this.matchType(type),
46
- nodeAndTypeMatch = nodeMatches && typeMatches;
44
+ const matchesNode = this.matchNode(node),
45
+ matchesType = this.matchType(type),
46
+ matchesNodeAndType = matchesNode && matchesType;
47
47
 
48
- return nodeAndTypeMatch;
48
+ return matchesNodeAndType;
49
49
  }
50
50
 
51
51
  asString(tokens) {
@@ -6,37 +6,86 @@ import { nodeQuery, nodesQuery } from "../utilities/query";
6
6
  const variableNodeQuery = nodeQuery("/containedAssertion/term/variable!"),
7
7
  metastatementVariableNodesQuery = nodesQuery("/containedAssertion/statement//variable");
8
8
 
9
- export default function verifyContainedAssertion(containedAssertionNode) {
10
- let containedAssertionVerified = false;
11
-
12
- const containedAssertionNegated = isAssertionNegated(containedAssertionNode),
13
- variableNode = variableNodeQuery(containedAssertionNode),
14
- negated = containedAssertionNegated; ///
15
-
16
- if (false) {
17
- ///
18
- } else if (variableNode !== null) {
19
- const metastatementVariableNodes = metastatementVariableNodesQuery(containedAssertionNode),
20
- variableNodeMatchesMetaArgumentVariableNode = metastatementVariableNodes.some((metastatementVariableNode) => {
21
- const variableNodeMatchesMetaArgumentVariableNode = variableNode.match(metastatementVariableNode);
22
-
23
- if (variableNodeMatchesMetaArgumentVariableNode) {
24
- return true;
25
- }
26
- });
27
-
28
- if (!negated) {
29
- if (variableNodeMatchesMetaArgumentVariableNode) {
30
- containedAssertionVerified = true;
31
- }
9
+ export default function verifyContainedAssertion(containedAssertionNode, assignments, derived, localContext) {
10
+ let containedAssertionVerified;
11
+
12
+ const containedAssertionString = localContext.nodeAsString(containedAssertionNode);
13
+
14
+ localContext.trace(`Verifying the '${containedAssertionString}' contained assertion...`, containedAssertionNode);
15
+
16
+ const containedAssertionFunctions = [
17
+ verifyDerivedContainedAssertion,
18
+ verifyStatedContainedAssertion
19
+ ];
20
+
21
+ containedAssertionVerified = containedAssertionFunctions.some((containedAssertionFunction) => {
22
+ const containedAssertionVerified = containedAssertionFunction(containedAssertionNode, assignments, derived, localContext);
23
+
24
+ if (containedAssertionVerified) {
25
+ return true;
32
26
  }
27
+ });
28
+
29
+ if (containedAssertionVerified) {
30
+ localContext.debug(`...verified the '${containedAssertionString}' contained assertion.`, containedAssertionNode);
31
+ }
32
+
33
+ return containedAssertionVerified;
34
+ }
35
+
36
+ function verifyDerivedContainedAssertion(containedAssertionNode, assignments, derived, localContext) {
37
+ let derivedContainedAssertionVerified = false;
38
+
39
+ if (derived) {
40
+ const containedAssertionString = localContext.nodeAsString(containedAssertionNode);
41
+
42
+ localContext.trace(`Verifying the derived '${containedAssertionString}' contained assertion...`, containedAssertionNode);
33
43
 
34
- if (negated) {
35
- if (!variableNodeMatchesMetaArgumentVariableNode) {
36
- containedAssertionVerified = true;
44
+ const containedAssertionNegated = isAssertionNegated(containedAssertionNode),
45
+ variableNode = variableNodeQuery(containedAssertionNode),
46
+ negated = containedAssertionNegated; ///
47
+
48
+ if (false) {
49
+ ///
50
+ } else if (variableNode !== null) {
51
+ const metastatementVariableNodes = metastatementVariableNodesQuery(containedAssertionNode),
52
+ variableNodeMatchesMetaArgumentVariableNode = metastatementVariableNodes.some((metastatementVariableNode) => {
53
+ const variableNodeMatchesMetaArgumentVariableNode = variableNode.match(metastatementVariableNode);
54
+
55
+ if (variableNodeMatchesMetaArgumentVariableNode) {
56
+ return true;
57
+ }
58
+ });
59
+
60
+ if (!negated) {
61
+ if (variableNodeMatchesMetaArgumentVariableNode) {
62
+ derivedContainedAssertionVerified = true;
63
+ }
37
64
  }
65
+
66
+ if (negated) {
67
+ if (!variableNodeMatchesMetaArgumentVariableNode) {
68
+ derivedContainedAssertionVerified = true;
69
+ }
70
+ }
71
+ }
72
+
73
+ if (derivedContainedAssertionVerified) {
74
+ localContext.debug(`...verified the derived '${containedAssertionString}' contained assertion.`, containedAssertionNode);
38
75
  }
39
76
  }
40
77
 
41
- return containedAssertionVerified;
78
+ return derivedContainedAssertionVerified;
79
+ }
80
+
81
+ function verifyStatedContainedAssertion(containedAssertionNode, assignments, derived, localContext) {
82
+ let derivedStatedAssertionVerified = false;
83
+
84
+ if (!derived) {
85
+ const containedAssertionString = localContext.nodeAsString(containedAssertionNode);
86
+
87
+ localContext.debug(`The stated '${containedAssertionString}' contained assertion cannot be verified.`, containedAssertionNode);
88
+ }
89
+
90
+ return derivedStatedAssertionVerified;
42
91
  }
@@ -9,60 +9,109 @@ import { isAssertionNegated } from "../utilities/verify";
9
9
  const termNodeQuery = nodeQuery("/definedAssertion/term!"),
10
10
  variableNodeQuery = nodeQuery("/definedAssertion/term/variable!");
11
11
 
12
- export default function verifyDefinedAssertion(definedAssertionNode, localContext) {
13
- let definedAssertionVerified = false;
12
+ export default function verifyDefinedAssertion(definedAssertionNode, assignments, derived, localContext) {
13
+ let definedAssertionVerified;
14
14
 
15
- const definedAssertionNegated = isAssertionNegated(definedAssertionNode),
16
- variableNode = variableNodeQuery(definedAssertionNode),
17
- termNode = termNodeQuery(definedAssertionNode),
18
- negated = definedAssertionNegated; ///
15
+ const definedAssertionString = localContext.nodeAsString(definedAssertionNode);
19
16
 
20
- if (false) {
21
- ///
22
- } else if (variableNode !== null) {
23
- const variable = localContext.findVariableByVariableNode(variableNode);
17
+ localContext.trace(`Verifying the '${definedAssertionString}' defined assertion...`, definedAssertionNode);
24
18
 
25
- if (variable !== null) {
26
- const variableDefined = localContext.isVariableDefined(variable);
19
+ const definedAssertionFunctions = [
20
+ verifyDerivedDefinedAssertion,
21
+ verifyStatedDefinedAssertion
22
+ ];
27
23
 
28
- if (!negated) {
29
- if (variableDefined) {
30
- definedAssertionVerified = true;
24
+ definedAssertionVerified = definedAssertionFunctions.some((definedAssertionFunction) => {
25
+ const definedAssertionVerified = definedAssertionFunction(definedAssertionNode, assignments, derived, localContext);
26
+
27
+ if (definedAssertionVerified) {
28
+ return true;
29
+ }
30
+ });
31
+
32
+ if (definedAssertionVerified) {
33
+ localContext.debug(`...verified the '${definedAssertionString}' defined assertion.`, definedAssertionNode);
34
+ }
35
+
36
+ return definedAssertionVerified;
37
+ }
38
+
39
+ function verifyDerivedDefinedAssertion(definedAssertionNode, assignments, derived, localContext) {
40
+ let derivedDefinedAssertionVerified = false;
41
+
42
+ if (derived) {
43
+ const definedAssertionString = localContext.nodeAsString(definedAssertionNode);
44
+
45
+ localContext.trace(`Verifying the derived '${definedAssertionString}' defined assertion...`, definedAssertionNode);
46
+
47
+ const definedAssertionNegated = isAssertionNegated(definedAssertionNode),
48
+ variableNode = variableNodeQuery(definedAssertionNode),
49
+ termNode = termNodeQuery(definedAssertionNode),
50
+ negated = definedAssertionNegated; ///
51
+
52
+ if (false) {
53
+ ///
54
+ } else if (variableNode !== null) {
55
+ const variable = localContext.findVariableByVariableNode(variableNode);
56
+
57
+ if (variable !== null) {
58
+ const variableDefined = localContext.isVariableDefined(variable);
59
+
60
+ if (!negated) {
61
+ if (variableDefined) {
62
+ derivedDefinedAssertionVerified = true;
63
+ }
31
64
  }
32
- }
33
65
 
34
- if (negated) {
35
- if (!variableDefined) {
36
- definedAssertionVerified = true;
66
+ if (negated) {
67
+ if (!variableDefined) {
68
+ derivedDefinedAssertionVerified = true;
69
+ }
37
70
  }
38
71
  }
39
- }
40
- } else if (termNode !== null) {
41
- const terms = [],
42
- termVerified = verifyTerm(termNode, terms, localContext, () => {
43
- const verifiedAhead = true;
44
-
45
- return verifiedAhead;
46
- });
47
-
48
- if (termVerified) {
49
- const firstTerm = first(terms),
50
- term = firstTerm, ///
51
- termGrounded = localContext.isTermGrounded(term);
52
-
53
- if (!negated) {
54
- if (termGrounded) {
55
- definedAssertionVerified = true;
72
+ } else if (termNode !== null) {
73
+ const terms = [],
74
+ termVerified = verifyTerm(termNode, terms, localContext, () => {
75
+ const verifiedAhead = true;
76
+
77
+ return verifiedAhead;
78
+ });
79
+
80
+ if (termVerified) {
81
+ const firstTerm = first(terms),
82
+ term = firstTerm, ///
83
+ termGrounded = localContext.isTermGrounded(term);
84
+
85
+ if (!negated) {
86
+ if (termGrounded) {
87
+ derivedDefinedAssertionVerified = true;
88
+ }
56
89
  }
57
- }
58
90
 
59
- if (negated) {
60
- if (!termGrounded) {
61
- definedAssertionVerified = true;
91
+ if (negated) {
92
+ if (!termGrounded) {
93
+ derivedDefinedAssertionVerified = true;
94
+ }
62
95
  }
63
96
  }
64
97
  }
98
+
99
+ if (derivedDefinedAssertionVerified) {
100
+ localContext.debug(`...verified the derived '${definedAssertionString}' defined assertion.`, definedAssertionNode);
101
+ }
65
102
  }
66
103
 
67
- return definedAssertionVerified;
104
+ return derivedDefinedAssertionVerified;
105
+ }
106
+
107
+ function verifyStatedDefinedAssertion(definedAssertionNode, assignments, derived, localContext) {
108
+ let derivedStatedAssertionVerified = false;
109
+
110
+ if (!derived) {
111
+ const definedAssertionString = localContext.nodeAsString(definedAssertionNode);
112
+
113
+ localContext.debug(`The stated '${definedAssertionString}' defined assertion cannot be verified.`, definedAssertionNode);
114
+ }
115
+
116
+ return derivedStatedAssertionVerified;
68
117
  }
@@ -10,7 +10,7 @@ import { nodesQuery } from "../utilities/query";
10
10
  const declarationNodesQuery = nodesQuery("/frame/declaration"),
11
11
  metavariableNodesQuery = nodesQuery("/frame/metavariable");
12
12
 
13
- export default function verifyFrame(frameNode, frames, derived, localMetaContext) {
13
+ export default function verifyFrame(frameNode, frames, assignments, derived, localMetaContext) {
14
14
  let frameVerified;
15
15
 
16
16
  const frameString = localMetaContext.nodeAsString(frameNode);
@@ -55,7 +55,7 @@ function verifyDerivedFrameAssertion(frameAssertionNode, assignments, derived, l
55
55
  if (frameAssertion !== null) {
56
56
  const frames = [],
57
57
  frameNode = frameNodeQuery(frameAssertionNode),
58
- frameVerified = verifyFrame(frameNode, frames, derived, localMetaContext);
58
+ frameVerified = verifyFrame(frameNode, frames, assignments, derived, localMetaContext);
59
59
 
60
60
  if (frameVerified) {
61
61
  const firstFrame = first(frames),
@@ -114,7 +114,7 @@ function verifyStatedFrameAssertion(frameAssertionNode, assignments, derived, lo
114
114
  if (metavariableVerified) {
115
115
  const frames = [],
116
116
  frameNode = frameNodeQuery(frameAssertionNode),
117
- frameVerified = verifyFrame(frameNode, frames, derived, localMetaContext);
117
+ frameVerified = verifyFrame(frameNode, frames, assignments, derived, localMetaContext);
118
118
 
119
119
  if (frameVerified) {
120
120
  const firstFrame = first(frames),
@@ -42,9 +42,50 @@ export default function verifyMetaproofStep(metaproofStepNode, substitutions, lo
42
42
  metaproofStepVerified = true;
43
43
  }
44
44
  } else if (qualifiedStatementNode !== null) {
45
- debugger
45
+ let qualifiedStatementVerified;
46
+
47
+ const assignments = [],
48
+ localContext = localMetaContext; ///
49
+
50
+ qualifiedStatementVerified = verifyQualifiedStatement(qualifiedStatementNode, assignments, localContext);
51
+
52
+ if (qualifiedStatementVerified) {
53
+ const assignmentAssigned = assignAssignment(assignments, localContext);
54
+
55
+ qualifiedStatementVerified = assignmentAssigned; ///
56
+ }
57
+
58
+ if (qualifiedStatementVerified) {
59
+ const statementNode = statementNodeQuery(qualifiedStatementNode),
60
+ metaproofStep = MetaproofStep.fromStatementNode(statementNode);
61
+
62
+ localMetaContext.addMetaproofStep(metaproofStep);
63
+
64
+ metaproofStepVerified = true;
65
+ }
46
66
  } else if (unqualifiedStatementNode !== null) {
47
- debugger
67
+ let qualifiedStatementVerified;
68
+
69
+ const assignments = [],
70
+ localContext = localMetaContext, ///
71
+ substitutions = null;
72
+
73
+ qualifiedStatementVerified = verifyQualifiedStatement(qualifiedStatementNode, substitutions, assignments, localContext);
74
+
75
+ if (qualifiedStatementVerified) {
76
+ const assignmentAssigned = assignAssignment(assignments, localContext);
77
+
78
+ qualifiedStatementVerified = assignmentAssigned; ///
79
+ }
80
+
81
+ if (qualifiedStatementVerified) {
82
+ const statementNode = statementNodeQuery(qualifiedStatementNode),
83
+ metaproofStep = MetaproofStep.fromStatementNode(statementNode);
84
+
85
+ localMetaContext.addMetaproofStep(metaproofStep);
86
+
87
+ metaproofStepVerified = qualifiedStatementVerified; ///
88
+ }
48
89
  } else if (qualifiedMetastatementNode !== null) {
49
90
  let qualifiedMetastatementVerified;
50
91
 
@@ -15,9 +15,9 @@ export default function verifyUnqualifiedMetastatement(unqualifiedMetastatementN
15
15
  localMetaContext.trace(`Verifying the '${unqualifiedMetastatementString}' unqualified metastatement...`, unqualifiedMetastatementNode);
16
16
 
17
17
  if (derived) {
18
- const metastatementMatches = localMetaContext.matchMetastatement(metastatementNode);
18
+ const matchesMetastatementNode = localMetaContext.matchMetastatementNode(metastatementNode);
19
19
 
20
- unqualifiedMetastatementVerified = metastatementMatches; ///
20
+ unqualifiedMetastatementVerified = matchesMetastatementNode; ///
21
21
  }
22
22
 
23
23
  if (!unqualifiedMetastatementVerified) {
@@ -63,7 +63,7 @@ function verifyMetastatementAsFrameAssertion(metastatementNode, assignments, der
63
63
  }
64
64
 
65
65
  function verifyMetastatementAsIs(metastatementNode, assignments, derived, localMetaContext) {
66
- let metastatementVerifiedAsIs = false;
66
+ let metastatementVerifiedAsIs;
67
67
 
68
68
  const frameAssertionNode = frameAssertionNodeQuery(metastatementNode);
69
69
 
@@ -72,6 +72,47 @@ function verifyMetastatementAsIs(metastatementNode, assignments, derived, localM
72
72
 
73
73
  localMetaContext.trace(`Verifying the '${metastatementString}' metastatement as is...`, metastatementNode);
74
74
 
75
+ const verifyMetastatementAsIsFunctions = [
76
+ verifyDerivedMetastatementAsIs,
77
+ verifyStatedMetastatementAsIs
78
+ ];
79
+
80
+ metastatementVerifiedAsIs = verifyMetastatementAsIsFunctions.some((verifyMetastatementAsIsFunction) => {
81
+ const metastatementVerifiedAsIs = verifyMetastatementAsIsFunction(metastatementNode, assignments, derived, localMetaContext);
82
+
83
+ if (metastatementVerifiedAsIs) {
84
+ return true;
85
+ }
86
+ });
87
+
88
+ if (metastatementVerifiedAsIs) {
89
+ localMetaContext.debug(`...verified the '${metastatementString}' metastatement as is.`, metastatementNode);
90
+ }
91
+ }
92
+
93
+ return metastatementVerifiedAsIs;
94
+ }
95
+
96
+ function verifyDerivedMetastatementAsIs(metastatementNode, assignments, derived, localMetaContext) {
97
+ let derivedMetastatementVerifiedAsIs = false;
98
+
99
+ if (derived) {
100
+ const metastatementString = localMetaContext.nodeAsString(metastatementNode);
101
+
102
+ localMetaContext.debug(`Cannot verify the derived '${metastatementString}' metastatement as is.`, metastatementNode);
103
+ }
104
+
105
+ return derivedMetastatementVerifiedAsIs;
106
+ }
107
+
108
+ function verifyStatedMetastatementAsIs(metastatementNode, assignments, derived, localMetaContext) {
109
+ let statedMetastatementVerifiedAsIs = false;
110
+
111
+ if (!derived) {
112
+ const metastatementString = localMetaContext.nodeAsString(metastatementNode);
113
+
114
+ localMetaContext.trace(`Verifying the stated '${metastatementString}' metastatement as is...`, metastatementNode);
115
+
75
116
  const nonTerminalNode = metastatementNode, ///
76
117
  nonTerminalNodeVerified = metastatementNodeVerifier.verifyNonTerminalNode(nonTerminalNode, localMetaContext, () => {
77
118
  const verifiedAhead = true;
@@ -79,12 +120,12 @@ function verifyMetastatementAsIs(metastatementNode, assignments, derived, localM
79
120
  return verifiedAhead;
80
121
  });
81
122
 
82
- metastatementVerifiedAsIs = nonTerminalNodeVerified; ///
123
+ statedMetastatementVerifiedAsIs = nonTerminalNodeVerified; ///
83
124
 
84
- if (metastatementVerifiedAsIs) {
85
- localMetaContext.debug(`...verified the '${metastatementString}' metastatement as is.`, metastatementNode);
125
+ if (statedMetastatementVerifiedAsIs) {
126
+ localMetaContext.debug(`...verified the stated '${metastatementString}' metastatement as is.`, metastatementNode);
86
127
  }
87
128
  }
88
129
 
89
- return metastatementVerifiedAsIs;
130
+ return statedMetastatementVerifiedAsIs;
90
131
  }
@@ -64,7 +64,28 @@ export default function verifyRuleProofStep(ruleProofStepNode, localMetaContext)
64
64
  ruleProofStepVerified = true;
65
65
  }
66
66
  } else if (unqualifiedStatementNode !== null) {
67
- debugger
67
+ let qualifiedStatementVerified;
68
+
69
+ const assignments = [],
70
+ localContext = localMetaContext, ///
71
+ substitutions = null;
72
+
73
+ qualifiedStatementVerified = verifyQualifiedStatement(qualifiedStatementNode, substitutions, assignments, localContext);
74
+
75
+ if (qualifiedStatementVerified) {
76
+ const assignmentAssigned = assignAssignment(assignments, localContext);
77
+
78
+ qualifiedStatementVerified = assignmentAssigned; ///
79
+ }
80
+
81
+ if (qualifiedStatementVerified) {
82
+ const statementNode = statementNodeQuery(qualifiedStatementNode),
83
+ metaproofStep = MetaproofStep.fromStatementNode(statementNode);
84
+
85
+ localMetaContext.addMetaproofStep(metaproofStep);
86
+
87
+ ruleProofStepVerified = qualifiedStatementVerified; ///
88
+ }
68
89
  } else if (qualifiedMetastatementNode !== null) {
69
90
  let qualifiedMetastatementVerified;
70
91
 
@@ -15,9 +15,9 @@ export default function verifyUnqualifiedStatement(unqualifiedStatementNode, ass
15
15
  localContext.trace(`Verifying the '${unqualifiedStatementString}' unqualified statement...`, unqualifiedStatementNode);
16
16
 
17
17
  if (derived) {
18
- const statementMatches = localContext.matchStatement(statementNode);
18
+ const matchesStatementNode = localContext.matchStatementNode(statementNode);
19
19
 
20
- unqualifiedStatementVerified = statementMatches; ///
20
+ unqualifiedStatementVerified = matchesStatementNode; ///
21
21
  }
22
22
 
23
23
  if (!unqualifiedStatementVerified) {
@@ -137,11 +137,7 @@ function verifyStatementAsDefinedAssertion(statementNode, assignments, derived,
137
137
 
138
138
  localContext.trace(`Verifying the '${statementString}' statement as a defined assertion...`, definedAssertionNode);
139
139
 
140
- const definedAssertionVerified = verifyDefinedAssertion(definedAssertionNode, localContext, () => {
141
- const verifiedAhead = true;
142
-
143
- return verifiedAhead;
144
- });
140
+ const definedAssertionVerified = verifyDefinedAssertion(definedAssertionNode, assignments, derived, localContext);
145
141
 
146
142
  statementVerifiedAsDefinedAssertion = definedAssertionVerified; ///
147
143
 
@@ -163,7 +159,7 @@ function verifyStatementAsContainedAssertion(statementNode, assignments, derived
163
159
 
164
160
  localContext.trace(`Verifying the '${statementString}' statement as a contained assertion...`, containedAssertionNode);
165
161
 
166
- const containedVerified = verifyContainedAssertion(containedAssertionNode);
162
+ const containedVerified = verifyContainedAssertion(containedAssertionNode, assignments, derived, localContext);
167
163
 
168
164
  if (containedVerified) {
169
165
  statementNode = statementNodeQuery(containedAssertionNode); ///