occam-verify-cli 0.0.678 → 0.0.680

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 (141) hide show
  1. package/bin/action/verify.js +13 -3
  2. package/lib/axiomLemmaTheoremConjecture.js +3 -3
  3. package/lib/conclusion.js +16 -5
  4. package/lib/consequent.js +11 -3
  5. package/lib/context/file.js +73 -3
  6. package/lib/context/release.js +7 -2
  7. package/lib/equality.js +13 -199
  8. package/lib/premise.js +24 -7
  9. package/lib/supposition.js +15 -4
  10. package/lib/type.js +3 -8
  11. package/lib/utilities/array.js +5 -2
  12. package/lib/utilities/string.js +26 -13
  13. package/lib/verifier/node/metastatement.js +176 -0
  14. package/lib/verifier/node/statementAsCombinator.js +186 -0
  15. package/lib/verifier/node/termAsConstructor.js +224 -0
  16. package/lib/verifier/node.js +158 -0
  17. package/lib/verifier/nodes/equality.js +155 -0
  18. package/lib/verifier/{metastatementForMetavariable → nodes/metastatementForMetavariable}/conclusion.js +13 -12
  19. package/lib/verifier/{metastatementForMetavariable → nodes/metastatementForMetavariable}/premise.js +13 -12
  20. package/lib/verifier/nodes/metastatementForMetavariable.js +198 -0
  21. package/lib/verifier/nodes/statement.js +200 -0
  22. package/lib/verifier/{statementForMetavariable → nodes/statementForMetavariable}/conclusion.js +13 -12
  23. package/lib/verifier/{statementForMetavariable → nodes/statementForMetavariable}/premise.js +13 -12
  24. package/lib/verifier/nodes/statementForMetavariable.js +203 -0
  25. package/lib/verifier/nodes/term.js +210 -0
  26. package/lib/verifier/{termForVariable/supposition.js → nodes/termForVariable/consequent.js} +13 -12
  27. package/lib/verifier/{termForVariable/consequent.js → nodes/termForVariable/supposition.js} +13 -12
  28. package/lib/verifier/nodes/termForVariable.js +217 -0
  29. package/lib/verifier/nodes.js +175 -0
  30. package/lib/verify/axiom.js +3 -3
  31. package/lib/verify/conclusion.js +3 -3
  32. package/lib/verify/conjecture.js +3 -3
  33. package/lib/verify/consequent.js +3 -3
  34. package/lib/verify/declaration/combinator.js +7 -2
  35. package/lib/verify/declaration/constructor.js +8 -2
  36. package/lib/verify/declaration/metavariable.js +7 -2
  37. package/lib/verify/declaration/type.js +7 -2
  38. package/lib/verify/declaration/variable.js +8 -2
  39. package/lib/verify/file.js +3 -3
  40. package/lib/verify/label.js +9 -4
  41. package/lib/verify/lemma.js +3 -3
  42. package/lib/verify/metastatement/qualified.js +5 -6
  43. package/lib/verify/metastatement/unqualified.js +9 -7
  44. package/lib/verify/metastatement.js +36 -156
  45. package/lib/verify/metavariable.js +6 -4
  46. package/lib/verify/premise.js +3 -3
  47. package/lib/verify/release.js +3 -3
  48. package/lib/verify/rule.js +3 -3
  49. package/lib/verify/statement/qualified.js +5 -6
  50. package/lib/verify/statement/unqualified.js +9 -7
  51. package/lib/verify/statement.js +86 -332
  52. package/lib/verify/statementAsCombinator.js +8 -82
  53. package/lib/verify/supposition.js +3 -3
  54. package/lib/verify/term.js +79 -215
  55. package/lib/verify/termAsConstructor.js +15 -89
  56. package/lib/verify/terms.js +45 -0
  57. package/lib/verify/theorem.js +3 -3
  58. package/lib/verify/type.js +7 -5
  59. package/lib/verify/typeAssertion.js +124 -0
  60. package/lib/verify/variable.js +7 -5
  61. package/package.json +5 -5
  62. package/src/axiomLemmaTheoremConjecture.js +2 -2
  63. package/src/conclusion.js +13 -4
  64. package/src/consequent.js +9 -2
  65. package/src/context/file.js +9 -2
  66. package/src/context/release.js +9 -2
  67. package/src/equality.js +17 -143
  68. package/src/premise.js +23 -6
  69. package/src/supposition.js +12 -3
  70. package/src/type.js +3 -8
  71. package/src/utilities/array.js +1 -1
  72. package/src/utilities/string.js +34 -23
  73. package/src/verifier/node/metastatement.js +61 -0
  74. package/src/verifier/node/statementAsCombinator.js +80 -0
  75. package/src/verifier/node/termAsConstructor.js +124 -0
  76. package/src/verifier/node.js +85 -0
  77. package/src/verifier/nodes/equality.js +68 -0
  78. package/src/verifier/nodes/metastatementForMetavariable/conclusion.js +11 -0
  79. package/src/verifier/nodes/metastatementForMetavariable/premise.js +11 -0
  80. package/src/verifier/{metastatementForMetavariable.js → nodes/metastatementForMetavariable.js} +13 -13
  81. package/src/verifier/nodes/statement.js +100 -0
  82. package/src/verifier/nodes/statementForMetavariable/conclusion.js +11 -0
  83. package/src/verifier/nodes/statementForMetavariable/premise.js +11 -0
  84. package/src/verifier/{statementForMetavariable.js → nodes/statementForMetavariable.js} +10 -10
  85. package/src/verifier/nodes/term.js +106 -0
  86. package/src/verifier/nodes/termForVariable/consequent.js +11 -0
  87. package/src/verifier/nodes/termForVariable/supposition.js +11 -0
  88. package/src/verifier/{termForVariable.js → nodes/termForVariable.js} +42 -30
  89. package/src/verifier/nodes.js +111 -0
  90. package/src/verify/axiom.js +2 -2
  91. package/src/verify/conclusion.js +2 -2
  92. package/src/verify/conjecture.js +2 -2
  93. package/src/verify/consequent.js +2 -2
  94. package/src/verify/declaration/combinator.js +9 -1
  95. package/src/verify/declaration/constructor.js +15 -1
  96. package/src/verify/declaration/metavariable.js +9 -1
  97. package/src/verify/declaration/type.js +14 -1
  98. package/src/verify/declaration/variable.js +15 -1
  99. package/src/verify/file.js +2 -2
  100. package/src/verify/label.js +10 -2
  101. package/src/verify/lemma.js +4 -4
  102. package/src/verify/metastatement/qualified.js +4 -6
  103. package/src/verify/metastatement/unqualified.js +9 -7
  104. package/src/verify/metastatement.js +35 -56
  105. package/src/verify/metavariable.js +6 -3
  106. package/src/verify/premise.js +2 -2
  107. package/src/verify/release.js +2 -2
  108. package/src/verify/rule.js +2 -2
  109. package/src/verify/statement/qualified.js +4 -6
  110. package/src/verify/statement/unqualified.js +9 -7
  111. package/src/verify/statement.js +109 -302
  112. package/src/verify/statementAsCombinator.js +9 -129
  113. package/src/verify/supposition.js +2 -2
  114. package/src/verify/term.js +99 -156
  115. package/src/verify/termAsConstructor.js +20 -135
  116. package/src/verify/terms.js +54 -0
  117. package/src/verify/theorem.js +2 -2
  118. package/src/verify/type.js +7 -4
  119. package/src/verify/typeAssertion.js +164 -0
  120. package/src/verify/variable.js +7 -4
  121. package/lib/node/statement/combinator/equality.js +0 -21
  122. package/lib/ocmbinator/equality.js +0 -126
  123. package/lib/tokens/statement/combinator/equality.js +0 -17
  124. package/lib/verifier/metastatementForMetavariable.js +0 -198
  125. package/lib/verifier/statementForMetavariable.js +0 -203
  126. package/lib/verifier/termForVariable.js +0 -209
  127. package/lib/verifier.js +0 -138
  128. package/lib/verify/assertion/type.js +0 -115
  129. package/lib/verify/typeInference.js +0 -132
  130. package/src/node/statement/combinator/equality.js +0 -9
  131. package/src/ocmbinator/equality.js +0 -23
  132. package/src/tokens/statement/combinator/equality.js +0 -10
  133. package/src/verifier/metastatementForMetavariable/conclusion.js +0 -9
  134. package/src/verifier/metastatementForMetavariable/premise.js +0 -9
  135. package/src/verifier/statementForMetavariable/conclusion.js +0 -9
  136. package/src/verifier/statementForMetavariable/premise.js +0 -9
  137. package/src/verifier/termForVariable/consequent.js +0 -9
  138. package/src/verifier/termForVariable/supposition.js +0 -9
  139. package/src/verifier.js +0 -74
  140. package/src/verify/assertion/type.js +0 -153
  141. package/src/verify/typeInference.js +0 -146
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
 
