occam-verify-cli 0.0.1063 → 0.0.1066
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/bin/action/verify.js +2 -0
- package/lib/assertion/contained.js +1 -2
- package/lib/assertion/defined.js +31 -47
- package/lib/assertion/subproof.js +3 -3
- package/lib/combinator/bracketed.js +135 -0
- package/lib/conclusion.js +5 -8
- package/lib/consequent.js +5 -8
- package/lib/constants.js +3 -3
- package/lib/constructor/bracketed.js +30 -11
- package/lib/context/file.js +39 -3
- package/lib/context/local.js +59 -7
- package/lib/metavariable.js +30 -33
- package/lib/mixins/statement/unify.js +2 -2
- package/lib/mixins/statement/verify.js +6 -6
- package/lib/premise.js +5 -8
- package/lib/proofStep.js +2 -2
- package/lib/ruleNames.js +1 -5
- package/lib/statement/unqualified.js +14 -1
- package/lib/statement.js +27 -19
- package/lib/substitution/frameForMetavariable.js +17 -2
- package/lib/substitution/statementForMetavariable.js +22 -27
- package/lib/substitution/termForVariable.js +28 -10
- package/lib/supposition.js +5 -8
- package/lib/unifier/intrinsicLevel.js +4 -4
- package/lib/unifier/metaLevel.js +8 -13
- package/lib/unifier/metavariable.js +4 -4
- package/lib/unify/simpleSubstitutionStatementWithComplexSubstitutionStatement.js +3 -3
- package/lib/unify/statementWithSttaemetnGivenEquivalences.js +5 -5
- package/lib/utilities/brackets.js +5 -10
- package/lib/utilities/node.js +29 -15
- package/lib/utilities/string.js +34 -16
- package/lib/utilities/tokens.js +16 -8
- package/lib/utilities/unify.js +4 -21
- package/lib/variable.js +14 -2
- package/package.json +1 -1
- package/src/assertion/contained.js +0 -2
- package/src/assertion/defined.js +34 -61
- package/src/assertion/subproof.js +2 -2
- package/src/combinator/bracketed.js +49 -0
- package/src/conclusion.js +5 -18
- package/src/consequent.js +5 -18
- package/src/constants.js +2 -2
- package/src/constructor/bracketed.js +32 -9
- package/src/context/file.js +35 -5
- package/src/context/local.js +64 -7
- package/src/metavariable.js +46 -33
- package/src/mixins/statement/unify.js +1 -1
- package/src/mixins/statement/verify.js +7 -6
- package/src/premise.js +5 -18
- package/src/proofStep.js +1 -1
- package/src/ruleNames.js +0 -1
- package/src/statement/unqualified.js +17 -0
- package/src/statement.js +54 -36
- package/src/substitution/frameForMetavariable.js +26 -1
- package/src/substitution/statementForMetavariable.js +27 -34
- package/src/substitution/termForVariable.js +45 -13
- package/src/supposition.js +5 -18
- package/src/unifier/intrinsicLevel.js +3 -3
- package/src/unifier/metaLevel.js +15 -21
- package/src/unifier/metavariable.js +3 -3
- package/src/unify/simpleSubstitutionStatementWithComplexSubstitutionStatement.js +2 -2
- package/src/unify/statementWithSttaemetnGivenEquivalences.js +4 -4
- package/src/utilities/brackets.js +2 -3
- package/src/utilities/node.js +30 -22
- package/src/utilities/string.js +39 -23
- package/src/utilities/tokens.js +17 -8
- package/src/utilities/unify.js +0 -14
- package/src/variable.js +20 -1
- package/lib/node/statement/bracketed.js +0 -16
- package/lib/node/statement/combinator/bracketed.js +0 -25
- package/lib/node/term/bracketed.js +0 -16
- package/lib/node/term/constructor/bracketed.js +0 -25
- package/lib/ocmbinator/bracketed.js +0 -157
- package/lib/substitution/statement.js +0 -163
- package/lib/unify/frameWithMetaType.js +0 -24
- package/lib/verifier/substitution.js +0 -161
- package/lib/verify/frameGivenMetaType.js +0 -37
- package/src/node/statement/bracketed.js +0 -9
- package/src/node/statement/combinator/bracketed.js +0 -10
- package/src/node/term/bracketed.js +0 -9
- package/src/node/term/constructor/bracketed.js +0 -10
- package/src/ocmbinator/bracketed.js +0 -26
- package/src/substitution/statement.js +0 -81
- package/src/unify/frameWithMetaType.js +0 -14
- package/src/verifier/substitution.js +0 -75
- package/src/verify/frameGivenMetaType.js +0 -31
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Substitution from "../substitution";
|
|
4
|
-
import substitutionVerifier from "../verifier/substitution";
|
|
5
|
-
|
|
6
|
-
import { nodeQuery } from "../utilities/query";
|
|
7
|
-
import { substitutionNodeFromSubstitutionString } from "../utilities/node";
|
|
8
|
-
|
|
9
|
-
const substitutionNodeQuery = nodeQuery("/statement/substitution");
|
|
10
|
-
|
|
11
|
-
export default class StatementSubstitution extends Substitution {
|
|
12
|
-
constructor(string, node) {
|
|
13
|
-
super(string);
|
|
14
|
-
|
|
15
|
-
this.node = node;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
getNode() {
|
|
19
|
-
return this.node;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
verify(assignments, stated, localContext) {
|
|
23
|
-
let verified;
|
|
24
|
-
|
|
25
|
-
const statementSubstitutionString = this.string; ///
|
|
26
|
-
|
|
27
|
-
localContext.trace(`Verifying the '${statementSubstitutionString}' statement substitution...`);
|
|
28
|
-
|
|
29
|
-
const substitutionNode = this.node, ///
|
|
30
|
-
substitutionVerified = substitutionVerifier.verify(substitutionNode, assignments, stated, localContext);
|
|
31
|
-
|
|
32
|
-
verified = substitutionVerified; ///
|
|
33
|
-
|
|
34
|
-
if (verified) {
|
|
35
|
-
localContext.debug(`...verified the '${statementSubstitutionString}' statement substitution.`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return verified;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
toJSON() {
|
|
42
|
-
const string = this.getString(),
|
|
43
|
-
json = {
|
|
44
|
-
string
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
return json;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
static fromJSON(json, fileContext) {
|
|
51
|
-
let statementSubstitution = null;
|
|
52
|
-
|
|
53
|
-
if (json !== null) {
|
|
54
|
-
const { string } = json,
|
|
55
|
-
lexer = fileContext.getLexer(),
|
|
56
|
-
parser = fileContext.getParser(),
|
|
57
|
-
substitutionString = string, ///
|
|
58
|
-
substitutionNode = substitutionNodeFromSubstitutionString(substitutionString, lexer, parser),
|
|
59
|
-
node = substitutionNode;
|
|
60
|
-
|
|
61
|
-
statementSubstitution = new Substitution(string, node);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return statementSubstitution;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
static fromStatementNode(statementNode, fileContext) {
|
|
68
|
-
let statementSubstitution = null;
|
|
69
|
-
|
|
70
|
-
const substitutionNode = substitutionNodeQuery(statementNode);
|
|
71
|
-
|
|
72
|
-
if (substitutionNode) {
|
|
73
|
-
const node = substitutionNode, ///
|
|
74
|
-
string = fileContext.nodeAsString(substitutionNode);
|
|
75
|
-
|
|
76
|
-
statementSubstitution = new StatementSubstitution(string, node);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return statementSubstitution;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import verifyFrameGivenMetaType from "../verify/frameGivenMetaType";
|
|
4
|
-
|
|
5
|
-
export default function unifyFrameWithMetaType(frameNode, metaTypeNode, assignments, stated, localContext) {
|
|
6
|
-
let frameUnifiedWithMetaType;
|
|
7
|
-
|
|
8
|
-
const metaType = localContext.findMetaTypeByMetaTypeName(metaTypeNode),
|
|
9
|
-
frameVerifiedGivenMetaType = verifyFrameGivenMetaType(frameNode, metaType, assignments, stated, localContext);
|
|
10
|
-
|
|
11
|
-
frameUnifiedWithMetaType = frameVerifiedGivenMetaType; ///
|
|
12
|
-
|
|
13
|
-
return frameUnifiedWithMetaType;
|
|
14
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import shim from "../shim";
|
|
4
|
-
import Verifier from "../verifier";
|
|
5
|
-
|
|
6
|
-
import { nodeQuery } from "../utilities/query";
|
|
7
|
-
|
|
8
|
-
const termNodeQuery = nodeQuery("/term"),
|
|
9
|
-
frameNodeQuery = nodeQuery("/frame"),
|
|
10
|
-
variableNodeQuery = nodeQuery("/variable"),
|
|
11
|
-
metavariableNodeQuery = nodeQuery("/metavariable");
|
|
12
|
-
|
|
13
|
-
class SubstitutionVerifier extends Verifier {
|
|
14
|
-
verify(substitutionNode, assignments, stated, localContext) {
|
|
15
|
-
let substitutionVerified;
|
|
16
|
-
|
|
17
|
-
const nonTerminalNode = substitutionNode, ///
|
|
18
|
-
nonTerminalNodeVerified = this.verifyNonTerminalNode(nonTerminalNode, assignments, stated, localContext);
|
|
19
|
-
|
|
20
|
-
substitutionVerified = nonTerminalNodeVerified; ///
|
|
21
|
-
|
|
22
|
-
return substitutionVerified;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
static maps = [
|
|
26
|
-
{
|
|
27
|
-
nodeQuery: metavariableNodeQuery,
|
|
28
|
-
verify: (metavariableNode, assignments, stated, localContext) => {
|
|
29
|
-
const { Metavariable } = shim,
|
|
30
|
-
metavariable = Metavariable.fromMetavariableNode(metavariableNode, localContext),
|
|
31
|
-
metavariableVerified = metavariable.verify(localContext);
|
|
32
|
-
|
|
33
|
-
return metavariableVerified;
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
nodeQuery: variableNodeQuery,
|
|
38
|
-
verify: (variableNode, assignments, stated, localContext) => {
|
|
39
|
-
const { Variable } = shim,
|
|
40
|
-
variable = Variable.fromVariableNode(variableNode, localContext),
|
|
41
|
-
variableVerified = variable.verify(localContext);
|
|
42
|
-
|
|
43
|
-
return variableVerified;
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
nodeQuery: frameNodeQuery,
|
|
48
|
-
verify: (frameNode, assignments, stated, localContext) => {
|
|
49
|
-
const { Frame } = shim,
|
|
50
|
-
frame = Frame.fromFrameNode(frameNode, localContext),
|
|
51
|
-
frameVerified = frame.verify(localContext);
|
|
52
|
-
|
|
53
|
-
return frameVerified;
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
nodeQuery: termNodeQuery,
|
|
58
|
-
verify: (termNode, assignments, stated, localContext) => {
|
|
59
|
-
const { Term } = shim,
|
|
60
|
-
term = Term.fromTermNode(termNode, localContext),
|
|
61
|
-
termVerified = term.verify(localContext, () => {
|
|
62
|
-
const verifiedAhead = true;
|
|
63
|
-
|
|
64
|
-
return verifiedAhead;
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
return termVerified;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
];
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const substitutionVerifier = new SubstitutionVerifier();
|
|
74
|
-
|
|
75
|
-
export default substitutionVerifier;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import shim from "../shim";
|
|
4
|
-
|
|
5
|
-
import { FRAME_META_TYPE_NAME } from "../metaTypeNames";
|
|
6
|
-
|
|
7
|
-
export default function verifyFrameGivenMetaType(frameNode, metaType, assignments, stated, localContext) {
|
|
8
|
-
let frameVerifiedGivenMetaType;
|
|
9
|
-
|
|
10
|
-
const metaTypeName = metaType.getName();
|
|
11
|
-
|
|
12
|
-
switch (metaTypeName) {
|
|
13
|
-
case FRAME_META_TYPE_NAME: {
|
|
14
|
-
const { verifyFrame } = shim,
|
|
15
|
-
frames = [],
|
|
16
|
-
frameVerified = verifyFrame(frameNode, frames, stated, localContext)
|
|
17
|
-
|
|
18
|
-
frameVerifiedGivenMetaType = frameVerified; ///
|
|
19
|
-
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
default: {
|
|
24
|
-
debugger
|
|
25
|
-
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return frameVerifiedGivenMetaType;
|
|
31
|
-
}
|