occam-verify-cli 0.0.1067 → 0.0.1069
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 +3 -2
- package/lib/assertion/contained.js +2 -2
- package/lib/assertion/defined.js +2 -2
- package/lib/assertion/subproof.js +3 -3
- package/lib/assignment/judgement.js +3 -3
- package/lib/axiom.js +11 -6
- package/lib/combinator.js +9 -9
- package/lib/conclusion.js +13 -10
- package/lib/conjecture.js +11 -6
- package/lib/consequent.js +13 -10
- package/lib/constructor.js +9 -9
- package/lib/context/file.js +34 -126
- package/lib/context/local.js +16 -5
- package/lib/context/release.js +2 -3
- package/lib/declaration.js +96 -2
- package/lib/equivalence.js +2 -2
- package/lib/frame.js +179 -98
- package/lib/index.js +22 -6
- package/lib/judgement.js +84 -5
- package/lib/label.js +12 -8
- package/lib/lemma.js +12 -12
- package/lib/metaLemma.js +120 -8
- package/lib/metaType.js +24 -3
- package/lib/metatheorem.js +145 -9
- package/lib/metavariable.js +128 -43
- package/lib/mixins/statement/qualified/unify.js +6 -10
- package/lib/mixins/statement/unify.js +4 -19
- package/lib/mixins/statement/verify.js +13 -13
- package/lib/mixins/term/unify.js +2 -2
- package/lib/premise.js +21 -13
- package/lib/reference.js +17 -17
- package/lib/rule.js +28 -40
- package/lib/statement/unqualified.js +34 -9
- package/lib/statement.js +7 -5
- package/lib/substitution/frameForMetavariable.js +75 -70
- package/lib/substitution/statementForMetavariable.js +83 -42
- package/lib/substitution/termForVariable.js +65 -68
- package/lib/substitution.js +46 -43
- package/lib/substitutions.js +52 -40
- package/lib/supposition.js +15 -11
- package/lib/term.js +6 -11
- package/lib/theorem.js +11 -6
- package/lib/topLevelAssertion.js +24 -42
- package/lib/type.js +5 -12
- package/lib/unifier/intrinsicLevel.js +4 -4
- package/lib/unifier/metaLevel.js +11 -7
- package/lib/unifier/metavariable.js +6 -6
- package/lib/unifier/statementWithCombinator.js +16 -16
- package/lib/unifier/termWithConstructor.js +7 -7
- package/lib/utilities/brackets.js +10 -10
- package/lib/utilities/json.js +493 -0
- package/lib/utilities/node.js +26 -19
- package/lib/utilities/release.js +53 -0
- package/lib/utilities/releaseContext.js +4 -15
- package/lib/utilities/tokens.js +8 -1
- package/lib/variable.js +14 -15
- package/lib/verifier/topLevel.js +5 -5
- package/package.json +1 -1
- package/src/assertion/contained.js +1 -1
- package/src/assertion/defined.js +1 -1
- package/src/assertion/subproof.js +2 -3
- package/src/assignment/judgement.js +3 -4
- package/src/axiom.js +14 -6
- package/src/combinator.js +12 -13
- package/src/conclusion.js +16 -13
- package/src/conjecture.js +14 -6
- package/src/consequent.js +16 -13
- package/src/constructor.js +11 -13
- package/src/context/file.js +94 -202
- package/src/context/local.js +8 -6
- package/src/context/release.js +2 -3
- package/src/declaration.js +126 -45
- package/src/equivalence.js +2 -2
- package/src/frame.js +225 -141
- package/src/index.js +17 -1
- package/src/judgement.js +109 -3
- package/src/label.js +15 -10
- package/src/lemma.js +17 -10
- package/src/metaLemma.js +102 -1
- package/src/metaType.js +29 -3
- package/src/metatheorem.js +143 -2
- package/src/metavariable.js +189 -66
- package/src/mixins/statement/qualified/unify.js +7 -19
- package/src/mixins/statement/unify.js +3 -25
- package/src/mixins/statement/verify.js +15 -13
- package/src/mixins/term/unify.js +1 -1
- package/src/premise.js +31 -16
- package/src/reference.js +18 -18
- package/src/rule.js +40 -58
- package/src/statement/unqualified.js +41 -11
- package/src/statement.js +6 -3
- package/src/substitution/frameForMetavariable.js +85 -98
- package/src/substitution/statementForMetavariable.js +109 -45
- package/src/substitution/termForVariable.js +83 -94
- package/src/substitution.js +36 -34
- package/src/substitutions.js +53 -46
- package/src/supposition.js +22 -14
- package/src/term.js +5 -15
- package/src/theorem.js +14 -6
- package/src/topLevelAssertion.js +38 -64
- package/src/type.js +5 -20
- package/src/unifier/intrinsicLevel.js +4 -3
- package/src/unifier/metaLevel.js +19 -7
- package/src/unifier/metavariable.js +5 -5
- package/src/unifier/statementWithCombinator.js +19 -19
- package/src/unifier/termWithConstructor.js +7 -7
- package/src/utilities/brackets.js +5 -5
- package/src/utilities/json.js +551 -0
- package/src/utilities/node.js +28 -23
- package/src/{verify → utilities}/release.js +5 -1
- package/src/utilities/releaseContext.js +2 -2
- package/src/utilities/tokens.js +10 -0
- package/src/variable.js +18 -19
- package/src/verifier/topLevel.js +6 -4
- package/lib/argument.js +0 -106
- package/lib/metaTypes.js +0 -19
- package/lib/unify/metavariableWithFrame.js +0 -40
- package/lib/unify/simpleSubstitutionStatementWithComplexSubstitutionStatement.js +0 -31
- package/lib/unify/statementWithSttaemetnGivenEquivalences.js +0 -45
- package/lib/verify/declaration.js +0 -83
- package/lib/verify/frame.js +0 -120
- package/lib/verify/judgement.js +0 -88
- package/lib/verify/metaLemma.js +0 -49
- package/lib/verify/metatheorem.js +0 -48
- package/lib/verify/metavariableGivenMetaType.js +0 -44
- package/lib/verify/release.js +0 -50
- package/src/argument.js +0 -79
- package/src/metaTypes.js +0 -11
- package/src/unify/metavariableWithFrame.js +0 -40
- package/src/unify/simpleSubstitutionStatementWithComplexSubstitutionStatement.js +0 -27
- package/src/unify/statementWithSttaemetnGivenEquivalences.js +0 -51
- package/src/verify/declaration.js +0 -113
- package/src/verify/frame.js +0 -157
- package/src/verify/judgement.js +0 -127
- package/src/verify/metaLemma.js +0 -72
- package/src/verify/metatheorem.js +0 -67
- package/src/verify/metavariableGivenMetaType.js +0 -45
|
@@ -13,11 +13,11 @@ const termNodeQuery = nodeQuery("/term!"),
|
|
|
13
13
|
statementNodeQuery = nodeQuery("/statement!");
|
|
14
14
|
|
|
15
15
|
class StatementWithCombinatorUnifier extends Unifier {
|
|
16
|
-
unify(
|
|
16
|
+
unify(combinatorStatementNode, statementNode, assignments, stated, localContext) {
|
|
17
17
|
let statementUnifiedWithCombinator;
|
|
18
18
|
|
|
19
|
-
const nonTerminalNodeA =
|
|
20
|
-
nonTerminalNodeB =
|
|
19
|
+
const nonTerminalNodeA = combinatorStatementNode, ///
|
|
20
|
+
nonTerminalNodeB = statementNode, ///
|
|
21
21
|
nonTerminalNodeUnified = this.unifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, assignments, stated, localContext);
|
|
22
22
|
|
|
23
23
|
statementUnifiedWithCombinator = nonTerminalNodeUnified; ///
|
|
@@ -27,14 +27,14 @@ class StatementWithCombinatorUnifier extends Unifier {
|
|
|
27
27
|
|
|
28
28
|
static maps = [
|
|
29
29
|
{
|
|
30
|
-
nodeQueryA:
|
|
31
|
-
nodeQueryB:
|
|
32
|
-
unify: (
|
|
30
|
+
nodeQueryA: metaTypeNodeQuery,
|
|
31
|
+
nodeQueryB: statementNodeQuery,
|
|
32
|
+
unify: (metaTypeNodeA, statementNodeB, assignments, stated, localContext) => {
|
|
33
33
|
let unified;
|
|
34
34
|
|
|
35
35
|
const { Statement, MetaType } = shim,
|
|
36
|
-
metaTypeNode =
|
|
37
|
-
statementNode =
|
|
36
|
+
metaTypeNode = metaTypeNodeA, ///
|
|
37
|
+
statementNode = statementNodeB, ///
|
|
38
38
|
metaType = MetaType.fromMetaTypeNode(metaTypeNode, localContext),
|
|
39
39
|
statement = Statement.fromStatementNode(statementNode, localContext),
|
|
40
40
|
statementVerifiedGivenType = statement.verifyGivenMetaType(metaType, assignments, stated, localContext);
|
|
@@ -45,17 +45,17 @@ class StatementWithCombinatorUnifier extends Unifier {
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
nodeQueryA:
|
|
49
|
-
nodeQueryB:
|
|
50
|
-
unify: (
|
|
48
|
+
nodeQueryA: metaTypeNodeQuery,
|
|
49
|
+
nodeQueryB: frameNodeQuery,
|
|
50
|
+
unify: (metaTypeNodeA, frameNodeB, assignments, stated, localContext) => {
|
|
51
51
|
let unified;
|
|
52
52
|
|
|
53
53
|
const { Frame, MetaType } = shim,
|
|
54
|
-
metaTypeNode =
|
|
55
|
-
frameNode =
|
|
54
|
+
metaTypeNode = metaTypeNodeA, ///
|
|
55
|
+
frameNode = frameNodeB, ///
|
|
56
56
|
metaType = MetaType.fromMetaTypeNode(metaTypeNode, localContext),
|
|
57
57
|
frame = Frame.fromFrameNode(frameNode, localContext),
|
|
58
|
-
frameVerifiedGivenType = frame.verifyGivenMetaType(metaType, localContext);
|
|
58
|
+
frameVerifiedGivenType = frame.verifyGivenMetaType(metaType, assignments, stated, localContext);
|
|
59
59
|
|
|
60
60
|
unified = frameVerifiedGivenType;
|
|
61
61
|
|
|
@@ -63,18 +63,18 @@ class StatementWithCombinatorUnifier extends Unifier {
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
nodeQueryA:
|
|
67
|
-
nodeQueryB:
|
|
68
|
-
unify: (
|
|
66
|
+
nodeQueryA: typeNodeQuery,
|
|
67
|
+
nodeQueryB: termNodeQuery,
|
|
68
|
+
unify: (typeNodeA, termNodeB, assignments, stated, localContext) => {
|
|
69
69
|
let unified = false;
|
|
70
70
|
|
|
71
71
|
const { Term } = shim,
|
|
72
|
-
typeNode =
|
|
72
|
+
typeNode = typeNodeA, ///
|
|
73
73
|
typeName = typeNameFromTypeNode(typeNode),
|
|
74
74
|
type = localContext.findTypeByTypeName(typeName);
|
|
75
75
|
|
|
76
76
|
if (type !== null) {
|
|
77
|
-
const termNode =
|
|
77
|
+
const termNode = termNodeB, ///
|
|
78
78
|
term = Term.fromTermNode(termNode, localContext),
|
|
79
79
|
termVerifiedGivenType = term.verifyGivenType(type, localContext);
|
|
80
80
|
|
|
@@ -10,11 +10,11 @@ const termNodeQuery = nodeQuery("/term"),
|
|
|
10
10
|
typeNodeQuery = nodeQuery("/type");
|
|
11
11
|
|
|
12
12
|
class TermWithConstructorUnifier extends Unifier {
|
|
13
|
-
unify(
|
|
13
|
+
unify(constructorTermNode, termNode, localContext) {
|
|
14
14
|
let termUnifiedWithConstructor;
|
|
15
15
|
|
|
16
|
-
const nonTerminalNodeA =
|
|
17
|
-
nonTerminalNodeB =
|
|
16
|
+
const nonTerminalNodeA = constructorTermNode, ///
|
|
17
|
+
nonTerminalNodeB = termNode, ///
|
|
18
18
|
nonTerminalNodeUnified = this.unifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, localContext);
|
|
19
19
|
|
|
20
20
|
termUnifiedWithConstructor = nonTerminalNodeUnified; ///
|
|
@@ -24,9 +24,9 @@ class TermWithConstructorUnifier extends Unifier {
|
|
|
24
24
|
|
|
25
25
|
static maps = [
|
|
26
26
|
{
|
|
27
|
-
nodeQueryA:
|
|
28
|
-
nodeQueryB:
|
|
29
|
-
unify: (
|
|
27
|
+
nodeQueryA: typeNodeQuery,
|
|
28
|
+
nodeQueryB: termNodeQuery,
|
|
29
|
+
unify: (typeNodeB, termNodeB, localContext) => {
|
|
30
30
|
let unified = false;
|
|
31
31
|
|
|
32
32
|
const { Term } = shim,
|
|
@@ -35,7 +35,7 @@ class TermWithConstructorUnifier extends Unifier {
|
|
|
35
35
|
type = localContext.findTypeByTypeName(typeName);
|
|
36
36
|
|
|
37
37
|
if (type !== null) {
|
|
38
|
-
const termNode =
|
|
38
|
+
const termNode = termNodeB, ///
|
|
39
39
|
term = Term.fromTermNode(termNode, localContext),
|
|
40
40
|
termVerifiedGivenType = term.verifyGivenType(type, localContext);
|
|
41
41
|
|
|
@@ -8,17 +8,17 @@ import { BRACKETED_TERM_DEPTH, BRACKETED_STATEMENT_DEPTH } from "../constants";
|
|
|
8
8
|
const bracketedTermChildNodeQuery = nodeQuery("/term/argument/term!"),
|
|
9
9
|
bracketedStatementChildNodeQuery = nodeQuery("/statement/metaArgument/statement!");
|
|
10
10
|
|
|
11
|
-
export function
|
|
12
|
-
const bracketedTermChildNode = bracketedTermChildNodeFromTermNode(
|
|
11
|
+
export function stripBracketsFromTermNode(termNode) {
|
|
12
|
+
const bracketedTermChildNode = bracketedTermChildNodeFromTermNode(termNode);
|
|
13
13
|
|
|
14
14
|
if (bracketedTermChildNode !== null) {
|
|
15
|
-
|
|
15
|
+
termNode = bracketedTermChildNode; ///
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
return
|
|
18
|
+
return termNode;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export function
|
|
21
|
+
export function stripBracketsFromStatementNode(statementNode) {
|
|
22
22
|
const bracketedStatementChildNode = bracketedStatementChildNodeFromStatementNode(statementNode);
|
|
23
23
|
|
|
24
24
|
if (bracketedStatementChildNode !== null) {
|
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import shim from "../shim";
|
|
4
|
+
|
|
5
|
+
export function termFromJSON(json, fileContext) {
|
|
6
|
+
let { term } = json;
|
|
7
|
+
|
|
8
|
+
const termJSON = term; ///
|
|
9
|
+
|
|
10
|
+
json = termJSON; ///
|
|
11
|
+
|
|
12
|
+
const { Term } = shim;
|
|
13
|
+
|
|
14
|
+
term = Term.fromJSON(json, fileContext);
|
|
15
|
+
|
|
16
|
+
return term;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function typeFromJSON(json, fileContext) {
|
|
20
|
+
let { type } = json;
|
|
21
|
+
|
|
22
|
+
const { name } = type,
|
|
23
|
+
typeName = name; ///
|
|
24
|
+
|
|
25
|
+
type = fileContext.findTypeByTypeName(typeName);
|
|
26
|
+
|
|
27
|
+
return type;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function metaTypeFromJSON(json, fileContext) {
|
|
31
|
+
let { metaType } = json;
|
|
32
|
+
|
|
33
|
+
if (metaType !== null) {
|
|
34
|
+
const { name } = metaType,
|
|
35
|
+
metaTypeName = name; ///
|
|
36
|
+
|
|
37
|
+
metaType = fileContext.findMetaTypeByMetaTypeName(metaTypeName);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return metaType;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function superTypeFromJSON(json, fileContext) {
|
|
44
|
+
let { superType } = json;
|
|
45
|
+
|
|
46
|
+
const superTypeJSON = superType; ///
|
|
47
|
+
|
|
48
|
+
json = superTypeJSON; ///
|
|
49
|
+
|
|
50
|
+
const { name } = json,
|
|
51
|
+
typeName = name, ///
|
|
52
|
+
type = fileContext.findTypeByTypeName(typeName);
|
|
53
|
+
|
|
54
|
+
superType = type; ///
|
|
55
|
+
|
|
56
|
+
return superType;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function statementFromJSON(json, fileContext) {
|
|
60
|
+
let { statement } = json;
|
|
61
|
+
|
|
62
|
+
const { Statement } = shim,
|
|
63
|
+
statementJSON = statement; ///
|
|
64
|
+
|
|
65
|
+
json = statementJSON; ///
|
|
66
|
+
|
|
67
|
+
statement = Statement.fromJSON(json, fileContext);
|
|
68
|
+
|
|
69
|
+
return statement;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function conclusionFromJSON(json, fileContext) {
|
|
73
|
+
let { conclusion } = json;
|
|
74
|
+
|
|
75
|
+
const { Conclusion } = shim,
|
|
76
|
+
conclusionJSON = conclusion; ///
|
|
77
|
+
|
|
78
|
+
json = conclusionJSON; ///
|
|
79
|
+
|
|
80
|
+
conclusion = Conclusion.fromJSON(json, fileContext);
|
|
81
|
+
|
|
82
|
+
return conclusion;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function consequentFromJSON(json, fileContext) {
|
|
86
|
+
let { consequent } = json;
|
|
87
|
+
|
|
88
|
+
const { Consequent } = shim,
|
|
89
|
+
consequentJSON = consequent; ///
|
|
90
|
+
|
|
91
|
+
json = consequentJSON; ///
|
|
92
|
+
|
|
93
|
+
consequent = Consequent.fromJSON(json, fileContext);
|
|
94
|
+
|
|
95
|
+
return consequent;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function metavariableFromJSON(json, fileContext) {
|
|
99
|
+
let { metavariable } = json;
|
|
100
|
+
|
|
101
|
+
const { Metavariable } = shim,
|
|
102
|
+
metavariableJSON = metavariable; ///
|
|
103
|
+
|
|
104
|
+
json = metavariableJSON; ///
|
|
105
|
+
|
|
106
|
+
metavariable = Metavariable.fromJSON(json, fileContext);
|
|
107
|
+
|
|
108
|
+
return metavariable;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function unqualifiedStatementFromJSON(json, fileContext) {
|
|
112
|
+
let { unqualifiedStatement } = json;
|
|
113
|
+
|
|
114
|
+
const { UnqualifiedStatement } = shim,
|
|
115
|
+
unqualifiedStatementJSON = unqualifiedStatement; ///
|
|
116
|
+
|
|
117
|
+
json = unqualifiedStatementJSON; ///
|
|
118
|
+
|
|
119
|
+
unqualifiedStatement = UnqualifiedStatement.fromJSON(json, fileContext);
|
|
120
|
+
|
|
121
|
+
return unqualifiedStatement;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function typesFromJSON(json, fileContext) {
|
|
125
|
+
let { types } = json;
|
|
126
|
+
|
|
127
|
+
const typesJSON = types; ///
|
|
128
|
+
types = typesJSON.map((typeJSON) => {
|
|
129
|
+
const { Type } = shim,
|
|
130
|
+
json = typeJSON, ///
|
|
131
|
+
type = Type.fromJSON(json, fileContext);
|
|
132
|
+
|
|
133
|
+
return (type);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
return types;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function rulesFromJSON(json, fileContext) {
|
|
140
|
+
let { rules } = json;
|
|
141
|
+
|
|
142
|
+
const rulesJSON = rules; ///
|
|
143
|
+
rules = rulesJSON.map((ruleJSON) => {
|
|
144
|
+
const { Rule } = shim,
|
|
145
|
+
json = ruleJSON, ///
|
|
146
|
+
rule = Rule.fromJSON(json, fileContext);
|
|
147
|
+
|
|
148
|
+
return (rule);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
return rules;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function labelsFromJSON(json, fileContext) {
|
|
155
|
+
let { labels } = json;
|
|
156
|
+
|
|
157
|
+
const { Label } = shim,
|
|
158
|
+
labelsJSON = labels; ///
|
|
159
|
+
|
|
160
|
+
labels = labelsJSON.map((labelJSON) => {
|
|
161
|
+
const json = labelJSON, ///
|
|
162
|
+
label = Label.fromJSON(json, fileContext);
|
|
163
|
+
|
|
164
|
+
return label;
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
return labels;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export function axiomsFromJSON(json, fileContext) {
|
|
171
|
+
let { axioms } = json;
|
|
172
|
+
|
|
173
|
+
const axiomsJSON = axioms; ///
|
|
174
|
+
axioms = axiomsJSON.map((axiomJSON) => {
|
|
175
|
+
const { Axiom } = shim,
|
|
176
|
+
json = axiomJSON, ///
|
|
177
|
+
axiom = Axiom.fromJSON(json, fileContext);
|
|
178
|
+
|
|
179
|
+
return (axiom);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
return axioms;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function premisesFromJSON(json, fileContext) {
|
|
186
|
+
let { premises } = json;
|
|
187
|
+
|
|
188
|
+
const { Premise } = shim,
|
|
189
|
+
premisesJSON = premises; ///
|
|
190
|
+
|
|
191
|
+
premises = premisesJSON.map((premiseJSON) => {
|
|
192
|
+
const json = premiseJSON, ///
|
|
193
|
+
premise = Premise.fromJSON(json, fileContext);
|
|
194
|
+
|
|
195
|
+
return premise;
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
return premises;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export function theoremsFromJSON(json, fileContext) {
|
|
202
|
+
let { theorems } = json;
|
|
203
|
+
|
|
204
|
+
const theoremsJSON = theorems; ///
|
|
205
|
+
theorems = theoremsJSON.map((theoremJSON) => {
|
|
206
|
+
const { Theorem } = shim,
|
|
207
|
+
json = theoremJSON, ///
|
|
208
|
+
theorem = Theorem.fromJSON(json, fileContext);
|
|
209
|
+
|
|
210
|
+
return (theorem);
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
return theorems;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function variablesFromJSON(json, fileContext) {
|
|
217
|
+
let { variables } = json;
|
|
218
|
+
|
|
219
|
+
const variablesJSON = variables; ///
|
|
220
|
+
variables = variablesJSON.map((variableJSON) => {
|
|
221
|
+
const { Variable } = shim,
|
|
222
|
+
json = variableJSON, ///
|
|
223
|
+
variable = Variable.fromJSON(json, fileContext);
|
|
224
|
+
|
|
225
|
+
return (variable);
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
return variables;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export function conjecturesFromJSON(json, fileContext) {
|
|
232
|
+
let { conjectures } = json;
|
|
233
|
+
|
|
234
|
+
const conjecturesJSON = conjectures; ///
|
|
235
|
+
conjectures = conjecturesJSON.map((conjectureJSON) => {
|
|
236
|
+
const { Conjecture } = shim,
|
|
237
|
+
json = conjectureJSON, ///
|
|
238
|
+
conjecture = Conjecture.fromJSON(json, fileContext);
|
|
239
|
+
|
|
240
|
+
return (conjecture);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
return conjectures;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function combinatorsFromJSON(json, fileContext) {
|
|
247
|
+
let { combinators } = json;
|
|
248
|
+
|
|
249
|
+
const combinatorsJSON = combinators; ///
|
|
250
|
+
combinators = combinatorsJSON.map((combinatorJSON) => {
|
|
251
|
+
const { Combinator } = shim,
|
|
252
|
+
json = combinatorJSON, ///
|
|
253
|
+
combinator = Combinator.fromJSON(json, fileContext);
|
|
254
|
+
|
|
255
|
+
return (combinator);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
return combinators;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function constructorsFromJSON(json, fileContext) {
|
|
262
|
+
let { constructors } = json;
|
|
263
|
+
|
|
264
|
+
const constructorsJSON = constructors; ///
|
|
265
|
+
constructors = constructorsJSON.map((constructorJSON) => {
|
|
266
|
+
const { Constructor } = shim,
|
|
267
|
+
json = constructorJSON, ///
|
|
268
|
+
constructor = Constructor.fromJSON(json, fileContext);
|
|
269
|
+
|
|
270
|
+
return (constructor);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
return constructors;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export function metatheoremsFromJSON(json, fileContext) {
|
|
277
|
+
let { metatheorems } = json;
|
|
278
|
+
|
|
279
|
+
const metatheoremsJSON = metatheorems; ///
|
|
280
|
+
metatheorems = metatheoremsJSON.map((metatheoremJSON) => {
|
|
281
|
+
const { Metatheorem } = shim,
|
|
282
|
+
json = metatheoremJSON, ///
|
|
283
|
+
metatheorem = Metatheorem.fromJSON(json, fileContext);
|
|
284
|
+
|
|
285
|
+
return (metatheorem);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
return metatheorems;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export function suppositionsFromJSON(json, fileContext) {
|
|
292
|
+
let { suppositions } = json;
|
|
293
|
+
|
|
294
|
+
const { Supposition } = shim,
|
|
295
|
+
suppositionsJSON = suppositions; ///
|
|
296
|
+
|
|
297
|
+
suppositions = suppositionsJSON.map((suppositionJSON) => {
|
|
298
|
+
const json = suppositionJSON, ///
|
|
299
|
+
supposition = Supposition.fromJSON(json, fileContext);
|
|
300
|
+
|
|
301
|
+
return supposition;
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
return suppositions;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export function substitutionsFromJSON(json, fileContext) {
|
|
308
|
+
let { substitutions } = json;
|
|
309
|
+
|
|
310
|
+
const { Substitution } = shim,
|
|
311
|
+
substitutionsJSON = substitutions; ///
|
|
312
|
+
|
|
313
|
+
substitutions = substitutionsJSON.map((substitutionJSON) => {
|
|
314
|
+
const json = substitutionJSON, ///
|
|
315
|
+
substitution = Substitution.fromJSON(json, fileContext);
|
|
316
|
+
|
|
317
|
+
return substitution;
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
return substitutions;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export function metavariablesFromJSON(json, fileContext) {
|
|
324
|
+
let { metavariables } = json;
|
|
325
|
+
|
|
326
|
+
const metavariablesJSON = metavariables; ///
|
|
327
|
+
metavariables = metavariablesJSON.map((metavariableJSON) => {
|
|
328
|
+
const { Metavariable } = shim,
|
|
329
|
+
json = metavariableJSON, ///
|
|
330
|
+
metavariable = Metavariable.fromJSON(json, fileContext);
|
|
331
|
+
|
|
332
|
+
return (metavariable);
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
return metavariables;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export function termToTermJSON(term) {
|
|
339
|
+
const termJSON = term.toJSON();
|
|
340
|
+
|
|
341
|
+
return termJSON;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export function typeToTypeJSON(type) {
|
|
345
|
+
const typeJSON = type.toJSON();
|
|
346
|
+
|
|
347
|
+
return typeJSON;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export function metaTypeToMetaTypeJSON(metaType) {
|
|
351
|
+
const metaTypeJSON = (metaType !== null) ?
|
|
352
|
+
metaType.toJSON() :
|
|
353
|
+
null;
|
|
354
|
+
return metaTypeJSON;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export function superTypeToSuperTypeJSON(superType) {
|
|
358
|
+
const superTypeJSON = superType.toJSON();
|
|
359
|
+
|
|
360
|
+
return superTypeJSON;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export function statementToStatementJSON(statement) {
|
|
364
|
+
const statementJSON = statement.toJSNO();
|
|
365
|
+
|
|
366
|
+
return statementJSON;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export function conclusionToConclusionJSON(conclusion) {
|
|
370
|
+
const conclusionJSON = conclusion.toJSON();
|
|
371
|
+
|
|
372
|
+
return conclusionJSON;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export function consequentToConsequentJSON(consequent) {
|
|
376
|
+
const consequentJSON = consequent.toJSON();
|
|
377
|
+
|
|
378
|
+
return consequentJSON;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export function metavariableToMetavariableJSON(metavariable) {
|
|
382
|
+
const metavariableJSON = metavariable.toJSNO();
|
|
383
|
+
|
|
384
|
+
return metavariableJSON;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export function unqualifiedStatementToUnqualifiedStatementJSON(unqualifiedStatement) {
|
|
388
|
+
const unqualifiedStatementJSON = unqualifiedStatement.toJSNO();
|
|
389
|
+
|
|
390
|
+
return unqualifiedStatementJSON;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export function typesToTypesJSON(types) {
|
|
394
|
+
const typesJSON = types.map((type) => {
|
|
395
|
+
const typeJSON = type.toJSON();
|
|
396
|
+
|
|
397
|
+
type = typeJSON; ///
|
|
398
|
+
|
|
399
|
+
return type;
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
return typesJSON;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export function rulesToRulesJSON(rules) {
|
|
406
|
+
const rulesJSON = rules.map((rule) => {
|
|
407
|
+
const ruleJSON = rule.toJSON();
|
|
408
|
+
|
|
409
|
+
rule = ruleJSON; ///
|
|
410
|
+
|
|
411
|
+
return rule;
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
return rulesJSON;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export function labelsToLabelsJSON(labels) {
|
|
418
|
+
const labelsJSON = labels.map((label) => {
|
|
419
|
+
const labelJSON = label.toJSON();
|
|
420
|
+
|
|
421
|
+
return labelJSON;
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
return labelsJSON;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export function axiomsToAxiomsJSON(axioms) {
|
|
428
|
+
const axiomsJSON = axioms.map((axiom) => {
|
|
429
|
+
const axiomJSON = axiom.toJSON();
|
|
430
|
+
|
|
431
|
+
axiom = axiomJSON; ///
|
|
432
|
+
|
|
433
|
+
return axiom;
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
return axiomsJSON;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
export function premisesToPremisesJSON(premises) {
|
|
440
|
+
const premisesJSON = premises.map((premise) => {
|
|
441
|
+
const premiseJSON = premise.toJSON();
|
|
442
|
+
|
|
443
|
+
return premiseJSON;
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
return premisesJSON;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export function theoremsToTheoremsJSON(theorems) {
|
|
450
|
+
const theoremsJSON = theorems.map((theorem) => {
|
|
451
|
+
const theoremJSON = theorem.toJSON();
|
|
452
|
+
|
|
453
|
+
theorem = theoremJSON; ///
|
|
454
|
+
|
|
455
|
+
return theorem;
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
return theoremsJSON;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export function variablesToVariablesJSON(variables) {
|
|
462
|
+
const variablesJSON = variables.map((variable) => {
|
|
463
|
+
const variableJSON = variable.toJSON();
|
|
464
|
+
|
|
465
|
+
variable = variableJSON; ///
|
|
466
|
+
|
|
467
|
+
return variable;
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
return variablesJSON;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export function conjecturesToConjecturesJSON(conjectures) {
|
|
474
|
+
const conjecturesJSON = conjectures.map((conjecture) => {
|
|
475
|
+
const conjectureJSON = conjecture.toJSON();
|
|
476
|
+
|
|
477
|
+
conjecture = conjectureJSON; ///
|
|
478
|
+
|
|
479
|
+
return conjecture;
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
return conjecturesJSON;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export function combinatorsToCombinatorsJSON(combinators) {
|
|
486
|
+
const combinatorsJSON = combinators.map((combinator) => {
|
|
487
|
+
const combinatorJSON = combinator.toJSON();
|
|
488
|
+
|
|
489
|
+
combinator = combinatorJSON; ///
|
|
490
|
+
|
|
491
|
+
return combinator;
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
return combinatorsJSON;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export function suppositionsToSuppositionsJSON(suppositions) {
|
|
498
|
+
const suppositionsJSON = suppositions.map((supposition) => {
|
|
499
|
+
const suppositionJSON = supposition.toJSON();
|
|
500
|
+
|
|
501
|
+
return suppositionJSON;
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
return suppositionsJSON;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
export function constructorsToConstructorsJSON(constructors) {
|
|
508
|
+
const constructorsJSON = constructors.map((constructor) => {
|
|
509
|
+
const constructorJSON = constructor.toJSON();
|
|
510
|
+
|
|
511
|
+
constructor = constructorJSON; ///
|
|
512
|
+
|
|
513
|
+
return constructor;
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
return constructorsJSON;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export function metatheoremsToMetatheoremsJSON(metatheorems) {
|
|
520
|
+
const metatheoremsJSON = metatheorems.map((metatheorem) => {
|
|
521
|
+
const metatheoremJSON = metatheorem.toJSON();
|
|
522
|
+
|
|
523
|
+
metatheorem = metatheoremJSON; ///
|
|
524
|
+
|
|
525
|
+
return metatheorem;
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
return metatheoremsJSON;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export function substitutionsToSubstitutionsJSON(substitutions) {
|
|
532
|
+
const substitutionsJSON = substitutions.mapSubstitution((substitution) => {
|
|
533
|
+
const substitutionJSON = substitution.toJSON();
|
|
534
|
+
|
|
535
|
+
return substitutionJSON;
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
return substitutionsJSON;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
export function metavariablesToMetavariablesJSON(metavariables) {
|
|
542
|
+
const metavariablesJSON = metavariables.map((metavariable) => {
|
|
543
|
+
const metavariableJSON = metavariable.toJSON();
|
|
544
|
+
|
|
545
|
+
metavariable = metavariableJSON; ///
|
|
546
|
+
|
|
547
|
+
return metavariable;
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
return metavariablesJSON;
|
|
551
|
+
}
|