occam-verify-cli 1.0.448 → 1.0.472
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/constants.js +13 -5
- package/lib/context/ephemeral.js +270 -0
- package/lib/context/file.js +136 -128
- package/lib/context/liminal.js +120 -0
- package/lib/context/literal.js +92 -0
- package/lib/context/nominal.js +15 -1
- package/lib/context/release.js +68 -9
- package/lib/context/scoped.js +322 -0
- package/lib/context/synthetic.js +133 -0
- package/lib/element/assertion/contained.js +66 -66
- package/lib/element/assertion/defined.js +32 -32
- package/lib/element/assertion/property.js +39 -39
- package/lib/element/assertion/satisfies.js +22 -22
- package/lib/element/assumption.js +71 -87
- package/lib/element/combinator/bracketed.js +1 -10
- package/lib/element/conclusion.js +19 -15
- package/lib/element/constructor/bracketed.js +1 -10
- package/lib/element/constructor.js +2 -2
- package/lib/element/declaration/combinator.js +1 -2
- package/lib/element/declaration/metavariable.js +3 -3
- package/lib/element/declaration/variable.js +3 -3
- package/lib/element/deduction.js +26 -20
- package/lib/element/derivation.js +3 -3
- package/lib/element/equality.js +5 -5
- package/lib/element/equivalence.js +112 -107
- package/lib/element/equivalences.js +24 -10
- package/lib/element/error.js +3 -3
- package/lib/element/frame.js +73 -62
- package/lib/element/hypothesis.js +2 -2
- package/lib/element/judgement.js +40 -60
- package/lib/element/metaType.js +4 -4
- package/lib/element/metavariable.js +49 -38
- package/lib/element/parameter.js +13 -5
- package/lib/element/procedureCall.js +16 -16
- package/lib/element/proof.js +14 -13
- package/lib/element/proofAssertion/premise.js +319 -0
- package/lib/element/proofAssertion/step.js +309 -0
- package/lib/element/proofAssertion/supposition.js +333 -0
- package/lib/element/proofAssertion.js +20 -10
- package/lib/element/propertyRelation.js +2 -2
- package/lib/element/reference.js +72 -30
- package/lib/element/rule.js +26 -28
- package/lib/element/section.js +5 -5
- package/lib/element/signature.js +9 -6
- package/lib/element/statement.js +44 -36
- package/lib/element/subproof.js +18 -17
- package/lib/element/substitution/frame.js +86 -49
- package/lib/element/substitution/reference.js +101 -19
- package/lib/element/substitution/statement.js +128 -105
- package/lib/element/substitution/term.js +93 -57
- package/lib/element/substitution.js +20 -69
- package/lib/element/substitutions.js +49 -34
- package/lib/element/term.js +41 -30
- package/lib/element/topLevelAssertion/axiom.js +331 -0
- package/lib/element/{conjecture.js → topLevelAssertion/conjecture.js} +10 -10
- package/lib/element/{lemma.js → topLevelAssertion/lemma.js} +9 -9
- package/lib/element/{theorem.js → topLevelAssertion/theorem.js} +8 -8
- package/lib/element/topLevelAssertion.js +434 -0
- package/lib/element/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +8 -8
- package/lib/element/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +8 -8
- package/lib/element/topLevelMetaAssertion.js +293 -0
- package/lib/element/type.js +4 -4
- package/lib/element/variable.js +48 -40
- package/lib/index.js +3 -3
- package/lib/main.js +3 -3
- package/lib/metaTypes.js +18 -15
- package/lib/node/frame.js +2 -2
- package/lib/node/metavariable.js +4 -4
- package/lib/node/parameter.js +28 -7
- package/lib/node/proofAssertion/premise.js +116 -0
- package/lib/node/proofAssertion/step.js +152 -0
- package/lib/node/proofAssertion/supposition.js +116 -0
- package/lib/node/{premise.js → proofAssertion.js} +11 -18
- package/lib/node/statement.js +2 -2
- package/lib/node/substitution/frame.js +9 -31
- package/lib/node/substitution/reference.js +137 -0
- package/lib/node/substitution/statement.js +9 -31
- package/lib/node/substitution/term.js +9 -23
- package/lib/node/{axiom.js → topLevelAssertion/axiom.js} +7 -7
- package/lib/node/{conjecture.js → topLevelAssertion/conjecture.js} +7 -7
- package/lib/node/{lemma.js → topLevelAssertion/lemma.js} +7 -7
- package/lib/node/{theorem.js → topLevelAssertion/theorem.js} +7 -7
- package/lib/node/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +9 -9
- package/lib/node/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +7 -7
- package/lib/node/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +7 -7
- package/lib/node/{metaLemmaMetaTheorem.js → topLevelMetaAssertion.js} +9 -9
- package/lib/nonTerminalNodeMap.js +15 -14
- package/lib/preamble.js +10 -10
- package/lib/process/instantiate.js +6 -21
- package/lib/process/unify.js +11 -10
- package/lib/tokenTypes.js +22 -0
- package/lib/types.js +3 -3
- package/lib/utilities/bnf.js +5 -5
- package/lib/utilities/context.js +63 -0
- package/lib/utilities/element.js +235 -408
- package/lib/utilities/instance.js +12 -34
- package/lib/utilities/json.js +3 -2
- package/lib/utilities/string.js +56 -21
- package/lib/utilities/unification.js +38 -32
- package/lib/utilities/validation.js +47 -50
- package/package.json +2 -2
- package/src/constants.js +12 -1
- package/src/context/ephemeral.js +257 -0
- package/src/context/file.js +108 -116
- package/src/context/liminal.js +67 -0
- package/src/context/literal.js +51 -0
- package/src/context/nominal.js +12 -0
- package/src/context/release.js +48 -8
- package/src/context/{local.js → scoped.js} +43 -125
- package/src/context/synthetic.js +60 -0
- package/src/element/assertion/contained.js +49 -47
- package/src/element/assertion/defined.js +29 -27
- package/src/element/assertion/property.js +35 -35
- package/src/element/assertion/satisfies.js +19 -18
- package/src/element/assumption.js +71 -93
- package/src/element/combinator/bracketed.js +0 -7
- package/src/element/conclusion.js +25 -24
- package/src/element/constructor/bracketed.js +0 -7
- package/src/element/constructor.js +1 -1
- package/src/element/declaration/combinator.js +0 -1
- package/src/element/declaration/metavariable.js +2 -2
- package/src/element/declaration/variable.js +5 -5
- package/src/element/deduction.js +33 -31
- package/src/element/derivation.js +2 -2
- package/src/element/equality.js +4 -4
- package/src/element/equivalence.js +115 -135
- package/src/element/equivalences.js +9 -7
- package/src/element/error.js +4 -2
- package/src/element/frame.js +80 -65
- package/src/element/hypothesis.js +1 -1
- package/src/element/judgement.js +42 -62
- package/src/element/metaType.js +3 -4
- package/src/element/metavariable.js +59 -56
- package/src/element/parameter.js +10 -5
- package/src/element/procedureCall.js +20 -18
- package/src/element/proof.js +14 -16
- package/src/element/{premise.js → proofAssertion/premise.js} +57 -53
- package/src/element/{step.js → proofAssertion/step.js} +59 -62
- package/src/element/{supposition.js → proofAssertion/supposition.js} +67 -56
- package/src/element/proofAssertion.js +24 -13
- package/src/element/propertyRelation.js +1 -1
- package/src/element/reference.js +87 -37
- package/src/element/rule.js +31 -37
- package/src/element/section.js +5 -5
- package/src/element/signature.js +8 -8
- package/src/element/statement.js +52 -48
- package/src/element/subproof.js +16 -18
- package/src/element/substitution/frame.js +104 -50
- package/src/element/substitution/reference.js +120 -20
- package/src/element/substitution/statement.js +169 -130
- package/src/element/substitution/term.js +104 -63
- package/src/element/substitution.js +16 -58
- package/src/element/substitutions.js +43 -41
- package/src/element/term.js +47 -41
- package/src/element/{axiom.js → topLevelAssertion/axiom.js} +22 -20
- package/src/element/{conjecture.js → topLevelAssertion/conjecture.js} +5 -6
- package/src/element/{lemma.js → topLevelAssertion/lemma.js} +5 -6
- package/src/element/{theorem.js → topLevelAssertion/theorem.js} +5 -5
- package/src/element/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +37 -33
- package/src/element/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +5 -6
- package/src/element/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +5 -6
- package/src/element/{metaLemmaMetatheorem.js → topLevelMetaAssertion.js} +19 -17
- package/src/element/type.js +2 -4
- package/src/element/variable.js +47 -48
- package/src/index.js +2 -1
- package/src/main.js +2 -1
- package/src/metaTypes.js +25 -9
- package/src/node/frame.js +1 -1
- package/src/node/metavariable.js +3 -3
- package/src/node/parameter.js +32 -5
- package/src/node/proofAssertion/premise.js +16 -0
- package/src/node/{step.js → proofAssertion/step.js} +4 -18
- package/src/node/proofAssertion/supposition.js +16 -0
- package/src/node/proofAssertion.js +23 -0
- package/src/node/statement.js +1 -1
- package/src/node/substitution/frame.js +6 -32
- package/src/node/substitution/reference.js +38 -0
- package/src/node/substitution/statement.js +6 -32
- package/src/node/substitution/term.js +6 -22
- package/src/node/topLevelAssertion/axiom.js +13 -0
- package/src/node/topLevelAssertion/conjecture.js +13 -0
- package/src/node/topLevelAssertion/lemma.js +13 -0
- package/src/node/topLevelAssertion/theorem.js +13 -0
- package/src/node/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +1 -1
- package/src/node/topLevelMetaAssertion/metaLemma.js +13 -0
- package/src/node/topLevelMetaAssertion/metatheorem.js +13 -0
- package/src/node/{metaLemmaMetaTheorem.js → topLevelMetaAssertion.js} +1 -1
- package/src/nonTerminalNodeMap.js +15 -12
- package/src/preamble.js +9 -9
- package/src/process/instantiate.js +27 -36
- package/src/process/unify.js +10 -9
- package/src/tokenTypes.js +4 -0
- package/src/types.js +4 -2
- package/src/utilities/bnf.js +3 -2
- package/src/utilities/context.js +46 -0
- package/src/utilities/element.js +302 -509
- package/src/utilities/instance.js +19 -42
- package/src/utilities/json.js +3 -1
- package/src/utilities/string.js +69 -28
- package/src/utilities/unification.js +41 -38
- package/src/utilities/validation.js +66 -75
- package/lib/context/local.js +0 -605
- package/lib/context/temporary.js +0 -752
- package/lib/element/axiom.js +0 -329
- package/lib/element/axiomLemmaTheoremConjecture.js +0 -427
- package/lib/element/metaLemmaMetatheorem.js +0 -289
- package/lib/element/premise.js +0 -307
- package/lib/element/step.js +0 -311
- package/lib/element/supposition.js +0 -320
- package/lib/log.js +0 -150
- package/lib/node/step.js +0 -166
- package/lib/node/supposition.js +0 -130
- package/src/context/temporary.js +0 -476
- package/src/log.js +0 -118
- package/src/node/axiom.js +0 -13
- package/src/node/conjecture.js +0 -13
- package/src/node/lemma.js +0 -13
- package/src/node/metaLemma.js +0 -13
- package/src/node/metatheorem.js +0 -13
- package/src/node/premise.js +0 -30
- package/src/node/supposition.js +0 -30
- package/src/node/theorem.js +0 -13
package/src/utilities/element.js
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import elements from "../elements";
|
|
4
4
|
|
|
5
|
+
import { literally } from "../utilities/context";
|
|
5
6
|
import { baseTypeFromNothing } from "../types";
|
|
6
7
|
import { instantiateReference } from "../process/instantiate";
|
|
8
|
+
import { findMetaTypeByMetaTypeName } from "../metaTypes";
|
|
7
9
|
import { equivalenceStringFromTerms,
|
|
8
10
|
rulsStringFromLabelsPremisesAndConclusion,
|
|
11
|
+
sectionStringFromHypothesesTopLevelAssertion,
|
|
9
12
|
subproofStringFromSuppositionsAndSubDerivation,
|
|
10
13
|
procedureCallStringFromProcedureReferenceAndParameters,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
axiomLemmaTheoremConjectureStringFromLabelsSuppositionsAndDeduction } from "../utilities/string";
|
|
14
|
+
topLevelAssertionStringFromLabelsSuppositionsAndDeduction,
|
|
15
|
+
topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction } from "../utilities/string";
|
|
14
16
|
|
|
15
17
|
export function typeFromTypeNode(typeNode, context) {
|
|
16
18
|
let type;
|
|
@@ -42,11 +44,8 @@ export function termFromTermNode(termNode, context) {
|
|
|
42
44
|
const { Term } = elements,
|
|
43
45
|
node = termNode, ///
|
|
44
46
|
string = context.nodeAsString(node),
|
|
45
|
-
type =
|
|
46
|
-
|
|
47
|
-
context = null;
|
|
48
|
-
|
|
49
|
-
const term = new Term(context, string, node, type);
|
|
47
|
+
type = typeFromTermNode(termNode, context),
|
|
48
|
+
term = new Term(context, string, node, type);
|
|
50
49
|
|
|
51
50
|
return term;
|
|
52
51
|
}
|
|
@@ -98,16 +97,16 @@ export function errorFromErrorNode(errorNode, context) {
|
|
|
98
97
|
|
|
99
98
|
export function lemmaFromLemmaNode(lemmaNode, context) {
|
|
100
99
|
const { Lemma } = elements,
|
|
101
|
-
|
|
102
|
-
proof =
|
|
103
|
-
labels =
|
|
104
|
-
deduction =
|
|
105
|
-
suppositions =
|
|
106
|
-
signature =
|
|
107
|
-
hypotheses =
|
|
108
|
-
|
|
100
|
+
topLevelAsssertionNode = lemmaNode, ///
|
|
101
|
+
proof = proofFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
102
|
+
labels = labelsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
103
|
+
deduction = deductionFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
104
|
+
suppositions = suppositionsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
105
|
+
signature = signatureFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
106
|
+
hypotheses = hypothesesFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
107
|
+
topLevelAsssertionString = topLevelAssertionStringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
|
|
109
108
|
node = lemmaNode, ///
|
|
110
|
-
string =
|
|
109
|
+
string = topLevelAsssertionString, ///
|
|
111
110
|
lemma = new Lemma(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
112
111
|
|
|
113
112
|
return lemma;
|
|
@@ -115,10 +114,10 @@ export function lemmaFromLemmaNode(lemmaNode, context) {
|
|
|
115
114
|
|
|
116
115
|
export function frameFromFrameNode(frameNode, context) {
|
|
117
116
|
const { Frame } = elements,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
node = frameNode, ///
|
|
118
|
+
string = context.nodeAsString(node),
|
|
119
|
+
assumptions = assumptionsFromFrameNode(frameNode, context),
|
|
120
|
+
frame = new Frame(context, string, node, assumptions);
|
|
122
121
|
|
|
123
122
|
return frame;
|
|
124
123
|
}
|
|
@@ -135,16 +134,16 @@ export function proofFromProofNode(proofNode, context) {
|
|
|
135
134
|
|
|
136
135
|
export function axiomFromAxiomNode(axiomNode, context) {
|
|
137
136
|
const { Axiom } = elements,
|
|
138
|
-
|
|
139
|
-
proof =
|
|
140
|
-
labels =
|
|
141
|
-
deduction =
|
|
142
|
-
suppositions =
|
|
143
|
-
signature =
|
|
137
|
+
topLevelAsssertionNode = axiomNode, ///
|
|
138
|
+
proof = proofFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
139
|
+
labels = labelsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
140
|
+
deduction = deductionFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
141
|
+
suppositions = suppositionsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
142
|
+
signature = signatureFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
144
143
|
hypotheses = [],
|
|
145
|
-
|
|
144
|
+
topLevelAsssertionString = topLevelAssertionStringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
|
|
146
145
|
node = axiomNode, ///
|
|
147
|
-
string =
|
|
146
|
+
string = topLevelAsssertionString, ///
|
|
148
147
|
axiom = new Axiom(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
149
148
|
|
|
150
149
|
return axiom;
|
|
@@ -157,7 +156,7 @@ export function sectionFromSectionNode(sectionNode, context) {
|
|
|
157
156
|
lemma = lemmaFromSectionNode(sectionNode, context),
|
|
158
157
|
theorem = theoremFromSectionNode(sectionNode, context),
|
|
159
158
|
conjecture = conjectureFromSectionNode(sectionNode, context),
|
|
160
|
-
sectionString =
|
|
159
|
+
sectionString = sectionStringFromHypothesesTopLevelAssertion(hypotheses, axiom, lemma, theorem, conjecture),
|
|
161
160
|
node = sectionNode, ///
|
|
162
161
|
string = sectionString, ///
|
|
163
162
|
section = new Section(context, string, node, hypotheses, axiom, lemma, theorem, conjecture);
|
|
@@ -178,53 +177,36 @@ export function premiseFromPremiseNode(premiseNode, context) {
|
|
|
178
177
|
|
|
179
178
|
export function theoremFromTheoremNode(theoremNode, context) {
|
|
180
179
|
const { Theorem } = elements,
|
|
181
|
-
|
|
182
|
-
proof =
|
|
183
|
-
labels =
|
|
184
|
-
deduction =
|
|
185
|
-
suppositions =
|
|
186
|
-
signature =
|
|
180
|
+
topLevelAsssertionNode = theoremNode, ///
|
|
181
|
+
proof = proofFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
182
|
+
labels = labelsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
183
|
+
deduction = deductionFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
184
|
+
suppositions = suppositionsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
185
|
+
signature = signatureFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
187
186
|
hypotheses = [],
|
|
188
|
-
|
|
187
|
+
topLevelAsssertionString = topLevelAssertionStringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
|
|
189
188
|
node = theoremNode, ///
|
|
190
|
-
string =
|
|
189
|
+
string = topLevelAsssertionString, ///
|
|
191
190
|
theorem = new Theorem(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
192
191
|
|
|
193
192
|
return theorem;
|
|
194
193
|
}
|
|
195
194
|
|
|
196
|
-
export function equalityFromEqualityNode(equalityNode, context) {
|
|
197
|
-
const { Equality } = elements,
|
|
198
|
-
node = equalityNode, ///
|
|
199
|
-
string = context.nodeAsString(node),
|
|
200
|
-
leftTermNode = equalityNode.getLeftTermNode(),
|
|
201
|
-
rightTermNode = equalityNode.getRightTermNode(),
|
|
202
|
-
leftTerm = termFromTermNode(leftTermNode, context),
|
|
203
|
-
rightTerm = termFromTermNode(rightTermNode, context),
|
|
204
|
-
equality = new Equality(string, leftTerm, rightTerm);
|
|
205
|
-
|
|
206
|
-
return equality;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
195
|
export function metaTypeFromMetaTypeNode(metaTypeNode, context) {
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
string = context.nodeAsString(node),
|
|
213
|
-
metaTypeName = metaTypeNode.getMetaTypeName(),
|
|
214
|
-
name = metaTypeName, ///
|
|
215
|
-
metaType = new MetaType(context, string, node, name);
|
|
196
|
+
const metaTypeName = metaTypeNode.getMetaTypeName(),
|
|
197
|
+
metaType = findMetaTypeByMetaTypeName(metaTypeName);
|
|
216
198
|
|
|
217
199
|
return metaType;
|
|
218
200
|
}
|
|
219
201
|
|
|
220
202
|
export function propertyFromPropertyNode(propertyNode, context) {
|
|
221
203
|
const { Property } = elements,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
204
|
+
node = propertyNode, ///
|
|
205
|
+
string = context.nodeAsString(node),
|
|
206
|
+
propertyName = propertyNode.getPropertyName(),
|
|
207
|
+
nominalTypeName = null,
|
|
208
|
+
name = propertyName, ///
|
|
209
|
+
property = new Property(context, string, node, name, nominalTypeName);
|
|
228
210
|
|
|
229
211
|
return property;
|
|
230
212
|
}
|
|
@@ -283,11 +265,8 @@ export function deductionFromDeductionNode(deductionNode, context) {
|
|
|
283
265
|
export function statementFromStatementNode(statementNode, context) {
|
|
284
266
|
const { Statement } = elements,
|
|
285
267
|
node = statementNode, ///
|
|
286
|
-
string = context.nodeAsString(node)
|
|
287
|
-
|
|
288
|
-
context = null;
|
|
289
|
-
|
|
290
|
-
const statement = new Statement(context, string, node);
|
|
268
|
+
string = context.nodeAsString(node),
|
|
269
|
+
statement = new Statement(context, string, node);
|
|
291
270
|
|
|
292
271
|
return statement;
|
|
293
272
|
}
|
|
@@ -326,13 +305,14 @@ export function judgementFromJudgementNode(judgementNode, context) {
|
|
|
326
305
|
export function metaLemmaFromMetaLemmaNode(metaLemmaNode, context) {
|
|
327
306
|
const { MetaLemma } = elements,
|
|
328
307
|
metaLemmaMetathoremNode = metaLemmaNode, ///
|
|
329
|
-
proof =
|
|
330
|
-
label =
|
|
331
|
-
deduction =
|
|
332
|
-
suppositions =
|
|
308
|
+
proof = proofFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
309
|
+
label = labelFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
310
|
+
deduction = deductionFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
311
|
+
suppositions = suppositionsFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
312
|
+
topLevelMetaAssertionString = topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction(label, suppositions, deduction),
|
|
333
313
|
substitutions = null,
|
|
334
314
|
node = metaLemmaNode, ///
|
|
335
|
-
string =
|
|
315
|
+
string = topLevelMetaAssertionString, ///
|
|
336
316
|
metaLemma = new MetaLemma(context, string, node, label, suppositions, deduction, proof, substitutions);
|
|
337
317
|
|
|
338
318
|
return metaLemma;
|
|
@@ -342,9 +322,9 @@ export function parameterFromParameterNode(parameterNode, context) {
|
|
|
342
322
|
const { Parameter } = elements,
|
|
343
323
|
node = parameterNode, ///
|
|
344
324
|
string = context.nodeAsString(node),
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
parameter = new Parameter(context, string, node, name);
|
|
325
|
+
name = parameterNode.getName(),
|
|
326
|
+
identifier = parameterNode.getIdentifier(),
|
|
327
|
+
parameter = new Parameter(context, string, node, name, identifier);
|
|
348
328
|
|
|
349
329
|
return parameter;
|
|
350
330
|
}
|
|
@@ -361,16 +341,16 @@ export function hypothesisFromHypothesisNode(hypotheseNode, context) {
|
|
|
361
341
|
|
|
362
342
|
export function conjectureFromConjectureNode(conjectureNode, context) {
|
|
363
343
|
const { Conjecture } = elements,
|
|
364
|
-
|
|
365
|
-
proof =
|
|
366
|
-
labels =
|
|
367
|
-
deduction =
|
|
368
|
-
suppositions =
|
|
369
|
-
signature =
|
|
344
|
+
topLevelAsssertionNode = conjectureNode, ///
|
|
345
|
+
proof = proofFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
346
|
+
labels = labelsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
347
|
+
deduction = deductionFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
348
|
+
suppositions = suppositionsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
349
|
+
signature = signatureFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
370
350
|
hypotheses = [],
|
|
371
|
-
|
|
351
|
+
topLevelAsssertionString = topLevelAssertionStringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
|
|
372
352
|
node = conjectureNode, ///
|
|
373
|
-
string =
|
|
353
|
+
string = topLevelAsssertionString, ///
|
|
374
354
|
conjecture = new Conjecture(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
375
355
|
|
|
376
356
|
return conjecture;
|
|
@@ -396,16 +376,6 @@ export function conclusionFromConclusionNode(conclusionNode, context) {
|
|
|
396
376
|
return conclusion;
|
|
397
377
|
}
|
|
398
378
|
|
|
399
|
-
export function conclusinoFromConclusionNode(conclusinoNode, context) {
|
|
400
|
-
const { Conclusion } = elements,
|
|
401
|
-
node = conclusinoNode, ///
|
|
402
|
-
string = context.nodeAsString(node),
|
|
403
|
-
statement = statementFromConclusionNode(conclusinoNode, context),
|
|
404
|
-
conclusino = new Conclusion(context, string, node, statement);
|
|
405
|
-
|
|
406
|
-
return conclusino;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
379
|
export function assumptionFromAssumptionNode(assumptionNode, context) {
|
|
410
380
|
const { Assumption } = elements,
|
|
411
381
|
node = assumptionNode, ///
|
|
@@ -438,41 +408,6 @@ export function typePrefixFromTypePrefixNode(typePrefixNode, context) {
|
|
|
438
408
|
return typePrefix;
|
|
439
409
|
}
|
|
440
410
|
|
|
441
|
-
export function metatheoremFromMetaLemmaNode(metatheoremNode, context) {
|
|
442
|
-
const { Metatehorem } = elements,
|
|
443
|
-
metaLemmaMetathoremNode = metatheoremNode, ///
|
|
444
|
-
proof = proofFromMetaLemmaMetatheoremNode(metaLemmaMetathoremNode, context),
|
|
445
|
-
label = labelFromMetaLemmaMetatheoremNode(metaLemmaMetathoremNode, context),
|
|
446
|
-
deduction = deductionFromMetaLemmaMetatheoremNode(metaLemmaMetathoremNode, context),
|
|
447
|
-
suppositions = suppositionsFromMetaLemmaMetatheoremNode(metaLemmaMetathoremNode, context),
|
|
448
|
-
substitutions = null,
|
|
449
|
-
node = metaLemmaNode, ///
|
|
450
|
-
string = metaLemmaMetatheoremStringFromLabelSuppositionsAndDeduction(label, suppositions, deduction),
|
|
451
|
-
metatheorem = new Metatehorem(context, string, node, label, suppositions, deduction, proof, substitutions);
|
|
452
|
-
|
|
453
|
-
return metatheorem;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
export function referenceFromMetavariableNode(metavariableNode, context) {
|
|
457
|
-
const metavariableString = context.nodeAsString(metavariableNode),
|
|
458
|
-
referenceString = metavariableString, ///
|
|
459
|
-
string = referenceString, ///
|
|
460
|
-
referenceNode = instantiateReference(string, context),
|
|
461
|
-
reference = referenceFromReferenceNode(referenceNode, context);
|
|
462
|
-
|
|
463
|
-
return reference;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
export function hyppothesisFromHypothesisNode(hypothesisNode, context) {
|
|
467
|
-
const { Hypothesis } = elements,
|
|
468
|
-
node = hypothesisNode, ///
|
|
469
|
-
string = context.nodeAsString(node),
|
|
470
|
-
statement = statementFromHypothesisNode(hypothesisNode, context),
|
|
471
|
-
hypothesis = new Hypothesis(context, string, node, statement);
|
|
472
|
-
|
|
473
|
-
return hypothesis
|
|
474
|
-
}
|
|
475
|
-
|
|
476
411
|
export function constructorFromConstructorNode(constructorNode, context) {
|
|
477
412
|
const { Constructor } = elements,
|
|
478
413
|
node = constructorNode, ///
|
|
@@ -505,10 +440,20 @@ export function equivalenceFromEquivalenceNode(equivalenceNode, context) {
|
|
|
505
440
|
return equivalence;
|
|
506
441
|
}
|
|
507
442
|
|
|
508
|
-
export function
|
|
509
|
-
const
|
|
443
|
+
export function metatheoremFromMetatheoremNode(metatheoremNode, context) {
|
|
444
|
+
const { Metatehorem } = elements,
|
|
445
|
+
metaLemmaMetathoremNode = metatheoremNode, ///
|
|
446
|
+
proof = proofFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
447
|
+
label = labelFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
448
|
+
deduction = deductionFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
449
|
+
suppositions = suppositionsFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
450
|
+
topLevelMetaAssertionString = topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction(label, suppositions, deduction),
|
|
451
|
+
substitutions = null,
|
|
452
|
+
node = metaLemmaNode, ///
|
|
453
|
+
string = topLevelMetaAssertionString, ///
|
|
454
|
+
metatheorem = new Metatehorem(context, string, node, label, suppositions, deduction, proof, substitutions);
|
|
510
455
|
|
|
511
|
-
return
|
|
456
|
+
return metatheorem;
|
|
512
457
|
}
|
|
513
458
|
|
|
514
459
|
export function metavariableFromMetavariableNode(metavariableNode, context) {
|
|
@@ -566,18 +511,6 @@ export function stepsOrSubproofFromStepOrSubproofNode(stepOrSubproofNode, contex
|
|
|
566
511
|
return stepOrSubproof;
|
|
567
512
|
}
|
|
568
513
|
|
|
569
|
-
export function prefixedFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
|
|
570
|
-
const prefixed = simpleTypeDeclarationNode.isPrefixed();
|
|
571
|
-
|
|
572
|
-
return prefixed;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
export function prefixedFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
576
|
-
const prefixed = complexTypeDeclarationNode.isPrefixed();
|
|
577
|
-
|
|
578
|
-
return prefixed;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
514
|
export function definedAssertionFromDefinedAssertionNode(definedAssertionNode, context) {
|
|
582
515
|
const { DefinedAssertion } = elements,
|
|
583
516
|
node = definedAssertionNode, ///
|
|
@@ -605,9 +538,9 @@ export function termSubstitutionFromTermSubstitutionNode(termSubstitutionNode, c
|
|
|
605
538
|
const { TermSubstitution } = elements,
|
|
606
539
|
node = termSubstitutionNode, ///
|
|
607
540
|
string = context.nodeAsString(node),
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
termSubstitution = new TermSubstitution(context, string, node,
|
|
541
|
+
targetTerm = targetTermFromTermSubstitutionNode(termSubstitutionNode, context),
|
|
542
|
+
replacementTerm = replacementTermFromTermSubstitutionNode(termSubstitutionNode, context),
|
|
543
|
+
termSubstitution = new TermSubstitution(context, string, node, targetTerm, replacementTerm);
|
|
611
544
|
|
|
612
545
|
return termSubstitution;
|
|
613
546
|
}
|
|
@@ -616,9 +549,9 @@ export function frameSubstitutionFromFrameSubstitutionNode(frameSubstitutionNode
|
|
|
616
549
|
const { FrameSubstitution } = elements,
|
|
617
550
|
node = frameSubstitutionNode, ///
|
|
618
551
|
string = context.nodeAsString(node),
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
frameSubstitution = new FrameSubstitution(context, string, node,
|
|
552
|
+
targetFrame = targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, context),
|
|
553
|
+
replacementFrame = replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context),
|
|
554
|
+
frameSubstitution = new FrameSubstitution(context, string, node, targetFrame, replacementFrame);
|
|
622
555
|
|
|
623
556
|
return frameSubstitution;
|
|
624
557
|
}
|
|
@@ -673,17 +606,26 @@ export function procedureReferenceFromProcedureReferenceNode(procedureReferenceN
|
|
|
673
606
|
node = procedureReferenceNode, ///
|
|
674
607
|
string = context.nodeAsString(node),
|
|
675
608
|
name = nameFromProcedureReferenceNode(procedureReferenceNode, context),
|
|
676
|
-
|
|
609
|
+
procedureDeclaration = new ProcedureReference(context, string, node, name);
|
|
677
610
|
|
|
678
|
-
return
|
|
611
|
+
return procedureDeclaration;
|
|
679
612
|
}
|
|
680
613
|
|
|
681
614
|
export function variableDeclarationFromVariableDeclarationNode(variableDeclarationNode, context) {
|
|
682
615
|
const { VariableDeclaration } = elements,
|
|
683
616
|
node = variableDeclarationNode, ///
|
|
684
617
|
string = context.nodeAsString(node),
|
|
685
|
-
|
|
686
|
-
|
|
618
|
+
typeNode = variableDeclarationNode.getTypeNode(),
|
|
619
|
+
provisional = variableDeclarationNode.isProvisional(),
|
|
620
|
+
variableNode = variableDeclarationNode.getVariableNode(),
|
|
621
|
+
type = typeFromTypeNode(typeNode, context),
|
|
622
|
+
variable = variableFromVariableNode(variableNode, context);
|
|
623
|
+
|
|
624
|
+
type.setProvisional(provisional);
|
|
625
|
+
|
|
626
|
+
variable.setType(type);
|
|
627
|
+
|
|
628
|
+
const variableDeclaration = new VariableDeclaration(context, string, node, variable);
|
|
687
629
|
|
|
688
630
|
return variableDeclaration;
|
|
689
631
|
}
|
|
@@ -719,30 +661,35 @@ export function simpleTypeDeclarationFromSimpleTypeDeclarationNode(simpleTypeDec
|
|
|
719
661
|
return simpleTypeDeclaration;
|
|
720
662
|
}
|
|
721
663
|
|
|
722
|
-
export function statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, context) {
|
|
723
|
-
const { StatementSubstitution } = elements,
|
|
724
|
-
node = statementSubstitutionNode, ///
|
|
725
|
-
string = context.nodeAsString(node),
|
|
726
|
-
resolved = true,
|
|
727
|
-
statement = null,
|
|
728
|
-
metavariable = null,
|
|
729
|
-
substitution = null,
|
|
730
|
-
statementSubstitution = new StatementSubstitution(context, string, node, resolved, statement, metavariable, substitution);
|
|
731
|
-
|
|
732
|
-
return statementSubstitution;
|
|
733
|
-
}
|
|
734
|
-
|
|
735
664
|
export function referenceSubstitutionFromReferenceSubstitutionNode(referenceSubstitutionNode, context) {
|
|
736
665
|
const { ReferenceSubstitution } = elements,
|
|
737
666
|
node = referenceSubstitutionNode, ///
|
|
738
667
|
string = context.nodeAsString(node),
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
referenceSubstitution = new ReferenceSubstitution(context, string, node,
|
|
668
|
+
targetReference = targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
|
|
669
|
+
replacementReference = replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
|
|
670
|
+
referenceSubstitution = new ReferenceSubstitution(context, string, node, targetReference, replacementReference);
|
|
742
671
|
|
|
743
672
|
return referenceSubstitution;
|
|
744
673
|
}
|
|
745
674
|
|
|
675
|
+
export function statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, substitution, context) {
|
|
676
|
+
if (context === undefined) {
|
|
677
|
+
context = substitution; ///
|
|
678
|
+
|
|
679
|
+
substitution = null;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
const { StatementSubstitution } = elements,
|
|
683
|
+
node = statementSubstitutionNode, ///
|
|
684
|
+
string = context.nodeAsString(node),
|
|
685
|
+
resolved = resolvedFromStatementSubstitutionNode(statementSubstitutionNode, substitution, context),
|
|
686
|
+
targetStatement = targetStatementFromStatementSubstitutionNode(statementSubstitutionNode, context),
|
|
687
|
+
replacementStatement = replacementStatementFromStatementSubstitutionNode(statementSubstitutionNode, context),
|
|
688
|
+
statementSubstitution = new StatementSubstitution(context, string, node, resolved, substitution, targetStatement, replacementStatement);
|
|
689
|
+
|
|
690
|
+
return statementSubstitution;
|
|
691
|
+
}
|
|
692
|
+
|
|
746
693
|
export function constructorDeclarationFromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
747
694
|
const { ConstructorDeclaration } = elements,
|
|
748
695
|
node = constructorDeclarationNode, ///
|
|
@@ -778,6 +725,12 @@ export function metavariableDeclarationFromMetavariableDeclarationNode(metavaria
|
|
|
778
725
|
return metavariableDeclaration;
|
|
779
726
|
}
|
|
780
727
|
|
|
728
|
+
export function typeFromTermNode(termNode, context) {
|
|
729
|
+
const type = null;
|
|
730
|
+
|
|
731
|
+
return type;
|
|
732
|
+
}
|
|
733
|
+
|
|
781
734
|
export function proofFromRuleNode(ruleNode, context) {
|
|
782
735
|
let proof = null;
|
|
783
736
|
|
|
@@ -814,18 +767,6 @@ export function lemmaFromSectionNode(sectionNode, context) {
|
|
|
814
767
|
return lemma;
|
|
815
768
|
}
|
|
816
769
|
|
|
817
|
-
export function variableFromTermNode(termNode, context) {
|
|
818
|
-
let variable = null;
|
|
819
|
-
|
|
820
|
-
const variableNode = termNode.getVariableNode();
|
|
821
|
-
|
|
822
|
-
if (variableNode !== null) {
|
|
823
|
-
variable = variableFromVariableNode(variableNode, context);
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
return variable;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
770
|
export function statementFromStepNode(stepNode, context) {
|
|
830
771
|
let statement = null;
|
|
831
772
|
|
|
@@ -946,18 +887,6 @@ export function conjectureFromSectionNode(sectionNode, context) {
|
|
|
946
887
|
return conjecture;
|
|
947
888
|
}
|
|
948
889
|
|
|
949
|
-
export function conclusionFromPremiseNode(premiseNode, context) {
|
|
950
|
-
let conclusion = null;
|
|
951
|
-
|
|
952
|
-
const conclusionNode = premiseNode.getConclusionNode();
|
|
953
|
-
|
|
954
|
-
if (conclusionNode !== null) {
|
|
955
|
-
conclusion = conclusionFromConclusionNode(conclusionNode, context);
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
return conclusion;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
890
|
export function termFromTypeAssertionNode(typeAssertionNode, context) {
|
|
962
891
|
let term = null;
|
|
963
892
|
|
|
@@ -982,18 +911,6 @@ export function typeFromTypeAssertionNode(typeAssertionNode, context) {
|
|
|
982
911
|
return type;
|
|
983
912
|
}
|
|
984
913
|
|
|
985
|
-
export function metavariableFromFrameNode(frameNode, context) {
|
|
986
|
-
let metavariable = null;
|
|
987
|
-
|
|
988
|
-
const metavariableNode = frameNode.getMetavariableNode();
|
|
989
|
-
|
|
990
|
-
if (metavariableNode !== null) {
|
|
991
|
-
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
return metavariable;
|
|
995
|
-
}
|
|
996
|
-
|
|
997
914
|
export function identifierFromVarialbeNode(variableNode, context) {
|
|
998
915
|
const variableIdentifier = variableNode.getVariableIdentifier(),
|
|
999
916
|
identifier = variableIdentifier; ///
|
|
@@ -1039,6 +956,18 @@ export function stepFromStepOrSubproofNode(stepOrSubproofNode, context) {
|
|
|
1039
956
|
return step;
|
|
1040
957
|
}
|
|
1041
958
|
|
|
959
|
+
export function assumptionFromJudgementNode(judgementNode, context) {
|
|
960
|
+
let assumption = null;
|
|
961
|
+
|
|
962
|
+
const assumptionNode = judgementNode.getAssumptionNode();
|
|
963
|
+
|
|
964
|
+
if (assumptionNode !== null) {
|
|
965
|
+
assumption = assumptionFromAssumptionNode(assumptionNode, context);
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
return assumption;
|
|
969
|
+
}
|
|
970
|
+
|
|
1042
971
|
export function statementFromCombinatorNode(combinatorNode, context) {
|
|
1043
972
|
let statement = null;
|
|
1044
973
|
|
|
@@ -1087,18 +1016,6 @@ export function referenceFromAssumptionNode(assumptionNode, context) {
|
|
|
1087
1016
|
return reference;
|
|
1088
1017
|
}
|
|
1089
1018
|
|
|
1090
|
-
export function assumptionFromJudgementNode(judgementNode, context) {
|
|
1091
|
-
let assumption = null;
|
|
1092
|
-
|
|
1093
|
-
const assumptionNode = judgementNode.getAssumptionNode();
|
|
1094
|
-
|
|
1095
|
-
if (assumptionNode !== null) {
|
|
1096
|
-
assumption = assumptionFromAssumptionNode(assumptionNode, context);
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
return assumption;
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
1019
|
export function statementFromHypothesisNode(hypothesisNode, context) {
|
|
1103
1020
|
let statement = null;
|
|
1104
1021
|
|
|
@@ -1159,16 +1076,16 @@ export function termFromPropertyRelationNode(propertyRelationNode, context) {
|
|
|
1159
1076
|
return term;
|
|
1160
1077
|
}
|
|
1161
1078
|
|
|
1162
|
-
export function
|
|
1163
|
-
let
|
|
1079
|
+
export function subDerivationFromSubproofNode(subproofNode, context) {
|
|
1080
|
+
let subDerviation = null;
|
|
1164
1081
|
|
|
1165
|
-
const
|
|
1082
|
+
const subDerivationNode = subproofNode.getSubDerivationNode();
|
|
1166
1083
|
|
|
1167
|
-
if (
|
|
1168
|
-
|
|
1084
|
+
if (subDerivationNode !== null) {
|
|
1085
|
+
subDerviation = subDerivationFromSubDerivationNode(subDerivationNode, context);
|
|
1169
1086
|
}
|
|
1170
1087
|
|
|
1171
|
-
return
|
|
1088
|
+
return subDerviation;
|
|
1172
1089
|
}
|
|
1173
1090
|
|
|
1174
1091
|
export function metavariableFromStatementNode(statementNode, context) {
|
|
@@ -1183,18 +1100,6 @@ export function metavariableFromStatementNode(statementNode, context) {
|
|
|
1183
1100
|
return metavariable;
|
|
1184
1101
|
}
|
|
1185
1102
|
|
|
1186
|
-
export function subDerivationFromSubproofNode(subproofNode, context) {
|
|
1187
|
-
let subDerviation = null;
|
|
1188
|
-
|
|
1189
|
-
const subDerivationNode = subproofNode.getSubDerivationNode();
|
|
1190
|
-
|
|
1191
|
-
if (subDerivationNode !== null) {
|
|
1192
|
-
subDerviation = subDerivationFromSubDerivationNode(subDerivationNode, context);
|
|
1193
|
-
}
|
|
1194
|
-
|
|
1195
|
-
return subDerviation;
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
1103
|
export function metavariableFromReferenceNode(referenceNode, context) {
|
|
1199
1104
|
let metavariable = null;
|
|
1200
1105
|
|
|
@@ -1207,10 +1112,23 @@ export function metavariableFromReferenceNode(referenceNode, context) {
|
|
|
1207
1112
|
return metavariable;
|
|
1208
1113
|
}
|
|
1209
1114
|
|
|
1115
|
+
export function referenceFromMetavariableNode(metavariableNode, context) {
|
|
1116
|
+
const metavariableString = context.nodeAsString(metavariableNode);
|
|
1117
|
+
|
|
1118
|
+
return literally((context) => {
|
|
1119
|
+
const referenceString = metavariableString, ///
|
|
1120
|
+
string = referenceString, ///
|
|
1121
|
+
referenceNode = instantiateReference(string, context),
|
|
1122
|
+
reference = referenceFromReferenceNode(referenceNode, context);
|
|
1123
|
+
|
|
1124
|
+
return reference;
|
|
1125
|
+
}, context);
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1210
1128
|
export function frameFromDefinedAssertionNode(definedAssertionNode, context) {
|
|
1211
1129
|
let frame = null;
|
|
1212
1130
|
|
|
1213
|
-
const frameNode = definedAssertionNode.
|
|
1131
|
+
const frameNode = definedAssertionNode.getFrameNode();
|
|
1214
1132
|
|
|
1215
1133
|
if (frameNode !== null) {
|
|
1216
1134
|
frame = frameFromFrameNode(frameNode, context);
|
|
@@ -1243,12 +1161,6 @@ export function satisfiesAssertionFromStepNode(stepNode, context) {
|
|
|
1243
1161
|
return satisfiesAssertion;
|
|
1244
1162
|
}
|
|
1245
1163
|
|
|
1246
|
-
export function parameterNameFromParameterNode(parameterNode, context) {
|
|
1247
|
-
const parameterName = parameterNode.getParameterName();
|
|
1248
|
-
|
|
1249
|
-
return parameterName;
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
1164
|
export function typeAssertionFromStatementNode(statementNode, context) {
|
|
1253
1165
|
let typeAssertion = null;
|
|
1254
1166
|
|
|
@@ -1261,40 +1173,16 @@ export function typeAssertionFromStatementNode(statementNode, context) {
|
|
|
1261
1173
|
return typeAssertion;
|
|
1262
1174
|
}
|
|
1263
1175
|
|
|
1264
|
-
export function
|
|
1265
|
-
let
|
|
1266
|
-
|
|
1267
|
-
const metavariableNode = assumptionNode.getMetavariableNode();
|
|
1268
|
-
|
|
1269
|
-
if (metavariableNode !== null) {
|
|
1270
|
-
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
1271
|
-
}
|
|
1272
|
-
|
|
1273
|
-
return metavariable;
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
export function referenceFromProcedureCallNode(procedureCallNode, context) {
|
|
1277
|
-
let reference = null;
|
|
1278
|
-
|
|
1279
|
-
const referenceNode = procedureCallNode.getReferenceNode();
|
|
1280
|
-
|
|
1281
|
-
if (referenceNode !== null) {
|
|
1282
|
-
reference = referenceFromReferenceNode(referenceNode, context);
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
return reference;
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
|
-
export function frameFromFrameSubstitutionNode(frameSubstitutionNode, context) {
|
|
1289
|
-
let frame = null;
|
|
1176
|
+
export function proofFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1177
|
+
let proof = null;
|
|
1290
1178
|
|
|
1291
|
-
const
|
|
1179
|
+
const proofNode = topLevelAsssertionNode.getProofNode();
|
|
1292
1180
|
|
|
1293
|
-
if (
|
|
1294
|
-
|
|
1181
|
+
if (proofNode !== null) {
|
|
1182
|
+
proof = proofFromProofNode(proofNode, context);
|
|
1295
1183
|
}
|
|
1296
1184
|
|
|
1297
|
-
return
|
|
1185
|
+
return proof;
|
|
1298
1186
|
}
|
|
1299
1187
|
|
|
1300
1188
|
export function subproofFromStepOrSubproofNode(subproofOrSubproofNode, context) {
|
|
@@ -1323,16 +1211,10 @@ export function termFromContainedAssertionNode(containedAssertionNode, context)
|
|
|
1323
1211
|
return term;
|
|
1324
1212
|
}
|
|
1325
1213
|
|
|
1326
|
-
export function
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
const typeNode = propertyDeclarationNode.getTypeNode();
|
|
1330
|
-
|
|
1331
|
-
if (typeNode !== null) {
|
|
1332
|
-
type = typeFromTypeNode(typeNode, context);
|
|
1333
|
-
}
|
|
1214
|
+
export function nameFromProcedureReferenceNode(procedureReferenceNode, context) {
|
|
1215
|
+
const name = procedureReferenceNode.getName();
|
|
1334
1216
|
|
|
1335
|
-
return
|
|
1217
|
+
return name;
|
|
1336
1218
|
}
|
|
1337
1219
|
|
|
1338
1220
|
export function frameFromContainedAssertionNode(containedAssertionNode, context) {
|
|
@@ -1371,18 +1253,6 @@ export function propertyFromPropertyRelationNode(propertyRelationNode, context)
|
|
|
1371
1253
|
return property;
|
|
1372
1254
|
}
|
|
1373
1255
|
|
|
1374
|
-
export function variableFromTermSubstitutionNode(termSubstitutionNode, context) {
|
|
1375
|
-
let variable = null;
|
|
1376
|
-
|
|
1377
|
-
const variableNode = termSubstitutionNode.getMetavariableNode();
|
|
1378
|
-
|
|
1379
|
-
if (variableNode !== null) {
|
|
1380
|
-
variable = variableFromVariableNode(variableNode, context);
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
return variable;
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
1256
|
export function definedAssertionFromStatementNode(statementNode, context) {
|
|
1387
1257
|
let definedAssertion = null;
|
|
1388
1258
|
|
|
@@ -1407,7 +1277,55 @@ export function termSubstitutionFromStatementNode(statementNode, context) {
|
|
|
1407
1277
|
return termSubstitution;
|
|
1408
1278
|
}
|
|
1409
1279
|
|
|
1410
|
-
export function
|
|
1280
|
+
export function typeFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
|
|
1281
|
+
let type = null;
|
|
1282
|
+
|
|
1283
|
+
const typeNode = simpleTypeDeclarationNode.getTypeNode();
|
|
1284
|
+
|
|
1285
|
+
if (typeNode !== null) {
|
|
1286
|
+
type = typeFromTypeNode(typeNode, context);
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
return type;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
export function targetTermFromTermSubstitutionNode(termSubstitutionNode, context) {
|
|
1293
|
+
let targetTerm = null;
|
|
1294
|
+
|
|
1295
|
+
const targetTermNode = termSubstitutionNode.getTargetTermNode();
|
|
1296
|
+
|
|
1297
|
+
if (targetTermNode !== null) {
|
|
1298
|
+
targetTerm = termFromTermNode(targetTermNode, context);
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
return targetTerm;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
export function deductionFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1305
|
+
let deduction = null;
|
|
1306
|
+
|
|
1307
|
+
const deductionNode = topLevelAsssertionNode.getDeductionNode();
|
|
1308
|
+
|
|
1309
|
+
if (deductionNode !== null) {
|
|
1310
|
+
deduction = deductionFromDeductionNode(deductionNode, context);
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
return deduction;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
export function signatureFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1317
|
+
let signature = null;
|
|
1318
|
+
|
|
1319
|
+
const signatureNode = topLevelAsssertionNode.getSignatureNode();
|
|
1320
|
+
|
|
1321
|
+
if (signatureNode !== null) {
|
|
1322
|
+
signature = signatureFromSignatureNode(signatureNode, context);
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
return signature;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
export function proofFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context) {
|
|
1411
1329
|
let proof = null;
|
|
1412
1330
|
|
|
1413
1331
|
const proofNode = metaLemmaMetathoremNode.getProofNode();
|
|
@@ -1419,7 +1337,7 @@ export function proofFromMetaLemmaMetatheoremNode(metaLemmaMetathoremNode, conte
|
|
|
1419
1337
|
return proof;
|
|
1420
1338
|
}
|
|
1421
1339
|
|
|
1422
|
-
export function
|
|
1340
|
+
export function labelFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context) {
|
|
1423
1341
|
let label = null;
|
|
1424
1342
|
|
|
1425
1343
|
const labelNode = metaLemmaMetathoremNode.getLabelNode();
|
|
@@ -1431,18 +1349,6 @@ export function labelFromMetaLemmaMetatheoremNode(metaLemmaMetathoremNode, conte
|
|
|
1431
1349
|
return label;
|
|
1432
1350
|
}
|
|
1433
1351
|
|
|
1434
|
-
export function typeFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
|
|
1435
|
-
let type = null;
|
|
1436
|
-
|
|
1437
|
-
const typeNode = simpleTypeDeclarationNode.getTypeNode();
|
|
1438
|
-
|
|
1439
|
-
if (typeNode !== null) {
|
|
1440
|
-
type = typeFromTypeNode(typeNode, context);
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
return type;
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
1352
|
export function frameSubstitutionFromStatementNode(statementNode, context) {
|
|
1447
1353
|
let frameSubstitution = null;
|
|
1448
1354
|
|
|
@@ -1455,17 +1361,6 @@ export function frameSubstitutionFromStatementNode(statementNode, context) {
|
|
|
1455
1361
|
return frameSubstitution;
|
|
1456
1362
|
}
|
|
1457
1363
|
|
|
1458
|
-
export function stepsOrSubproofsFromDerivationNode(derivationNode, context) {
|
|
1459
|
-
const stepOrSubproofNodes = derivationNode.getStepOrSubproofNodes(),
|
|
1460
|
-
stepsOrSubproofs = stepOrSubproofNodes.map((stepOrSubproofNode) => {
|
|
1461
|
-
const stepOrSubproof = stepsOrSubproofFromStepOrSubproofNode(stepOrSubproofNode, context);
|
|
1462
|
-
|
|
1463
|
-
return stepOrSubproof;
|
|
1464
|
-
});
|
|
1465
|
-
|
|
1466
|
-
return stepsOrSubproofs;
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
1364
|
export function propertyAssertionFromStatementNode(statementNode, context) {
|
|
1470
1365
|
let propertyAssertion = null;
|
|
1471
1366
|
|
|
@@ -1490,16 +1385,15 @@ export function subproofAssertionFromStatementNode(statementNode, context) {
|
|
|
1490
1385
|
return subproofAssertion;
|
|
1491
1386
|
}
|
|
1492
1387
|
|
|
1493
|
-
export function
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1388
|
+
export function stepsOrSubproofsFromDerivationNode(derivationNode, context) {
|
|
1389
|
+
const stepOrSubproofNodes = derivationNode.getStepOrSubproofNodes(),
|
|
1390
|
+
stepsOrSubproofs = stepOrSubproofNodes.map((stepOrSubproofNode) => {
|
|
1391
|
+
const stepOrSubproof = stepsOrSubproofFromStepOrSubproofNode(stepOrSubproofNode, context);
|
|
1497
1392
|
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
}
|
|
1393
|
+
return stepOrSubproof;
|
|
1394
|
+
});
|
|
1501
1395
|
|
|
1502
|
-
return
|
|
1396
|
+
return stepsOrSubproofs;
|
|
1503
1397
|
}
|
|
1504
1398
|
|
|
1505
1399
|
export function typeFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
@@ -1514,22 +1408,6 @@ export function typeFromComplexTypeDeclarationNode(complexTypeDeclarationNode, c
|
|
|
1514
1408
|
return type;
|
|
1515
1409
|
}
|
|
1516
1410
|
|
|
1517
|
-
export function typeFromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
1518
|
-
let type;
|
|
1519
|
-
|
|
1520
|
-
const typeNode = constructorDeclarationNode.getTypeNode();
|
|
1521
|
-
|
|
1522
|
-
if (typeNode !== null) {
|
|
1523
|
-
type = typeFromTypeNode(typeNode, context);
|
|
1524
|
-
} else {
|
|
1525
|
-
const baseType = baseTypeFromNothing();
|
|
1526
|
-
|
|
1527
|
-
type = baseType; ///
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
return type;
|
|
1531
|
-
}
|
|
1532
|
-
|
|
1533
1411
|
export function containedAssertionFromStatementNode(statementNode, context) {0
|
|
1534
1412
|
let containedAssertion = null;
|
|
1535
1413
|
|
|
@@ -1566,18 +1444,6 @@ export function statementFromContainedAssertionNode(containedAssertionNode, cont
|
|
|
1566
1444
|
return statement;
|
|
1567
1445
|
}
|
|
1568
1446
|
|
|
1569
|
-
export function propertyFromPropertyDeclarationNode(propertyDeclarationNode, context) {
|
|
1570
|
-
let property = null;
|
|
1571
|
-
|
|
1572
|
-
const propertyNode = propertyDeclarationNode.getPropertyNode();
|
|
1573
|
-
|
|
1574
|
-
if (propertyNode !== null) {
|
|
1575
|
-
property = propertyFromPropertyNode(propertyNode, context);
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
|
-
return property;
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
1447
|
export function signatureFromSatisfiesAssertionNode(satisfiesAssertionNode, context) {
|
|
1582
1448
|
let signature = null;
|
|
1583
1449
|
|
|
@@ -1602,16 +1468,22 @@ export function referenceFromSatisfiesAssertionNode(satisfiesAssertionNode, cont
|
|
|
1602
1468
|
return reference;
|
|
1603
1469
|
}
|
|
1604
1470
|
|
|
1605
|
-
export function
|
|
1606
|
-
|
|
1471
|
+
export function hypothesesFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1472
|
+
const ypotheses = [];
|
|
1473
|
+
|
|
1474
|
+
return ypotheses;
|
|
1475
|
+
}
|
|
1607
1476
|
|
|
1608
|
-
|
|
1477
|
+
export function targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, context) {
|
|
1478
|
+
let targetFrame = null;
|
|
1609
1479
|
|
|
1610
|
-
|
|
1611
|
-
|
|
1480
|
+
const targetFrameNode = frameSubstitutionNode.getTargetFrameNode();
|
|
1481
|
+
|
|
1482
|
+
if (targetFrameNode !== null) {
|
|
1483
|
+
targetFrame = frameFromFrameNode(targetFrameNode, context);
|
|
1612
1484
|
}
|
|
1613
1485
|
|
|
1614
|
-
return
|
|
1486
|
+
return targetFrame;
|
|
1615
1487
|
}
|
|
1616
1488
|
|
|
1617
1489
|
export function stepsOrSubproofsFromSubDerivationNode(subDerivationNode, context) {
|
|
@@ -1625,19 +1497,25 @@ export function stepsOrSubproofsFromSubDerivationNode(subDerivationNode, context
|
|
|
1625
1497
|
return stepsOrSubproofs;
|
|
1626
1498
|
}
|
|
1627
1499
|
|
|
1628
|
-
export function
|
|
1629
|
-
|
|
1500
|
+
export function prefixedFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
|
|
1501
|
+
const prefixed = simpleTypeDeclarationNode.isPrefixed();
|
|
1630
1502
|
|
|
1631
|
-
|
|
1503
|
+
return prefixed;
|
|
1504
|
+
}
|
|
1632
1505
|
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
}
|
|
1506
|
+
export function resolvedFromStatementSubstitutionNode(statementSubstitutionNode, substitution, context) {
|
|
1507
|
+
const resolved = (substitution === null);
|
|
1636
1508
|
|
|
1637
|
-
return
|
|
1509
|
+
return resolved;
|
|
1638
1510
|
}
|
|
1639
1511
|
|
|
1640
|
-
export function
|
|
1512
|
+
export function prefixedFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
1513
|
+
const prefixed = complexTypeDeclarationNode.isPrefixed();
|
|
1514
|
+
|
|
1515
|
+
return prefixed;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
export function deductionFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context) {
|
|
1641
1519
|
let deduction = null;
|
|
1642
1520
|
|
|
1643
1521
|
const deductionNode = metaLemmaMetathoremNode.getDeductionNode();
|
|
@@ -1649,42 +1527,6 @@ export function deductionFromMetaLemmaMetatheoremNode(metaLemmaMetathoremNode, c
|
|
|
1649
1527
|
return deduction;
|
|
1650
1528
|
}
|
|
1651
1529
|
|
|
1652
|
-
export function statementFromStatementSubstitutionNode(statementSubstitutionNode, context) {
|
|
1653
|
-
let statement = null;
|
|
1654
|
-
|
|
1655
|
-
const statementNode = statementSubstitutionNode.getStatementNode();
|
|
1656
|
-
|
|
1657
|
-
if (statementNode !== null) {
|
|
1658
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1659
|
-
}
|
|
1660
|
-
|
|
1661
|
-
return statement;
|
|
1662
|
-
}
|
|
1663
|
-
|
|
1664
|
-
export function referenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context) {
|
|
1665
|
-
let reference = null;
|
|
1666
|
-
|
|
1667
|
-
const referenceNode = referenceSubstitutionNode.getReferenceNode();
|
|
1668
|
-
|
|
1669
|
-
if (referenceNode !== null) {
|
|
1670
|
-
reference = referenceFromReferenceNode(referenceNode, context);
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1673
|
-
return reference;
|
|
1674
|
-
}
|
|
1675
|
-
|
|
1676
|
-
export function statementFromCombinatorDeclarationNode(combinatorDeclarationNode, context) {
|
|
1677
|
-
let statement = null;
|
|
1678
|
-
|
|
1679
|
-
const statementNode = combinatorDeclarationNode.getStatementNode();
|
|
1680
|
-
|
|
1681
|
-
if (statementNode !== null) {
|
|
1682
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
return statement;
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
1530
|
export function procedureReferenceFromProcedureCallNode(procedureCallNode, context) {
|
|
1689
1531
|
let procedureReference = null;
|
|
1690
1532
|
|
|
@@ -1697,6 +1539,18 @@ export function procedureReferenceFromProcedureCallNode(procedureCallNode, conte
|
|
|
1697
1539
|
return procedureReference;
|
|
1698
1540
|
}
|
|
1699
1541
|
|
|
1542
|
+
export function replacementTermFromTermSubstitutionNode(termSubstitutionNode, context) {
|
|
1543
|
+
let replacementTerm = null;
|
|
1544
|
+
|
|
1545
|
+
const replacementTermNode = termSubstitutionNode.getReplacementTermNode();
|
|
1546
|
+
|
|
1547
|
+
if (replacementTermNode !== null) {
|
|
1548
|
+
replacementTerm = termFromTermNode(replacementTermNode, context);
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
return replacementTerm;
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1700
1554
|
export function typePrefixFromTypePrefixDeclarationNode(typePrefixDeclarationNode, context) {
|
|
1701
1555
|
let typePrefix = null;
|
|
1702
1556
|
|
|
@@ -1733,16 +1587,16 @@ export function metaTypeFromMetavariableDeclarationNode(metavariableDeclarationN
|
|
|
1733
1587
|
return metaType;
|
|
1734
1588
|
}
|
|
1735
1589
|
|
|
1736
|
-
export function
|
|
1737
|
-
let
|
|
1590
|
+
export function replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context) {
|
|
1591
|
+
let replacementFrame = null;
|
|
1738
1592
|
|
|
1739
|
-
const
|
|
1593
|
+
const replacementFrameNode = frameSubstitutionNode.getReplacementFrameNode();
|
|
1740
1594
|
|
|
1741
|
-
if (
|
|
1742
|
-
|
|
1595
|
+
if (replacementFrameNode !== null) {
|
|
1596
|
+
replacementFrame = frameFromFrameNode(replacementFrameNode, context);
|
|
1743
1597
|
}
|
|
1744
1598
|
|
|
1745
|
-
return
|
|
1599
|
+
return replacementFrame;
|
|
1746
1600
|
}
|
|
1747
1601
|
|
|
1748
1602
|
export function propertyRelationFromPropertyAssertionNode(propertyAssertionNode, context) {
|
|
@@ -1769,10 +1623,10 @@ export function constructorFromConstructorDeclarationNode(constructorDeclaration
|
|
|
1769
1623
|
return constructor;
|
|
1770
1624
|
}
|
|
1771
1625
|
|
|
1772
|
-
export function
|
|
1626
|
+
export function metavariableFromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
1773
1627
|
let metavariable = null;
|
|
1774
1628
|
|
|
1775
|
-
const metavariableNode =
|
|
1629
|
+
const metavariableNode = metavariableDeclarationNode.getMetavariableNode();
|
|
1776
1630
|
|
|
1777
1631
|
if (metavariableNode !== null) {
|
|
1778
1632
|
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
@@ -1781,52 +1635,52 @@ export function metavariableFromStatementSubstitutionNode(statementSubstitutionN
|
|
|
1781
1635
|
return metavariable;
|
|
1782
1636
|
}
|
|
1783
1637
|
|
|
1784
|
-
export function
|
|
1785
|
-
let
|
|
1638
|
+
export function targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context) {
|
|
1639
|
+
let targetRefernece = null;
|
|
1786
1640
|
|
|
1787
|
-
const
|
|
1641
|
+
const targetReferenceNode = referenceSubstitutionNode.getTargetReferenceNode();
|
|
1788
1642
|
|
|
1789
|
-
if (
|
|
1790
|
-
|
|
1643
|
+
if (targetReferenceNode !== null) {
|
|
1644
|
+
targetRefernece = metavariableFromMetavariableNode(targetReferenceNode, context);
|
|
1791
1645
|
}
|
|
1792
1646
|
|
|
1793
|
-
return
|
|
1647
|
+
return targetRefernece;
|
|
1794
1648
|
}
|
|
1795
1649
|
|
|
1796
|
-
export function
|
|
1797
|
-
let
|
|
1650
|
+
export function targetStatementFromStatementSubstitutionNode(statementSubstitutionNode, context) {
|
|
1651
|
+
let targetStatement = null;
|
|
1798
1652
|
|
|
1799
|
-
const
|
|
1653
|
+
const targetStatementNode = statementSubstitutionNode.getTargetStatementNode();
|
|
1800
1654
|
|
|
1801
|
-
if (
|
|
1802
|
-
|
|
1655
|
+
if (targetStatementNode !== null) {
|
|
1656
|
+
targetStatement = statementFromStatementNode(targetStatementNode, context);
|
|
1803
1657
|
}
|
|
1804
1658
|
|
|
1805
|
-
return
|
|
1659
|
+
return targetStatement;
|
|
1806
1660
|
}
|
|
1807
1661
|
|
|
1808
|
-
export function
|
|
1809
|
-
let
|
|
1662
|
+
export function replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context) {
|
|
1663
|
+
let replacementReference = null;
|
|
1810
1664
|
|
|
1811
|
-
const
|
|
1665
|
+
const replacementReferenceNode = referenceSubstitutionNode.getReplacementReferenceNode();
|
|
1812
1666
|
|
|
1813
|
-
if (
|
|
1814
|
-
|
|
1667
|
+
if (replacementReferenceNode !== null) {
|
|
1668
|
+
replacementReference = referenceFromReferenceNode(replacementReferenceNode, context);
|
|
1815
1669
|
}
|
|
1816
1670
|
|
|
1817
|
-
return
|
|
1671
|
+
return replacementReference;
|
|
1818
1672
|
}
|
|
1819
1673
|
|
|
1820
|
-
export function
|
|
1821
|
-
let
|
|
1674
|
+
export function replacementStatementFromStatementSubstitutionNode(statementSubstitutionNode, context) {
|
|
1675
|
+
let replacementStatement = null;
|
|
1822
1676
|
|
|
1823
|
-
const
|
|
1677
|
+
const replacementStatementNode = statementSubstitutionNode.getReplacementStatementNode();
|
|
1824
1678
|
|
|
1825
|
-
if (
|
|
1826
|
-
|
|
1679
|
+
if (replacementStatementNode !== null) {
|
|
1680
|
+
replacementStatement = statementFromStatementNode(replacementStatementNode, context);
|
|
1827
1681
|
}
|
|
1828
1682
|
|
|
1829
|
-
return
|
|
1683
|
+
return replacementStatement;
|
|
1830
1684
|
}
|
|
1831
1685
|
|
|
1832
1686
|
export function termsFromTermNodes(termNodes, context) {
|
|
@@ -1869,26 +1723,6 @@ export function statementsFromStatementNodes(statementNodes, context) {
|
|
|
1869
1723
|
return statements;
|
|
1870
1724
|
}
|
|
1871
1725
|
|
|
1872
|
-
export function superTypesFromSuperTypeNodes(superTypeNodes, context) {
|
|
1873
|
-
const superTypes = superTypeNodes.map((superTypeNode) => {
|
|
1874
|
-
const typeNode = superTypeNode, ///
|
|
1875
|
-
type = typeFromTypeNode(typeNode, context),
|
|
1876
|
-
superType = type; ///
|
|
1877
|
-
|
|
1878
|
-
return superType;
|
|
1879
|
-
}),
|
|
1880
|
-
superTypesLength = superTypes.length;
|
|
1881
|
-
|
|
1882
|
-
if (superTypesLength === 0) {
|
|
1883
|
-
const baseType = baseTypeFromNothing(),
|
|
1884
|
-
superType = baseType; ///
|
|
1885
|
-
|
|
1886
|
-
superTypes.push(superType);
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
return superTypes;
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
1726
|
export function parametersFromParameterNodes(parameterNodes, context) {
|
|
1893
1727
|
const parameters = parameterNodes.map((parameterNode) => {
|
|
1894
1728
|
const parameter = parameterFromParameterNode(parameterNode, context);
|
|
@@ -1929,16 +1763,6 @@ export function suppositionsFromSuppositionNodes(suppositionNodes, context) {
|
|
|
1929
1763
|
return suppositions;
|
|
1930
1764
|
}
|
|
1931
1765
|
|
|
1932
|
-
export function propertiesFromPropertyDeclarationNodes(propertyDeclarationNodes, context) {
|
|
1933
|
-
const properties = propertyDeclarationNodes.map((propertyDeclarationNode) => {
|
|
1934
|
-
const property = propertyFromPropertyDeclarationNode(propertyDeclarationNode, context);
|
|
1935
|
-
|
|
1936
|
-
return property;
|
|
1937
|
-
});
|
|
1938
|
-
|
|
1939
|
-
return properties;
|
|
1940
|
-
}
|
|
1941
|
-
|
|
1942
1766
|
export function labelsFromRuleNode(ruleNode, context) {
|
|
1943
1767
|
const labelNodes = ruleNode.getLabelNodes(),
|
|
1944
1768
|
labels = labelsFromLabelNodes(labelNodes, context);
|
|
@@ -1988,6 +1812,13 @@ export function parametersFromProcedureCallNode(procedureCallNode, context) {
|
|
|
1988
1812
|
return parameters;
|
|
1989
1813
|
}
|
|
1990
1814
|
|
|
1815
|
+
export function labelsFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1816
|
+
const labelNodes = topLevelAsssertionNode.getLabelNodes(),
|
|
1817
|
+
labels = labelsFromLabelNodes(labelNodes, context);
|
|
1818
|
+
|
|
1819
|
+
return labels;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1991
1822
|
export function statementsFromSubproofAssertionNode(subproofAssertionNode, context) {
|
|
1992
1823
|
const statementNodes = subproofAssertionNode.getStatementNodes(),
|
|
1993
1824
|
statements = statementsFromStatementNodes(statementNodes, context);
|
|
@@ -1995,54 +1826,16 @@ export function statementsFromSubproofAssertionNode(subproofAssertionNode, conte
|
|
|
1995
1826
|
return statements;
|
|
1996
1827
|
}
|
|
1997
1828
|
|
|
1998
|
-
export function
|
|
1999
|
-
const suppositionNodes =
|
|
1829
|
+
export function suppositionsFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1830
|
+
const suppositionNodes = topLevelAsssertionNode.getSuppositionNodes(),
|
|
2000
1831
|
suppositions = suppositionsFromSuppositionNodes(suppositionNodes, context);
|
|
2001
1832
|
|
|
2002
1833
|
return suppositions;
|
|
2003
1834
|
}
|
|
2004
1835
|
|
|
2005
|
-
export function
|
|
2006
|
-
const
|
|
2007
|
-
properties = propertiesFromPropertyDeclarationNodes(propertyDeclarationNodes, context);
|
|
2008
|
-
|
|
2009
|
-
return properties;
|
|
2010
|
-
}
|
|
2011
|
-
|
|
2012
|
-
export function superTypesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
2013
|
-
const superTypeNodes = complexTypeDeclarationNode.getSuperTypeNodes(),
|
|
2014
|
-
superTypes = superTypesFromSuperTypeNodes(superTypeNodes, context);
|
|
2015
|
-
|
|
2016
|
-
return superTypes;
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
export function labelsFromAxiomLemmaTheoremConjectureNode(axiomLemmaTheoremConjectureNode, context) {
|
|
2020
|
-
const labelNodes = axiomLemmaTheoremConjectureNode.getLabelNodes(),
|
|
2021
|
-
labels = labelsFromLabelNodes(labelNodes, context);
|
|
2022
|
-
|
|
2023
|
-
return labels;
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
export function suppositionsFromAxiomLemmaTheoremConjectureNode(axiomLemmaTheoremConjectureNode, context) {
|
|
2027
|
-
const suppositionNodes = axiomLemmaTheoremConjectureNode.getSuppositionNodes(),
|
|
1836
|
+
export function suppositionsFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context) {
|
|
1837
|
+
const suppositionNodes = metaLemmaMetathoremNode.getSuppositionNodes(),
|
|
2028
1838
|
suppositions = suppositionsFromSuppositionNodes(suppositionNodes, context);
|
|
2029
1839
|
|
|
2030
1840
|
return suppositions;
|
|
2031
1841
|
}
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
export function _typeFromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
2037
|
-
let type = null;
|
|
2038
|
-
|
|
2039
|
-
const typeNode = metavariableDeclarationNode.getTypeNode();
|
|
2040
|
-
|
|
2041
|
-
if (typeNode !== null) {
|
|
2042
|
-
const nominalTypeName = typeNode.getNominalTypeName();
|
|
2043
|
-
|
|
2044
|
-
type = context.findTypeByNominalTypeName(nominalTypeName);
|
|
2045
|
-
}
|
|
2046
|
-
|
|
2047
|
-
return type;
|
|
2048
|
-
}
|