3
- import Verifier from "../verifier";
4
- import verifyTerm from "../verify/term";
5
- import TermForVariableSubstitution from "../substitution/termForVariable";
3
+ import verifyTerm from "../../verify/term";
4
+ import NodesVerifier from "../../verifier/nodes";
5
+ import TermForVariableSubstitution from "../../substitution/termForVariable";
6
6
 
7
- import { first } from "../utilities/array";
8
- import { nodeQuery } from "../utilities/query";
9
- import { TERM_RULE_NAME } from "../ruleNames";
10
- import { variableNameFromVariableNode } from "../utilities/query";
7
+ import { first } from "../../utilities/array";
8
+ import { nodeQuery } from "../../utilities/query";
9
+ import { TERM_RULE_NAME } from "../../ruleNames";
10
+ import { variableNameFromVariableNode } from "../../utilities/query";
11
11
 
12
12
  const variableNodeQuery = nodeQuery('/term/variable!');
13
13
 
14
- export default class TermForVariableVerifier extends Verifier {
15
- verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, proofContextA, proofContextB) {
14
+ export default class TermForVariableNodesVerifier extends NodesVerifier {
15
+ verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, proofContextA, proofContextB, verifyAhead) {
16
16
  let nonTerminalNodeVerified = false;
17
17
 
18
18
  const nonTerminalNodeARuleName = nonTerminalNodeA.getRuleName(),
@@ -25,28 +25,28 @@ export default class TermForVariableVerifier extends Verifier {
25
25
  if (nonTerminalNodeARuleNameTermRuleName && nonTerminalNodeBRuleNameTermRuleName) {
26
26
  const termNodeA = nonTerminalNodeA, ///
27
27
  termNodeB = nonTerminalNodeB, ///
28
- termNodeVerified = this.verifyTermNode(termNodeA, termNodeB, substitutions, proofContextA, proofContextB);
28
+ termNodeVerified = this.verifyTermNode(termNodeA, termNodeB, substitutions, proofContextA, proofContextB, verifyAhead);
29
29
 
30
30
  if (termNodeVerified) {
31
31
  nonTerminalNodeVerified = true; ///
32
32
  } else {
33
- nonTerminalNodeVerified = super.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, proofContextA, proofContextB);
33
+ nonTerminalNodeVerified = super.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, proofContextA, proofContextB, verifyAhead);
34
34
  }
35
35
  } else {
36
- nonTerminalNodeVerified = super.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, proofContextA, proofContextB);
36
+ nonTerminalNodeVerified = super.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, proofContextA, proofContextB, verifyAhead);
37
37
  }
