occam-verify-cli 0.0.508 → 0.0.509
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/assertion/type.js +90 -0
- package/lib/combinator.js +7 -1
- package/lib/verify/assertion/type.js +19 -23
- package/lib/verify/conclusion.js +6 -5
- package/lib/verify/consequence.js +6 -5
- package/lib/verify/derivation.js +2 -2
- package/lib/verify/metastatement/qualified.js +19 -5
- package/lib/verify/metastatement/unqualified.js +16 -4
- package/lib/verify/metastatement.js +3 -3
- package/lib/verify/premise.js +6 -5
- package/lib/verify/ruleDerivation.js +2 -2
- package/lib/verify/statement/qualified.js +9 -8
- package/lib/verify/statement/unqualified.js +16 -4
- package/lib/verify/statement.js +106 -9
- package/lib/verify/supposition.js +11 -11
- package/package.json +3 -3
- package/src/assertion/type.js +46 -0
- package/src/combinator.js +4 -0
- package/src/verify/assertion/type.js +24 -25
- package/src/verify/conclusion.js +11 -5
- package/src/verify/consequence.js +10 -4
- package/src/verify/derivation.js +4 -2
- package/src/verify/metastatement/qualified.js +20 -6
- package/src/verify/metastatement/unqualified.js +13 -3
- package/src/verify/metastatement.js +2 -2
- package/src/verify/premise.js +10 -4
- package/src/verify/ruleDerivation.js +4 -2
- package/src/verify/statement/qualified.js +13 -11
- package/src/verify/statement/unqualified.js +13 -3
- package/src/verify/statement.js +175 -9
- package/src/verify/supposition.js +16 -12
- package/lib/verify/metaDerivation.js +0 -63
- package/lib/verify/metaproof.js +0 -32
- package/src/verify/metaDerivation.js +0 -75
- package/src/verify/metaproof.js +0 -35
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import Consequence from "../consequence";
|
|
4
|
+
import verifyUnqualifiedStatement from "./statement/unqualified";
|
|
4
5
|
|
|
5
6
|
import { nodeQuery } from "../utilities/query";
|
|
6
7
|
import { nodeAsString } from "../utilities/string";
|
|
7
8
|
|
|
8
|
-
const statementNodeQuery = nodeQuery("/
|
|
9
|
+
const statementNodeQuery = nodeQuery("/unqualifiedStatement/statement!"),
|
|
10
|
+
unqualifiedStatementNodeQuery = nodeQuery("/consequence/unqualifiedStatement!");
|
|
9
11
|
|
|
10
12
|
export default function verifyConsequence(consequenceNode, consequences, proofContext) {
|
|
11
13
|
let consequenceVerified = false;
|
|
@@ -16,10 +18,14 @@ export default function verifyConsequence(consequenceNode, consequences, proofCo
|
|
|
16
18
|
|
|
17
19
|
proofContext.debug(`Verifying the ${consequenceString} consequence...`);
|
|
18
20
|
|
|
19
|
-
const
|
|
21
|
+
const derived = false,
|
|
22
|
+
assertions = [],
|
|
23
|
+
unqualifiedStatementNode = unqualifiedStatementNodeQuery(consequenceNode),
|
|
24
|
+
unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, assertions, derived, proofContext);
|
|
20
25
|
|
|
21
|
-
if (
|
|
22
|
-
const
|
|
26
|
+
if (unqualifiedStatementVerified) {
|
|
27
|
+
const statementNode = statementNodeQuery(unqualifiedStatementNode),
|
|
28
|
+
consequence = Consequence.fromStatementNode(statementNode);
|
|
23
29
|
|
|
24
30
|
consequences.push(consequence);
|
|
25
31
|
|
package/src/verify/derivation.js
CHANGED
|
@@ -123,8 +123,10 @@ function verifyChild(childNode, proofContext) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
case UNQUALIFIED_STATEMENT_RULE_NAME: {
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const derived = true,
|
|
127
|
+
assertions = [],
|
|
128
|
+
unqualifiedStatementNode = childNode, ///
|
|
129
|
+
unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, assertions, derived, proofContext);
|
|
128
130
|
|
|
129
131
|
if (unqualifiedStatementVerified) {
|
|
130
132
|
const statementNode = statementNodeQuery(unqualifiedStatementNode),
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import verifyMetastatement from "../../verify/metastatement";
|
|
4
|
+
|
|
3
5
|
import { nodeAsString } from "../../utilities/string";
|
|
4
6
|
import { nodeQuery, referenceNameFromReferenceNode } from "../../utilities/query";
|
|
5
7
|
|
|
@@ -18,14 +20,26 @@ export default function verifyQualifiedMetastatement(qualifiedMetastatementNode,
|
|
|
18
20
|
|
|
19
21
|
metaproofContext.debug(`Verifying the ${metastatementString} qualified metastatement...`);
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
let ruleMatchesStatement = true;
|
|
24
|
+
|
|
25
|
+
const referenceNode = referenceNodeQuery(qualifiedMetastatementNode);
|
|
26
|
+
|
|
27
|
+
if (referenceNode !== null) {
|
|
28
|
+
const referenceName = referenceNameFromReferenceNode(referenceNode),
|
|
29
|
+
rule = metaproofContext.findRuleByReferenceName(referenceName);
|
|
30
|
+
|
|
31
|
+
if (rule !== null) {
|
|
32
|
+
const ruleMatchesStatement = rule.matchMetastatement(metastatementNode, metaproofContext);
|
|
33
|
+
|
|
34
|
+
qualifiedMetastatementVerified = ruleMatchesStatement; ///
|
|
35
|
+
}
|
|
36
|
+
}
|
|
24
37
|
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
38
|
+
if (ruleMatchesStatement) {
|
|
39
|
+
const assertions = [],
|
|
40
|
+
metastatementVerified = verifyMetastatement(metastatementNode, assertions, metaproofContext);
|
|
27
41
|
|
|
28
|
-
qualifiedMetastatementVerified =
|
|
42
|
+
qualifiedMetastatementVerified = metastatementVerified; ///
|
|
29
43
|
}
|
|
30
44
|
}
|
|
31
45
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import verifyMetastatement from "../metastatement";
|
|
4
|
+
|
|
3
5
|
import { nodeQuery } from "../../utilities/query";
|
|
4
6
|
import { nodeAsString } from "../../utilities/string";
|
|
5
7
|
|
|
6
8
|
const metastatementNodeQuery = nodeQuery("/unqualifiedMetastatement/metastatement!");
|
|
7
9
|
|
|
8
|
-
export default function verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, metaproofContext) {
|
|
10
|
+
export default function verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, assertions, derived, metaproofContext) {
|
|
9
11
|
let unqualifiedMetastatementVerified = false;
|
|
10
12
|
|
|
11
13
|
metaproofContext.begin(unqualifiedMetastatementNode);
|
|
@@ -17,9 +19,17 @@ export default function verifyUnqualifiedMetastatement(unqualifiedMetastatementN
|
|
|
17
19
|
|
|
18
20
|
metaproofContext.debug(`Verifying the ${metastatementString} unqualified metastatement...`);
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
let metastatementMatches = true;
|
|
23
|
+
|
|
24
|
+
if (derived) {
|
|
25
|
+
metastatementMatches = metaproofContext.matchMetastatement(metastatementNode);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (metastatementMatches) {
|
|
29
|
+
const metastatementVerified = verifyMetastatement(metastatementNode, assertions, metaproofContext);
|
|
21
30
|
|
|
22
|
-
|
|
31
|
+
unqualifiedMetastatementVerified = metastatementVerified; ///
|
|
32
|
+
}
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
unqualifiedMetastatementVerified ?
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
export default function verifyMetastatement(metastatementNode,
|
|
4
|
-
let metastatementVerified = true;
|
|
3
|
+
export default function verifyMetastatement(metastatementNode, assertions, metaproofContext) {
|
|
4
|
+
let metastatementVerified = true; ///
|
|
5
5
|
|
|
6
6
|
metaproofContext.begin(metastatementNode);
|
|
7
7
|
|
package/src/verify/premise.js
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import Premise from "../premise";
|
|
4
4
|
import MetaproofStep from "../step/metaproof";
|
|
5
|
+
import verifyUnqualifiedMetastatement from "../verify/metastatement/unqualified";
|
|
5
6
|
|
|
6
7
|
import { nodeQuery } from "../utilities/query";
|
|
7
8
|
import { nodeAsString } from "../utilities/string";
|
|
8
9
|
|
|
9
|
-
const metastatementNodeQuery = nodeQuery("/
|
|
10
|
+
const metastatementNodeQuery = nodeQuery("/unqualifiedMetastatement/metastatement!"),
|
|
11
|
+
unqualifiedMetastatementNodeQuery = nodeQuery("/premise/unqualifiedMetastatement!");
|
|
10
12
|
|
|
11
13
|
export default function verifyPremise(premiseNode, premises, metaproofContext) {
|
|
12
14
|
let premiseVerified;
|
|
@@ -17,10 +19,14 @@ export default function verifyPremise(premiseNode, premises, metaproofContext) {
|
|
|
17
19
|
|
|
18
20
|
metaproofContext.debug(`Verifying the ${premiseString} premise...`);
|
|
19
21
|
|
|
20
|
-
const
|
|
22
|
+
const derived = false,
|
|
23
|
+
assertions = [],
|
|
24
|
+
unqualifiedMetastatementNode = unqualifiedMetastatementNodeQuery(premiseNode),
|
|
25
|
+
unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, assertions, derived, metaproofContext);
|
|
21
26
|
|
|
22
|
-
if (
|
|
23
|
-
const
|
|
27
|
+
if (unqualifiedMetastatementVerified) {
|
|
28
|
+
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
29
|
+
metaproofStep = MetaproofStep.fromMetastatementNode(metastatementNode),
|
|
24
30
|
premise = Premise.fromMetastatementNode(metastatementNode);
|
|
25
31
|
|
|
26
32
|
premises.push(premise);
|
|
@@ -123,8 +123,10 @@ function verifyChild(childNode, metaproofContext) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
case UNQUALIFIED_METASTATEMENT_RULE_NAME: {
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const derived = true,
|
|
127
|
+
assertions = [],
|
|
128
|
+
unqualifiedMetastatementNode = childNode, ///
|
|
129
|
+
unqualifiedMetastatementVerified = verifyUnqualifiedMetastatement(unqualifiedMetastatementNode, assertions, derived, metaproofContext);
|
|
128
130
|
|
|
129
131
|
if (unqualifiedMetastatementVerified) {
|
|
130
132
|
const metastatementNode = metastatementNodeQuery(unqualifiedMetastatementNode),
|
|
@@ -5,8 +5,8 @@ import verifyStatement from "../../verify/statement";
|
|
|
5
5
|
import { nodeAsString } from "../../utilities/string";
|
|
6
6
|
import { nodeQuery, referenceNameFromReferenceNode } from "../../utilities/query";
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const referenceNodeQuery = nodeQuery("/qualifiedStatement/qualification!/reference!"),
|
|
9
|
+
statementNodeQuery = nodeQuery("/qualifiedStatement/statement!");
|
|
10
10
|
|
|
11
11
|
export default function verifyQualifiedStatement(qualifiedStatementNode, proofContext) {
|
|
12
12
|
let qualifiedStatementVerified = false;
|
|
@@ -20,23 +20,25 @@ export default function verifyQualifiedStatement(qualifiedStatementNode, proofCo
|
|
|
20
20
|
|
|
21
21
|
proofContext.debug(`Verifying the ${statementString} qualified statement...`);
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
let ruleMatchesStatement = true;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
const qualified = true,
|
|
27
|
-
statementVerified = verifyStatement(statementNode, qualified, proofContext);
|
|
25
|
+
const referenceNode = referenceNodeQuery(qualifiedStatementNode);
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
} else {
|
|
27
|
+
if (referenceNode !== null) {
|
|
31
28
|
const referenceName = referenceNameFromReferenceNode(referenceNode),
|
|
32
29
|
rule = proofContext.findRuleByReferenceName(referenceName);
|
|
33
30
|
|
|
34
31
|
if (rule !== null) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
qualifiedStatementVerified = ruleMatchesStatement; ///
|
|
32
|
+
ruleMatchesStatement = rule.matchStatement(statementNode, proofContext);
|
|
38
33
|
}
|
|
39
34
|
}
|
|
35
|
+
|
|
36
|
+
if (ruleMatchesStatement) {
|
|
37
|
+
const assertions = [],
|
|
38
|
+
statementVerified = verifyStatement(statementNode, assertions, proofContext);
|
|
39
|
+
|
|
40
|
+
qualifiedStatementVerified = statementVerified; ///
|
|
41
|
+
}
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
qualifiedStatementVerified ?
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import verifyStatement from "../statement";
|
|
4
|
+
|
|
3
5
|
import { nodeQuery } from "../../utilities/query";
|
|
4
6
|
import { nodeAsString } from "../../utilities/string";
|
|
5
7
|
|
|
6
8
|
const statementNodeQuery = nodeQuery("/unqualifiedStatement/statement!");
|
|
7
9
|
|
|
8
|
-
export default function verifyUnqualifiedStatement(unqualifiedStatementNode, proofContext) {
|
|
10
|
+
export default function verifyUnqualifiedStatement(unqualifiedStatementNode, assertions, derived, proofContext) {
|
|
9
11
|
let unqualifiedStatementVerified = false;
|
|
10
12
|
|
|
11
13
|
proofContext.begin(unqualifiedStatementNode);
|
|
@@ -17,9 +19,17 @@ export default function verifyUnqualifiedStatement(unqualifiedStatementNode, pro
|
|
|
17
19
|
|
|
18
20
|
proofContext.debug(`Verifying the ${statementString} unqualified statement...`);
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
let statementMatches = true;
|
|
23
|
+
|
|
24
|
+
if (derived) {
|
|
25
|
+
statementMatches = proofContext.matchStatement(statementNode);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (statementMatches) {
|
|
29
|
+
const statementVerified = verifyStatement(statementNode, assertions, proofContext);
|
|
21
30
|
|
|
22
|
-
|
|
31
|
+
unqualifiedStatementVerified = statementVerified; ///
|
|
32
|
+
}
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
unqualifiedStatementVerified ?
|
package/src/verify/statement.js
CHANGED
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import verifyTerm from "../verify/term";
|
|
3
4
|
import verifyTypeAssertion from "../verify/assertion/type";
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
+
import { first } from "../utilities/array";
|
|
7
|
+
import { nodeAsString } from "../utilities/string";
|
|
8
|
+
import { ARGUMENT_RULE_NAME } from "../ruleNames";
|
|
9
|
+
import { nodeQuery, typeNameFromTypeNode } from "../utilities/query";
|
|
6
10
|
|
|
7
|
-
const
|
|
11
|
+
const termNodeQuery = nodeQuery("/argument/term!"),
|
|
12
|
+
typeNodeQuery = nodeQuery("/argument/type!"),
|
|
13
|
+
typeAssertionNodeQuery = nodeQuery("/statement/typeAssertion!");
|
|
8
14
|
|
|
9
|
-
export default function verifyStatement(statementNode,
|
|
15
|
+
export default function verifyStatement(statementNode, assertions, proofContext) {
|
|
10
16
|
let statementVerified = false;
|
|
11
17
|
|
|
12
18
|
proofContext.begin(statementNode);
|
|
13
19
|
|
|
14
|
-
|
|
15
|
-
const typeAssertionNode = typeAssertionNodeQuery(statementNode);
|
|
20
|
+
const typeAssertionNode = typeAssertionNodeQuery(statementNode);
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
if (typeAssertionNode !== null) {
|
|
23
|
+
const typeAssertionVerified = verifyTypeAssertion(typeAssertionNode, assertions, proofContext);
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
statementVerified = typeAssertionVerified; ///
|
|
26
|
+
} else {
|
|
27
|
+
const context = proofContext, ///
|
|
28
|
+
statementVerifiedAgainstCombinators = verifyStatementAgainstCombinators(statementNode, context);
|
|
29
|
+
|
|
30
|
+
statementVerified = statementVerifiedAgainstCombinators; ///
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
statementVerified ?
|
|
@@ -27,3 +36,160 @@ export default function verifyStatement(statementNode, qualified, proofContext)
|
|
|
27
36
|
|
|
28
37
|
return statementVerified;
|
|
29
38
|
}
|
|
39
|
+
|
|
40
|
+
function verifyStatementAgainstCombinators(statementNode, context) {
|
|
41
|
+
let statementVerifiedAgainstCombinators = false;
|
|
42
|
+
|
|
43
|
+
context.begin(statementNode);
|
|
44
|
+
|
|
45
|
+
const combinators = context.getCombinators(),
|
|
46
|
+
combinator = combinators.find((combinator) => {
|
|
47
|
+
const statementVerifiedAgainstCombinator = verifyStatementAgainstCombinator(statementNode, combinator, context);
|
|
48
|
+
|
|
49
|
+
if (statementVerifiedAgainstCombinator) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
}) || null;
|
|
53
|
+
|
|
54
|
+
if (combinator !== null) {
|
|
55
|
+
statementVerifiedAgainstCombinators = true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
statementVerifiedAgainstCombinators ?
|
|
59
|
+
context.complete(statementNode) :
|
|
60
|
+
context.halt(statementNode);
|
|
61
|
+
|
|
62
|
+
return statementVerifiedAgainstCombinators;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function verifyStatementAgainstCombinator(statementNode, combinator, context) {
|
|
66
|
+
const combinatorStatementNode = combinator.getStatementNode(),
|
|
67
|
+
node = statementNode, ///
|
|
68
|
+
combinatorNode = combinatorStatementNode, ///
|
|
69
|
+
nodeVerified = verifyNode(node, combinatorNode, context),
|
|
70
|
+
statementVerifiedAgainstCombinator = nodeVerified; ///
|
|
71
|
+
|
|
72
|
+
return statementVerifiedAgainstCombinator;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function verifyNode(node, combinatorNode, context) {
|
|
76
|
+
let nodeVerified;
|
|
77
|
+
|
|
78
|
+
const nodeTerminalNode = node.isTerminalNode(),
|
|
79
|
+
combinatorNodeTerminalNode = combinatorNode.isTerminalNode();
|
|
80
|
+
|
|
81
|
+
if (nodeTerminalNode === combinatorNodeTerminalNode) {
|
|
82
|
+
if (nodeTerminalNode) {
|
|
83
|
+
const terminalNode = node, ///
|
|
84
|
+
combinatorTerminalNode = combinatorNode, ///
|
|
85
|
+
terminalNodeVerified = verifyTerminalNode(terminalNode, combinatorTerminalNode, context);
|
|
86
|
+
|
|
87
|
+
nodeVerified = terminalNodeVerified; ///
|
|
88
|
+
} else {
|
|
89
|
+
const nonTerminalNode = node, ///
|
|
90
|
+
combinatorNonTerminalNode = combinatorNode, ///
|
|
91
|
+
nonTerminalNodeVerified = verifyNonTerminalNode(nonTerminalNode, combinatorNonTerminalNode, context);
|
|
92
|
+
|
|
93
|
+
nodeVerified = nonTerminalNodeVerified; ///
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return nodeVerified;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function verifyNodes(nodes, combinatorNodes, context) {
|
|
101
|
+
let nodesVerified = false;
|
|
102
|
+
|
|
103
|
+
const nodesLength = nodes.length,
|
|
104
|
+
combinatorNodesLength = combinatorNodes.length;
|
|
105
|
+
|
|
106
|
+
if (nodesLength === combinatorNodesLength) {
|
|
107
|
+
nodesVerified = nodes.every((node, index) => {
|
|
108
|
+
const combinatorNode = combinatorNodes[index],
|
|
109
|
+
nodeVerified = verifyNode(node, combinatorNode, context);
|
|
110
|
+
|
|
111
|
+
if (nodeVerified) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return nodesVerified;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function verifyTerminalNode(terminalNode, combinatorTerminalNode, context) {
|
|
121
|
+
let terminalNodeVerified = false;
|
|
122
|
+
|
|
123
|
+
const matches = terminalNode.match(combinatorTerminalNode);
|
|
124
|
+
|
|
125
|
+
if (matches) {
|
|
126
|
+
terminalNodeVerified = true;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return terminalNodeVerified;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function verifyNonTerminalNode(nonTerminalNode, combinatorNonTerminalNode, context) {
|
|
133
|
+
let nonTerminalNodeVerified = false;
|
|
134
|
+
|
|
135
|
+
const ruleName = nonTerminalNode.getRuleName(), ///
|
|
136
|
+
combinatorRuleName = combinatorNonTerminalNode.getRuleName(); ///
|
|
137
|
+
|
|
138
|
+
if (ruleName === combinatorRuleName) {
|
|
139
|
+
switch (ruleName) {
|
|
140
|
+
case ARGUMENT_RULE_NAME: {
|
|
141
|
+
const argumentNode = nonTerminalNode, ///
|
|
142
|
+
combinatorArgumentNode = combinatorNonTerminalNode, ///
|
|
143
|
+
argumentNodeVerified = verifyArgumentNode(argumentNode, combinatorArgumentNode, context);
|
|
144
|
+
|
|
145
|
+
nonTerminalNodeVerified = argumentNodeVerified; ///
|
|
146
|
+
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
default: {
|
|
151
|
+
const childNodes = nonTerminalNode.getChildNodes(),
|
|
152
|
+
combinatorChildNodes = combinatorNonTerminalNode.getChildNodes(),
|
|
153
|
+
nodes = childNodes, ///
|
|
154
|
+
combinatorNodes = combinatorChildNodes, ///
|
|
155
|
+
nodesVerified = verifyNodes(nodes, combinatorNodes, context);
|
|
156
|
+
|
|
157
|
+
nonTerminalNodeVerified = nodesVerified; ///
|
|
158
|
+
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return nonTerminalNodeVerified;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function verifyArgumentNode(argumentNode, combinatorArgumentNode, context) {
|
|
168
|
+
let argumentNodeVerified = false;
|
|
169
|
+
|
|
170
|
+
const termNode = termNodeQuery(argumentNode);
|
|
171
|
+
|
|
172
|
+
if (termNode === null) {
|
|
173
|
+
const argumentString = nodeAsString(argumentNode);
|
|
174
|
+
|
|
175
|
+
context.error(`The ${argumentString} argument should be a term, not a type`);
|
|
176
|
+
} else {
|
|
177
|
+
const types = [],
|
|
178
|
+
termVerified = verifyTerm(termNode, types, context);
|
|
179
|
+
|
|
180
|
+
if (termVerified) {
|
|
181
|
+
const firstType = first(types),
|
|
182
|
+
termType = firstType, ///
|
|
183
|
+
typeNode = typeNodeQuery(combinatorArgumentNode),
|
|
184
|
+
typeName = typeNameFromTypeNode(typeNode),
|
|
185
|
+
type = context.findTypeByTypeName(typeName),
|
|
186
|
+
statementTypeEqualToOrSubTypeOfType = termType.isEqualToOrSubTypeOf(type);
|
|
187
|
+
|
|
188
|
+
if (statementTypeEqualToOrSubTypeOfType) {
|
|
189
|
+
argumentNodeVerified = true;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return argumentNodeVerified;
|
|
195
|
+
}
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import ProofStep from "../step/proof";
|
|
4
4
|
import Supposition from "../supposition";
|
|
5
|
-
import
|
|
5
|
+
import verifyUnqualifiedStatement from "./statement/unqualified";
|
|
6
6
|
|
|
7
7
|
import { nodeQuery } from "../utilities/query";
|
|
8
8
|
import { nodeAsString } from "../utilities/string";
|
|
9
9
|
|
|
10
|
-
const statementNodeQuery = nodeQuery("/
|
|
10
|
+
const statementNodeQuery = nodeQuery("/unqualifiedStatement/statement!"),
|
|
11
|
+
unqualifiedStatementNodeQuery = nodeQuery("/supposition/unqualifiedStatement!");
|
|
11
12
|
|
|
12
13
|
export default function verifySupposition(suppositionNode, suppositions, proofContext) {
|
|
13
14
|
let suppositionVerified;
|
|
@@ -18,20 +19,23 @@ export default function verifySupposition(suppositionNode, suppositions, proofCo
|
|
|
18
19
|
|
|
19
20
|
proofContext.debug(`Verifying the ${suppositionString} supposition...`);
|
|
20
21
|
|
|
21
|
-
const
|
|
22
|
+
const derived = false,
|
|
23
|
+
assertions = [],
|
|
24
|
+
unqualifiedStatementNode = unqualifiedStatementNodeQuery(suppositionNode),
|
|
25
|
+
unqualifiedStatementVerified = verifyUnqualifiedStatement(unqualifiedStatementNode, assertions, derived, proofContext);
|
|
22
26
|
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
25
|
-
|
|
27
|
+
if (unqualifiedStatementVerified) {
|
|
28
|
+
const statementNode = statementNodeQuery(unqualifiedStatementNode),
|
|
29
|
+
proofStep = ProofStep.fromStatementNode(statementNode),
|
|
30
|
+
supposition = Supposition.fromStatementNode(statementNode);
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
const proofStep = ProofStep.fromStatementNode(statementNode),
|
|
29
|
-
supposition = Supposition.fromStatementNode(statementNode);
|
|
32
|
+
suppositions.push(supposition);
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
proofContext.addProofStep(proofStep);
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
assertions.every((assertion) => {
|
|
37
|
+
assertion.assert(proofContext);
|
|
38
|
+
});
|
|
35
39
|
|
|
36
40
|
suppositionVerified = true;
|
|
37
41
|
}
|
|
@@ -1,63 +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 verifyMetaDerivation;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _metaproof = /*#__PURE__*/ _interopRequireDefault(require("../step/metaproof"));
|
|
12
|
-
var _qualified = /*#__PURE__*/ _interopRequireDefault(require("../verify/metastatement/qualified"));
|
|
13
|
-
var _unqualified = /*#__PURE__*/ _interopRequireDefault(require("../verify/metastatement/unqualified"));
|
|
14
|
-
var _query = require("../utilities/query");
|
|
15
|
-
var _ruleNames = require("../ruleNames");
|
|
16
|
-
function _interopRequireDefault(obj) {
|
|
17
|
-
return obj && obj.__esModule ? obj : {
|
|
18
|
-
default: obj
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
var childNodesQuery = (0, _query.nodesQuery)("/metaDerivation|metaSubDerivation/*"), metastatementNodeQuery = (0, _query.nodeQuery)("/qualifiedMetastatement|unqualifiedMetastatement/metastatement!");
|
|
22
|
-
function verifyMetaDerivation(metaDerivationNode, metaproofContext) {
|
|
23
|
-
var metaDerivationVerified;
|
|
24
|
-
metaproofContext.begin(metaDerivationNode);
|
|
25
|
-
var childNodes = childNodesQuery(metaDerivationNode);
|
|
26
|
-
metaDerivationVerified = childNodes.every(function(childNode) {
|
|
27
|
-
var childVerified = verifyChild(childNode, metaproofContext);
|
|
28
|
-
if (childVerified) {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
metaDerivationVerified ? metaproofContext.complete(metaDerivationNode) : metaproofContext.halt(metaDerivationNode);
|
|
33
|
-
return metaDerivationVerified;
|
|
34
|
-
}
|
|
35
|
-
function verifyChild(childNode, metaproofContext) {
|
|
36
|
-
var childVerified;
|
|
37
|
-
var childNodeRuleName = childNode.getRuleName();
|
|
38
|
-
switch(childNodeRuleName){
|
|
39
|
-
case _ruleNames.QUALIFIED_METASTATEMENT_RULE_NAME:
|
|
40
|
-
{
|
|
41
|
-
var qualifiedMetastatementNode = childNode, qualifiedMetastatementVerified = (0, _qualified.default)(qualifiedMetastatementNode, metaproofContext);
|
|
42
|
-
if (qualifiedMetastatementVerified) {
|
|
43
|
-
var metastatementNode = metastatementNodeQuery(qualifiedMetastatementNode), metaproofStep = _metaproof.default.fromMetastatementNode(metastatementNode);
|
|
44
|
-
metaproofContext.addMetaproofStep(metaproofStep);
|
|
45
|
-
childVerified = qualifiedMetastatementVerified; ///
|
|
46
|
-
}
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
case _ruleNames.UNQUALIFIED_METASTATEMENT_RULE_NAME:
|
|
50
|
-
{
|
|
51
|
-
var unqualifiedMetastatementNode = childNode, unqualifiedMetastatementVerified = (0, _unqualified.default)(unqualifiedMetastatementNode, metaproofContext);
|
|
52
|
-
if (unqualifiedMetastatementVerified) {
|
|
53
|
-
var metastatementNode1 = metastatementNodeQuery(unqualifiedMetastatementNode), metaproofStep1 = _metaproof.default.fromMetastatementNode(metastatementNode1);
|
|
54
|
-
metaproofContext.addMetaproofStep(metaproofStep1);
|
|
55
|
-
childVerified = true;
|
|
56
|
-
}
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return childVerified;
|
|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BQUEsa0JBQTRCLEVBQUNGLDRCQUE0QmI7Z0JBRWhHLElBQUljLGdDQUFnQztvQkFDbEMsSUFBTUUsb0JBQW9CbkIsdUJBQXVCZ0IsNkJBQzNDSSxnQkFBZ0JDLGtCQUFhLENBQUNDLHFCQUFxQixDQUFDSDtvQkFFMURoQixpQkFBaUJvQixnQkFBZ0IsQ0FBQ0g7b0JBRWxDWCxnQkFBZ0JRLGdDQUFnQyxHQUFHO2dCQUNyRCxDQUFDO2dCQUVELEtBQU07WUFDUjtRQUVBLEtBQUtPLDhDQUFtQztZQUFFO2dCQUN4QyxJQUFNQywrQkFBK0JqQixXQUMvQmtCLG1DQUFtQ0MsSUFBQUEsb0JBQThCLEVBQUNGLDhCQUE4QnRCO2dCQUV0RyxJQUFJdUIsa0NBQWtDO29CQUNwQyxJQUFNUCxxQkFBb0JuQix1QkFBdUJ5QiwrQkFDM0NMLGlCQUFnQkMsa0JBQWEsQ0FBQ0MscUJBQXFCLENBQUNIO29CQUUxRGhCLGlCQUFpQm9CLGdCQUFnQixDQUFDSDtvQkFFbENYLGdCQUFnQixJQUFJO2dCQUN0QixDQUFDO2dCQUVELEtBQU07WUFDUjtJQUNGO0lBRUEsT0FBT0E7QUFDVCJ9
|
package/lib/verify/metaproof.js
DELETED
|
@@ -1,32 +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 verifyMetaproof;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _metaDerivation = /*#__PURE__*/ _interopRequireDefault(require("../verify/metaDerivation"));
|
|
12
|
-
var _matcher = require("../matcher");
|
|
13
|
-
var _query = require("../utilities/query");
|
|
14
|
-
function _interopRequireDefault(obj) {
|
|
15
|
-
return obj && obj.__esModule ? obj : {
|
|
16
|
-
default: obj
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
var metaDerivationNodeQuery = (0, _query.nodeQuery)("/metaproof/metaDerivation!");
|
|
20
|
-
function verifyMetaproof(metaproofNode, conclusion, metaproofContext) {
|
|
21
|
-
var metaproofVerified = false;
|
|
22
|
-
metaproofContext.begin(metaproofNode);
|
|
23
|
-
var metaDerivationNode = metaDerivationNodeQuery(metaproofNode), metaDerivationVerified = (0, _metaDerivation.default)(metaDerivationNode, metaproofContext);
|
|
24
|
-
if (metaDerivationVerified) {
|
|
25
|
-
var lastMetaproofStep = metaproofContext.getLastMetaproofStep(), metaproofStep = lastMetaproofStep, metastatementNode = metaproofStep.getMetastatementNode(), conclusionMetastatementNode = conclusion.getMetastatementNode(), nodeA = metastatementNode, nodeB = conclusionMetastatementNode, nodeMatches = _matcher.matcher.matchNode(nodeA, nodeB);
|
|
26
|
-
metaproofVerified = nodeMatches; ///
|
|
27
|
-
}
|
|
28
|
-
metaproofVerified ? metaproofContext.complete(metaproofNode) : metaproofContext.complete(metaproofNode);
|
|
29
|
-
return metaproofVerified;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92ZXJpZnkvbWV0YXByb29mLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5pbXBvcnQgdmVyaWZ5TWV0YURlcml2YXRpb24gZnJvbSBcIi4uL3ZlcmlmeS9tZXRhRGVyaXZhdGlvblwiO1xuXG5pbXBvcnQgeyBtYXRjaGVyIH0gZnJvbSBcIi4uL21hdGNoZXJcIjtcbmltcG9ydCB7IG5vZGVRdWVyeSB9IGZyb20gXCIuLi91dGlsaXRpZXMvcXVlcnlcIjtcblxuY29uc3QgbWV0YURlcml2YXRpb25Ob2RlUXVlcnkgPSBub2RlUXVlcnkoXCIvbWV0YXByb29mL21ldGFEZXJpdmF0aW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