occam-verify-cli 0.0.1016 → 0.0.1020
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/argument.js +12 -11
- package/lib/assignment/equality.js +3 -3
- package/lib/axiom.js +102 -6
- package/lib/combinator.js +12 -12
- package/lib/conclusion.js +3 -4
- package/lib/consequent.js +75 -14
- package/lib/constructor/bracketed.js +3 -3
- package/lib/constructor.js +68 -18
- package/lib/context/file.js +49 -89
- package/lib/context/local.js +34 -58
- package/lib/declaration/combinator.js +3 -3
- package/lib/declaration/metavariable.js +15 -4
- package/lib/declaration/type.js +3 -3
- package/lib/declaration/variable.js +146 -0
- package/lib/equality.js +95 -19
- package/lib/index.js +6 -1
- package/lib/label.js +9 -9
- package/lib/lemma.js +107 -6
- package/lib/metavariable.js +14 -21
- package/lib/mixins/statement/qualified/unify.js +3 -3
- package/lib/mixins/statement/verify.js +4 -5
- package/lib/mixins/term/unify.js +82 -0
- package/lib/mixins/term/verify.js +44 -0
- package/lib/node/term/constructor/bracketed.js +15 -11
- package/lib/premise.js +3 -5
- package/lib/proofStep.js +2 -2
- package/lib/reference.js +9 -9
- package/lib/rule.js +5 -5
- package/lib/ruleNames.js +5 -5
- package/lib/statement/qualified.js +6 -3
- package/lib/statement.js +22 -39
- package/lib/supposition.js +75 -50
- package/lib/term.js +62 -16
- package/lib/topLevelAssertion.js +98 -33
- package/lib/type.js +22 -31
- package/lib/unifier/equality.js +12 -4
- package/lib/unifier/intrinsicLevel.js +1 -4
- package/lib/unifier/metaLevel.js +1 -4
- package/lib/unifier/metavariable.js +10 -7
- package/lib/unifier/statementWithCombinator.js +18 -9
- package/lib/unifier/termWithConstructor.js +11 -4
- package/lib/unify/frameWithMetaType.js +2 -2
- package/lib/utilities/name.js +9 -2
- package/lib/utilities/node.js +14 -14
- package/lib/utilities/tokens.js +7 -7
- package/lib/utilities/unify.js +3 -3
- package/lib/variable.js +155 -20
- package/lib/verifier/statementAsCombinator.js +2 -2
- package/lib/verifier/termAsConstructor.js +2 -2
- package/lib/verifier/topLevel.js +7 -7
- package/lib/verify/assertion/type.js +3 -4
- package/lib/verify/conjecture.js +2 -3
- package/lib/verify/frame.js +2 -6
- package/lib/verify/lemma.js +2 -3
- package/lib/verify/metaLemma.js +2 -3
- package/lib/verify/metatheorem.js +2 -3
- package/lib/verify/metavariableGivenMetaType.js +3 -3
- package/lib/verify/theorem.js +2 -3
- package/package.json +1 -1
- package/src/argument.js +11 -9
- package/src/assignment/equality.js +3 -4
- package/src/axiom.js +78 -1
- package/src/combinator.js +10 -9
- package/src/conclusion.js +2 -4
- package/src/consequent.js +88 -13
- package/src/constructor/bracketed.js +4 -1
- package/src/constructor.js +18 -14
- package/src/context/file.js +50 -93
- package/src/context/local.js +13 -31
- package/src/declaration/combinator.js +2 -2
- package/src/declaration/metavariable.js +20 -6
- package/src/declaration/type.js +2 -2
- package/src/declaration/variable.js +78 -0
- package/src/equality.js +123 -22
- package/src/index.js +6 -0
- package/src/label.js +7 -7
- package/src/lemma.js +91 -1
- package/src/metavariable.js +13 -22
- package/src/mixins/statement/qualified/unify.js +2 -2
- package/src/mixins/statement/verify.js +5 -5
- package/src/mixins/term/unify.js +110 -0
- package/src/mixins/term/verify.js +47 -0
- package/src/node/term/constructor/bracketed.js +4 -3
- package/src/premise.js +2 -5
- package/src/proofStep.js +1 -1
- package/src/reference.js +7 -7
- package/src/rule.js +4 -4
- package/src/ruleNames.js +1 -1
- package/src/statement/qualified.js +7 -3
- package/src/statement.js +28 -60
- package/src/supposition.js +106 -53
- package/src/term.js +70 -14
- package/src/topLevelAssertion.js +120 -33
- package/src/type.js +39 -41
- package/src/unifier/equality.js +15 -3
- package/src/unifier/intrinsicLevel.js +0 -4
- package/src/unifier/metaLevel.js +0 -4
- package/src/unifier/metavariable.js +16 -8
- package/src/unifier/statementWithCombinator.js +33 -11
- package/src/unifier/termWithConstructor.js +17 -4
- package/src/unify/frameWithMetaType.js +1 -1
- package/src/utilities/name.js +9 -1
- package/src/utilities/node.js +14 -14
- package/src/utilities/tokens.js +4 -4
- package/src/utilities/unify.js +2 -2
- package/src/variable.js +158 -22
- package/src/verifier/statementAsCombinator.js +1 -1
- package/src/verifier/termAsConstructor.js +1 -1
- package/src/verifier/topLevel.js +9 -6
- package/src/verify/assertion/type.js +1 -1
- package/src/verify/conjecture.js +1 -1
- package/src/verify/frame.js +1 -7
- package/src/verify/lemma.js +1 -1
- package/src/verify/metaLemma.js +1 -1
- package/src/verify/metatheorem.js +1 -1
- package/src/verify/metavariableGivenMetaType.js +2 -2
- package/src/verify/theorem.js +1 -1
- package/lib/tokens/constructorTerm/bracketed.js +0 -17
- package/lib/unify/termWithBracketedConstructor.js +0 -39
- package/lib/unify/termWithConstructor.js +0 -37
- package/lib/unify/termWithConstructors.js +0 -34
- package/lib/unify/termWithTerm.js +0 -27
- package/lib/unify/termWithType.js +0 -24
- package/lib/verify/axiom.js +0 -45
- package/lib/verify/consequent.js +0 -38
- package/lib/verify/declaration/variable.js +0 -67
- package/lib/verify/equality.js +0 -92
- package/lib/verify/proofStep.js +0 -28
- package/lib/verify/term.js +0 -97
- package/lib/verify/termAsConstructor.js +0 -58
- package/lib/verify/termGivenType.js +0 -34
- package/lib/verify/terms.js +0 -38
- package/lib/verify/type.js +0 -23
- package/lib/verify/variable.js +0 -25
- package/src/tokens/constructorTerm/bracketed.js +0 -10
- package/src/unify/termWithBracketedConstructor.js +0 -39
- package/src/unify/termWithConstructor.js +0 -39
- package/src/unify/termWithConstructors.js +0 -27
- package/src/unify/termWithTerm.js +0 -24
- package/src/unify/termWithType.js +0 -14
- package/src/verify/axiom.js +0 -56
- package/src/verify/consequent.js +0 -40
- package/src/verify/declaration/variable.js +0 -85
- package/src/verify/equality.js +0 -118
- package/src/verify/proofStep.js +0 -21
- package/src/verify/term.js +0 -123
- package/src/verify/termAsConstructor.js +0 -66
- package/src/verify/termGivenType.js +0 -32
- package/src/verify/terms.js +0 -38
- package/src/verify/type.js +0 -19
- package/src/verify/variable.js +0 -21
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Constructor from "../constructor";
|
|
4
|
-
import termAsConstructorVerifier from "../verifier/termAsConstructor";
|
|
5
|
-
|
|
6
|
-
import { first } from "../utilities/array";
|
|
7
|
-
|
|
8
|
-
export default function verifyTermAsConstructor(termNode, typeNode, fileContext) {
|
|
9
|
-
let termVerifiedAsConstructor = false;
|
|
10
|
-
|
|
11
|
-
const termString = fileContext.nodeAsString(termNode);
|
|
12
|
-
|
|
13
|
-
fileContext.debug(`Verifying the '${termString}' term as a constructor...`, termNode);
|
|
14
|
-
|
|
15
|
-
const types = [],
|
|
16
|
-
typeVerified = verifyType(typeNode, types, fileContext);
|
|
17
|
-
|
|
18
|
-
let type;
|
|
19
|
-
|
|
20
|
-
if (typeVerified) {
|
|
21
|
-
const firstType = first(types);
|
|
22
|
-
|
|
23
|
-
type = firstType; ///
|
|
24
|
-
|
|
25
|
-
termVerifiedAsConstructor = termAsConstructorVerifier.verifyTerm(termNode, fileContext);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (termVerifiedAsConstructor) {
|
|
29
|
-
const tokens = fileContext.getTokens(),
|
|
30
|
-
constructor = Constructor.fromTermNodeTypeAndTokens(termNode, type, tokens);
|
|
31
|
-
|
|
32
|
-
fileContext.addConstructor(constructor);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (termVerifiedAsConstructor) {
|
|
36
|
-
fileContext.debug(`...verified the '${termString}' term as a constructor.`, termNode);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return termVerifiedAsConstructor;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function verifyType(typeNode, types, fileContext) {
|
|
43
|
-
let typeVerified = false;
|
|
44
|
-
|
|
45
|
-
if (typeNode === null) {
|
|
46
|
-
const type = null;
|
|
47
|
-
|
|
48
|
-
types.push(type);
|
|
49
|
-
|
|
50
|
-
typeVerified = true;
|
|
51
|
-
} else {
|
|
52
|
-
const type = fileContext.findTypeByTypeNode(typeNode);
|
|
53
|
-
|
|
54
|
-
if (type !== null) {
|
|
55
|
-
types.push(type);
|
|
56
|
-
|
|
57
|
-
typeVerified = true;
|
|
58
|
-
} else {
|
|
59
|
-
const typeString = fileContext.nodeAsString(typeNode);
|
|
60
|
-
|
|
61
|
-
fileContext.debug(`The '${typeString}' type is not present.`, typeNode);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return typeVerified;
|
|
66
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import shim from "../shim";
|
|
4
|
-
|
|
5
|
-
import { first } from "../utilities/array";
|
|
6
|
-
|
|
7
|
-
export default function verifyTermGivenType(termNode, type, localContext) {
|
|
8
|
-
let termVerifiedGivenType = false;
|
|
9
|
-
|
|
10
|
-
if (type !== null) {
|
|
11
|
-
const { verifyTerm } = shim,
|
|
12
|
-
terms = [],
|
|
13
|
-
termVerified = verifyTerm(termNode, terms, localContext, () => {
|
|
14
|
-
let verifiedAhead = false;
|
|
15
|
-
|
|
16
|
-
const firstTerm = first(terms),
|
|
17
|
-
term = firstTerm, ///
|
|
18
|
-
termType = term.getType(),
|
|
19
|
-
termTypeEqualToOrSubTypeOfType = termType.isEqualToOrSubTypeOf(type);
|
|
20
|
-
|
|
21
|
-
if (termTypeEqualToOrSubTypeOfType) {
|
|
22
|
-
verifiedAhead = true;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return verifiedAhead;
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
termVerifiedGivenType = termVerified; ///
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return termVerifiedGivenType;
|
|
32
|
-
}
|
package/src/verify/terms.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import verifyTerm from "../verify/term";
|
|
4
|
-
|
|
5
|
-
import { first, second } from "../utilities/array";
|
|
6
|
-
|
|
7
|
-
export default function verifyTerms(termNodes, terms, localContext, verifyAhead) {
|
|
8
|
-
let termsVerified;
|
|
9
|
-
|
|
10
|
-
const firstTermNode = first(termNodes),
|
|
11
|
-
secondTermNode = second(termNodes),
|
|
12
|
-
firstTermString = localContext.nodeAsString(firstTermNode),
|
|
13
|
-
secondTermString = localContext.nodeAsString(secondTermNode);
|
|
14
|
-
|
|
15
|
-
localContext.trace(`Verifying the '${firstTermString}' and '${secondTermString}' terms...`, firstTermNode);
|
|
16
|
-
|
|
17
|
-
const firstTermVerified = verifyTerm(firstTermNode, terms, localContext, () => {
|
|
18
|
-
let verifiedAhead;
|
|
19
|
-
|
|
20
|
-
const secondTermVerified = verifyTerm(secondTermNode, terms, localContext, () => {
|
|
21
|
-
const verifiedAhead = verifyAhead();
|
|
22
|
-
|
|
23
|
-
return verifiedAhead;
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
verifiedAhead = secondTermVerified; ///
|
|
27
|
-
|
|
28
|
-
return verifiedAhead;
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
termsVerified = firstTermVerified; ///
|
|
32
|
-
|
|
33
|
-
if (termsVerified) {
|
|
34
|
-
localContext.debug(`...verified the '${firstTermString}' and '${secondTermString}' terms.`, firstTermNode);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return termsVerified
|
|
38
|
-
}
|
package/src/verify/type.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
export default function verifyType(typeNode, localContext) {
|
|
4
|
-
let typeVerified;
|
|
5
|
-
|
|
6
|
-
const typeString = localContext.nodeAsString(typeNode);
|
|
7
|
-
|
|
8
|
-
localContext.trace(`Verifying the '${typeString}' type...`, typeNode);
|
|
9
|
-
|
|
10
|
-
const typePresent = localContext.isTypePresentByTypeNode(typeNode);
|
|
11
|
-
|
|
12
|
-
typeVerified = typePresent; ///
|
|
13
|
-
|
|
14
|
-
if (typeVerified) {
|
|
15
|
-
localContext.debug(`...verified the '${typeString}' type.`, typeNode);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return typeVerified;
|
|
19
|
-
}
|
package/src/verify/variable.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
export default function verifyVariable(variableNode, localContext) {
|
|
4
|
-
let variableVerified = false;
|
|
5
|
-
|
|
6
|
-
const variableString = localContext.nodeAsString(variableNode);
|
|
7
|
-
|
|
8
|
-
localContext.trace(`Verifying the '${variableString}' variable...`, variableNode);
|
|
9
|
-
|
|
10
|
-
const variablePresent = localContext.isVariablePresentByVariableNode(variableNode);
|
|
11
|
-
|
|
12
|
-
if (variablePresent) {
|
|
13
|
-
variableVerified = true;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (variableVerified) {
|
|
17
|
-
localContext.debug(`...verified the '${variableString}' variable.`, variableNode);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return variableVerified;
|
|
21
|
-
}
|