@tuprolog/2p-full 0.30.5 → 0.31.1-dev01

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.
Files changed (70) hide show
  1. package/2p-bdd.js +609 -0
  2. package/2p-bdd.js.map +1 -0
  3. package/2p-core.js +12057 -0
  4. package/2p-core.js.map +1 -0
  5. package/2p-datalog.js +8 -0
  6. package/2p-datalog.js.map +1 -0
  7. package/2p-dsl-core.js +8 -0
  8. package/2p-dsl-core.js.map +1 -0
  9. package/2p-dsl-solve.js +8 -0
  10. package/2p-dsl-solve.js.map +1 -0
  11. package/2p-dsl-theory.js +8 -0
  12. package/2p-dsl-theory.js.map +1 -0
  13. package/2p-dsl-unify.js +8 -0
  14. package/2p-dsl-unify.js.map +1 -0
  15. package/2p-full.d.ts +270 -0
  16. package/2p-full.js +21 -0
  17. package/2p-full.js.map +1 -0
  18. package/2p-io-lib.js +3600 -0
  19. package/2p-io-lib.js.map +1 -0
  20. package/2p-oop-lib.js +3660 -0
  21. package/2p-oop-lib.js.map +1 -0
  22. package/2p-parser-core.js +1450 -0
  23. package/2p-parser-core.js.map +1 -0
  24. package/2p-parser-js.js +29 -0
  25. package/2p-parser-js.js.map +1 -0
  26. package/2p-parser-theory.js +114 -0
  27. package/2p-parser-theory.js.map +1 -0
  28. package/2p-repl.js +519 -0
  29. package/2p-repl.js.map +1 -0
  30. package/2p-serialize-core.js +8 -0
  31. package/2p-serialize-core.js.map +1 -0
  32. package/2p-serialize-theory.js +8 -0
  33. package/2p-serialize-theory.js.map +1 -0
  34. package/2p-solve-classic.js +3329 -0
  35. package/2p-solve-classic.js.map +1 -0
  36. package/2p-solve-concurrent.js +8 -0
  37. package/2p-solve-concurrent.js.map +1 -0
  38. package/2p-solve-plp.js +44 -0
  39. package/2p-solve-plp.js.map +1 -0
  40. package/2p-solve-problog.js +4547 -0
  41. package/2p-solve-problog.js.map +1 -0
  42. package/2p-solve-streams.js +3028 -0
  43. package/2p-solve-streams.js.map +1 -0
  44. package/2p-solve.js +16824 -0
  45. package/2p-solve.js.map +1 -0
  46. package/2p-theory.js +4902 -0
  47. package/2p-theory.js.map +1 -0
  48. package/2p-unify.js +957 -0
  49. package/2p-unify.js.map +1 -0
  50. package/2p-utils.js +1423 -0
  51. package/2p-utils.js.map +1 -0
  52. package/88b0986a7186d029-atomicfu-js-ir.js +8 -0
  53. package/88b0986a7186d029-atomicfu-js-ir.js.map +1 -0
  54. package/clikt-clikt-js-ir.js +7240 -0
  55. package/clikt-clikt-js-ir.js.map +1 -0
  56. package/kotlin-kotlin-stdlib-js-ir.js +11847 -0
  57. package/kotlin-kotlin-stdlib-js-ir.js.map +1 -0
  58. package/kotlin-kotlinx-atomicfu-runtime-js-ir.js +8 -0
  59. package/kotlin-kotlinx-atomicfu-runtime-js-ir.js.map +1 -0
  60. package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js +8 -0
  61. package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js.map +1 -0
  62. package/kt-math.js +11348 -0
  63. package/kt-math.js.map +1 -0
  64. package/package.json +4 -36
  65. package/CONTRIBUTORS +0 -10
  66. package/LICENSE +0 -202
  67. package/kotlin/2p-full/it/unibo/tuprolog/tuprolog.kjsm +0 -0
  68. package/kotlin/2p-full.js +0 -15
  69. package/kotlin/2p-full.js.map +0 -1
  70. package/kotlin/2p-full.meta.js +0 -1
