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
|
@@ -9,32 +9,29 @@ const metastatementNodeQuery = nodeQuery("/unqualifiedMetastatement/metastatemen
|
|
|
9
9
|
export default function verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, assignments, derived, localMetaContext) {
|
|
10
10
|
let unqualifiedMetastatementVerified = false;
|
|
11
11
|
|
|
12
|
-
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode)
|
|
12
|
+
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
13
|
+
unqualifiedMetastatementString = localMetaContext.nodeAsString(unqualifiedMetastatementNode);
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
const metastatementString = localMetaContext.nodeAsString(metastatementNode);
|
|
15
|
+
localMetaContext.trace(`Verifying the '${unqualifiedMetastatementString}' unqualified metastatement...`, unqualifiedMetastatementNode);
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
if (derived) {
|
|
18
|
+
const metastatementMatches = localMetaContext.matchMetastatement(metastatementNode);
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
unqualifiedMetastatementVerified = metastatementMatches; ///
|
|
23
|
-
}
|
|
20
|
+
unqualifiedMetastatementVerified = metastatementMatches; ///
|
|
21
|
+
}
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
if (!unqualifiedMetastatementVerified) {
|
|
24
|
+
const metastatementVerified = verifyMetastatement(metastatementNode, assignments, derived, localMetaContext, () => {
|
|
25
|
+
const verifiedAhead = true;
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
return verifiedAhead;
|
|
28
|
+
});
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
unqualifiedMetastatementVerified = metastatementVerified; ///
|
|
31
|
+
}
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
33
|
+
if (unqualifiedMetastatementVerified) {
|
|
34
|
+
localMetaContext.debug(`...verified the '${unqualifiedMetastatementString}' unqualified metastatement.`, unqualifiedMetastatementNode);
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
return unqualifiedMetastatementVerified;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import ProofStep from "../step/proof";
|
|
4
|
+
import verifySubproof from "../verify/subproof";
|
|
5
|
+
import verifySubDerivation from "../verify/subDerivation";
|
|
6
|
+
import verifyQualifiedStatement from "../verify/statement/qualified";
|
|
7
|
+
import verifyUnqualifiedStatement from "../verify/statement/unqualified";
|
|
8
|
+
|
|
9
|
+
import { nodeQuery } from "../utilities/query";
|
|
10
|
+
import { assignAssignment } from "../utilities/assignments";
|
|
11
|
+
|
|
12
|
+
const subproofNodeQuery = nodeQuery("/proofStep|lastProofStep/subproof!"),
|
|
13
|
+
statementNodeQuery = nodeQuery("/qualifiedStatement|unqualifiedStatement/statement!"),
|
|
14
|
+
qualifiedStatementNodeQuery = nodeQuery("/proofStep|lastProofStep/qualifiedStatement!"),
|
|
15
|
+
unqualifiedStatementNodeQuery = nodeQuery("/proofStep|lastProofStep/unqualifiedStatement!");
|
|
16
|
+
|
|
17
|
+
export default function verifyProofStep(proofStepNode, localContext) {
|
|
18
|
+
let proofStepVerified = false;
|
|
19
|
+
|
|
20
|
+
const subproofNode = subproofNodeQuery(proofStepNode),
|
|
21
|
+
qualifiedStatementNode = qualifiedStatementNodeQuery(proofStepNode),
|
|
22
|
+
unqualifiedStatementNode = unqualifiedStatementNodeQuery(proofStepNode);
|
|
23
|
+
|
|
24
|
+
if (false) {
|
|
25
|
+
///
|
|
26
|
+
} else if (subproofNode !== null) {
|
|
27
|
+
let subproofVerified;
|
|
28
|
+
|
|
29
|
+
subproofVerified = verifySubproof(subproofNode, localContext);
|
|
30
|
+
|
|
31
|
+
if (subproofVerified) {
|
|
32
|
+
const proofStep = ProofStep.fromSubproofNode(subproofNode);
|
|
33
|
+
|
|
34
|
+
localContext.addProofStep(proofStep);
|
|
35
|
+
|
|
36
|
+
proofStepVerified = true;
|
|
37
|
+
}
|
|
38
|
+
} else if (qualifiedStatementNode !== null) {
|
|
39
|
+
let qualifiedStatementVerified;
|
|
40
|
+
|
|
41
|
+
const assignments = [];
|
|
42
|
+
|
|
43
|
+
qualifiedStatementVerified = verifyQualifiedStatement(qualifiedStatementNode, assignments, localContext);
|
|
44
|
+
|
|
45
|
+
if (qualifiedStatementVerified) {
|
|
46
|
+
const assignmentAssigned = assignAssignment(assignments, localContext);
|
|
47
|
+
|
|
48
|
+
qualifiedStatementVerified = assignmentAssigned; ///
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (qualifiedStatementVerified) {
|
|
52
|
+
const statementNode = statementNodeQuery(qualifiedStatementNode),
|
|
53
|
+
proofStep = ProofStep.fromStatementNode(statementNode);
|
|
54
|
+
|
|
55
|
+
localContext.addProofStep(proofStep);
|
|
56
|
+
|
|
57
|
+
proofStepVerified = true;
|
|
58
|
+
}
|
|
59
|
+
} else if (unqualifiedStatementNode !== null) {
|
|
60
|
+
let unqualifiedStatementVerified;
|
|
61
|
+
|
|
62
|
+
const derived = true,
|
|
63
|
+
assignments = [];
|
|
64
|
+
|
|
65
|
+
unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, assignments, derived, localContext);
|
|
66
|
+
|
|
67
|
+
if (unqualifiedStatementVerified) {
|
|
68
|
+
const assignmentAssigned = assignAssignment(assignments, localContext);
|
|
69
|
+
|
|
70
|
+
unqualifiedStatementVerified = assignmentAssigned; ///
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (unqualifiedStatementVerified) {
|
|
74
|
+
const statementNode = statementNodeQuery(unqualifiedStatementNode),
|
|
75
|
+
proofStep = ProofStep.fromStatementNode(statementNode);
|
|
76
|
+
|
|
77
|
+
localContext.addProofStep(proofStep);
|
|
78
|
+
|
|
79
|
+
proofStepVerified = true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return proofStepVerified;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
Object.assign(verifySubDerivation, {
|
|
87
|
+
verifyProofStep
|
|
88
|
+
});
|
|
@@ -1,149 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import verifyPremises from "../verify/premises";
|
|
5
|
-
import LocalMetaContext from "../context/localMeta";
|
|
6
|
-
import verifyQualifiedMetastatement from "../verify/metastatement/qualified";
|
|
7
|
-
import verifyUnqualifiedMetastatement from "../verify/metastatement/unqualified";
|
|
3
|
+
import verifyRuleProofStep from "../verify/ruleProofStep";
|
|
8
4
|
|
|
9
|
-
import {
|
|
10
|
-
import { nodeQuery, nodesQuery } from "../utilities/query";
|
|
11
|
-
import { RULE_SUBPROOF_RULE_NAME, QUALIFIED_METASTATEMENT_RULE_NAME, UNQUALIFIED_METASTATEMENT_RULE_NAME } from "../ruleNames";
|
|
5
|
+
import { nodesQuery } from "../utilities/query";
|
|
12
6
|
|
|
13
|
-
const
|
|
14
|
-
premiseNodesQuery = nodesQuery("/ruleSubproof/premise"),
|
|
15
|
-
metastatementNodeQuery = nodeQuery("/qualifiedMetastatement|unqualifiedMetastatement/metastatement!"),
|
|
16
|
-
ruleSubDerivationNodeQuery = nodeQuery("/ruleSubproof/ruleSubDerivation");
|
|
7
|
+
const ruleProofStepNodesQuery = nodesQuery("/ruleDerivation/ruleProofStep|lastRuleProofStep");
|
|
17
8
|
|
|
18
9
|
export default function verifyRuleDerivation(ruleDerivationNode, localMetaContext) {
|
|
19
10
|
let ruleDerivationVerified;
|
|
20
11
|
|
|
21
|
-
const
|
|
12
|
+
const ruleProofStepNodes = ruleProofStepNodesQuery(ruleDerivationNode);
|
|
22
13
|
|
|
23
|
-
ruleDerivationVerified =
|
|
24
|
-
const
|
|
14
|
+
ruleDerivationVerified = ruleProofStepNodes.every((ruleProofStepNode) => {
|
|
15
|
+
const ruleProofStepVerified = verifyRuleProofStep(ruleProofStepNode, localMetaContext);
|
|
25
16
|
|
|
26
|
-
if (
|
|
17
|
+
if (ruleProofStepVerified) {
|
|
27
18
|
return true;
|
|
28
19
|
}
|
|
29
20
|
});
|
|
30
21
|
|
|
31
22
|
return ruleDerivationVerified;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
|
-
function verifyRuleSubDerivation(ruleSubDerivationNode, localMetaContext) {
|
|
35
|
-
let ruleSubDerivationVerified;
|
|
36
|
-
|
|
37
|
-
const childNodes = childNodesQuery(ruleSubDerivationNode);
|
|
38
|
-
|
|
39
|
-
ruleSubDerivationVerified = childNodes.every((childNode) => {
|
|
40
|
-
const childVerified = verifyChild(childNode, localMetaContext);
|
|
41
|
-
|
|
42
|
-
if (childVerified) {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
return ruleSubDerivationVerified;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function verifyRuleSubproof(ruleSubproofNode, localMetaContext) {
|
|
51
|
-
let ruleSubproofVerified = false;
|
|
52
|
-
|
|
53
|
-
localMetaContext = LocalMetaContext.fromLocalMetaContext(localMetaContext); ///
|
|
54
|
-
|
|
55
|
-
const premises = [],
|
|
56
|
-
premiseNodes = premiseNodesQuery(ruleSubproofNode),
|
|
57
|
-
premisesVerified = verifyPremises(premiseNodes, premises, localMetaContext);
|
|
58
|
-
|
|
59
|
-
if (premisesVerified) {
|
|
60
|
-
const ruleSubDerivationNode = ruleSubDerivationNodeQuery(ruleSubproofNode),
|
|
61
|
-
ruleSubDerivationVerified = verifyRuleSubDerivation(ruleSubDerivationNode, localMetaContext);
|
|
62
|
-
|
|
63
|
-
if (ruleSubDerivationVerified) {
|
|
64
|
-
ruleSubproofVerified = true;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return ruleSubproofVerified;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function verifyChild(childNode, localMetaContext) {
|
|
72
|
-
let childVerified;
|
|
73
|
-
|
|
74
|
-
const childNodeRuleName = childNode.getRuleName();
|
|
75
|
-
|
|
76
|
-
switch (childNodeRuleName) {
|
|
77
|
-
case RULE_SUBPROOF_RULE_NAME: {
|
|
78
|
-
const ruleSubproofNode = childNode, ///
|
|
79
|
-
ruleSubproofVerified = verifyRuleSubproof(ruleSubproofNode, localMetaContext);
|
|
80
|
-
|
|
81
|
-
if (ruleSubproofVerified) {
|
|
82
|
-
const metaproofStep = MetaproofStep.fromRuleSubproofNode(ruleSubproofNode);
|
|
83
|
-
|
|
84
|
-
localMetaContext.addMetaproofStep(metaproofStep);
|
|
85
|
-
|
|
86
|
-
childVerified = true;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
case QUALIFIED_METASTATEMENT_RULE_NAME: {
|
|
93
|
-
let qualifiedMetastatementVerified;
|
|
94
|
-
|
|
95
|
-
const derived = true,
|
|
96
|
-
assignments = [],
|
|
97
|
-
substitutions = null,
|
|
98
|
-
qualifiedMetastatementNode = childNode; ///
|
|
99
|
-
|
|
100
|
-
qualifiedMetastatementVerified = verifyQualifiedMetastatement(qualifiedMetastatementNode, substitutions, assignments, derived, localMetaContext);
|
|
101
|
-
|
|
102
|
-
if (qualifiedMetastatementVerified) {
|
|
103
|
-
const assignmentAssigned = assignAssignment(assignments, localMetaContext);
|
|
104
|
-
|
|
105
|
-
qualifiedMetastatementVerified = assignmentAssigned; ///
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (qualifiedMetastatementVerified) {
|
|
109
|
-
const metastatementNode = metastatementNodeQuery(qualifiedMetastatementNode),
|
|
110
|
-
metaproofStep = MetaproofStep.fromMetastatementNode(metastatementNode);
|
|
111
|
-
|
|
112
|
-
localMetaContext.addMetaproofStep(metaproofStep);
|
|
113
|
-
|
|
114
|
-
childVerified = qualifiedMetastatementVerified; ///
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
case UNQUALIFIED_METASTATEMENT_RULE_NAME: {
|
|
121
|
-
let unqualifiedMetastatementVerified;
|
|
122
|
-
|
|
123
|
-
const derived = true,
|
|
124
|
-
assignments = [],
|
|
125
|
-
unqualifiedMetastatementNode = childNode; ///
|
|
126
|
-
|
|
127
|
-
unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, assignments, derived, localMetaContext);
|
|
128
|
-
|
|
129
|
-
if (unqualifiedMetastatementVerified) {
|
|
130
|
-
const assignmentAssigned = assignAssignment(assignments, localMetaContext);
|
|
131
|
-
|
|
132
|
-
unqualifiedMetastatementVerified = assignmentAssigned; ///
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (unqualifiedMetastatementVerified) {
|
|
136
|
-
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
137
|
-
metaproofStep = MetaproofStep.fromMetastatementNode(metastatementNode);
|
|
138
|
-
|
|
139
|
-
localMetaContext.addMetaproofStep(metaproofStep);
|
|
140
|
-
|
|
141
|
-
childVerified = true;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return childVerified;
|
|
149
|
-
}
|
|
@@ -0,0 +1,99 @@
|
|
|
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 ruleSubproofNodeQuery = nodeQuery("/ruleProofStep|lastRuleProofStep/ruleSubproof!"),
|
|
15
|
+
metastatementNodeQuery = nodeQuery("/qualifiedMetastatement|unqualifiedMetastatement/metastatement!"),
|
|
16
|
+
qualifiedStatementNodeQuery = nodeQuery("/ruleProofStep|lastRuleProofStep/qualifiedStatement!"),
|
|
17
|
+
unqualifiedStatementNodeQuery = nodeQuery("/ruleProofStep|lastRuleProofStep/unqualifiedStatement!"),
|
|
18
|
+
qualifiedMetastatementNodeQuery = nodeQuery("/ruleProofStep|lastRuleProofStep/qualifiedMetastatement!"),
|
|
19
|
+
unqualifiedMetastatementNodeQuery = nodeQuery("/ruleProofStep|lastRuleProofStep/unqualifiedMetastatement!");
|
|
20
|
+
|
|
21
|
+
export default function verifyRuleProofStep(ruleProofStepNode, localMetaContext) {
|
|
22
|
+
let ruleProofStepVerified = false;
|
|
23
|
+
|
|
24
|
+
const ruleSubproofNode = ruleSubproofNodeQuery(ruleProofStepNode),
|
|
25
|
+
qualifiedStatementNode = qualifiedStatementNodeQuery(ruleProofStepNode),
|
|
26
|
+
unqualifiedStatementNode = unqualifiedStatementNodeQuery(ruleProofStepNode),
|
|
27
|
+
qualifiedMetastatementNode = qualifiedMetastatementNodeQuery(ruleProofStepNode),
|
|
28
|
+
unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(ruleProofStepNode);
|
|
29
|
+
|
|
30
|
+
if (false) {
|
|
31
|
+
///
|
|
32
|
+
} else if (ruleSubproofNode !== null) {
|
|
33
|
+
let ruleSubproofVerified;
|
|
34
|
+
|
|
35
|
+
ruleSubproofVerified = verifyRuleSubproof(ruleSubproofNode, localMetaContext);
|
|
36
|
+
|
|
37
|
+
if (ruleSubproofVerified) {
|
|
38
|
+
const metaproofStep = MetaproofStep.fromRuleSubproofNode(ruleSubproofNode);
|
|
39
|
+
|
|
40
|
+
localMetaContext.addMetaproofStep(metaproofStep);
|
|
41
|
+
|
|
42
|
+
ruleProofStepVerified = true;
|
|
43
|
+
}
|
|
44
|
+
} else if (qualifiedStatementNode !== null) {
|
|
45
|
+
debugger
|
|
46
|
+
} else if (unqualifiedStatementNode !== null) {
|
|
47
|
+
debugger
|
|
48
|
+
} else if (qualifiedMetastatementNode !== null) {
|
|
49
|
+
let qualifiedMetastatementVerified;
|
|
50
|
+
|
|
51
|
+
const assignments = [],
|
|
52
|
+
substitutions = null;
|
|
53
|
+
|
|
54
|
+
qualifiedMetastatementVerified = verifyQualifiedMetastatement(qualifiedMetastatementNode, substitutions, assignments, localMetaContext);
|
|
55
|
+
|
|
56
|
+
if (qualifiedMetastatementVerified) {
|
|
57
|
+
const assignmentAssigned = assignAssignment(assignments, localMetaContext);
|
|
58
|
+
|
|
59
|
+
qualifiedMetastatementVerified = assignmentAssigned; ///
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (qualifiedMetastatementVerified) {
|
|
63
|
+
const metastatementNode = metastatementNodeQuery(qualifiedMetastatementNode),
|
|
64
|
+
metaproofStep = MetaproofStep.fromMetastatementNode(metastatementNode);
|
|
65
|
+
|
|
66
|
+
localMetaContext.addMetaproofStep(metaproofStep);
|
|
67
|
+
|
|
68
|
+
ruleProofStepVerified = qualifiedMetastatementVerified; ///
|
|
69
|
+
}
|
|
70
|
+
} else if (unqualifiedMetastatementNode !== null) {
|
|
71
|
+
let unqualifiedMetastatementVerified;
|
|
72
|
+
|
|
73
|
+
const derived = true,
|
|
74
|
+
assignments = [];
|
|
75
|
+
|
|
76
|
+
unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, assignments, derived, localMetaContext);
|
|
77
|
+
|
|
78
|
+
if (unqualifiedMetastatementVerified) {
|
|
79
|
+
const assignmentAssigned = assignAssignment(assignments, localMetaContext);
|
|
80
|
+
|
|
81
|
+
unqualifiedMetastatementVerified = assignmentAssigned; ///
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (unqualifiedMetastatementVerified) {
|
|
85
|
+
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
86
|
+
metaproofStep = MetaproofStep.fromMetastatementNode(metastatementNode);
|
|
87
|
+
|
|
88
|
+
localMetaContext.addMetaproofStep(metaproofStep);
|
|
89
|
+
|
|
90
|
+
ruleProofStepVerified = true;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return ruleProofStepVerified;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
Object.assign(verifyRuleSubDerivation, {
|
|
98
|
+
verifyRuleProofStep
|
|
99
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
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, localMetaContext) {
|
|
8
|
+
let ruleSubDerivationVerified;
|
|
9
|
+
|
|
10
|
+
const ruleProofStepNodes = ruleProofStepNodesQuery(ruleSubDerivationNode);
|
|
11
|
+
|
|
12
|
+
ruleSubDerivationVerified = ruleProofStepNodes.every((ruleProofStepNode) => {
|
|
13
|
+
const { verifyRuleProofStep } = verifyRuleSubDerivation,
|
|
14
|
+
ruleProofStepVerified = verifyRuleProofStep(ruleProofStepNode, localMetaContext);
|
|
15
|
+
|
|
16
|
+
if (ruleProofStepVerified) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return ruleSubDerivationVerified;
|
|
22
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import verifyPremises from "../verify/premises";
|
|
4
|
+
import LocalMetaContext from "../context/localMeta";
|
|
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, localMetaContext) {
|
|
13
|
+
let ruleSubproofVerified = false;
|
|
14
|
+
|
|
15
|
+
localMetaContext = LocalMetaContext.fromLocalMetaContext(localMetaContext); ///
|
|
16
|
+
|
|
17
|
+
const premises = [],
|
|
18
|
+
premiseNodes = premiseNodesQuery(ruleSubproofNode),
|
|
19
|
+
premisesVerified = verifyPremises(premiseNodes, premises, localMetaContext);
|
|
20
|
+
|
|
21
|
+
if (premisesVerified) {
|
|
22
|
+
const ruleSubDerivationNode = ruleSubDerivationNodeQuery(ruleSubproofNode),
|
|
23
|
+
ruleSubDerivationVerified = verifyRuleSubDerivation(ruleSubDerivationNode, localMetaContext);
|
|
24
|
+
|
|
25
|
+
if (ruleSubDerivationVerified) {
|
|
26
|
+
ruleSubproofVerified = true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return ruleSubproofVerified;
|
|
31
|
+
}
|
|
32
|
+
|