occam-verify-cli 0.0.678 → 0.0.679

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 (125) hide show
  1. package/bin/action/verify.js +13 -3
  2. package/lib/conclusion.js +10 -5
  3. package/lib/consequent.js +8 -3
  4. package/lib/context/file.js +74 -4
  5. package/lib/context/release.js +7 -2
  6. package/lib/equality.js +16 -16
  7. package/lib/premise.js +12 -7
  8. package/lib/supposition.js +9 -4
  9. package/lib/type.js +3 -8
  10. package/lib/utilities/string.js +26 -13
  11. package/lib/verifier/node/metastatement.js +173 -0
  12. package/lib/verifier/node/statementAsCombinator.js +186 -0
  13. package/lib/verifier/node/termAsConstructor.js +224 -0
  14. package/lib/verifier/node.js +158 -0
  15. package/lib/verifier/{metastatementForMetavariable → nodes/metastatementForMetavariable}/conclusion.js +13 -12
  16. package/lib/verifier/{metastatementForMetavariable → nodes/metastatementForMetavariable}/premise.js +13 -12
  17. package/lib/verifier/nodes/metastatementForMetavariable.js +198 -0
  18. package/lib/verifier/nodes/statement.js +199 -0
  19. package/lib/verifier/{statementForMetavariable → nodes/statementForMetavariable}/conclusion.js +13 -12
  20. package/lib/verifier/{statementForMetavariable → nodes/statementForMetavariable}/premise.js +13 -12
  21. package/lib/verifier/nodes/statementForMetavariable.js +203 -0
  22. package/lib/verifier/nodes/term.js +212 -0
  23. package/lib/verifier/{termForVariable/supposition.js → nodes/termForVariable/consequent.js} +13 -12
  24. package/lib/verifier/{termForVariable/consequent.js → nodes/termForVariable/supposition.js} +13 -12
  25. package/lib/verifier/nodes/termForVariable.js +209 -0
  26. package/lib/verifier/nodes.js +175 -0
  27. package/lib/verify/assertion/type.js +20 -10
  28. package/lib/verify/axiom.js +3 -3
  29. package/lib/verify/conclusion.js +3 -3
  30. package/lib/verify/conjecture.js +3 -3
  31. package/lib/verify/consequent.js +3 -3
  32. package/lib/verify/declaration/combinator.js +7 -2
  33. package/lib/verify/declaration/constructor.js +8 -2
  34. package/lib/verify/declaration/metavariable.js +7 -2
  35. package/lib/verify/declaration/type.js +7 -2
  36. package/lib/verify/declaration/variable.js +8 -2
  37. package/lib/verify/file.js +3 -3
  38. package/lib/verify/label.js +9 -4
  39. package/lib/verify/lemma.js +3 -3
  40. package/lib/verify/metastatement/qualified.js +5 -6
  41. package/lib/verify/metastatement/unqualified.js +9 -7
  42. package/lib/verify/metastatement.js +34 -157
  43. package/lib/verify/metavariable.js +6 -4
  44. package/lib/verify/premise.js +3 -3
  45. package/lib/verify/release.js +3 -3
  46. package/lib/verify/rule.js +3 -3
  47. package/lib/verify/statement/qualified.js +5 -6
  48. package/lib/verify/statement/unqualified.js +9 -7
  49. package/lib/verify/statement.js +112 -317
  50. package/lib/verify/statementAsCombinator.js +8 -82
  51. package/lib/verify/supposition.js +3 -3
  52. package/lib/verify/term.js +69 -213
  53. package/lib/verify/termAsConstructor.js +15 -89
  54. package/lib/verify/theorem.js +3 -3
  55. package/lib/verify/type.js +7 -5
  56. package/lib/verify/typeInference.js +5 -5
  57. package/lib/verify/variable.js +7 -5
  58. package/package.json +5 -5
  59. package/src/conclusion.js +5 -4
  60. package/src/consequent.js +3 -2
  61. package/src/context/file.js +11 -4
  62. package/src/context/release.js +9 -2
  63. package/src/equality.js +10 -10
  64. package/src/premise.js +7 -6
  65. package/src/supposition.js +4 -3
  66. package/src/type.js +3 -8
  67. package/src/utilities/string.js +34 -23
  68. package/src/verifier/node/metastatement.js +57 -0
  69. package/src/verifier/node/statementAsCombinator.js +80 -0
  70. package/src/verifier/node/termAsConstructor.js +124 -0
  71. package/src/verifier/node.js +85 -0
  72. package/src/verifier/nodes/metastatementForMetavariable/conclusion.js +11 -0
  73. package/src/verifier/nodes/metastatementForMetavariable/premise.js +11 -0
  74. package/src/verifier/{metastatementForMetavariable.js → nodes/metastatementForMetavariable.js} +6 -6
  75. package/src/verifier/nodes/statement.js +98 -0
  76. package/src/verifier/nodes/statementForMetavariable/conclusion.js +11 -0
  77. package/src/verifier/nodes/statementForMetavariable/premise.js +11 -0
  78. package/src/verifier/{statementForMetavariable.js → nodes/statementForMetavariable.js} +10 -10
  79. package/src/verifier/nodes/term.js +111 -0
  80. package/src/verifier/nodes/termForVariable/consequent.js +11 -0
  81. package/src/verifier/nodes/termForVariable/supposition.js +11 -0
  82. package/src/verifier/{termForVariable.js → nodes/termForVariable.js} +9 -9
  83. package/src/verifier/nodes.js +111 -0
  84. package/src/verify/assertion/type.js +25 -9
  85. package/src/verify/axiom.js +2 -2
  86. package/src/verify/conclusion.js +2 -2
  87. package/src/verify/conjecture.js +2 -2
  88. package/src/verify/consequent.js +2 -2
  89. package/src/verify/declaration/combinator.js +9 -1
  90. package/src/verify/declaration/constructor.js +15 -1
  91. package/src/verify/declaration/metavariable.js +9 -1
  92. package/src/verify/declaration/type.js +14 -1
  93. package/src/verify/declaration/variable.js +15 -1
  94. package/src/verify/file.js +2 -2
  95. package/src/verify/label.js +10 -2
  96. package/src/verify/lemma.js +4 -4
  97. package/src/verify/metastatement/qualified.js +4 -6
  98. package/src/verify/metastatement/unqualified.js +9 -7
  99. package/src/verify/metastatement.js +32 -57
  100. package/src/verify/metavariable.js +6 -3
  101. package/src/verify/premise.js +2 -2
  102. package/src/verify/release.js +2 -2
  103. package/src/verify/rule.js +2 -2
  104. package/src/verify/statement/qualified.js +4 -6
  105. package/src/verify/statement/unqualified.js +9 -7
  106. package/src/verify/statement.js +159 -283
  107. package/src/verify/statementAsCombinator.js +9 -129
  108. package/src/verify/supposition.js +2 -2
  109. package/src/verify/term.js +94 -159
  110. package/src/verify/termAsConstructor.js +20 -135
  111. package/src/verify/theorem.js +2 -2
  112. package/src/verify/type.js +7 -4
  113. package/src/verify/typeInference.js +4 -4
  114. package/src/verify/variable.js +7 -4
  115. package/lib/verifier/metastatementForMetavariable.js +0 -198
  116. package/lib/verifier/statementForMetavariable.js +0 -203
  117. package/lib/verifier/termForVariable.js +0 -209
  118. package/lib/verifier.js +0 -138
  119. package/src/verifier/metastatementForMetavariable/conclusion.js +0 -9
  120. package/src/verifier/metastatementForMetavariable/premise.js +0 -9
  121. package/src/verifier/statementForMetavariable/conclusion.js +0 -9
  122. package/src/verifier/statementForMetavariable/premise.js +0 -9
  123. package/src/verifier/termForVariable/consequent.js +0 -9
  124. package/src/verifier/termForVariable/supposition.js +0 -9
  125. package/src/verifier.js +0 -74
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ import StatementForMetavariableNodesVerifier from "../../../verifier/nodes/statementForMetavariable";
4
+
5
+ class ConclusionStatementForMetavariableNodesVerifier extends StatementForMetavariableNodesVerifier {
6
+ static createSubstitutions = false;
7
+ }
8
+
9
+ const conclusionStatementForMetavariableNodesVerifier = new ConclusionStatementForMetavariableNodesVerifier();
10
+
11
+ export default conclusionStatementForMetavariableNodesVerifier;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ import StatementForMetavariableNodesVerifier from "../../../verifier/nodes/statementForMetavariable";
4
+
5
+ class PremiseStatementForMetavariableNodesVerifier extends StatementForMetavariableNodesVerifier {
6
+ static createSubstitutions = true;
7
+ }
8
+
9
+ const premiseStatementForMetavariableNodesVerifier = new PremiseStatementForMetavariableNodesVerifier();
10
+
11
+ export default premiseStatementForMetavariableNodesVerifier;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
 
