occam-verify-cli 1.0.662 → 1.0.664
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/.swcrc +3 -0
- package/lib/abbreviations.js +10 -10
- package/lib/action/help.js +27 -2
- package/lib/action/verify.js +33 -205
- package/lib/action/version.js +6 -6
- package/lib/commands.js +4 -4
- package/lib/constants.js +16 -16
- package/lib/context/ephemeral.js +337 -540
- package/lib/context/file/nominal.js +545 -1040
- package/lib/context/liminal.js +159 -325
- package/lib/context/literal.js +34 -138
- package/lib/context/nominal.js +29 -124
- package/lib/context/scoped.js +163 -325
- package/lib/context/synthetic.js +31 -126
- package/lib/context.js +230 -482
- package/lib/defaults.js +8 -8
- package/lib/element/assertion/contained.js +159 -299
- package/lib/element/assertion/defined.js +145 -279
- package/lib/element/assertion/property.js +132 -266
- package/lib/element/assertion/satisfies.js +108 -239
- package/lib/element/assertion/subproof.js +88 -207
- package/lib/element/assertion/type.js +132 -262
- package/lib/element/assertion.js +17 -156
- package/lib/element/assumption.js +187 -386
- package/lib/element/combinator/bracketed.js +19 -142
- package/lib/element/combinator.js +65 -228
- package/lib/element/conclusion.js +72 -370
- package/lib/element/constructor/bracketed.js +34 -157
- package/lib/element/constructor.js +81 -253
- package/lib/element/declaration/combinator.js +41 -286
- package/lib/element/declaration/complexType.js +184 -452
- package/lib/element/declaration/constructor.js +69 -323
- package/lib/element/declaration/metavariable.js +70 -317
- package/lib/element/declaration/simpleType.js +117 -378
- package/lib/element/declaration/typePrefix.js +54 -299
- package/lib/element/declaration/variable.js +74 -328
- package/lib/element/declaration.js +3 -114
- package/lib/element/deduction.js +76 -378
- package/lib/element/derivation.js +31 -340
- package/lib/element/equality.js +152 -347
- package/lib/element/equivalence.js +160 -385
- package/lib/element/equivalences.js +132 -356
- package/lib/element/error.js +16 -290
- package/lib/element/frame.js +210 -418
- package/lib/element/hypothesis.js +56 -354
- package/lib/element/judgement.js +120 -305
- package/lib/element/label.js +62 -236
- package/lib/element/metaType.js +35 -200
- package/lib/element/metavariable.js +249 -459
- package/lib/element/parameter.js +39 -202
- package/lib/element/procedureCall.js +74 -381
- package/lib/element/procedureReference.js +27 -186
- package/lib/element/proof.js +38 -349
- package/lib/element/proofAssertion/premise.js +174 -466
- package/lib/element/proofAssertion/step.js +144 -495
- package/lib/element/proofAssertion/supposition.js +170 -466
- package/lib/element/proofAssertion.js +47 -195
- package/lib/element/property.js +36 -201
- package/lib/element/propertyRelation.js +62 -223
- package/lib/element/reference.js +173 -378
- package/lib/element/rule.js +178 -673
- package/lib/element/section.js +47 -356
- package/lib/element/signature.js +96 -264
- package/lib/element/statement.js +195 -395
- package/lib/element/subDerivation.js +32 -341
- package/lib/element/subproof.js +73 -448
- package/lib/element/substitution/frame.js +114 -257
- package/lib/element/substitution/reference.js +108 -248
- package/lib/element/substitution/statement.js +223 -397
- package/lib/element/substitution/term.js +123 -266
- package/lib/element/substitution.js +97 -296
- package/lib/element/term.js +139 -339
- package/lib/element/topLevelAssertion/axiom.js +153 -459
- package/lib/element/topLevelAssertion/conjecture.js +24 -295
- package/lib/element/topLevelAssertion/lemma.js +22 -289
- package/lib/element/topLevelAssertion/theorem.js +24 -295
- package/lib/element/topLevelAssertion.js +218 -718
- package/lib/element/topLevelMetaAssertion/metaLemma.js +24 -290
- package/lib/element/topLevelMetaAssertion/metatheorem.js +24 -290
- package/lib/element/topLevelMetaAssertion.js +109 -509
- package/lib/element/type.js +198 -435
- package/lib/element/typePrefix.js +27 -186
- package/lib/element/variable.js +119 -308
- package/lib/elements.js +4 -4
- package/lib/index.js +4 -4
- package/lib/main.js +18 -18
- package/lib/messages.js +2 -2
- package/lib/metaTypeNames.js +4 -4
- package/lib/metaTypes.js +10 -10
- package/lib/node/argument.js +15 -109
- package/lib/node/assertion/contained.js +33 -130
- package/lib/node/assertion/defined.js +29 -123
- package/lib/node/assertion/property.js +18 -112
- package/lib/node/assertion/satisfies.js +14 -105
- package/lib/node/assertion/subproof.js +10 -98
- package/lib/node/assertion/type.js +14 -105
- package/lib/node/assertion.js +5 -89
- package/lib/node/assumption.js +12 -103
- package/lib/node/body/axiom.js +5 -89
- package/lib/node/body/conjecture.js +5 -89
- package/lib/node/body/lemma.js +5 -89
- package/lib/node/body/metaLemma.js +5 -89
- package/lib/node/body/metatheorem.js +5 -89
- package/lib/node/body/rule.js +26 -126
- package/lib/node/body/theorem.js +5 -89
- package/lib/node/body.js +15 -109
- package/lib/node/combinator.js +9 -97
- package/lib/node/conclusion.js +12 -103
- package/lib/node/constructor.js +9 -97
- package/lib/node/declaration/combinator.js +10 -98
- package/lib/node/declaration/complexType.js +53 -162
- package/lib/node/declaration/constructor.js +29 -123
- package/lib/node/declaration/metavariable.js +18 -112
- package/lib/node/declaration/property.js +26 -123
- package/lib/node/declaration/simpleType.js +52 -158
- package/lib/node/declaration/typePrefix.js +14 -105
- package/lib/node/declaration/variable.js +33 -130
- package/lib/node/declaration.js +5 -89
- package/lib/node/deduction.js +12 -103
- package/lib/node/derivation.js +12 -125
- package/lib/node/document.js +5 -89
- package/lib/node/equality.js +17 -111
- package/lib/node/equivalence.js +9 -97
- package/lib/node/equivalences.js +5 -89
- package/lib/node/error.js +5 -89
- package/lib/node/frame.js +26 -123
- package/lib/node/header/axiom.js +10 -98
- package/lib/node/header/conjecture.js +5 -89
- package/lib/node/header/lemma.js +5 -89
- package/lib/node/header/metaLemma.js +5 -89
- package/lib/node/header/metatheorem.js +5 -89
- package/lib/node/header/rule.js +5 -89
- package/lib/node/header/theorem.js +5 -89
- package/lib/node/header.js +30 -130
- package/lib/node/hypothesis.js +12 -103
- package/lib/node/judgement.js +15 -109
- package/lib/node/label.js +9 -97
- package/lib/node/labels.js +9 -97
- package/lib/node/metaArgument.js +9 -97
- package/lib/node/metaType.js +16 -104
- package/lib/node/metavariable.js +23 -117
- package/lib/node/parameter.js +32 -123
- package/lib/node/parenthesisedLabel.js +9 -97
- package/lib/node/parenthesisedLabels.js +12 -103
- package/lib/node/placeholder.js +5 -89
- package/lib/node/procedureCall.js +15 -109
- package/lib/node/procedureReference.js +16 -104
- package/lib/node/proof.js +9 -97
- package/lib/node/proofAssertion/premise.js +10 -98
- package/lib/node/proofAssertion/step.js +32 -132
- package/lib/node/proofAssertion/supposition.js +10 -98
- package/lib/node/proofAssertion.js +12 -103
- package/lib/node/property.js +15 -106
- package/lib/node/propertyRelation.js +15 -109
- package/lib/node/qualification.js +12 -103
- package/lib/node/reference.js +9 -97
- package/lib/node/rule.js +26 -129
- package/lib/node/section.js +22 -122
- package/lib/node/signature.js +9 -97
- package/lib/node/statement.js +93 -238
- package/lib/node/subDerivation.js +12 -125
- package/lib/node/subproof.js +18 -115
- package/lib/node/substitution/frame.js +22 -119
- package/lib/node/substitution/reference.js +22 -119
- package/lib/node/substitution/statement.js +42 -151
- package/lib/node/substitution/term.js +22 -119
- package/lib/node/substitution.js +5 -89
- package/lib/node/term.js +51 -160
- package/lib/node/topLevelAssertion/axiom.js +8 -105
- package/lib/node/topLevelAssertion/conjecture.js +8 -105
- package/lib/node/topLevelAssertion/lemma.js +8 -105
- package/lib/node/topLevelAssertion/theorem.js +8 -105
- package/lib/node/topLevelAssertion.js +29 -135
- package/lib/node/topLevelMetaAssertion/metaLemma.js +8 -105
- package/lib/node/topLevelMetaAssertion/metatheorem.js +8 -105
- package/lib/node/topLevelMetaAssertion.js +25 -128
- package/lib/node/type.js +43 -140
- package/lib/node/typePrefix.js +16 -104
- package/lib/node/types.js +9 -97
- package/lib/node/variable.js +16 -104
- package/lib/nominal/lexer.js +3 -68
- package/lib/nominal/parser.js +7 -85
- package/lib/nonTerminalNodeMap.js +171 -101
- package/lib/options.js +6 -6
- package/lib/preamble.js +62 -62
- package/lib/prepare.js +4 -4
- package/lib/process/assign.js +20 -20
- package/lib/process/equate.js +39 -117
- package/lib/process/instantiate.js +10 -9
- package/lib/process/unify.js +199 -325
- package/lib/process/validate.js +87 -195
- package/lib/process/verify.js +263 -786
- package/lib/ruleNames.js +84 -84
- package/lib/tokenTypes.js +3 -3
- package/lib/utilities/bnf.js +7 -7
- package/lib/utilities/brackets.js +18 -18
- package/lib/utilities/clock.js +8 -8
- package/lib/utilities/context.js +23 -191
- package/lib/utilities/element.js +276 -276
- package/lib/utilities/equivalence.js +7 -7
- package/lib/utilities/fileContext.js +9 -9
- package/lib/utilities/instance.js +14 -14
- package/lib/utilities/json.js +211 -211
- package/lib/utilities/releaseContext.js +19 -147
- package/lib/utilities/statement.js +10 -10
- package/lib/utilities/string.js +47 -47
- package/lib/utilities/substitutions.js +19 -19
- package/lib/utilities/type.js +5 -5
- package/lib/utilities/unification.js +196 -426
- package/lib/utilities/validation.js +72 -72
- package/package.json +1 -1
|
@@ -8,354 +8,45 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return _default;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function _assert_this_initialized(self) {
|
|
16
|
-
if (self === void 0) {
|
|
17
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
18
|
-
}
|
|
19
|
-
return self;
|
|
20
|
-
}
|
|
21
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
22
|
-
try {
|
|
23
|
-
var info = gen[key](arg);
|
|
24
|
-
var value = info.value;
|
|
25
|
-
} catch (error) {
|
|
26
|
-
reject(error);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (info.done) {
|
|
30
|
-
resolve(value);
|
|
31
|
-
} else {
|
|
32
|
-
Promise.resolve(value).then(_next, _throw);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function _async_to_generator(fn) {
|
|
36
|
-
return function() {
|
|
37
|
-
var self = this, args = arguments;
|
|
38
|
-
return new Promise(function(resolve, reject) {
|
|
39
|
-
var gen = fn.apply(self, args);
|
|
40
|
-
function _next(value) {
|
|
41
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
42
|
-
}
|
|
43
|
-
function _throw(err) {
|
|
44
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
45
|
-
}
|
|
46
|
-
_next(undefined);
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function _call_super(_this, derived, args) {
|
|
51
|
-
derived = _get_prototype_of(derived);
|
|
52
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
53
|
-
}
|
|
54
|
-
function _class_call_check(instance, Constructor) {
|
|
55
|
-
if (!(instance instanceof Constructor)) {
|
|
56
|
-
throw new TypeError("Cannot call a class as a function");
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function _construct(Parent, args, Class) {
|
|
60
|
-
if (_is_native_reflect_construct()) {
|
|
61
|
-
_construct = Reflect.construct;
|
|
62
|
-
} else {
|
|
63
|
-
_construct = function construct(Parent, args, Class) {
|
|
64
|
-
var a = [
|
|
65
|
-
null
|
|
66
|
-
];
|
|
67
|
-
a.push.apply(a, args);
|
|
68
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
69
|
-
var instance = new Constructor();
|
|
70
|
-
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
71
|
-
return instance;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
return _construct.apply(null, arguments);
|
|
75
|
-
}
|
|
76
|
-
function _defineProperties(target, props) {
|
|
77
|
-
for(var i = 0; i < props.length; i++){
|
|
78
|
-
var descriptor = props[i];
|
|
79
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
80
|
-
descriptor.configurable = true;
|
|
81
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
82
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
86
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
87
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
88
|
-
return Constructor;
|
|
89
|
-
}
|
|
90
|
-
function _define_property(obj, key, value) {
|
|
91
|
-
if (key in obj) {
|
|
92
|
-
Object.defineProperty(obj, key, {
|
|
93
|
-
value: value,
|
|
94
|
-
enumerable: true,
|
|
95
|
-
configurable: true,
|
|
96
|
-
writable: true
|
|
97
|
-
});
|
|
98
|
-
} else {
|
|
99
|
-
obj[key] = value;
|
|
100
|
-
}
|
|
101
|
-
return obj;
|
|
102
|
-
}
|
|
103
|
-
function _get_prototype_of(o) {
|
|
104
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
105
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
106
|
-
};
|
|
107
|
-
return _get_prototype_of(o);
|
|
108
|
-
}
|
|
109
|
-
function _inherits(subClass, superClass) {
|
|
110
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
111
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
112
|
-
}
|
|
113
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
114
|
-
constructor: {
|
|
115
|
-
value: subClass,
|
|
116
|
-
writable: true,
|
|
117
|
-
configurable: true
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
121
|
-
}
|
|
11
|
+
const _necessary = require("necessary");
|
|
12
|
+
const _occamlanguages = require("occam-languages");
|
|
13
|
+
const _assign = /*#__PURE__*/ _interop_require_default(require("../process/assign"));
|
|
14
|
+
const _elements = require("../elements");
|
|
122
15
|
function _interop_require_default(obj) {
|
|
123
16
|
return obj && obj.__esModule ? obj : {
|
|
124
17
|
default: obj
|
|
125
18
|
};
|
|
126
19
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return call;
|
|
20
|
+
const { last } = _necessary.arrayUtilities, { asyncEvery } = _occamlanguages.asynchronousUtilities;
|
|
21
|
+
const _default = (0, _elements.define)(class Derivation extends _occamlanguages.Element {
|
|
22
|
+
constructor(context, string, node, subproofOrProofAssertions){
|
|
23
|
+
super(context, string, node);
|
|
24
|
+
this.subproofOrProofAssertions = subproofOrProofAssertions;
|
|
133
25
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
function _set_prototype_of(o, p) {
|
|
137
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
138
|
-
o.__proto__ = p;
|
|
139
|
-
return o;
|
|
140
|
-
};
|
|
141
|
-
return _set_prototype_of(o, p);
|
|
142
|
-
}
|
|
143
|
-
function _type_of(obj) {
|
|
144
|
-
"@swc/helpers - typeof";
|
|
145
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
146
|
-
}
|
|
147
|
-
function _wrap_native_super(Class) {
|
|
148
|
-
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
149
|
-
_wrap_native_super = function wrapNativeSuper(Class) {
|
|
150
|
-
if (Class === null || !_is_native_function(Class)) return Class;
|
|
151
|
-
if (typeof Class !== "function") {
|
|
152
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
153
|
-
}
|
|
154
|
-
if (typeof _cache !== "undefined") {
|
|
155
|
-
if (_cache.has(Class)) return _cache.get(Class);
|
|
156
|
-
_cache.set(Class, Wrapper);
|
|
157
|
-
}
|
|
158
|
-
function Wrapper() {
|
|
159
|
-
return _construct(Class, arguments, _get_prototype_of(this).constructor);
|
|
160
|
-
}
|
|
161
|
-
Wrapper.prototype = Object.create(Class.prototype, {
|
|
162
|
-
constructor: {
|
|
163
|
-
value: Wrapper,
|
|
164
|
-
enumerable: false,
|
|
165
|
-
writable: true,
|
|
166
|
-
configurable: true
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
return _set_prototype_of(Wrapper, Class);
|
|
170
|
-
};
|
|
171
|
-
return _wrap_native_super(Class);
|
|
172
|
-
}
|
|
173
|
-
function _is_native_reflect_construct() {
|
|
174
|
-
try {
|
|
175
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
176
|
-
} catch (_) {}
|
|
177
|
-
return (_is_native_reflect_construct = function() {
|
|
178
|
-
return !!result;
|
|
179
|
-
})();
|
|
180
|
-
}
|
|
181
|
-
function _ts_generator(thisArg, body) {
|
|
182
|
-
var f, y, t, _ = {
|
|
183
|
-
label: 0,
|
|
184
|
-
sent: function() {
|
|
185
|
-
if (t[0] & 1) throw t[1];
|
|
186
|
-
return t[1];
|
|
187
|
-
},
|
|
188
|
-
trys: [],
|
|
189
|
-
ops: []
|
|
190
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
191
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
192
|
-
return this;
|
|
193
|
-
}), g;
|
|
194
|
-
function verb(n) {
|
|
195
|
-
return function(v) {
|
|
196
|
-
return step([
|
|
197
|
-
n,
|
|
198
|
-
v
|
|
199
|
-
]);
|
|
200
|
-
};
|
|
26
|
+
getSubproofOrProofAssertions() {
|
|
27
|
+
return this.subproofOrProofAssertions;
|
|
201
28
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
206
|
-
if (y = 0, t) op = [
|
|
207
|
-
op[0] & 2,
|
|
208
|
-
t.value
|
|
209
|
-
];
|
|
210
|
-
switch(op[0]){
|
|
211
|
-
case 0:
|
|
212
|
-
case 1:
|
|
213
|
-
t = op;
|
|
214
|
-
break;
|
|
215
|
-
case 4:
|
|
216
|
-
_.label++;
|
|
217
|
-
return {
|
|
218
|
-
value: op[1],
|
|
219
|
-
done: false
|
|
220
|
-
};
|
|
221
|
-
case 5:
|
|
222
|
-
_.label++;
|
|
223
|
-
y = op[1];
|
|
224
|
-
op = [
|
|
225
|
-
0
|
|
226
|
-
];
|
|
227
|
-
continue;
|
|
228
|
-
case 7:
|
|
229
|
-
op = _.ops.pop();
|
|
230
|
-
_.trys.pop();
|
|
231
|
-
continue;
|
|
232
|
-
default:
|
|
233
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
234
|
-
_ = 0;
|
|
235
|
-
continue;
|
|
236
|
-
}
|
|
237
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
238
|
-
_.label = op[1];
|
|
239
|
-
break;
|
|
240
|
-
}
|
|
241
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
242
|
-
_.label = t[1];
|
|
243
|
-
t = op;
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
if (t && _.label < t[2]) {
|
|
247
|
-
_.label = t[2];
|
|
248
|
-
_.ops.push(op);
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
if (t[2]) _.ops.pop();
|
|
252
|
-
_.trys.pop();
|
|
253
|
-
continue;
|
|
254
|
-
}
|
|
255
|
-
op = body.call(thisArg, _);
|
|
256
|
-
} catch (e) {
|
|
257
|
-
op = [
|
|
258
|
-
6,
|
|
259
|
-
e
|
|
260
|
-
];
|
|
261
|
-
y = 0;
|
|
262
|
-
} finally{
|
|
263
|
-
f = t = 0;
|
|
264
|
-
}
|
|
265
|
-
if (op[0] & 5) throw op[1];
|
|
266
|
-
return {
|
|
267
|
-
value: op[0] ? op[1] : void 0,
|
|
268
|
-
done: true
|
|
269
|
-
};
|
|
29
|
+
getDerivationNode() {
|
|
30
|
+
const node = this.getNode(), derivationNode = node; ///
|
|
31
|
+
return derivationNode;
|
|
270
32
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
var _default = (0, _elements.define)((_Derivation = /*#__PURE__*/ function(Element) {
|
|
275
|
-
_inherits(Derivation, Element);
|
|
276
|
-
function Derivation(context, string, node, subproofOrProofAssertions) {
|
|
277
|
-
_class_call_check(this, Derivation);
|
|
278
|
-
var _this;
|
|
279
|
-
_this = _call_super(this, Derivation, [
|
|
280
|
-
context,
|
|
281
|
-
string,
|
|
282
|
-
node
|
|
283
|
-
]);
|
|
284
|
-
_this.subproofOrProofAssertions = subproofOrProofAssertions;
|
|
285
|
-
return _this;
|
|
33
|
+
getLastProofAssertion() {
|
|
34
|
+
const lastSubproofOrProofAssertion = last(this.subproofOrProofAssertions), lastProofAssertion = lastSubproofOrProofAssertion; ///
|
|
35
|
+
return lastProofAssertion;
|
|
286
36
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
key: "getDerivationNode",
|
|
296
|
-
value: function getDerivationNode() {
|
|
297
|
-
var node = this.getNode(), derivationNode = node; ///
|
|
298
|
-
return derivationNode;
|
|
37
|
+
async verify(context) {
|
|
38
|
+
let verifies;
|
|
39
|
+
verifies = await asyncEvery(this.subproofOrProofAssertions, async (subproofOrProofAssertion)=>{
|
|
40
|
+
const subproofOrProofAssertionVerifies = await subproofOrProofAssertion.verify(context);
|
|
41
|
+
if (subproofOrProofAssertionVerifies) {
|
|
42
|
+
context.assignAssignments();
|
|
43
|
+
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
44
|
+
return true;
|
|
299
45
|
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
return lastProofAssertion;
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
key: "verify",
|
|
310
|
-
value: function verify(context) {
|
|
311
|
-
return _async_to_generator(function() {
|
|
312
|
-
var verifies;
|
|
313
|
-
return _ts_generator(this, function(_state) {
|
|
314
|
-
switch(_state.label){
|
|
315
|
-
case 0:
|
|
316
|
-
return [
|
|
317
|
-
4,
|
|
318
|
-
asyncEvery(this.subproofOrProofAssertions, function(subproofOrProofAssertion) {
|
|
319
|
-
return _async_to_generator(function() {
|
|
320
|
-
var subproofOrProofAssertionVerifies;
|
|
321
|
-
return _ts_generator(this, function(_state) {
|
|
322
|
-
switch(_state.label){
|
|
323
|
-
case 0:
|
|
324
|
-
return [
|
|
325
|
-
4,
|
|
326
|
-
subproofOrProofAssertion.verify(context)
|
|
327
|
-
];
|
|
328
|
-
case 1:
|
|
329
|
-
subproofOrProofAssertionVerifies = _state.sent();
|
|
330
|
-
if (subproofOrProofAssertionVerifies) {
|
|
331
|
-
context.assignAssignments();
|
|
332
|
-
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
333
|
-
return [
|
|
334
|
-
2,
|
|
335
|
-
true
|
|
336
|
-
];
|
|
337
|
-
}
|
|
338
|
-
return [
|
|
339
|
-
2
|
|
340
|
-
];
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
})();
|
|
344
|
-
})
|
|
345
|
-
];
|
|
346
|
-
case 1:
|
|
347
|
-
verifies = _state.sent();
|
|
348
|
-
return [
|
|
349
|
-
2,
|
|
350
|
-
verifies
|
|
351
|
-
];
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
}).call(this);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
]);
|
|
358
|
-
return Derivation;
|
|
359
|
-
}(_wrap_native_super(_occamlanguages.Element)), _define_property(_Derivation, "name", "Derivation"), _Derivation));
|
|
46
|
+
});
|
|
47
|
+
return verifies;
|
|
48
|
+
}
|
|
49
|
+
static name = "Derivation";
|
|
50
|
+
});
|
|
360
51
|
|
|
361
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
52
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lbGVt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