occam-verify-cli 1.0.438 → 1.0.444
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/context/file.js +38 -35
- package/lib/context/local.js +10 -10
- package/lib/context/release.js +6 -6
- package/lib/context/temporary.js +14 -14
- package/lib/element/assertion/contained.js +45 -45
- package/lib/element/assertion/defined.js +13 -13
- package/lib/element/assertion/property.js +23 -22
- package/lib/element/assertion/satisfies.js +7 -6
- package/lib/element/assertion/subproof.js +20 -17
- package/lib/element/assertion/type.js +3 -2
- package/lib/element/assertion.js +1 -23
- package/lib/element/assumption.js +24 -22
- package/lib/element/axiom.js +9 -12
- package/lib/element/axiomLemmaTheoremConjecture.js +32 -32
- package/lib/element/{statement/combinator → combinator}/bracketed.js +16 -16
- package/lib/element/combinator.js +229 -0
- package/lib/element/conclusion.js +11 -9
- package/lib/element/{term/constructor → constructor}/bracketed.js +5 -5
- package/lib/element/constructor.js +232 -0
- package/lib/element/declaration/combinator.js +2 -16
- package/lib/element/declaration/complexType.js +12 -12
- package/lib/element/declaration/constructor.js +13 -11
- package/lib/element/declaration/simpleType.js +4 -4
- package/lib/element/declaration/typePrefix.js +2 -2
- package/lib/element/declaration/variable.js +3 -3
- package/lib/element/deduction.js +11 -9
- package/lib/element/derivation.js +7 -10
- package/lib/element/equivalence.js +10 -10
- package/lib/element/equivalences.js +5 -5
- package/lib/element/frame.js +32 -38
- package/lib/element/hypothesis.js +3 -3
- package/lib/element/judgement.js +6 -4
- package/lib/element/label.js +8 -8
- package/lib/element/metaLemmaMetatheorem.js +5 -5
- package/lib/element/metaType.js +17 -80
- package/lib/element/metavariable.js +34 -34
- package/lib/element/parameter.js +3 -3
- package/lib/element/premise.js +49 -58
- package/lib/element/property.js +9 -9
- package/lib/element/propertyRelation.js +13 -13
- package/lib/element/reference.js +14 -17
- package/lib/element/rule.js +21 -21
- package/lib/element/signature.js +11 -11
- package/lib/element/statement.js +18 -18
- package/lib/element/step.js +83 -55
- package/lib/element/subDerivation.js +7 -10
- package/lib/element/subproof.js +6 -14
- package/lib/element/substitution/frame.js +1 -7
- package/lib/element/substitution/reference.js +2 -3
- package/lib/element/substitution/statement.js +44 -15
- package/lib/element/substitution/term.js +10 -57
- package/lib/element/substitution.js +5 -11
- package/lib/element/substitutions.js +29 -29
- package/lib/element/supposition.js +63 -55
- package/lib/element/term.js +21 -34
- package/lib/element/type.js +47 -60
- package/lib/element/typePrefix.js +5 -5
- package/lib/element/variable.js +9 -9
- package/lib/element.js +9 -3
- package/lib/metaTypes.js +52 -0
- package/lib/node/axiomLemmaTheoremConjecture.js +9 -9
- package/lib/node/body/axiom.js +2 -25
- package/lib/node/body/conjecture.js +2 -25
- package/lib/node/body/lemma.js +2 -25
- package/lib/node/body/metaLemma.js +2 -25
- package/lib/node/body/metatheorem.js +2 -25
- package/lib/node/body/rule.js +15 -1
- package/lib/node/body/theorem.js +2 -25
- package/lib/node/body.js +25 -2
- package/lib/node/combinator.js +11 -2
- package/lib/node/constructor.js +11 -2
- package/lib/node/declaration/combinator.js +5 -5
- package/lib/node/declaration/constructor.js +8 -8
- package/lib/node/declaration/property.js +15 -15
- package/lib/node/declaration/simpleType.js +31 -31
- package/lib/node/declaration/variable.js +8 -8
- package/lib/node/equality.js +8 -8
- package/lib/node/frame.js +20 -20
- package/lib/node/header.js +22 -22
- package/lib/node/metaLemmaMetaTheorem.js +16 -16
- package/lib/node/metavariable.js +15 -15
- package/lib/node/property.js +8 -8
- package/lib/node/propertyRelation.js +8 -8
- package/lib/node/rule.js +16 -16
- package/lib/node/statement.js +12 -12
- package/lib/node/step.js +22 -22
- package/lib/node/subproof.js +8 -8
- package/lib/node/substitution/frame.js +19 -19
- package/lib/node/substitution/statement.js +19 -19
- package/lib/node/substitution/term.js +19 -19
- package/lib/node/term.js +35 -35
- package/lib/preamble.js +5 -5
- package/lib/process/instantiate.js +20 -2
- package/lib/process/unify.js +39 -42
- package/lib/process/validate.js +431 -0
- package/lib/process/verify.js +44 -135
- package/lib/types.js +27 -0
- package/lib/utilities/brackets.js +4 -4
- package/lib/utilities/element.js +91 -55
- package/lib/utilities/instance.js +18 -18
- package/lib/utilities/statement.js +2 -2
- package/lib/utilities/string.js +21 -10
- package/lib/utilities/unification.js +237 -0
- package/lib/utilities/validation.js +251 -0
- package/package.json +6 -6
- package/src/context/file.js +37 -31
- package/src/context/local.js +8 -8
- package/src/context/release.js +9 -6
- package/src/context/temporary.js +11 -11
- package/src/element/assertion/contained.js +19 -20
- package/src/element/assertion/defined.js +11 -12
- package/src/element/assertion/property.js +20 -20
- package/src/element/assertion/satisfies.js +6 -6
- package/src/element/assertion/subproof.js +17 -15
- package/src/element/assertion/type.js +2 -2
- package/src/element/assertion.js +0 -2
- package/src/element/assumption.js +22 -19
- package/src/element/axiom.js +7 -11
- package/src/element/axiomLemmaTheoremConjecture.js +36 -36
- package/src/element/{statement/combinator → combinator}/bracketed.js +7 -7
- package/src/element/combinator.js +90 -0
- package/src/element/conclusion.js +12 -10
- package/src/element/{term/constructor → constructor}/bracketed.js +5 -5
- package/src/element/{term/constructor.js → constructor.js} +17 -25
- package/src/element/declaration/combinator.js +1 -22
- package/src/element/declaration/complexType.js +11 -11
- package/src/element/declaration/constructor.js +13 -10
- package/src/element/declaration/simpleType.js +3 -3
- package/src/element/declaration/typePrefix.js +1 -1
- package/src/element/declaration/variable.js +2 -2
- package/src/element/deduction.js +12 -9
- package/src/element/derivation.js +6 -10
- package/src/element/equivalence.js +8 -8
- package/src/element/equivalences.js +4 -4
- package/src/element/frame.js +28 -30
- package/src/element/hypothesis.js +2 -2
- package/src/element/judgement.js +6 -3
- package/src/element/label.js +4 -4
- package/src/element/metaLemmaMetatheorem.js +4 -3
- package/src/element/metaType.js +9 -45
- package/src/element/metavariable.js +29 -31
- package/src/element/parameter.js +2 -2
- package/src/element/premise.js +55 -62
- package/src/element/property.js +6 -6
- package/src/element/propertyRelation.js +11 -11
- package/src/element/reference.js +12 -21
- package/src/element/rule.js +17 -16
- package/src/element/signature.js +10 -9
- package/src/element/statement.js +16 -18
- package/src/element/step.js +93 -55
- package/src/element/subDerivation.js +6 -10
- package/src/element/subproof.js +4 -12
- package/src/element/substitution/frame.js +0 -2
- package/src/element/substitution/reference.js +1 -5
- package/src/element/substitution/statement.js +44 -14
- package/src/element/substitution/term.js +10 -13
- package/src/element/substitution.js +3 -5
- package/src/element/substitutions.js +48 -30
- package/src/element/supposition.js +88 -70
- package/src/element/term.js +18 -28
- package/src/element/type.js +42 -36
- package/src/element/typePrefix.js +3 -3
- package/src/element/variable.js +7 -7
- package/src/element.js +3 -1
- package/src/metaTypes.js +42 -0
- package/src/node/axiomLemmaTheoremConjecture.js +6 -6
- package/src/node/body/axiom.js +0 -21
- package/src/node/body/conjecture.js +0 -23
- package/src/node/body/lemma.js +0 -23
- package/src/node/body/metaLemma.js +0 -23
- package/src/node/body/metatheorem.js +0 -23
- package/src/node/body/rule.js +12 -0
- package/src/node/body/theorem.js +0 -23
- package/src/node/body.js +23 -0
- package/src/node/combinator.js +9 -0
- package/src/node/constructor.js +9 -0
- package/src/node/declaration/combinator.js +5 -5
- package/src/node/declaration/constructor.js +8 -8
- package/src/node/declaration/property.js +14 -14
- package/src/node/declaration/simpleType.js +31 -31
- package/src/node/declaration/variable.js +7 -7
- package/src/node/equality.js +7 -7
- package/src/node/frame.js +21 -21
- package/src/node/header.js +22 -22
- package/src/node/metaLemmaMetaTheorem.js +14 -14
- package/src/node/metavariable.js +14 -14
- package/src/node/property.js +7 -7
- package/src/node/propertyRelation.js +7 -7
- package/src/node/rule.js +15 -15
- package/src/node/statement.js +12 -12
- package/src/node/step.js +21 -21
- package/src/node/subproof.js +7 -7
- package/src/node/substitution/frame.js +18 -18
- package/src/node/substitution/statement.js +18 -18
- package/src/node/substitution/term.js +18 -18
- package/src/node/term.js +34 -34
- package/src/preamble.js +4 -4
- package/src/process/instantiate.js +12 -0
- package/src/process/unify.js +53 -57
- package/src/process/validate.js +316 -0
- package/src/process/verify.js +50 -138
- package/src/types.js +18 -0
- package/src/utilities/brackets.js +10 -6
- package/src/utilities/element.js +125 -82
- package/src/utilities/instance.js +18 -18
- package/src/utilities/statement.js +2 -2
- package/src/utilities/string.js +34 -20
- package/src/{mixins/step/unify.js → utilities/unification.js} +82 -68
- package/src/{mixins/statement/validate.js → utilities/validation.js} +143 -69
- package/lib/element/statement/combinator.js +0 -105
- package/lib/element/term/constructor.js +0 -172
- package/lib/mixins/statement/validate.js +0 -198
- package/lib/mixins/step/unify.js +0 -228
- package/lib/mixins/term/verify.js +0 -65
- package/src/element/statement/combinator.js +0 -59
- package/src/mixins/term/verify.js +0 -81
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import elements from "
|
|
3
|
+
import elements from "../elements";
|
|
4
4
|
|
|
5
5
|
import { equalityFromStatement,
|
|
6
6
|
judgementFromStatement,
|
|
@@ -10,10 +10,80 @@ import { equalityFromStatement,
|
|
|
10
10
|
propertyAssertionFromStatement,
|
|
11
11
|
subproofAssertionFromStatement,
|
|
12
12
|
containedAssertionFromStatement,
|
|
13
|
-
satisfiesAssertionFromStatement } from "
|
|
13
|
+
satisfiesAssertionFromStatement } from "../utilities/statement";
|
|
14
14
|
|
|
15
|
-
function
|
|
16
|
-
let
|
|
15
|
+
function unifyTermWithBracketedConstructor(term, context, validateAhead) {
|
|
16
|
+
let termUnifiesWithBracketedConstructor;
|
|
17
|
+
|
|
18
|
+
const { BracketedConstructor } = elements,
|
|
19
|
+
bracketedConstructor = BracketedConstructor.fromNothing();
|
|
20
|
+
|
|
21
|
+
termUnifiesWithBracketedConstructor = bracketedConstructor.unifyTerm(term, context, validateAhead);
|
|
22
|
+
|
|
23
|
+
return termUnifiesWithBracketedConstructor;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function unifyTermWithConstructors(term, context, validateAhead) {
|
|
27
|
+
let termUnifiesWithConstructors;
|
|
28
|
+
|
|
29
|
+
const constructors = context.getConstructors();
|
|
30
|
+
|
|
31
|
+
termUnifiesWithConstructors = constructors.some((constructor) => {
|
|
32
|
+
const unifiesWithConstructor = constructor.unifyTerm(term, context, validateAhead);
|
|
33
|
+
|
|
34
|
+
if (unifiesWithConstructor) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return termUnifiesWithConstructors;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function validateTermAsVariable(term, context, validateAhead) {
|
|
43
|
+
let termValidatesAsVariable = false;
|
|
44
|
+
|
|
45
|
+
const { Variable } = elements,
|
|
46
|
+
termNode = term.getNode(),
|
|
47
|
+
singularVariableNode = termNode.getSingularVariableNode();
|
|
48
|
+
|
|
49
|
+
if (singularVariableNode !== null) {
|
|
50
|
+
let variable;
|
|
51
|
+
|
|
52
|
+
const termString = term.getString(),
|
|
53
|
+
variableNode = singularVariableNode; ///
|
|
54
|
+
|
|
55
|
+
variable = Variable.fromVariableNode(variableNode, context);
|
|
56
|
+
|
|
57
|
+
context.trace(`Verifying the '${termString}' term as a variable...`);
|
|
58
|
+
|
|
59
|
+
const variableValidates = variable.validate(context);
|
|
60
|
+
|
|
61
|
+
if (variableValidates) {
|
|
62
|
+
let verifiesAhead;
|
|
63
|
+
|
|
64
|
+
const variableIdentifier = variable.getIdentifier();
|
|
65
|
+
|
|
66
|
+
variable = context.findVariableByVariableIdentifier(variableIdentifier);
|
|
67
|
+
|
|
68
|
+
const type = variable.getType();
|
|
69
|
+
|
|
70
|
+
term.setType(type);
|
|
71
|
+
|
|
72
|
+
verifiesAhead = validateAhead();
|
|
73
|
+
|
|
74
|
+
termValidatesAsVariable = verifiesAhead; ///
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (termValidatesAsVariable) {
|
|
78
|
+
context.debug(`...verified the '${termString}' term as a variable.`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return termValidatesAsVariable;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function validateStatementAsMetavariableAndSubstitution(statement, assignments, stated, context) {
|
|
86
|
+
let statementValidatesAsMetavariableAndSubstitution = false;
|
|
17
87
|
|
|
18
88
|
const metavariable = metavariableFromStatement(statement, context);
|
|
19
89
|
|
|
@@ -34,40 +104,40 @@ function validateAsMetavariableAndSubstitution(statement, assignments, stated, c
|
|
|
34
104
|
const substitutionValidates = substitution.validate(context);
|
|
35
105
|
|
|
36
106
|
if (substitutionValidates) {
|
|
37
|
-
|
|
107
|
+
statementValidatesAsMetavariableAndSubstitution = true;
|
|
38
108
|
}
|
|
39
109
|
} else {
|
|
40
|
-
|
|
110
|
+
statementValidatesAsMetavariableAndSubstitution = true;
|
|
41
111
|
}
|
|
42
112
|
}
|
|
43
113
|
|
|
44
|
-
if (
|
|
114
|
+
if (statementValidatesAsMetavariableAndSubstitution) {
|
|
45
115
|
context.debug(`...validated the '${statementString}' statement as a metavariable and substitution.`);
|
|
46
116
|
}
|
|
47
117
|
}
|
|
48
118
|
|
|
49
|
-
return
|
|
119
|
+
return statementValidatesAsMetavariableAndSubstitution;
|
|
50
120
|
}
|
|
51
121
|
|
|
52
|
-
function
|
|
122
|
+
function unifyStatementWithBracketedCombinator(statement, assignments, stated, context) {
|
|
53
123
|
stated = true; ///
|
|
54
124
|
|
|
55
125
|
assignments = null; ///
|
|
56
126
|
|
|
57
|
-
const {
|
|
58
|
-
|
|
59
|
-
|
|
127
|
+
const { BracketedCombinator } = elements,
|
|
128
|
+
bracketedCombinator = BracketedCombinator.fromNothing(),
|
|
129
|
+
statementUnifiesWithBracketedCombinator = bracketedCombinator.unifyStatement(statement, assignments, stated, context);
|
|
60
130
|
|
|
61
|
-
return
|
|
131
|
+
return statementUnifiesWithBracketedCombinator;
|
|
62
132
|
}
|
|
63
133
|
|
|
64
|
-
function
|
|
134
|
+
function unifyStatementWithCombinators(statement, assignments, stated, context) {
|
|
65
135
|
stated = true; ///
|
|
66
136
|
|
|
67
137
|
assignments = null; ///
|
|
68
138
|
|
|
69
139
|
const combinators = context.getCombinators(),
|
|
70
|
-
|
|
140
|
+
statementUnifiesWithCombinators = combinators.some((combinator) => {
|
|
71
141
|
const unifiesWithCombinator = combinator.unifyStatement(statement, assignments, stated, context);
|
|
72
142
|
|
|
73
143
|
if (unifiesWithCombinator) {
|
|
@@ -75,11 +145,11 @@ function unifyWithCombinators(statement, assignments, stated, context) {
|
|
|
75
145
|
}
|
|
76
146
|
});
|
|
77
147
|
|
|
78
|
-
return
|
|
148
|
+
return statementUnifiesWithCombinators;
|
|
79
149
|
}
|
|
80
150
|
|
|
81
|
-
function
|
|
82
|
-
let
|
|
151
|
+
function validateStatementAsEquality(statement, assignments, stated, context) {
|
|
152
|
+
let statementValidatesAsEquality = false;
|
|
83
153
|
|
|
84
154
|
const equality = equalityFromStatement(statement, context);
|
|
85
155
|
|
|
@@ -90,18 +160,18 @@ function validateAsEquality(statement, assignments, stated, context) {
|
|
|
90
160
|
|
|
91
161
|
const equalityValidates = equality.validate(assignments, stated, context);
|
|
92
162
|
|
|
93
|
-
|
|
163
|
+
statementValidatesAsEquality = equalityValidates; ///
|
|
94
164
|
|
|
95
|
-
if (
|
|
165
|
+
if (statementValidatesAsEquality) {
|
|
96
166
|
context.debug(`...validated the '${statementString}' statement as an equality.`);
|
|
97
167
|
}
|
|
98
168
|
}
|
|
99
169
|
|
|
100
|
-
return
|
|
170
|
+
return statementValidatesAsEquality;
|
|
101
171
|
}
|
|
102
172
|
|
|
103
|
-
function
|
|
104
|
-
let
|
|
173
|
+
function validateStatementAsJudgement(statement, assignments, stated, context) {
|
|
174
|
+
let validatesStatementAsJudgement = false;
|
|
105
175
|
|
|
106
176
|
const judgement = judgementFromStatement(statement, context);
|
|
107
177
|
|
|
@@ -112,18 +182,18 @@ function validateAsJudgement(statement, assignments, stated, context) {
|
|
|
112
182
|
|
|
113
183
|
const judgementValidates = judgement.validate(assignments, stated, context);
|
|
114
184
|
|
|
115
|
-
|
|
185
|
+
validatesStatementAsJudgement = judgementValidates; ///
|
|
116
186
|
|
|
117
|
-
if (
|
|
187
|
+
if (validatesStatementAsJudgement) {
|
|
118
188
|
context.debug(`...validated the '${statementString}' statement as a judgement.`);
|
|
119
189
|
}
|
|
120
190
|
}
|
|
121
191
|
|
|
122
|
-
return
|
|
192
|
+
return validatesStatementAsJudgement;
|
|
123
193
|
}
|
|
124
194
|
|
|
125
|
-
function
|
|
126
|
-
let
|
|
195
|
+
function validateStatementAsTypeAssertion(statement, assignments, stated, context) {
|
|
196
|
+
let validatesStatementAsTypeAssertion = false;
|
|
127
197
|
|
|
128
198
|
const typeAssertion = typeAssertionFromStatement(statement, context);
|
|
129
199
|
|
|
@@ -134,9 +204,9 @@ function validateAsTypeAssertion(statement, assignments, stated, context) {
|
|
|
134
204
|
|
|
135
205
|
const typeAssertionValidates = typeAssertion.validate(assignments, stated, context);
|
|
136
206
|
|
|
137
|
-
|
|
207
|
+
validatesStatementAsTypeAssertion = typeAssertionValidates; ///
|
|
138
208
|
|
|
139
|
-
if (
|
|
209
|
+
if (validatesStatementAsTypeAssertion) {
|
|
140
210
|
const assertion = typeAssertion; ///
|
|
141
211
|
|
|
142
212
|
context.addAssertion(assertion);
|
|
@@ -145,11 +215,11 @@ function validateAsTypeAssertion(statement, assignments, stated, context) {
|
|
|
145
215
|
}
|
|
146
216
|
}
|
|
147
217
|
|
|
148
|
-
return
|
|
218
|
+
return validatesStatementAsTypeAssertion;
|
|
149
219
|
}
|
|
150
220
|
|
|
151
|
-
function
|
|
152
|
-
let
|
|
221
|
+
function validateStatementAsDefinedAssertion(statement, assignments, stated, context) {
|
|
222
|
+
let validatesStatementAsDefinedAssertion = false;
|
|
153
223
|
|
|
154
224
|
const definedAssertion = definedAssertionFromStatement(statement, context);
|
|
155
225
|
|
|
@@ -160,9 +230,9 @@ function validateAsDefinedAssertion(statement, assignments, stated, context) {
|
|
|
160
230
|
|
|
161
231
|
const definedAssertionValidates = definedAssertion.validate(assignments, stated, context);
|
|
162
232
|
|
|
163
|
-
|
|
233
|
+
validatesStatementAsDefinedAssertion = definedAssertionValidates; ///
|
|
164
234
|
|
|
165
|
-
if (
|
|
235
|
+
if (validatesStatementAsDefinedAssertion) {
|
|
166
236
|
const assertion = definedAssertion; ///
|
|
167
237
|
|
|
168
238
|
context.addAssertion(assertion);
|
|
@@ -171,11 +241,11 @@ function validateAsDefinedAssertion(statement, assignments, stated, context) {
|
|
|
171
241
|
}
|
|
172
242
|
}
|
|
173
243
|
|
|
174
|
-
return
|
|
244
|
+
return validatesStatementAsDefinedAssertion;
|
|
175
245
|
}
|
|
176
246
|
|
|
177
|
-
function
|
|
178
|
-
let
|
|
247
|
+
function validateStatementAsPropertyAssertion(statement, assignments, stated, context) {
|
|
248
|
+
let statementValidatesAsPropertyAssertion = false;
|
|
179
249
|
|
|
180
250
|
const propertyAssertion = propertyAssertionFromStatement(statement, context);
|
|
181
251
|
|
|
@@ -186,9 +256,9 @@ function validateAsPropertyAssertion(statement, assignments, stated, context) {
|
|
|
186
256
|
|
|
187
257
|
const propertyAssertionValidates = propertyAssertion.validate(assignments, stated, context);
|
|
188
258
|
|
|
189
|
-
|
|
259
|
+
statementValidatesAsPropertyAssertion = propertyAssertionValidates; ///
|
|
190
260
|
|
|
191
|
-
if (
|
|
261
|
+
if (statementValidatesAsPropertyAssertion) {
|
|
192
262
|
const assertion = propertyAssertion; ///
|
|
193
263
|
|
|
194
264
|
context.addAssertion(assertion);
|
|
@@ -197,11 +267,11 @@ function validateAsPropertyAssertion(statement, assignments, stated, context) {
|
|
|
197
267
|
}
|
|
198
268
|
}
|
|
199
269
|
|
|
200
|
-
return
|
|
270
|
+
return statementValidatesAsPropertyAssertion;
|
|
201
271
|
}
|
|
202
272
|
|
|
203
|
-
function
|
|
204
|
-
let
|
|
273
|
+
function validateStatementAsSubproofAssertion(statement, assignments, stated, context) {
|
|
274
|
+
let statementValidatesAsSubproofAssertion = false;
|
|
205
275
|
|
|
206
276
|
const subproofAssertion = subproofAssertionFromStatement(statement, context);
|
|
207
277
|
|
|
@@ -212,9 +282,9 @@ function validateAsSubproofAssertion(statement, assignments, stated, context) {
|
|
|
212
282
|
|
|
213
283
|
const subproofAssertionValidates = subproofAssertion.validate(assignments, stated, context);
|
|
214
284
|
|
|
215
|
-
|
|
285
|
+
statementValidatesAsSubproofAssertion = subproofAssertionValidates; ///
|
|
216
286
|
|
|
217
|
-
if (
|
|
287
|
+
if (statementValidatesAsSubproofAssertion) {
|
|
218
288
|
const assertion = subproofAssertion; ///
|
|
219
289
|
|
|
220
290
|
context.addAssertion(assertion);
|
|
@@ -223,11 +293,11 @@ function validateAsSubproofAssertion(statement, assignments, stated, context) {
|
|
|
223
293
|
}
|
|
224
294
|
}
|
|
225
295
|
|
|
226
|
-
return
|
|
296
|
+
return statementValidatesAsSubproofAssertion;
|
|
227
297
|
}
|
|
228
298
|
|
|
229
|
-
function
|
|
230
|
-
let
|
|
299
|
+
function validateStatementAsContainedAssertion(statement, assignments, stated, context) {
|
|
300
|
+
let validatesStatementAsContainedAssertion = false;
|
|
231
301
|
|
|
232
302
|
const containedAssertion = containedAssertionFromStatement(statement, context);
|
|
233
303
|
|
|
@@ -238,9 +308,9 @@ function validateAsContainedAssertion(statement, assignments, stated, context) {
|
|
|
238
308
|
|
|
239
309
|
const containedAssertionValidates = containedAssertion.validate(assignments, stated, context);
|
|
240
310
|
|
|
241
|
-
|
|
311
|
+
validatesStatementAsContainedAssertion = containedAssertionValidates; ///
|
|
242
312
|
|
|
243
|
-
if (
|
|
313
|
+
if (validatesStatementAsContainedAssertion) {
|
|
244
314
|
const assertion = containedAssertion; ///
|
|
245
315
|
|
|
246
316
|
context.addAssertion(assertion);
|
|
@@ -249,11 +319,11 @@ function validateAsContainedAssertion(statement, assignments, stated, context) {
|
|
|
249
319
|
}
|
|
250
320
|
}
|
|
251
321
|
|
|
252
|
-
return
|
|
322
|
+
return validatesStatementAsContainedAssertion;
|
|
253
323
|
}
|
|
254
324
|
|
|
255
|
-
function
|
|
256
|
-
let
|
|
325
|
+
function validateStatementAsSatisfiesAssertion(statement, assignments, stated, context) {
|
|
326
|
+
let validatesAStatementsSatisfiesAssertion = false;
|
|
257
327
|
|
|
258
328
|
const satisfiesAssertion = satisfiesAssertionFromStatement(statement, context);
|
|
259
329
|
|
|
@@ -264,9 +334,9 @@ function validateAsSatisfiesAssertion(statement, assignments, stated, context) {
|
|
|
264
334
|
|
|
265
335
|
const satisfiesAssertionValidates = satisfiesAssertion.validate(assignments, stated, context);
|
|
266
336
|
|
|
267
|
-
|
|
337
|
+
validatesAStatementsSatisfiesAssertion = satisfiesAssertionValidates; ///
|
|
268
338
|
|
|
269
|
-
if (
|
|
339
|
+
if (validatesAStatementsSatisfiesAssertion) {
|
|
270
340
|
const assertion = satisfiesAssertion; ///
|
|
271
341
|
|
|
272
342
|
context.addAssertion(assertion);
|
|
@@ -275,21 +345,25 @@ function validateAsSatisfiesAssertion(statement, assignments, stated, context) {
|
|
|
275
345
|
}
|
|
276
346
|
}
|
|
277
347
|
|
|
278
|
-
return
|
|
348
|
+
return validatesAStatementsSatisfiesAssertion;
|
|
279
349
|
}
|
|
280
350
|
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
validateAsEquality,
|
|
286
|
-
validateAsJudgement,
|
|
287
|
-
validateAsTypeAssertion,
|
|
288
|
-
validateAsDefinedAssertion,
|
|
289
|
-
validateAsPropertyAssertion,
|
|
290
|
-
validateAsSubproofAssertion,
|
|
291
|
-
validateAsContainedAssertion,
|
|
292
|
-
validateAsSatisfiesAssertion
|
|
351
|
+
export const validateTerms = [
|
|
352
|
+
unifyTermWithBracketedConstructor,
|
|
353
|
+
unifyTermWithConstructors,
|
|
354
|
+
validateTermAsVariable
|
|
293
355
|
];
|
|
294
356
|
|
|
295
|
-
export
|
|
357
|
+
export const validateStatements = [
|
|
358
|
+
validateStatementAsMetavariableAndSubstitution,
|
|
359
|
+
unifyStatementWithBracketedCombinator,
|
|
360
|
+
unifyStatementWithCombinators,
|
|
361
|
+
validateStatementAsEquality,
|
|
362
|
+
validateStatementAsJudgement,
|
|
363
|
+
validateStatementAsTypeAssertion,
|
|
364
|
+
validateStatementAsDefinedAssertion,
|
|
365
|
+
validateStatementAsPropertyAssertion,
|
|
366
|
+
validateStatementAsSubproofAssertion,
|
|
367
|
+
validateStatementAsContainedAssertion,
|
|
368
|
+
validateStatementAsSatisfiesAssertion
|
|
369
|
+
];
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _elements = require("../../elements");
|
|
12
|
-
var _unify = require("../../process/unify");
|
|
13
|
-
var _json = require("../../utilities/json");
|
|
14
|
-
function _class_call_check(instance, Constructor) {
|
|
15
|
-
if (!(instance instanceof Constructor)) {
|
|
16
|
-
throw new TypeError("Cannot call a class as a function");
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function _defineProperties(target, props) {
|
|
20
|
-
for(var i = 0; i < props.length; i++){
|
|
21
|
-
var descriptor = props[i];
|
|
22
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
23
|
-
descriptor.configurable = true;
|
|
24
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
25
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
29
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
30
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
31
|
-
return Constructor;
|
|
32
|
-
}
|
|
33
|
-
function _define_property(obj, key, value) {
|
|
34
|
-
if (key in obj) {
|
|
35
|
-
Object.defineProperty(obj, key, {
|
|
36
|
-
value: value,
|
|
37
|
-
enumerable: true,
|
|
38
|
-
configurable: true,
|
|
39
|
-
writable: true
|
|
40
|
-
});
|
|
41
|
-
} else {
|
|
42
|
-
obj[key] = value;
|
|
43
|
-
}
|
|
44
|
-
return obj;
|
|
45
|
-
}
|
|
46
|
-
var _CombinatorStatement;
|
|
47
|
-
var _default = (0, _elements.define)((_CombinatorStatement = /*#__PURE__*/ function() {
|
|
48
|
-
function CombinatorStatement(statement) {
|
|
49
|
-
_class_call_check(this, CombinatorStatement);
|
|
50
|
-
this.statement = statement;
|
|
51
|
-
}
|
|
52
|
-
_create_class(CombinatorStatement, [
|
|
53
|
-
{
|
|
54
|
-
key: "getStatement",
|
|
55
|
-
value: function getStatement() {
|
|
56
|
-
return this.statement;
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
key: "getString",
|
|
61
|
-
value: function getString() {
|
|
62
|
-
return this.statement.getString();
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
key: "getStatementNode",
|
|
67
|
-
value: function getStatementNode() {
|
|
68
|
-
var statementNode = this.statement.getNode();
|
|
69
|
-
return statementNode;
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
key: "unifyStatement",
|
|
74
|
-
value: function unifyStatement(statement, assignments, stated, context) {
|
|
75
|
-
var statementUnifies;
|
|
76
|
-
var statementString = statement.getString(), combinatorStatementString = this.getString();
|
|
77
|
-
context.trace("Unifying the '".concat(statementString, "' statement with the '").concat(combinatorStatementString, "' combinator's statement..."));
|
|
78
|
-
var combinatorStatement = this, statementUnifiesWithCombinator = (0, _unify.unifyStatementWithCombinatorStatement)(statement, combinatorStatement, assignments, stated, context);
|
|
79
|
-
statementUnifies = statementUnifiesWithCombinator; ///
|
|
80
|
-
if (statementUnifies) {
|
|
81
|
-
context.debug("...unified the '".concat(statementString, "' statement with the '").concat(combinatorStatementString, "' combinator's statement."));
|
|
82
|
-
}
|
|
83
|
-
return statementUnifies;
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
key: "toJSON",
|
|
88
|
-
value: function toJSON() {
|
|
89
|
-
var statementJSON = (0, _json.statementToStatementJSON)(this.statement), json = statementJSON;
|
|
90
|
-
return json;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
], [
|
|
94
|
-
{
|
|
95
|
-
key: "fromJSON",
|
|
96
|
-
value: function fromJSON(json, context) {
|
|
97
|
-
var statement = (0, _json.statementFromJSON)(json, context), combinator = new CombinatorStatement(statement);
|
|
98
|
-
return combinator;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
]);
|
|
102
|
-
return CombinatorStatement;
|
|
103
|
-
}(), _define_property(_CombinatorStatement, "name", "CombinatorStatement"), _CombinatorStatement));
|
|
104
|
-
|
|
105
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbGVtZW50L3N0YXRlbWVudC9jb21iaW5hdG9yLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5pbXBvcnQgeyBkZWZpbmUgfSBmcm9tIFwiLi4vLi4vZWxlbWVudHNcIjtcbmltcG9ydCB7IHVuaWZ5U3RhdGVtZW50V2l0aENvbWJpbmF0b3JTdGF0ZW1lbnQgfSBmcm9tIFwiLi4vLi4vcHJvY2Vzcy91bmlmeVwiO1xuaW1wb3J0IHsgc3RhdGVtZW50RnJvbUpTT04sIHN0YXRlbWVudFRvU3RhdGVtZW50SlNPTiB9IGZyb20gXCIuLi8uLi91dGlsaXRpZXMvanNvblwiO1xuXG5leHBvcnQgZGVmYXVsdCBkZWZpbmUoY2xhc3MgQ29tYmluYXRvclN0YXRlbWVudCB7XG4gIGNvbnN0cnVjdG9yKHN0YXRlbWVudCkge1xuICAgIHRoaXMuc3RhdGVtZW50ID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LFNBQVM7Z0JBRWhETyxRQUFRSSxLQUFLLENBQUMsQUFBQyxpQkFBd0RELE9BQXhDRCxpQkFBZ0IsMEJBQWtELE9BQTFCQywyQkFBMEI7Z0JBRWpHLElBQU1FLHNCQUFzQixJQUFJLEVBQzFCQyxpQ0FBaUNDLElBQUFBLDRDQUFxQyxFQUFDaEIsV0FBV2MscUJBQXFCUCxhQUFhQyxRQUFRQztnQkFFbElDLG1CQUFtQkssZ0NBQWdDLEdBQUc7Z0JBRXRELElBQUlMLGtCQUFrQjtvQkFDcEJELFFBQVFRLEtBQUssQ0FBQyxBQUFDLG1CQUEwREwsT0FBeENELGlCQUFnQiwwQkFBa0QsT0FBMUJDLDJCQUEwQjtnQkFDckc7Z0JBRUEsT0FBT0Y7WUFDVDs7O1lBRUFRLEtBQUFBO21CQUFBQSxTQUFBQTtnQkFDRSxJQUFNQyxnQkFBZ0JDLElBQUFBLDhCQUF3QixFQUFDLElBQUksQ0FBQ3BCLFNBQVMsR0FDdkRxQixPQUFPRjtnQkFFYixPQUFPRTtZQUNUOzs7O1lBSU9DLEtBQUFBO21CQUFQLFNBQU9BLFNBQVNELElBQUksRUFBRVosT0FBTztnQkFDM0IsSUFBTVQsWUFBWXVCLElBQUFBLHVCQUFpQixFQUFDRixNQUFNWixVQUNwQ2UsYUFBYSxJQUFJekIsb0JBQW9CQztnQkFFM0MsT0FBT3dCO1lBQ1Q7Ozs7S0FQQSx1Q0FBT0MsUUFBTyJ9
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _elements = /*#__PURE__*/ _interop_require_wildcard(require("../../elements"));
|
|
12
|
-
var _unify = require("../../process/unify");
|
|
13
|
-
var _json = require("../../utilities/json");
|
|
14
|
-
function _class_call_check(instance, Constructor) {
|
|
15
|
-
if (!(instance instanceof Constructor)) {
|
|
16
|
-
throw new TypeError("Cannot call a class as a function");
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function _defineProperties(target, props) {
|
|
20
|
-
for(var i = 0; i < props.length; i++){
|
|
21
|
-
var descriptor = props[i];
|
|
22
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
23
|
-
descriptor.configurable = true;
|
|
24
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
25
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
29
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
30
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
31
|
-
return Constructor;
|
|
32
|
-
}
|
|
33
|
-
function _define_property(obj, key, value) {
|
|
34
|
-
if (key in obj) {
|
|
35
|
-
Object.defineProperty(obj, key, {
|
|
36
|
-
value: value,
|
|
37
|
-
enumerable: true,
|
|
38
|
-
configurable: true,
|
|
39
|
-
writable: true
|
|
40
|
-
});
|
|
41
|
-
} else {
|
|
42
|
-
obj[key] = value;
|
|
43
|
-
}
|
|
44
|
-
return obj;
|
|
45
|
-
}
|
|
46
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
47
|
-
if (typeof WeakMap !== "function") return null;
|
|
48
|
-
var cacheBabelInterop = new WeakMap();
|
|
49
|
-
var cacheNodeInterop = new WeakMap();
|
|
50
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
51
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
52
|
-
})(nodeInterop);
|
|
53
|
-
}
|
|
54
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
55
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
56
|
-
return obj;
|
|
57
|
-
}
|
|
58
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
59
|
-
return {
|
|
60
|
-
default: obj
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
64
|
-
if (cache && cache.has(obj)) {
|
|
65
|
-
return cache.get(obj);
|
|
66
|
-
}
|
|
67
|
-
var newObj = {
|
|
68
|
-
__proto__: null
|
|
69
|
-
};
|
|
70
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
71
|
-
for(var key in obj){
|
|
72
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
73
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
74
|
-
if (desc && (desc.get || desc.set)) {
|
|
75
|
-
Object.defineProperty(newObj, key, desc);
|
|
76
|
-
} else {
|
|
77
|
-
newObj[key] = obj[key];
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
newObj.default = obj;
|
|
82
|
-
if (cache) {
|
|
83
|
-
cache.set(obj, newObj);
|
|
84
|
-
}
|
|
85
|
-
return newObj;
|
|
86
|
-
}
|
|
87
|
-
var _ConstructorTerm;
|
|
88
|
-
var _default = (0, _elements.define)((_ConstructorTerm = /*#__PURE__*/ function() {
|
|
89
|
-
function ConstructorTerm(term) {
|
|
90
|
-
_class_call_check(this, ConstructorTerm);
|
|
91
|
-
this.term = term;
|
|
92
|
-
}
|
|
93
|
-
_create_class(ConstructorTerm, [
|
|
94
|
-
{
|
|
95
|
-
key: "getTerm",
|
|
96
|
-
value: function getTerm() {
|
|
97
|
-
return this.term;
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
key: "getType",
|
|
102
|
-
value: function getType() {
|
|
103
|
-
return this.term.getType();
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
key: "getString",
|
|
108
|
-
value: function getString() {
|
|
109
|
-
return this.term.getString();
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
key: "isProvisional",
|
|
114
|
-
value: function isProvisional() {
|
|
115
|
-
return this.term.isProvisional();
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
key: "setType",
|
|
120
|
-
value: function setType(type) {
|
|
121
|
-
this.term.setType(type);
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
key: "unifyTerm",
|
|
126
|
-
value: function unifyTerm(term, context, verifyAhead) {
|
|
127
|
-
var termUnifies = false;
|
|
128
|
-
var termString = term.getString(), constructorTermString = this.getString();
|
|
129
|
-
context.trace("Unifying the '".concat(termString, "' term with the '").concat(constructorTermString, "' constructor's term..."));
|
|
130
|
-
var constructorTerm = this, termUnifiesWithConstructor = (0, _unify.unifyTermWithConstructorTerm)(term, constructorTerm, context);
|
|
131
|
-
if (termUnifiesWithConstructor) {
|
|
132
|
-
var verifiesAhead;
|
|
133
|
-
var type = this.getType();
|
|
134
|
-
term.setType(type);
|
|
135
|
-
verifiesAhead = verifyAhead();
|
|
136
|
-
termUnifies = verifiesAhead; ///
|
|
137
|
-
}
|
|
138
|
-
if (termUnifies) {
|
|
139
|
-
context.debug("...unified the '".concat(termString, "' term with the '").concat(constructorTermString, "' constructor's term."));
|
|
140
|
-
}
|
|
141
|
-
return termUnifies;
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
key: "toJSON",
|
|
146
|
-
value: function toJSON() {
|
|
147
|
-
var termJSON = (0, _json.termToTermJSON)(this.term), term = termJSON, json = {
|
|
148
|
-
term: term
|
|
149
|
-
};
|
|
150
|
-
return json;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
], [
|
|
154
|
-
{
|
|
155
|
-
key: "fromJSON",
|
|
156
|
-
value: function fromJSON(json, context) {
|
|
157
|
-
var term = (0, _json.termFromJSON)(json, context), constructor = new ConstructorTerm(term);
|
|
158
|
-
return constructor;
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
key: "fromConstructorDeclarationNode",
|
|
163
|
-
value: function fromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
164
|
-
var Term = _elements.default.Term, term = Term.fromConstructorDeclarationNode(constructorDeclarationNode, context), constructor = new ConstructorTerm(term);
|
|
165
|
-
return constructor;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
]);
|
|
169
|
-
return ConstructorTerm;
|
|
170
|
-
}(), _define_property(_ConstructorTerm, "name", "ConstructorTerm"), _ConstructorTerm));
|
|
171
|
-
|
|
172
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbGVtZW50L3Rlcm0vY29uc3RydWN0b3IuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmltcG9ydCBlbGVtZW50cyBmcm9tIFwiLi4vLi4vZWxlbWVudHNcIjtcblxuaW1wb3J0IHsgZGVmaW5lIH0gZnJvbSBcIi4uLy4uL2VsZW1lbnRzXCI7XG5pbXBvcnQgeyB1bmlmeVRlcm1XaXRoQ29uc3RydWN0b3JUZXJtIH0gZnJvbSBcIi4uLy4uL3Byb2Nlc3MvdW5pZnlcIjtcbmltcG9ydCB7IHRlcm1Gcm9tSlNPTiwgdGVybVRvVGVybUpTT04gfSBmcm9tIFwiLi4vLi4vdXRpbGl0aWVzL2pzb25cIjtcblxuZXhwb3J0IGRlZmF1bHQgZGVmaW5lKGNsYXNzIENvbnN0cnVjdG9yVGVybSB7XG4gIGNvbnN0cnVjdG9yKHRlcm0pIHtcbiAgICB0aGlzLnRlcm0gPSB0ZXJtO1xuICB9XG5cbiAgZ2V0VGVybSgpIHtcbiAgICByZXR1cm4gdGhpcy50ZXJtO1xuICB9XG5cbiAgZ2V0VHlwZS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