occam-verify-cli 0.0.263 → 0.0.265
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.
- package/bin/ruleNames.js +2 -2
- package/bin/verify/conditinalInference.js +45 -0
- package/bin/verify/metaDerivation.js +28 -28
- package/bin/verify/rule.js +29 -22
- package/bin/verify/unconditionalInference.js +32 -0
- package/package.json +3 -3
- package/bin/verify/rule/inferenceConditional.js +0 -52
- package/bin/verify/rule/unqualifiedMetastatement.js +0 -43
package/bin/ruleNames.js
CHANGED
|
@@ -4,7 +4,7 @@ const TERM_RULE_NAME = "term",
|
|
|
4
4
|
TYPE_RULE_NAME = "type",
|
|
5
5
|
ARGUMENT_RULE_NAME = "argument",
|
|
6
6
|
METAVARIABLE_RULE_NAME = "metavariable",
|
|
7
|
-
|
|
7
|
+
META_CONDITIONAL_PROOF_RULE_NAME = "metaConditionalProof",
|
|
8
8
|
QUALIFIED_METASTATEMENT_RULE_NAME = "qualifiedMetastatement",
|
|
9
9
|
UNQUALIFIED_METASTATEMENT_RULE_NAME = "unqualifiedMetastatement";
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ module.exports = {
|
|
|
13
13
|
TYPE_RULE_NAME,
|
|
14
14
|
ARGUMENT_RULE_NAME,
|
|
15
15
|
METAVARIABLE_RULE_NAME,
|
|
16
|
-
|
|
16
|
+
META_CONDITIONAL_PROOF_RULE_NAME,
|
|
17
17
|
QUALIFIED_METASTATEMENT_RULE_NAME,
|
|
18
18
|
UNQUALIFIED_METASTATEMENT_RULE_NAME
|
|
19
19
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const verifyMetaproof = require("../../verify/metaproof"),
|
|
4
|
+
verifyConclusion = require("../../verify/conclusion"),
|
|
5
|
+
verifyPremiseOrPremises = require("../../verify/premiseOrPremises");
|
|
6
|
+
|
|
7
|
+
const { nodeQuery } = require("../../utilities/query");
|
|
8
|
+
|
|
9
|
+
const metaproofNodeQuery = nodeQuery("/rule/metaproof!"),
|
|
10
|
+
conclusionNodeQuery = nodeQuery("/conditionalInference/conclusion!"),
|
|
11
|
+
premiseOrPremisesNodeQuery = nodeQuery("/conditionalInference/premise|premises!");
|
|
12
|
+
|
|
13
|
+
function verifyConditionalInference(ruleNode, premises, conclusions, context) {
|
|
14
|
+
let conditinalInferenceVerified = false;
|
|
15
|
+
|
|
16
|
+
const inferenceConditionalNode = inferenceConditionalNodeQuery(ruleNode);
|
|
17
|
+
|
|
18
|
+
if (inferenceConditionalNode !== null) {
|
|
19
|
+
const premiseOrPremisesNode = premiseOrPremisesNodeQuery(inferenceConditionalNode),
|
|
20
|
+
premiseOrPremisesVerified = verifyPremiseOrPremises(premiseOrPremisesNode, premises, context);
|
|
21
|
+
|
|
22
|
+
if (premiseOrPremisesVerified) {
|
|
23
|
+
const conclusionNode = conclusionNodeQuery(inferenceConditionalNode),
|
|
24
|
+
conclusionVerified = verifyConclusion(conclusionNode, conclusions, context);
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const metaproofNode = metaproofNodeQuery(ruleNode);
|
|
28
|
+
|
|
29
|
+
let metaproofVerified = true;
|
|
30
|
+
|
|
31
|
+
if (metaproofNode !== null) {
|
|
32
|
+
metaproofVerified = verifyMetaproof(metaproofNode, rules, context);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (metaproofVerified) {
|
|
36
|
+
ruleVerified = true;
|
|
37
|
+
}
|
|
38
|
+
conditinalInferenceVerified = conclusionVerified;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return conditinalInferenceVerified;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = verifyConditionalInference;
|
|
@@ -6,99 +6,99 @@ const MetaproofContext = require("../context/metaproof"),
|
|
|
6
6
|
verifyUnqualifiedMetastatement = require("../verify/metastatement/unqualified");
|
|
7
7
|
|
|
8
8
|
const { nodeQuery, nodesQuery } = require("../utilities/query"),
|
|
9
|
-
{
|
|
9
|
+
{ META_CONDITIONAL_PROOF_RULE_NAME, QUALIFIED_METASTATEMENT_RULE_NAME, UNQUALIFIED_METASTATEMENT_RULE_NAME } = require("../ruleNames");
|
|
10
10
|
|
|
11
|
-
const metaAntecedentNodeQuery = nodeQuery("/
|
|
12
|
-
metaDerivationNodeQuery = nodeQuery("/
|
|
11
|
+
const metaAntecedentNodeQuery = nodeQuery("/metaConditionalProof/metaAntecedent!"),
|
|
12
|
+
metaDerivationNodeQuery = nodeQuery("/metaConditionalProof/metaDerivation!"),
|
|
13
13
|
metaDerivationChildNodesQuery = nodesQuery("/metaDerivation/*"),
|
|
14
|
-
qualifiedMetastatementNodeQuery = nodeQuery("/
|
|
15
|
-
unqualifiedMetastatementNodeQuery = nodeQuery("/
|
|
14
|
+
qualifiedMetastatementNodeQuery = nodeQuery("/metaConditionalProof/qualifiedMetastatement!"),
|
|
15
|
+
unqualifiedMetastatementNodeQuery = nodeQuery("/metaConditionalProof/unqualifiedMetastatement!");
|
|
16
16
|
|
|
17
17
|
function verifyMetaDerivation(metaDerivationNode, context) {
|
|
18
18
|
const derived = true;
|
|
19
19
|
|
|
20
20
|
context.setDerived(derived);
|
|
21
21
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
let
|
|
22
|
+
const metaConditionalProofChildNodes = metaDerivationChildNodesQuery(metaDerivationNode),
|
|
23
|
+
metaConditionalProofChildNodesVerified = metaConditionalProofChildNodes.every((metaConditionalProofChildNode) => {
|
|
24
|
+
let metaConditionalProofChildNodeVerified;
|
|
25
25
|
|
|
26
|
-
const ruleName =
|
|
26
|
+
const ruleName = metaConditionalProofChildNode.getRuleName();
|
|
27
27
|
|
|
28
28
|
switch (ruleName) {
|
|
29
|
-
case
|
|
30
|
-
const
|
|
31
|
-
|
|
29
|
+
case META_CONDITIONAL_PROOF_RULE_NAME: {
|
|
30
|
+
const metaConditionalProofNode = metaConditionalProofChildNode, ///
|
|
31
|
+
metaConditionalProofVerified = verifyMetaConditionalProof(metaConditionalProofNode, context);
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
metaConditionalProofChildNodeVerified = metaConditionalProofVerified; ///
|
|
34
34
|
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
case QUALIFIED_METASTATEMENT_RULE_NAME: {
|
|
39
|
-
const qualifiedMetastatementNode =
|
|
39
|
+
const qualifiedMetastatementNode = metaConditionalProofChildNode, ///
|
|
40
40
|
qualifiedMetastatementVerified = verifyQualifiedMetastatement(qualifiedMetastatementNode, context);
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
metaConditionalProofChildNodeVerified = qualifiedMetastatementVerified; ///
|
|
43
43
|
|
|
44
44
|
break;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
case UNQUALIFIED_METASTATEMENT_RULE_NAME: {
|
|
48
|
-
const unqualifiedMetastatementNode =
|
|
48
|
+
const unqualifiedMetastatementNode = metaConditionalProofChildNode, ///
|
|
49
49
|
unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, context);
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
metaConditionalProofChildNodeVerified = unqualifiedMetastatementVerified; ///
|
|
52
52
|
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
return
|
|
57
|
+
return metaConditionalProofChildNodeVerified;
|
|
58
58
|
}),
|
|
59
|
-
metaDerivationVerified =
|
|
59
|
+
metaDerivationVerified = metaConditionalProofChildNodesVerified; ///
|
|
60
60
|
|
|
61
61
|
return metaDerivationVerified;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
module.exports = verifyMetaDerivation;
|
|
65
65
|
|
|
66
|
-
function
|
|
67
|
-
let
|
|
66
|
+
function verifyMetaConditionalProof(metaConditionalProofNode, context) {
|
|
67
|
+
let metaConditionalProofVerified = false;
|
|
68
68
|
|
|
69
69
|
const metaproofContext = MetaproofContext.fromContext(context);
|
|
70
70
|
|
|
71
71
|
context = metaproofContext; ///
|
|
72
72
|
|
|
73
|
-
const metaAntecedentNode = metaAntecedentNodeQuery(
|
|
73
|
+
const metaAntecedentNode = metaAntecedentNodeQuery(metaConditionalProofNode),
|
|
74
74
|
metaAntecedentVerified = verifyMetaAntecedent(metaAntecedentNode, context);
|
|
75
75
|
|
|
76
76
|
if (metaAntecedentVerified) {
|
|
77
77
|
let metaDerivationVerified = true;
|
|
78
78
|
|
|
79
|
-
const metaDerivationNode = metaDerivationNodeQuery(
|
|
79
|
+
const metaDerivationNode = metaDerivationNodeQuery(metaConditionalProofNode);
|
|
80
80
|
|
|
81
81
|
if (metaDerivationNode !== null) {
|
|
82
82
|
metaDerivationVerified = verifyMetaDerivation(metaDerivationNode, context);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
if (metaDerivationVerified) {
|
|
86
|
-
const qualifiedMetastatementNode = qualifiedMetastatementNodeQuery(
|
|
87
|
-
unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(
|
|
86
|
+
const qualifiedMetastatementNode = qualifiedMetastatementNodeQuery(metaConditionalProofNode),
|
|
87
|
+
unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(metaConditionalProofNode);
|
|
88
88
|
|
|
89
89
|
if (qualifiedMetastatementNode !== null) {
|
|
90
90
|
const qualifiedMetastatementVerified = verifyQualifiedMetastatement(qualifiedMetastatementNode, context);
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
metaConditionalProofVerified = qualifiedMetastatementVerified; ///
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
if (unqualifiedMetastatementNode !== null) {
|
|
96
96
|
const unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, context);
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
metaConditionalProofVerified = unqualifiedMetastatementVerified; ///
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
return
|
|
103
|
+
return metaConditionalProofVerified;
|
|
104
104
|
}
|
package/bin/verify/rule.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
const { loggingUtilities } = require("necessary");
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const Rule = require("../rule"),
|
|
6
|
+
verifyLabels = require("../verify/labels"),
|
|
6
7
|
MetaproofContext = require("../context/metaproof"),
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
verifyConditionalInference = require("../verify/conditinalInference"),
|
|
9
|
+
verifyUnconditionalInference = require("../verify/unconditionalInference");
|
|
9
10
|
|
|
10
11
|
const { first } = require("../utilities/array"),
|
|
11
12
|
{ nodesAsString } = require("../utilities/string"),
|
|
@@ -14,7 +15,8 @@ const { first } = require("../utilities/array"),
|
|
|
14
15
|
const { log } = loggingUtilities;
|
|
15
16
|
|
|
16
17
|
const labelNodesQuery = nodesQuery("/rule/label"),
|
|
17
|
-
|
|
18
|
+
conditionalInferenceNodeQuery = nodeQuery("/rule/conditionalInference!"),
|
|
19
|
+
unconditionalInferenceNodeQuery = nodeQuery("/rule/unconditionalInference!");
|
|
18
20
|
|
|
19
21
|
function verifyRule(ruleNode, context) {
|
|
20
22
|
let ruleVerified = false;
|
|
@@ -24,35 +26,40 @@ function verifyRule(ruleNode, context) {
|
|
|
24
26
|
|
|
25
27
|
log.debug(`Verifying the '${labelsString}' rule...`);
|
|
26
28
|
|
|
27
|
-
const
|
|
29
|
+
const labels = [],
|
|
30
|
+
labelsVerified = verifyLabels(labelNodes, labels, context);
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
if (labelsVerified) {
|
|
33
|
+
const metaproofContext = MetaproofContext.fromContext(context);
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
inferenceConditionalRuleVerified = verifyInferenceConditionalRule(ruleNode, rules, context),
|
|
33
|
-
unqualifiedMetastatementRuleVerified = verifyUnqualifiedMetastatementRule(ruleNode, rules, context);
|
|
35
|
+
context = metaproofContext; ///
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
const premises = [],
|
|
38
|
+
conclusions = [],
|
|
39
|
+
conditionalInferenceNode = conditionalInferenceNodeQuery(ruleNode),
|
|
40
|
+
unconditionalInferenceNode = unconditionalInferenceNodeQuery(ruleNode);
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
if (conditionalInferenceNode !== null) {
|
|
43
|
+
const conditionalInferenceVerified = verifyConditionalInference(ruleNode, premises, conclusions, context);
|
|
39
44
|
|
|
40
|
-
|
|
41
|
-
metaproofVerified = verifyMetaproof(metaproofNode, rules, context);
|
|
45
|
+
ruleVerified = conditionalInferenceVerified; ///
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
if (
|
|
45
|
-
|
|
48
|
+
if (unconditionalInferenceNode !== null) {
|
|
49
|
+
const unconditionalInferenceVerified = verifyUnconditionalInference(ruleNode, premises, conclusions, context);
|
|
50
|
+
|
|
51
|
+
ruleVerified = unconditionalInferenceVerified; ///
|
|
46
52
|
}
|
|
47
|
-
}
|
|
48
53
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
if (ruleVerified) {
|
|
55
|
+
const firstConclusion = first(conclusions),
|
|
56
|
+
conclusion = firstConclusion, ///
|
|
57
|
+
rule = Rule.fromPremisesConclusionAndLabels(premises, conclusion, labels);
|
|
52
58
|
|
|
53
|
-
|
|
59
|
+
context.addRule(rule);
|
|
54
60
|
|
|
55
|
-
|
|
61
|
+
log.info(`Verified the '${labelsString}' rule.`);
|
|
62
|
+
}
|
|
56
63
|
}
|
|
57
64
|
|
|
58
65
|
return ruleVerified;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const Conclusion = require("../../conclusion"),
|
|
4
|
+
verifyUnqualifiedMetastatement = require("../../verify/metastatement/unqualified");
|
|
5
|
+
|
|
6
|
+
const { nodeQuery } = require("../../utilities/query");
|
|
7
|
+
|
|
8
|
+
const metastatementNodeQuery = nodeQuery("/*/metastatement"),
|
|
9
|
+
unqualifiedMetastatementNodeQuery = nodeQuery("/rule/unqualifiedMetastatement!");
|
|
10
|
+
|
|
11
|
+
function verifyUnqualifiedMetastatementRule(ruleNode, premises, conclusions, context) {
|
|
12
|
+
let unqualifiedMetastatementRuleVerified = false;
|
|
13
|
+
|
|
14
|
+
const unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(ruleNode);
|
|
15
|
+
|
|
16
|
+
if (unqualifiedMetastatementNode !== null) {
|
|
17
|
+
const unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, context);
|
|
18
|
+
|
|
19
|
+
if (unqualifiedMetastatementVerified) {
|
|
20
|
+
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
21
|
+
conclusion = Conclusion.fromMetastatementNode(metastatementNode);
|
|
22
|
+
|
|
23
|
+
conclusions.push(conclusion);
|
|
24
|
+
|
|
25
|
+
unqualifiedMetastatementRuleVerified = true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return unqualifiedMetastatementRuleVerified;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = verifyUnqualifiedMetastatementRule;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "occam-verify-cli",
|
|
3
3
|
"author": "James Smith",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.265",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/occam-verify-cli",
|
|
7
7
|
"description": "Occam's Verifier",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"argumentative": "^2.0.15",
|
|
14
14
|
"necessary": "^11.0.40",
|
|
15
|
-
"occam-custom-grammars": "^5.0.
|
|
15
|
+
"occam-custom-grammars": "^5.0.346",
|
|
16
16
|
"occam-dom": "^3.0.171",
|
|
17
17
|
"occam-grammar-utilities": "^7.0.66",
|
|
18
|
-
"occam-grammars": "^1.0.
|
|
18
|
+
"occam-grammars": "^1.0.313",
|
|
19
19
|
"occam-open-cli": "^5.0.37",
|
|
20
20
|
"occam-parsers": "^16.0.122"
|
|
21
21
|
},
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const Rule = require("../../rule"),
|
|
4
|
-
verifyLabels = require("../../verify/labels"),
|
|
5
|
-
verifyConclusion = require("../../verify/conclusion"),
|
|
6
|
-
verifyPremiseOrPremises = require("../../verify/premiseOrPremises");
|
|
7
|
-
|
|
8
|
-
const { first } = require("../../utilities/array"),
|
|
9
|
-
{ nodeQuery, nodesQuery } = require("../../utilities/query");
|
|
10
|
-
|
|
11
|
-
const labelNodesQuery = nodesQuery("/rule/label"),
|
|
12
|
-
conclusionNodeQuery = nodeQuery("/inferenceConditional/conclusion!"),
|
|
13
|
-
premiseOrPremisesNodeQuery = nodeQuery("/inferenceConditional/premise|premises!"),
|
|
14
|
-
inferenceConditionalNodeQuery = nodeQuery("/rule/inferenceConditional!");
|
|
15
|
-
|
|
16
|
-
function verifyInferenceConditionalRule(ruleNode, rules, context) {
|
|
17
|
-
let inferenceConditionalRuleVerified = false;
|
|
18
|
-
|
|
19
|
-
const inferenceConditionalNode = inferenceConditionalNodeQuery(ruleNode);
|
|
20
|
-
|
|
21
|
-
if (inferenceConditionalNode !== null) {
|
|
22
|
-
const labels = [],
|
|
23
|
-
labelNodes = labelNodesQuery(ruleNode),
|
|
24
|
-
labelsVerified = verifyLabels(labelNodes, labels, context);
|
|
25
|
-
|
|
26
|
-
if (labelsVerified) {
|
|
27
|
-
const premises = [],
|
|
28
|
-
premiseOrPremisesNode = premiseOrPremisesNodeQuery(inferenceConditionalNode),
|
|
29
|
-
premiseOrPremisesVerified = verifyPremiseOrPremises(premiseOrPremisesNode, premises, context);
|
|
30
|
-
|
|
31
|
-
if (premiseOrPremisesVerified) {
|
|
32
|
-
const conclusions = [],
|
|
33
|
-
conclusionNode = conclusionNodeQuery(inferenceConditionalNode),
|
|
34
|
-
conclusionVerified = verifyConclusion(conclusionNode, conclusions, context);
|
|
35
|
-
|
|
36
|
-
if (conclusionVerified) {
|
|
37
|
-
const firstConclusion = first(conclusions),
|
|
38
|
-
conclusion = firstConclusion, ///
|
|
39
|
-
rule = Rule.fromPremisesConclusionAndLabels(premises, conclusion, labels);
|
|
40
|
-
|
|
41
|
-
rules.push(rule);
|
|
42
|
-
|
|
43
|
-
inferenceConditionalRuleVerified = true;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return inferenceConditionalRuleVerified;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
module.exports = verifyInferenceConditionalRule;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const Rule = require("../../rule"),
|
|
4
|
-
Conclusion = require("../../conclusion"),
|
|
5
|
-
verifyLabels = require("../../verify/labels"),
|
|
6
|
-
verifyUnqualifiedMetastatement = require("../../verify/metastatement/unqualified");
|
|
7
|
-
|
|
8
|
-
const { nodeQuery, nodesQuery } = require("../../utilities/query");
|
|
9
|
-
|
|
10
|
-
const labelNodesQuery = nodesQuery("/rule/label"),
|
|
11
|
-
metastatementNodeQuery = nodeQuery("/*/metastatement"),
|
|
12
|
-
unqualifiedMetastatementNodeQuery = nodeQuery("/rule/unqualifiedMetastatement!");
|
|
13
|
-
|
|
14
|
-
function verifyUnqualifiedMetastatementRule(ruleNode, rules, context) {
|
|
15
|
-
let unqualifiedMetastatementRuleVerified = false;
|
|
16
|
-
|
|
17
|
-
const unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(ruleNode);
|
|
18
|
-
|
|
19
|
-
if (unqualifiedMetastatementNode !== null) {
|
|
20
|
-
const labels = [],
|
|
21
|
-
labelNodes = labelNodesQuery(ruleNode),
|
|
22
|
-
labelsVerified = verifyLabels(labelNodes, labels, context);
|
|
23
|
-
|
|
24
|
-
if (labelsVerified) {
|
|
25
|
-
const unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, context);
|
|
26
|
-
|
|
27
|
-
if (unqualifiedMetastatementVerified) {
|
|
28
|
-
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
29
|
-
conclusion = Conclusion.fromMetastatementNode(metastatementNode),
|
|
30
|
-
premises = [],
|
|
31
|
-
rule = Rule.fromPremisesConclusionAndLabels(premises, conclusion, labels);
|
|
32
|
-
|
|
33
|
-
rules.push(rule);
|
|
34
|
-
|
|
35
|
-
unqualifiedMetastatementRuleVerified = true;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return unqualifiedMetastatementRuleVerified;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
module.exports = verifyUnqualifiedMetastatementRule;
|