occam-verify-cli 0.0.503 → 0.0.505

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.
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  import MetaproofStep from "../step/metaproof";
4
- import MetaproofContext from "../context/metaproof";
5
- import verifyMetaSupposition from "../verify/metaSupposition";
6
4
  import verifyQualifiedMetastatement from "../verify/metastatement/qualified";
7
5
  import verifyUnqualifiedMetastatement from "../verify/metastatement/unqualified";
8
6
 
9
7
  import { nodeQuery, nodesQuery } from "../utilities/query";
10
- import { META_SUBPROOF_RULE_NAME, QUALIFIED_METASTATEMENT_RULE_NAME, UNQUALIFIED_METASTATEMENT_RULE_NAME } from "../ruleNames";
8
+ import { QUALIFIED_METASTATEMENT_RULE_NAME, UNQUALIFIED_METASTATEMENT_RULE_NAME } from "../ruleNames";
11
9
 
12
10
  const childNodesQuery = nodesQuery("/metaDerivation|metaSubDerivation/*"),
13
- metastatementNodeQuery = nodeQuery("/qualifiedMetastatement|unqualifiedMetastatement/metastatement!"),
14
- metaSuppositionNodesQuery = nodesQuery("/metaSubproof/metaSupposition"),
15
- metaSubDerivationNodeQuery = nodeQuery("/metaSubproof/metaSubDerivation");
11
+ metastatementNodeQuery = nodeQuery("/qualifiedMetastatement|unqualifiedMetastatement/metastatement!");
16
12
 
17
13
  export default function verifyMetaDerivation(metaDerivationNode, metaproofContext) {
18
14
  let metaDerivationVerified;
@@ -36,76 +32,12 @@ export default function verifyMetaDerivation(metaDerivationNode, metaproofContex
36
32
  return metaDerivationVerified;
37
33
  }
38
34
 
39
- function verifyMetaSubDerivation(metaSubDerivationNode, metaproofContext) {
40
- let metaSubDerivationVerified;
41
-
42
- metaproofContext.begin(metaSubDerivationNode);
43
-
44
- const childNodes = childNodesQuery(metaSubDerivationNode);
45
-
46
- metaSubDerivationVerified = childNodes.every((childNode) => {
47
- const childVerified = verifyChild(childNode, metaproofContext);
48
-
49
- if (childVerified) {
50
- return true;
51
- }
52
- });
53
-
54
- metaSubDerivationVerified ?
55
- metaproofContext.complete(metaSubDerivationNode) :
56
- metaproofContext.halt(metaSubDerivationNode);
57
-
58
- return metaSubDerivationVerified;
59
- }
60
-
61
- function verifyMetaSubproof(metaSubproofNode, metaproofContext) {
62
- let metaSubproofVerified = false;
63
-
64
- metaproofContext = MetaproofContext.fromMetaproofContext(metaproofContext); ///
65
-
66
- const metaSuppositions = [],
67
- metaSuppositionNodes = metaSuppositionNodesQuery(metaSubproofNode),
68
- metaSuppositionsVerified = metaSuppositionNodes.every((metaSuppositionNode) => {
69
- const metaSuppositionVerified = verifyMetaSupposition(metaSuppositionNode, metaSuppositions, metaproofContext);
70
-
71
- if (metaSuppositionVerified) {
72
- return true;
73
- }
74
- });
75
-
76
- if (metaSuppositionsVerified) {
77
- const metaSubDerivationNode = metaSubDerivationNodeQuery(metaSubproofNode),
78
- metaSubDerivationVerified = verifyMetaSubDerivation(metaSubDerivationNode, metaproofContext);
79
-
80
- if (metaSubDerivationVerified) {
81
- metaSubproofVerified = true;
82
- }
83
- }
84
-
85
- return metaSubproofVerified;
86
- }
87
-
88
35
  function verifyChild(childNode, metaproofContext) {
89
36
  let childVerified;
90
37
 
91
38
  const childNodeRuleName = childNode.getRuleName();
92
39
 
93
40
  switch (childNodeRuleName) {
94
- case META_SUBPROOF_RULE_NAME: {
95
- const metaSubproofNode = childNode, ///
96
- metaSubproofVerified = verifyMetaSubproof(metaSubproofNode, metaproofContext);
97
-
98
- if (metaSubproofVerified) {
99
- const metaproofStep = MetaproofStep.fromMetaSubproofNode(metaSubproofNode);
100
-
101
- metaproofContext.addMetaproofStep(metaproofStep);
102
-
103
- childVerified = true;
104
- }
105
-
106
- break;
107
- }
108
-
109
41
  case QUALIFIED_METASTATEMENT_RULE_NAME: {
110
42
  const qualifiedMetastatementNode = childNode, ///
111
43
  qualifiedMetastatementVerified = verifyQualifiedMetastatement(qualifiedMetastatementNode, metaproofContext);