occam-verify-cli 0.0.892 → 0.0.893
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/axiomLemmaTheoremConjecture.js +3 -3
- package/lib/conclusion.js +4 -3
- package/lib/metaConsequent.js +4 -3
- package/lib/metaLemmaMetatheorem.js +13 -13
- package/lib/metaSupposition.js +6 -5
- package/lib/premise.js +9 -8
- package/lib/rule.js +16 -15
- package/lib/verifier/nodes/metaLevel.js +7 -7
- package/lib/verify/derivation.js +10 -90
- package/lib/verify/metaDerivation.js +7 -87
- package/lib/verify/metaProofStep.js +76 -0
- package/lib/verify/metaSubDerivation.js +25 -0
- package/lib/verify/metaSubproof.js +34 -0
- package/lib/verify/metaproof.js +7 -8
- package/lib/verify/metastatement/qualified.js +53 -34
- package/lib/verify/metastatement/unqualified.js +16 -19
- package/lib/verify/proofStep.js +70 -0
- package/lib/verify/ruleDerivation.js +7 -85
- package/lib/verify/ruleProofStep.js +76 -0
- package/lib/verify/ruleSubDerivation.js +25 -0
- package/lib/verify/ruleSubproof.js +34 -0
- package/lib/verify/statement/qualified.js +47 -89
- package/lib/verify/statement/unqualified.js +16 -19
- package/lib/verify/subDerivation.js +25 -0
- package/lib/verify/subproof.js +34 -0
- package/package.json +4 -4
- package/src/axiomLemmaTheoremConjecture.js +4 -2
- package/src/conclusion.js +6 -4
- package/src/metaConsequent.js +6 -4
- package/src/metaLemmaMetatheorem.js +12 -12
- package/src/metaSupposition.js +11 -8
- package/src/premise.js +15 -14
- package/src/rule.js +16 -14
- package/src/verifier/nodes/metaLevel.js +6 -6
- package/src/verify/derivation.js +10 -138
- package/src/verify/metaDerivation.js +7 -135
- package/src/verify/metaProofStep.js +98 -0
- package/src/verify/metaSubDerivation.js +22 -0
- package/src/verify/metaSubproof.js +32 -0
- package/src/verify/metaproof.js +11 -11
- package/src/verify/metastatement/qualified.js +67 -31
- package/src/verify/metastatement/unqualified.js +16 -19
- package/src/verify/proofStep.js +88 -0
- package/src/verify/ruleDerivation.js +7 -133
- package/src/verify/ruleProofStep.js +99 -0
- package/src/verify/ruleSubDerivation.js +22 -0
- package/src/verify/ruleSubproof.js +32 -0
- package/src/verify/statement/qualified.js +55 -127
- package/src/verify/statement/unqualified.js +16 -19
- package/src/verify/subDerivation.js +22 -0
- package/src/verify/subproof.js +32 -0
|
@@ -18,26 +18,23 @@ function _interop_require_default(obj) {
|
|
|
18
18
|
var statementNodeQuery = (0, _query.nodeQuery)("/unqualifiedStatement/statement!");
|
|
19
19
|
function verifyUnqualifiedStatement(unqualifiedStatementNode, assignments, derived, localContext) {
|
|
20
20
|
var unqualifiedStatementVerified = false;
|
|
21
|
-
var statementNode = statementNodeQuery(unqualifiedStatementNode);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (unqualifiedStatementVerified) {
|
|
37
|
-
localContext.debug("...verified the '".concat(statementString, "' unqualified statement."), unqualifiedStatementNode);
|
|
38
|
-
}
|
|
21
|
+
var statementNode = statementNodeQuery(unqualifiedStatementNode), unqualifiedStatementString = localContext.nodeAsString(unqualifiedStatementNode);
|
|
22
|
+
localContext.trace("Verifying the '".concat(unqualifiedStatementString, "' unqualified statement..."), unqualifiedStatementNode);
|
|
23
|
+
if (derived) {
|
|
24
|
+
var statementMatches = localContext.matchStatement(statementNode);
|
|
25
|
+
unqualifiedStatementVerified = statementMatches; ///
|
|
26
|
+
}
|
|
27
|
+
if (!unqualifiedStatementVerified) {
|
|
28
|
+
var statementVerified = (0, _statement.default)(statementNode, assignments, derived, localContext, function() {
|
|
29
|
+
var verifiedAhead = true;
|
|
30
|
+
return verifiedAhead;
|
|
31
|
+
});
|
|
32
|
+
unqualifiedStatementVerified = statementVerified; ///
|
|
33
|
+
}
|
|
34
|
+
if (unqualifiedStatementVerified) {
|
|
35
|
+
localContext.debug("...verified the '".concat(unqualifiedStatementString, "' unqualified statement."), unqualifiedStatementNode);
|
|
39
36
|
}
|
|
40
37
|
return unqualifiedStatementVerified;
|
|
41
38
|
}
|
|
42
39
|
|
|
43
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy92ZXJpZnkvc3RhdGVtZW50L3VucXVhbGlmaWVkLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5pbXBvcnQgdmVyaWZ5U3RhdGVtZW50IGZyb20gXCIuLi8uLi92ZXJpZnkvc3RhdGVtZW50XCI7XG5cbmltcG9ydCB7IG5vZGVRdWVyeSB9IGZyb20gXCIuLi8uLi91dGlsaXRpZXMvcXVlcnlcIjtcblxuY29uc3Qgc3RhdGVtZW50Tm9kZVF1ZXJ5ID0gbm9kZVF1ZXJ5KFwiL3VucXVhbGlmaWVkU3RhdGVtZW50L3N0YXRlbWVudCFcIik7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHZlcmlmeVVucXVhbGlmaWVkU3RhdGVtZW50KHVucXVhbGlmaWVkU3RhdGVtZW50Tm9kZSwgYXNzaWdubWVudHMsIGRlcml2ZWQsIGxvY2FsQ29udGV4dCkge1xuICBsZXQgdW5xdWFsaWZpZWRTdGF0ZW1lbnRWZXJpZmllZCA9IGZhbHNlO1xuXG4gIGNvbnN0IHN0YXRlbWVudE5vZGUgPSBzdGF0ZW1lbnROb2RlUXVlcnkodW5xdWFsaWZpZWRTdGF0ZW1lbnROb2RlKSxcbiAgICAgICAgdW5xdWFsaWZpZWRTdGF0ZW1lbnRTdHJpbmcgPSBsb2NhbENvbnRleHQubm9kZUFzU3RyaW5nKHVucXVhbGlmaWVkU3RhdGVtZW50Tm9kZSk7XG5cbiAgbG9j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ZQUNyRixJQUFNVSxnQkFBZ0I7WUFFdEIsT0FBT0E7UUFDVDtRQUVOVCwrQkFBK0JPLG1CQUFvQixHQUFHO0lBQ3hEO0lBRUEsSUFBSVAsOEJBQThCO1FBQ2hDRCxhQUFhVyxLQUFLLENBQUMsQUFBQyxvQkFBOEMsT0FBM0JSLDRCQUEyQiw2QkFBMkJOO0lBQy9GO0lBRUEsT0FBT0k7QUFDVCJ9
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return verifySubDerivation;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _query = require("../utilities/query");
|
|
12
|
+
var proofStepNodesQuery = (0, _query.nodesQuery)("/subDerivation/proofStep|lastProofStep");
|
|
13
|
+
function verifySubDerivation(subDerivationNode, localMetaContext) {
|
|
14
|
+
var subDerivationVerified;
|
|
15
|
+
var proofStepNodes = proofStepNodesQuery(subDerivationNode);
|
|
16
|
+
subDerivationVerified = proofStepNodes.every(function(proofStepNode) {
|
|
17
|
+
var verifyProofStep = verifySubDerivation.verifyProofStep, proofStepVerified = verifyProofStep(proofStepNode, localMetaContext);
|
|
18
|
+
if (proofStepVerified) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return subDerivationVerified;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92ZXJpZnkvc3ViRGVyaXZhdGlvbi5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuaW1wb3J0IHsgbm9kZXNRdWVyeSB9IGZyb20gXCIuLi91dGlsaXRpZXMvcX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WFwcGluZ3MiOiJBQUFBOzs7OytCQU1BOzs7ZUFBd0JBOzs7cUJBSkc7QUFFM0IsSUFBTUMsc0JBQXNCQyxJQUFBQSxpQkFBVSxFQUFDO0FBRXhCLFNBQVNGLG9CQUFvQkcsaUJBQWlCLEVBQUVDLGdCQUFnQjtJQUM3RSxJQUFJQztJQUVKLElBQU1DLGlCQUFpQkwsb0JBQW9CRTtJQUUzQ0Usd0JBQXdCQyxlQUFlQyxLQUFLLENBQUMsU0FBQ0M7UUFDNUMsSUFBTSxBQUFFQyxrQkFBb0JULG9CQUFwQlMsaUJBQ0ZDLG9CQUFvQkQsZ0JBQWdCRCxlQUFlSjtRQUV6RCxJQUFJTSxtQkFBbUI7WUFDckIsT0FBTztRQUNUO0lBQ0Y7SUFFQSxPQUFPTDtBQUNUIn0=
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return verifySubproof;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _local = /*#__PURE__*/ _interop_require_default(require("../context/local"));
|
|
12
|
+
var _suppositions = /*#__PURE__*/ _interop_require_default(require("../verify/suppositions"));
|
|
13
|
+
var _subDerivation = /*#__PURE__*/ _interop_require_default(require("../verify/subDerivation"));
|
|
14
|
+
var _query = require("../utilities/query");
|
|
15
|
+
function _interop_require_default(obj) {
|
|
16
|
+
return obj && obj.__esModule ? obj : {
|
|
17
|
+
default: obj
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
var suppositionNodesQuery = (0, _query.nodesQuery)("/subproof/supposition"), subDerivationNodeQuery = (0, _query.nodeQuery)("/subproof/subDerivation");
|
|
21
|
+
function verifySubproof(subproofNode, localContext) {
|
|
22
|
+
var subproofVerified = false;
|
|
23
|
+
localContext = _local.default.fromLocalContext(localContext); ///
|
|
24
|
+
var suppositions = [], suppositionNodes = suppositionNodesQuery(subproofNode), suppositionsVerified = (0, _suppositions.default)(suppositionNodes, suppositions, localContext);
|
|
25
|
+
if (suppositionsVerified) {
|
|
26
|
+
var subDerivationNode = subDerivationNodeQuery(subproofNode), subDerivationVerified = (0, _subDerivation.default)(subDerivationNode, localContext);
|
|
27
|
+
if (subDerivationVerified) {
|
|
28
|
+
subproofVerified = true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return subproofVerified;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92ZXJpZnkvc3VicHJvb2YuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmltcG9ydCBMb2NhbENvbnRleHQgZnJvbSBcIi4uL2NvbnRleHQvbG9jYWxcIjtcbmltcG9ydCB2ZXJpZnlTdXBwb3NpdGlvbnMgZnJvbSBcIi4uL3ZlcmlmeS9zdXBwb3NpdGlvbnNcIjtcbmltcG9ydCB2ZXJpZnlTdWJEZXJpdmF0aW9uIGZyb20gXCIuLi92ZXJpZnkvc3ViRGVyaXZhdGlvblwiO1xuXG5pbXBvcnQgeyBub2RlUXVlcnksIG5vZGVzUXVlcnkgfSBmcm9tIFwiLi4vdXRpbGl0aWVzL3F1ZXJ5XCI7XG5cbmNvbnN0IHN1cHBvc2l0aW9uTm9kZXNRdWVyeSA9IG5vZGVzUXVlcnkoXCIvc3VicHJvb2Yvc3VwcG9zaXRpb25cIiksXG4gICAgICBzdWJEZXJpdmF0aW9uTm9kZVF1ZXJ5ID0gbm9kZVF1ZXJ5KFwiL3N1YnByb29mL3N1YkRlcml2YXRpb25cIik7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHZlcmlmeVN1YnByb29mKHN1YnByb29mTm9kZSw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cHBvc2l0aW9ucyIsInN1cHBvc2l0aW9uTm9kZXMiLCJzdXBwb3NpdGlvbnNWZXJpZmllZCIsInZlcmlmeVN1cHBvc2l0aW9ucyIsInN1YkRlcml2YXRpb25Ob2RlIiwic3ViRGVyaXZhdGlvblZlcmlmaWVkIiwidmVyaWZ5U3ViRGVyaXZhdGlvbiJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7K0JBV0E7OztlQUF3QkE7Ozs0REFUQzttRUFDTTtvRUFDQztxQkFFTTs7Ozs7O0FBRXRDLElBQU1DLHdCQUF3QkMsSUFBQUEsaUJBQVUsRUFBQywwQkFDbkNDLHlCQUF5QkMsSUFBQUEsZ0JBQVMsRUFBQztBQUUxQixTQUFTSixlQUFlSyxZQUFZLEVBQUVDLFlBQVk7SUFDL0QsSUFBSUMsbUJBQW1CO0lBRXZCRCxlQUFlRSxjQUFZLENBQUNDLGdCQUFnQixDQUFDSCxlQUFlLEdBQUc7SUFFL0QsSUFBTUksZUFBZSxFQUFFLEVBQ2pCQyxtQkFBbUJWLHNCQUFzQkksZUFDekNPLHVCQUF1QkMsSUFBQUEscUJBQWtCLEVBQUNGLGtCQUFrQkQsY0FBY0o7SUFFaEYsSUFBSU0sc0JBQXNCO1FBQ3hCLElBQU1FLG9CQUFvQlgsdUJBQXVCRSxlQUMzQ1Usd0JBQXdCQyxJQUFBQSxzQkFBbUIsRUFBQ0YsbUJBQW1CUjtRQUVyRSxJQUFJUyx1QkFBdUI7WUFDekJSLG1CQUFtQjtRQUNyQjtJQUNGO0lBRUEsT0FBT0E7QUFDVCJ9
|
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.893",
|
|
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.28",
|
|
14
14
|
"necessary": "^14.0.1",
|
|
15
|
-
"occam-custom-grammars": "^5.0.
|
|
16
|
-
"occam-entities": "^1.0.
|
|
17
|
-
"occam-file-system": "^6.0.
|
|
15
|
+
"occam-custom-grammars": "^5.0.802",
|
|
16
|
+
"occam-entities": "^1.0.143",
|
|
17
|
+
"occam-file-system": "^6.0.184",
|
|
18
18
|
"occam-grammar-utilities": "^8.0.207",
|
|
19
19
|
"occam-query": "^3.1.174"
|
|
20
20
|
},
|
|
@@ -7,6 +7,7 @@ import LocalContext from "./context/local";
|
|
|
7
7
|
|
|
8
8
|
import { prune } from "./utilities/array";
|
|
9
9
|
import { someSubArray } from "./utilities/array";
|
|
10
|
+
import local from "./context/local";
|
|
10
11
|
|
|
11
12
|
export default class AxiomLemmaTheoremConjecture {
|
|
12
13
|
constructor(labels, suppositions, consequent, localContext) {
|
|
@@ -32,10 +33,11 @@ export default class AxiomLemmaTheoremConjecture {
|
|
|
32
33
|
return this.localContext;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
matchStatement(statementNode,
|
|
36
|
+
matchStatement(statementNode, localContext) {
|
|
36
37
|
let statementNatches;
|
|
37
38
|
|
|
38
|
-
const suppositionsLength = this.suppositions.length
|
|
39
|
+
const suppositionsLength = this.suppositions.length,
|
|
40
|
+
statementLocalContext = localContext; ///
|
|
39
41
|
|
|
40
42
|
if (suppositionsLength === 0) {
|
|
41
43
|
const substitutions = [],
|
package/src/conclusion.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import LocalMetaContext from "./context/localMeta";
|
|
3
4
|
import metaLevelNodesVerifier from "./verifier/nodes/metaLevel";
|
|
4
5
|
import intrinsicLevelAgainstMetaLevelNodesVerifier from "./verifier/nodes/intrinsicLevelAgainstMetaLevel";
|
|
5
6
|
|
|
@@ -30,12 +31,13 @@ export default class Conclusion {
|
|
|
30
31
|
return statementNodeMatches;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
matchMetastatementNode(metastatementNode, substitutions,
|
|
34
|
+
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
34
35
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
35
36
|
nonTerminalNodeB = metastatementNode, ///
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
fileContextA = fileContext, ///
|
|
38
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
39
|
+
localMetaContextB = localMetaContext, ///
|
|
40
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
39
41
|
const verifiedAhead = true;
|
|
40
42
|
|
|
41
43
|
return verifiedAhead;
|
package/src/metaConsequent.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import LocalMetaContext from "./context/localMeta";
|
|
3
4
|
import metaLevelNodesVerifier from "./verifier/nodes/metaLevel";
|
|
4
5
|
|
|
5
6
|
import { nodeAsString } from "./utilities/string";
|
|
@@ -14,12 +15,13 @@ export default class MetaConsequent {
|
|
|
14
15
|
return this.metastatementNode;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
matchMetastatementNode(metastatementNode, substitutions,
|
|
18
|
+
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
18
19
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
19
20
|
nonTerminalNodeB = metastatementNode, ///
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
fileContextA = fileContext, ///
|
|
22
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
23
|
+
localMetaContextB = localMetaContext, ///
|
|
24
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
23
25
|
const verifiedAhead = true;
|
|
24
26
|
|
|
25
27
|
return verifiedAhead;
|
|
@@ -37,27 +37,27 @@ export default class MetaLemmaMetatheorem {
|
|
|
37
37
|
return this.fileContext;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
matchMetastatement(metastatementNode,
|
|
40
|
+
matchMetastatement(metastatementNode, localMetaContext) {
|
|
41
41
|
let metastatementNatches;
|
|
42
42
|
|
|
43
43
|
const metaSuppositionsLength = this.metaSuppositions.length;
|
|
44
44
|
|
|
45
45
|
if (metaSuppositionsLength === 0) {
|
|
46
46
|
const substitutions = [],
|
|
47
|
-
metaConsequentMatches = matchMetaConsequent(this.metaConsequent, metastatementNode, substitutions, this.fileContext,
|
|
47
|
+
metaConsequentMatches = matchMetaConsequent(this.metaConsequent, metastatementNode, substitutions, this.fileContext, localMetaContext);
|
|
48
48
|
|
|
49
49
|
metastatementNatches = metaConsequentMatches; ///
|
|
50
50
|
} else {
|
|
51
|
-
const metaproofSteps =
|
|
51
|
+
const metaproofSteps = localMetaContext.getProofSteps();
|
|
52
52
|
|
|
53
53
|
metastatementNatches = someSubArray(metaproofSteps, metaSuppositionsLength, (metaproofSteps) => {
|
|
54
54
|
let metaSuppositionsMatchMetaConsequent = false;
|
|
55
55
|
|
|
56
56
|
const substitutions = [],
|
|
57
|
-
metaSuppositionsMatch = matchMetaSuppositions(this.metaSuppositions, metaproofSteps, substitutions, this.fileContext,
|
|
57
|
+
metaSuppositionsMatch = matchMetaSuppositions(this.metaSuppositions, metaproofSteps, substitutions, this.fileContext, localMetaContext);
|
|
58
58
|
|
|
59
59
|
if (metaSuppositionsMatch) {
|
|
60
|
-
const metaConsequentMatches = matchMetaConsequent(this.metaConsequent, metastatementNode, substitutions, this.fileContext,
|
|
60
|
+
const metaConsequentMatches = matchMetaConsequent(this.metaConsequent, metastatementNode, substitutions, this.fileContext, localMetaContext);
|
|
61
61
|
|
|
62
62
|
metaSuppositionsMatchMetaConsequent = metaConsequentMatches; ///
|
|
63
63
|
}
|
|
@@ -162,13 +162,13 @@ export default class MetaLemmaMetatheorem {
|
|
|
162
162
|
static fromLabelsMetaSuppositionsMetaConsequentSubstitutionsAndFileContext(Class, labels, metaSuppositions, metaConsequent, substitutions, fileContext) { return new Class(labels, metaSuppositions, metaConsequent, substitutions, fileContext); }
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
function matchMetaSupposition(metaSupposition, metaproofSteps, substitutions, fileContext,
|
|
165
|
+
function matchMetaSupposition(metaSupposition, metaproofSteps, substitutions, fileContext, localMetaContext) {
|
|
166
166
|
const metaproofStep = prune(metaproofSteps, (metaproofStep) => {
|
|
167
167
|
const metaSubproofNode = metaproofStep.getMetaSubproofNode(),
|
|
168
168
|
metastatementNode = metaproofStep.getMetastatementNode();
|
|
169
169
|
|
|
170
170
|
if (metaSubproofNode !== null) {
|
|
171
|
-
const metaSubProofMatches = metaSupposition.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext,
|
|
171
|
+
const metaSubProofMatches = metaSupposition.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext);
|
|
172
172
|
|
|
173
173
|
if (!metaSubProofMatches) { ///
|
|
174
174
|
return true;
|
|
@@ -176,7 +176,7 @@ function matchMetaSupposition(metaSupposition, metaproofSteps, substitutions, fi
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
if (metastatementNode !== null) {
|
|
179
|
-
const metastatementMatches = metaSupposition.matchMetastatementNode(metastatementNode, substitutions, fileContext,
|
|
179
|
+
const metastatementMatches = metaSupposition.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext);
|
|
180
180
|
|
|
181
181
|
if (!metastatementMatches) { ///
|
|
182
182
|
return true;
|
|
@@ -189,9 +189,9 @@ function matchMetaSupposition(metaSupposition, metaproofSteps, substitutions, fi
|
|
|
189
189
|
return metaSuppositionMatches;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
function matchMetaSuppositions(metaSuppositions, metaproofSteps, substitutions, fileContext,
|
|
192
|
+
function matchMetaSuppositions(metaSuppositions, metaproofSteps, substitutions, fileContext, localMetaContext) {
|
|
193
193
|
const metaSuppositionsMatch = metaSuppositions.every((metaSupposition) => {
|
|
194
|
-
const metaSuppositionMatches = matchMetaSupposition(metaSupposition, metaproofSteps, substitutions, fileContext,
|
|
194
|
+
const metaSuppositionMatches = matchMetaSupposition(metaSupposition, metaproofSteps, substitutions, fileContext, localMetaContext);
|
|
195
195
|
|
|
196
196
|
if (metaSuppositionMatches) {
|
|
197
197
|
return true;
|
|
@@ -201,8 +201,8 @@ function matchMetaSuppositions(metaSuppositions, metaproofSteps, substitutions,
|
|
|
201
201
|
return metaSuppositionsMatch;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
function matchMetaConsequent(metaConsequent, metastatementNode, substitutions, fileContext,
|
|
205
|
-
const nonTerminalNodeMatches = metaConsequent.matchMetastatementNode(metastatementNode, substitutions, fileContext,
|
|
204
|
+
function matchMetaConsequent(metaConsequent, metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
205
|
+
const nonTerminalNodeMatches = metaConsequent.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext),
|
|
206
206
|
metaConsequentMatches = nonTerminalNodeMatches; ///
|
|
207
207
|
|
|
208
208
|
return metaConsequentMatches;
|
package/src/metaSupposition.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import LocalMetaContext from "./context/localMeta";
|
|
3
4
|
import metaLevelNodesVerifier from "./verifier/nodes/metaLevel";
|
|
4
5
|
|
|
5
6
|
import { match } from "./utilities/array";
|
|
@@ -21,7 +22,7 @@ export default class MetaSupposition {
|
|
|
21
22
|
return this.metastatementNode;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
matchMetaSubproofNode(metaSubproofNode, substitutions,
|
|
25
|
+
matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext) {
|
|
25
26
|
let metaSubproofNodeMatches = false;
|
|
26
27
|
|
|
27
28
|
const metaSubproofAssertionNode = metaSubproofAssertionNodeQuery(this.metastatementNode);
|
|
@@ -41,9 +42,10 @@ export default class MetaSupposition {
|
|
|
41
42
|
metaSubproofNodeMatches = match(metaSubproofAssertionMetastatementNodes, metaSubproofMetastatementNodes, (metaSubproofAssertionMetastatementNode, metaSubproofMetastatementNode) => {
|
|
42
43
|
const nonTerminalNodeA = metaSubproofAssertionMetastatementNode, ///
|
|
43
44
|
nonTerminalNodeB = metaSubproofMetastatementNode, ///
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
fileContextA = fileContext, ///
|
|
46
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
47
|
+
localMetaContextB = localMetaContext, ///
|
|
48
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
47
49
|
const verifiedAhead = true;
|
|
48
50
|
|
|
49
51
|
return verifiedAhead;
|
|
@@ -59,12 +61,13 @@ export default class MetaSupposition {
|
|
|
59
61
|
return metaSubproofNodeMatches;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
matchMetastatementNode(metastatementNode, substitutions,
|
|
64
|
+
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
63
65
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
64
66
|
nonTerminalNodeB = metastatementNode, ///
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
fileContextA = fileContext, ///
|
|
68
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
69
|
+
localMetaContextB = localMetaContext, ///
|
|
70
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
68
71
|
const verifiedAhead = true;
|
|
69
72
|
|
|
70
73
|
return verifiedAhead;
|
package/src/premise.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import LocalContext from "./context/local";
|
|
4
|
+
import LocalMetaContext from "./context/localMeta";
|
|
4
5
|
import metaLevelNodesVerifier from "./verifier/nodes/metaLevel";
|
|
5
6
|
import intrinsicLevelAgainstMetaLevelNodesVerifier from "./verifier/nodes/intrinsicLevelAgainstMetaLevel";
|
|
6
7
|
|
|
@@ -10,9 +11,9 @@ import { nodeQuery, nodesQuery } from "./utilities/query";
|
|
|
10
11
|
import { metastatementNodeFromMetastatementString } from "./utilities/node";
|
|
11
12
|
|
|
12
13
|
const subproofAssertionNodeQuery = nodeQuery("/metastatement/subproofAssertion!"),
|
|
13
|
-
ruleSubproofPremiseMetastatementQuery = nodesQuery("/ruleSubproof/premise/unqualifiedMetastatement!/metastatement!"),
|
|
14
14
|
subproofAssertionMetastatementNodesQuery = nodesQuery("/subproofAssertion/metastatement"),
|
|
15
|
-
|
|
15
|
+
ruleSubproofPremiseMetastatementNodesQuery = nodesQuery("/ruleSubproof/premise/unqualifiedMetastatement!/metastatement!"),
|
|
16
|
+
ruleSubproofLastRuleProofStepMetastatementNodeQuery = nodeQuery("/ruleSubproof/ruleSubDerivation/lastRuleProofStep/unqualifiedMetastatement|qualifiedMetastatement/metastatement!");
|
|
16
17
|
|
|
17
18
|
export default class Premise {
|
|
18
19
|
constructor(metastatementNode) {
|
|
@@ -39,17 +40,17 @@ export default class Premise {
|
|
|
39
40
|
return statementNodeMatches;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext,
|
|
43
|
+
matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localMetaContext) {
|
|
43
44
|
let ruleSubproofNodeMatches = false;
|
|
44
45
|
|
|
45
46
|
const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
|
|
46
47
|
|
|
47
48
|
if (subproofAssertionNode !== null) {
|
|
48
|
-
const
|
|
49
|
-
|
|
49
|
+
const ruleSubproofPremiseMetastatementNodes = ruleSubproofPremiseMetastatementNodesQuery(ruleSubproofNode),
|
|
50
|
+
ruleSubproofLastRuleProofStepMetastatementNode = ruleSubproofLastRuleProofStepMetastatementNodeQuery(ruleSubproofNode),
|
|
50
51
|
ruleSubproofMetastatementNodes = [
|
|
51
|
-
...
|
|
52
|
-
|
|
52
|
+
...ruleSubproofPremiseMetastatementNodes,
|
|
53
|
+
ruleSubproofLastRuleProofStepMetastatementNode
|
|
53
54
|
],
|
|
54
55
|
ruleSubproofMetastatementNodesLength = ruleSubproofMetastatementNodes.length,
|
|
55
56
|
subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode),
|
|
@@ -60,9 +61,9 @@ export default class Premise {
|
|
|
60
61
|
const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
|
|
61
62
|
nonTerminalNodeB = ruleSubproofMetastatementNode, ///
|
|
62
63
|
fileContextA = fileContext, ///
|
|
63
|
-
|
|
64
|
-
localMetaContextB =
|
|
65
|
-
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions,
|
|
64
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
65
|
+
localMetaContextB = localMetaContext, ///
|
|
66
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
66
67
|
const verifiedAhead = true;
|
|
67
68
|
|
|
68
69
|
return verifiedAhead;
|
|
@@ -78,13 +79,13 @@ export default class Premise {
|
|
|
78
79
|
return ruleSubproofNodeMatches;
|
|
79
80
|
}
|
|
80
81
|
|
|
81
|
-
matchMetastatementNode(metastatementNode, substitutions, fileContext,
|
|
82
|
+
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
82
83
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
83
84
|
nonTerminalNodeB = metastatementNode, ///
|
|
84
85
|
fileContextA = fileContext, ///
|
|
85
|
-
|
|
86
|
-
localMetaContextB =
|
|
87
|
-
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions,
|
|
86
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
87
|
+
localMetaContextB = localMetaContext, ///
|
|
88
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
88
89
|
const verifiedAhead = true;
|
|
89
90
|
|
|
90
91
|
return verifiedAhead;
|
package/src/rule.js
CHANGED
|
@@ -6,6 +6,7 @@ import Conclusion from "./conclusion";
|
|
|
6
6
|
|
|
7
7
|
import { prune } from "./utilities/array";
|
|
8
8
|
import { someSubArray } from "./utilities/array";
|
|
9
|
+
import local from "./context/local";
|
|
9
10
|
|
|
10
11
|
export default class Rule {
|
|
11
12
|
constructor(labels, premises, conclusion, fileContext) {
|
|
@@ -31,10 +32,11 @@ export default class Rule {
|
|
|
31
32
|
return this.fileContext;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
matchStatement(statementNode,
|
|
35
|
+
matchStatement(statementNode, localContext) {
|
|
35
36
|
let statementNatches;
|
|
36
37
|
|
|
37
|
-
const premisesLength = this.premises.length
|
|
38
|
+
const premisesLength = this.premises.length,
|
|
39
|
+
statementLocalContext = localContext; ///
|
|
38
40
|
|
|
39
41
|
if (premisesLength === 0) {
|
|
40
42
|
const substitutions = [],
|
|
@@ -65,27 +67,27 @@ export default class Rule {
|
|
|
65
67
|
return statementNatches;
|
|
66
68
|
}
|
|
67
69
|
|
|
68
|
-
matchMetastatement(metastatementNode,
|
|
70
|
+
matchMetastatement(metastatementNode, localMetaContext) {
|
|
69
71
|
let metastatementNatches;
|
|
70
72
|
|
|
71
73
|
const premisesLength = this.premises.length;
|
|
72
74
|
|
|
73
75
|
if (premisesLength === 0) {
|
|
74
76
|
const substitutions = [],
|
|
75
|
-
conclusionMatches = metaMatchConclusion(this.conclusion, metastatementNode, substitutions, this.fileContext,
|
|
77
|
+
conclusionMatches = metaMatchConclusion(this.conclusion, metastatementNode, substitutions, this.fileContext, localMetaContext);
|
|
76
78
|
|
|
77
79
|
metastatementNatches = conclusionMatches; ///
|
|
78
80
|
} else {
|
|
79
|
-
const metaproofSteps =
|
|
81
|
+
const metaproofSteps = localMetaContext.getMetaproofSteps();
|
|
80
82
|
|
|
81
83
|
metastatementNatches = someSubArray(metaproofSteps, premisesLength, (metaproofSteps) => {
|
|
82
84
|
let premisesMatchConclusion = false;
|
|
83
85
|
|
|
84
86
|
const substitutions = [],
|
|
85
|
-
premisesMatch = metaMatchPremises(this.premises, metaproofSteps, substitutions, this.fileContext,
|
|
87
|
+
premisesMatch = metaMatchPremises(this.premises, metaproofSteps, substitutions, this.fileContext, localMetaContext);
|
|
86
88
|
|
|
87
89
|
if (premisesMatch) {
|
|
88
|
-
const conclusionMatches = metaMatchConclusion(this.conclusion, metastatementNode, substitutions, this.fileContext,
|
|
90
|
+
const conclusionMatches = metaMatchConclusion(this.conclusion, metastatementNode, substitutions, this.fileContext, localMetaContext);
|
|
89
91
|
|
|
90
92
|
premisesMatchConclusion = conclusionMatches; ///
|
|
91
93
|
}
|
|
@@ -217,13 +219,13 @@ function matchConclusion(conclusion, statementNode, substitutions, fileContext,
|
|
|
217
219
|
return conclusionMatches;
|
|
218
220
|
}
|
|
219
221
|
|
|
220
|
-
function metaMatchPremise(premise, metaproofSteps, substitutions, fileContext,
|
|
222
|
+
function metaMatchPremise(premise, metaproofSteps, substitutions, fileContext, localMetaContext) {
|
|
221
223
|
const metaproofStep = prune(metaproofSteps, (metaproofStep) => {
|
|
222
224
|
const ruleSubproofNode = metaproofStep.getRuleSubproofNode(),
|
|
223
225
|
metastatementNode = metaproofStep.getMetastatementNode()
|
|
224
226
|
|
|
225
227
|
if (ruleSubproofNode !== null) {
|
|
226
|
-
const ruleSubProofNodeMatches = premise.matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext,
|
|
228
|
+
const ruleSubProofNodeMatches = premise.matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localMetaContext);
|
|
227
229
|
|
|
228
230
|
if (!ruleSubProofNodeMatches) { ///
|
|
229
231
|
return true;
|
|
@@ -231,7 +233,7 @@ function metaMatchPremise(premise, metaproofSteps, substitutions, fileContext, m
|
|
|
231
233
|
}
|
|
232
234
|
|
|
233
235
|
if (metastatementNode !== null) {
|
|
234
|
-
const metastatementNodeMatches = premise.matchMetastatementNode(metastatementNode, substitutions, fileContext,
|
|
236
|
+
const metastatementNodeMatches = premise.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext);
|
|
235
237
|
|
|
236
238
|
if (!metastatementNodeMatches) { ///
|
|
237
239
|
return true;
|
|
@@ -244,9 +246,9 @@ function metaMatchPremise(premise, metaproofSteps, substitutions, fileContext, m
|
|
|
244
246
|
return premiseMatches;
|
|
245
247
|
}
|
|
246
248
|
|
|
247
|
-
function metaMatchPremises(premise, metaproofSteps, substitutions, fileContext,
|
|
249
|
+
function metaMatchPremises(premise, metaproofSteps, substitutions, fileContext, localMetaContext) {
|
|
248
250
|
const premisesMatch = premise.every((premise) => {
|
|
249
|
-
const premiseMatches = metaMatchPremise(premise, metaproofSteps, substitutions, fileContext,
|
|
251
|
+
const premiseMatches = metaMatchPremise(premise, metaproofSteps, substitutions, fileContext, localMetaContext);
|
|
250
252
|
|
|
251
253
|
if (premiseMatches) {
|
|
252
254
|
return true;
|
|
@@ -256,8 +258,8 @@ function metaMatchPremises(premise, metaproofSteps, substitutions, fileContext,
|
|
|
256
258
|
return premisesMatch;
|
|
257
259
|
}
|
|
258
260
|
|
|
259
|
-
function metaMatchConclusion(conclusion, metastatementNode, substitutions, fileContext,
|
|
260
|
-
const metastatementNodeMatches = conclusion.matchMetastatementNode(metastatementNode, substitutions, fileContext,
|
|
261
|
+
function metaMatchConclusion(conclusion, metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
262
|
+
const metastatementNodeMatches = conclusion.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext),
|
|
261
263
|
conclusionMatches = metastatementNodeMatches; ///
|
|
262
264
|
|
|
263
265
|
return conclusionMatches;
|
|
@@ -10,21 +10,21 @@ const metastatementNodeQuery = nodeQuery("/metastatement!"),
|
|
|
10
10
|
metastatementMetavariableNodeQuery = nodeQuery("/metastatement/metavariable!");
|
|
11
11
|
|
|
12
12
|
class MetaLevelNodesVerifier extends NodesVerifier {
|
|
13
|
-
verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions,
|
|
13
|
+
verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, verifyAhead) {
|
|
14
14
|
let nonTerminalNodeVerified;
|
|
15
15
|
|
|
16
16
|
const nodeQueryMaps = [
|
|
17
17
|
{
|
|
18
18
|
nodeQueryA: metastatementMetavariableNodeQuery,
|
|
19
19
|
nodeQueryB: metastatementNodeQuery,
|
|
20
|
-
verifyNodes: (nodeA, nodeB, substitutions,
|
|
20
|
+
verifyNodes: (nodeA, nodeB, substitutions, localMetaContextA, localMetaContextB, verifyAhead) => {
|
|
21
21
|
let nonTerminalNodeVerified;
|
|
22
22
|
|
|
23
23
|
const metastatementNodeB = nodeB, ///
|
|
24
24
|
metastatementMetavariableNodeA = nodeA, ///
|
|
25
25
|
metastatementMetavariableNodeVerifiedAgainstMetastatementNode =
|
|
26
26
|
|
|
27
|
-
this.verifyMetastatementMetavariableNodeAgainstMetastatementNode(metastatementMetavariableNodeA, metastatementNodeB, substitutions,
|
|
27
|
+
this.verifyMetastatementMetavariableNodeAgainstMetastatementNode(metastatementMetavariableNodeA, metastatementNodeB, substitutions, localMetaContextA, localMetaContextB, verifyAhead);
|
|
28
28
|
|
|
29
29
|
nonTerminalNodeVerified = metastatementMetavariableNodeVerifiedAgainstMetastatementNode; ///
|
|
30
30
|
|
|
@@ -33,16 +33,16 @@ class MetaLevelNodesVerifier extends NodesVerifier {
|
|
|
33
33
|
}
|
|
34
34
|
];
|
|
35
35
|
|
|
36
|
-
const nodesVerified = verifyNodes(nodeQueryMaps, nonTerminalNodeA, nonTerminalNodeB, substitutions,
|
|
36
|
+
const nodesVerified = verifyNodes(nodeQueryMaps, nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, verifyAhead);
|
|
37
37
|
|
|
38
38
|
nonTerminalNodeVerified = nodesVerified ?
|
|
39
39
|
true :
|
|
40
|
-
super.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions,
|
|
40
|
+
super.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, verifyAhead);
|
|
41
41
|
|
|
42
42
|
return nonTerminalNodeVerified;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
verifyMetastatementMetavariableNodeAgainstMetastatementNode(metastatementMetavariableNodeA, metastatementNodeB, substitutions,
|
|
45
|
+
verifyMetastatementMetavariableNodeAgainstMetastatementNode(metastatementMetavariableNodeA, metastatementNodeB, substitutions, localMetaContextA, localMetaContextB, verifyAhead) {
|
|
46
46
|
let metastatementMetavariableNodeVerifiedAgainstMetastatementNode;
|
|
47
47
|
|
|
48
48
|
const metavariableNode = metastatementMetavariableNodeA, ///
|