occam-verify-cli 0.0.919 → 0.0.921
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/utilities/verify.js +22 -6
- package/lib/verifier/nodes/metaLevel.js +22 -2
- package/lib/verify/metaLemma.js +2 -2
- package/lib/verify/metaSubproof.js +3 -3
- package/lib/verify/metaSupposition.js +2 -2
- package/lib/verify/metaproof.js +4 -4
- package/lib/verify/metastatement.js +5 -1
- package/lib/verify/metastatementAsContainedAssertion.js +109 -0
- package/lib/verify/metastatementAsDefinedAssertion.js +132 -0
- package/lib/verify/metatheorem.js +2 -2
- package/lib/verify/premise.js +2 -2
- package/lib/verify/rule.js +9 -8
- package/lib/verify/statementAsContainedAssertion.js +15 -20
- package/package.json +4 -4
- package/src/utilities/verify.js +20 -4
- package/src/verifier/nodes/metaLevel.js +32 -1
- package/src/verify/metaLemma.js +2 -1
- package/src/verify/metaSubproof.js +3 -3
- package/src/verify/metaSupposition.js +1 -2
- package/src/verify/metaproof.js +5 -6
- package/src/verify/metastatement.js +4 -0
- package/src/verify/metastatementAsContainedAssertion.js +127 -0
- package/src/verify/metastatementAsDefinedAssertion.js +156 -0
- package/src/verify/metatheorem.js +2 -1
- package/src/verify/premise.js +1 -2
- package/src/verify/rule.js +11 -8
- package/src/verify/statementAsContainedAssertion.js +21 -26
- package/lib/verify/ruleDerivation.js +0 -31
- package/lib/verify/ruleProof.js +0 -32
- package/lib/verify/ruleProofStep.js +0 -98
- package/lib/verify/ruleSubDerivation.js +0 -25
- package/lib/verify/ruleSubproof.js +0 -35
- package/src/verify/ruleDerivation.js +0 -23
- package/src/verify/ruleProof.js +0 -31
- package/src/verify/ruleProofStep.js +0 -139
- package/src/verify/ruleSubDerivation.js +0 -22
- package/src/verify/ruleSubproof.js +0 -34
|
@@ -1,35 +0,0 @@
|
|
|
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 verifyRuleSubproof;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _premises = /*#__PURE__*/ _interop_require_default(require("../verify/premises"));
|
|
12
|
-
var _metaLevel = /*#__PURE__*/ _interop_require_default(require("../context/local/metaLevel"));
|
|
13
|
-
var _ruleSubDerivation = /*#__PURE__*/ _interop_require_default(require("../verify/ruleSubDerivation"));
|
|
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 premiseNodesQuery = (0, _query.nodesQuery)("/ruleSubproof/premise"), ruleSubDerivationNodeQuery = (0, _query.nodeQuery)("/ruleSubproof/ruleSubDerivation");
|
|
21
|
-
function verifyRuleSubproof(ruleSubproofNode, localContext) {
|
|
22
|
-
var ruleSubproofVerified = false;
|
|
23
|
-
var metaLevelLocalContext = _metaLevel.default.fromLocalContext(localContext);
|
|
24
|
-
localContext = metaLevelLocalContext; ///
|
|
25
|
-
var premises = [], premiseNodes = premiseNodesQuery(ruleSubproofNode), premisesVerified = (0, _premises.default)(premiseNodes, premises, localContext);
|
|
26
|
-
if (premisesVerified) {
|
|
27
|
-
var ruleSubDerivationNode = ruleSubDerivationNodeQuery(ruleSubproofNode), ruleSubDerivationVerified = (0, _ruleSubDerivation.default)(ruleSubDerivationNode, localContext);
|
|
28
|
-
if (ruleSubDerivationVerified) {
|
|
29
|
-
ruleSubproofVerified = true;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return ruleSubproofVerified;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92ZXJpZnkvcnVsZVN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ncyI6IkFBQUE7Ozs7K0JBV0E7OztlQUF3QkE7OzsrREFURztnRUFDTzt3RUFDRTtxQkFFRTs7Ozs7O0FBRXRDLElBQU1DLG9CQUFvQkMsSUFBQUEsaUJBQVUsRUFBQywwQkFDL0JDLDZCQUE2QkMsSUFBQUEsZ0JBQVMsRUFBQztBQUU5QixTQUFTSixtQkFBbUJLLGdCQUFnQixFQUFFQyxZQUFZO0lBQ3ZFLElBQUlDLHVCQUF1QjtJQUUzQixJQUFNQyx3QkFBd0JDLGtCQUFxQixDQUFDQyxnQkFBZ0IsQ0FBQ0o7SUFFckVBLGVBQWVFLHVCQUF1QixHQUFHO0lBRXpDLElBQU1HLFdBQVcsRUFBRSxFQUNiQyxlQUFlWCxrQkFBa0JJLG1CQUNqQ1EsbUJBQW1CQyxJQUFBQSxpQkFBYyxFQUFDRixjQUFjRCxVQUFVTDtJQUVoRSxJQUFJTyxrQkFBa0I7UUFDcEIsSUFBTUUsd0JBQXdCWiwyQkFBMkJFLG1CQUNuRFcsNEJBQTRCQyxJQUFBQSwwQkFBdUIsRUFBQ0YsdUJBQXVCVDtRQUVqRixJQUFJVSwyQkFBMkI7WUFDN0JULHVCQUF1QjtRQUN6QjtJQUNGO0lBRUEsT0FBT0E7QUFDVCJ9
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import verifyRuleProofStep from "../verify/ruleProofStep";
|
|
4
|
-
|
|
5
|
-
import { nodesQuery } from "../utilities/query";
|
|
6
|
-
|
|
7
|
-
const ruleProofStepNodesQuery = nodesQuery("/ruleDerivation/ruleProofStep|lastRuleProofStep");
|
|
8
|
-
|
|
9
|
-
export default function verifyRuleDerivation(ruleDerivationNode, localContext) {
|
|
10
|
-
let ruleDerivationVerified;
|
|
11
|
-
|
|
12
|
-
const ruleProofStepNodes = ruleProofStepNodesQuery(ruleDerivationNode);
|
|
13
|
-
|
|
14
|
-
ruleDerivationVerified = ruleProofStepNodes.every((ruleProofStepNode) => {
|
|
15
|
-
const ruleProofStepVerified = verifyRuleProofStep(ruleProofStepNode, localContext);
|
|
16
|
-
|
|
17
|
-
if (ruleProofStepVerified) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
return ruleDerivationVerified;
|
|
23
|
-
}
|
package/src/verify/ruleProof.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import verifyRuleDerivation from "../verify/ruleDerivation";
|
|
4
|
-
import MetaLevelLocalContext from "../context/local/metaLevel";
|
|
5
|
-
|
|
6
|
-
import { nodeQuery } from "../utilities/query";
|
|
7
|
-
|
|
8
|
-
const ruleDerivationNodeQuery = nodeQuery("/ruleProof/ruleDerivation!");
|
|
9
|
-
|
|
10
|
-
export default function verifyRuleProof(ruleProofNode, conclusion, localContext) {
|
|
11
|
-
let ruleProofVerified = false;
|
|
12
|
-
|
|
13
|
-
const metaLevelLocalContext = MetaLevelLocalContext.fromLocalContext(localContext);
|
|
14
|
-
|
|
15
|
-
localContext = metaLevelLocalContext; ///
|
|
16
|
-
|
|
17
|
-
const ruleDerivationNode = ruleDerivationNodeQuery(ruleProofNode),
|
|
18
|
-
ruleDerivationVerified = verifyRuleDerivation(ruleDerivationNode, localContext);
|
|
19
|
-
|
|
20
|
-
if (ruleDerivationVerified) {
|
|
21
|
-
const lastMetaproofStep = localContext.getLastMetaproofStep(),
|
|
22
|
-
metaproofStep = lastMetaproofStep, ///
|
|
23
|
-
metastatementNode = metaproofStep.getMetastatementNode(),
|
|
24
|
-
conclusionMetastatementNode = conclusion.getMetastatementNode(),
|
|
25
|
-
metastatementNodeMatchConclusionMetastatementNode = metastatementNode.match(conclusionMetastatementNode);
|
|
26
|
-
|
|
27
|
-
ruleProofVerified = metastatementNodeMatchConclusionMetastatementNode; ///
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return ruleProofVerified;
|
|
31
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import MetaproofStep from "../step/metaproof";
|
|
4
|
-
import verifyRuleSubproof from "../verify/ruleSubproof";
|
|
5
|
-
import verifyRuleSubDerivation from "../verify/ruleSubDerivation";
|
|
6
|
-
import verifyQualifiedStatement from "../verify/statement/qualified";
|
|
7
|
-
import verifyUnqualifiedStatement from "../verify/statement/unqualified";
|
|
8
|
-
import verifyQualifiedMetastatement from "../verify/metastatement/qualified";
|
|
9
|
-
import verifyUnqualifiedMetastatement from "../verify/metastatement/unqualified";
|
|
10
|
-
|
|
11
|
-
import { nodeQuery } from "../utilities/query";
|
|
12
|
-
import { assignAssignment } from "../utilities/assignments";
|
|
13
|
-
|
|
14
|
-
const statementNodeQuery = nodeQuery("/qualifiedStatement|unqualifiedStatement/statement!"),
|
|
15
|
-
ruleSubproofNodeQuery = nodeQuery("/ruleProofStep|lastRuleProofStep/ruleSubproof!"),
|
|
16
|
-
metastatementNodeQuery = nodeQuery("/qualifiedMetastatement|unqualifiedMetastatement/metastatement!"),
|
|
17
|
-
qualifiedStatementNodeQuery = nodeQuery("/ruleProofStep|lastRuleProofStep/qualifiedStatement!"),
|
|
18
|
-
unqualifiedStatementNodeQuery = nodeQuery("/ruleProofStep|lastRuleProofStep/unqualifiedStatement!"),
|
|
19
|
-
qualifiedMetastatementNodeQuery = nodeQuery("/ruleProofStep|lastRuleProofStep/qualifiedMetastatement!"),
|
|
20
|
-
unqualifiedMetastatementNodeQuery = nodeQuery("/ruleProofStep|lastRuleProofStep/unqualifiedMetastatement!");
|
|
21
|
-
|
|
22
|
-
export default function verifyRuleProofStep(ruleProofStepNode, localContext) {
|
|
23
|
-
let ruleProofStepVerified = false;
|
|
24
|
-
|
|
25
|
-
const ruleSubproofNode = ruleSubproofNodeQuery(ruleProofStepNode),
|
|
26
|
-
qualifiedStatementNode = qualifiedStatementNodeQuery(ruleProofStepNode),
|
|
27
|
-
unqualifiedStatementNode = unqualifiedStatementNodeQuery(ruleProofStepNode),
|
|
28
|
-
qualifiedMetastatementNode = qualifiedMetastatementNodeQuery(ruleProofStepNode),
|
|
29
|
-
unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(ruleProofStepNode);
|
|
30
|
-
|
|
31
|
-
if (false) {
|
|
32
|
-
///
|
|
33
|
-
} else if (ruleSubproofNode !== null) {
|
|
34
|
-
let ruleSubproofVerified;
|
|
35
|
-
|
|
36
|
-
ruleSubproofVerified = verifyRuleSubproof(ruleSubproofNode, localContext);
|
|
37
|
-
|
|
38
|
-
if (ruleSubproofVerified) {
|
|
39
|
-
const metaproofStep = MetaproofStep.fromRuleSubproofNode(ruleSubproofNode);
|
|
40
|
-
|
|
41
|
-
localContext.addMetaproofStep(metaproofStep);
|
|
42
|
-
|
|
43
|
-
ruleProofStepVerified = true;
|
|
44
|
-
}
|
|
45
|
-
} else if (qualifiedStatementNode !== null) {
|
|
46
|
-
let qualifiedStatementVerified;
|
|
47
|
-
|
|
48
|
-
const assignments = [];
|
|
49
|
-
|
|
50
|
-
qualifiedStatementVerified = verifyQualifiedStatement(qualifiedStatementNode, assignments, localContext);
|
|
51
|
-
|
|
52
|
-
if (qualifiedStatementVerified) {
|
|
53
|
-
const assignmentAssigned = assignAssignment(assignments, localContext);
|
|
54
|
-
|
|
55
|
-
qualifiedStatementVerified = assignmentAssigned; ///
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (qualifiedStatementVerified) {
|
|
59
|
-
const statementNode = statementNodeQuery(qualifiedStatementNode),
|
|
60
|
-
metaproofStep = MetaproofStep.fromStatementNode(statementNode);
|
|
61
|
-
|
|
62
|
-
localContext.addMetaproofStep(metaproofStep);
|
|
63
|
-
|
|
64
|
-
ruleProofStepVerified = true;
|
|
65
|
-
}
|
|
66
|
-
} else if (unqualifiedStatementNode !== null) {
|
|
67
|
-
let unqualifiedStatementVerified;
|
|
68
|
-
|
|
69
|
-
const derived = true,
|
|
70
|
-
assignments = [];
|
|
71
|
-
|
|
72
|
-
unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, assignments, derived, localContext);
|
|
73
|
-
|
|
74
|
-
if (unqualifiedStatementVerified) {
|
|
75
|
-
const assignmentAssigned = assignAssignment(assignments, localContext);
|
|
76
|
-
|
|
77
|
-
unqualifiedStatementVerified = assignmentAssigned; ///
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (unqualifiedStatementVerified) {
|
|
81
|
-
const statementNode = statementNodeQuery(unqualifiedStatementNode),
|
|
82
|
-
metaproofStep = MetaproofStep.fromStatementNode(statementNode);
|
|
83
|
-
|
|
84
|
-
localContext.addMetaproofStep(metaproofStep);
|
|
85
|
-
|
|
86
|
-
ruleProofStepVerified = unqualifiedStatementVerified; ///
|
|
87
|
-
}
|
|
88
|
-
} else if (qualifiedMetastatementNode !== null) {
|
|
89
|
-
let qualifiedMetastatementVerified;
|
|
90
|
-
|
|
91
|
-
const assignments = [],
|
|
92
|
-
substitutions = null;
|
|
93
|
-
|
|
94
|
-
qualifiedMetastatementVerified = verifyQualifiedMetastatement(qualifiedMetastatementNode, substitutions, assignments, localContext);
|
|
95
|
-
|
|
96
|
-
if (qualifiedMetastatementVerified) {
|
|
97
|
-
const assignmentAssigned = assignAssignment(assignments, localContext);
|
|
98
|
-
|
|
99
|
-
qualifiedMetastatementVerified = assignmentAssigned; ///
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (qualifiedMetastatementVerified) {
|
|
103
|
-
const metastatementNode = metastatementNodeQuery(qualifiedMetastatementNode),
|
|
104
|
-
metaproofStep = MetaproofStep.fromMetastatementNode(metastatementNode);
|
|
105
|
-
|
|
106
|
-
localContext.addMetaproofStep(metaproofStep);
|
|
107
|
-
|
|
108
|
-
ruleProofStepVerified = qualifiedMetastatementVerified; ///
|
|
109
|
-
}
|
|
110
|
-
} else if (unqualifiedMetastatementNode !== null) {
|
|
111
|
-
let unqualifiedMetastatementVerified;
|
|
112
|
-
|
|
113
|
-
const derived = true,
|
|
114
|
-
assignments = [];
|
|
115
|
-
|
|
116
|
-
unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, assignments, derived, localContext);
|
|
117
|
-
|
|
118
|
-
if (unqualifiedMetastatementVerified) {
|
|
119
|
-
const assignmentAssigned = assignAssignment(assignments, localContext);
|
|
120
|
-
|
|
121
|
-
unqualifiedMetastatementVerified = assignmentAssigned; ///
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (unqualifiedMetastatementVerified) {
|
|
125
|
-
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
126
|
-
metaproofStep = MetaproofStep.fromMetastatementNode(metastatementNode);
|
|
127
|
-
|
|
128
|
-
localContext.addMetaproofStep(metaproofStep);
|
|
129
|
-
|
|
130
|
-
ruleProofStepVerified = true;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return ruleProofStepVerified;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
Object.assign(verifyRuleSubDerivation, {
|
|
138
|
-
verifyRuleProofStep
|
|
139
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { nodesQuery } from "../utilities/query";
|
|
4
|
-
|
|
5
|
-
const ruleProofStepNodesQuery = nodesQuery("/ruleSubDerivation/ruleProofStep|lastRuleProofStep");
|
|
6
|
-
|
|
7
|
-
export default function verifyRuleSubDerivation(ruleSubDerivationNode, localContext) {
|
|
8
|
-
let ruleSubDerivationVerified;
|
|
9
|
-
|
|
10
|
-
const ruleProofStepNodes = ruleProofStepNodesQuery(ruleSubDerivationNode);
|
|
11
|
-
|
|
12
|
-
ruleSubDerivationVerified = ruleProofStepNodes.every((ruleProofStepNode) => {
|
|
13
|
-
const { verifyRuleProofStep } = verifyRuleSubDerivation,
|
|
14
|
-
ruleProofStepVerified = verifyRuleProofStep(ruleProofStepNode, localContext);
|
|
15
|
-
|
|
16
|
-
if (ruleProofStepVerified) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
return ruleSubDerivationVerified;
|
|
22
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import verifyPremises from "../verify/premises";
|
|
4
|
-
import MetaLevelLocalContext from "../context/local/metaLevel";
|
|
5
|
-
import verifyRuleSubDerivation from "../verify/ruleSubDerivation";
|
|
6
|
-
|
|
7
|
-
import { nodeQuery, nodesQuery } from "../utilities/query";
|
|
8
|
-
|
|
9
|
-
const premiseNodesQuery = nodesQuery("/ruleSubproof/premise"),
|
|
10
|
-
ruleSubDerivationNodeQuery = nodeQuery("/ruleSubproof/ruleSubDerivation");
|
|
11
|
-
|
|
12
|
-
export default function verifyRuleSubproof(ruleSubproofNode, localContext) {
|
|
13
|
-
let ruleSubproofVerified = false;
|
|
14
|
-
|
|
15
|
-
const metaLevelLocalContext = MetaLevelLocalContext.fromLocalContext(localContext);
|
|
16
|
-
|
|
17
|
-
localContext = metaLevelLocalContext; ///
|
|
18
|
-
|
|
19
|
-
const premises = [],
|
|
20
|
-
premiseNodes = premiseNodesQuery(ruleSubproofNode),
|
|
21
|
-
premisesVerified = verifyPremises(premiseNodes, premises, localContext);
|
|
22
|
-
|
|
23
|
-
if (premisesVerified) {
|
|
24
|
-
const ruleSubDerivationNode = ruleSubDerivationNodeQuery(ruleSubproofNode),
|
|
25
|
-
ruleSubDerivationVerified = verifyRuleSubDerivation(ruleSubDerivationNode, localContext);
|
|
26
|
-
|
|
27
|
-
if (ruleSubDerivationVerified) {
|
|
28
|
-
ruleSubproofVerified = true;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return ruleSubproofVerified;
|
|
33
|
-
}
|
|
34
|
-
|