occam-verify-cli 0.0.455 → 0.0.457
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/lib/axiom.js +26 -46
- package/lib/combinator.js +2 -3
- package/lib/conclusion.js +2 -3
- package/lib/constructor.js +2 -3
- package/lib/context/file.js +5 -1
- package/lib/context/release/file.js +17 -4
- package/lib/label.js +2 -3
- package/lib/lemma.js +26 -46
- package/lib/premise.js +2 -3
- package/lib/ruleNames.js +5 -1
- package/lib/theorem.js +26 -46
- package/lib/utilities/string.js +46 -1
- package/lib/verify/assertion/type.js +55 -0
- package/lib/verify/axiom.js +10 -15
- package/lib/verify/equality.js +7 -1
- package/lib/verify/lemma.js +13 -22
- package/lib/verify/metastatement/qualified.js +4 -3
- package/lib/verify/metastatement/unqualified.js +14 -9
- package/lib/verify/metastatement.js +19 -0
- package/lib/verify/statement/qualified.js +14 -11
- package/lib/verify/statement/unqualified.js +13 -9
- package/lib/verify/statement.js +5 -8
- package/lib/verify/statementAsCombinator.js +3 -2
- package/lib/verify/term.js +6 -1
- package/lib/verify/termAsConstructor.js +5 -5
- package/lib/verify/theorem.js +10 -15
- package/lib/verify/type.js +8 -7
- package/lib/verify/variable.js +4 -3
- package/package.json +3 -3
- package/src/axiom.js +27 -54
- package/src/combinator.js +3 -3
- package/src/conclusion.js +3 -3
- package/src/constructor.js +3 -3
- package/src/context/file.js +6 -0
- package/src/context/release/file.js +17 -4
- package/src/label.js +3 -3
- package/src/lemma.js +28 -55
- package/src/premise.js +3 -3
- package/src/ruleNames.js +1 -0
- package/src/theorem.js +32 -59
- package/src/utilities/string.js +67 -0
- package/src/verify/assertion/type.js +32 -56
- package/src/verify/axiom.js +10 -24
- package/src/verify/equality.js +9 -0
- package/src/verify/lemma.js +14 -37
- package/src/verify/metastatement/qualified.js +5 -3
- package/src/verify/metastatement/unqualified.js +17 -10
- package/src/verify/metastatement.js +15 -0
- package/src/verify/statement/qualified.js +20 -8
- package/src/verify/statement/unqualified.js +16 -10
- package/src/verify/statement.js +5 -8
- package/src/verify/statementAsCombinator.js +4 -2
- package/src/verify/term.js +8 -0
- package/src/verify/termAsConstructor.js +5 -5
- package/src/verify/theorem.js +11 -25
- package/src/verify/type.js +9 -7
- package/src/verify/variable.js +5 -3
- package/lib/utilities/node.js +0 -45
- package/src/utilities/node.js +0 -50
package/lib/verify/type.js
CHANGED
|
@@ -19,11 +19,13 @@ function _interopRequireDefault(obj) {
|
|
|
19
19
|
function verifyType(typeNode, superTypeNode, fileContext) {
|
|
20
20
|
var typeVerified = false;
|
|
21
21
|
fileContext.begin(typeNode);
|
|
22
|
-
var
|
|
22
|
+
var typeString = (0, _string.nodeAsString)(typeNode);
|
|
23
|
+
fileContext.debug("Verifying the '".concat(typeString, "' type..."));
|
|
23
24
|
var typeName = (0, _query.typeNameFromTypeNode)(typeNode), typePresent = fileContext.isTypePresentByTypeName(typeName);
|
|
24
25
|
if (typePresent) {
|
|
25
26
|
fileContext.error("The type '".concat(typeName, "' is already present."));
|
|
26
27
|
} else {
|
|
28
|
+
var type;
|
|
27
29
|
var superTypeName = (0, _query.typeNameFromTypeNode)(superTypeNode);
|
|
28
30
|
if (superTypeName === null) {
|
|
29
31
|
type = _type.default.fromTypeName(typeName);
|
|
@@ -35,17 +37,16 @@ function verifyType(typeNode, superTypeNode, fileContext) {
|
|
|
35
37
|
type = _type.default.fromTypeNameAndSuperType(typeName, superType);
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
if (type !== null) {
|
|
41
|
+
fileContext.addType(type);
|
|
42
|
+
typeVerified = true;
|
|
43
|
+
}
|
|
42
44
|
}
|
|
43
45
|
if (typeVerified) {
|
|
44
|
-
var typeString = (0, _string.nodeAsString)(typeNode);
|
|
45
46
|
fileContext.info("Verified the '".concat(typeString, "' type."));
|
|
46
47
|
}
|
|
47
48
|
typeVerified ? fileContext.complete(typeNode) : fileContext.halt(typeNode);
|
|
48
49
|
return typeVerified;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
52
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92ZXJpZnkvdHlwZS5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuaW1wb3J0IFR5cGUgZnJvbSBcIi4uL3R5cGVcIjtcblxuaW1wb3J0IHsgbm9kZUFzU3RyaW5nIH0gZnJvbSBcIi4uL3V0aWxpdGllcy9zdHJpbmdcIjtcbmltcG9ydCB7IHR5cGVOYW1lRnJvbVR5cGVOb2RlIH0gZnJvbSBcIi4uL3V0aWxpdGllcy9xdWVyeVwiO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiB2ZXJpZnlUeXBlKHR5cGVOb2RlLCBzdXBlclR5cGVOb2RlLCBmaWxlQ29udGV4dCkge1xuICBsZXQgdHlwZVZlcmlmaWVkID0gZmFsc2U7XG5cbiAgZmlsZUNvbnRleHQuYmVnaW4odHlwZU5vZGUpO1xuXG4gIGNvbnN0IHR5cGVTdHJpbmcgPSBub2RlQXNTdHJpbmcodHlwZU5vZGUpO1xuXG4gIGZpbGVDb250ZXh0LmRlYnVnKGBWZXJpZnlpbmcgdGhlICcke3R5cGVTdHJpbmd9JyB0eXBlLi4uYCk7XG5cbiAgY29uc3QgdHlwZU5hbWUgPSB0eXBlTmFtZUZyb21UeXBlTm9kZSh0eXBlTm9kZSksXG4gICAgICAgIHR5cGVQcmVzZW50ID0gZmlsZUNvbnRleHQuaXNUeXBlUHJlc2VudEJ5VHlwZU5hbWUodHlwZU5hbWUpO1xuXG4gIGlmICh0eXBlUHJlc2VudCkge1xuICAgIGZpbGVDb250ZXh0LmVycm9yKGBUaGUgdHlwZSAnJHt0eXBlTmFtZX0nIGlzIGFscmVhZHkgcHJlc2VudC5gKTt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0FBQ0MsWUFBWSxDQUFDUjtRQUMzQixPQUFPO1lBQ0wsSUFBTVMsWUFBWWYsWUFBWWdCLGtCQUFrQixDQUFDSjtZQUVqRCxJQUFJRyxjQUFjLElBQUksRUFBRTtnQkFDdEJmLFlBQVlVLEtBQUssQ0FBQyxBQUFDLG1CQUFnQyxPQUFkRSxlQUFjO1lBQ3JELE9BQU87Z0JBQ0xELE9BQU9FLGFBQUksQ0FBQ0ksd0JBQXdCLENBQUNYLFVBQVVTO1lBQ2pELENBQUM7UUFDSCxDQUFDO1FBRUQsSUFBSUosU0FBUyxJQUFJLEVBQUU7WUFDakJYLFlBQVlrQixPQUFPLENBQUNQO1lBRXBCVixlQUFlLElBQUk7UUFDckIsQ0FBQztJQUNILENBQUM7SUFFRCxJQUFJQSxjQUFjO1FBQ2hCRCxZQUFZbUIsSUFBSSxDQUFDLEFBQUMsaUJBQTJCLE9BQVhoQixZQUFXO0lBQy9DLENBQUM7SUFFREYsZUFDRUQsWUFBWW9CLFFBQVEsQ0FBQ3RCLFlBQ25CRSxZQUFZcUIsSUFBSSxDQUFDdkIsU0FBUztJQUU5QixPQUFPRztBQUNUIn0=
|
package/lib/verify/variable.js
CHANGED
|
@@ -19,11 +19,13 @@ function _interopRequireDefault(obj) {
|
|
|
19
19
|
function verifyVariable(variableNode, typeNode, fileContext) {
|
|
20
20
|
var variableVerified = false;
|
|
21
21
|
fileContext.begin(variableNode);
|
|
22
|
-
var
|
|
22
|
+
var variableString = (0, _string.nodeAsString)(variableNode);
|
|
23
|
+
fileContext.debug("Verifying the '".concat(variableString, "' variable..."));
|
|
23
24
|
var variableName = (0, _query.variableNameFromVariableNode)(variableNode), variablePresent = fileContext.isVariablePresentByVariableName(variableName);
|
|
24
25
|
if (variablePresent) {
|
|
25
26
|
fileContext.error("The variable '".concat(variableName, "' is already present."));
|
|
26
27
|
} else {
|
|
28
|
+
var variable;
|
|
27
29
|
var typeName = (0, _query.typeNameFromTypeNode)(typeNode);
|
|
28
30
|
if (typeName === null) {
|
|
29
31
|
var type = null, name = variableName; ///
|
|
@@ -43,11 +45,10 @@ function verifyVariable(variableNode, typeNode, fileContext) {
|
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
if (variableVerified) {
|
|
46
|
-
var variableString = (0, _string.nodeAsString)(variableNode);
|
|
47
48
|
fileContext.info("Verified the '".concat(variableString, "' variable."));
|
|
48
49
|
}
|
|
49
50
|
variableVerified ? fileContext.complete(variableNode) : fileContext.halt(variableNode);
|
|
50
51
|
return variableVerified;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92ZXJpZnkvdmFyaWFibGUuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmltcG9ydCBWYXJpYWJsZSBmcm9tIFwiLi4vdmFyaWFibGVcIjtcblxuaW1wb3J0IHsgbm9kZUFzU3RyaW5nIH0gZnJvbSBcIi4uL3V0aWxpdGllcy9zdHJpbmdcIjtcbmltcG9ydCB7IHR5cGVOYW1lRnJvbVR5cGVOb2RlLCB2YXJpYWJsZU5hbWVGcm9tVmFyaWFibGVOb2RlIH0gZnJvbSBcIi4uL3V0aWxpdGllcy9xdWVyeVwiO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiB2ZXJpZnlWYXJpYWJsZSh2YXJpYWJsZU5vZGUsIHR5cGVOb2RlLCBmaWxlQ29udGV4dCkge1xuICBsZXQgdmFyaWFibGVWZXJpZmllZCA9IGZhbHNlO1xuXG4gIGZpbGVDb250ZXh0LmJlZ2luKHZhcmlhYmxlTm9kZSk7XG5cbiAgY29uc3QgdmFyaWFibGVTdHJpbmcgPSBub2RlQXNTdHJpbmcodmFyaWFibGVOb2RlKTtcblxuICBmaWxlQ29udGV4dC5kZWJ1ZyhgVmVya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T0FBTUM7WUFDNUMsQ0FBQztRQUNILENBQUM7UUFFRCxJQUFJSixhQUFhLElBQUksRUFBRTtZQUNyQlgsWUFBWW1CLFdBQVcsQ0FBQ1I7WUFFeEJWLG1CQUFtQixJQUFJO1FBQ3pCLENBQUM7SUFDSCxDQUFDO0lBRUQsSUFBSUEsa0JBQWtCO1FBQ3BCRCxZQUFZb0IsSUFBSSxDQUFDLEFBQUMsaUJBQStCLE9BQWZqQixnQkFBZTtJQUNuRCxDQUFDO0lBRURGLG1CQUNFRCxZQUFZcUIsUUFBUSxDQUFDdkIsZ0JBQ25CRSxZQUFZc0IsSUFBSSxDQUFDeEIsYUFBYTtJQUVsQyxPQUFPRztBQUNUIn0=
|
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.457",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/occam-verify-cli",
|
|
7
7
|
"description": "Occam's Verifier",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"argumentative": "^2.0.21",
|
|
14
14
|
"necessary": "^11.2.1",
|
|
15
|
-
"occam-custom-grammars": "^5.0.
|
|
15
|
+
"occam-custom-grammars": "^5.0.371",
|
|
16
16
|
"occam-dom": "^3.0.171",
|
|
17
|
-
"occam-file-system": "^5.0.
|
|
17
|
+
"occam-file-system": "^5.0.130",
|
|
18
18
|
"occam-grammar-utilities": "^7.0.66"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
package/src/axiom.js
CHANGED
|
@@ -5,30 +5,25 @@ import Label from "./label";
|
|
|
5
5
|
import { AXIOM_KIND } from "./kinds";
|
|
6
6
|
import { nodeAsString } from "./utilities/string";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { unqualifiedStatementNodeFromUnqualifiedStatementString, indicativeConditionalNodeFromIndicativeConditionalString } from "./utilities/string";
|
|
9
9
|
|
|
10
10
|
export default class Axiom {
|
|
11
|
-
constructor(labels,
|
|
11
|
+
constructor(labels, unqualifiedStatementNode, indicativeConditionalNode) {
|
|
12
12
|
this.labels = labels;
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.consequentStatementNode = consequentStatementNode;
|
|
13
|
+
this.unqualifiedStatementNode = unqualifiedStatementNode;
|
|
14
|
+
this.indicativeConditionalNode = indicativeConditionalNode;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
getLabels() {
|
|
19
18
|
return this.labels;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
return this.
|
|
21
|
+
getUnqualifiedStatementNode() {
|
|
22
|
+
return this.unqualifiedStatementNode;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
return this.
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
getConsequentStatementNode() {
|
|
31
|
-
return this.consequentStatementNode;
|
|
25
|
+
getIndicativeConditionalNode() {
|
|
26
|
+
return this.indicativeConditionalNode;
|
|
32
27
|
}
|
|
33
28
|
|
|
34
29
|
matchLabelName(labelName) {
|
|
@@ -50,24 +45,17 @@ export default class Axiom {
|
|
|
50
45
|
|
|
51
46
|
return labelJSON;
|
|
52
47
|
}),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
suppositionStatementStrings = this.suppositionStatementNodes.map((suppositionStatementNode) => {
|
|
56
|
-
const suppositionStatementString = nodeAsString(suppositionStatementNode);
|
|
57
|
-
|
|
58
|
-
return suppositionStatementString;
|
|
59
|
-
}),
|
|
48
|
+
unqualifiedStatementString = nodeAsString(this.unqalifiedStatementNode),
|
|
49
|
+
indicativeConditionalString = nodeAsString(this.indicativeConditionalNode),
|
|
60
50
|
kind = AXIOM_KIND,
|
|
61
51
|
labels = labelsJSON, ///
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
suppositions = suppositionStatementStrings, ///
|
|
52
|
+
unqualifiedStatement = unqualifiedStatementString, ///
|
|
53
|
+
indicativeConditional = indicativeConditionalString, ///
|
|
65
54
|
json = {
|
|
66
55
|
kind,
|
|
67
56
|
labels,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
suppositions
|
|
57
|
+
unqualifiedStatement,
|
|
58
|
+
indicativeConditional
|
|
71
59
|
};
|
|
72
60
|
|
|
73
61
|
return json;
|
|
@@ -85,45 +73,30 @@ export default class Axiom {
|
|
|
85
73
|
return label;
|
|
86
74
|
});
|
|
87
75
|
|
|
88
|
-
|
|
76
|
+
let { unqualifiedStatement, indicativeConditional } = json;
|
|
89
77
|
|
|
90
|
-
let
|
|
78
|
+
let unqualifiedStatementNode = null,
|
|
79
|
+
indicativeConditionalNode = null;
|
|
91
80
|
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
statementNode = statementNodeFromStatementJSON(statementJSON, releaseContext),
|
|
95
|
-
suppositionStatementNodes = null,
|
|
96
|
-
consequentStatementNode = null;
|
|
81
|
+
if (unqualifiedStatement !== null) {
|
|
82
|
+
const unqualifiedStatementString = unqualifiedStatement; ///
|
|
97
83
|
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
const statementNode = null,
|
|
101
|
-
suppositionStatementsJSON = suppositions, ///
|
|
102
|
-
suppositionStatementNodes = suppositionStatementsJSON.map((suppositionStatementJSON) => {
|
|
103
|
-
const suppositionStatementNode = statementNodeFromStatementJSON(suppositionStatementJSON, releaseContext);
|
|
84
|
+
unqualifiedStatementNode = unqualifiedStatementNodeFromUnqualifiedStatementString(unqualifiedStatementString, releaseContext);
|
|
85
|
+
}
|
|
104
86
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
consequentStatementJSON = consequent, ///
|
|
108
|
-
consequentStatementNode = statementNodeFromStatementJSON(consequentStatementJSON, releaseContext);
|
|
87
|
+
if (indicativeConditional !== null) {
|
|
88
|
+
const indicativeConditionalString = indicativeConditional; ///
|
|
109
89
|
|
|
110
|
-
|
|
90
|
+
indicativeConditionalNode = indicativeConditionalNodeFromIndicativeConditionalString(indicativeConditionalString, releaseContext);
|
|
111
91
|
}
|
|
112
92
|
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
static fromLabelsAndStatementNode(labels, statementNode) {
|
|
117
|
-
const suppositionStatementNodes = [],
|
|
118
|
-
consequentStatementNode = null,
|
|
119
|
-
axiom = new Axiom(labels, statementNode, suppositionStatementNodes, consequentStatementNode);
|
|
93
|
+
const axiom = new Axiom(labels, unqualifiedStatementNode, indicativeConditionalNode);
|
|
120
94
|
|
|
121
95
|
return axiom;
|
|
122
96
|
}
|
|
123
97
|
|
|
124
|
-
static
|
|
125
|
-
const
|
|
126
|
-
axiom = new Axiom(labels, statementNode, suppositionStatementNodes, consequentStatementNode);
|
|
98
|
+
static fromLabelsUnqualifiedStatementNodeAndIndicativeConditionalNode(labels, unqualifiedStatementNode, indicativeConditionalNode) {
|
|
99
|
+
const axiom = new Axiom(labels, unqualifiedStatementNode, indicativeConditionalNode);
|
|
127
100
|
|
|
128
101
|
return axiom;
|
|
129
102
|
}
|
package/src/combinator.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { nodeAsString } from "./utilities/string";
|
|
4
4
|
import { COMBINATOR_KIND } from "./kinds";
|
|
5
|
-
import {
|
|
5
|
+
import { statementNodeFromStatementString } from "./utilities/string";
|
|
6
6
|
|
|
7
7
|
export default class Combinator {
|
|
8
8
|
constructor(statementNode) {
|
|
@@ -33,8 +33,8 @@ export default class Combinator {
|
|
|
33
33
|
|
|
34
34
|
static fromJSON(json, releaseContext) {
|
|
35
35
|
const { statement } = json,
|
|
36
|
-
|
|
37
|
-
statementNode =
|
|
36
|
+
statementString = statement, ///
|
|
37
|
+
statementNode = statementNodeFromStatementString(statementString, releaseContext),
|
|
38
38
|
combinator = new Combinator(statementNode);
|
|
39
39
|
|
|
40
40
|
return combinator;
|
package/src/conclusion.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { first } from "./utilities/array";
|
|
4
4
|
import { nodeAsString } from "./utilities/string";
|
|
5
5
|
import { metavariableNameFromMetavariableNode } from "./utilities/query";
|
|
6
|
-
import {
|
|
6
|
+
import { metastatementNodeFromMetastatementString } from "./utilities/string";
|
|
7
7
|
import { METAVARIABLE_RULE_NAME, METASTATEMENT_RULE_NAME } from "./ruleNames";
|
|
8
8
|
|
|
9
9
|
export default class Conclusion {
|
|
@@ -36,8 +36,8 @@ export default class Conclusion {
|
|
|
36
36
|
|
|
37
37
|
static fromJSON(json, releaseContext) {
|
|
38
38
|
const { metastatement } = json,
|
|
39
|
-
|
|
40
|
-
metastatementNode =
|
|
39
|
+
metastatementString = metastatement, ///
|
|
40
|
+
metastatementNode = metastatementNodeFromMetastatementString(metastatementString, releaseContext),
|
|
41
41
|
conclusion = new Conclusion(metastatementNode);
|
|
42
42
|
|
|
43
43
|
return conclusion;
|
package/src/constructor.js
CHANGED
|
@@ -4,7 +4,7 @@ import Type from "./type";
|
|
|
4
4
|
|
|
5
5
|
import { nodeAsString } from "./utilities/string";
|
|
6
6
|
import { CONSTRUCTOR_KIND } from "./kinds";
|
|
7
|
-
import {
|
|
7
|
+
import { termNodeFromTermString } from "./utilities/string";
|
|
8
8
|
|
|
9
9
|
export default class Constructor {
|
|
10
10
|
constructor(termNode, type) {
|
|
@@ -56,8 +56,8 @@ export default class Constructor {
|
|
|
56
56
|
|
|
57
57
|
static fromJSON(json, releaseContext) {
|
|
58
58
|
const { term } = json,
|
|
59
|
-
|
|
60
|
-
termNode =
|
|
59
|
+
termString = term, ///
|
|
60
|
+
termNode = termNodeFromTermString(termString, releaseContext);
|
|
61
61
|
|
|
62
62
|
let { type } = json;
|
|
63
63
|
|
package/src/context/file.js
CHANGED
|
@@ -391,6 +391,12 @@ export default class FileContext {
|
|
|
391
391
|
json.push(axiomJSON);
|
|
392
392
|
});
|
|
393
393
|
|
|
394
|
+
this.lemmas.forEach((lemma) => {
|
|
395
|
+
const lemmaJSON = lemma.toJSON();
|
|
396
|
+
|
|
397
|
+
json.push(lemmaJSON);
|
|
398
|
+
});
|
|
399
|
+
|
|
394
400
|
this.theorems.forEach((theorem) => {
|
|
395
401
|
const theoremJSON = theorem.toJSON();
|
|
396
402
|
|
|
@@ -7,13 +7,14 @@ import { rewriteNodes } from "occam-grammar-utilities";
|
|
|
7
7
|
import Rule from "../../rule";
|
|
8
8
|
import Type from "../../type";
|
|
9
9
|
import Axiom from "../../axiom";
|
|
10
|
+
import Lemma from "../../lemma";
|
|
10
11
|
import Theorem from "../../theorem";
|
|
11
12
|
import Combinator from "../../combinator";
|
|
12
13
|
import Constructor from "../../constructor";
|
|
13
14
|
|
|
14
15
|
import { push } from "../../utilities/array";
|
|
15
16
|
import { customGrammarFromNameAndEntries } from "../../utilities/customGrammar";
|
|
16
|
-
import { RULE_KIND, TYPE_KIND, AXIOM_KIND, THEOREM_KIND, COMBINATOR_KIND, CONSTRUCTOR_KIND } from "../../kinds";
|
|
17
|
+
import { RULE_KIND, TYPE_KIND, AXIOM_KIND, LEMMA_KIND, THEOREM_KIND, COMBINATOR_KIND, CONSTRUCTOR_KIND } from "../../kinds";
|
|
17
18
|
|
|
18
19
|
export default class FileReleaseContext extends ReleaseContext {
|
|
19
20
|
constructor(log, name, entries, callbacks, verified, customGrammar, florenceLexer, florenceParser, dependencyReleaseContexts, contextJSON, types, rules, axioms, lemmas, theorems, combinators, constructors) {
|
|
@@ -203,9 +204,7 @@ export default class FileReleaseContext extends ReleaseContext {
|
|
|
203
204
|
return node;
|
|
204
205
|
}
|
|
205
206
|
|
|
206
|
-
|
|
207
|
-
super.initialise(dependencyReleaseContexts);
|
|
208
|
-
|
|
207
|
+
fromJSON() {
|
|
209
208
|
const jsonArray = this.contextJSON,
|
|
210
209
|
releaseContext = this; ///
|
|
211
210
|
|
|
@@ -237,6 +236,14 @@ export default class FileReleaseContext extends ReleaseContext {
|
|
|
237
236
|
break;
|
|
238
237
|
}
|
|
239
238
|
|
|
239
|
+
case LEMMA_KIND: {
|
|
240
|
+
const lemma = Lemma.fromJSON(json, releaseContext);
|
|
241
|
+
|
|
242
|
+
this.lemmas.push(lemma);
|
|
243
|
+
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
|
|
240
247
|
case THEOREM_KIND: {
|
|
241
248
|
const theorem = Theorem.fromJSON(json, releaseContext);
|
|
242
249
|
|
|
@@ -264,6 +271,12 @@ export default class FileReleaseContext extends ReleaseContext {
|
|
|
264
271
|
});
|
|
265
272
|
}
|
|
266
273
|
|
|
274
|
+
initialise(dependencyReleaseContexts) {
|
|
275
|
+
super.initialise(dependencyReleaseContexts);
|
|
276
|
+
|
|
277
|
+
this.fromJSON();
|
|
278
|
+
}
|
|
279
|
+
|
|
267
280
|
static fromLogNameEntriesCallbacksAndContextJSON(log, name, entries, callbacks, contextJSON) {
|
|
268
281
|
const verified = true,
|
|
269
282
|
customGrammar = customGrammarFromNameAndEntries(name, entries),
|
package/src/label.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { nodeAsString } from "./utilities/string";
|
|
4
|
-
import { labelNodeFromLabelJSON } from "./utilities/node";
|
|
5
4
|
import { labelNameFromLabelNode } from "./utilities/query";
|
|
5
|
+
import { labelNodeFromLabelString } from "./utilities/string";
|
|
6
6
|
|
|
7
7
|
export default class Label {
|
|
8
8
|
constructor(node) {
|
|
@@ -35,8 +35,8 @@ export default class Label {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
static fromJSON(json, releaseContext) {
|
|
38
|
-
const
|
|
39
|
-
labelNode =
|
|
38
|
+
const labelString = json, ///
|
|
39
|
+
labelNode = labelNodeFromLabelString(labelString, releaseContext),
|
|
40
40
|
node = labelNode, ///
|
|
41
41
|
label = new Label(node);
|
|
42
42
|
|
package/src/lemma.js
CHANGED
|
@@ -5,36 +5,31 @@ import Label from "./label";
|
|
|
5
5
|
import { LEMMA_KIND } from "./kinds";
|
|
6
6
|
import { nodeAsString } from "./utilities/string";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { unqualifiedStatementNodeFromUnqualifiedStatementString, indicativeConditionalNodeFromIndicativeConditionalString } from "./utilities/string";
|
|
9
9
|
|
|
10
10
|
export default class Lemma {
|
|
11
|
-
constructor(labels,
|
|
11
|
+
constructor(labels, unqualifiedStatementNode, indicativeConditionalNode) {
|
|
12
12
|
this.labels = labels;
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.consequentStatementNode = consequentStatementNode;
|
|
13
|
+
this.unqualifiedStatementNode = unqualifiedStatementNode;
|
|
14
|
+
this.indicativeConditionalNode = indicativeConditionalNode;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
getLabels() {
|
|
19
18
|
return this.labels;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
return this.
|
|
21
|
+
getUnqualifiedStatementNode() {
|
|
22
|
+
return this.unqualifiedStatementNode;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
return this.
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
getConsequentStatementNode() {
|
|
31
|
-
return this.consequentStatementNode;
|
|
25
|
+
getIndicativeConditionalNode() {
|
|
26
|
+
return this.indicativeConditionalNode;
|
|
32
27
|
}
|
|
33
28
|
|
|
34
29
|
matchLabelName(labelName) {
|
|
35
30
|
const matchesLabelName = this.labels.some((label) => {
|
|
36
31
|
const name = labelName, ///
|
|
37
|
-
|
|
32
|
+
labelMatchesName = label.matchName(name);
|
|
38
33
|
|
|
39
34
|
if (labelMatchesName) {
|
|
40
35
|
return true;
|
|
@@ -50,24 +45,17 @@ export default class Lemma {
|
|
|
50
45
|
|
|
51
46
|
return labelJSON;
|
|
52
47
|
}),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
suppositionStatementStrings = this.suppositionStatementNodes.map((suppositionStatementNode) => {
|
|
56
|
-
const suppositionStatementString = nodeAsString(suppositionStatementNode);
|
|
57
|
-
|
|
58
|
-
return suppositionStatementString;
|
|
59
|
-
}),
|
|
48
|
+
unqualifiedStatementString = nodeAsString(this.unqalifiedStatementNode),
|
|
49
|
+
indicativeConditionalString = nodeAsString(this.indicativeConditionalNode),
|
|
60
50
|
kind = LEMMA_KIND,
|
|
61
51
|
labels = labelsJSON, ///
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
suppositions = suppositionStatementStrings, ///
|
|
52
|
+
unqualifiedStatement = unqualifiedStatementString, ///
|
|
53
|
+
indicativeConditional = indicativeConditionalString, ///
|
|
65
54
|
json = {
|
|
66
55
|
kind,
|
|
67
56
|
labels,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
suppositions
|
|
57
|
+
unqualifiedStatement,
|
|
58
|
+
indicativeConditional
|
|
71
59
|
};
|
|
72
60
|
|
|
73
61
|
return json;
|
|
@@ -85,45 +73,30 @@ export default class Lemma {
|
|
|
85
73
|
return label;
|
|
86
74
|
});
|
|
87
75
|
|
|
88
|
-
|
|
76
|
+
let { unqualifiedStatement, indicativeConditional } = json;
|
|
89
77
|
|
|
90
|
-
let
|
|
78
|
+
let unqualifiedStatementNode = null,
|
|
79
|
+
indicativeConditionalNode = null;
|
|
91
80
|
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
statementNode = statementNodeFromStatementJSON(statementJSON, releaseContext),
|
|
95
|
-
suppositionStatementNodes = null,
|
|
96
|
-
consequentStatementNode = null;
|
|
81
|
+
if (unqualifiedStatement !== null) {
|
|
82
|
+
const unqualifiedStatementString = unqualifiedStatement; ///
|
|
97
83
|
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
const statementNode = null,
|
|
101
|
-
suppositionStatementsJSON = suppositions, ///
|
|
102
|
-
suppositionStatementNodes = suppositionStatementsJSON.map((suppositionStatementJSON) => {
|
|
103
|
-
const suppositionStatementNode = statementNodeFromStatementJSON(suppositionStatementJSON, releaseContext);
|
|
84
|
+
unqualifiedStatementNode = unqualifiedStatementNodeFromUnqualifiedStatementString(unqualifiedStatementString, releaseContext);
|
|
85
|
+
}
|
|
104
86
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
consequentStatementJSON = consequent, ///
|
|
108
|
-
consequentStatementNode = statementNodeFromStatementJSON(consequentStatementJSON, releaseContext);
|
|
87
|
+
if (indicativeConditional !== null) {
|
|
88
|
+
const indicativeConditionalString = indicativeConditional; ///
|
|
109
89
|
|
|
110
|
-
|
|
90
|
+
indicativeConditionalNode = indicativeConditionalNodeFromIndicativeConditionalString(indicativeConditionalString, releaseContext);
|
|
111
91
|
}
|
|
112
92
|
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
static fromLabelsAndStatementNode(labels, statementNode) {
|
|
117
|
-
const suppositionStatementNodes = [],
|
|
118
|
-
consequentStatementNode = null,
|
|
119
|
-
lemma = new Lemma(labels, statementNode, suppositionStatementNodes, consequentStatementNode);
|
|
93
|
+
const lemma = new Lemma(labels, unqualifiedStatementNode, indicativeConditionalNode);
|
|
120
94
|
|
|
121
95
|
return lemma;
|
|
122
96
|
}
|
|
123
97
|
|
|
124
|
-
static
|
|
125
|
-
const
|
|
126
|
-
lemma = new Lemma(labels, statementNode, suppositionStatementNodes, consequentStatementNode);
|
|
98
|
+
static fromLabelsUnqualifiedStatementNodeAndIndicativeConditionalNode(labels, unqualifiedStatementNode, indicativeConditionalNode) {
|
|
99
|
+
const lemma = new Lemma(labels, unqualifiedStatementNode, indicativeConditionalNode);
|
|
127
100
|
|
|
128
101
|
return lemma;
|
|
129
102
|
}
|
package/src/premise.js
CHANGED
|
@@ -6,7 +6,7 @@ import { first } from "./utilities/array";
|
|
|
6
6
|
import { nodeAsString } from "./utilities/string";
|
|
7
7
|
import { nodeQuery, nodesQuery } from "./utilities/query";
|
|
8
8
|
import { metavariableNameFromMetavariableNode } from "./utilities/query";
|
|
9
|
-
import {
|
|
9
|
+
import { metastatementNodeFromMetastatementString } from "./utilities/string";
|
|
10
10
|
import { METAVARIABLE_RULE_NAME, METASTATEMENT_RULE_NAME } from "./ruleNames";
|
|
11
11
|
|
|
12
12
|
const metastatementNodesQuery = nodesQuery("/metaSubproofAssertion/metastatement"),
|
|
@@ -71,8 +71,8 @@ export default class Premise {
|
|
|
71
71
|
|
|
72
72
|
static fromJSON(json, releaseContext) {
|
|
73
73
|
const { metastatement } = json,
|
|
74
|
-
|
|
75
|
-
metastatementNode =
|
|
74
|
+
metastatementString = metastatement, ///
|
|
75
|
+
metastatementNode = metastatementNodeFromMetastatementString(metastatementString, releaseContext),
|
|
76
76
|
premise = new Premise(metastatementNode);
|
|
77
77
|
|
|
78
78
|
return premise;
|
package/src/ruleNames.js
CHANGED
|
@@ -8,6 +8,7 @@ export const METAVARIABLE_RULE_NAME = "metavariable";
|
|
|
8
8
|
export const METASTATEMENT_RULE_NAME = "metastatement";
|
|
9
9
|
export const META_SUBPROOF_RULE_NAME = "metaSubproof";
|
|
10
10
|
export const UNQUALIFIED_STATEMENT_RULE_NAME = "unqualifiedStatement";
|
|
11
|
+
export const INDICATIVE_CONDITIONAL_RULE_NAME = "indicativeConditional";
|
|
11
12
|
export const COMBINATOR_DECLARATION_RULE_NAME = "combinatorDeclaration";
|
|
12
13
|
export const CONSTRUCTOR_DECLARATION_RULE_NAME = "constructorDeclaration";
|
|
13
14
|
export const QUALIFIED_METASTATEMENT_RULE_NAME = "qualifiedMetastatement";
|