occam-verify-cli 0.0.507 → 0.0.509

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 (91) hide show
  1. package/lib/assertion/type.js +90 -0
  2. package/lib/axiomLemmaTheorem.js +2 -2
  3. package/lib/combinator.js +7 -1
  4. package/lib/conclusion.js +6 -6
  5. package/lib/consequence.js +4 -4
  6. package/lib/matcher/metastatementForMetavariable/conclusion.js +113 -0
  7. package/lib/matcher/metastatementForMetavariable/premise.js +113 -0
  8. package/lib/matcher/metastatementForMetavariable.js +201 -0
  9. package/lib/matcher/statementForMetavariable/conclusion.js +113 -0
  10. package/lib/matcher/statementForMetavariable/premise.js +113 -0
  11. package/lib/matcher/statementForMetavariable.js +201 -0
  12. package/lib/matcher/statementForVariable/consequence.js +113 -0
  13. package/lib/matcher/statementForVariable/supposition.js +113 -0
  14. package/lib/matcher/statementForVariable.js +201 -0
  15. package/lib/matcher.js +124 -10
  16. package/lib/premise.js +19 -19
  17. package/lib/rule.js +11 -11
  18. package/lib/substitution/metastatementForMetavariable.js +86 -0
  19. package/lib/substitution/statementForMetavariable.js +86 -0
  20. package/lib/substitution/statementForVariable.js +86 -0
  21. package/lib/supposition.js +9 -9
  22. package/lib/verify/assertion/type.js +19 -23
  23. package/lib/verify/conclusion.js +6 -5
  24. package/lib/verify/consequence.js +6 -5
  25. package/lib/verify/derivation.js +2 -2
  26. package/lib/verify/metastatement/qualified.js +19 -5
  27. package/lib/verify/metastatement/unqualified.js +16 -4
  28. package/lib/verify/metastatement.js +3 -3
  29. package/lib/verify/premise.js +6 -5
  30. package/lib/verify/ruleDerivation.js +2 -2
  31. package/lib/verify/statement/qualified.js +9 -8
  32. package/lib/verify/statement/unqualified.js +16 -4
  33. package/lib/verify/statement.js +106 -9
  34. package/lib/verify/supposition.js +11 -11
  35. package/package.json +3 -3
  36. package/src/assertion/type.js +46 -0
  37. package/src/axiomLemmaTheorem.js +1 -1
  38. package/src/combinator.js +4 -0
  39. package/src/conclusion.js +9 -9
  40. package/src/consequence.js +5 -5
  41. package/src/matcher/metastatementForMetavariable/conclusion.js +9 -0
  42. package/src/matcher/metastatementForMetavariable/premise.js +9 -0
  43. package/src/matcher/metastatementForMetavariable.js +99 -0
  44. package/src/matcher/statementForMetavariable/conclusion.js +9 -0
  45. package/src/matcher/statementForMetavariable/premise.js +9 -0
  46. package/src/matcher/statementForMetavariable.js +99 -0
  47. package/src/matcher/statementForVariable/consequence.js +9 -0
  48. package/src/matcher/statementForVariable/supposition.js +9 -0
  49. package/src/matcher/statementForVariable.js +99 -0
  50. package/src/matcher.js +70 -3
  51. package/src/premise.js +42 -42
  52. package/src/rule.js +12 -12
  53. package/src/{metaSubstitution.js → substitution/metastatementForMetavariable.js} +7 -7
  54. package/src/{substitution.js → substitution/statementForMetavariable.js} +7 -7
  55. package/src/substitution/statementForVariable.js +64 -0
  56. package/src/supposition.js +20 -20
  57. package/src/verify/assertion/type.js +24 -25
  58. package/src/verify/conclusion.js +11 -5
  59. package/src/verify/consequence.js +10 -4
  60. package/src/verify/derivation.js +4 -2
  61. package/src/verify/metastatement/qualified.js +20 -6
  62. package/src/verify/metastatement/unqualified.js +13 -3
  63. package/src/verify/metastatement.js +2 -2
  64. package/src/verify/premise.js +10 -4
  65. package/src/verify/ruleDerivation.js +4 -2
  66. package/src/verify/statement/qualified.js +13 -11
  67. package/src/verify/statement/unqualified.js +13 -3
  68. package/src/verify/statement.js +175 -9
  69. package/src/verify/supposition.js +16 -12
  70. package/lib/matcher/conclusion.js +0 -194
  71. package/lib/matcher/consequence.js +0 -194
  72. package/lib/matcher/premise.js +0 -199
  73. package/lib/matcher/supposition.js +0 -199
  74. package/lib/metaMatcher/conclusion.js +0 -194
  75. package/lib/metaMatcher/premise.js +0 -199
  76. package/lib/metaMatcher.js +0 -36
  77. package/lib/metaSubstitution.js +0 -86
  78. package/lib/mixins/matcher.js +0 -109
  79. package/lib/substitution.js +0 -86
  80. package/lib/verify/metaDerivation.js +0 -63
  81. package/lib/verify/metaproof.js +0 -32
  82. package/src/matcher/conclusion.js +0 -86
  83. package/src/matcher/consequence.js +0 -89
  84. package/src/matcher/premise.js +0 -94
  85. package/src/matcher/supposition.js +0 -97
  86. package/src/metaMatcher/conclusion.js +0 -86
  87. package/src/metaMatcher/premise.js +0 -94
  88. package/src/metaMatcher.js +0 -9
  89. package/src/mixins/matcher.js +0 -81
  90. package/src/verify/metaDerivation.js +0 -75
  91. package/src/verify/metaproof.js +0 -35
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- import MetaproofStep from "../step/metaproof";
4
- import verifyQualifiedMetastatement from "../verify/metastatement/qualified";
5
- import verifyUnqualifiedMetastatement from "../verify/metastatement/unqualified";
6
-
7
- import { nodeQuery, nodesQuery } from "../utilities/query";
8
- import { QUALIFIED_METASTATEMENT_RULE_NAME, UNQUALIFIED_METASTATEMENT_RULE_NAME } from "../ruleNames";
9
-
10
- const childNodesQuery = nodesQuery("/metaDerivation|metaSubDerivation/*"),
11
- metastatementNodeQuery = nodeQuery("/qualifiedMetastatement|unqualifiedMetastatement/metastatement!");
12
-
13
- export default function verifyMetaDerivation(metaDerivationNode, metaproofContext) {
14
- let metaDerivationVerified;
15
-
16
- metaproofContext.begin(metaDerivationNode);
17
-
18
- const childNodes = childNodesQuery(metaDerivationNode);
19
-
20
- metaDerivationVerified = childNodes.every((childNode) => {
21
- const childVerified = verifyChild(childNode, metaproofContext);
22
-
23
- if (childVerified) {
24
- return true;
25
- }
26
- });
27
-
28
- metaDerivationVerified ?
29
- metaproofContext.complete(metaDerivationNode) :
30
- metaproofContext.halt(metaDerivationNode);
31
-
32
- return metaDerivationVerified;
33
- }
34
-
35
- function verifyChild(childNode, metaproofContext) {
36
- let childVerified;
37
-
38
- const childNodeRuleName = childNode.getRuleName();
39
-
40
- switch (childNodeRuleName) {
41
- case QUALIFIED_METASTATEMENT_RULE_NAME: {
42
- const qualifiedMetastatementNode = childNode, ///
43
- qualifiedMetastatementVerified = verifyQualifiedMetastatement(qualifiedMetastatementNode, metaproofContext);
44
-
45
- if (qualifiedMetastatementVerified) {
46
- const metastatementNode = metastatementNodeQuery(qualifiedMetastatementNode),
47
- metaproofStep = MetaproofStep.fromMetastatementNode(metastatementNode);
48
-
49
- metaproofContext.addMetaproofStep(metaproofStep);
50
-
51
- childVerified = qualifiedMetastatementVerified; ///
52
- }
53
-
54
- break;
55
- }
56
-
57
- case UNQUALIFIED_METASTATEMENT_RULE_NAME: {
58
- const unqualifiedMetastatementNode = childNode, ///
59
- unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, metaproofContext);
60
-
61
- if (unqualifiedMetastatementVerified) {
62
- const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
63
- metaproofStep = MetaproofStep.fromMetastatementNode(metastatementNode);
64
-
65
- metaproofContext.addMetaproofStep(metaproofStep);
66
-
67
- childVerified = true;
68
- }
69
-
70
- break;
71
- }
72
- }
73
-
74
- return childVerified;
75
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- import verifyMetaDerivation from "../verify/metaDerivation";
4
-
5
- import { matcher } from "../matcher";
6
- import { nodeQuery } from "../utilities/query";
7
-
8
- const metaDerivationNodeQuery = nodeQuery("/metaproof/metaDerivation!");
9
-
10
- export default function verifyMetaproof(metaproofNode, conclusion, metaproofContext) {
11
- let metaproofVerified = false;
12
-
13
- metaproofContext.begin(metaproofNode);
14
-
15
- const metaDerivationNode = metaDerivationNodeQuery(metaproofNode),
16
- metaDerivationVerified = verifyMetaDerivation(metaDerivationNode, metaproofContext);
17
-
18
- if (metaDerivationVerified) {
19
- const lastMetaproofStep = metaproofContext.getLastMetaproofStep(),
20
- metaproofStep = lastMetaproofStep, ///
21
- metastatementNode = metaproofStep.getMetastatementNode(),
22
- conclusionMetastatementNode = conclusion.getMetastatementNode(),
23
- nodeA = metastatementNode, ///
24
- nodeB = conclusionMetastatementNode, ///
25
- nodeMatches = matcher.matchNode(nodeA, nodeB);
26
-
27
- metaproofVerified = nodeMatches; ///
28
- }
29
-
30
- metaproofVerified ?
31
- metaproofContext.complete(metaproofNode) :
32
- metaproofContext.complete(metaproofNode);
33
-
34
- return metaproofVerified;
35
- }