38
38
  }
39
39
 
40
40
  return nonTerminalNodeVerified;
41
41
  }
42
42
 
43
- verifyTermNode(termNodeA, termNodeB, substitutions, proofContextA, proofContextB) {
43
+ verifyTermNode(termNodeA, termNodeB, substitutions, proofContextA, proofContextB, verifyAhead) {
44
44
  let termNodeVerified = false;
45
45
 
46
46
  const variableNodeA = variableNodeQuery(termNodeA);
47
47
 
48
48
  if (variableNodeA !== null) {
49
- const variableVerified = this.verifyVariableNode(variableNodeA, termNodeB, substitutions, proofContextA, proofContextB);
49
+ const variableVerified = this.verifyVariableNode(variableNodeA, termNodeB, substitutions, proofContextA, proofContextB, verifyAhead);
50
50
 
51
51
  termNodeVerified = variableVerified; ///
52
52
  }
@@ -54,8 +54,8 @@ export default class TermForVariableVerifier extends Verifier {
54
54
  return termNodeVerified;
55
55
  }
56
56
 
57
- verifyVariableNode(variableNodeA, termNodeB, substitutions, proofContextA, proofContextB) {
58
- let variableVerified;
57
+ verifyVariableNode(variableNodeA, termNodeB, substitutions, proofContextA, proofContextB, verifyAhead) {
58
+ let variableVerified = false;
59
59
 
60
60
  const variableNameA = variableNameFromVariableNode(variableNodeA),
61
61
  substitution = substitutions.find((substitution) => {
@@ -70,7 +70,11 @@ export default class TermForVariableVerifier extends Verifier {
70
70
  const termNode = termNodeB, ///
71
71
  substitutionNodesVerified = substitution.matchTermNode(termNode);
72
72
 
73
- variableVerified = substitutionNodesVerified; ///
73
+ if (substitutionNodesVerified) {
74
+ const verifiedAhead = verifyAhead();
75
+
76
+ variableVerified = verifiedAhead; ///
77
+ }
74
78
  } else {
75
79
  const { createSubstitutions } = this.constructor;
76
80
 
@@ -83,23 +87,31 @@ export default class TermForVariableVerifier extends Verifier {
83
87
  const types = [],
84
88
  context = proofContextB, ///
85
89
  termNode = termNodeB, ///
86
- termVerified = verifyTerm(termNode, types, context);
90
+ termVerified = verifyTerm(termNode, types, context, () => {
91
+ let verifiedAhead = false;
87
92
 
88
- if (termVerified) {
89
- const firstType = first(types),
90
- termType = firstType,
91
- variableType = variable.getType(),
92
- variableTypeEqualToOrSuperTypeOfTermType = variableType.isEqualToOrSuperTypeOf(termType);
93
+ const firstType = first(types),
94
+ termType = firstType,
95
+ variableType = variable.getType(),
96
+ variableTypeEqualToOrSuperTypeOfTermType = variableType.isEqualToOrSuperTypeOf(termType);
93
97
 
94
- if (variableTypeEqualToOrSuperTypeOfTermType) {
95
- const termForVariableSubstitution = TermForVariableSubstitution.fromVariableNameAndTermNode(variableName, termNode),
96
- substitution = termForVariableSubstitution; ///
98
+ if (variableTypeEqualToOrSuperTypeOfTermType) {
99
+ const termForVariableSubstitution = TermForVariableSubstitution.fromVariableNameAndTermNode(variableName, termNode),
100
+ substitution = termForVariableSubstitution; ///
97
101
 
98
- substitutions.push(substitution);
102
+ substitutions.push(substitution);
99
103
 
100
- variableVerified = true;
101
- }
102
- }
104
+ verifiedAhead = verifyAhead();
105
+
106
+ if (!verifiedAhead) {
107
+ substitutions.pop();
108
+ }
109
+ }
110
+
111
+ return verifiedAhead;
112
+ });
113
+
114
+ variableVerified = termVerified; ///
103
115
  }
104
116
  }
105
117
  }
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ export default class NodesVerifier {
4
+ verifyNode(nodeA, nodeB, ...remainingArguments) {
5
+ let nodeVerified = false;
6
+
7
+ const nodeATerminalNode = nodeA.isTerminalNode(),
8
+ nodeBTerminalNode = nodeB.isTerminalNode(),
9
+ nodeANonTerminalNode = nodeA.isNonTerminalNode(),
10
+ nodeBNonTerminalNode = nodeB.isNonTerminalNode();
11
+
12
+ if (false) {
13
+ ///
14
+ } else if (nodeATerminalNode && nodeBTerminalNode) {
15
+ const terminalNodeA = nodeA, ///
16
+ terminalNodeB = nodeB, ///
17
+ terminalNodeVerified = this.verifyTerminalNode(terminalNodeA, terminalNodeB, ...remainingArguments);
18
+
19
+ nodeVerified = terminalNodeVerified; ///
20
+ } else if (nodeANonTerminalNode && nodeBNonTerminalNode) {
21
+ const nonTerminalNodeA = nodeA, ///
22
+ nonTerminalNodeB = nodeB, ///
23
+ nonTerminalNodeVerified = this.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, ...remainingArguments);
24
+
25
+ nodeVerified = nonTerminalNodeVerified; ///
26
+ }
27
+
28
+ return nodeVerified;
29
+ }
30
+
31
+ verifyChildNodes(childNodesA, childNodesB, ...remainingArguments) {
32
+ let childNodesVerify = false;
33
+
34
+ const childNodesALength = childNodesA.length,
35
+ childNodesBLength = childNodesB.length;
36
+
37
+ if (childNodesALength === childNodesBLength) {
38
+ const index = 0,
39
+ childNodesVerifyAhead = this.verifyChildNodesAhead(index, childNodesA, childNodesB, ...remainingArguments);
40
+
41
+ childNodesVerify = childNodesVerifyAhead; ///
42
+ }
43
+
44
+ return childNodesVerify;
45
+ }
46
+
47
+ verifyChildNodesAhead(index, childNodesA, childNodesB, ...remainingArguments) {
48
+ let childNodesVerify;
49
+
50
+ const verifyAhead = remainingArguments.pop(), ///
51
+ childNodesALength = childNodesA.length;
52
+
53
+ if (index === childNodesALength) {
54
+ const verifiedAhead = verifyAhead();
55
+
56
+ childNodesVerify = verifiedAhead; ///
57
+ } else {
58
+ const childNodeA = childNodesA[index],
59
+ childNodeB = childNodesB[index],
60
+ nodeA = childNodeA, ///
61
+ nodeB = childNodeB, ///
62
+ nodeVerified = this.verifyNode(nodeA, nodeB, ...remainingArguments, () => {
63
+ index++;
64
+
65
+ remainingArguments.push(verifyAhead); ///
66
+
67
+ const childNodesVerifyAhead = this.verifyChildNodesAhead(index, childNodesA, childNodesB, ...remainingArguments);
68
+
69
+ return childNodesVerifyAhead;
70
+ });
71
+
72
+ childNodesVerify = nodeVerified; ///
73
+ }
74
+
75
+ return childNodesVerify;
76
+ }
77
+
78
+ verifyTerminalNode(terminalNodeA, terminalNodeB, ...remainingArguments) {
79
+ let terminalNodeVerified = false;
80
+
81
+ const matches = terminalNodeA.match(terminalNodeB);
82
+
83
+ if (matches) {
84
+ const verifyAhead = remainingArguments.pop(),
85
+ verifiedAhead = verifyAhead();
86
+
87
+ terminalNodeVerified = verifiedAhead; ///
88
+ }
89
+
90
+ return terminalNodeVerified;
91
+ }
92
+
93
+ verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, ...remainingArguments) {
94
+ let nonTerminalNodeVerified = false;
95
+
96
+ const nonTerminalNodeARuleName = nonTerminalNodeA.getRuleName(), ///
97
+ nonTerminalNodeBRuleName = nonTerminalNodeB.getRuleName(); ///
98
+
99
+ if (nonTerminalNodeARuleName === nonTerminalNodeBRuleName) {
100
+ const nonTerminalNodeAChildNodes = nonTerminalNodeA.getChildNodes(),
101
+ nonTerminalNodeBChildNodes = nonTerminalNodeB.getChildNodes(),
102
+ childNodesA = nonTerminalNodeAChildNodes, ///
103
+ childNodesB = nonTerminalNodeBChildNodes, ///
104
+ childNodesVerify = this.verifyChildNodes(childNodesA, childNodesB, ...remainingArguments);
105
+
106
+ nonTerminalNodeVerified = childNodesVerify; ///
107
+ }
108
+
109
+ return nonTerminalNodeVerified;
110
+ }
111
+ }
@@ -20,7 +20,7 @@ export default function verifyAxiom(axiomNode, fileContext) {
20
20
  labelsString = fileContext.nodesAsString(labelNodes),
21
21
  proofContext = ProofContext.fromFileContext(fileContext);
22
22
 
23
- fileContext.debug(`Verifying the '${labelsString}' axiom...`, axiomNode);
23
+ fileContext.trace(`Verifying the '${labelsString}' axiom...`, axiomNode);
24
24
 
25
25
  const labels = [],
26
26
  labelsVerified = verifyLabels(labelNodes, labels, fileContext);
@@ -54,7 +54,7 @@ export default function verifyAxiom(axiomNode, fileContext) {
54
54
  }
55
55
 
56
56
  if (axiomVerified) {
57
- fileContext.info(`Verified the '${labelsString}' axiom.`, axiomNode);
57
+ fileContext.debug(`...verified the '${labelsString}' axiom.`, axiomNode);
58
58
  }
59
59
 
60
60
  return axiomVerified;
@@ -13,7 +13,7 @@ export default function verifyConclusion(conclusionNode, conclusions, metaproofC
13
13
 
14
14
  const conclusionString = metaproofContext.nodeAsString(conclusionNode);
15
15
 
16
- metaproofContext.debug(`Verifying the '${conclusionString}' conclusion...`, conclusionNode);
16
+ metaproofContext.trace(`Verifying the '${conclusionString}' conclusion...`, conclusionNode);
17
17
 
18
18
  const derived = false,
19
19
  unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(conclusionNode),
@@ -29,7 +29,7 @@ export default function verifyConclusion(conclusionNode, conclusions, metaproofC
29
29
  }
30
30
 
31
31
  if (conclusionVerified) {
32
- metaproofContext.info(`Verified the '${conclusionString}' conclusion.`, conclusionNode);
32
+ metaproofContext.debug(`...verified the '${conclusionString}' conclusion.`, conclusionNode);
33
33
  }
34
34
 
35
35
  return conclusionVerified;
@@ -22,7 +22,7 @@ export default function verifyConjecture(conjectureNode, fileContext) {
22
22
  labelsString = fileContext.nodesAsString(labelNodes),
23
23
  proofContext = ProofContext.fromFileContext(fileContext);
24
24
 
25
- fileContext.debug(`Verifying the '${labelsString}' conjecture...`, conjectureNode);
25
+ fileContext.trace(`Verifying the '${labelsString}' conjecture...`, conjectureNode);
26
26
 
27
27
  const labels = [],
28
28
  labelsVerified = verifyLabels(labelNodes, labels, fileContext);
@@ -60,7 +60,7 @@ export default function verifyConjecture(conjectureNode, fileContext) {
60
60
  }
61
61
 
62
62
  if (conjectureVerified) {
63
- fileContext.info(`Verified the '${labelsString}' conjecture.`, conjectureNode);
63
+ fileContext.debug(`...verified the '${labelsString}' conjecture.`, conjectureNode);
64
64
  }
65
65
 
66
66
  return conjectureVerified;
@@ -13,7 +13,7 @@ export default function verifyConsequent(consequentNode, consequents, proofConte
13
13
 
14
14
  const consequentString = proofContext.nodeAsString(consequentNode);
15
15
 
16
- proofContext.debug(`Verifying the '${consequentString}' consequent...`, consequentNode);
16
+ proofContext.trace(`Verifying the '${consequentString}' consequent...`, consequentNode);
17
17
 
18
18
  const derived = false,
19
19
  assignments = [],
@@ -30,7 +30,7 @@ export default function verifyConsequent(consequentNode, consequents, proofConte
30
30
  }
31
31
 
32
32
  if (consequentVerified) {
33
- proofContext.info(`Verified the '${consequentString}' consequent.`, consequentNode);
33
+ proofContext.debug(`...verified the '${consequentString}' consequent.`, consequentNode);
34
34
  }
35
35
 
36
36
  return consequentVerified;
@@ -10,9 +10,17 @@ export default function verifyCombinatorDeclaration(combinatorDeclarationNode, f
10
10
  let combinatorDeclarationVerified;
11
11
 
12
12
  const statementNode = statementNodeQuery(combinatorDeclarationNode),
13
- statementVerifiedAsCombinator = verifyStatementAsCombinator(statementNode, fileContext);
13
+ statementString = fileContext.nodeAsString(statementNode);
14
+
15
+ fileContext.trace(`Verifying the '${statementString}' combinator declaration...`, combinatorDeclarationNode);
16
+
17
+ const statementVerifiedAsCombinator = verifyStatementAsCombinator(statementNode, fileContext);
14
18
 
15
19
  combinatorDeclarationVerified = statementVerifiedAsCombinator; ///
16
20
 
21
+ if (combinatorDeclarationVerified) {
22
+ fileContext.debug(`...verified the '${statementString}' combinator declaration.`, combinatorDeclarationNode);
23
+ }
24
+
17
25
  return combinatorDeclarationVerified;
18
26
  }
@@ -3,6 +3,7 @@
3
3
  import verifyTermAsConstructor from "../../verify/termAsConstructor";
4
4
 
5
5
  import { nodeQuery } from "../../utilities/query";
6
+ import { EMPTY_STRING } from "../../constants";
6
7
 
7
8
  const termNodeQuery = nodeQuery("/constructorDeclaration/term"),
8
9
  typeNodeQuery = nodeQuery("/constructorDeclaration/type");
@@ -12,9 +13,22 @@ export default function verifyConstructorDeclaration(constructorDeclarationNode,
12
13
 
13
14
  const termNode = termNodeQuery(constructorDeclarationNode),
14
15
  typeNode = typeNodeQuery(constructorDeclarationNode),
15
- termVerifiedAsConstructor = verifyTermAsConstructor(termNode, typeNode, fileContext);
16
+ termString = fileContext.nodeAsString(termNode),
17
+ typeString = fileContext.nodeAsString(typeNode);
18
+
19
+ (typeString === EMPTY_STRING) ?
20
+ fileContext.trace(`Verifying the '${termString}' constructor declaration...`, constructorDeclarationNode) :
21
+ fileContext.trace(`Verifying the '${termString}:${typeString}' constructor declaration...`, constructorDeclarationNode);
22
+
23
+ const termVerifiedAsConstructor = verifyTermAsConstructor(termNode, typeNode, fileContext);
16
24
 
17
25
  constructorDeclarationVerified = termVerifiedAsConstructor; ///
18
26
 
27
+ if (constructorDeclarationVerified) {
28
+ (typeString === EMPTY_STRING) ?
29
+ fileContext.debug(`...verified the '${termString}' constructor declaration.`, constructorDeclarationNode) :
30
+ fileContext.debug(`...verified the '${termString}:${typeString}' constructor declaration.`, constructorDeclarationNode);
31
+ }
32
+
19
33
  return constructorDeclarationVerified;
20
34
  }
@@ -12,9 +12,17 @@ export default function verifyMetavariableDeclaration(metavariableDeclarationNod
12
12
 
13
13
  const metaTypeNode = metaTypeNodeQuery(metavariableDeclarationNode),
14
14
  metavariableNode = metavariableNodeQuery(metavariableDeclarationNode),
15
- metavariableVVerified = verifyMetavariable(metavariableNode, metaTypeNode, fileContext);
15
+ metavariableString = fileContext.nodeAsString(metaTypeNode);
16
+
17
+ fileContext.trace(`Verifying the '${metavariableString}' metavariable declaration...`, metavariableDeclarationNode);
18
+
19
+ const metavariableVVerified = verifyMetavariable(metavariableNode, metaTypeNode, fileContext);
16
20
 
17
21
  metavariableDeclarationVerified = metavariableVVerified; ///
18
22
 
23
+ if (metavariableDeclarationVerified) {
24
+ fileContext.debug(`...verified the '${metavariableString}' metavariable declaration.`, metavariableDeclarationNode);
25
+ }
26
+
19
27
  return metavariableDeclarationVerified;
20
28
  }
@@ -3,6 +3,7 @@
3
3
  import verifyType from "../../verify/type";
4
4
 
5
5
  import { nodeQuery } from "../../utilities/query";
6
+ import { EMPTY_STRING } from "../../constants";
6
7
 
7
8
  const firstTypeNodeQuery = nodeQuery("/typeDeclaration/type[0]"),
8
9
  secondTypeNodeQuery = nodeQuery("/typeDeclaration/type[1]");
@@ -13,11 +14,23 @@ export default function verifyTypeDeclaration(typeDeclarationNode, fileContext)
13
14
  const firstTypeNode = firstTypeNodeQuery(typeDeclarationNode),
14
15
  secondTypeNode = secondTypeNodeQuery(typeDeclarationNode),
15
16
  typeNode = firstTypeNode, ///
16
- superTypeNode = secondTypeNode; ///
17
+ superTypeNode = secondTypeNode, ///
18
+ typeString = fileContext.nodeAsString(typeNode),
19
+ superTypeString = fileContext.nodeAsString(superTypeNode);
20
+
21
+ (superTypeString === EMPTY_STRING) ?
22
+ fileContext.trace(`Verifying the '${typeString}' type declaration...`, typeDeclarationNode) :
23
+ fileContext.trace(`Verifying the '${typeString}:${superTypeString}' type declaration...`, typeDeclarationNode);
17
24
 
18
25
  const typeVerified = verifyType(typeNode, superTypeNode, fileContext);
19
26
 
20
27
  typeDeclarationVerified = typeVerified; ///
21
28
 
29
+ if (typeDeclarationVerified) {
30
+ (superTypeString === EMPTY_STRING) ?
31
+ fileContext.trace(`...verified the '${typeString}' type declaration.`, typeDeclarationNode) :
32
+ fileContext.trace(`...verified the '${typeString}:${superTypeString}' type declaration.`, typeDeclarationNode);
33
+ }
34
+
22
35
  return typeDeclarationVerified;
23
36
  }
@@ -3,6 +3,7 @@
3
3
  import verifyVariable from "../../verify/variable";
4
4
 
5
5
  import { nodeQuery } from "../../utilities/query";
6
+ import { EMPTY_STRING } from "../../constants";
6
7
 
7
8
  const typeNodeQuery = nodeQuery("/variableDeclaration/type"),
8
9
  variableNodeQuery = nodeQuery("/variableDeclaration/variable");
@@ -12,9 +13,22 @@ export default function verifyVariableDeclaration(variableDeclarationNode, fileC
12
13
 
13
14
  const typeNode = typeNodeQuery(variableDeclarationNode),
14
15
  variableNode = variableNodeQuery(variableDeclarationNode),
15
- variableVVerified = verifyVariable(variableNode, typeNode, fileContext);
16
+ typeString = fileContext.nodeAsString(typeNode),
17
+ variableString = fileContext.nodeAsString(variableNode);
18
+
19
+ (typeString === EMPTY_STRING) ?
20
+ fileContext.trace(`Verifying the '${variableString}' variable declaration...`, variableDeclarationNode) :
21
+ fileContext.trace(`Verifying the '${variableString}:${typeString}' variable declaration...`, variableDeclarationNode);
22
+
23
+ const variableVVerified = verifyVariable(variableNode, typeNode, fileContext);
16
24
 
17
25
  variableDeclarationVerified = variableVVerified; ///
18
26
 
27
+ if (variableDeclarationVerified) {
28
+ (typeString === EMPTY_STRING) ?
29
+ fileContext.debug(`...verified the '${variableString}' variable declaration.`, variableDeclarationNode) :
30
+ fileContext.debug(`...verified the '${variableString}:${typeString}' variable declaration.`, variableDeclarationNode);
31
+ }
32
+
19
33
  return variableDeclarationVerified;
20
34
  }
@@ -23,7 +23,7 @@ export default function verifyFile(filePath, releaseContext) {
23
23
  errorNodesLength = errorNodes.length;
24
24
 
25
25
  if (errorNodesLength > 0) {
26
- releaseContext.error(`The '${filePath}' file cannot be verified because it contains errors.`);
26
+ releaseContext.warning(`The '${filePath}' file cannot be verified because it contains errors.`);
27
27
  } else {
28
28
  const topLevelDeclarationNodes = topLevelDeclarationNodesQuery(node),
29
29
  topLevelDeclarationsVerified = topLevelDeclarationNodes.every((topLevelDeclarationNode) => {
@@ -43,7 +43,7 @@ export default function verifyFile(filePath, releaseContext) {
43
43
  }
44
44
 
45
45
  if (fileVerified) {
46
- releaseContext.info(`Verified the '${filePath}' file.`);
46
+ releaseContext.info(`...verified the '${filePath}' file.`);
47
47
  }
48
48
 
49
49
  return fileVerified;
@@ -8,12 +8,16 @@ export default function verifyLabel(labelNode, labels, fileContext) {
8
8
  let labelVerified = false;
9
9
 
10
10
  const labelName = labelNameFromLabelNode(labelNode),
11
- labelPresent = fileContext.isLabelPresentByLabelName(labelName);
11
+ labelString = fileContext.nodeAsString(labelNode);
12
+
13
+ fileContext.trace(`Verifying the '${labelString}' label...`, labelNode);
14
+
15
+ const labelPresent = fileContext.isLabelPresentByLabelName(labelName);
12
16
 
13
17
  if (labelPresent) {
14
18
  const labelString = fileContext.nodeAsString(labelNode);
15
19
 
16
- fileContext.error(`The '${labelString}' label is already present.`, labelNode);
20
+ fileContext.debug(`The '${labelString}' label is already present.`, labelNode);
17
21
  } else {
18
22
  const label = Label.fromLabelNode(labelNode);
19
23
 
@@ -22,5 +26,9 @@ export default function verifyLabel(labelNode, labels, fileContext) {
22
26
  labelVerified = true;
23
27
  }
24
28
 
29
+ if (labelVerified) {
30
+ fileContext.debug(`...verified the '${labelString}' label.`, labelNode);
31
+ }
32
+
25
33
  return labelVerified;
26
34
  }
@@ -24,8 +24,8 @@ export default function verifyLemma(lemmaNode, fileContext) {
24
24
  proofContext = ProofContext.fromFileContext(fileContext);
25
25
 
26
26
  (labelsString === EMPTY_STRING) ?
27
- fileContext.debug(`Verifying a lemma...`, lemmaNode) :
28
- fileContext.debug(`Verifying the '${labelsString}' lemma...`, lemmaNode);
27
+ fileContext.trace(`Verifying a lemma...`, lemmaNode) :
28
+ fileContext.trace(`Verifying the '${labelsString}' lemma...`, lemmaNode);
29
29
 
30
30
  const labels = [],
31
31
  labelsVerified = verifyLabels(labelNodes, labels, fileContext);
@@ -65,8 +65,8 @@ export default function verifyLemma(lemmaNode, fileContext) {
65
65
 
66
66
  if (lemmaVerified) {
67
67
  (labelsString === EMPTY_STRING) ?
68
- fileContext.info(`Verified the lemma.`, lemmaNode) :
69
- fileContext.info(`Verified the '${labelsString}' lemma.`, lemmaNode);
68
+ fileContext.debug(`...verified the lemma.`, lemmaNode) :
69
+ fileContext.debug(`...verified the '${labelsString}' lemma.`, lemmaNode);
70
70
  }
71
71
 
72
72
  return lemmaVerified;
@@ -14,7 +14,7 @@ export default function verifyQualifiedMetastatement(qualifiedMetastatementNode,
14
14
  const metastatementString = metaproofContext.nodeAsString(metastatementNode),
15
15
  metastatementMetaproofContext = metaproofContext; ///
16
16
 
17
- metaproofContext.debug(`Verifying the '${metastatementString}' qualified metastatement...`, qualifiedMetastatementNode);
17
+ metaproofContext.trace(`Verifying the '${metastatementString}' qualified metastatement...`, qualifiedMetastatementNode);
18
18
 
19
19
  const referenceNode = referenceNodeQuery(qualifiedMetastatementNode),
20
20
  referenceName = referenceNameFromReferenceNode(referenceNode),
@@ -25,12 +25,10 @@ export default function verifyQualifiedMetastatement(qualifiedMetastatementNode,
25
25
 
26
26
  qualifiedMetastatementVerified = ruleMatchesMetastatement; ///
27
27
  }
28
- }
29
-
30
- if (qualifiedMetastatementVerified) {
31
- const metastatementString = metaproofContext.nodeAsString(metastatementNode);
32
28
 
33
- metaproofContext.info(`Verified the '${metastatementString}' qualified metastatement.`, qualifiedMetastatementNode);
29
+ if (qualifiedMetastatementVerified) {
30
+ metaproofContext.debug(`...verified the '${metastatementString}' qualified metastatement.`, qualifiedMetastatementNode);
31
+ }
34
32
  }
35
33
 
36
34
  return qualifiedMetastatementVerified;
@@ -14,7 +14,7 @@ export default function verifyUnqualifiedMetastatement(unqualifiedMetastatementN
14
14
  if (metastatementNode !== null) {
15
15
  const metastatementString = metaproofContext.nodeAsString(metastatementNode);
16
16
 
17
- metaproofContext.debug(`Verifying the '${metastatementString}' unqualified metastatement...`, unqualifiedMetastatementNode);
17
+ metaproofContext.trace(`Verifying the '${metastatementString}' unqualified metastatement...`, unqualifiedMetastatementNode);
18
18
 
19
19
  if (derived) {
20
20
  const metastatementMatches = metaproofContext.matchMetastatement(metastatementNode);
@@ -23,16 +23,18 @@ export default function verifyUnqualifiedMetastatement(unqualifiedMetastatementN
23
23
  }
24
24
 
25
25
  if (!unqualifiedMetastatementVerified) {
26
- const metastatementVerified = verifyMetastatement(metastatementNode, derived, metaproofContext);
26
+ const metastatementVerified = verifyMetastatement(metastatementNode, derived, metaproofContext, () => {
27
+ const verifiedAhead = true;
28
+
29
+ return verifiedAhead;
30
+ });
27
31
 
28
32
  unqualifiedMetastatementVerified = metastatementVerified; ///
29
33
  }
30
- }
31
34
 
32
- if (unqualifiedMetastatementVerified) {
33
- const metastatementString = metaproofContext.nodeAsString(metastatementNode);
34
-
35
- metaproofContext.info(`Verified the '${metastatementString}' unqualified metastatement.`, unqualifiedMetastatementNode);
35
+ if (unqualifiedMetastatementVerified) {
36
+ metaproofContext.debug(`...verified the '${metastatementString}' unqualified metastatement.`, unqualifiedMetastatementNode);
37
+ }
36
38
  }
37
39
 
38
40
  return unqualifiedMetastatementVerified;