occam-verify-cli 0.0.484 → 0.0.486
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/antecedent.js +2 -2
- package/lib/premise.js +2 -2
- package/lib/verify/antecedent.js +12 -9
- package/lib/verify/axiom.js +1 -1
- package/lib/verify/conclusion.js +10 -11
- package/lib/verify/conditionalIndicative.js +13 -9
- package/lib/verify/consequent.js +10 -11
- package/lib/verify/derivation.js +54 -39
- package/lib/verify/metaDerivation.js +53 -38
- package/lib/verify/metastatement/unqualified.js +7 -16
- package/lib/verify/premiseOrPremises.js +4 -4
- package/lib/verify/statement/unqualified.js +7 -16
- package/package.json +3 -3
- package/src/antecedent.js +1 -1
- package/src/premise.js +2 -2
- package/src/verify/antecedent.js +14 -11
- package/src/verify/axiom.js +1 -1
- package/src/verify/conclusion.js +10 -12
- package/src/verify/conditionalIndicative.js +20 -12
- package/src/verify/consequent.js +10 -12
- package/src/verify/derivation.js +79 -53
- package/src/verify/metaDerivation.js +78 -52
- package/src/verify/metastatement/unqualified.js +6 -12
- package/src/verify/premiseOrPremises.js +3 -4
- package/src/verify/statement/unqualified.js +6 -12
- package/lib/verify/conditinalIndicative.js +0 -37
- package/lib/verify/metastatement.js +0 -19
- package/src/verify/conditinalIndicative.js +0 -37
- package/src/verify/metastatement.js +0 -15
package/src/verify/conclusion.js
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import Conclusion from "../conclusion";
|
|
4
|
-
import verifyUnqualifiedMetastatement from "../verify/metastatement/unqualified";
|
|
5
4
|
|
|
6
5
|
import { nodeQuery } from "../utilities/query";
|
|
6
|
+
import {nodeAsString} from "../utilities/string";
|
|
7
7
|
|
|
8
|
-
const metastatementNodeQuery = nodeQuery("
|
|
9
|
-
unqualifiedMetastatementNodeQuery = nodeQuery("/conclusion/unqualifiedMetastatement!");
|
|
8
|
+
const metastatementNodeQuery = nodeQuery("/conclusion/unqualifiedMetastatement!/metastatement!");
|
|
10
9
|
|
|
11
10
|
export default function verifyConclusion(conclusionNode, conclusions, metaproofContext) {
|
|
12
11
|
let conclusionVerified = false;
|
|
13
12
|
|
|
14
13
|
metaproofContext.begin(conclusionNode);
|
|
15
14
|
|
|
16
|
-
const
|
|
15
|
+
const conclusionString = nodeAsString(conclusionNode);
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
const unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, metaproofContext);
|
|
17
|
+
metaproofContext.debug(`Verifying the '${conclusionString}' conclusion...`);
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
23
|
-
conclusion = Conclusion.fromMetastatementNode(metastatementNode);
|
|
19
|
+
const metastatementNode = metastatementNodeQuery(conclusionNode);
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
if (metastatementNode !== null) {
|
|
22
|
+
const conclusion = Conclusion.fromMetastatementNode(metastatementNode);
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
conclusions.push(conclusion);
|
|
25
|
+
|
|
26
|
+
conclusionVerified = true;
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
conclusionVerified ?
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import verifyConsequent from "../verify/consequent";
|
|
4
|
+
import verifyAntecedent from "../verify/antecedent";
|
|
4
5
|
|
|
5
|
-
import { nodesQuery } from "../utilities/query";
|
|
6
|
+
import { nodeQuery, nodesQuery } from "../utilities/query";
|
|
6
7
|
|
|
7
|
-
const
|
|
8
|
+
const consequentNodeQuery = nodeQuery("/conditionalIndicative/consequent!"),
|
|
9
|
+
antecedentsNodeQuery = nodesQuery("/conditionalIndicative/antecedent");
|
|
8
10
|
|
|
9
|
-
export default function verifyConditionalIndicative(conditionalIndicativeNode, proofContext) {
|
|
10
|
-
let conditionalIndicativeVerified;
|
|
11
|
+
export default function verifyConditionalIndicative(conditionalIndicativeNode, antecedents, consequents, proofContext) {
|
|
12
|
+
let conditionalIndicativeVerified = false;
|
|
11
13
|
|
|
12
14
|
proofContext.begin(conditionalIndicativeNode);
|
|
13
15
|
|
|
14
|
-
const
|
|
16
|
+
const consequentNode = consequentNodeQuery(conditionalIndicativeNode),
|
|
17
|
+
antecedentNodes = antecedentsNodeQuery(conditionalIndicativeNode),
|
|
18
|
+
antecedentsVerified = antecedentNodes.every((antecedentNode) => {
|
|
19
|
+
const antecedentVerified = verifyAntecedent(antecedentNode, antecedents, proofContext);
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
if (antecedentVerified) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
if (antecedentsVerified) {
|
|
27
|
+
const consequentVerified = verifyConsequent(consequentNode, consequents, proofContext);
|
|
28
|
+
|
|
29
|
+
conditionalIndicativeVerified = consequentVerified; ///
|
|
30
|
+
}
|
|
23
31
|
|
|
24
32
|
conditionalIndicativeVerified ?
|
|
25
33
|
proofContext.complete(conditionalIndicativeNode) :
|
package/src/verify/consequent.js
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import Consequent from "../consequent";
|
|
4
|
-
import verifyUnqualifiedStatement from "../verify/statement/unqualified";
|
|
5
4
|
|
|
6
5
|
import { nodeQuery } from "../utilities/query";
|
|
6
|
+
import { nodeAsString } from "../utilities/string";
|
|
7
7
|
|
|
8
|
-
const statementNodeQuery = nodeQuery("
|
|
9
|
-
unqualifiedStatementNodeQuery = nodeQuery("/consequent/unqualifiedStatement!");
|
|
8
|
+
const statementNodeQuery = nodeQuery("/consequent/unqualifiedStatement!/statement!");
|
|
10
9
|
|
|
11
10
|
export default function verifyConsequent(consequentNode, consequents, proofContext) {
|
|
12
11
|
let consequentVerified = false;
|
|
13
12
|
|
|
14
13
|
proofContext.begin(consequentNode);
|
|
15
14
|
|
|
16
|
-
const
|
|
15
|
+
const consequentString = nodeAsString(consequentNode);
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
const unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, proofContext);
|
|
17
|
+
proofContext.debug(`Verifying the ${consequentString} consequent...`);
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
const statementNode = statementNodeQuery(unqualifiedStatementNode),
|
|
23
|
-
consequent = Consequent.fromStatementNode(statementNode);
|
|
19
|
+
const statementNode = statementNodeQuery(consequentNode);
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
if (statementNode !== null) {
|
|
22
|
+
const consequent = Consequent.fromStatementNode(statementNode);
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
consequents.push(consequent);
|
|
25
|
+
|
|
26
|
+
consequentVerified = true;
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
consequentVerified ?
|
package/src/verify/derivation.js
CHANGED
|
@@ -8,10 +8,10 @@ import verifyUnqualifiedStatement from "../verify/statement/unqualified";
|
|
|
8
8
|
import { nodeQuery, nodesQuery } from "../utilities/query";
|
|
9
9
|
import { SUBPROOF_RULE_NAME, QUALIFIED_STATEMENT_RULE_NAME, UNQUALIFIED_STATEMENT_RULE_NAME } from "../ruleNames";
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
unqualifiedStatementNodesQuery = nodesQuery("/subproof/unqualifiedStatement")
|
|
11
|
+
const childNodesQuery = nodesQuery("/derivation|subDerivation/*"),
|
|
12
|
+
statementNodeQuery = nodeQuery("/qualifiedStatement|unqualifiedStatement/statement!"),
|
|
13
|
+
subDerivationNodeQuery = nodeQuery("/subproof/subDerivation"),
|
|
14
|
+
unqualifiedStatementNodesQuery = nodesQuery("/subproof/unqualifiedStatement");
|
|
15
15
|
|
|
16
16
|
export default function verifyDerivation(derivationNode, proofContext) {
|
|
17
17
|
let derivationVerified;
|
|
@@ -20,17 +20,17 @@ export default function verifyDerivation(derivationNode, proofContext) {
|
|
|
20
20
|
|
|
21
21
|
proofContext.setDerived();
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const childNodes = childNodesQuery(derivationNode);
|
|
24
24
|
|
|
25
|
-
derivationVerified =
|
|
26
|
-
const
|
|
25
|
+
derivationVerified = childNodes.every((childNode) => { ///
|
|
26
|
+
const childVerified = verifyChild(childNode, proofContext);
|
|
27
27
|
|
|
28
|
-
if (
|
|
28
|
+
if (childVerified) {
|
|
29
29
|
return true;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
proofContext.
|
|
33
|
+
proofContext.resetDerived();
|
|
34
34
|
|
|
35
35
|
derivationVerified ?
|
|
36
36
|
proofContext.complete(derivationNode) :
|
|
@@ -39,14 +39,73 @@ export default function verifyDerivation(derivationNode, proofContext) {
|
|
|
39
39
|
return derivationVerified;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function
|
|
43
|
-
let
|
|
42
|
+
function verifySubDerivation(subDerivationNode, proofContext) {
|
|
43
|
+
let derivationVerified;
|
|
44
|
+
|
|
45
|
+
proofContext.begin(subDerivationNode);
|
|
46
|
+
|
|
47
|
+
proofContext.setDerived();
|
|
48
|
+
|
|
49
|
+
const childNodes = childNodesQuery(subDerivationNode);
|
|
50
|
+
|
|
51
|
+
derivationVerified = childNodes.every((childNode) => { ///
|
|
52
|
+
const childVerified = verifyChild(childNode, proofContext);
|
|
53
|
+
|
|
54
|
+
if (childVerified) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
proofContext.resetDerived();
|
|
60
|
+
|
|
61
|
+
derivationVerified ?
|
|
62
|
+
proofContext.complete(subDerivationNode) :
|
|
63
|
+
proofContext.halt(subDerivationNode);
|
|
64
|
+
|
|
65
|
+
return derivationVerified;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function verifySubproof(subproofNode, proofContext) {
|
|
69
|
+
let subproofVerified = false;
|
|
70
|
+
|
|
71
|
+
proofContext = ProofContext.fromProofContext(proofContext); ///
|
|
72
|
+
|
|
73
|
+
const unqualifiedStatementNodes = unqualifiedStatementNodesQuery(subproofNode),
|
|
74
|
+
unqualifiedStatementsVerified = unqualifiedStatementNodes.every((unqualifiedStatementNode) => {
|
|
75
|
+
const unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, proofContext);
|
|
76
|
+
|
|
77
|
+
if (unqualifiedStatementVerified) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
if (unqualifiedStatementsVerified) {
|
|
83
|
+
unqualifiedStatementNodes.forEach((unqualifiedStatementNode) => {
|
|
84
|
+
const statementNode = statementNodeQuery(unqualifiedStatementNode),
|
|
85
|
+
proofStep = ProofStep.fromStatementNode(statementNode);
|
|
86
|
+
|
|
87
|
+
proofContext.addProofStep(proofStep);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const subDerivationNode = subDerivationNodeQuery(subproofNode),
|
|
91
|
+
subDerivationVerified = verifySubDerivation(subDerivationNode, proofContext);
|
|
92
|
+
|
|
93
|
+
if (subDerivationVerified) {
|
|
94
|
+
subproofVerified = true;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return subproofVerified;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function verifyChild(childNode, proofContext) {
|
|
102
|
+
let childVerified;
|
|
44
103
|
|
|
45
|
-
const
|
|
104
|
+
const childNodeRuleName = childNode.getRuleName();
|
|
46
105
|
|
|
47
|
-
switch (
|
|
106
|
+
switch (childNodeRuleName) {
|
|
48
107
|
case SUBPROOF_RULE_NAME: {
|
|
49
|
-
const subproofNode =
|
|
108
|
+
const subproofNode = childNode, ///
|
|
50
109
|
subproofVerified = verifySubproof(subproofNode, proofContext);
|
|
51
110
|
|
|
52
111
|
if (subproofVerified) {
|
|
@@ -54,14 +113,14 @@ function verifyDerivationChild(derivationChildNode, proofContext) {
|
|
|
54
113
|
|
|
55
114
|
proofContext.addProofStep(proofStep);
|
|
56
115
|
|
|
57
|
-
|
|
116
|
+
childVerified = true;
|
|
58
117
|
}
|
|
59
118
|
|
|
60
119
|
break;
|
|
61
120
|
}
|
|
62
121
|
|
|
63
122
|
case QUALIFIED_STATEMENT_RULE_NAME: {
|
|
64
|
-
const qualifiedStatementNode =
|
|
123
|
+
const qualifiedStatementNode = childNode, ///
|
|
65
124
|
qualifiedStatementVerified = verifyQualifiedStatement(qualifiedStatementNode, proofContext);
|
|
66
125
|
|
|
67
126
|
if (qualifiedStatementVerified) {
|
|
@@ -70,14 +129,14 @@ function verifyDerivationChild(derivationChildNode, proofContext) {
|
|
|
70
129
|
|
|
71
130
|
proofContext.addProofStep(proofStep);
|
|
72
131
|
|
|
73
|
-
|
|
132
|
+
childVerified = qualifiedStatementVerified; ///
|
|
74
133
|
}
|
|
75
134
|
|
|
76
135
|
break;
|
|
77
136
|
}
|
|
78
137
|
|
|
79
138
|
case UNQUALIFIED_STATEMENT_RULE_NAME: {
|
|
80
|
-
const unqualifiedStatementNode =
|
|
139
|
+
const unqualifiedStatementNode = childNode, ///
|
|
81
140
|
unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, proofContext);
|
|
82
141
|
|
|
83
142
|
if (unqualifiedStatementVerified) {
|
|
@@ -86,45 +145,12 @@ function verifyDerivationChild(derivationChildNode, proofContext) {
|
|
|
86
145
|
|
|
87
146
|
proofContext.addProofStep(proofStep);
|
|
88
147
|
|
|
89
|
-
|
|
148
|
+
childVerified = true;
|
|
90
149
|
}
|
|
91
150
|
|
|
92
151
|
break;
|
|
93
152
|
}
|
|
94
153
|
}
|
|
95
154
|
|
|
96
|
-
return
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function verifySubproof(subproofNode, proofContext) {
|
|
100
|
-
let subproofVerified = false;
|
|
101
|
-
|
|
102
|
-
proofContext = ProofContext.fromProofContext(proofContext); ///
|
|
103
|
-
|
|
104
|
-
const unqualifiedStatementNodes = unqualifiedStatementNodesQuery(subproofNode),
|
|
105
|
-
unqualifiedStatementsVerified = unqualifiedStatementNodes.every((unqualifiedStatementNode) => {
|
|
106
|
-
const unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, proofContext);
|
|
107
|
-
|
|
108
|
-
if (unqualifiedStatementVerified) {
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
if (unqualifiedStatementsVerified) {
|
|
114
|
-
unqualifiedStatementNodes.forEach((unqualifiedStatementNode) => {
|
|
115
|
-
const statementNode = statementNodeQuery(unqualifiedStatementNode),
|
|
116
|
-
proofStep = ProofStep.fromStatementNode(statementNode);
|
|
117
|
-
|
|
118
|
-
proofContext.addProofStep(proofStep);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const derivationNode = derivationNodeQuery(subproofNode),
|
|
122
|
-
derivationVerified = verifyDerivation(derivationNode, proofContext);
|
|
123
|
-
|
|
124
|
-
if (derivationVerified) {
|
|
125
|
-
subproofVerified = true;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return subproofVerified;
|
|
155
|
+
return childVerified;
|
|
130
156
|
}
|
|
@@ -8,10 +8,10 @@ import verifyUnqualifiedMetastatement from "../verify/metastatement/unqualified"
|
|
|
8
8
|
import { nodeQuery, nodesQuery } from "../utilities/query";
|
|
9
9
|
import { META_SUBPROOF_RULE_NAME, QUALIFIED_METASTATEMENT_RULE_NAME, UNQUALIFIED_METASTATEMENT_RULE_NAME } from "../ruleNames";
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
unqualifiedMetastatementNodesQuery = nodesQuery("/metaSubproof/unqualifiedMetastatement")
|
|
11
|
+
const childNodesQuery = nodesQuery("/metaDerivation|metaSubDerivation/*"),
|
|
12
|
+
metastatementNodeQuery = nodeQuery("/qualifiedMetastatement|unqualifiedMetastatement/metastatement!"),
|
|
13
|
+
metaSubDerivationNodeQuery = nodeQuery("/metaSubproof/metaSubDerivation"),
|
|
14
|
+
unqualifiedMetastatementNodesQuery = nodesQuery("/metaSubproof/unqualifiedMetastatement");
|
|
15
15
|
|
|
16
16
|
export default function verifyMetaDerivation(metaDerivationNode, metaproofContext) {
|
|
17
17
|
let metaDerivationVerified;
|
|
@@ -20,12 +20,12 @@ export default function verifyMetaDerivation(metaDerivationNode, metaproofContex
|
|
|
20
20
|
|
|
21
21
|
metaproofContext.setDerived();
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const childNodes = childNodesQuery(metaDerivationNode);
|
|
24
24
|
|
|
25
|
-
metaDerivationVerified =
|
|
26
|
-
const
|
|
25
|
+
metaDerivationVerified = childNodes.every((childNode) => { ///
|
|
26
|
+
const childVerified = verifyChild(childNode, metaproofContext);
|
|
27
27
|
|
|
28
|
-
if (
|
|
28
|
+
if (childVerified) {
|
|
29
29
|
return true;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
@@ -39,14 +39,73 @@ export default function verifyMetaDerivation(metaDerivationNode, metaproofContex
|
|
|
39
39
|
return metaDerivationVerified;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function
|
|
43
|
-
let
|
|
42
|
+
function verifyMetaSubDerivation(metaSubDerivationNode, metaproofContext) {
|
|
43
|
+
let metaDerivationVerified;
|
|
44
|
+
|
|
45
|
+
metaproofContext.begin(metaSubDerivationNode);
|
|
46
|
+
|
|
47
|
+
metaproofContext.setDerived();
|
|
48
|
+
|
|
49
|
+
const childNodes = childNodesQuery(metaSubDerivationNode);
|
|
50
|
+
|
|
51
|
+
metaDerivationVerified = childNodes.every((childNode) => { ///
|
|
52
|
+
const childVerified = verifyChild(childNode, metaproofContext);
|
|
53
|
+
|
|
54
|
+
if (childVerified) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
metaproofContext.resetDerived();
|
|
60
|
+
|
|
61
|
+
metaDerivationVerified ?
|
|
62
|
+
metaproofContext.complete(metaSubDerivationNode) :
|
|
63
|
+
metaproofContext.halt(metaSubDerivationNode);
|
|
44
64
|
|
|
45
|
-
|
|
65
|
+
return metaDerivationVerified;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function verifyMetaSubproof(metaSubproofNode, metaproofContext) {
|
|
69
|
+
let metaSubproofVerified = false;
|
|
70
|
+
|
|
71
|
+
metaproofContext = MetaproofContext.fromMetaproofContext(metaproofContext); ///
|
|
72
|
+
|
|
73
|
+
const unqualifiedMetastatementNodes = unqualifiedMetastatementNodesQuery(metaSubproofNode),
|
|
74
|
+
unqualifiedMetastatementsVerified = unqualifiedMetastatementNodes.every((unqualifiedMetastatementNode) => {
|
|
75
|
+
const unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, metaproofContext);
|
|
76
|
+
|
|
77
|
+
if (unqualifiedMetastatementVerified) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
if (unqualifiedMetastatementsVerified) {
|
|
83
|
+
unqualifiedMetastatementNodes.forEach((unqualifiedMetastatementNode) => {
|
|
84
|
+
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
85
|
+
metaproofStep = MetaproofStep.fromMetastatementNode(metastatementNode);
|
|
86
|
+
|
|
87
|
+
metaproofContext.addMetaproofStep(metaproofStep);
|
|
88
|
+
});
|
|
46
89
|
|
|
47
|
-
|
|
90
|
+
const metaSubDerivationNode = metaSubDerivationNodeQuery(metaSubproofNode),
|
|
91
|
+
metaSubDerivationVerified = verifyMetaSubDerivation(metaSubDerivationNode, metaproofContext);
|
|
92
|
+
|
|
93
|
+
if (metaSubDerivationVerified) {
|
|
94
|
+
metaSubproofVerified = true;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return metaSubproofVerified;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function verifyChild(childNode, metaproofContext) {
|
|
102
|
+
let childVerified;
|
|
103
|
+
|
|
104
|
+
const childNodeRuleName = childNode.getRuleName();
|
|
105
|
+
|
|
106
|
+
switch (childNodeRuleName) {
|
|
48
107
|
case META_SUBPROOF_RULE_NAME: {
|
|
49
|
-
const metaSubproofNode =
|
|
108
|
+
const metaSubproofNode = childNode, ///
|
|
50
109
|
metaSubproofVerified = verifyMetaSubproof(metaSubproofNode, metaproofContext);
|
|
51
110
|
|
|
52
111
|
if (metaSubproofVerified) {
|
|
@@ -54,14 +113,14 @@ function verifyMetaDerivationChild(metaDerivationChildNode, metaproofContext) {
|
|
|
54
113
|
|
|
55
114
|
metaproofContext.addMetaproofStep(metaproofStep);
|
|
56
115
|
|
|
57
|
-
|
|
116
|
+
childVerified = true;
|
|
58
117
|
}
|
|
59
118
|
|
|
60
119
|
break;
|
|
61
120
|
}
|
|
62
121
|
|
|
63
122
|
case QUALIFIED_METASTATEMENT_RULE_NAME: {
|
|
64
|
-
const qualifiedMetastatementNode =
|
|
123
|
+
const qualifiedMetastatementNode = childNode, ///
|
|
65
124
|
qualifiedMetastatementVerified = verifyQualifiedMetastatement(qualifiedMetastatementNode, metaproofContext);
|
|
66
125
|
|
|
67
126
|
if (qualifiedMetastatementVerified) {
|
|
@@ -70,14 +129,14 @@ function verifyMetaDerivationChild(metaDerivationChildNode, metaproofContext) {
|
|
|
70
129
|
|
|
71
130
|
metaproofContext.addMetaproofStep(metaproofStep);
|
|
72
131
|
|
|
73
|
-
|
|
132
|
+
childVerified = qualifiedMetastatementVerified; ///
|
|
74
133
|
}
|
|
75
134
|
|
|
76
135
|
break;
|
|
77
136
|
}
|
|
78
137
|
|
|
79
138
|
case UNQUALIFIED_METASTATEMENT_RULE_NAME: {
|
|
80
|
-
const unqualifiedMetastatementNode =
|
|
139
|
+
const unqualifiedMetastatementNode = childNode, ///
|
|
81
140
|
unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, metaproofContext);
|
|
82
141
|
|
|
83
142
|
if (unqualifiedMetastatementVerified) {
|
|
@@ -86,45 +145,12 @@ function verifyMetaDerivationChild(metaDerivationChildNode, metaproofContext) {
|
|
|
86
145
|
|
|
87
146
|
metaproofContext.addMetaproofStep(metaproofStep);
|
|
88
147
|
|
|
89
|
-
|
|
148
|
+
childVerified = true;
|
|
90
149
|
}
|
|
91
150
|
|
|
92
151
|
break;
|
|
93
152
|
}
|
|
94
153
|
}
|
|
95
154
|
|
|
96
|
-
return
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function verifyMetaSubproof(metaSubproofNode, metaproofContext) {
|
|
100
|
-
let metaSubproofVerified = false;
|
|
101
|
-
|
|
102
|
-
metaproofContext = MetaproofContext.fromMetaproofContext(metaproofContext); ///
|
|
103
|
-
|
|
104
|
-
const unqualifiedMetastatementNodes = unqualifiedMetastatementNodesQuery(metaSubproofNode),
|
|
105
|
-
unqualifiedMetastatementsVerified = unqualifiedMetastatementNodes.every((unqualifiedMetastatementNode) => {
|
|
106
|
-
const unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, metaproofContext);
|
|
107
|
-
|
|
108
|
-
if (unqualifiedMetastatementVerified) {
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
if (unqualifiedMetastatementsVerified) {
|
|
114
|
-
unqualifiedMetastatementNodes.forEach((unqualifiedMetastatementNode) => {
|
|
115
|
-
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
116
|
-
metaproofStep = MetaproofStep.fromMetastatementNode(metastatementNode);
|
|
117
|
-
|
|
118
|
-
metaproofContext.addMetaproofStep(metaproofStep);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const metaDerivationNode = metaDerivationNodeQuery(metaSubproofNode),
|
|
122
|
-
metaDerivationVerified = verifyMetaDerivation(metaDerivationNode, metaproofContext);
|
|
123
|
-
|
|
124
|
-
if (metaDerivationVerified) {
|
|
125
|
-
metaSubproofVerified = true;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return metaSubproofVerified;
|
|
155
|
+
return childVerified;
|
|
130
156
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import verifyMetastatement from "../../verify/metastatement";
|
|
4
|
-
|
|
5
3
|
import { nodeQuery } from "../../utilities/query";
|
|
6
4
|
import { nodeAsString } from "../../utilities/string";
|
|
7
5
|
|
|
@@ -19,18 +17,14 @@ export default function verifyUnqualifiedMetastatement(unqualifiedMetastatementN
|
|
|
19
17
|
|
|
20
18
|
metaproofContext.debug(`Verifying the ${metastatementString} unqualified metastatement...`);
|
|
21
19
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
if (metastatementVerified) {
|
|
25
|
-
const derived = metaproofContext.isDerived();
|
|
20
|
+
const derived = metaproofContext.isDerived();
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
if (derived) {
|
|
23
|
+
const metaAssertionMatches = metaproofContext.matchMetastatement(metastatementNode);
|
|
29
24
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
25
|
+
unqualifiedMetastatementVerified = metaAssertionMatches; ///
|
|
26
|
+
} else {
|
|
27
|
+
unqualifiedMetastatementVerified = true;
|
|
34
28
|
}
|
|
35
29
|
}
|
|
36
30
|
|
|
@@ -6,17 +6,16 @@ import verifyUnqualifiedMetastatement from "../verify/metastatement/unqualified"
|
|
|
6
6
|
|
|
7
7
|
import { nodeQuery, nodesQuery } from "../utilities/query";
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
unqualifiedMetastatementNodesQuery = nodesQuery("/premise|premises/unqualifiedMetastatement");
|
|
9
|
+
const metastatementNodesQuery = nodesQuery("/premise|premises/unqualifiedMetastatement/metastatement");
|
|
11
10
|
|
|
12
11
|
export default function verifyPremiseOrPremises(premiseOrPremisesNode, premises, metaproofContext) {
|
|
13
12
|
let premiseOrPremisesVerified;
|
|
14
13
|
|
|
15
14
|
metaproofContext.begin(premiseOrPremisesNode);
|
|
16
15
|
|
|
17
|
-
const
|
|
16
|
+
const metastatementNodes = metastatementNodesQuery(premiseOrPremisesNode);
|
|
18
17
|
|
|
19
|
-
premiseOrPremisesVerified =
|
|
18
|
+
premiseOrPremisesVerified = metastatementNodes.every((unqualifiedMetastatementNode) => {
|
|
20
19
|
const unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, metaproofContext);
|
|
21
20
|
|
|
22
21
|
if (unqualifiedMetastatementVerified) {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import verifyStatement from "../../verify/statement";
|
|
4
|
-
|
|
5
3
|
import { nodeQuery } from "../../utilities/query";
|
|
6
4
|
import { nodeAsString } from "../../utilities/string";
|
|
7
5
|
|
|
@@ -19,18 +17,14 @@ export default function verifyUnqualifiedStatement(unqualifiedStatementNode, pro
|
|
|
19
17
|
|
|
20
18
|
proofContext.debug(`Verifying the ${statementString} unqualified statement...`);
|
|
21
19
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
if (statementVerified) {
|
|
25
|
-
const derived = proofContext.isDerived();
|
|
20
|
+
const derived = proofContext.isDerived();
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
if (derived) {
|
|
23
|
+
const assertionMatches = proofContext.matchStatement(statementNode);
|
|
29
24
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
25
|
+
unqualifiedStatementVerified = assertionMatches; ///
|
|
26
|
+
} else {
|
|
27
|
+
unqualifiedStatementVerified = true;
|
|
34
28
|
}
|
|
35
29
|
}
|
|
36
30
|
|
|
@@ -1,37 +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 verifyConditionalIndicative;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _consequent = /*#__PURE__*/ _interopRequireDefault(require("../verify/consequent"));
|
|
12
|
-
var _antecedent = /*#__PURE__*/ _interopRequireDefault(require("../verify/antecedent"));
|
|
13
|
-
var _query = require("../utilities/query");
|
|
14
|
-
function _interopRequireDefault(obj) {
|
|
15
|
-
return obj && obj.__esModule ? obj : {
|
|
16
|
-
default: obj
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
var consequentNodeQuery = (0, _query.nodeQuery)("/conditionalIndicative/consequent!"), antecedentsNodeQuery = (0, _query.nodesQuery)("/conditionalIndicative/antecedent");
|
|
20
|
-
function verifyConditionalIndicative(conditionalIndicativeNode, antecedents, consequents, proofContext) {
|
|
21
|
-
var conditionalIndicativeVerified = false;
|
|
22
|
-
proofContext.begin(conditionalIndicativeNode);
|
|
23
|
-
var consequentNode = consequentNodeQuery(conditionalIndicativeNode), antecedentNodes = antecedentsNodeQuery(conditionalIndicativeNode), antecedentsVerified = antecedentNodes.every(function(antecedentNode) {
|
|
24
|
-
var antecedentVerified = (0, _antecedent.default)(antecedentNode, antecedents, proofContext);
|
|
25
|
-
if (antecedentVerified) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
if (antecedentsVerified) {
|
|
30
|
-
var consequentVerified = (0, _consequent.default)(consequentNode, consequents, proofContext);
|
|
31
|
-
conditionalIndicativeVerified = consequentVerified; ///
|
|
32
|
-
}
|
|
33
|
-
conditionalIndicativeVerified ? proofContext.complete(conditionalIndicativeNode) : proofContext.halt(conditionalIndicativeNode);
|
|
34
|
-
return conditionalIndicativeVerified;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92ZXJpZnkvY29uZGl0aW5hbEluZGljYXRpdmUuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmltcG9ydCB2ZXJpZnlDb25zZXF1ZW50IGZyb20gXCIuLi92ZXJpZnkvY29uc2VxdWVudFwiO1xuaW1wb3J0IHZlcmlmeUFudGVjZWRlbnQgZnJvbSBcIi4uL3ZlcmlmeS9hbnRlY2VkZW50XCI7XG5cbmltcG9ydCB7IG5vZGVRdWVyeSwgbm9kZXNRdWVyeSB9IGZyb20gXCIuLi91dGlsaXRpZXMvcXVlcnlcIjtcblxuY29uc3QgY29uc2VxdWVudE5vZGVRdWVyeSA9IG5vZGVRdWVyeShcIi9jb25kaXRpb25hbEluZGljYXRpdmUvY29uc2VxdWVudCFcIiksXG4gICAgICBhbnRlY2VkZW50c05vZGVRdWVyeSA9IG5vZGVzUXVlcnkoXCIvY29uZGl0aW9uYWxJbmRpY2F0aXZlL2FudGVjZWRlbnRcIik7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHZlcmlmeUNvbmRpdGlvbmFsSW5kaWNhdGl2ZShjb25kaXRpb25hbEluZGljYXRpdmVOb2RlLCBhbnRlY2VkZW50cywgY29uc2VxdWVudHMsIHByb29mQ29udGV4dCkge1xuICBsZXQgY29uZGl0aW9uYWxJbmRpY2F0aXZlVmVyaWZpZWQgPSBmYWxzZTtcblxuICBwcm9vZkNvbnRleHQuYmVnaW4oY29uZGl0aW9uYWxJbmRpY2F0aXZlTm9kZSk7XG5cbiAgY29uc3QgY29uc2VxdWVudE5vZGUgPSBjb25zZXF1ZW50Tm9kZVF1ZXJ5KGNvbmRpdGlv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