occam-verify-cli 0.0.266 → 0.0.267
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.
|
@@ -6,36 +6,30 @@ const verifyMetaproof = require("../verify/metaproof"),
|
|
|
6
6
|
|
|
7
7
|
const { nodeQuery } = require("../utilities/query");
|
|
8
8
|
|
|
9
|
-
const metaproofNodeQuery = nodeQuery("/
|
|
9
|
+
const metaproofNodeQuery = nodeQuery("/conditionalInference/metaproof!"),
|
|
10
10
|
conclusionNodeQuery = nodeQuery("/conditionalInference/conclusion!"),
|
|
11
11
|
premiseOrPremisesNodeQuery = nodeQuery("/conditionalInference/premise|premises!");
|
|
12
12
|
|
|
13
|
-
function verifyConditionalInference(
|
|
13
|
+
function verifyConditionalInference(conditionalInferenceNode, premises, conclusions, context) {
|
|
14
14
|
let conditionalInferenceVerified = false;
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const premiseOrPremisesNode = premiseOrPremisesNodeQuery(conditionalInferenceNode),
|
|
17
|
+
premiseOrPremisesVerified = verifyPremiseOrPremises(premiseOrPremisesNode, premises, context);
|
|
17
18
|
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (premiseOrPremisesVerified) {
|
|
23
|
-
const conclusionNode = conclusionNodeQuery(inferenceConditionalNode),
|
|
24
|
-
conclusionVerified = verifyConclusion(conclusionNode, conclusions, context);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const metaproofNode = metaproofNodeQuery(ruleNode);
|
|
19
|
+
if (premiseOrPremisesVerified) {
|
|
20
|
+
const conclusionNode = conclusionNodeQuery(conditionalInferenceNode),
|
|
21
|
+
conclusionVerified = verifyConclusion(conclusionNode, conclusions, context);
|
|
28
22
|
|
|
23
|
+
if (conclusionVerified) {
|
|
29
24
|
let metaproofVerified = true;
|
|
30
25
|
|
|
26
|
+
const metaproofNode = metaproofNodeQuery(conditionalInferenceNode);
|
|
27
|
+
|
|
31
28
|
if (metaproofNode !== null) {
|
|
32
|
-
metaproofVerified = verifyMetaproof(metaproofNode,
|
|
29
|
+
metaproofVerified = verifyMetaproof(metaproofNode, context);
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
ruleVerified = true;
|
|
37
|
-
}
|
|
38
|
-
conditionalInferenceVerified = conclusionVerified;
|
|
32
|
+
conditionalInferenceVerified = metaproofVerified; ///
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
35
|
|
package/bin/verify/rule.js
CHANGED
|
@@ -40,13 +40,13 @@ function verifyRule(ruleNode, context) {
|
|
|
40
40
|
unconditionalInferenceNode = unconditionalInferenceNodeQuery(ruleNode);
|
|
41
41
|
|
|
42
42
|
if (conditionalInferenceNode !== null) {
|
|
43
|
-
const conditionalInferenceVerified = verifyConditionalInference(
|
|
43
|
+
const conditionalInferenceVerified = verifyConditionalInference(conditionalInferenceNode, premises, conclusions, context);
|
|
44
44
|
|
|
45
45
|
ruleVerified = conditionalInferenceVerified; ///
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
if (unconditionalInferenceNode !== null) {
|
|
49
|
-
const unconditionalInferenceVerified = verifyUnconditionalInference(
|
|
49
|
+
const unconditionalInferenceVerified = verifyUnconditionalInference(unconditionalInferenceNode, premises, conclusions, context);
|
|
50
50
|
|
|
51
51
|
ruleVerified = unconditionalInferenceVerified; ///
|
|
52
52
|
}
|
|
@@ -8,8 +8,8 @@ const { nodeQuery } = require("../../utilities/query");
|
|
|
8
8
|
const metastatementNodeQuery = nodeQuery("/*/metastatement"),
|
|
9
9
|
unqualifiedMetastatementNodeQuery = nodeQuery("/rule/unqualifiedMetastatement!");
|
|
10
10
|
|
|
11
|
-
function
|
|
12
|
-
let
|
|
11
|
+
function verifyUnconditionalInference(ruleNode, premises, conclusions, context) {
|
|
12
|
+
let unconditionalInferenceVerified = false;
|
|
13
13
|
|
|
14
14
|
const unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(ruleNode);
|
|
15
15
|
|
|
@@ -22,11 +22,11 @@ function verifyUnqualifiedMetastatementRule(ruleNode, premises, conclusions, con
|
|
|
22
22
|
|
|
23
23
|
conclusions.push(conclusion);
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
unconditionalInferenceVerified = true;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
return
|
|
29
|
+
return unconditionalInferenceVerified;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
module.exports =
|
|
32
|
+
module.exports = verifyUnconditionalInference;
|
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.267",
|
|
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.348",
|
|
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.315",
|
|
19
19
|
"occam-open-cli": "^5.0.37",
|
|
20
20
|
"occam-parsers": "^16.0.122"
|
|
21
21
|
},
|