occam-verify-cli 0.0.272 → 0.0.274
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/.swcrc +5 -0
- package/bin/abbreviations.js +4 -2
- package/bin/context/{package → release}/fileSystem.js +38 -25
- package/bin/fileNames.js +7 -7
- package/bin/loadReleaseContexts.js +52 -0
- package/bin/main.js +8 -9
- package/bin/options.js +2 -2
- package/bin/utilities/fileSystem.js +13 -15
- package/lib/assertion.js +140 -0
- package/lib/axiom.js +90 -0
- package/lib/browser.js +27 -0
- package/lib/combinator.js +58 -0
- package/lib/conclusion.js +140 -0
- package/lib/constants.js +42 -0
- package/lib/constructor.js +76 -0
- package/lib/context/file.js +342 -0
- package/lib/context/metaproof.js +232 -0
- package/lib/context/proof.js +211 -0
- package/lib/context/release.js +303 -0
- package/lib/main.js +27 -0
- package/lib/metaAssertion.js +200 -0
- package/lib/metaSubstitution.js +123 -0
- package/lib/permutationsMatrix.js +466136 -0
- package/lib/premise.js +168 -0
- package/lib/rule.js +139 -0
- package/lib/ruleNames.js +46 -0
- package/lib/type.js +153 -0
- package/lib/utilities/array.js +99 -0
- package/lib/utilities/metastatement.js +45 -0
- package/lib/utilities/permutations.js +114 -0
- package/lib/utilities/query.js +81 -0
- package/lib/utilities/string.js +54 -0
- package/lib/variable.js +94 -0
- package/lib/verify/IndicativeConditional.js +29 -0
- package/lib/verify/assertion/type.js +52 -0
- package/lib/verify/axiom.js +52 -0
- package/lib/verify/conclusion.js +34 -0
- package/lib/verify/conditinalInference.js +30 -0
- package/lib/verify/declaration/combinator.js +24 -0
- package/lib/verify/declaration/constructor.js +24 -0
- package/lib/verify/declaration/topLevel.js +51 -0
- package/lib/verify/declaration/type.js +24 -0
- package/lib/verify/declaration/variable.js +24 -0
- package/lib/verify/equality.js +45 -0
- package/lib/verify/file.js +39 -0
- package/lib/verify/files.js +48 -0
- package/lib/verify/label.js +24 -0
- package/lib/verify/labels.js +27 -0
- package/lib/verify/metaDerivation.js +94 -0
- package/lib/verify/metaproof.js +81 -0
- package/lib/verify/metastatement/qualified.js +31 -0
- package/lib/verify/metastatement/unqualified.js +39 -0
- package/lib/verify/premiseOrPremises.js +39 -0
- package/lib/verify/release.js +61 -0
- package/lib/verify/rule.js +61 -0
- package/lib/verify/statement/qualified.js +24 -0
- package/lib/verify/statement/unqualified.js +32 -0
- package/lib/verify/statement.js +43 -0
- package/lib/verify/statementAsCombinator.js +102 -0
- package/lib/verify/supposition.js +29 -0
- package/lib/verify/term.js +121 -0
- package/lib/verify/termAsConstructor.js +126 -0
- package/lib/verify/termAsVariable.js +31 -0
- package/lib/verify/type.js +45 -0
- package/lib/verify/unconditionalInference.js +31 -0
- package/lib/verify/variable.js +48 -0
- package/package.json +21 -5
- package/{bin → src}/assertion.js +2 -4
- package/src/axiom.js +49 -0
- package/src/browser.js +4 -0
- package/{bin → src}/combinator.js +2 -4
- package/{bin → src}/conclusion.js +4 -6
- package/src/constants.js +9 -0
- package/{bin → src}/constructor.js +2 -4
- package/{bin → src}/context/file.js +34 -24
- package/{bin → src}/context/metaproof.js +13 -3
- package/{bin → src}/context/proof.js +13 -3
- package/src/context/release.js +219 -0
- package/src/main.js +4 -0
- package/{bin → src}/metaAssertion.js +4 -6
- package/{bin → src}/metaSubstitution.js +11 -4
- package/{bin → src}/permutationsMatrix.js +1 -1
- package/{bin → src}/premise.js +6 -8
- package/{bin → src}/rule.js +24 -15
- package/src/ruleNames.js +10 -0
- package/{bin → src}/type.js +1 -3
- package/{bin → src}/utilities/array.js +19 -24
- package/{bin → src}/utilities/metastatement.js +18 -12
- package/{bin → src}/utilities/permutations.js +4 -4
- package/{bin → src}/utilities/query.js +8 -18
- package/{bin → src}/utilities/string.js +4 -10
- package/{bin → src}/variable.js +1 -3
- package/src/verify/IndicativeConditional.js +20 -0
- package/{bin → src}/verify/assertion/type.js +8 -14
- package/src/verify/axiom.js +68 -0
- package/{bin → src}/verify/conclusion.js +4 -6
- package/src/verify/conditinalInference.js +25 -0
- package/{bin → src}/verify/declaration/combinator.js +3 -5
- package/{bin → src}/verify/declaration/constructor.js +3 -5
- package/{bin → src}/verify/declaration/topLevel.js +8 -10
- package/{bin → src}/verify/declaration/type.js +3 -5
- package/{bin → src}/verify/declaration/variable.js +3 -5
- package/{bin → src}/verify/equality.js +4 -6
- package/{bin → src}/verify/file.js +9 -15
- package/{bin → src}/verify/files.js +5 -7
- package/{bin → src}/verify/label.js +3 -9
- package/{bin → src}/verify/labels.js +2 -4
- package/{bin → src}/verify/metaDerivation.js +25 -19
- package/{bin → src}/verify/metaproof.js +6 -7
- package/{bin → src}/verify/metastatement/qualified.js +4 -10
- package/{bin → src}/verify/metastatement/unqualified.js +5 -11
- package/{bin → src}/verify/premiseOrPremises.js +9 -10
- package/src/verify/release.js +70 -0
- package/{bin → src}/verify/rule.js +17 -20
- package/{bin → src}/verify/statement/qualified.js +3 -5
- package/{bin → src}/verify/statement/unqualified.js +3 -5
- package/{bin → src}/verify/statement.js +7 -13
- package/{bin → src}/verify/statementAsCombinator.js +8 -14
- package/{bin → src}/verify/supposition.js +4 -6
- package/{bin → src}/verify/term.js +7 -13
- package/{bin → src}/verify/termAsConstructor.js +13 -19
- package/{bin → src}/verify/termAsVariable.js +3 -9
- package/{bin → src}/verify/type.js +7 -13
- package/{bin → src}/verify/unconditionalInference.js +4 -11
- package/{bin → src}/verify/variable.js +6 -12
- package/bin/axiom.js +0 -52
- package/bin/consequent.js +0 -19
- package/bin/constants.js +0 -19
- package/bin/context/package.js +0 -221
- package/bin/loadPackageContexts.js +0 -53
- package/bin/permutations.js +0 -3
- package/bin/ruleNames.js +0 -23
- package/bin/verify/axiom/IndicativeConditional.js +0 -54
- package/bin/verify/axiom/unqualifiedStatement.js +0 -40
- package/bin/verify/axiom.js +0 -37
- package/bin/verify/conditinalInference.js +0 -42
- package/bin/verify/consequent.js +0 -32
- package/bin/verify/metaConsequent.js +0 -23
- package/bin/verify/metaSupposition.js +0 -24
- package/bin/verify/package.js +0 -81
- package/index.js +0 -9
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { nodeQuery } from "../../utilities/query";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import verifyRule from "../../verify/rule";
|
|
6
|
+
import verifyAxiom from "../../verify/axiom";
|
|
7
|
+
import verifyTypeDeclaration from "../../verify/declaration/type";
|
|
8
|
+
import verifyVariableDeclaration from "../../verify/declaration/variable";
|
|
9
|
+
import verifyCombinatorDeclaration from "../../verify/declaration/combinator";
|
|
10
|
+
import verifyConstructorDeclaration from "../../verify/declaration/constructor";
|
|
11
11
|
|
|
12
12
|
const ruleNodeQuery = nodeQuery("/topLevelDeclaration/rule!"),
|
|
13
13
|
axiomNodeQuery = nodeQuery("/topLevelDeclaration/axiom!"),
|
|
@@ -16,7 +16,7 @@ const ruleNodeQuery = nodeQuery("/topLevelDeclaration/rule!"),
|
|
|
16
16
|
combinatorDeclarationNodeQuery = nodeQuery("/topLevelDeclaration/combinatorDeclaration!"),
|
|
17
17
|
constructorDeclarationNodeQuery = nodeQuery("/topLevelDeclaration/constructorDeclaration!");
|
|
18
18
|
|
|
19
|
-
function verifyTopLevelDeclaration(topLevelDeclarationNode, context) {
|
|
19
|
+
export default function verifyTopLevelDeclaration(topLevelDeclarationNode, context) {
|
|
20
20
|
let topLevelDeclarationVerified = false;
|
|
21
21
|
|
|
22
22
|
const node = topLevelDeclarationNode, ///
|
|
@@ -57,5 +57,3 @@ function verifyTopLevelDeclaration(topLevelDeclarationNode, context) {
|
|
|
57
57
|
|
|
58
58
|
return topLevelDeclarationVerified;
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
module.exports = verifyTopLevelDeclaration;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import verifyType from "../../verify/type";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { nodeQuery } from "../../utilities/query";
|
|
6
6
|
|
|
7
7
|
const firstTypeNodeQuery = nodeQuery("/typeDeclaration/type[0]"),
|
|
8
8
|
secondTypeNodeQuery = nodeQuery("/typeDeclaration/type[1]");
|
|
9
9
|
|
|
10
|
-
function verifyTypeDeclaration(typeDeclarationNode, context) {
|
|
10
|
+
export default function verifyTypeDeclaration(typeDeclarationNode, context) {
|
|
11
11
|
const firstTypeNode = firstTypeNodeQuery(typeDeclarationNode),
|
|
12
12
|
secondTypeNode = secondTypeNodeQuery(typeDeclarationNode),
|
|
13
13
|
typeNode = firstTypeNode, ///
|
|
@@ -17,5 +17,3 @@ function verifyTypeDeclaration(typeDeclarationNode, context) {
|
|
|
17
17
|
|
|
18
18
|
return typeDeclarationVerified;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
module.exports = verifyTypeDeclaration;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import verifyVariable from "../../verify/variable";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { nodeQuery } from "../../utilities/query";
|
|
6
6
|
|
|
7
7
|
const typeNodeQuery = nodeQuery("/variableDeclaration/type"),
|
|
8
8
|
variableNodeQuery = nodeQuery("/variableDeclaration/variable");
|
|
9
9
|
|
|
10
|
-
function verifyVariableDeclaration(variableDeclarationNode, context) {
|
|
10
|
+
export default function verifyVariableDeclaration(variableDeclarationNode, context) {
|
|
11
11
|
const typeNode = typeNodeQuery(variableDeclarationNode),
|
|
12
12
|
variableNode = variableNodeQuery(variableDeclarationNode),
|
|
13
13
|
variableVVerified = verifyVariable(variableNode, typeNode, context),
|
|
@@ -15,5 +15,3 @@ function verifyVariableDeclaration(variableDeclarationNode, context) {
|
|
|
15
15
|
|
|
16
16
|
return variableDeclarationVerified;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
module.exports = verifyVariableDeclaration;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import verifyTerm from "../verify/term";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { nodeQuery } from "../utilities/query";
|
|
6
|
+
import { first, second } from "../utilities/array";
|
|
7
7
|
|
|
8
8
|
const firstTermNodeQuery = nodeQuery("/equality/term[0]"),
|
|
9
9
|
secondTermNodeQuery = nodeQuery("/equality/term[1]");
|
|
10
10
|
|
|
11
|
-
function verifyEquality(equalityNode, context) {
|
|
11
|
+
export default function verifyEquality(equalityNode, context) {
|
|
12
12
|
let equalityVerified = false;
|
|
13
13
|
|
|
14
14
|
const types = [],
|
|
@@ -41,8 +41,6 @@ function verifyEquality(equalityNode, context) {
|
|
|
41
41
|
return equalityVerified;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
module.exports = verifyEquality;
|
|
45
|
-
|
|
46
44
|
function equateTerms(firstTermNode, secondTermNode, context) {
|
|
47
45
|
let termsEqual = true; ///
|
|
48
46
|
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import FileContext from "../context/file";
|
|
4
|
+
import ReleaseContext from "../context/release";
|
|
5
|
+
import verifyTopLevelDeclaration from "../verify/declaration/topLevel";
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
PackageContext = require("../context/package"),
|
|
7
|
-
verifyTopLevelDeclaration = require("../verify/declaration/topLevel");
|
|
8
|
-
|
|
9
|
-
const { nodesQuery } = require("../utilities/query");
|
|
10
|
-
|
|
11
|
-
const { log } = loggingUtilities;
|
|
7
|
+
import { nodesQuery } from "../utilities/query";
|
|
12
8
|
|
|
13
9
|
const topLevelDeclarationNodesQuery = nodesQuery("/document/topLevelDeclaration");
|
|
14
10
|
|
|
15
|
-
function verifyFile(filePath,
|
|
11
|
+
export default function verifyFile(filePath, releaseContext = ReleaseContext.fromNothing()) {
|
|
16
12
|
let fileVerified = false;
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
releaseContext.debug(`Verifying the '${filePath}' file...`);
|
|
19
15
|
|
|
20
|
-
const fileContext = FileContext.
|
|
16
|
+
const fileContext = FileContext.fromReleaseContextAndFilePath(releaseContext, filePath),
|
|
21
17
|
context = fileContext, ///
|
|
22
18
|
node = fileContext.getNode(),
|
|
23
19
|
topLevelDeclarationNodes = topLevelDeclarationNodesQuery(node),
|
|
@@ -30,14 +26,12 @@ function verifyFile(filePath, packageContext = PackageContext.fromNothing()) {
|
|
|
30
26
|
})
|
|
31
27
|
|
|
32
28
|
if (topLevelDeclarationsVerified) {
|
|
33
|
-
|
|
29
|
+
releaseContext.addFileContext(fileContext);
|
|
34
30
|
|
|
35
31
|
fileVerified = true;
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
releaseContext.info(`Verified the '${filePath}' file.`);
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
return fileVerified;
|
|
41
37
|
}
|
|
42
|
-
|
|
43
|
-
module.exports = verifyFile;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import verifyFile from "../verify/file";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { leftDifference } from "../utilities/array";
|
|
6
6
|
|
|
7
|
-
function verifyFiles(
|
|
7
|
+
export default function verifyFiles(releaseContext) {
|
|
8
8
|
let filesVerified = false;
|
|
9
9
|
|
|
10
|
-
const filePaths =
|
|
10
|
+
const filePaths = releaseContext.getFilePaths();
|
|
11
11
|
|
|
12
12
|
for (;;) {
|
|
13
13
|
const filePathsLength = filePaths.length;
|
|
@@ -21,7 +21,7 @@ function verifyFiles(packageContext) {
|
|
|
21
21
|
const verifiedFilePaths = [];
|
|
22
22
|
|
|
23
23
|
filePaths.forEach((filePath) => {
|
|
24
|
-
const fileVerified = verifyFile(filePath,
|
|
24
|
+
const fileVerified = verifyFile(filePath, releaseContext);
|
|
25
25
|
|
|
26
26
|
if (fileVerified) {
|
|
27
27
|
const verifiedFilePath = filePath; ///
|
|
@@ -42,5 +42,3 @@ function verifyFiles(packageContext) {
|
|
|
42
42
|
|
|
43
43
|
return filesVerified;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
module.exports = verifyFiles;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { labelNameFromLabelNode } from "../utilities/query";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { log } = loggingUtilities;
|
|
8
|
-
|
|
9
|
-
function verifyLabel(labelNode, labels, context) {
|
|
5
|
+
export default function verifyLabel(labelNode, labels, context) {
|
|
10
6
|
let labelVerified = false;
|
|
11
7
|
|
|
12
8
|
const labelName = labelNameFromLabelNode(labelNode),
|
|
@@ -14,7 +10,7 @@ function verifyLabel(labelNode, labels, context) {
|
|
|
14
10
|
labelPresent = context.isLabelPresent(label);
|
|
15
11
|
|
|
16
12
|
if (labelPresent) {
|
|
17
|
-
|
|
13
|
+
context.error(`The label ${label} is already present`);
|
|
18
14
|
} else {
|
|
19
15
|
labels.push(label);
|
|
20
16
|
|
|
@@ -23,5 +19,3 @@ function verifyLabel(labelNode, labels, context) {
|
|
|
23
19
|
|
|
24
20
|
return labelVerified;
|
|
25
21
|
}
|
|
26
|
-
|
|
27
|
-
module.exports = verifyLabel;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import verifyLabel from "../verify/label";
|
|
4
4
|
|
|
5
|
-
function verifyLabels(labelNodes, labels, context) {
|
|
5
|
+
export default function verifyLabels(labelNodes, labels, context) {
|
|
6
6
|
const labelsVerified = labelNodes.every((labelNode) => {
|
|
7
7
|
const labelVerified = verifyLabel(labelNode, labels, context);
|
|
8
8
|
|
|
@@ -13,5 +13,3 @@ function verifyLabels(labelNodes, labels, context) {
|
|
|
13
13
|
|
|
14
14
|
return labelsVerified;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
module.exports = verifyLabels;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
verifyUnqualifiedMetastatement = require("../verify/metastatement/unqualified");
|
|
3
|
+
import MetaAssertion from "../metaAssertion";
|
|
4
|
+
import MetaproofContext from "../context/metaproof";
|
|
5
|
+
import verifyQualifiedMetastatement from "../verify/metastatement/qualified";
|
|
6
|
+
import verifyUnqualifiedMetastatement from "../verify/metastatement/unqualified";
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { first, second } from "../utilities/array";
|
|
9
|
+
import { nodeQuery, nodesQuery } from "../utilities/query";
|
|
10
|
+
import { META_SUBPROOF_RULE_NAME, QUALIFIED_METASTATEMENT_RULE_NAME, UNQUALIFIED_METASTATEMENT_RULE_NAME } from "../ruleNames";
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
metaDerivationNodeQuery = nodeQuery("/metaSubproof/metaDerivation!"),
|
|
12
|
+
const metaDerivationNodeQuery = nodeQuery("/metaSubproof/metaDerivation!"),
|
|
14
13
|
metaDerivationChildNodesQuery = nodesQuery("/metaDerivation/*"),
|
|
15
|
-
qualifiedMetastatementNodeQuery = nodeQuery("/
|
|
16
|
-
unqualifiedMetastatementNodeQuery = nodeQuery("/
|
|
14
|
+
qualifiedMetastatementNodeQuery = nodeQuery("/qualifiedMetastatement"),
|
|
15
|
+
unqualifiedMetastatementNodeQuery = nodeQuery("/unqualifiedMetastatement!"),
|
|
16
|
+
qualifiedOrUnqualifiedMetastatementNodesQuery = nodesQuery("/metaSubproof/qualifiedMetastatement|unqualifiedMetastatement")
|
|
17
17
|
|
|
18
|
-
function verifyMetaDerivation(metaDerivationNode, context) {
|
|
18
|
+
export default function verifyMetaDerivation(metaDerivationNode, context) {
|
|
19
19
|
const derived = true;
|
|
20
20
|
|
|
21
21
|
context.setDerived(derived);
|
|
@@ -80,8 +80,6 @@ function verifyMetaDerivation(metaDerivationNode, context) {
|
|
|
80
80
|
return metaDerivationVerified;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
module.exports = verifyMetaDerivation;
|
|
84
|
-
|
|
85
83
|
function verifyMetaSubproof(metaSubproofNode, context) {
|
|
86
84
|
let metaSubproofVerified = false;
|
|
87
85
|
|
|
@@ -89,10 +87,16 @@ function verifyMetaSubproof(metaSubproofNode, context) {
|
|
|
89
87
|
|
|
90
88
|
context = metaproofContext; ///
|
|
91
89
|
|
|
92
|
-
const
|
|
93
|
-
|
|
90
|
+
const qualifiedOrUnqualifiedMetastatementNodes = qualifiedOrUnqualifiedMetastatementNodesQuery(metaSubproofNode),
|
|
91
|
+
firstQualifiedOrUnqualifiedMetastatementNode = first(qualifiedOrUnqualifiedMetastatementNodes),
|
|
92
|
+
unqualifiedMetastatementNode = firstQualifiedOrUnqualifiedMetastatementNode, ///
|
|
93
|
+
unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, context);
|
|
94
|
+
|
|
95
|
+
if (unqualifiedMetastatementVerified) {
|
|
96
|
+
const metaAssertion = MetaAssertion.fromUnqualifiedMetastatementNode(unqualifiedMetastatementNode);
|
|
97
|
+
|
|
98
|
+
context.addMetaAssertion(metaAssertion);
|
|
94
99
|
|
|
95
|
-
if (metaSuppositionVerified) {
|
|
96
100
|
let metaDerivationVerified = true;
|
|
97
101
|
|
|
98
102
|
const metaDerivationNode = metaDerivationNodeQuery(metaSubproofNode);
|
|
@@ -102,8 +106,10 @@ function verifyMetaSubproof(metaSubproofNode, context) {
|
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
if (metaDerivationVerified) {
|
|
105
|
-
const
|
|
106
|
-
|
|
109
|
+
const secondQualifiedOrUnqualifiedMetastatementNode = second(qualifiedOrUnqualifiedMetastatementNodes),
|
|
110
|
+
qualifiedOrUnqualifiedMetastatementNode = secondQualifiedOrUnqualifiedMetastatementNode, ///
|
|
111
|
+
qualifiedMetastatementNode = qualifiedMetastatementNodeQuery(qualifiedOrUnqualifiedMetastatementNode),
|
|
112
|
+
unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(qualifiedOrUnqualifiedMetastatementNode);
|
|
107
113
|
|
|
108
114
|
if (qualifiedMetastatementNode !== null) {
|
|
109
115
|
const qualifiedMetastatementVerified = verifyQualifiedMetastatement(qualifiedMetastatementNode, context);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import verifyMetaDerivation from "../verify/metaDerivation";
|
|
4
|
+
import verifyQualifiedMetastatement from "../verify/metastatement/qualified";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { nodeQuery } from "../utilities/query";
|
|
7
7
|
|
|
8
8
|
const metaDerivationNodeQuery = nodeQuery("/metaproof/metaDerivation!"),
|
|
9
9
|
qualifiedStatementNodeQuery = nodeQuery("/metaproof/qualifiedMetastatement!"),
|
|
10
10
|
metaProofMetastatementNodeQuery = nodeQuery("/metaproof/qualifiedMetastatement/metastatement!");
|
|
11
11
|
|
|
12
|
-
function verifyMetaproof(metaproofNode,
|
|
12
|
+
export default function verifyMetaproof(metaproofNode, conclusion, context) {
|
|
13
13
|
let metaproofVerified = false;
|
|
14
14
|
|
|
15
15
|
const metaDerivationNode = metaDerivationNodeQuery(metaproofNode);
|
|
@@ -25,7 +25,8 @@ function verifyMetaproof(metaproofNode, metastatementNode, context) {
|
|
|
25
25
|
qualifiedMetastatementVerified = verifyQualifiedMetastatement(qualifiedMetastatementNode, context);
|
|
26
26
|
|
|
27
27
|
if (qualifiedMetastatementVerified) {
|
|
28
|
-
const
|
|
28
|
+
const metastatementNode = conclusion.getMetastatementNode(),
|
|
29
|
+
metaProofMetastatementNode = metaProofMetastatementNodeQuery(metaproofNode),
|
|
29
30
|
metaProofMetastatementNodeMatches = matchMetaProofMetastatementNode(metaProofMetastatementNode, metastatementNode);
|
|
30
31
|
|
|
31
32
|
metaproofVerified = metaProofMetastatementNodeMatches; ///
|
|
@@ -35,8 +36,6 @@ function verifyMetaproof(metaproofNode, metastatementNode, context) {
|
|
|
35
36
|
return metaproofVerified;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
module.exports = verifyMetaproof;
|
|
39
|
-
|
|
40
39
|
function matchMetaProofMetastatementNode(metaProofMetastatementNode, metastatementNode) {
|
|
41
40
|
const metaProofNonTerminalNode = metaProofMetastatementNode, ///
|
|
42
41
|
nonTerminalNode = metastatementNode, ///
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const { nodeAsString } = require("../../utilities/string"),
|
|
6
|
-
{ nodeQuery, referenceNameFromReferenceNode } = require("../../utilities/query");
|
|
7
|
-
|
|
8
|
-
const { log } = loggingUtilities;
|
|
3
|
+
import { nodeAsString } from "../../utilities/string";
|
|
4
|
+
import { nodeQuery, referenceNameFromReferenceNode } from "../../utilities/query";
|
|
9
5
|
|
|
10
6
|
const referenceNodeQuery = nodeQuery("/qualifiedMetastatement/qualification!/reference!"),
|
|
11
7
|
metastatementNodeQuery = nodeQuery("/qualifiedMetastatement/metastatement!");
|
|
12
8
|
|
|
13
|
-
function verifyQualifiedMetastatement(qualifiedMetastatementNode, context) {
|
|
9
|
+
export default function verifyQualifiedMetastatement(qualifiedMetastatementNode, context) {
|
|
14
10
|
let qualifiedMetastatementVerified = false;
|
|
15
11
|
|
|
16
12
|
const metastatementNode = metastatementNodeQuery(qualifiedMetastatementNode);
|
|
@@ -30,10 +26,8 @@ function verifyQualifiedMetastatement(qualifiedMetastatementNode, context) {
|
|
|
30
26
|
if (qualifiedMetastatementVerified) {
|
|
31
27
|
const metastatementString = nodeAsString(metastatementNode);
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
context.debug(`Verified the '${metastatementString}' qualified metastatement.`);
|
|
34
30
|
}
|
|
35
31
|
|
|
36
32
|
return qualifiedMetastatementVerified;
|
|
37
33
|
}
|
|
38
|
-
|
|
39
|
-
module.exports = verifyQualifiedMetastatement;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import MetaAssertion from "../../metaAssertion";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { nodeQuery } = require("../../utilities/query"),
|
|
8
|
-
{ nodeAsString } = require("../../utilities/string");
|
|
9
|
-
|
|
10
|
-
const { log } = loggingUtilities;
|
|
5
|
+
import { nodeQuery } from "../../utilities/query";
|
|
6
|
+
import { nodeAsString } from "../../utilities/string";
|
|
11
7
|
|
|
12
8
|
const metastatementNodeQuery = nodeQuery("/unqualifiedMetastatement/metastatement!");
|
|
13
9
|
|
|
14
|
-
function verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, context) {
|
|
10
|
+
export default function verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, context) {
|
|
15
11
|
let unqualifiedMetastatementVerified = false;
|
|
16
12
|
|
|
17
13
|
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode);
|
|
@@ -32,10 +28,8 @@ function verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, context) {
|
|
|
32
28
|
if (unqualifiedMetastatementVerified) {
|
|
33
29
|
const metastatementString = nodeAsString(metastatementNode);
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
context.debug(`Verified the '${metastatementString}' unqualified metastatement.`);
|
|
36
32
|
}
|
|
37
33
|
|
|
38
34
|
return unqualifiedMetastatementVerified;
|
|
39
35
|
}
|
|
40
|
-
|
|
41
|
-
module.exports = verifyUnqualifiedMetastatement;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import Premise from "../premise";
|
|
4
|
+
import MetaAssertion from "../metaAssertion";
|
|
5
|
+
import verifyUnqualifiedMetastatement from "../verify/metastatement/unqualified";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { nodeQuery, nodesQuery } from "../utilities/query";
|
|
8
8
|
|
|
9
9
|
const metastatementNodeQuery = nodeQuery("/unqualifiedMetastatement/metastatement"),
|
|
10
10
|
unqualifiedMetastatementNodesQuery = nodesQuery("/premise|premises/unqualifiedMetastatement");
|
|
11
11
|
|
|
12
|
-
function verifyPremiseOrPremises(premiseOrPremisesNode, premises, context) {
|
|
12
|
+
export default function verifyPremiseOrPremises(premiseOrPremisesNode, premises, context) {
|
|
13
13
|
const unqualifiedMetastatementNodes = unqualifiedMetastatementNodesQuery(premiseOrPremisesNode),
|
|
14
14
|
premiseOrPremisesVerified = unqualifiedMetastatementNodes.every((unqualifiedMetastatementNode) => {
|
|
15
15
|
const unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, context);
|
|
16
16
|
|
|
17
17
|
if (unqualifiedMetastatementVerified) {
|
|
18
|
+
const metaAssertion = MetaAssertion.fromUnqualifiedMetastatementNode(unqualifiedMetastatementNode);
|
|
19
|
+
|
|
20
|
+
context.addMetaAssertion(metaAssertion);
|
|
21
|
+
|
|
18
22
|
return true;
|
|
19
23
|
}
|
|
20
24
|
});
|
|
@@ -22,16 +26,11 @@ function verifyPremiseOrPremises(premiseOrPremisesNode, premises, context) {
|
|
|
22
26
|
if (premiseOrPremisesVerified) {
|
|
23
27
|
unqualifiedMetastatementNodes.forEach((unqualifiedMetastatementNode) => {
|
|
24
28
|
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
25
|
-
metaAssertion = MetaAssertion.fromUnqualifiedMetastatementNode(unqualifiedMetastatementNode),
|
|
26
29
|
premise = Premise.fromMetastatementNode(metastatementNode);
|
|
27
30
|
|
|
28
|
-
context.addMetaAssertion(metaAssertion);
|
|
29
|
-
|
|
30
31
|
premises.push(premise);
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
return premiseOrPremisesVerified;
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
module.exports = verifyPremiseOrPremises;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { loggingUtilities } from "necessary";
|
|
4
|
+
|
|
5
|
+
import verifyFiles from "../verify/files";
|
|
6
|
+
|
|
7
|
+
const { log } = loggingUtilities;
|
|
8
|
+
|
|
9
|
+
export default function verifyRelease(releaseName, releaseContextMap, releaseContexts = []) {
|
|
10
|
+
const releaseContext = releaseContextMap[releaseName];
|
|
11
|
+
|
|
12
|
+
let releaseVerified = releaseContext.isReleaseVerified();
|
|
13
|
+
|
|
14
|
+
if (!releaseVerified) {
|
|
15
|
+
log.debug(`Verifying the '${releaseName}' package...`);
|
|
16
|
+
|
|
17
|
+
const dependencyReleaseNames = releaseContext.getDependencyReleaseNames(),
|
|
18
|
+
dependencyReleasesVVerified = dependencyReleaseNames.every((dependencyReleaseName) => {
|
|
19
|
+
const releaseName = dependencyReleaseName, ///
|
|
20
|
+
releaseVerified = verifyRelease(releaseName, releaseContextMap, releaseContexts);
|
|
21
|
+
|
|
22
|
+
if (releaseVerified) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
if (dependencyReleasesVVerified) {
|
|
28
|
+
const releaseNames = dependencyReleaseNames, ///
|
|
29
|
+
releaseContexts = releaseNames.map((releaseName) => {
|
|
30
|
+
const releaseContext = releaseContextMap[releaseName];
|
|
31
|
+
|
|
32
|
+
return releaseContext;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const dependencyReleaseContexts = retrieveDependencyReleaseContexts(dependencyReleaseNames, releaseContextMap);
|
|
36
|
+
|
|
37
|
+
releaseContext.initialise(releaseContexts, dependencyReleaseContexts);
|
|
38
|
+
|
|
39
|
+
const filesVerified = verifyFiles(releaseContext);
|
|
40
|
+
|
|
41
|
+
releaseVerified = filesVerified; ///
|
|
42
|
+
|
|
43
|
+
if (releaseVerified) {
|
|
44
|
+
releaseContexts.push(releaseContext);
|
|
45
|
+
|
|
46
|
+
log.info(`Verified the '${releaseName}' release.`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return releaseVerified;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function retrieveDependencyReleaseContexts(dependencyReleaseNames, releaseContextMap, dependencyReleaseContexts = []) {
|
|
55
|
+
dependencyReleaseNames.forEach((dependencyReleaseName) => {
|
|
56
|
+
const dependencyReleaseContext = releaseContextMap[dependencyReleaseName],
|
|
57
|
+
dependencyReleaseContextsIncludesDependencyReleaseContext = dependencyReleaseContexts.includes(dependencyReleaseContext);
|
|
58
|
+
|
|
59
|
+
if (!dependencyReleaseContextsIncludesDependencyReleaseContext) {
|
|
60
|
+
const releaseContext = dependencyReleaseContext, ///
|
|
61
|
+
dependencyReleaseNames = releaseContext.getDependencyReleaseNames();
|
|
62
|
+
|
|
63
|
+
retrieveDependencyReleaseContexts(dependencyReleaseNames, releaseContextMap, dependencyReleaseContexts);
|
|
64
|
+
|
|
65
|
+
dependencyReleaseContexts.push(dependencyReleaseContext);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
return dependencyReleaseContexts;
|
|
70
|
+
}
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import Rule from "../rule";
|
|
4
|
+
import verifyLabels from "../verify/labels";
|
|
5
|
+
import verifyMetaproof from "../verify/metaproof";
|
|
6
|
+
import MetaproofContext from "../context/metaproof";
|
|
7
|
+
import verifyConditionalInference from "../verify/conditinalInference";
|
|
8
|
+
import verifyUnconditionalInference from "../verify/unconditionalInference";
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
verifyConditionalInference = require("../verify/conditinalInference"),
|
|
9
|
-
verifyUnconditionalInference = require("../verify/unconditionalInference");
|
|
10
|
-
|
|
11
|
-
const { first } = require("../utilities/array"),
|
|
12
|
-
{ nodesAsString } = require("../utilities/string"),
|
|
13
|
-
{ nodeQuery, nodesQuery } = require("../utilities/query");
|
|
14
|
-
|
|
15
|
-
const { log } = loggingUtilities;
|
|
10
|
+
import { first } from "../utilities/array";
|
|
11
|
+
import { nodesAsString } from "../utilities/string";
|
|
12
|
+
import { nodeQuery, nodesQuery } from "../utilities/query";
|
|
16
13
|
|
|
17
14
|
const labelNodesQuery = nodesQuery("/rule/label"),
|
|
18
15
|
metaproofNodeQuery = nodeQuery("/rule/metaproof!"),
|
|
19
16
|
conditionalInferenceNodeQuery = nodeQuery("/rule/conditionalInference!"),
|
|
20
17
|
unconditionalInferenceNodeQuery = nodeQuery("/rule/unconditionalInference!");
|
|
21
18
|
|
|
22
|
-
function verifyRule(ruleNode, context) {
|
|
19
|
+
export default function verifyRule(ruleNode, context) {
|
|
23
20
|
let ruleVerified = false;
|
|
24
21
|
|
|
25
22
|
const labelNodes = labelNodesQuery(ruleNode),
|
|
26
23
|
labelsString = nodesAsString(labelNodes);
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
const metaproofContext = MetaproofContext.fromContext(context);
|
|
26
|
+
|
|
27
|
+
context = metaproofContext; ///
|
|
28
|
+
|
|
29
|
+
context.debug(`Verifying the '${labelsString}' rule...`);
|
|
29
30
|
|
|
30
31
|
const labels = [],
|
|
31
32
|
labelsVerified = verifyLabels(labelNodes, labels, context);
|
|
@@ -55,9 +56,7 @@ function verifyRule(ruleNode, context) {
|
|
|
55
56
|
let metaproofVerified = true;
|
|
56
57
|
|
|
57
58
|
if (metaproofNode !== null) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
metaproofVerified = verifyMetaproof(metaproofNode, metastatementNode, context);
|
|
59
|
+
metaproofVerified = verifyMetaproof(metaproofNode, conclusion, context);
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
if (metaproofVerified) {
|
|
@@ -70,11 +69,9 @@ function verifyRule(ruleNode, context) {
|
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
if (ruleVerified) {
|
|
73
|
-
|
|
72
|
+
context.info(`Verified the '${labelsString}' rule.`);
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
return ruleVerified;
|
|
78
77
|
}
|
|
79
|
-
|
|
80
|
-
module.exports = verifyRule;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import verifyStatement from "../../verify/statement";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { nodeQuery } from "../../utilities/query";
|
|
6
6
|
|
|
7
7
|
const statementNodeQuery = nodeQuery("/qualifiedStatement/statement!");
|
|
8
8
|
|
|
9
|
-
function verifyQualifiedStatement(qualifiedStatementNode, context) {
|
|
9
|
+
export default function verifyQualifiedStatement(qualifiedStatementNode, context) {
|
|
10
10
|
const statementNode = statementNodeQuery(qualifiedStatementNode),
|
|
11
11
|
statementVerified = verifyStatement(statementNode, context),
|
|
12
12
|
qualifiedStatementVerified = statementVerified; ///
|
|
13
13
|
|
|
14
14
|
return qualifiedStatementVerified;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
module.exports = verifyQualifiedStatement;
|