package/2p-utils.js ADDED
@@ -0,0 +1,1423 @@
1
+ (function (_, kotlin_kotlin, kotlin_kt_math) {
2
+ 'use strict';
3
+ //region block: imports
4
+ var imul = Math.imul;
5
+ var objectMeta = kotlin_kotlin.$_$.i7;
6
+ var setMetadataFor = kotlin_kotlin.$_$.j7;
7
+ var Unit_getInstance = kotlin_kotlin.$_$.r2;
8
+ var interfaceMeta = kotlin_kotlin.$_$.u6;
9
+ var THROW_CCE = kotlin_kotlin.$_$.sb;
10
+ var isInterface = kotlin_kotlin.$_$.y6;
11
+ var classMeta = kotlin_kotlin.$_$.m6;
12
+ var Sequence = kotlin_kotlin.$_$.f8;
13
+ var arrayIterator = kotlin_kotlin.$_$.f6;
14
+ var Comparable = kotlin_kotlin.$_$.gb;
15
+ var sequence = kotlin_kotlin.$_$.j9;
16
+ var hashCode = kotlin_kotlin.$_$.t6;
17
+ var asIterable = kotlin_kotlin.$_$.h8;
18
+ var toList = kotlin_kotlin.$_$.p9;
19
+ var asSequence = kotlin_kotlin.$_$.g3;
20
+ var asIterable_0 = kotlin_kotlin.$_$.b3;
21
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.j3;
22
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.b1;
23
+ var IntCompanionObject_getInstance = kotlin_kotlin.$_$.l2;
24
+ var IntRange = kotlin_kotlin.$_$.x7;
25
+ var zip = kotlin_kotlin.$_$.t9;
26
+ var CoroutineImpl = kotlin_kotlin.$_$.c6;
27
+ var SequenceScope = kotlin_kotlin.$_$.e8;
28
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.b6;
29
+ var withIndex = kotlin_kotlin.$_$.s9;
30
+ var equals = kotlin_kotlin.$_$.o6;
31
+ var ensureNotNull = kotlin_kotlin.$_$.vb;
32
+ var map = kotlin_kotlin.$_$.c9;
33
+ var filterNot = kotlin_kotlin.$_$.q8;
34
+ var toMutableList = kotlin_kotlin.$_$.q9;
35
+ var minWithOrNull = kotlin_kotlin.$_$.d9;
36
+ var Regex_init_$Create$ = kotlin_kotlin.$_$.h1;
37
+ var toString = kotlin_kotlin.$_$.n7;
38
+ var Companion_getInstance = kotlin_kt_math.$_$.f;
39
+ var Companion_getInstance_0 = kotlin_kt_math.$_$.e;
40
+ var isObject = kotlin_kotlin.$_$.a7;
41
+ var Map = kotlin_kotlin.$_$.w2;
42
+ var toMutableMap = kotlin_kotlin.$_$.v5;
43
+ var lazy = kotlin_kotlin.$_$.xb;
44
+ var getKClassFromExpression = kotlin_kotlin.$_$.b;
45
+ var KProperty1 = kotlin_kotlin.$_$.d8;
46
+ var getPropertyCallableRef = kotlin_kotlin.$_$.r6;
47
+ var NoSuchElementException_init_$Create$ = kotlin_kotlin.$_$.v1;
48
+ var Pair = kotlin_kotlin.$_$.qb;
49
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.p1;
50
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.f1;
51
+ var joinToString$default = kotlin_kotlin.$_$.h;
52
+ var mutableListOf = kotlin_kotlin.$_$.s4;
53
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.c1;
54
+ var addAll = kotlin_kotlin.$_$.y2;
55
+ //endregion
56
+ //region block: pre-declaration
57
+ setMetadataFor(Companion, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
58
+ function getOrSet(key, valueGenerator) {
59
+ var got = this.a3(key);
60
+ var tmp;
61
+ if (got instanceof Some) {
62
+ tmp = got.jq_1;
63
+ } else {
64
+ var tmp$ret$0;
65
+ // Inline function 'kotlin.also' call
66
+ var tmp0_also = valueGenerator();
67
+ // Inline function 'kotlin.contracts.contract' call
68
+ // Inline function 'it.unibo.tuprolog.utils.Cache.getOrSet.<anonymous>' call
69
+ this.hq(key, tmp0_also);
70
+ tmp$ret$0 = tmp0_also;
71
+ tmp = tmp$ret$0;
72
+ }
73
+ return tmp;
74
+ }
75
+ setMetadataFor(Cache, 'Cache', interfaceMeta, undefined, undefined, undefined, undefined, []);
76
+ setMetadataFor(Companion_0, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
77
+ function ifValid(consumer) {
78
+ var tmp;
79
+ if (this.lq()) {
80
+ var tmp_0 = Companion_getInstance_7();
81
+ var tmp$ret$0;
82
+ // Inline function 'kotlin.let' call
83
+ var tmp0_let = this.b1();
84
+ // Inline function 'kotlin.contracts.contract' call
85
+ tmp$ret$0 = consumer(tmp0_let);
86
+ tmp = tmp_0.pq(tmp$ret$0);
87
+ } else {
88
+ tmp = Companion_getInstance_7().oq();
89
+ }
90
+ return tmp;
91
+ }
92
+ setMetadataFor(Cached, 'Cached', interfaceMeta, undefined, undefined, undefined, undefined, []);
93
+ function castTo() {
94
+ return isInterface(this, Castable) ? this : THROW_CCE();
95
+ }
96
+ setMetadataFor(Castable, 'Castable', interfaceMeta, undefined, undefined, undefined, undefined, []);
97
+ setMetadataFor(Companion_1, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
98
+ setMetadataFor(_no_name_provided__qut3iv, undefined, classMeta, undefined, undefined, undefined, undefined, []);
99
+ setMetadataFor(_no_name_provided__qut3iv_0, undefined, classMeta, undefined, [Sequence], undefined, undefined, []);
100
+ function asIterable_1() {
101
+ var tmp$ret$0;
102
+ // Inline function 'kotlin.collections.Iterable' call
103
+ tmp$ret$0 = new _no_name_provided__qut3iv(this);
104
+ return tmp$ret$0;
105
+ }
106
+ function asSequence_0() {
107
+ var tmp$ret$0;
108
+ // Inline function 'kotlin.sequences.Sequence' call
109
+ tmp$ret$0 = new _no_name_provided__qut3iv_0(this);
110
+ return tmp$ret$0;
111
+ }
112
+ setMetadataFor(Cursor, 'Cursor', interfaceMeta, undefined, undefined, undefined, undefined, []);
113
+ function component1() {
114
+ return this.yq();
115
+ }
116
+ function component2() {
117
+ return this.b1();
118
+ }
119
+ setMetadataFor(Indexed, 'Indexed', interfaceMeta, undefined, undefined, undefined, undefined, []);
120
+ setMetadataFor(Companion_2, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
121
+ function compareTo(other) {
122
+ return this.yq() - other.yq() | 0;
123
+ }
124
+ setMetadataFor(IntIndexed, 'IntIndexed', interfaceMeta, undefined, [Indexed, Comparable], undefined, undefined, []);
125
+ setMetadataFor(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', classMeta, undefined, undefined, undefined, undefined, []);
126
+ setMetadataFor(dropLast$slambda, 'dropLast$slambda', classMeta, CoroutineImpl, undefined, undefined, undefined, [1]);
127
+ setMetadataFor(insertAt$slambda, 'insertAt$slambda', classMeta, CoroutineImpl, undefined, undefined, undefined, [1]);
128
+ setMetadataFor(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', classMeta, undefined, undefined, undefined, undefined, []);
129
+ setMetadataFor(merge$slambda, 'merge$slambda', classMeta, CoroutineImpl, undefined, undefined, undefined, [1]);
130
+ setMetadataFor(Companion_3, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
131
+ function compareTo_0(other) {
132
+ return this.yq().ch(other.yq()).rh();
133
+ }
134
+ setMetadataFor(LongIndexed, 'LongIndexed', interfaceMeta, undefined, [Indexed, Comparable], undefined, undefined, []);
135
+ setMetadataFor(Companion_4, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
136
+ setMetadataFor(NumberTypeTester, 'NumberTypeTester', classMeta, undefined, undefined, undefined, undefined, []);
137
+ setMetadataFor(Companion_5, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
138
+ setMetadataFor(Optional, 'Optional', classMeta, undefined, undefined, undefined, undefined, []);
139
+ setMetadataFor(Some, 'Some', classMeta, Optional, undefined, undefined, undefined, []);
140
+ setMetadataFor(None, 'None', objectMeta, Optional, undefined, undefined, undefined, []);
141
+ function getTag(name) {
142
+ var tmp = this.kt().a3(name);
143
+ return (tmp == null ? true : isObject(tmp)) ? tmp : THROW_CCE();
144
+ }
145
+ function containsTag(name) {
146
+ var tmp$ret$1;
147
+ // Inline function 'kotlin.collections.contains' call
148
+ var tmp0_contains = this.kt();
149
+ var tmp$ret$0;
150
+ // Inline function 'kotlin.collections.containsKey' call
151
+ tmp$ret$0 = (isInterface(tmp0_contains, Map) ? tmp0_contains : THROW_CCE()).u2(name);
152
+ tmp$ret$1 = tmp$ret$0;
153
+ return tmp$ret$1;
154
+ }
155
+ setMetadataFor(Taggable, 'Taggable', interfaceMeta, undefined, undefined, undefined, undefined, []);
156
+ setMetadataFor(Companion_6, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
157
+ setMetadataFor(AbstractCursor$iterator$1, undefined, classMeta, undefined, undefined, undefined, undefined, []);
158
+ setMetadataFor(AbstractCursor, 'AbstractCursor', classMeta, undefined, [Cursor], undefined, undefined, []);
159
+ setMetadataFor(CachedImpl, 'CachedImpl', classMeta, undefined, [Cached], undefined, undefined, []);
160
+ setMetadataFor(ConjunctionCursor, 'ConjunctionCursor', classMeta, AbstractCursor, undefined, undefined, undefined, []);
161
+ setMetadataFor(EmptyCursor, 'EmptyCursor', objectMeta, AbstractCursor, undefined, undefined, undefined, []);
162
+ setMetadataFor(IntIndexedImpl, 'IntIndexedImpl', classMeta, undefined, [IntIndexed], undefined, undefined, []);
163
+ setMetadataFor(LazyCursor, 'LazyCursor', classMeta, AbstractCursor, undefined, undefined, undefined, []);
164
+ setMetadataFor(LongIndexedImpl, 'LongIndexedImpl', classMeta, undefined, [LongIndexed], undefined, undefined, []);
165
+ setMetadataFor(MapperCursor, 'MapperCursor', classMeta, AbstractCursor, undefined, undefined, undefined, []);
166
+ setMetadataFor(NonLastCursor, 'NonLastCursor', classMeta, AbstractCursor, undefined, undefined, undefined, []);
167
+ setMetadataFor(SimpleLRUCache, 'SimpleLRUCache', classMeta, undefined, [Cache], undefined, undefined, []);
168
+ setMetadataFor(ValueCursor, 'ValueCursor', classMeta, AbstractCursor, undefined, undefined, undefined, []);
169
+ //endregion
170
+ function Companion() {
171
+ Companion_instance = this;
172
+ }
173
+ Companion.prototype.gq = function (capacity) {
174
+ return new SimpleLRUCache(capacity);
175
+ };
176
+ var Companion_instance;
177
+ function Companion_getInstance_1() {
178
+ if (Companion_instance == null)
179
+ new Companion();
180
+ return Companion_instance;
181
+ }
182
+ function Cache() {
183
+ }
184
+ function Companion_0() {
185
+ Companion_instance_0 = this;
186
+ }
187
+ Companion_0.prototype.kq = function (generator) {
188
+ return new CachedImpl(generator);
189
+ };
190
+ var Companion_instance_0;
191
+ function Companion_getInstance_2() {
192
+ if (Companion_instance_0 == null)
193
+ new Companion_0();
194
+ return Companion_instance_0;
195
+ }
196
+ function Cached() {
197
+ }
198
+ function Castable() {
199
+ }
200
+ function Companion_1() {
201
+ Companion_instance_1 = this;
202
+ }
203
+ Companion_1.prototype.of = function (iterator) {
204
+ return toCursor(iterator);
205
+ };
206
+ Companion_1.prototype.ofSequence = function (sequence) {
207
+ return cursor_0(sequence);
208
+ };
209
+ Companion_1.prototype.empty = function () {
210
+ return EmptyCursor_getInstance();
211
+ };
212
+ var Companion_instance_1;
213
+ function Companion_getInstance_3() {
214
+ if (Companion_instance_1 == null)
215
+ new Companion_1();
216
+ return Companion_instance_1;
217
+ }
218
+ function _no_name_provided__qut3iv(this$0) {
219
+ this.rq_1 = this$0;
220
+ }
221
+ _no_name_provided__qut3iv.prototype.j = function () {
222
+ var tmp$ret$0;
223
+ // Inline function 'it.unibo.tuprolog.utils.Cursor.asIterable.<anonymous>' call
224
+ tmp$ret$0 = this.rq_1.iterator();
225
+ return tmp$ret$0;
226
+ };
227
+ function _no_name_provided__qut3iv_0(this$0) {
228
+ this.sq_1 = this$0;
229
+ }
230
+ _no_name_provided__qut3iv_0.prototype.j = function () {
231
+ var tmp$ret$0;
232
+ // Inline function 'it.unibo.tuprolog.utils.Cursor.asSequence.<anonymous>' call
233
+ tmp$ret$0 = this.sq_1.iterator();
234
+ return tmp$ret$0;
235
+ };
236
+ function Cursor() {
237
+ }
238
+ function cursor(_this__u8e3s4) {
239
+ return toCursor(_this__u8e3s4.j());
240
+ }
241
+ function cursor_0(_this__u8e3s4) {
242
+ return toCursor(_this__u8e3s4.j());
243
+ }
244
+ function cursor_1(_this__u8e3s4) {
245
+ return toCursor(arrayIterator(_this__u8e3s4));
246
+ }
247
+ function plus(_this__u8e3s4, other) {
248
+ return other.vq() ? new ConjunctionCursor(_this__u8e3s4, forceCast(other)) : _this__u8e3s4.vq() ? _this__u8e3s4 : EmptyCursor_getInstance();
249
+ }
250
+ function toCursor(_this__u8e3s4) {
251
+ return Companion_getInstance_8().xq(_this__u8e3s4);
252
+ }
253
+ function Indexed() {
254
+ }
255
+ function Companion_2() {
256
+ Companion_instance_2 = this;
257
+ }
258
+ Companion_2.prototype.zq = function (index, value) {
259
+ return new IntIndexedImpl(index, value);
260
+ };
261
+ var Companion_instance_2;
262
+ function Companion_getInstance_4() {
263
+ if (Companion_instance_2 == null)
264
+ new Companion_2();
265
+ return Companion_instance_2;
266
+ }
267
+ function IntIndexed() {
268
+ }
269
+ function dropLast(_this__u8e3s4) {
270
+ return sequence(dropLast$slambda_0(_this__u8e3s4, null));
271
+ }
272
+ function itemWiseHashCode(iterable) {
273
+ var hash = 13;
274
+ var i = iterable.j();
275
+ while (i.m()) {
276
+ var tmp = imul(31, hash);
277
+ var tmp0_safe_receiver = i.p();
278
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : hashCode(tmp0_safe_receiver);
279
+ hash = tmp + (tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs) | 0;
280
+ }
281
+ return hash;
282
+ }
283
+ function insertAt(_this__u8e3s4, index, item, items) {
284
+ return sequence(insertAt$slambda_0(_this__u8e3s4, index, item, items, null));
285
+ }
286
+ function itemWiseHashCode_0(sequence) {
287
+ return itemWiseHashCode(asIterable(sequence));
288
+ }
289
+ function itemWiseEquals(sequence1, sequence2, comparator) {
290
+ return itemWiseEquals_0(asIterable(sequence1), asIterable(sequence2), comparator);
291
+ }
292
+ function cached(_this__u8e3s4) {
293
+ return cursor_0(_this__u8e3s4).asSequence();
294
+ }
295
+ function buffered(_this__u8e3s4) {
296
+ return asSequence(toList(_this__u8e3s4));
297
+ }
298
+ function itemWiseEquals_0(iterable1, iterable2, comparator) {
299
+ var i = iterable1.j();
300
+ var j = iterable2.j();
301
+ while (i.m() ? j.m() : false) {
302
+ var a = i.p();
303
+ var b = j.p();
304
+ if (!comparator(a, b)) {
305
+ return false;
306
+ }
307
+ }
308
+ return i.m() === j.m();
309
+ }
310
+ function itemWiseEquals_1(iterable1, iterable2) {
311
+ return itemWiseEquals_0(iterable1, iterable2, itemWiseEquals$lambda);
312
+ }
313
+ function itemWiseHashCode_1(items) {
314
+ return itemWiseHashCode(asIterable_0(items));
315
+ }
316
+ function mergeSequences(iterables, comparator) {
317
+ var tmp = new sam$kotlin_Comparator$0(comparator);
318
+ var tmp$ret$2;
319
+ // Inline function 'kotlin.collections.map' call
320
+ var tmp$ret$1;
321
+ // Inline function 'kotlin.collections.mapTo' call
322
+ var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(iterables, 10));
323
+ var tmp0_iterator = iterables.j();
324
+ while (tmp0_iterator.m()) {
325
+ var item = tmp0_iterator.p();
326
+ var tmp$ret$0;
327
+ // Inline function 'it.unibo.tuprolog.utils.mergeSequences.<anonymous>' call
328
+ tmp$ret$0 = asIterable(item);
329
+ tmp0_mapTo.g(tmp$ret$0);
330
+ }
331
+ tmp$ret$1 = tmp0_mapTo;
332
+ tmp$ret$2 = tmp$ret$1;
333
+ return merge(tmp, tmp$ret$2);
334
+ }
335
+ function merge(comparator, iterables) {
336
+ return sequence(merge$slambda_0(iterables, comparator, null));
337
+ }
338
+ function indexed(_this__u8e3s4) {
339
+ var tmp = asSequence(new IntRange(0, IntCompanionObject_getInstance().MAX_VALUE));
340
+ return zip(_this__u8e3s4, tmp, indexed$lambda);
341
+ }
342
+ function sam$kotlin_Comparator$0(function_0) {
343
+ this.br_1 = function_0;
344
+ }
345
+ sam$kotlin_Comparator$0.prototype.cg = function (a, b) {
346
+ return this.br_1(a, b);
347
+ };
348
+ sam$kotlin_Comparator$0.prototype.compare = function (a, b) {
349
+ return this.cg(a, b);
350
+ };
351
+ function dropLast$slambda($this_dropLast, resultContinuation) {
352
+ this.kr_1 = $this_dropLast;
353
+ CoroutineImpl.call(this, resultContinuation);
354
+ }
355
+ dropLast$slambda.prototype.pr = function ($this$sequence, $cont) {
356
+ var tmp = this.qr($this$sequence, $cont);
357
+ tmp.ei_1 = Unit_getInstance();
358
+ tmp.fi_1 = null;
359
+ return tmp.ki();
360
+ };
361
+ dropLast$slambda.prototype.wi = function (p1, $cont) {
362
+ return this.pr(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
363
+ };
364
+ dropLast$slambda.prototype.ki = function () {
365
+ var suspendResult = this.ei_1;
366
+ $sm: do
367
+ try {
368
+ var tmp = this.ci_1;
369
+ switch (tmp) {
370
+ case 0:
371
+ this.di_1 = 5;
372
+ this.mr_1 = this.kr_1.j();
373
+ this.ci_1 = 1;
374
+ continue $sm;
375
+ case 1:
376
+ if (!this.mr_1.m()) {
377
+ this.ci_1 = 4;
378
+ continue $sm;
379
+ }
380
+
381
+ this.nr_1 = this.mr_1.p();
382
+ if (this.mr_1.m()) {
383
+ this.ci_1 = 2;
384
+ suspendResult = this.lr_1.z4(this.nr_1, this);
385
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
386
+ return suspendResult;
387
+ }
388
+ continue $sm;
389
+ } else {
390
+ this.ci_1 = 3;
391
+ continue $sm;
392
+ }
393
+
394
+ break;
395
+ case 2:
396
+ this.ci_1 = 3;
397
+ continue $sm;
398
+ case 3:
399
+ this.ci_1 = 1;
400
+ continue $sm;
401
+ case 4:
402
+ return Unit_getInstance();
403
+ case 5:
404
+ throw this.fi_1;
405
+ }
406
+ } catch ($p) {
407
+ if (this.di_1 === 5) {
408
+ throw $p;
409
+ } else {
410
+ this.ci_1 = this.di_1;
411
+ this.fi_1 = $p;
412
+ }
413
+ }
414
+ while (true);
415
+ };
416
+ dropLast$slambda.prototype.qr = function ($this$sequence, completion) {
417
+ var i = new dropLast$slambda(this.kr_1, completion);
418
+ i.lr_1 = $this$sequence;
419
+ return i;
420
+ };
421
+ function dropLast$slambda_0($this_dropLast, resultContinuation) {
422
+ var i = new dropLast$slambda($this_dropLast, resultContinuation);
423
+ var l = function ($this$sequence, $cont) {
424
+ return i.pr($this$sequence, $cont);
425
+ };
426
+ l.$arity = 1;
427
+ return l;
428
+ }
429
+ function insertAt$slambda($this_insertAt, $index, $item, $items, resultContinuation) {
430
+ this.zr_1 = $this_insertAt;
431
+ this.as_1 = $index;
432
+ this.bs_1 = $item;
433
+ this.cs_1 = $items;
434
+ CoroutineImpl.call(this, resultContinuation);
435
+ }
436
+ insertAt$slambda.prototype.pr = function ($this$sequence, $cont) {
437
+ var tmp = this.qr($this$sequence, $cont);
438
+ tmp.ei_1 = Unit_getInstance();
439
+ tmp.fi_1 = null;
440
+ return tmp.ki();
441
+ };
442
+ insertAt$slambda.prototype.wi = function (p1, $cont) {
443
+ return this.pr(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
444
+ };
445
+ insertAt$slambda.prototype.ki = function () {
446
+ var suspendResult = this.ei_1;
447
+ $sm: do
448
+ try {
449
+ var tmp = this.ci_1;
450
+ switch (tmp) {
451
+ case 0:
452
+ this.di_1 = 7;
453
+ this.es_1 = asIterable(withIndex(this.zr_1)).j();
454
+ this.ci_1 = 1;
455
+ continue $sm;
456
+ case 1:
457
+ if (!this.es_1.m()) {
458
+ this.ci_1 = 6;
459
+ continue $sm;
460
+ }
461
+
462
+ this.fs_1 = this.es_1.p();
463
+ this.gs_1 = this.fs_1.n3();
464
+ this.hs_1 = this.fs_1.o3();
465
+ if (this.gs_1 === this.as_1) {
466
+ this.ci_1 = 2;
467
+ suspendResult = this.ds_1.z4(this.bs_1, this);
468
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
469
+ return suspendResult;
470
+ }
471
+ continue $sm;
472
+ } else {
473
+ this.ci_1 = 4;
474
+ continue $sm;
475
+ }
476
+
477
+ break;
478
+ case 2:
479
+ this.ci_1 = 3;
480
+ suspendResult = this.ds_1.b5(asIterable_0(this.cs_1), this);
481
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
482
+ return suspendResult;
483
+ }
484
+
485
+ continue $sm;
486
+ case 3:
487
+ this.ci_1 = 4;
488
+ continue $sm;
489
+ case 4:
490
+ this.ci_1 = 5;
491
+ suspendResult = this.ds_1.z4(this.hs_1, this);
492
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
493
+ return suspendResult;
494
+ }
495
+
496
+ continue $sm;
497
+ case 5:
498
+ this.ci_1 = 1;
499
+ continue $sm;
500
+ case 6:
501
+ return Unit_getInstance();
502
+ case 7:
503
+ throw this.fi_1;
504
+ }
505
+ } catch ($p) {
506
+ if (this.di_1 === 7) {
507
+ throw $p;
508
+ } else {
509
+ this.ci_1 = this.di_1;
510
+ this.fi_1 = $p;
511
+ }
512
+ }
513
+ while (true);
514
+ };
515
+ insertAt$slambda.prototype.qr = function ($this$sequence, completion) {
516
+ var i = new insertAt$slambda(this.zr_1, this.as_1, this.bs_1, this.cs_1, completion);
517
+ i.ds_1 = $this$sequence;
518
+ return i;
519
+ };
520
+ function insertAt$slambda_0($this_insertAt, $index, $item, $items, resultContinuation) {
521
+ var i = new insertAt$slambda($this_insertAt, $index, $item, $items, resultContinuation);
522
+ var l = function ($this$sequence, $cont) {
523
+ return i.pr($this$sequence, $cont);
524
+ };
525
+ l.$arity = 1;
526
+ return l;
527
+ }
528
+ function itemWiseEquals$lambda(a, b) {
529
+ return equals(a, b);
530
+ }
531
+ function sam$kotlin_Comparator$0_0(function_0) {
532
+ this.is_1 = function_0;
533
+ }
534
+ sam$kotlin_Comparator$0_0.prototype.cg = function (a, b) {
535
+ return this.is_1(a, b);
536
+ };
537
+ sam$kotlin_Comparator$0_0.prototype.compare = function (a, b) {
538
+ return this.cg(a, b);
539
+ };
540
+ function merge$slambda$lambda(it) {
541
+ return cursor(it);
542
+ }
543
+ function merge$slambda$lambda_0(it) {
544
+ return it.wq();
545
+ }
546
+ function merge$slambda$lambda_1(it) {
547
+ return ensureNotNull(it.uq());
548
+ }
549
+ function merge$slambda$lambda_2($comparator) {
550
+ return function (a, b) {
551
+ return $comparator.compare(a.b1(), b.b1());
552
+ };
553
+ }
554
+ function merge$slambda($iterables, $comparator, resultContinuation) {
555
+ this.rs_1 = $iterables;
556
+ this.ss_1 = $comparator;
557
+ CoroutineImpl.call(this, resultContinuation);
558
+ }
559
+ merge$slambda.prototype.pr = function ($this$sequence, $cont) {
560
+ var tmp = this.qr($this$sequence, $cont);
561
+ tmp.ei_1 = Unit_getInstance();
562
+ tmp.fi_1 = null;
563
+ return tmp.ki();
564
+ };
565
+ merge$slambda.prototype.wi = function (p1, $cont) {
566
+ return this.pr(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
567
+ };
568
+ merge$slambda.prototype.ki = function () {
569
+ var suspendResult = this.ei_1;
570
+ $sm: do
571
+ try {
572
+ var tmp = this.ci_1;
573
+ switch (tmp) {
574
+ case 0:
575
+ this.di_1 = 3;
576
+ var tmp_0 = this;
577
+ var tmp_1 = asSequence(this.rs_1);
578
+ var tmp_2 = map(tmp_1, merge$slambda$lambda);
579
+ tmp_0.us_1 = toMutableList(filterNot(tmp_2, merge$slambda$lambda_0));
580
+ this.ci_1 = 1;
581
+ continue $sm;
582
+ case 1:
583
+ if (!!this.us_1.d()) {
584
+ this.ci_1 = 4;
585
+ continue $sm;
586
+ }
587
+
588
+ var tmp_3 = this;
589
+ var tmp_4 = asSequence(this.us_1);
590
+ var tmp_5 = indexed(map(tmp_4, merge$slambda$lambda_1));
591
+ var tmp_6 = merge$slambda$lambda_2(this.ss_1);
592
+ tmp_3.vs_1 = ensureNotNull(minWithOrNull(tmp_5, new sam$kotlin_Comparator$0_0(tmp_6)));
593
+ this.ws_1 = this.vs_1.n3();
594
+ this.xs_1 = this.vs_1.o3();
595
+ this.ci_1 = 2;
596
+ suspendResult = this.ts_1.z4(this.xs_1, this);
597
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
598
+ return suspendResult;
599
+ }
600
+
601
+ continue $sm;
602
+ case 2:
603
+ var tmp0_let = this.us_1.n(this.ws_1).tq();
604
+ if (tmp0_let.wq()) {
605
+ this.us_1.t4(this.ws_1);
606
+ } else {
607
+ this.us_1.s4(this.ws_1, tmp0_let);
608
+ }
609
+
610
+ ;
611
+ this.ci_1 = 1;
612
+ continue $sm;
613
+ case 3:
614
+ throw this.fi_1;
615
+ case 4:
616
+ return Unit_getInstance();
617
+ }
618
+ } catch ($p) {
619
+ if (this.di_1 === 3) {
620
+ throw $p;
621
+ } else {
622
+ this.ci_1 = this.di_1;
623
+ this.fi_1 = $p;
624
+ }
625
+ }
626
+ while (true);
627
+ };
628
+ merge$slambda.prototype.qr = function ($this$sequence, completion) {
629
+ var i = new merge$slambda(this.rs_1, this.ss_1, completion);
630
+ i.ts_1 = $this$sequence;
631
+ return i;
632
+ };
633
+ function merge$slambda_0($iterables, $comparator, resultContinuation) {
634
+ var i = new merge$slambda($iterables, $comparator, resultContinuation);
635
+ var l = function ($this$sequence, $cont) {
636
+ return i.pr($this$sequence, $cont);
637
+ };
638
+ l.$arity = 1;
639
+ return l;
640
+ }
641
+ function indexed$lambda(it, i) {
642
+ return Companion_getInstance_4().zq(i, it);
643
+ }
644
+ function Companion_3() {
645
+ Companion_instance_3 = this;
646
+ }
647
+ Companion_3.prototype.ys = function (index, value) {
648
+ return new LongIndexedImpl(index, value);
649
+ };
650
+ var Companion_instance_3;
651
+ function Companion_getInstance_5() {
652
+ if (Companion_instance_3 == null)
653
+ new Companion_3();
654
+ return Companion_instance_3;
655
+ }
656
+ function LongIndexed() {
657
+ }
658
+ function Companion_4() {
659
+ Companion_instance_4 = this;
660
+ var tmp = this;
661
+ var tmp$ret$0;
662
+ // Inline function 'kotlin.text.toRegex' call
663
+ tmp$ret$0 = Regex_init_$Create$('[0-9]+');
664
+ tmp.at_1 = tmp$ret$0;
665
+ }
666
+ var Companion_instance_4;
667
+ function Companion_getInstance_6() {
668
+ if (Companion_instance_4 == null)
669
+ new Companion_4();
670
+ return Companion_instance_4;
671
+ }
672
+ function _get_stringRepresentation__xuqjt9(_this__u8e3s4, $this) {
673
+ return $this.bt_1.iq(_this__u8e3s4, NumberTypeTester$_get_stringRepresentation_$lambda_7w0qtg(_this__u8e3s4));
674
+ }
675
+ function NumberTypeTester$_get_stringRepresentation_$lambda_7w0qtg($this_stringRepresentation) {
676
+ return function () {
677
+ return toString($this_stringRepresentation);
678
+ };
679
+ }
680
+ function NumberTypeTester() {
681
+ Companion_getInstance_6();
682
+ this.bt_1 = Companion_getInstance_1().gq(8);
683
+ }
684
+ NumberTypeTester.prototype.ct = function (_this__u8e3s4) {
685
+ return Companion_getInstance_6().at_1.ef(_get_stringRepresentation__xuqjt9(_this__u8e3s4, this));
686
+ };
687
+ NumberTypeTester.prototype.dt = function (_this__u8e3s4) {
688
+ return Companion_getInstance().parse(_get_stringRepresentation__xuqjt9(_this__u8e3s4, this));
689
+ };
690
+ NumberTypeTester.prototype.et = function (_this__u8e3s4) {
691
+ var tmp = Companion_getInstance_0();
692
+ var tmp_0 = _get_stringRepresentation__xuqjt9(_this__u8e3s4, this);
693
+ return tmp.sj(tmp_0, null, 2, null);
694
+ };
695
+ function Companion_5() {
696
+ Companion_instance_5 = this;
697
+ }
698
+ Companion_5.prototype.ft = function (value) {
699
+ return new Some(value);
700
+ };
701
+ Companion_5.prototype.pq = function (value) {
702
+ var tmp;
703
+ if (value == null) {
704
+ tmp = this.oq();
705
+ } else {
706
+ tmp = this.ft(value);
707
+ }
708
+ return tmp;
709
+ };
710
+ Companion_5.prototype.oq = function () {
711
+ return None_getInstance();
712
+ };
713
+ var Companion_instance_5;
714
+ function Companion_getInstance_7() {
715
+ if (Companion_instance_5 == null)
716
+ new Companion_5();
717
+ return Companion_instance_5;
718
+ }
719
+ function Some(value) {
720
+ Optional.call(this);
721
+ this.jq_1 = value;
722
+ }
723
+ Some.prototype.b1 = function () {
724
+ return this.jq_1;
725
+ };
726
+ Some.prototype.gt = function () {
727
+ return true;
728
+ };
729
+ Some.prototype.ht = function (function_0) {
730
+ return new Some(function_0(this.jq_1));
731
+ };
732
+ Some.prototype.toString = function () {
733
+ return 'Some(' + this.jq_1 + ')';
734
+ };
735
+ Some.prototype.hashCode = function () {
736
+ return this.jq_1 == null ? 0 : hashCode(this.jq_1);
737
+ };
738
+ Some.prototype.equals = function (other) {
739
+ if (this === other)
740
+ return true;
741
+ if (!(other instanceof Some))
742
+ return false;
743
+ var tmp0_other_with_cast = other instanceof Some ? other : THROW_CCE();
744
+ if (!equals(this.jq_1, tmp0_other_with_cast.jq_1))
745
+ return false;
746
+ return true;
747
+ };
748
+ function None() {
749
+ None_instance = this;
750
+ Optional.call(this);
751
+ }
752
+ None.prototype.b1 = function () {
753
+ return null;
754
+ };
755
+ None.prototype.gt = function () {
756
+ return false;
757
+ };
758
+ None.prototype.jt = function (function_0) {
759
+ return None_getInstance();
760
+ };
761
+ None.prototype.ht = function (function_0) {
762
+ return this.jt(function_0);
763
+ };
764
+ None.prototype.toString = function () {
765
+ return 'None';
766
+ };
767
+ var None_instance;
768
+ function None_getInstance() {
769
+ if (None_instance == null)
770
+ new None();
771
+ return None_instance;
772
+ }
773
+ function Optional() {
774
+ Companion_getInstance_7();
775
+ }
776
+ Optional.prototype.it = function () {
777
+ return !this.gt();
778
+ };
779
+ function Taggable() {
780
+ }
781
+ function setTags(_this__u8e3s4, tags) {
782
+ var tmp = _this__u8e3s4.resetTags(tags);
783
+ return isInterface(tmp, Taggable) ? tmp : THROW_CCE();
784
+ }
785
+ function setTag(_this__u8e3s4, key, value) {
786
+ var tmp$ret$0;
787
+ // Inline function 'kotlin.also' call
788
+ var tmp0_also = toMutableMap(_this__u8e3s4.kt());
789
+ // Inline function 'kotlin.contracts.contract' call
790
+ // Inline function 'it.unibo.tuprolog.utils.setTag.<anonymous>' call
791
+ // Inline function 'kotlin.collections.set' call
792
+ tmp0_also.w3(key, value);
793
+ tmp$ret$0 = tmp0_also;
794
+ return setTags(_this__u8e3s4, tmp$ret$0);
795
+ }
796
+ function Companion_6() {
797
+ Companion_instance_6 = this;
798
+ }
799
+ Companion_6.prototype.xq = function (source) {
800
+ var tmp;
801
+ if (source.m()) {
802
+ tmp = new LazyCursor(source);
803
+ } else {
804
+ tmp = EmptyCursor_getInstance();
805
+ }
806
+ return tmp;
807
+ };
808
+ var Companion_instance_6;
809
+ function Companion_getInstance_8() {
810
+ if (Companion_instance_6 == null)
811
+ new Companion_6();
812
+ return Companion_instance_6;
813
+ }
814
+ function AbstractCursor$iterator$1(this$0) {
815
+ this.lt_1 = this$0;
816
+ }
817
+ AbstractCursor$iterator$1.prototype.m = function () {
818
+ return !this.lt_1.wq();
819
+ };
820
+ AbstractCursor$iterator$1.prototype.p = function () {
821
+ var result = this.lt_1.uq();
822
+ this.lt_1 = this.lt_1.tq();
823
+ return ensureNotNull(result);
824
+ };
825
+ function AbstractCursor() {
826
+ Companion_getInstance_8();
827
+ }
828
+ AbstractCursor.prototype.toString = function () {
829
+ return this.wq() ? '[]' : !this.vq() ? '[' + this.uq() + ']' : '[' + this.uq() + ', ...]';
830
+ };
831
+ AbstractCursor.prototype.j = function () {
832
+ return new AbstractCursor$iterator$1(this);
833
+ };
834
+ AbstractCursor.prototype.iterator = function () {
835
+ return this.j();
836
+ };
837
+ AbstractCursor.prototype.mt = function () {
838
+ return false;
839
+ };
840
+ AbstractCursor.prototype.ht = function (mapper) {
841
+ return new MapperCursor(this, mapper);
842
+ };
843
+ AbstractCursor.prototype.map = function (mapper) {
844
+ return this.ht(mapper);
845
+ };
846
+ function CachedImpl(generator) {
847
+ this.nt_1 = generator;
848
+ this.ot_1 = Companion_getInstance_7().oq();
849
+ }
850
+ CachedImpl.prototype.lq = function () {
851
+ return this.ot_1.gt();
852
+ };
853
+ CachedImpl.prototype.pt = function () {
854
+ return this.ot_1.it();
855
+ };
856
+ CachedImpl.prototype.b1 = function () {
857
+ this.qt();
858
+ return ensureNotNull(this.ot_1.b1());
859
+ };
860
+ CachedImpl.prototype.qt = function () {
861
+ if (this.pt()) {
862
+ this.ot_1 = Companion_getInstance_7().ft(this.nt_1());
863
+ }
864
+ };
865
+ CachedImpl.prototype.mq = function () {
866
+ this.ot_1 = Companion_getInstance_7().oq();
867
+ };
868
+ CachedImpl.prototype.toString = function () {
869
+ return 'CachedImpl(generator=' + this.nt_1 + ')';
870
+ };
871
+ CachedImpl.prototype.hashCode = function () {
872
+ return hashCode(this.nt_1);
873
+ };
874
+ CachedImpl.prototype.equals = function (other) {
875
+ if (this === other)
876
+ return true;
877
+ if (!(other instanceof CachedImpl))
878
+ return false;
879
+ var tmp0_other_with_cast = other instanceof CachedImpl ? other : THROW_CCE();
880
+ if (!equals(this.nt_1, tmp0_other_with_cast.nt_1))
881
+ return false;
882
+ return true;
883
+ };
884
+ function ConjunctionCursor$next$delegate$lambda(this$0) {
885
+ return function () {
886
+ return this$0.rt_1.vq() ? new ConjunctionCursor(this$0.rt_1.tq(), this$0.st_1) : this$0.st_1.mt() ? this$0.st_1.tq() : this$0.st_1;
887
+ };
888
+ }
889
+ function ConjunctionCursor(first, second) {
890
+ AbstractCursor.call(this);
891
+ this.rt_1 = first;
892
+ this.st_1 = second;
893
+ var tmp = this;
894
+ tmp.tt_1 = lazy(ConjunctionCursor$next$delegate$lambda(this));
895
+ }
896
+ ConjunctionCursor.prototype.wq = function () {
897
+ return this.rt_1.wq() ? this.st_1.wq() : false;
898
+ };
899
+ ConjunctionCursor.prototype.tq = function () {
900
+ var tmp$ret$0;
901
+ // Inline function 'kotlin.getValue' call
902
+ var tmp0_getValue = next$factory();
903
+ tmp$ret$0 = this.tt_1.b1();
904
+ return tmp$ret$0;
905
+ };
906
+ ConjunctionCursor.prototype.uq = function () {
907
+ return this.rt_1.vq() ? this.rt_1.uq() : this.st_1.uq();
908
+ };
909
+ ConjunctionCursor.prototype.vq = function () {
910
+ return this.rt_1.vq() ? true : this.st_1.vq();
911
+ };
912
+ ConjunctionCursor.prototype.equals = function (other) {
913
+ if (this === other)
914
+ return true;
915
+ if (other == null ? true : !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
916
+ return false;
917
+ if (other instanceof ConjunctionCursor)
918
+ other;
919
+ else
920
+ THROW_CCE();
921
+ if (!equals(this.rt_1, other.rt_1))
922
+ return false;
923
+ if (!equals(this.st_1, other.st_1))
924
+ return false;
925
+ return true;
926
+ };
927
+ ConjunctionCursor.prototype.hashCode = function () {
928
+ var result = hashCode(this.rt_1);
929
+ result = imul(31, result) + hashCode(this.st_1) | 0;
930
+ return result;
931
+ };
932
+ function next$factory() {
933
+ return getPropertyCallableRef('next', 1, KProperty1, function (receiver) {
934
+ return receiver.tq();
935
+ }, null);
936
+ }
937
+ function EmptyCursor() {
938
+ EmptyCursor_instance = this;
939
+ AbstractCursor.call(this);
940
+ }
941
+ EmptyCursor.prototype.tq = function () {
942
+ throw NoSuchElementException_init_$Create$();
943
+ };
944
+ EmptyCursor.prototype.uq = function () {
945
+ return null;
946
+ };
947
+ EmptyCursor.prototype.vq = function () {
948
+ return false;
949
+ };
950
+ EmptyCursor.prototype.wq = function () {
951
+ return true;
952
+ };
953
+ EmptyCursor.prototype.toString = function () {
954
+ return AbstractCursor.prototype.toString.call(this);
955
+ };
956
+ EmptyCursor.prototype.jt = function (mapper) {
957
+ return this;
958
+ };
959
+ EmptyCursor.prototype.map = function (mapper) {
960
+ return this.jt(mapper);
961
+ };
962
+ EmptyCursor.prototype.ht = function (mapper) {
963
+ return this.jt(mapper);
964
+ };
965
+ var EmptyCursor_instance;
966
+ function EmptyCursor_getInstance() {
967
+ if (EmptyCursor_instance == null)
968
+ new EmptyCursor();
969
+ return EmptyCursor_instance;
970
+ }
971
+ function IntIndexedImpl(index, value) {
972
+ this.ut_1 = index;
973
+ this.vt_1 = value;
974
+ }
975
+ IntIndexedImpl.prototype.yq = function () {
976
+ return this.ut_1;
977
+ };
978
+ IntIndexedImpl.prototype.b1 = function () {
979
+ return this.vt_1;
980
+ };
981
+ IntIndexedImpl.prototype.n3 = function () {
982
+ return this.ut_1;
983
+ };
984
+ IntIndexedImpl.prototype.o3 = function () {
985
+ return this.vt_1;
986
+ };
987
+ IntIndexedImpl.prototype.toString = function () {
988
+ return 'IntIndexedImpl(index=' + this.ut_1 + ', value=' + this.vt_1 + ')';
989
+ };
990
+ IntIndexedImpl.prototype.hashCode = function () {
991
+ var result = this.ut_1;
992
+ result = imul(result, 31) + (this.vt_1 == null ? 0 : hashCode(this.vt_1)) | 0;
993
+ return result;
994
+ };
995
+ IntIndexedImpl.prototype.equals = function (other) {
996
+ if (this === other)
997
+ return true;
998
+ if (!(other instanceof IntIndexedImpl))
999
+ return false;
1000
+ var tmp0_other_with_cast = other instanceof IntIndexedImpl ? other : THROW_CCE();
1001
+ if (!(this.ut_1 === tmp0_other_with_cast.ut_1))
1002
+ return false;
1003
+ if (!equals(this.vt_1, tmp0_other_with_cast.vt_1))
1004
+ return false;
1005
+ return true;
1006
+ };
1007
+ IntIndexedImpl.prototype.aa = function (other) {
1008
+ return this.ar((!(other == null) ? isInterface(other, IntIndexed) : false) ? other : THROW_CCE());
1009
+ };
1010
+ function _get_wrapped__s2ip8($this) {
1011
+ var tmp$ret$0;
1012
+ // Inline function 'kotlin.getValue' call
1013
+ var tmp0_getValue = wrapped$factory();
1014
+ tmp$ret$0 = $this.xt_1.b1();
1015
+ return tmp$ret$0;
1016
+ }
1017
+ function LazyCursor$wrapped$delegate$lambda(this$0) {
1018
+ return function () {
1019
+ return new NonLastCursor(this$0.wt_1);
1020
+ };
1021
+ }
1022
+ function LazyCursor(delegate) {
1023
+ AbstractCursor.call(this);
1024
+ this.wt_1 = delegate;
1025
+ var tmp = this;
1026
+ tmp.xt_1 = lazy(LazyCursor$wrapped$delegate$lambda(this));
1027
+ }
1028
+ LazyCursor.prototype.mt = function () {
1029
+ return true;
1030
+ };
1031
+ LazyCursor.prototype.tq = function () {
1032
+ return _get_wrapped__s2ip8(this).tq();
1033
+ };
1034
+ LazyCursor.prototype.uq = function () {
1035
+ return _get_wrapped__s2ip8(this).uq();
1036
+ };
1037
+ LazyCursor.prototype.vq = function () {
1038
+ return true;
1039
+ };
1040
+ LazyCursor.prototype.wq = function () {
1041
+ return false;
1042
+ };
1043
+ LazyCursor.prototype.toString = function () {
1044
+ return AbstractCursor.prototype.toString.call(this);
1045
+ };
1046
+ LazyCursor.prototype.j = function () {
1047
+ return _get_wrapped__s2ip8(this).j();
1048
+ };
1049
+ LazyCursor.prototype.iterator = function () {
1050
+ return this.j();
1051
+ };
1052
+ LazyCursor.prototype.hashCode = function () {
1053
+ return hashCode(this.wt_1);
1054
+ };
1055
+ LazyCursor.prototype.equals = function (other) {
1056
+ if (this === other)
1057
+ return true;
1058
+ if (!(other instanceof LazyCursor))
1059
+ return false;
1060
+ var tmp0_other_with_cast = other instanceof LazyCursor ? other : THROW_CCE();
1061
+ if (!equals(this.wt_1, tmp0_other_with_cast.wt_1))
1062
+ return false;
1063
+ return true;
1064
+ };
1065
+ function wrapped$factory() {
1066
+ return getPropertyCallableRef('wrapped', 1, KProperty1, function (receiver) {
1067
+ return _get_wrapped__s2ip8(receiver);
1068
+ }, null);
1069
+ }
1070
+ function LongIndexedImpl(index, value) {
1071
+ this.yt_1 = index;
1072
+ this.zt_1 = value;
1073
+ }
1074
+ LongIndexedImpl.prototype.yq = function () {
1075
+ return this.yt_1;
1076
+ };
1077
+ LongIndexedImpl.prototype.b1 = function () {
1078
+ return this.zt_1;
1079
+ };
1080
+ LongIndexedImpl.prototype.zs = function (other) {
1081
+ return this.yt_1.ch(other.yq()).rh();
1082
+ };
1083
+ LongIndexedImpl.prototype.aa = function (other) {
1084
+ return this.zs((!(other == null) ? isInterface(other, LongIndexed) : false) ? other : THROW_CCE());
1085
+ };
1086
+ LongIndexedImpl.prototype.toString = function () {
1087
+ return 'LongIndexedImpl(index=' + toString(this.yt_1) + ', value=' + this.zt_1 + ')';
1088
+ };
1089
+ LongIndexedImpl.prototype.hashCode = function () {
1090
+ var result = this.yt_1.hashCode();
1091
+ result = imul(result, 31) + (this.zt_1 == null ? 0 : hashCode(this.zt_1)) | 0;
1092
+ return result;
1093
+ };
1094
+ LongIndexedImpl.prototype.equals = function (other) {
1095
+ if (this === other)
1096
+ return true;
1097
+ if (!(other instanceof LongIndexedImpl))
1098
+ return false;
1099
+ var tmp0_other_with_cast = other instanceof LongIndexedImpl ? other : THROW_CCE();
1100
+ if (!this.yt_1.equals(tmp0_other_with_cast.yt_1))
1101
+ return false;
1102
+ if (!equals(this.zt_1, tmp0_other_with_cast.zt_1))
1103
+ return false;
1104
+ return true;
1105
+ };
1106
+ function MapperCursor$current$delegate$lambda(this$0) {
1107
+ return function () {
1108
+ return this$0.bu_1(ensureNotNull(this$0.au_1.uq()));
1109
+ };
1110
+ }
1111
+ function MapperCursor(wrapped, mapper) {
1112
+ AbstractCursor.call(this);
1113
+ this.au_1 = wrapped;
1114
+ this.bu_1 = mapper;
1115
+ var tmp = this;
1116
+ tmp.cu_1 = lazy(MapperCursor$current$delegate$lambda(this));
1117
+ }
1118
+ MapperCursor.prototype.tq = function () {
1119
+ return this.au_1.tq().ht(this.bu_1);
1120
+ };
1121
+ MapperCursor.prototype.uq = function () {
1122
+ var tmp$ret$0;
1123
+ // Inline function 'kotlin.getValue' call
1124
+ var tmp0_getValue = current$factory();
1125
+ tmp$ret$0 = this.cu_1.b1();
1126
+ return tmp$ret$0;
1127
+ };
1128
+ MapperCursor.prototype.vq = function () {
1129
+ return true;
1130
+ };
1131
+ MapperCursor.prototype.wq = function () {
1132
+ return false;
1133
+ };
1134
+ MapperCursor.prototype.equals = function (other) {
1135
+ if (this === other)
1136
+ return true;
1137
+ if (other == null ? true : !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
1138
+ return false;
1139
+ if (other instanceof MapperCursor)
1140
+ other;
1141
+ else
1142
+ THROW_CCE();
1143
+ if (!equals(this.au_1, other.au_1))
1144
+ return false;
1145
+ if (!equals(this.bu_1, other.bu_1))
1146
+ return false;
1147
+ return true;
1148
+ };
1149
+ MapperCursor.prototype.hashCode = function () {
1150
+ var result = hashCode(this.au_1);
1151
+ result = imul(31, result) + hashCode(this.bu_1) | 0;
1152
+ return result;
1153
+ };
1154
+ MapperCursor.prototype.du = function (mapper) {
1155
+ return new ValueCursor(mapper(this.uq()), this.tq().ht(mapper));
1156
+ };
1157
+ MapperCursor.prototype.map = function (mapper) {
1158
+ return this.du(mapper);
1159
+ };
1160
+ MapperCursor.prototype.ht = function (mapper) {
1161
+ return this.du(mapper);
1162
+ };
1163
+ function current$factory() {
1164
+ return getPropertyCallableRef('current', 1, KProperty1, function (receiver) {
1165
+ return receiver.uq();
1166
+ }, null);
1167
+ }
1168
+ function NonLastCursor$next$delegate$lambda($source, this$0) {
1169
+ return function () {
1170
+ var tmp$ret$0;
1171
+ // Inline function 'kotlin.also' call
1172
+ var tmp0_also = Companion_getInstance_8().xq($source);
1173
+ // Inline function 'kotlin.contracts.contract' call
1174
+ // Inline function 'it.unibo.tuprolog.utils.impl.NonLastCursor.next$delegate.<anonymous>.<anonymous>' call
1175
+ this$0.eu_1 = null;
1176
+ tmp$ret$0 = tmp0_also;
1177
+ return tmp$ret$0;
1178
+ };
1179
+ }
1180
+ function NonLastCursor(source) {
1181
+ AbstractCursor.call(this);
1182
+ this.eu_1 = source;
1183
+ var tmp = this;
1184
+ tmp.fu_1 = lazy(NonLastCursor$next$delegate$lambda(source, this));
1185
+ this.gu_1 = source.p();
1186
+ }
1187
+ NonLastCursor.prototype.tq = function () {
1188
+ var tmp$ret$0;
1189
+ // Inline function 'kotlin.getValue' call
1190
+ var tmp0_getValue = next$factory_0();
1191
+ tmp$ret$0 = this.fu_1.b1();
1192
+ return tmp$ret$0;
1193
+ };
1194
+ NonLastCursor.prototype.uq = function () {
1195
+ return this.gu_1;
1196
+ };
1197
+ NonLastCursor.prototype.vq = function () {
1198
+ return true;
1199
+ };
1200
+ NonLastCursor.prototype.wq = function () {
1201
+ return false;
1202
+ };
1203
+ NonLastCursor.prototype.toString = function () {
1204
+ return AbstractCursor.prototype.toString.call(this);
1205
+ };
1206
+ function next$factory_0() {
1207
+ return getPropertyCallableRef('next', 1, KProperty1, function (receiver) {
1208
+ return receiver.tq();
1209
+ }, null);
1210
+ }
1211
+ function removeLeastRecent($this) {
1212
+ var tmp$ret$0;
1213
+ // Inline function 'kotlin.collections.iterator' call
1214
+ var tmp0_iterator = $this.iu_1;
1215
+ tmp$ret$0 = tmp0_iterator.z().j();
1216
+ var entry = tmp$ret$0.p();
1217
+ $this.iu_1.x3(entry.a1());
1218
+ var tmp = Companion_getInstance_7();
1219
+ var tmp$ret$1;
1220
+ // Inline function 'kotlin.collections.toPair' call
1221
+ tmp$ret$1 = new Pair(entry.a1(), entry.b1());
1222
+ return tmp.ft(tmp$ret$1);
1223
+ }
1224
+ function removeLeastRecentIfNecessary($this) {
1225
+ var tmp;
1226
+ if ($this.iu_1.o() >= $this.hu_1) {
1227
+ tmp = removeLeastRecent($this);
1228
+ } else {
1229
+ return Companion_getInstance_7().oq();
1230
+ }
1231
+ return tmp;
1232
+ }
1233
+ function SimpleLRUCache$toSequence$lambda(it) {
1234
+ var tmp$ret$0;
1235
+ // Inline function 'kotlin.collections.toPair' call
1236
+ tmp$ret$0 = new Pair(it.a1(), it.b1());
1237
+ return tmp$ret$0;
1238
+ }
1239
+ function SimpleLRUCache$toString$lambda(it) {
1240
+ return '' + it.g4_1 + ' = ' + it.h4_1;
1241
+ }
1242
+ function SimpleLRUCache(capacity) {
1243
+ this.hu_1 = capacity;
1244
+ // Inline function 'kotlin.require' call
1245
+ var tmp0_require = this.hu_1 > 0;
1246
+ // Inline function 'kotlin.contracts.contract' call
1247
+ // Inline function 'kotlin.require' call
1248
+ // Inline function 'kotlin.contracts.contract' call
1249
+ if (!tmp0_require) {
1250
+ var tmp$ret$0;
1251
+ // Inline function 'kotlin.require.<anonymous>' call
1252
+ tmp$ret$0 = 'Failed requirement.';
1253
+ var message = tmp$ret$0;
1254
+ throw IllegalArgumentException_init_$Create$(toString(message));
1255
+ }
1256
+ this.iu_1 = LinkedHashMap_init_$Create$();
1257
+ }
1258
+ SimpleLRUCache.prototype.hq = function (key, value) {
1259
+ var evicted = removeLeastRecentIfNecessary(this);
1260
+ // Inline function 'kotlin.collections.set' call
1261
+ var tmp0_set = this.iu_1;
1262
+ tmp0_set.w3(key, value);
1263
+ return evicted;
1264
+ };
1265
+ SimpleLRUCache.prototype.a3 = function (key) {
1266
+ var tmp;
1267
+ if (this.iu_1.u2(key)) {
1268
+ tmp = Companion_getInstance_7().pq(this.iu_1.a3(key));
1269
+ } else {
1270
+ tmp = Companion_getInstance_7().oq();
1271
+ }
1272
+ return tmp;
1273
+ };
1274
+ SimpleLRUCache.prototype.equals = function (other) {
1275
+ if (this === other)
1276
+ return true;
1277
+ if (other == null ? true : !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
1278
+ return false;
1279
+ if (other instanceof SimpleLRUCache)
1280
+ other;
1281
+ else
1282
+ THROW_CCE();
1283
+ if (!(this.hu_1 === other.hu_1))
1284
+ return false;
1285
+ if (!this.iu_1.equals(other.iu_1))
1286
+ return false;
1287
+ return true;
1288
+ };
1289
+ SimpleLRUCache.prototype.hashCode = function () {
1290
+ var result = this.hu_1;
1291
+ result = imul(31, result) + this.iu_1.hashCode() | 0;
1292
+ return result;
1293
+ };
1294
+ SimpleLRUCache.prototype.ju = function () {
1295
+ var tmp = asSequence(this.iu_1.z());
1296
+ return buffered(map(tmp, SimpleLRUCache$toSequence$lambda));
1297
+ };
1298
+ SimpleLRUCache.prototype.toString = function () {
1299
+ var tmp = this.ju();
1300
+ var tmp_0 = map(tmp, SimpleLRUCache$toString$lambda);
1301
+ return 'SimpleLRUCache(' + joinToString$default(tmp_0, ', ', null, null, 0, null, null, 62, null) + ')';
1302
+ };
1303
+ function ValueCursor(current, next) {
1304
+ AbstractCursor.call(this);
1305
+ this.ku_1 = current;
1306
+ this.lu_1 = next;
1307
+ }
1308
+ ValueCursor.prototype.uq = function () {
1309
+ return this.ku_1;
1310
+ };
1311
+ ValueCursor.prototype.tq = function () {
1312
+ return this.lu_1;
1313
+ };
1314
+ ValueCursor.prototype.vq = function () {
1315
+ return true;
1316
+ };
1317
+ ValueCursor.prototype.wq = function () {
1318
+ return false;
1319
+ };
1320
+ function dequeOf(items) {
1321
+ return toMutableList(items);
1322
+ }
1323
+ function dequeOf_0(items) {
1324
+ return mutableListOf(items.slice());
1325
+ }
1326
+ function dequeOf_1(items) {
1327
+ var tmp$ret$1;
1328
+ // Inline function 'kotlin.also' call
1329
+ var tmp$ret$0;
1330
+ // Inline function 'kotlin.collections.mutableListOf' call
1331
+ tmp$ret$0 = ArrayList_init_$Create$_0();
1332
+ var tmp0_also = tmp$ret$0;
1333
+ // Inline function 'kotlin.contracts.contract' call
1334
+ // Inline function 'it.unibo.tuprolog.utils.dequeOf.<anonymous>' call
1335
+ addAll(tmp0_also, items);
1336
+ tmp$ret$1 = tmp0_also;
1337
+ return tmp$ret$1;
1338
+ }
1339
+ function takeFirst(_this__u8e3s4) {
1340
+ if (_this__u8e3s4.d())
1341
+ return null;
1342
+ var first = _this__u8e3s4.n(0);
1343
+ _this__u8e3s4.t4(0);
1344
+ return first;
1345
+ }
1346
+ function addFirst(_this__u8e3s4, item) {
1347
+ _this__u8e3s4.ua(0, item);
1348
+ }
1349
+ function addFirst_0(_this__u8e3s4, items) {
1350
+ var i = _this__u8e3s4.bb();
1351
+ var tmp0_iterator = items.j();
1352
+ while (tmp0_iterator.m()) {
1353
+ var item = tmp0_iterator.p();
1354
+ i.va(item);
1355
+ }
1356
+ }
1357
+ function forceCast(_this__u8e3s4) {
1358
+ var it = _this__u8e3s4;
1359
+ return it;
1360
+ }
1361
+ //region block: post-declaration
1362
+ AbstractCursor.prototype.asIterable = asIterable_1;
1363
+ AbstractCursor.prototype.asSequence = asSequence_0;
1364
+ CachedImpl.prototype.nq = ifValid;
1365
+ ConjunctionCursor.prototype.asIterable = asIterable_1;
1366
+ ConjunctionCursor.prototype.asSequence = asSequence_0;
1367
+ EmptyCursor.prototype.asIterable = asIterable_1;
1368
+ EmptyCursor.prototype.asSequence = asSequence_0;
1369
+ IntIndexedImpl.prototype.ar = compareTo;
1370
+ LazyCursor.prototype.asIterable = asIterable_1;
1371
+ LazyCursor.prototype.asSequence = asSequence_0;
1372
+ MapperCursor.prototype.asIterable = asIterable_1;
1373
+ MapperCursor.prototype.asSequence = asSequence_0;
1374
+ NonLastCursor.prototype.asIterable = asIterable_1;
1375
+ NonLastCursor.prototype.asSequence = asSequence_0;
1376
+ SimpleLRUCache.prototype.iq = getOrSet;
1377
+ ValueCursor.prototype.asIterable = asIterable_1;
1378
+ ValueCursor.prototype.asSequence = asSequence_0;
1379
+ //endregion
1380
+ //region block: exports
1381
+ _.$_$ = _.$_$ || {};
1382
+ _.$_$.a = Companion_getInstance_1;
1383
+ _.$_$.b = Companion_getInstance_2;
1384
+ _.$_$.c = Companion_getInstance_3;
1385
+ _.$_$.d = Companion_getInstance_5;
1386
+ _.$_$.e = Companion_getInstance_7;
1387
+ _.$_$.f = castTo;
1388
+ _.$_$.g = Castable;
1389
+ _.$_$.h = compareTo_0;
1390
+ _.$_$.i = LongIndexed;
1391
+ _.$_$.j = NumberTypeTester;
1392
+ _.$_$.k = Some;
1393
+ _.$_$.l = containsTag;
1394
+ _.$_$.m = getTag;
1395
+ _.$_$.n = Taggable;
1396
+ _.$_$.o = addFirst_0;
1397
+ _.$_$.p = addFirst;
1398
+ _.$_$.q = buffered;
1399
+ _.$_$.r = cached;
1400
+ _.$_$.s = cursor;
1401
+ _.$_$.t = cursor_0;
1402
+ _.$_$.u = cursor_1;
1403
+ _.$_$.v = dequeOf;
1404
+ _.$_$.w = dequeOf_1;
1405
+ _.$_$.x = dequeOf_0;
1406
+ _.$_$.y = dropLast;
1407
+ _.$_$.z = forceCast;
1408
+ _.$_$.a1 = insertAt;
1409
+ _.$_$.b1 = itemWiseEquals;
1410
+ _.$_$.c1 = itemWiseEquals_1;
1411
+ _.$_$.d1 = itemWiseHashCode;
1412
+ _.$_$.e1 = itemWiseHashCode_1;
1413
+ _.$_$.f1 = itemWiseHashCode_0;
1414
+ _.$_$.g1 = mergeSequences;
1415
+ _.$_$.h1 = plus;
1416
+ _.$_$.i1 = setTags;
1417
+ _.$_$.j1 = setTag;
1418
+ _.$_$.k1 = takeFirst;
1419
+ //endregion
1420
+ return _;
1421
+ }(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./kt-math.js')));
1422
+
1423
+ //# sourceMappingURL=2p-utils.js.map