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,12 +1,12 @@
|
|
|
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("/unqualifiedStatement/statement!");
|
|
8
8
|
|
|
9
|
-
function verifyUnqualifiedStatement(unqualifiedStatementNode, context) {
|
|
9
|
+
export default function verifyUnqualifiedStatement(unqualifiedStatementNode, context) {
|
|
10
10
|
let unqualifiedStatementVerified = false;
|
|
11
11
|
|
|
12
12
|
const statementNode = statementNodeQuery(unqualifiedStatementNode);
|
|
@@ -23,5 +23,3 @@ function verifyUnqualifiedStatement(unqualifiedStatementNode, context) {
|
|
|
23
23
|
|
|
24
24
|
return unqualifiedStatementVerified;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
module.exports = verifyUnqualifiedStatement;
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import verifyEquality from "../verify/equality";
|
|
4
|
+
import verifyTypeAssertion from "../verify/assertion/type";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const { nodeQuery } = require("../utilities/query"),
|
|
9
|
-
{ nodeAsString } = require("../utilities/string");
|
|
6
|
+
import { nodeQuery } from "../utilities/query";
|
|
7
|
+
import { nodeAsString } from "../utilities/string";
|
|
10
8
|
|
|
11
9
|
const equalityNodeQuery = nodeQuery("/statement/equality!"),
|
|
12
10
|
typeAssertionNodeQuery = nodeQuery("/statement/typeAssertion!");
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function verifyStatement(statementNode, context) {
|
|
12
|
+
export default function verifyStatement(statementNode, context) {
|
|
17
13
|
let statementVerified = false;
|
|
18
14
|
|
|
19
15
|
const statementString = nodeAsString(statementNode);
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
context.debug(`Verifying the '${statementString}' statement...`);
|
|
22
18
|
|
|
23
19
|
const equalityNode = equalityNodeQuery(statementNode),
|
|
24
20
|
typeAssertionNode = typeAssertionNodeQuery(statementNode);
|
|
@@ -38,10 +34,8 @@ function verifyStatement(statementNode, context) {
|
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
if (statementVerified) {
|
|
41
|
-
|
|
37
|
+
context.info(`Verified the '${statementString}' statement.`);
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
return statementVerified;
|
|
45
41
|
}
|
|
46
|
-
|
|
47
|
-
module.exports = verifyStatement;
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import Combinator from "../combinator";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { nodeAsString } from "../utilities/string";
|
|
6
|
+
import { typeNameFromTypeNode } from "../utilities/query";
|
|
7
|
+
import { TERM_RULE_NAME, TYPE_RULE_NAME } from "../ruleNames";
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
{ typeNameFromTypeNode } = require("../utilities/query"),
|
|
9
|
-
{ TERM_RULE_NAME, TYPE_RULE_NAME } = require("../ruleNames");
|
|
10
|
-
|
|
11
|
-
const { log } = loggingUtilities;
|
|
12
|
-
|
|
13
|
-
function verifyStatementAsCombinator(statementNode, context) {
|
|
9
|
+
export default function verifyStatementAsCombinator(statementNode, context) {
|
|
14
10
|
let statementVerifiedAsCombinator = false;
|
|
15
11
|
|
|
16
12
|
const statementString = nodeAsString(statementNode);
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
context.debug(`Verifying the ${statementString} statement as a combinator...`);
|
|
19
15
|
|
|
20
16
|
const nonTerminalNode = statementNode, ///
|
|
21
17
|
childNodes = nonTerminalNode.getChildNodes(),
|
|
@@ -32,14 +28,12 @@ function verifyStatementAsCombinator(statementNode, context) {
|
|
|
32
28
|
|
|
33
29
|
const statementString = nodeAsString(statementNode);
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
context.info(`Verified the '${statementString}' combinator.`);
|
|
36
32
|
}
|
|
37
33
|
|
|
38
34
|
return statementVerifiedAsCombinator;
|
|
39
35
|
}
|
|
40
36
|
|
|
41
|
-
module.exports = verifyStatementAsCombinator;
|
|
42
|
-
|
|
43
37
|
function verifyNode(node, context) {
|
|
44
38
|
let nodeVerified;
|
|
45
39
|
|
|
@@ -123,7 +117,7 @@ function verifyTypeNode(typeNode, context) {
|
|
|
123
117
|
typePresent = context.isTypePresentByTypeName(typeName);
|
|
124
118
|
|
|
125
119
|
if (!typePresent) {
|
|
126
|
-
|
|
120
|
+
context.error(`The type '${typeName}' is missing.`);
|
|
127
121
|
} else {
|
|
128
122
|
typeNodeVerified = true;
|
|
129
123
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import Assertion from "../assertion";
|
|
4
|
+
import verifyUnqualifiedStatement from "../verify/statement/unqualified";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { nodeQuery } from "../utilities/query";
|
|
7
7
|
|
|
8
8
|
const unqualifiedStatementNodeQuery = nodeQuery("/supposition/unqualifiedStatement!");
|
|
9
9
|
|
|
10
|
-
function verifySupposition(suppositionNode, suppositions, context) {
|
|
10
|
+
export default function verifySupposition(suppositionNode, suppositions, context) {
|
|
11
11
|
const unqualifiedStatementNode = unqualifiedStatementNodeQuery(suppositionNode),
|
|
12
12
|
unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, context),
|
|
13
13
|
suppositionVerified = unqualifiedStatementVerified;
|
|
@@ -20,5 +20,3 @@ function verifySupposition(suppositionNode, suppositions, context) {
|
|
|
20
20
|
|
|
21
21
|
return suppositionVerified;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
module.exports = verifySupposition;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import verifyTermAsVariable from "../verify/termAsVariable";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{ ARGUMENT_RULE_NAME } = require("../ruleNames"),
|
|
10
|
-
{ nodeQuery, typeNameFromTypeNode } = require("../utilities/query");
|
|
11
|
-
|
|
12
|
-
const { log } = loggingUtilities;
|
|
5
|
+
import { first } from "../utilities/array";
|
|
6
|
+
import { nodeAsString } from "../utilities/string";
|
|
7
|
+
import { ARGUMENT_RULE_NAME } from "../ruleNames";
|
|
8
|
+
import { nodeQuery, typeNameFromTypeNode } from "../utilities/query";
|
|
13
9
|
|
|
14
10
|
const termNodeQuery = nodeQuery("/argument/term!"),
|
|
15
11
|
typeNodeQuery = nodeQuery("/argument/type!")
|
|
16
12
|
|
|
17
|
-
function verifyTerm(termNode, types, values, context) {
|
|
13
|
+
export default function verifyTerm(termNode, types, values, context) {
|
|
18
14
|
let termVerified = false;
|
|
19
15
|
|
|
20
16
|
const names = [],
|
|
@@ -47,8 +43,6 @@ function verifyTerm(termNode, types, values, context) {
|
|
|
47
43
|
return termVerified;
|
|
48
44
|
}
|
|
49
45
|
|
|
50
|
-
module.exports = verifyTerm;
|
|
51
|
-
|
|
52
46
|
function verifyTermAgainstConstructor(termNode, constructor, context) {
|
|
53
47
|
const constructorTermNode = constructor.getTermNode(),
|
|
54
48
|
node = termNode, ///
|
|
@@ -159,7 +153,7 @@ function verifyArgumentNode(argumentNode, constructorArgumentNode, context) {
|
|
|
159
153
|
if (termNode === null) {
|
|
160
154
|
const argumentString = nodeAsString(argumentNode);
|
|
161
155
|
|
|
162
|
-
|
|
156
|
+
context.error(`The ${argumentString} argument should be a term, not a type`);
|
|
163
157
|
} else {
|
|
164
158
|
const types = [],
|
|
165
159
|
values = [],
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import verifyTerm from "../verify/term";
|
|
4
|
+
import Constructor from "../constructor";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{ nodeAsString } = require("../utilities/string"),
|
|
10
|
-
{ nodeQuery, typeNameFromTypeNode } = require("../utilities/query"),
|
|
11
|
-
{ TERM_RULE_NAME, ARGUMENT_RULE_NAME } = require("../ruleNames");
|
|
12
|
-
|
|
13
|
-
const { log } = loggingUtilities;
|
|
6
|
+
import { first } from "../utilities/array";
|
|
7
|
+
import { nodeAsString } from "../utilities/string";
|
|
8
|
+
import { nodeQuery, typeNameFromTypeNode } from "../utilities/query";
|
|
9
|
+
import { TERM_RULE_NAME, ARGUMENT_RULE_NAME } from "../ruleNames";
|
|
14
10
|
|
|
15
11
|
const typeNodeQuery = nodeQuery("/argument/type");
|
|
16
12
|
|
|
17
|
-
function verifyTermAsConstructor(termNode, typeNode, context) {
|
|
13
|
+
export default function verifyTermAsConstructor(termNode, typeNode, context) {
|
|
18
14
|
let termVerifiedAsConstructor = false;
|
|
19
15
|
|
|
20
16
|
const termString = nodeAsString(termNode);
|
|
21
17
|
|
|
22
|
-
|
|
18
|
+
context.debug(`Verifying the '${termString}' term as a constructor...`);
|
|
23
19
|
|
|
24
20
|
const nonTerminalNode = termNode, ///
|
|
25
21
|
childNodes = nonTerminalNode.getChildNodes(),
|
|
@@ -40,7 +36,7 @@ function verifyTermAsConstructor(termNode, typeNode, context) {
|
|
|
40
36
|
} else {
|
|
41
37
|
const termString = nodeAsString(termNode);
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
context.error(`The '${termString}' constructor's '${typeName}' type is missing.`);
|
|
44
40
|
}
|
|
45
41
|
}
|
|
46
42
|
}
|
|
@@ -52,14 +48,12 @@ function verifyTermAsConstructor(termNode, typeNode, context) {
|
|
|
52
48
|
|
|
53
49
|
const termString = nodeAsString(termNode);
|
|
54
50
|
|
|
55
|
-
|
|
51
|
+
context.info(`Verified the '${termString}' constructor.`);
|
|
56
52
|
}
|
|
57
53
|
|
|
58
54
|
return termVerifiedAsConstructor;
|
|
59
55
|
}
|
|
60
56
|
|
|
61
|
-
module.exports = verifyTermAsConstructor;
|
|
62
|
-
|
|
63
57
|
function verifyNode(node, context) {
|
|
64
58
|
let nodeVerified;
|
|
65
59
|
|
|
@@ -127,7 +121,7 @@ function verifyNonTerminalNode(nonTerminalNode, context) {
|
|
|
127
121
|
if (type !== null) {
|
|
128
122
|
const termString = nodeAsString(termNode);
|
|
129
123
|
|
|
130
|
-
|
|
124
|
+
context.error(`The type of the constructor's compound '${termString}' term node is not null.`);
|
|
131
125
|
} else {
|
|
132
126
|
nonTerminalNodeVerified = true; ///
|
|
133
127
|
}
|
|
@@ -157,13 +151,13 @@ function verifyArgumentNode(argumentNode, context) {
|
|
|
157
151
|
if (typeNode === null) {
|
|
158
152
|
const argumentString = nodeAsString(argumentNode);
|
|
159
153
|
|
|
160
|
-
|
|
154
|
+
context.error(`The ${argumentString} argument should be a type.`);
|
|
161
155
|
} else {
|
|
162
156
|
const typeName = typeNameFromTypeNode(typeNode),
|
|
163
157
|
typePresent = context.isTypePresentByTypeName(typeName);
|
|
164
158
|
|
|
165
159
|
if (!typePresent) {
|
|
166
|
-
|
|
160
|
+
context.error(`The type '${typeName}' is missing.`);
|
|
167
161
|
} else {
|
|
168
162
|
typeNodeVerified = true;
|
|
169
163
|
}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const { nodeQuery, variableNameFromVariableNode} = require("../utilities/query");
|
|
3
|
+
import { nodeQuery, variableNameFromVariableNode} from "../utilities/query";
|
|
6
4
|
|
|
7
5
|
const variableNodeQuery = nodeQuery("/term/variable!");
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function verifyTermAsVariable(termNode, types, names, values, context) {
|
|
7
|
+
export default function verifyTermAsVariable(termNode, types, names, values, context) {
|
|
12
8
|
let termVerifiedAsVariable = false;
|
|
13
9
|
|
|
14
10
|
const variableNode = variableNodeQuery(termNode);
|
|
@@ -18,7 +14,7 @@ function verifyTermAsVariable(termNode, types, names, values, context) {
|
|
|
18
14
|
variablePresent = context.isVariablePresentByVariableName(variableName);
|
|
19
15
|
|
|
20
16
|
if (!variablePresent) {
|
|
21
|
-
|
|
17
|
+
context.error(`The ${variableName} variable is not present.`)
|
|
22
18
|
} else {
|
|
23
19
|
const variable = context.findVariableByVariableName(variableName),
|
|
24
20
|
type = variable.getType(),
|
|
@@ -37,5 +33,3 @@ function verifyTermAsVariable(termNode, types, names, values, context) {
|
|
|
37
33
|
|
|
38
34
|
return termVerifiedAsVariable;
|
|
39
35
|
}
|
|
40
|
-
|
|
41
|
-
module.exports = verifyTermAsVariable;
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import Type from "../type";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { typeNameFromTypeNode } from "../utilities/query";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { log } = loggingUtilities;
|
|
10
|
-
|
|
11
|
-
function verifyType(typeNode, superTypeNode, context) {
|
|
7
|
+
export default function verifyType(typeNode, superTypeNode, context) {
|
|
12
8
|
let typeVerified = false;
|
|
13
9
|
|
|
14
10
|
const typeName = typeNameFromTypeNode(typeNode),
|
|
15
11
|
typePresent = context.isTypePresentByTypeName(typeName);
|
|
16
12
|
|
|
17
13
|
if (typePresent) {
|
|
18
|
-
|
|
14
|
+
context.error(`The type '${typeName}' is already present.`);
|
|
19
15
|
} else {
|
|
20
16
|
const superTypeName = typeNameFromTypeNode(superTypeNode);
|
|
21
17
|
|
|
@@ -27,12 +23,12 @@ function verifyType(typeNode, superTypeNode, context) {
|
|
|
27
23
|
|
|
28
24
|
typeVerified = true;
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
context.info(`Verified the '${typeString}' type.`);
|
|
31
27
|
} else {
|
|
32
28
|
const superType = context.findTypeByTypeName(superTypeName);
|
|
33
29
|
|
|
34
30
|
if (superType === null) {
|
|
35
|
-
|
|
31
|
+
context.error(`The super-type '${superTypeName}' is missing.`);
|
|
36
32
|
} else {
|
|
37
33
|
const type = Type.fromTypeNameAndSuperType(typeName, superType),
|
|
38
34
|
typeString = type.asString();
|
|
@@ -41,7 +37,7 @@ function verifyType(typeNode, superTypeNode, context) {
|
|
|
41
37
|
|
|
42
38
|
typeVerified = true;
|
|
43
39
|
|
|
44
|
-
|
|
40
|
+
context.info(`Verified the '${typeString}' type.`);
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
43
|
}
|
|
@@ -49,5 +45,3 @@ function verifyType(typeNode, superTypeNode, context) {
|
|
|
49
45
|
return typeVerified;
|
|
50
46
|
}
|
|
51
47
|
|
|
52
|
-
module.exports = verifyType;
|
|
53
|
-
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
verifyUnqualifiedMetastatement = require("../verify/metastatement/unqualified");
|
|
3
|
+
import Conclusion from "../conclusion";
|
|
4
|
+
import verifyUnqualifiedMetastatement from "../verify/metastatement/unqualified";
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
import { nodeQuery } from "../utilities/query";
|
|
8
7
|
|
|
9
8
|
const metastatementNodeQuery = nodeQuery("/unconditionalInference/unqualifiedMetastatement!/metastatement!"),
|
|
10
9
|
unqualifiedMetastatementNodeQuery = nodeQuery("/unconditionalInference/unqualifiedMetastatement!");
|
|
11
10
|
|
|
12
|
-
function verifyUnconditionalInference(unconditionalInferenceNode, premises, conclusions, context) {
|
|
11
|
+
export default function verifyUnconditionalInference(unconditionalInferenceNode, premises, conclusions, context) {
|
|
13
12
|
let unconditionalInferenceVerified = false;
|
|
14
13
|
|
|
15
|
-
const metaproofContext = MetaproofContext.fromContext(context);
|
|
16
|
-
|
|
17
|
-
context = metaproofContext; ///
|
|
18
|
-
|
|
19
14
|
const metastatementNode = metastatementNodeQuery(unconditionalInferenceNode),
|
|
20
15
|
unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(unconditionalInferenceNode),
|
|
21
16
|
unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, context);
|
|
@@ -30,5 +25,3 @@ function verifyUnconditionalInference(unconditionalInferenceNode, premises, conc
|
|
|
30
25
|
|
|
31
26
|
return unconditionalInferenceVerified;
|
|
32
27
|
}
|
|
33
|
-
|
|
34
|
-
module.exports = verifyUnconditionalInference;
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import Variable from "../variable";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { typeNameFromTypeNode, variableNameFromVariableNode } from "../utilities/query";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { log } = loggingUtilities;
|
|
10
|
-
|
|
11
|
-
function verifyVariable(variableNode, typeNode, context) {
|
|
7
|
+
export default function verifyVariable(variableNode, typeNode, context) {
|
|
12
8
|
let variableVerified = false;
|
|
13
9
|
|
|
14
10
|
const variableName = variableNameFromVariableNode(variableNode),
|
|
15
11
|
variablePresent = context.isVariablePresentByVariableName(variableName);
|
|
16
12
|
|
|
17
13
|
if (variablePresent) {
|
|
18
|
-
|
|
14
|
+
context.error(`The variable '${variableName}' is already present.`);
|
|
19
15
|
} else {
|
|
20
16
|
let variable = null;
|
|
21
17
|
|
|
@@ -30,7 +26,7 @@ function verifyVariable(variableNode, typeNode, context) {
|
|
|
30
26
|
const type = context.findTypeByTypeName(typeName);
|
|
31
27
|
|
|
32
28
|
if (type === null) {
|
|
33
|
-
|
|
29
|
+
context.error(`The '${variableName}' variable's '${typeName}' type is missing.`);
|
|
34
30
|
} else {
|
|
35
31
|
const name = variableName; ///
|
|
36
32
|
|
|
@@ -45,11 +41,9 @@ function verifyVariable(variableNode, typeNode, context) {
|
|
|
45
41
|
|
|
46
42
|
variableVerified = true;
|
|
47
43
|
|
|
48
|
-
|
|
44
|
+
context.info(`Verified the '${variableString}' variable.`);
|
|
49
45
|
}
|
|
50
46
|
}
|
|
51
47
|
|
|
52
48
|
return variableVerified;
|
|
53
49
|
}
|
|
54
|
-
|
|
55
|
-
module.exports = verifyVariable;
|
package/bin/axiom.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { labelsAsString } = require("./utilities/string");
|
|
4
|
-
|
|
5
|
-
class Axiom {
|
|
6
|
-
constructor(labels, supposition, consequent, statementNode) {
|
|
7
|
-
this.labels = labels;
|
|
8
|
-
this.supposition = supposition;
|
|
9
|
-
this.consequent = consequent;
|
|
10
|
-
this.statementNode = statementNode;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
getLabels() {
|
|
14
|
-
return this.labels;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
getSupposition() {
|
|
18
|
-
return this.supposition;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
getConsequent() {
|
|
22
|
-
return this.consequent;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
getStatementNode() {
|
|
26
|
-
return this.statementNode;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
asString() {
|
|
30
|
-
const string = labelsAsString(this.labels);
|
|
31
|
-
|
|
32
|
-
return string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static fromStatementNodeAndLabels(statementNode, labels) {
|
|
36
|
-
const supposition = null,
|
|
37
|
-
consequent = null,
|
|
38
|
-
axiom = new Axiom(labels, supposition, consequent, statementNode);
|
|
39
|
-
|
|
40
|
-
return axiom;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
static fromSuppositionConsequentAndLabels(supposition, consequent, labels) {
|
|
44
|
-
const statementNode = null,
|
|
45
|
-
axiom = new Axiom(labels, supposition, consequent, statementNode);
|
|
46
|
-
|
|
47
|
-
return axiom;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
module.exports = Axiom;
|
|
52
|
-
|
package/bin/consequent.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
class Consequent {
|
|
4
|
-
constructor(statementNode) {
|
|
5
|
-
this.statementNode = statementNode;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
getStatementNode() {
|
|
9
|
-
return this.statementNode;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
static fromStatementNode(statementNode) {
|
|
13
|
-
const consequent = new Consequent(statementNode);
|
|
14
|
-
|
|
15
|
-
return consequent;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
module.exports = Consequent;
|
package/bin/constants.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const COMMA = ',';
|
|
4
|
-
const EMPTY_STRING = "";
|
|
5
|
-
const LEFT_BRACKET = "(";
|
|
6
|
-
const RIGHT_BRACKET = ")";
|
|
7
|
-
const MAXIMUM_INDEXES_LENGTH = 10;
|
|
8
|
-
const MAXIMUM_PERMUTATION_LENGTH = 5;
|
|
9
|
-
const BRACKETED_METASTATEMENT_CHILD_NODES_LENGTH = 3;
|
|
10
|
-
|
|
11
|
-
module.exports = {
|
|
12
|
-
COMMA,
|
|
13
|
-
EMPTY_STRING,
|
|
14
|
-
LEFT_BRACKET,
|
|
15
|
-
RIGHT_BRACKET,
|
|
16
|
-
MAXIMUM_INDEXES_LENGTH,
|
|
17
|
-
MAXIMUM_PERMUTATION_LENGTH,
|
|
18
|
-
BRACKETED_METASTATEMENT_CHILD_NODES_LENGTH
|
|
19
|
-
};
|