occam-verify-cli 0.0.271 → 0.0.272
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/axiom.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
const { labelsAsString } = require("./utilities/string");
|
|
4
4
|
|
|
5
5
|
class Axiom {
|
|
6
|
-
constructor(labels,
|
|
6
|
+
constructor(labels, supposition, consequent, statementNode) {
|
|
7
7
|
this.labels = labels;
|
|
8
|
-
this.
|
|
8
|
+
this.supposition = supposition;
|
|
9
9
|
this.consequent = consequent;
|
|
10
10
|
this.statementNode = statementNode;
|
|
11
11
|
}
|
|
@@ -14,8 +14,8 @@ class Axiom {
|
|
|
14
14
|
return this.labels;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
return this.
|
|
17
|
+
getSupposition() {
|
|
18
|
+
return this.supposition;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
getConsequent() {
|
|
@@ -33,16 +33,16 @@ class Axiom {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
static fromStatementNodeAndLabels(statementNode, labels) {
|
|
36
|
-
const
|
|
36
|
+
const supposition = null,
|
|
37
37
|
consequent = null,
|
|
38
|
-
axiom = new Axiom(labels,
|
|
38
|
+
axiom = new Axiom(labels, supposition, consequent, statementNode);
|
|
39
39
|
|
|
40
40
|
return axiom;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
static
|
|
43
|
+
static fromSuppositionConsequentAndLabels(supposition, consequent, labels) {
|
|
44
44
|
const statementNode = null,
|
|
45
|
-
axiom = new Axiom(labels,
|
|
45
|
+
axiom = new Axiom(labels, supposition, consequent, statementNode);
|
|
46
46
|
|
|
47
47
|
return axiom;
|
|
48
48
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const Axiom = require("../../axiom"),
|
|
4
4
|
verifyLabels = require("../../verify/labels"),
|
|
5
|
-
|
|
5
|
+
verifySupposition = require("../../verify/antecedent"),
|
|
6
6
|
verifyConsequent = require("../../verify/consequent");
|
|
7
7
|
|
|
8
8
|
const { first } = require("../../utilities/array"),
|
|
@@ -26,7 +26,7 @@ function verifyIndicativeConditionalAxiom(axiomNode, context) {
|
|
|
26
26
|
if (labelsVerified) {
|
|
27
27
|
const antecedents = [],
|
|
28
28
|
antecedentNode = antecedentNodeQuery(indicativeConditionalNode),
|
|
29
|
-
antecedentVerified =
|
|
29
|
+
antecedentVerified = verifySupposition(antecedentNode, antecedents, context);
|
|
30
30
|
|
|
31
31
|
if (antecedentVerified) {
|
|
32
32
|
const consequents = [],
|
|
@@ -34,11 +34,11 @@ function verifyIndicativeConditionalAxiom(axiomNode, context) {
|
|
|
34
34
|
consequentVerified = verifyConsequent(consequentNode, consequents, context);
|
|
35
35
|
|
|
36
36
|
if (consequentVerified) {
|
|
37
|
-
const
|
|
37
|
+
const firstSupposition = first(antecedents),
|
|
38
38
|
firstConsequent = first(consequents),
|
|
39
|
-
antecedent =
|
|
39
|
+
antecedent = firstSupposition, ///
|
|
40
40
|
consequent = firstConsequent, ///
|
|
41
|
-
axiom = Axiom.
|
|
41
|
+
axiom = Axiom.fromSuppositionConsequentAndLabels(antecedent, consequent, labels);
|
|
42
42
|
|
|
43
43
|
context.addAxiom(axiom);
|
|
44
44
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
const MetaAssertion = require("../metaAssertion"),
|
|
4
4
|
MetaproofContext = require("../context/metaproof"),
|
|
5
|
-
|
|
5
|
+
verifyMetaSupposition = require("../verify/metaSupposition"),
|
|
6
6
|
verifyQualifiedMetastatement = require("../verify/metastatement/qualified"),
|
|
7
7
|
verifyUnqualifiedMetastatement = require("../verify/metastatement/unqualified");
|
|
8
8
|
|
|
9
9
|
const { nodeQuery, nodesQuery } = require("../utilities/query"),
|
|
10
10
|
{ META_SUBPROOF_RULE_NAME, QUALIFIED_METASTATEMENT_RULE_NAME, UNQUALIFIED_METASTATEMENT_RULE_NAME } = require("../ruleNames");
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const metaSuppositionNodeQuery = nodeQuery("/metaSubproof/metaSupposition!"),
|
|
13
13
|
metaDerivationNodeQuery = nodeQuery("/metaSubproof/metaDerivation!"),
|
|
14
14
|
metaDerivationChildNodesQuery = nodesQuery("/metaDerivation/*"),
|
|
15
15
|
qualifiedMetastatementNodeQuery = nodeQuery("/metaSubproof/qualifiedMetastatement!"),
|
|
@@ -89,10 +89,10 @@ function verifyMetaSubproof(metaSubproofNode, context) {
|
|
|
89
89
|
|
|
90
90
|
context = metaproofContext; ///
|
|
91
91
|
|
|
92
|
-
const
|
|
93
|
-
|
|
92
|
+
const metaSuppositionNode = metaSuppositionNodeQuery(metaSubproofNode),
|
|
93
|
+
metaSuppositionVerified = verifyMetaSupposition(metaSuppositionNode, context);
|
|
94
94
|
|
|
95
|
-
if (
|
|
95
|
+
if (metaSuppositionVerified) {
|
|
96
96
|
let metaDerivationVerified = true;
|
|
97
97
|
|
|
98
98
|
const metaDerivationNode = metaDerivationNodeQuery(metaSubproofNode);
|
|
@@ -5,20 +5,20 @@ const MetaAssertion = require("../metaAssertion"),
|
|
|
5
5
|
|
|
6
6
|
const { nodeQuery } = require("../utilities/query");
|
|
7
7
|
|
|
8
|
-
const unqualifiedMetastatementNodeQuery = nodeQuery("/
|
|
8
|
+
const unqualifiedMetastatementNodeQuery = nodeQuery("/metaSupposition/unqualifiedMetastatement!");
|
|
9
9
|
|
|
10
|
-
function
|
|
11
|
-
const unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(
|
|
10
|
+
function verifyMetaSupposition(metaSuppositionNode, context) {
|
|
11
|
+
const unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(metaSuppositionNode),
|
|
12
12
|
unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, context),
|
|
13
|
-
|
|
13
|
+
metaSuppositionVerified = unqualifiedMetastatementVerified; ///
|
|
14
14
|
|
|
15
|
-
if (
|
|
15
|
+
if (metaSuppositionVerified) {
|
|
16
16
|
const metaAssertion = MetaAssertion.fromUnqualifiedMetastatementNode(unqualifiedMetastatementNode);
|
|
17
17
|
|
|
18
18
|
context.addMetaAssertion(metaAssertion);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
return
|
|
21
|
+
return metaSuppositionVerified;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
module.exports =
|
|
24
|
+
module.exports = verifyMetaSupposition;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const Assertion = require("../assertion"),
|
|
4
|
+
verifyUnqualifiedStatement = require("../verify/statement/unqualified");
|
|
5
|
+
|
|
6
|
+
const { nodeQuery } = require("../utilities/query");
|
|
7
|
+
|
|
8
|
+
const unqualifiedStatementNodeQuery = nodeQuery("/supposition/unqualifiedStatement!");
|
|
9
|
+
|
|
10
|
+
function verifySupposition(suppositionNode, suppositions, context) {
|
|
11
|
+
const unqualifiedStatementNode = unqualifiedStatementNodeQuery(suppositionNode),
|
|
12
|
+
unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, context),
|
|
13
|
+
suppositionVerified = unqualifiedStatementVerified;
|
|
14
|
+
|
|
15
|
+
if (suppositionVerified) {
|
|
16
|
+
const supposition = Assertion.fromUnqualifiedStatementNode(unqualifiedStatementNode);
|
|
17
|
+
|
|
18
|
+
suppositions.push(supposition);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return suppositionVerified;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = verifySupposition;
|
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.272",
|
|
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.353",
|
|
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.320",
|
|
19
19
|
"occam-open-cli": "^5.0.37",
|
|
20
20
|
"occam-parsers": "^16.0.122"
|
|
21
21
|
},
|
package/bin/verify/antecedent.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const Assertion = require("../assertion"),
|
|
4
|
-
verifyUnqualifiedStatement = require("../verify/statement/unqualified");
|
|
5
|
-
|
|
6
|
-
const { nodeQuery } = require("../utilities/query");
|
|
7
|
-
|
|
8
|
-
const unqualifiedStatementNodeQuery = nodeQuery("/antecedent/unqualifiedStatement!");
|
|
9
|
-
|
|
10
|
-
function verifyAntecedent(antecedentNode, antecedents, context) {
|
|
11
|
-
const unqualifiedStatementNode = unqualifiedStatementNodeQuery(antecedentNode),
|
|
12
|
-
unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, context),
|
|
13
|
-
antecedentVerified = unqualifiedStatementVerified;
|
|
14
|
-
|
|
15
|
-
if (antecedentVerified) {
|
|
16
|
-
const antecedent = Assertion.fromUnqualifiedStatementNode(unqualifiedStatementNode);
|
|
17
|
-
|
|
18
|
-
antecedents.push(antecedent);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return antecedentVerified;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
module.exports = verifyAntecedent;
|