3
- import Verifier from "../verifier";
4
- import StatementForMetavariableSubstitution from "../substitution/statementForMetavariable";
3
+ import NodesVerifier from "../../verifier/nodes";
4
+ import StatementForMetavariableSubstitution from "../../substitution/statementForMetavariable";
5
5
 
6
- import { nodeQuery } from "../utilities/query";
7
- import { metavariableNameFromMetavariableNode } from "../utilities/query";
8
- import { STATEMENT_RULE_NAME, METASTATEMENT_RULE_NAME, META_ARGUMENT_RULE_NAME } from "../ruleNames";
6
+ import { nodeQuery } from "../../utilities/query";
7
+ import { metavariableNameFromMetavariableNode } from "../../utilities/query";
8
+ import { STATEMENT_RULE_NAME, METASTATEMENT_RULE_NAME, META_ARGUMENT_RULE_NAME } from "../../ruleNames";
9
9
 
10
10
  const metavariableNodeQuery = nodeQuery('/metastatement/metavariable!'),
11
11
  metaArgumentChildNodeNodeQuery = nodeQuery('/metaArgument/*!');
12
12
 
13
- export default class StatementForMetavariableVerifier extends Verifier {
13
+ export default class StatementForMetavariableNodesVerifier extends NodesVerifier {
14
14
  verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, fileContextA, proofContextB) {
15
15
  let nonTerminalNodeVerified = false;
16
16
 
@@ -40,11 +40,11 @@ export default class StatementForMetavariableVerifier extends Verifier {
40
40
  } else {
41
41
  const nonTerminalNodeAChildNodes = nonTerminalNodeA.getChildNodes(),
42
42
  nonTerminalNodeBChildNodes = nonTerminalNodeB.getChildNodes(),
43
- nodesA = nonTerminalNodeAChildNodes, ///
44
- nodesB = nonTerminalNodeBChildNodes, ///
45
- nodesMatch = this.verifyNodes(nodesA, nodesB, substitutions, fileContextA, proofContextB);
43
+ childNodesA = nonTerminalNodeAChildNodes, ///
44
+ childNodesB = nonTerminalNodeBChildNodes, ///
45
+ childNodesVerified = this.verifyChildNodes(childNodesA, childNodesB, substitutions, fileContextA, proofContextB);
46
46
 
47
- nonTerminalNodeVerified = nodesMatch; ///
47
+ nonTerminalNodeVerified = childNodesVerified; ///
48
48
  }
49
49
  } else if (nonTerminalNodeBRuleName === nonTerminalNodeARuleName) {
50
50
  nonTerminalNodeVerified = super.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, fileContextA, proofContextB);
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ import NodesVerifier from "../../verifier/nodes";
4
+
5
+ import { first } from "../../utilities/array";
6
+ import { ARGUMENT_RULE_NAME } from "../../ruleNames";
7
+ import { nodeQuery, typeNameFromTypeNode } from "../../utilities/query";
8
+
9
+ const termNodeQuery = nodeQuery("/argument/term!"),
10
+ typeNodeQuery = nodeQuery("/argument/type!");
11
+
12
+ class TermNodesVerifier extends NodesVerifier {
13
+ verifyNonTerminalNode(nonTerminalNode, constructorNonTerminalNode, context, verifyAhead) {
14
+ let nonTerminalNodeVerified = false;
15
+
16
+ const ruleName = nonTerminalNode.getRuleName(), ///
17
+ constructorRuleName = constructorNonTerminalNode.getRuleName(); ///
18
+
19
+ if (ruleName === constructorRuleName) {
20
+ switch (ruleName) {
21
+ case ARGUMENT_RULE_NAME: {
22
+ const argumentNode = nonTerminalNode, ///
23
+ constructorArgumentNode = constructorNonTerminalNode, ///
24
+ argumentVerified = verifyArgument(argumentNode, constructorArgumentNode, context, verifyAhead),
25
+ argumentNodeVerified = argumentVerified; ///
26
+
27
+ nonTerminalNodeVerified = argumentNodeVerified; ///
28
+
29
+ break;
30
+ }
31
+
32
+ default: {
33
+ nonTerminalNodeVerified = super.verifyNonTerminalNode(nonTerminalNode, constructorNonTerminalNode, context, verifyAhead);
34
+
35
+ break;
36
+ }
37
+ }
38
+ }
39
+
40
+ return nonTerminalNodeVerified;
41
+ }
42
+ }
43
+
44
+ const termNodesVerifier = new TermNodesVerifier();
45
+
46
+ export default termNodesVerifier;
47
+
48
+ export function verifyArgument(argumentNode, constructorArgumentNode, context, verifyAhead) {
49
+ let argumentVerified = false;
50
+
51
+ const argumentString = context.nodeAsString(argumentNode);
52
+
53
+ context.trace(`Verifying the '${argumentString}' argument...`, argumentNode);
54
+
55
+ const typeNode = typeNodeQuery(argumentNode);
56
+
57
+ if (typeNode !== null) {
58
+ context.info(`The '${argumentString}' argument should be a term, not a type`, argumentNode);
59
+ } else {
60
+ const termNode = termNodeQuery(argumentNode);
61
+
62
+ if (!argumentVerified) {
63
+ const constructorTermNode = termNodeQuery(constructorArgumentNode);
64
+
65
+ if (constructorTermNode !== null) {
66
+ const node = termNode, ///
67
+ constructorNode = constructorTermNode, ///
68
+ nodeVerified = this.verifyNode(node, constructorNode, context, verifyAhead);
69
+
70
+ argumentVerified = nodeVerified; ///
71
+ }
72
+ }
73
+
74
+ if (!argumentVerified) {
75
+ const constructorTypeNode = typeNodeQuery(constructorArgumentNode);
76
+
77
+ if (constructorTypeNode !== null) {
78
+ const { verifyTerm } = termNodesVerifier,
79
+ types = [],
80
+ termVerified = verifyTerm(termNode, types, context, () => {
81
+ let verifiedAhead = false;
82
+
83
+ const constructorTypeName = typeNameFromTypeNode(constructorTypeNode),
84
+ firstType = first(types),
85
+ termType = firstType, ///
86
+ termTypeName = termType.getName(),
87
+ constructorType = context.findTypeByTypeName(constructorTypeName),
88
+ termTypeEqualToOrSubTypeOfType = termType.isEqualToOrSubTypeOf(constructorType);
89
+
90
+ if (termTypeEqualToOrSubTypeOfType) {
91
+ const termString = context.nodeAsString(termNode);
92
+
93
+ context.trace(`The '${termTypeName}' type of the '${termString}' term is equal to or a sub-type of the '${constructorTypeName}' type in the constructor.`, argumentNode);
94
+
95
+ verifiedAhead = verifyAhead();
96
+ }
97
+
98
+ return verifiedAhead;
99
+ });
100
+
101
+ argumentVerified = termVerified; ///
102
+ }
103
+ }
104
+ }
105
+
106
+ if (argumentVerified) {
107
+ context.debug(`...verified the '${argumentString}' argument.`, argumentNode);
108
+ }
109
+
110
+ return argumentVerified;
111
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ import TermForVariableNodesVerifier from "../../../verifier/nodes/termForVariable";
4
+
5
+ class ConsequentTermForVariableNodesVerifier extends TermForVariableNodesVerifier {
6
+ static createSubstitutions = false;
7
+ }
8
+
9
+ const consequentTermForVariableNodesVerifier = new ConsequentTermForVariableNodesVerifier();
10
+
11
+ export default consequentTermForVariableNodesVerifier;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ import TermForVariableNodesVerifier from "../../../verifier/nodes/termForVariable";
4
+
5
+ class SuppositionTermForVariableNodesVerifier extends TermForVariableNodesVerifier {
6
+ static createSubstitutions = true;
7
+ }
8
+
9
+ const suppositionTermForVariableNodesVerifier = new SuppositionTermForVariableNodesVerifier();
10
+
11
+ export default suppositionTermForVariableNodesVerifier;
@@ -1,17 +1,17 @@
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 {
14
+ export default class TermForVariableNodesVerifier extends NodesVerifier {
15
15
  verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, proofContextA, proofContextB) {
16
16
  let nonTerminalNodeVerified = false;
17
17
 
@@ -83,7 +83,7 @@ export default class TermForVariableVerifier extends Verifier {
83
83
  const types = [],
84
84
  context = proofContextB, ///
85
85
  termNode = termNodeB, ///
86
- termVerified = verifyTerm(termNode, types, context);
86
+ termVerified = verifyTerm(termNode, types, context, verifyAhead);
87
87
 
88
88
  if (termVerified) {
89
89
  const firstType = first(types),
@@ -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
+ }
@@ -15,14 +15,14 @@ export default function verifyTypeAssertion(typeAssertionNode, assignments, deri
15
15
 
16
16
  const typeAssertionString = context.nodeAsString(typeAssertionNode);
17
17
 
18
- context.debug(`Verifying the '${typeAssertionString}' type assertion...`, typeAssertionNode);
18
+ context.trace(`Verifying the '${typeAssertionString}' type assertion...`, typeAssertionNode);
19
19
 
20
20
  const typeNode = typeNodeQuery(typeAssertionNode),
21
21
  typeName = typeNameFromTypeNode(typeNode),
22
22
  typePresent = context.isTypePresentByTypeName(typeName);
23
23
 
24
24
  if (!typePresent) {
25
- context.error(`The '${typeName}' type is not present.`, typeAssertionNode);
25
+ context.info(`The '${typeName}' type is not present.`, typeAssertionNode);
26
26
  } else {
27
27
  if (!typeAssertionVerified) {
28
28
  const variableTypeAssertionVerified = verifyVariableTypeAssertion(typeAssertionNode, assignments, derived, context);
@@ -38,7 +38,7 @@ export default function verifyTypeAssertion(typeAssertionNode, assignments, deri
38
38
  }
39
39
 
40
40
  if (typeAssertionVerified) {
41
- context.info(`Verified the '${typeAssertionString}' statement type assertion.`, typeAssertionNode);
41
+ context.debug(`...verified the '${typeAssertionString}' statement type assertion.`, typeAssertionNode);
42
42
  }
43
43
 
44
44
  return typeAssertionVerified;
@@ -52,13 +52,17 @@ export function verifyVariableTypeAssertion(typeAssertionNode, assignments, deri
52
52
  termVerifiedAsVariable = verifyTermAsVariable(termNode, variables, context);
53
53
 
54
54
  if (termVerifiedAsVariable) {
55
+ const typeAssertionString = context.nodeAsString(typeAssertionNode);
56
+
57
+ context.trace(`Verifying the '${typeAssertionString}' variable type assertion...`, typeAssertionNode);
58
+
55
59
  const typeNode = typeNodeQuery(typeAssertionNode),
56
60
  typeName = typeNameFromTypeNode(typeNode),
57
61
  assertedTypeName = typeName, ///
58
62
  assertedType = context.findTypeByTypeName(assertedTypeName);
59
63
 
60
64
  if (assertedType === null) {
61
- context.error(`The '${assertedTypeName}' asserted type is not present.`, typeAssertionNode);
65
+ context.info(`The '${assertedTypeName}' asserted type is not present.`, typeAssertionNode);
62
66
  } else {
63
67
  const firstVariable = first(variables),
64
68
  variable = firstVariable, ///
@@ -72,7 +76,7 @@ export function verifyVariableTypeAssertion(typeAssertionNode, assignments, deri
72
76
  const assertedTypeName = assertedType.getName(),
73
77
  variableTypeName = variableType.getName();
74
78
 
75
- context.error(`The '${assertedTypeName}' asserted type is not equal to or a super-type of the '${variableName}' variable's '${variableTypeName}' type.`, typeAssertionNode);
79
+ context.info(`The '${assertedTypeName}' asserted type is not equal to or a super-type of the '${variableName}' variable's '${variableTypeName}' type.`, typeAssertionNode);
76
80
  } else {
77
81
  variableTypeAssertionVerified = true;
78
82
  }
@@ -83,7 +87,7 @@ export function verifyVariableTypeAssertion(typeAssertionNode, assignments, deri
83
87
  const assertedTypeName = assertedType.getName(),
84
88
  variableTypeName = variableType.getName();
85
89
 
86
- context.error(`The '${assertedTypeName}' asserted type is not equal to or a sub-type of the '${variableName}' variable's '${variableTypeName}' type.`, typeAssertionNode);
90
+ context.info(`The '${assertedTypeName}' asserted type is not equal to or a sub-type of the '${variableName}' variable's '${variableTypeName}' type.`, typeAssertionNode);
87
91
  } else {
88
92
  const name = variableName, ///
89
93
  type = assertedType, ///
@@ -96,6 +100,10 @@ export function verifyVariableTypeAssertion(typeAssertionNode, assignments, deri
96
100
  }
97
101
  }
98
102
  }
103
+
104
+ if (variableTypeAssertionVerified) {
105
+ context.debug(`...verified the '${typeAssertionString}' variable type assertion.`, typeAssertionNode);
106
+ }
99
107
  }
100
108
 
101
109
  return variableTypeAssertionVerified;
@@ -109,13 +117,17 @@ function verifyTermTypeAssertion(typeAssertionNode, derived, context) {
109
117
  termVerifiedAgainstConstructors = verifyTermAgainstConstructors(termNode, types, context);
110
118
 
111
119
  if (termVerifiedAgainstConstructors) {
120
+ const typeAssertionString = context.nodeAsString(typeAssertionNode);
121
+
122
+ context.trace(`Verifying the '${typeAssertionString}' term type assertion...`, typeAssertionNode);
123
+
112
124
  const typeNode = typeNodeQuery(typeAssertionNode),
113
125
  typeName = typeNameFromTypeNode(typeNode),
114
126
  assertedTypeName = typeName, ///
115
127
  assertedType = context.findTypeByTypeName(assertedTypeName);
116
128
 
117
129
  if (assertedType === null) {
118
- context.error(`The '${assertedTypeName}' asserted type is not present.`, typeAssertionNode);
130
+ context.info(`The '${assertedTypeName}' asserted type is not present.`, typeAssertionNode);
119
131
  } else {
120
132
  const firstType = first(types),
121
133
  termType = firstType; ///
@@ -128,7 +140,7 @@ function verifyTermTypeAssertion(typeAssertionNode, derived, context) {
128
140
  termTypeName = termType.getName(),
129
141
  assertedTypeName = assertedType.getName();
130
142
 
131
- context.error(`The '${assertedTypeName}' asserted type is not equal to or a super-type of the '${termString}' term's '${termTypeName}' type.`, typeAssertionNode);
143
+ context.info(`The '${assertedTypeName}' asserted type is not equal to or a super-type of the '${termString}' term's '${termTypeName}' type.`, typeAssertionNode);
132
144
  } else {
133
145
  termTypeAssertionVerified = true;
134
146
  }
@@ -140,12 +152,16 @@ function verifyTermTypeAssertion(typeAssertionNode, derived, context) {
140
152
  termTypeName = termType.getName(),
141
153
  assertedTypeName = assertedType.getName();
142
154
 
143
- context.error(`The '${assertedTypeName}' asserted type is not equal to or a sub-type of the '${termString}' term's '${termTypeName}' type.`, typeAssertionNode);
155
+ context.info(`The '${assertedTypeName}' asserted type is not equal to or a sub-type of the '${termString}' term's '${termTypeName}' type.`, typeAssertionNode);
144
156
  } else {
145
157
  termTypeAssertionVerified = true;
146
158
  }
147
159
  }
148
160
  }
161
+
162
+ if (termTypeAssertionVerified) {
163
+ context.debug(`...verified the '${typeAssertionString}' term type assertion.`, typeAssertionNode);
164
+ }
149
165
  }
150
166
 
151
167
  return termTypeAssertionVerified;
@@ -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
  }