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

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-oop-lib.js ADDED
@@ -0,0 +1,3660 @@
1
+ (function (_, kotlin_kotlin, kotlin_it_unibo_tuprolog_solve, kotlin_kt_math, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_utils, kotlin_it_unibo_tuprolog_unify) {
2
+ 'use strict';
3
+ //region block: imports
4
+ var NullPointerException_init_$Create$ = kotlin_kotlin.$_$.x1;
5
+ var interfaceMeta = kotlin_kotlin.$_$.u6;
6
+ var setMetadataFor = kotlin_kotlin.$_$.j7;
7
+ var objectMeta = kotlin_kotlin.$_$.i7;
8
+ var AbstractLibrary = kotlin_it_unibo_tuprolog_solve.$_$.y2;
9
+ var listOf = kotlin_kotlin.$_$.i4;
10
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.j3;
11
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.b1;
12
+ var to = kotlin_kotlin.$_$.ec;
13
+ var Unit_getInstance = kotlin_kotlin.$_$.r2;
14
+ var toMap = kotlin_kotlin.$_$.s5;
15
+ var PrimitiveClasses_getInstance = kotlin_kotlin.$_$.o2;
16
+ var List = kotlin_kotlin.$_$.v2;
17
+ var getKClass = kotlin_kotlin.$_$.c;
18
+ var ArrayList = kotlin_kotlin.$_$.s2;
19
+ var Map = kotlin_kotlin.$_$.w2;
20
+ var LinkedHashMap = kotlin_kotlin.$_$.u2;
21
+ var Long = kotlin_kotlin.$_$.mb;
22
+ var Char = kotlin_kotlin.$_$.eb;
23
+ var BigInteger = kotlin_kt_math.$_$.h;
24
+ var BigDecimal = kotlin_kt_math.$_$.g;
25
+ var arrayConcat = kotlin_kotlin.$_$.a;
26
+ var Specifier_XFY_getInstance = kotlin_it_unibo_tuprolog_core.$_$.c;
27
+ var Operator = kotlin_it_unibo_tuprolog_core.$_$.n1;
28
+ var Specifier_XFX_getInstance = kotlin_it_unibo_tuprolog_core.$_$.b;
29
+ var Specifier_FX_getInstance = kotlin_it_unibo_tuprolog_core.$_$.a;
30
+ var OperatorSet_init_$Create$ = kotlin_it_unibo_tuprolog_core.$_$.n;
31
+ var containsSignature = kotlin_it_unibo_tuprolog_solve.$_$.b3;
32
+ var containsOperator = kotlin_it_unibo_tuprolog_solve.$_$.a3;
33
+ var hasPrimitive = kotlin_it_unibo_tuprolog_solve.$_$.d3;
34
+ var hasFunction = kotlin_it_unibo_tuprolog_solve.$_$.c3;
35
+ var get_ruleSignatures = kotlin_it_unibo_tuprolog_solve.$_$.f3;
36
+ var hasProtected = kotlin_it_unibo_tuprolog_solve.$_$.e3;
37
+ var getKClassFromExpression = kotlin_kotlin.$_$.b;
38
+ var Atom = kotlin_it_unibo_tuprolog_core.$_$.o1;
39
+ var isInterface = kotlin_kotlin.$_$.y6;
40
+ var lazy = kotlin_kotlin.$_$.xb;
41
+ var toString = kotlin_kotlin.$_$.dc;
42
+ var hashCode = kotlin_kotlin.$_$.t6;
43
+ var THROW_CCE = kotlin_kotlin.$_$.sb;
44
+ var equals = kotlin_kotlin.$_$.o6;
45
+ var classMeta = kotlin_kotlin.$_$.m6;
46
+ var KProperty1 = kotlin_kotlin.$_$.d8;
47
+ var getPropertyCallableRef = kotlin_kotlin.$_$.r6;
48
+ var Companion_getInstance = kotlin_it_unibo_tuprolog_utils.$_$.e;
49
+ var contains = kotlin_kotlin.$_$.k3;
50
+ var listOf_0 = kotlin_kotlin.$_$.h4;
51
+ var checkIndexOverflow = kotlin_kotlin.$_$.i3;
52
+ var copyToArray = kotlin_kotlin.$_$.p3;
53
+ var trimMargin$default = kotlin_kotlin.$_$.a1;
54
+ var toString_0 = kotlin_kotlin.$_$.n7;
55
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.p1;
56
+ var setOf = kotlin_kotlin.$_$.e5;
57
+ var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.f1;
58
+ var format = kotlin_it_unibo_tuprolog_core.$_$.c3;
59
+ var captureStack = kotlin_kotlin.$_$.h6;
60
+ var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_solve.$_$.y1;
61
+ var Expected_DEALIASING_EXPRESSION_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.l;
62
+ var charSequenceLength = kotlin_kotlin.$_$.l6;
63
+ var charSequenceGet = kotlin_kotlin.$_$.k6;
64
+ var toString_1 = kotlin_kotlin.$_$.h2;
65
+ var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_unify.$_$.a;
66
+ var Struct = kotlin_it_unibo_tuprolog_core.$_$.z1;
67
+ var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_solve.$_$.s1;
68
+ var ObjectType_OOP_ALIAS_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.h;
69
+ var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.m;
70
+ var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.l1;
71
+ var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_solve.$_$.v1;
72
+ var Limit_OOP_OBJECT_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.j;
73
+ var Companion_getInstance_5 = kotlin_it_unibo_tuprolog_core.$_$.s;
74
+ var Term = kotlin_it_unibo_tuprolog_core.$_$.y2;
75
+ var NumberTypeTester = kotlin_it_unibo_tuprolog_utils.$_$.j;
76
+ var Companion_getInstance_6 = kotlin_it_unibo_tuprolog_core.$_$.g1;
77
+ var charArrayOf = kotlin_kotlin.$_$.i6;
78
+ var concatToString = kotlin_kotlin.$_$.w9;
79
+ var Companion_getInstance_7 = kotlin_it_unibo_tuprolog_core.$_$.a1;
80
+ var Companion_getInstance_8 = kotlin_it_unibo_tuprolog_core.$_$.x;
81
+ var isNumber = kotlin_kotlin.$_$.z6;
82
+ var Exception = kotlin_kotlin.$_$.ib;
83
+ var Var = kotlin_it_unibo_tuprolog_core.$_$.b3;
84
+ var sequenceOf = kotlin_kotlin.$_$.i9;
85
+ var Companion_getInstance_9 = kotlin_kt_math.$_$.f;
86
+ var Companion_getInstance_10 = kotlin_kotlin.$_$.q2;
87
+ var plus = kotlin_kotlin.$_$.g9;
88
+ var IntCompanionObject_getInstance = kotlin_kotlin.$_$.l2;
89
+ var ShortCompanionObject_getInstance = kotlin_kotlin.$_$.m2;
90
+ var ByteCompanionObject_getInstance = kotlin_kotlin.$_$.i2;
91
+ var Companion_getInstance_11 = kotlin_kt_math.$_$.e;
92
+ var DoubleCompanionObject_getInstance = kotlin_kotlin.$_$.j2;
93
+ var compareTo = kotlin_kotlin.$_$.n6;
94
+ var FloatCompanionObject_getInstance = kotlin_kotlin.$_$.k2;
95
+ var Integer = kotlin_it_unibo_tuprolog_core.$_$.u1;
96
+ var Real = kotlin_it_unibo_tuprolog_core.$_$.x1;
97
+ var Truth = kotlin_it_unibo_tuprolog_core.$_$.z2;
98
+ var first = kotlin_kotlin.$_$.t8;
99
+ var toSet = kotlin_kotlin.$_$.r9;
100
+ var Some = kotlin_it_unibo_tuprolog_utils.$_$.k;
101
+ var Companion_getInstance_12 = kotlin_it_unibo_tuprolog_core.$_$.e1;
102
+ var Companion_getInstance_13 = kotlin_it_unibo_tuprolog_solve.$_$.g2;
103
+ var Functional = kotlin_it_unibo_tuprolog_solve.$_$.o3;
104
+ var Companion_getInstance_14 = kotlin_it_unibo_tuprolog_solve.$_$.x1;
105
+ var Functional_0 = kotlin_it_unibo_tuprolog_solve.$_$.g3;
106
+ var Expected_OBJECT_REFERENCE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.n;
107
+ var isObject = kotlin_kotlin.$_$.a7;
108
+ var map = kotlin_kotlin.$_$.c9;
109
+ var Companion_getInstance_15 = kotlin_it_unibo_tuprolog_core.$_$.y;
110
+ var List_0 = kotlin_it_unibo_tuprolog_core.$_$.v1;
111
+ var toList = kotlin_kotlin.$_$.p9;
112
+ var isArray = kotlin_kotlin.$_$.v6;
113
+ var asSequence = kotlin_kotlin.$_$.h3;
114
+ var Predicative = kotlin_it_unibo_tuprolog_solve.$_$.q3;
115
+ var TernaryRelation = kotlin_it_unibo_tuprolog_solve.$_$.s3;
116
+ var asSequence_0 = kotlin_kotlin.$_$.g3;
117
+ var flatMap = kotlin_kotlin.$_$.u8;
118
+ var distinct = kotlin_kotlin.$_$.l8;
119
+ var TypeTester = kotlin_it_unibo_tuprolog_solve.$_$.t3;
120
+ var Expected_TYPE_REFERENCE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.p;
121
+ var Expected_REFERENCE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.o;
122
+ var Companion_getInstance_16 = kotlin_it_unibo_tuprolog_core.$_$.i1;
123
+ var Companion_getInstance_17 = kotlin_it_unibo_tuprolog_core.$_$.d1;
124
+ var filter = kotlin_kotlin.$_$.r8;
125
+ var Sequence = kotlin_kotlin.$_$.f8;
126
+ var firstOrNull = kotlin_kotlin.$_$.s8;
127
+ var Yes = kotlin_it_unibo_tuprolog_solve.$_$.t4;
128
+ var NonBacktrackable = kotlin_it_unibo_tuprolog_solve.$_$.h3;
129
+ var Companion_getInstance_18 = kotlin_it_unibo_tuprolog_solve.$_$.t1;
130
+ var Set = kotlin_kotlin.$_$.x2;
131
+ var NonBacktrackable_0 = kotlin_it_unibo_tuprolog_solve.$_$.u3;
132
+ var RuleWrapper = kotlin_it_unibo_tuprolog_solve.$_$.x3;
133
+ var RuleWrapper_init_$Init$ = kotlin_it_unibo_tuprolog_solve.$_$.g1;
134
+ var Var_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.j2;
135
+ var getStringHashCode = kotlin_kotlin.$_$.s6;
136
+ var toString_2 = kotlin_kotlin.$_$.xa;
137
+ var ensureNotNull = kotlin_kotlin.$_$.vb;
138
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.d2;
139
+ var split$default = kotlin_kotlin.$_$.t;
140
+ var get_kotlin = kotlin_kotlin.$_$.b7;
141
+ var NotImplementedError = kotlin_kotlin.$_$.nb;
142
+ var Regex_init_$Create$ = kotlin_kotlin.$_$.h1;
143
+ //endregion
144
+ //region block: pre-declaration
145
+ setMetadataFor(Ref, 'Ref', interfaceMeta, undefined, [Atom], undefined, undefined, []);
146
+ setMetadataFor(ObjectRef, 'ObjectRef', interfaceMeta, undefined, [Ref], undefined, undefined, []);
147
+ function get_object() {
148
+ throw NullPointerException_init_$Create$();
149
+ }
150
+ function invoke(objectConverter, methodName, arguments_0) {
151
+ throw NullPointerException_init_$Create$();
152
+ }
153
+ function assign(objectConverter, propertyName, value) {
154
+ throw NullPointerException_init_$Create$();
155
+ }
156
+ setMetadataFor(NullRef, 'NullRef', interfaceMeta, undefined, [ObjectRef], undefined, undefined, []);
157
+ setMetadataFor(OOP, 'OOP', objectMeta, undefined, undefined, undefined, undefined, []);
158
+ setMetadataFor(OOPLib, 'OOPLib', objectMeta, AbstractLibrary, undefined, undefined, undefined, []);
159
+ setMetadataFor(Companion, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
160
+ setMetadataFor(Companion_0, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
161
+ setMetadataFor(Companion_1, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
162
+ setMetadataFor(Result, 'Result', classMeta, undefined, undefined, undefined, undefined, []);
163
+ setMetadataFor(Value, 'Value', classMeta, Result, undefined, undefined, undefined, []);
164
+ setMetadataFor(Companion_2, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
165
+ function convert(term) {
166
+ return this.h3q(this.j3q(term), term);
167
+ }
168
+ setMetadataFor(TermToObjectConverter, 'TermToObjectConverter', interfaceMeta, undefined, undefined, undefined, undefined, []);
169
+ setMetadataFor(Companion_3, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
170
+ function typeRefFromName(typeName) {
171
+ var tmp = Companion_getInstance().pq(this.m3q(typeName));
172
+ return tmp.ht(TypeFactory$typeRefFromName$lambda).b1();
173
+ }
174
+ setMetadataFor(TypeFactory, 'TypeFactory', interfaceMeta, undefined, undefined, undefined, undefined, []);
175
+ setMetadataFor(Companion_4, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
176
+ function create(objectConverter, arguments_0) {
177
+ return this.p3q(objectConverter, listOf(arguments_0.slice()));
178
+ }
179
+ setMetadataFor(TypeRef, 'TypeRef', interfaceMeta, undefined, [Ref], undefined, undefined, []);
180
+ setMetadataFor(OopException, 'OopException', classMeta, TuPrologException, undefined, undefined, undefined, []);
181
+ setMetadataFor(MalformedAliasException, 'MalformedAliasException', classMeta, OopException, undefined, undefined, undefined, []);
182
+ setMetadataFor(NoSuchAnAliasException, 'NoSuchAnAliasException', classMeta, OopException, undefined, undefined, undefined, []);
183
+ setMetadataFor(Companion_5, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
184
+ setMetadataFor(TermToObjectConversionException, 'TermToObjectConversionException', classMeta, OopException, undefined, undefined, undefined, []);
185
+ setMetadataFor(NullRefImpl, 'NullRefImpl', objectMeta, undefined, [NullRef, Atom], undefined, undefined, []);
186
+ setMetadataFor(ObjectRefImpl, 'ObjectRefImpl', classMeta, undefined, [ObjectRef, Atom], undefined, undefined, []);
187
+ setMetadataFor(ObjectToTermConverterImpl, 'ObjectToTermConverterImpl', classMeta, undefined, undefined, undefined, undefined, []);
188
+ setMetadataFor(TermToObjectConverterImpl, 'TermToObjectConverterImpl', classMeta, undefined, [TermToObjectConverter], undefined, undefined, []);
189
+ setMetadataFor(TypeFactoryImpl, 'TypeFactoryImpl', classMeta, undefined, [TypeFactory], undefined, undefined, []);
190
+ setMetadataFor(Companion_6, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
191
+ setMetadataFor(TypeRefImpl, 'TypeRefImpl', classMeta, undefined, [TypeRef, Atom], undefined, undefined, []);
192
+ setMetadataFor(AbstractInvoke, 'AbstractInvoke', classMeta, Functional, undefined, undefined, undefined, []);
193
+ setMetadataFor(AbstractIterableItems, 'AbstractIterableItems', classMeta, Functional_0, undefined, undefined, undefined, []);
194
+ setMetadataFor(ArrayItems, 'ArrayItems', objectMeta, AbstractIterableItems, undefined, undefined, undefined, []);
195
+ setMetadataFor(Assign, 'Assign', objectMeta, Predicative, undefined, undefined, undefined, []);
196
+ setMetadataFor(Cast, 'Cast', objectMeta, TernaryRelation, undefined, undefined, undefined, []);
197
+ setMetadataFor(InvokeMethod, 'InvokeMethod', objectMeta, AbstractInvoke, undefined, undefined, undefined, []);
198
+ setMetadataFor(InvokeStrict, 'InvokeStrict', objectMeta, AbstractInvoke, undefined, undefined, undefined, []);
199
+ setMetadataFor(ListItems, 'ListItems', objectMeta, AbstractIterableItems, undefined, undefined, undefined, []);
200
+ setMetadataFor(NewObject3, 'NewObject3', objectMeta, Functional, undefined, undefined, undefined, []);
201
+ setMetadataFor(NullRef_0, 'NullRef', objectMeta, TypeTester, undefined, undefined, undefined, []);
202
+ setMetadataFor(ObjectRef_0, 'ObjectRef', objectMeta, TypeTester, undefined, undefined, undefined, []);
203
+ setMetadataFor(Ref_0, 'Ref', objectMeta, TypeTester, undefined, undefined, undefined, []);
204
+ setMetadataFor(Register, 'Register', objectMeta, NonBacktrackable, undefined, undefined, undefined, []);
205
+ setMetadataFor(SetItems, 'SetItems', objectMeta, AbstractIterableItems, undefined, undefined, undefined, []);
206
+ setMetadataFor(Type, 'Type', objectMeta, Functional_0, undefined, undefined, undefined, []);
207
+ setMetadataFor(TypeRef_0, 'TypeRef', objectMeta, TypeTester, undefined, undefined, undefined, []);
208
+ setMetadataFor(Unregister, 'Unregister', objectMeta, NonBacktrackable_0, undefined, undefined, undefined, []);
209
+ setMetadataFor(Companion_7, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
210
+ setMetadataFor(Alias, 'Alias', classMeta, RuleWrapper, undefined, undefined, undefined, []);
211
+ setMetadataFor(ColonEquals, 'ColonEquals', classMeta, RuleWrapper, undefined, undefined, undefined, []);
212
+ setMetadataFor(Cast_0, 'Cast', objectMeta, ColonEquals, undefined, undefined, undefined, []);
213
+ setMetadataFor(Invocation, 'Invocation', objectMeta, ColonEquals, undefined, undefined, undefined, []);
214
+ setMetadataFor(Assignment, 'Assignment', objectMeta, ColonEquals, undefined, undefined, undefined, []);
215
+ setMetadataFor(Dot, 'Dot', objectMeta, RuleWrapper, undefined, undefined, undefined, []);
216
+ setMetadataFor(Companion_8, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
217
+ setMetadataFor(FluentReduce, 'FluentReduce', classMeta, RuleWrapper, undefined, undefined, undefined, []);
218
+ setMetadataFor(Recursive, 'Recursive', objectMeta, FluentReduce, undefined, undefined, undefined, []);
219
+ setMetadataFor(Couple, 'Couple', objectMeta, FluentReduce, undefined, undefined, undefined, []);
220
+ setMetadataFor(Trivial, 'Trivial', objectMeta, FluentReduce, undefined, undefined, undefined, []);
221
+ setMetadataFor(NewObject2, 'NewObject2', objectMeta, RuleWrapper, undefined, undefined, undefined, []);
222
+ setMetadataFor(Companion_9, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
223
+ setMetadataFor(PropertyReduce, 'PropertyReduce', classMeta, RuleWrapper, undefined, undefined, undefined, []);
224
+ setMetadataFor(Recursive_0, 'Recursive', objectMeta, PropertyReduce, undefined, undefined, undefined, []);
225
+ setMetadataFor(Base, 'Base', objectMeta, PropertyReduce, undefined, undefined, undefined, []);
226
+ //endregion
227
+ function NullRef() {
228
+ }
229
+ function OOP() {
230
+ OOP_instance = this;
231
+ this.l3p_1 = '.';
232
+ this.m3p_1 = ':=';
233
+ this.n3p_1 = '$';
234
+ this.o3p_1 = 'as';
235
+ this.p3p_1 = 'alias';
236
+ }
237
+ var OOP_instance;
238
+ function OOP_getInstance() {
239
+ if (OOP_instance == null)
240
+ new OOP();
241
+ return OOP_instance;
242
+ }
243
+ function OOPLib() {
244
+ OOPLib_instance = this;
245
+ AbstractLibrary.call(this);
246
+ }
247
+ OOPLib.prototype.i2e = function () {
248
+ return 'prolog.oop';
249
+ };
250
+ OOPLib.prototype.h2e = function () {
251
+ var tmp$ret$3;
252
+ // Inline function 'kotlin.collections.map' call
253
+ var tmp0_map = listOf([ArrayItems_getInstance(), Assign_getInstance(), Cast_getInstance(), Type_getInstance(), InvokeMethod_getInstance(), InvokeStrict_getInstance(), ListItems_getInstance(), NewObject3_getInstance(), NullRef_getInstance(), ObjectRef_getInstance(), Ref_getInstance(), Register_getInstance(), SetItems_getInstance(), TypeRef_getInstance(), Unregister_getInstance()]);
254
+ var tmp$ret$2;
255
+ // Inline function 'kotlin.collections.mapTo' call
256
+ var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_map, 10));
257
+ var tmp0_iterator = tmp0_map.j();
258
+ while (tmp0_iterator.m()) {
259
+ var item = tmp0_iterator.p();
260
+ var tmp$ret$1;
261
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.OOPLib.<get-primitives>.<anonymous>' call
262
+ var tmp$ret$0;
263
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.descriptionPair' call
264
+ tmp$ret$0 = to(item.signature, item.j1u());
265
+ tmp$ret$1 = tmp$ret$0;
266
+ tmp0_mapTo.g(tmp$ret$1);
267
+ }
268
+ tmp$ret$2 = tmp0_mapTo;
269
+ tmp$ret$3 = tmp$ret$2;
270
+ return toMap(tmp$ret$3);
271
+ };
272
+ OOPLib.prototype.t1l = function () {
273
+ var tmp$ret$2;
274
+ // Inline function 'kotlin.collections.map' call
275
+ var tmp0_map = listOf(arrayConcat([[Cast_getInstance_0(), Invocation_getInstance(), Assignment_getInstance(), Dot_getInstance(), Recursive_getInstance(), Couple_getInstance(), Trivial_getInstance(), NewObject2_getInstance(), Recursive_getInstance_0(), Base_getInstance(), Companion_getInstance_27().s3p('string', PrimitiveClasses_getInstance().ee()), Companion_getInstance_27().s3p('array', PrimitiveClasses_getInstance().de()), Companion_getInstance_27().s3p('list', getKClass(List)), Companion_getInstance_27().s3p('arraylist', getKClass(ArrayList)), Companion_getInstance_27().s3p('map', getKClass(Map)), Companion_getInstance_27().s3p('hashmap', getKClass(LinkedHashMap)), Companion_getInstance_27().s3p('int', PrimitiveClasses_getInstance().ae()), Companion_getInstance_27().s3p('integer', PrimitiveClasses_getInstance().ae()), Companion_getInstance_27().s3p('double', PrimitiveClasses_getInstance().ce()), Companion_getInstance_27().s3p('float', PrimitiveClasses_getInstance().be()), Companion_getInstance_27().s3p('long', getKClass(Long)), Companion_getInstance_27().s3p('short', PrimitiveClasses_getInstance().zd()), Companion_getInstance_27().s3p('byte', PrimitiveClasses_getInstance().yd()), Companion_getInstance_27().s3p('char', getKClass(Char)), Companion_getInstance_27().s3p('bool', PrimitiveClasses_getInstance().xd()), Companion_getInstance_27().s3p('boolean', PrimitiveClasses_getInstance().xd()), Companion_getInstance_27().s3p('any', PrimitiveClasses_getInstance().ud()), Companion_getInstance_27().s3p('nothing', PrimitiveClasses_getInstance().wd()), Companion_getInstance_27().s3p('big_integer', getKClass(BigInteger)), Companion_getInstance_27().s3p('big_decimal', getKClass(BigDecimal))], get_platformSpecificAliases()]));
276
+ var tmp$ret$1;
277
+ // Inline function 'kotlin.collections.mapTo' call
278
+ var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_map, 10));
279
+ var tmp0_iterator = tmp0_map.j();
280
+ while (tmp0_iterator.m()) {
281
+ var item = tmp0_iterator.p();
282
+ var tmp$ret$0;
283
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.OOPLib.<get-clauses>.<anonymous>' call
284
+ tmp$ret$0 = item.j1u();
285
+ tmp0_mapTo.g(tmp$ret$0);
286
+ }
287
+ tmp$ret$1 = tmp0_mapTo;
288
+ tmp$ret$2 = tmp$ret$1;
289
+ return tmp$ret$2;
290
+ };
291
+ OOPLib.prototype.h1v = function () {
292
+ return OperatorSet_init_$Create$([new Operator('.', Specifier_XFY_getInstance(), 800), new Operator(':=', Specifier_XFX_getInstance(), 850), new Operator('as', Specifier_XFX_getInstance(), 200), new Operator('$', Specifier_FX_getInstance(), 100)]);
293
+ };
294
+ var OOPLib_instance;
295
+ function OOPLib_getInstance() {
296
+ if (OOPLib_instance == null)
297
+ new OOPLib();
298
+ return OOPLib_instance;
299
+ }
300
+ function nameOf($this, type, identifier) {
301
+ return '<object:' + get_fullName(type) + '#' + identifier + '>';
302
+ }
303
+ function Companion() {
304
+ Companion_instance = this;
305
+ this.t3p_1 = NullRefImpl_getInstance();
306
+ }
307
+ Companion.prototype.u3p = function (any) {
308
+ var tmp0_subject = any;
309
+ return tmp0_subject == null ? nameOf(this, PrimitiveClasses_getInstance().wd(), 'null') : nameOf(this, getKClassFromExpression(any), get_identifier(any));
310
+ };
311
+ Companion.prototype.v3p = function (any) {
312
+ var tmp0_subject = any;
313
+ return tmp0_subject == null ? this.t3p_1 : new ObjectRefImpl(any);
314
+ };
315
+ var Companion_instance;
316
+ function Companion_getInstance_19() {
317
+ if (Companion_instance == null)
318
+ new Companion();
319
+ return Companion_instance;
320
+ }
321
+ function ObjectRef() {
322
+ }
323
+ function Companion_0() {
324
+ Companion_instance_0 = this;
325
+ this.w3p_1 = new ObjectToTermConverterImpl();
326
+ }
327
+ var Companion_instance_0;
328
+ function Companion_getInstance_20() {
329
+ if (Companion_instance_0 == null)
330
+ new Companion_0();
331
+ return Companion_instance_0;
332
+ }
333
+ function Companion_1() {
334
+ Companion_instance_1 = this;
335
+ }
336
+ Companion_1.prototype.x3p = function (type, termToObjectConverter) {
337
+ return overloadSelector(type, termToObjectConverter);
338
+ };
339
+ var Companion_instance_1;
340
+ function Companion_getInstance_21() {
341
+ if (Companion_instance_1 == null)
342
+ new Companion_1();
343
+ return Companion_instance_1;
344
+ }
345
+ function Ref() {
346
+ }
347
+ function _get_termValue__ikgccs($this) {
348
+ var tmp$ret$0;
349
+ // Inline function 'kotlin.getValue' call
350
+ var tmp0_getValue = termValue$factory();
351
+ tmp$ret$0 = $this.z3p_1.b1();
352
+ return tmp$ret$0;
353
+ }
354
+ function _get_objectRef__3zhern($this) {
355
+ var tmp$ret$0;
356
+ // Inline function 'kotlin.getValue' call
357
+ var tmp0_getValue = objectRef$factory();
358
+ tmp$ret$0 = $this.a3q_1.b1();
359
+ return tmp$ret$0;
360
+ }
361
+ function Result$Value$termValue$delegate$lambda(this$0) {
362
+ return function () {
363
+ return Companion_getInstance_20().w3p_1.b3q(this$0.y3p_1);
364
+ };
365
+ }
366
+ function Result$Value$objectRef$delegate$lambda(this$0) {
367
+ return function () {
368
+ var tmp$ret$1;
369
+ // Inline function 'kotlin.let' call
370
+ var tmp0_let = _get_termValue__ikgccs(this$0);
371
+ // Inline function 'kotlin.contracts.contract' call
372
+ var tmp$ret$0;
373
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.Value.objectRef$delegate.<anonymous>.<anonymous>' call
374
+ var tmp;
375
+ if (isInterface(tmp0_let, ObjectRef)) {
376
+ tmp = tmp0_let;
377
+ } else {
378
+ tmp = Companion_getInstance_19().v3p(this$0.y3p_1);
379
+ }
380
+ tmp$ret$0 = tmp;
381
+ tmp$ret$1 = tmp$ret$0;
382
+ return tmp$ret$1;
383
+ };
384
+ }
385
+ function Value(value) {
386
+ Result.call(this);
387
+ this.y3p_1 = value;
388
+ var tmp = this;
389
+ tmp.z3p_1 = lazy(Result$Value$termValue$delegate$lambda(this));
390
+ var tmp_0 = this;
391
+ tmp_0.a3q_1 = lazy(Result$Value$objectRef$delegate$lambda(this));
392
+ }
393
+ Value.prototype.r1i = function () {
394
+ return _get_termValue__ikgccs(this);
395
+ };
396
+ Value.prototype.toTerm = function () {
397
+ return this.r1i();
398
+ };
399
+ Value.prototype.c3q = function () {
400
+ return _get_objectRef__3zhern(this);
401
+ };
402
+ Value.prototype.toString = function () {
403
+ return 'Value(value=' + toString(this.y3p_1) + ')';
404
+ };
405
+ Value.prototype.hashCode = function () {
406
+ return this.y3p_1 == null ? 0 : hashCode(this.y3p_1);
407
+ };
408
+ Value.prototype.equals = function (other) {
409
+ if (this === other)
410
+ return true;
411
+ if (!(other instanceof Value))
412
+ return false;
413
+ var tmp0_other_with_cast = other instanceof Value ? other : THROW_CCE();
414
+ if (!equals(this.y3p_1, tmp0_other_with_cast.y3p_1))
415
+ return false;
416
+ return true;
417
+ };
418
+ function Result() {
419
+ }
420
+ function termValue$factory() {
421
+ return getPropertyCallableRef('termValue', 1, KProperty1, function (receiver) {
422
+ return _get_termValue__ikgccs(receiver);
423
+ }, null);
424
+ }
425
+ function objectRef$factory() {
426
+ return getPropertyCallableRef('objectRef', 1, KProperty1, function (receiver) {
427
+ return _get_objectRef__3zhern(receiver);
428
+ }, null);
429
+ }
430
+ function TermToObjectConverter$Companion$of$lambda(it) {
431
+ return null;
432
+ }
433
+ function Companion_2() {
434
+ Companion_instance_2 = this;
435
+ var tmp = this;
436
+ tmp.d3q_1 = this.e3q(null, null, 3, null);
437
+ }
438
+ Companion_2.prototype.f3q = function (typeFactory, dealiaser) {
439
+ return new TermToObjectConverterImpl(typeFactory, dealiaser);
440
+ };
441
+ Companion_2.prototype.e3q = function (typeFactory, dealiaser, $mask0, $handler) {
442
+ if (!(($mask0 & 1) === 0))
443
+ typeFactory = Companion_getInstance_23().g3q_1;
444
+ if (!(($mask0 & 2) === 0)) {
445
+ dealiaser = TermToObjectConverter$Companion$of$lambda;
446
+ }
447
+ return this.f3q(typeFactory, dealiaser);
448
+ };
449
+ var Companion_instance_2;
450
+ function Companion_getInstance_22() {
451
+ if (Companion_instance_2 == null)
452
+ new Companion_2();
453
+ return Companion_instance_2;
454
+ }
455
+ function TermToObjectConverter() {
456
+ }
457
+ function Companion_3() {
458
+ Companion_instance_3 = this;
459
+ this.g3q_1 = new TypeFactoryImpl();
460
+ }
461
+ var Companion_instance_3;
462
+ function Companion_getInstance_23() {
463
+ if (Companion_instance_3 == null)
464
+ new Companion_3();
465
+ return Companion_instance_3;
466
+ }
467
+ function TypeFactory$typeRefFromName$lambda(it) {
468
+ return Companion_getInstance_24().l3q(it);
469
+ }
470
+ function TypeFactory() {
471
+ }
472
+ function Companion_4() {
473
+ Companion_instance_4 = this;
474
+ }
475
+ Companion_4.prototype.l3q = function (type) {
476
+ return new TypeRefImpl(type);
477
+ };
478
+ var Companion_instance_4;
479
+ function Companion_getInstance_24() {
480
+ if (Companion_instance_4 == null)
481
+ new Companion_4();
482
+ return Companion_instance_4;
483
+ }
484
+ function TypeRef() {
485
+ }
486
+ function get_PRIMITIVE_TYPES() {
487
+ init_properties_TypeUtils_kt_oih1j7();
488
+ return PRIMITIVE_TYPES;
489
+ }
490
+ var PRIMITIVE_TYPES;
491
+ function get_id() {
492
+ return id;
493
+ }
494
+ var id;
495
+ function get_isPrimitiveType(_this__u8e3s4) {
496
+ init_properties_TypeUtils_kt_oih1j7();
497
+ return contains(get_PRIMITIVE_TYPES(), _this__u8e3s4);
498
+ }
499
+ function isSubtypeOf(_this__u8e3s4, other) {
500
+ init_properties_TypeUtils_kt_oih1j7();
501
+ return isSubtypeOf_0(_this__u8e3s4, other, false);
502
+ }
503
+ function create_0(_this__u8e3s4, objectConverter, arguments_0) {
504
+ init_properties_TypeUtils_kt_oih1j7();
505
+ var constructorRef = Companion_getInstance_21().x3p(_this__u8e3s4, objectConverter).q3q(arguments_0);
506
+ return callWithPrologArguments$default(constructorRef, objectConverter, arguments_0, null, 4, null);
507
+ }
508
+ function invoke_0(_this__u8e3s4, objectConverter, methodName, arguments_0) {
509
+ init_properties_TypeUtils_kt_oih1j7();
510
+ return invoke_1(getKClassFromExpression(_this__u8e3s4), objectConverter, methodName, arguments_0, _this__u8e3s4);
511
+ }
512
+ function invoke_1(_this__u8e3s4, objectConverter, methodName, arguments_0, instance) {
513
+ init_properties_TypeUtils_kt_oih1j7();
514
+ var methodRef = Companion_getInstance_21().x3p(_this__u8e3s4, objectConverter).r3q(methodName, arguments_0);
515
+ return callWithPrologArguments(methodRef, objectConverter, arguments_0, instance);
516
+ }
517
+ function assign_0(_this__u8e3s4, objectConverter, propertyName, value) {
518
+ init_properties_TypeUtils_kt_oih1j7();
519
+ return assign_1(getKClassFromExpression(_this__u8e3s4), objectConverter, propertyName, value, _this__u8e3s4);
520
+ }
521
+ function assign_1(_this__u8e3s4, objectConverter, propertyName, value, instance) {
522
+ init_properties_TypeUtils_kt_oih1j7();
523
+ var setterRef = get_setterMethod(Companion_getInstance_21().x3p(_this__u8e3s4, objectConverter).s3q(propertyName, value));
524
+ return callWithPrologArguments(setterRef, objectConverter, listOf_0(value), instance);
525
+ }
526
+ function isSubtypeOf_0(_this__u8e3s4, other, strict) {
527
+ init_properties_TypeUtils_kt_oih1j7();
528
+ return isSupertypeOf(other, _this__u8e3s4, strict);
529
+ }
530
+ function callWithPrologArguments(_this__u8e3s4, converter, arguments_0, instance) {
531
+ init_properties_TypeUtils_kt_oih1j7();
532
+ var formalArgumentsTypes = ensureArgumentsListIsOfSize(_this__u8e3s4, arguments_0);
533
+ var tmp$ret$3;
534
+ // Inline function 'kotlin.collections.toTypedArray' call
535
+ var tmp$ret$2;
536
+ // Inline function 'kotlin.collections.mapIndexed' call
537
+ var tmp$ret$1;
538
+ // Inline function 'kotlin.collections.mapIndexedTo' call
539
+ var tmp0_mapIndexedTo = ArrayList_init_$Create$(collectionSizeOrDefault(arguments_0, 10));
540
+ var index = 0;
541
+ var tmp0_iterator = arguments_0.j();
542
+ while (tmp0_iterator.m()) {
543
+ var item = tmp0_iterator.p();
544
+ var tmp$ret$0;
545
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.callWithPrologArguments.<anonymous>' call
546
+ var tmp1 = index;
547
+ index = tmp1 + 1 | 0;
548
+ var tmp0__anonymous__q1qw7t = checkIndexOverflow(tmp1);
549
+ tmp$ret$0 = converter.h3q(formalArgumentsTypes.n(tmp0__anonymous__q1qw7t), item);
550
+ tmp0_mapIndexedTo.g(tmp$ret$0);
551
+ }
552
+ tmp$ret$1 = tmp0_mapIndexedTo;
553
+ tmp$ret$2 = tmp$ret$1;
554
+ var tmp1_toTypedArray = tmp$ret$2;
555
+ tmp$ret$3 = copyToArray(tmp1_toTypedArray);
556
+ var args = tmp$ret$3;
557
+ return catchingPlatformSpecificException(_this__u8e3s4, instance, callWithPrologArguments$lambda(_this__u8e3s4, instance, args));
558
+ }
559
+ function callWithPrologArguments$default(_this__u8e3s4, converter, arguments_0, instance, $mask0, $handler) {
560
+ if (!(($mask0 & 4) === 0))
561
+ instance = null;
562
+ return callWithPrologArguments(_this__u8e3s4, converter, arguments_0, instance);
563
+ }
564
+ function isSupertypeOf(_this__u8e3s4, other, strict) {
565
+ init_properties_TypeUtils_kt_oih1j7();
566
+ var tmp$ret$1;
567
+ $l$block: {
568
+ // Inline function 'kotlin.sequences.any' call
569
+ var tmp0_any = allSupertypes(other, strict);
570
+ var tmp0_iterator = tmp0_any.j();
571
+ while (tmp0_iterator.m()) {
572
+ var element = tmp0_iterator.p();
573
+ var tmp$ret$0;
574
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.isSupertypeOf.<anonymous>' call
575
+ tmp$ret$0 = element.equals(_this__u8e3s4);
576
+ if (tmp$ret$0) {
577
+ tmp$ret$1 = true;
578
+ break $l$block;
579
+ }
580
+ }
581
+ tmp$ret$1 = false;
582
+ }
583
+ return tmp$ret$1;
584
+ }
585
+ function ensureArgumentsListIsOfSize(_this__u8e3s4, actualArguments) {
586
+ init_properties_TypeUtils_kt_oih1j7();
587
+ var tmp$ret$4;
588
+ // Inline function 'kotlin.also' call
589
+ var tmp0_also = get_formalParameterTypes(_this__u8e3s4);
590
+ // Inline function 'kotlin.contracts.contract' call
591
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.ensureArgumentsListIsOfSize.<anonymous>' call
592
+ // Inline function 'kotlin.require' call
593
+ var tmp0_require = get_formalParameterTypes(_this__u8e3s4).o() === actualArguments.o();
594
+ // Inline function 'kotlin.contracts.contract' call
595
+ if (!tmp0_require) {
596
+ var tmp$ret$3;
597
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.ensureArgumentsListIsOfSize.<anonymous>.<anonymous>' call
598
+ var tmp = _this__u8e3s4.callableName;
599
+ var tmp$ret$2;
600
+ // Inline function 'kotlin.collections.map' call
601
+ var tmp$ret$1;
602
+ // Inline function 'kotlin.collections.mapTo' call
603
+ var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_also, 10));
604
+ var tmp0_iterator = tmp0_also.j();
605
+ while (tmp0_iterator.m()) {
606
+ var item = tmp0_iterator.p();
607
+ var tmp$ret$0;
608
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.ensureArgumentsListIsOfSize.<anonymous>.<anonymous>.<anonymous>' call
609
+ tmp$ret$0 = get_name(item);
610
+ tmp0_mapTo.g(tmp$ret$0);
611
+ }
612
+ tmp$ret$1 = tmp0_mapTo;
613
+ tmp$ret$2 = tmp$ret$1;
614
+ var tmp_0 = '\n |\n |Error while invoking ' + tmp + ' the expected argument types \n | ' + tmp$ret$2 + ' \n |are not as many as the as the actual parameters (' + tmp0_also.o() + ' vs. ' + actualArguments.o() + '):\n | ' + actualArguments + '\n |\n ';
615
+ tmp$ret$3 = trimMargin$default(tmp_0, null, 1, null);
616
+ var message = tmp$ret$3;
617
+ throw IllegalArgumentException_init_$Create$(toString_0(message));
618
+ }
619
+ tmp$ret$4 = tmp0_also;
620
+ return tmp$ret$4;
621
+ }
622
+ function callWithPrologArguments$lambda($this_callWithPrologArguments, $instance, $args) {
623
+ return function () {
624
+ var result = invoke_2($this_callWithPrologArguments, $instance, $args.slice());
625
+ return new Value(result);
626
+ };
627
+ }
628
+ var properties_initialized_TypeUtils_kt_7pe6qv;
629
+ function init_properties_TypeUtils_kt_oih1j7() {
630
+ if (properties_initialized_TypeUtils_kt_7pe6qv) {
631
+ } else {
632
+ properties_initialized_TypeUtils_kt_7pe6qv = true;
633
+ PRIMITIVE_TYPES = setOf([getKClass(Long), PrimitiveClasses_getInstance().ae(), PrimitiveClasses_getInstance().zd(), PrimitiveClasses_getInstance().yd(), getKClass(Char), PrimitiveClasses_getInstance().ce(), PrimitiveClasses_getInstance().be()]);
634
+ }
635
+ }
636
+ function MalformedAliasException(dealiasingExpression) {
637
+ var tmp = 'This is not a dealiasing expression `' + dealiasingExpression + '` in the form ' + format(get_DEALIASING_TEMPLATE(), Companion_getInstance_0().prettyExpressionsPrettyVariablesDefaultOperators());
638
+ OopException_init_$Init$_0(tmp, null, 2, null, this);
639
+ this.t3q_1 = dealiasingExpression;
640
+ captureStack(this, MalformedAliasException);
641
+ }
642
+ MalformedAliasException.prototype.u3q = function (context, signature) {
643
+ var tmp = Companion_getInstance_1();
644
+ var tmp_0 = Expected_DEALIASING_EXPRESSION_getInstance();
645
+ var tmp_1 = this.a26();
646
+ var tmp_2 = signature.toIndicator();
647
+ var tmp0_safe_receiver = this.message;
648
+ var tmp_3;
649
+ if (tmp0_safe_receiver == null) {
650
+ tmp_3 = null;
651
+ } else {
652
+ var tmp$ret$7;
653
+ // Inline function 'kotlin.text.replaceFirstChar' call
654
+ var tmp_4;
655
+ var tmp$ret$0;
656
+ // Inline function 'kotlin.text.isNotEmpty' call
657
+ tmp$ret$0 = charSequenceLength(tmp0_safe_receiver) > 0;
658
+ if (tmp$ret$0) {
659
+ var tmp$ret$4;
660
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.exceptions.MalformedAliasException.toLogicError.<anonymous>' call
661
+ var tmp0__anonymous__q1qw7t = charSequenceGet(tmp0_safe_receiver, 0);
662
+ var tmp$ret$3;
663
+ // Inline function 'kotlin.text.lowercase' call
664
+ var tmp$ret$2;
665
+ // Inline function 'kotlin.js.unsafeCast' call
666
+ var tmp$ret$1;
667
+ // Inline function 'kotlin.js.asDynamic' call
668
+ var tmp0_asDynamic = toString_1(tmp0__anonymous__q1qw7t);
669
+ tmp$ret$1 = tmp0_asDynamic;
670
+ var tmp1_unsafeCast = tmp$ret$1.toLowerCase();
671
+ tmp$ret$2 = tmp1_unsafeCast;
672
+ tmp$ret$3 = tmp$ret$2;
673
+ tmp$ret$4 = tmp$ret$3;
674
+ var tmp_5 = toString_0(tmp$ret$4);
675
+ var tmp$ret$6;
676
+ // Inline function 'kotlin.text.substring' call
677
+ var tmp$ret$5;
678
+ // Inline function 'kotlin.js.asDynamic' call
679
+ tmp$ret$5 = tmp0_safe_receiver;
680
+ tmp$ret$6 = tmp$ret$5.substring(1);
681
+ tmp_4 = tmp_5 + tmp$ret$6;
682
+ } else {
683
+ tmp_4 = tmp0_safe_receiver;
684
+ }
685
+ tmp$ret$7 = tmp_4;
686
+ tmp_3 = tmp$ret$7;
687
+ }
688
+ return tmp.of(context, tmp_0, tmp_1, 'Error in ' + tmp_2 + ': ' + tmp_3);
689
+ };
690
+ MalformedAliasException.prototype.a26 = function () {
691
+ return this.t3q_1;
692
+ };
693
+ function NoSuchAnAliasException(dealiasingExpression) {
694
+ var tmp = 'There exists no reference whose alias is `' + dealiasingExpression.get(0) + '`';
695
+ OopException_init_$Init$_0(tmp, null, 2, null, this);
696
+ this.v3q_1 = dealiasingExpression;
697
+ // Inline function 'kotlin.require' call
698
+ var tmp0_require = Companion_getInstance_2().matches(this.v3q_1, get_DEALIASING_TEMPLATE());
699
+ // Inline function 'kotlin.contracts.contract' call
700
+ // Inline function 'kotlin.require' call
701
+ // Inline function 'kotlin.contracts.contract' call
702
+ if (!tmp0_require) {
703
+ var tmp$ret$0;
704
+ // Inline function 'kotlin.require.<anonymous>' call
705
+ tmp$ret$0 = 'Failed requirement.';
706
+ var message = tmp$ret$0;
707
+ throw IllegalArgumentException_init_$Create$(toString_0(message));
708
+ }
709
+ // Inline function 'kotlin.require' call
710
+ var tmp_0 = this.v3q_1.get(0);
711
+ var tmp1_require = isInterface(tmp_0, Struct);
712
+ // Inline function 'kotlin.contracts.contract' call
713
+ // Inline function 'kotlin.require' call
714
+ // Inline function 'kotlin.contracts.contract' call
715
+ if (!tmp1_require) {
716
+ var tmp$ret$1;
717
+ // Inline function 'kotlin.require.<anonymous>' call
718
+ tmp$ret$1 = 'Failed requirement.';
719
+ var message_0 = tmp$ret$1;
720
+ throw IllegalArgumentException_init_$Create$(toString_0(message_0));
721
+ }
722
+ captureStack(this, NoSuchAnAliasException);
723
+ }
724
+ NoSuchAnAliasException.prototype.u3q = function (context, signature) {
725
+ var tmp = Companion_getInstance_3();
726
+ var tmp_0 = ObjectType_OOP_ALIAS_getInstance();
727
+ var tmp_1 = this.a26();
728
+ var tmp0_elvis_lhs = this.message;
729
+ return tmp.of(context, tmp_0, tmp_1, tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs);
730
+ };
731
+ NoSuchAnAliasException.prototype.a26 = function () {
732
+ return this.v3q_1;
733
+ };
734
+ function OopException_init_$Init$(message, cause, $this) {
735
+ TuPrologException_init_$Init$(message, cause, $this);
736
+ OopException.call($this);
737
+ return $this;
738
+ }
739
+ function OopException_init_$Init$_0(message, cause, $mask0, $marker, $this) {
740
+ if (!(($mask0 & 1) === 0))
741
+ message = null;
742
+ if (!(($mask0 & 2) === 0))
743
+ cause = null;
744
+ OopException_init_$Init$(message, cause, $this);
745
+ return $this;
746
+ }
747
+ function Companion_5() {
748
+ Companion_instance_5 = this;
749
+ }
750
+ var Companion_instance_5;
751
+ function Companion_getInstance_25() {
752
+ if (Companion_instance_5 == null)
753
+ new Companion_5();
754
+ return Companion_instance_5;
755
+ }
756
+ function OopException() {
757
+ Companion_getInstance_25();
758
+ captureStack(this, OopException);
759
+ }
760
+ function TermToObjectConversionException_init_$Init$(term, $this) {
761
+ TermToObjectConversionException.call($this, term, null);
762
+ return $this;
763
+ }
764
+ function TermToObjectConversionException_init_$Create$(term) {
765
+ var tmp = TermToObjectConversionException_init_$Init$(term, Object.create(TermToObjectConversionException.prototype));
766
+ captureStack(tmp, TermToObjectConversionException_init_$Create$);
767
+ return tmp;
768
+ }
769
+ function TermToObjectConversionException(term, targetType) {
770
+ var tmp0_safe_receiver = targetType;
771
+ var tmp;
772
+ if (tmp0_safe_receiver == null) {
773
+ tmp = null;
774
+ } else {
775
+ var tmp$ret$1;
776
+ // Inline function 'kotlin.let' call
777
+ // Inline function 'kotlin.contracts.contract' call
778
+ var tmp$ret$0;
779
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.exceptions.TermToObjectConversionException.<init>.<anonymous>' call
780
+ tmp$ret$0 = 'Term `' + term + '` cannot be converted into an object of type ' + get_fullName(targetType);
781
+ tmp$ret$1 = tmp$ret$0;
782
+ tmp = tmp$ret$1;
783
+ }
784
+ var tmp1_elvis_lhs = tmp;
785
+ var tmp_0 = tmp1_elvis_lhs == null ? 'Term `' + term + '` cannot be converted into an object' : tmp1_elvis_lhs;
786
+ OopException_init_$Init$_0(tmp_0, null, 2, null, this);
787
+ this.w3q_1 = term;
788
+ this.x3q_1 = targetType;
789
+ captureStack(this, TermToObjectConversionException);
790
+ }
791
+ TermToObjectConversionException.prototype.u3q = function (context, signature) {
792
+ return Companion_getInstance_4().t27(context, signature, Limit_OOP_OBJECT_getInstance(), this);
793
+ };
794
+ function NullRefImpl() {
795
+ NullRefImpl_instance = this;
796
+ this.y3q_1 = Companion_getInstance_5().of(Companion_getInstance_19().u3p(null));
797
+ }
798
+ NullRefImpl.prototype.gw = function () {
799
+ return this.y3q_1.gw();
800
+ };
801
+ NullRefImpl.prototype.yw = function () {
802
+ return this.y3q_1.yw();
803
+ };
804
+ NullRefImpl.prototype.zv = function () {
805
+ return this.y3q_1.zv();
806
+ };
807
+ NullRefImpl.prototype.fw = function () {
808
+ return this.y3q_1.fw();
809
+ };
810
+ NullRefImpl.prototype.xw = function () {
811
+ return this.y3q_1.xw();
812
+ };
813
+ NullRefImpl.prototype.aw = function () {
814
+ return this.y3q_1.aw();
815
+ };
816
+ NullRefImpl.prototype.tw = function () {
817
+ return this.y3q_1.tw();
818
+ };
819
+ NullRefImpl.prototype.mw = function () {
820
+ return this.y3q_1.mw();
821
+ };
822
+ NullRefImpl.prototype.sw = function () {
823
+ return this.y3q_1.sw();
824
+ };
825
+ NullRefImpl.prototype.ow = function () {
826
+ return this.y3q_1.ow();
827
+ };
828
+ NullRefImpl.prototype.bw = function () {
829
+ return this.y3q_1.bw();
830
+ };
831
+ NullRefImpl.prototype.cw = function () {
832
+ return this.y3q_1.cw();
833
+ };
834
+ NullRefImpl.prototype.pw = function () {
835
+ return this.y3q_1.pw();
836
+ };
837
+ NullRefImpl.prototype.ew = function () {
838
+ return this.y3q_1.ew();
839
+ };
840
+ NullRefImpl.prototype.ww = function () {
841
+ return this.y3q_1.ww();
842
+ };
843
+ NullRefImpl.prototype.jx = function () {
844
+ return this.y3q_1.jx();
845
+ };
846
+ NullRefImpl.prototype.uw = function () {
847
+ return this.y3q_1.uw();
848
+ };
849
+ NullRefImpl.prototype.gx = function () {
850
+ return this.y3q_1.gx();
851
+ };
852
+ NullRefImpl.prototype.rw = function () {
853
+ return this.y3q_1.rw();
854
+ };
855
+ NullRefImpl.prototype.fx = function () {
856
+ return this.y3q_1.fx();
857
+ };
858
+ NullRefImpl.prototype.hx = function () {
859
+ return this.y3q_1.hx();
860
+ };
861
+ NullRefImpl.prototype.dx = function () {
862
+ return this.y3q_1.dx();
863
+ };
864
+ NullRefImpl.prototype.nw = function () {
865
+ return this.y3q_1.nw();
866
+ };
867
+ NullRefImpl.prototype.lw = function () {
868
+ return this.y3q_1.lw();
869
+ };
870
+ NullRefImpl.prototype.dw = function () {
871
+ return this.y3q_1.dw();
872
+ };
873
+ NullRefImpl.prototype.cx = function () {
874
+ return this.y3q_1.cx();
875
+ };
876
+ NullRefImpl.prototype.qw = function () {
877
+ return this.y3q_1.qw();
878
+ };
879
+ NullRefImpl.prototype.bx = function () {
880
+ return this.y3q_1.bx();
881
+ };
882
+ NullRefImpl.prototype.kt = function () {
883
+ return this.y3q_1.kt();
884
+ };
885
+ NullRefImpl.prototype.b1 = function () {
886
+ return this.y3q_1.b1();
887
+ };
888
+ NullRefImpl.prototype.hw = function () {
889
+ return this.y3q_1.hw();
890
+ };
891
+ NullRefImpl.prototype.addFirst = function (argument) {
892
+ return this.y3q_1.addFirst(argument);
893
+ };
894
+ NullRefImpl.prototype.addLast = function (argument) {
895
+ return this.y3q_1.addLast(argument);
896
+ };
897
+ NullRefImpl.prototype.append = function (argument) {
898
+ return this.y3q_1.append(argument);
899
+ };
900
+ NullRefImpl.prototype.kw = function () {
901
+ return this.y3q_1.kw();
902
+ };
903
+ NullRefImpl.prototype.asAtom = function () {
904
+ return this.kw();
905
+ };
906
+ NullRefImpl.prototype.asBlock = function () {
907
+ return this.y3q_1.asBlock();
908
+ };
909
+ NullRefImpl.prototype.asClause = function () {
910
+ return this.y3q_1.asClause();
911
+ };
912
+ NullRefImpl.prototype.asCons = function () {
913
+ return this.y3q_1.asCons();
914
+ };
915
+ NullRefImpl.prototype.asDirective = function () {
916
+ return this.y3q_1.asDirective();
917
+ };
918
+ NullRefImpl.prototype.asEmptyBlock = function () {
919
+ return this.y3q_1.asEmptyBlock();
920
+ };
921
+ NullRefImpl.prototype.asEmptyList = function () {
922
+ return this.y3q_1.asEmptyList();
923
+ };
924
+ NullRefImpl.prototype.asFact = function () {
925
+ return this.y3q_1.asFact();
926
+ };
927
+ NullRefImpl.prototype.asIndicator = function () {
928
+ return this.y3q_1.asIndicator();
929
+ };
930
+ NullRefImpl.prototype.asInteger = function () {
931
+ return this.y3q_1.asInteger();
932
+ };
933
+ NullRefImpl.prototype.asList = function () {
934
+ return this.y3q_1.asList();
935
+ };
936
+ NullRefImpl.prototype.asNumeric = function () {
937
+ return this.y3q_1.asNumeric();
938
+ };
939
+ NullRefImpl.prototype.asReal = function () {
940
+ return this.y3q_1.asReal();
941
+ };
942
+ NullRefImpl.prototype.asRecursive = function () {
943
+ return this.y3q_1.asRecursive();
944
+ };
945
+ NullRefImpl.prototype.asRule = function () {
946
+ return this.y3q_1.asRule();
947
+ };
948
+ NullRefImpl.prototype.vw = function () {
949
+ return this.y3q_1.vw();
950
+ };
951
+ NullRefImpl.prototype.asStruct = function () {
952
+ return this.vw();
953
+ };
954
+ NullRefImpl.prototype.asTerm = function () {
955
+ return this.y3q_1.asTerm();
956
+ };
957
+ NullRefImpl.prototype.asTruth = function () {
958
+ return this.y3q_1.asTruth();
959
+ };
960
+ NullRefImpl.prototype.asTuple = function () {
961
+ return this.y3q_1.asTuple();
962
+ };
963
+ NullRefImpl.prototype.asVar = function () {
964
+ return this.y3q_1.asVar();
965
+ };
966
+ NullRefImpl.prototype.castToAtom = function () {
967
+ return this.y3q_1.castToAtom();
968
+ };
969
+ NullRefImpl.prototype.castToBlock = function () {
970
+ return this.y3q_1.castToBlock();
971
+ };
972
+ NullRefImpl.prototype.castToClause = function () {
973
+ return this.y3q_1.castToClause();
974
+ };
975
+ NullRefImpl.prototype.castToCons = function () {
976
+ return this.y3q_1.castToCons();
977
+ };
978
+ NullRefImpl.prototype.castToConstant = function () {
979
+ return this.y3q_1.castToConstant();
980
+ };
981
+ NullRefImpl.prototype.castToDirective = function () {
982
+ return this.y3q_1.castToDirective();
983
+ };
984
+ NullRefImpl.prototype.castToEmptyBlock = function () {
985
+ return this.y3q_1.castToEmptyBlock();
986
+ };
987
+ NullRefImpl.prototype.castToEmptyList = function () {
988
+ return this.y3q_1.castToEmptyList();
989
+ };
990
+ NullRefImpl.prototype.castToFact = function () {
991
+ return this.y3q_1.castToFact();
992
+ };
993
+ NullRefImpl.prototype.castToIndicator = function () {
994
+ return this.y3q_1.castToIndicator();
995
+ };
996
+ NullRefImpl.prototype.castToInteger = function () {
997
+ return this.y3q_1.castToInteger();
998
+ };
999
+ NullRefImpl.prototype.castToList = function () {
1000
+ return this.y3q_1.castToList();
1001
+ };
1002
+ NullRefImpl.prototype.castToNumeric = function () {
1003
+ return this.y3q_1.castToNumeric();
1004
+ };
1005
+ NullRefImpl.prototype.castToReal = function () {
1006
+ return this.y3q_1.castToReal();
1007
+ };
1008
+ NullRefImpl.prototype.castToRecursive = function () {
1009
+ return this.y3q_1.castToRecursive();
1010
+ };
1011
+ NullRefImpl.prototype.castToRule = function () {
1012
+ return this.y3q_1.castToRule();
1013
+ };
1014
+ NullRefImpl.prototype.castToStruct = function () {
1015
+ return this.y3q_1.castToStruct();
1016
+ };
1017
+ NullRefImpl.prototype.castToTerm = function () {
1018
+ return this.y3q_1.castToTerm();
1019
+ };
1020
+ NullRefImpl.prototype.castToTruth = function () {
1021
+ return this.y3q_1.castToTruth();
1022
+ };
1023
+ NullRefImpl.prototype.castToTuple = function () {
1024
+ return this.y3q_1.castToTuple();
1025
+ };
1026
+ NullRefImpl.prototype.castToVar = function () {
1027
+ return this.y3q_1.castToVar();
1028
+ };
1029
+ NullRefImpl.prototype.ax = function (other) {
1030
+ return this.y3q_1.ax(other);
1031
+ };
1032
+ NullRefImpl.prototype.aa = function (other) {
1033
+ return this.ax((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
1034
+ };
1035
+ NullRefImpl.prototype.containsTag = function (name) {
1036
+ return this.y3q_1.containsTag(name);
1037
+ };
1038
+ NullRefImpl.prototype.equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
1039
+ return this.y3q_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
1040
+ };
1041
+ NullRefImpl.prototype.equals = function (other) {
1042
+ return this.y3q_1.equals(other);
1043
+ };
1044
+ NullRefImpl.prototype.get = function (index) {
1045
+ return this.y3q_1.get(index);
1046
+ };
1047
+ NullRefImpl.prototype.getArgAt = function (index) {
1048
+ return this.y3q_1.getArgAt(index);
1049
+ };
1050
+ NullRefImpl.prototype.getTag = function (name) {
1051
+ return this.y3q_1.getTag(name);
1052
+ };
1053
+ NullRefImpl.prototype.hashCode = function () {
1054
+ return this.y3q_1.hashCode();
1055
+ };
1056
+ NullRefImpl.prototype.insertAt = function (index, argument) {
1057
+ return this.y3q_1.insertAt(index, argument);
1058
+ };
1059
+ NullRefImpl.prototype.resetTags = function (tags) {
1060
+ return this.y3q_1.resetTags(tags);
1061
+ };
1062
+ NullRefImpl.prototype.setArgs = function (args) {
1063
+ return this.y3q_1.setArgs(args);
1064
+ };
1065
+ NullRefImpl.prototype.setArgsIterable = function (args) {
1066
+ return this.y3q_1.setArgsIterable(args);
1067
+ };
1068
+ NullRefImpl.prototype.setArgsSequence = function (args) {
1069
+ return this.y3q_1.setArgsSequence(args);
1070
+ };
1071
+ NullRefImpl.prototype.setFunctor = function (functor) {
1072
+ return this.y3q_1.setFunctor(functor);
1073
+ };
1074
+ NullRefImpl.prototype.structurallyEquals = function (other) {
1075
+ return this.y3q_1.structurallyEquals(other);
1076
+ };
1077
+ NullRefImpl.prototype.toString = function () {
1078
+ return this.y3q_1.toString();
1079
+ };
1080
+ NullRefImpl.prototype.ex = function () {
1081
+ return true;
1082
+ };
1083
+ NullRefImpl.prototype.ix = function () {
1084
+ return this;
1085
+ };
1086
+ NullRefImpl.prototype.asConstant = function () {
1087
+ return this.ix();
1088
+ };
1089
+ NullRefImpl.prototype.iw = function () {
1090
+ return this;
1091
+ };
1092
+ NullRefImpl.prototype.freshCopy = function () {
1093
+ return this.iw();
1094
+ };
1095
+ NullRefImpl.prototype.jw = function (scope) {
1096
+ return this;
1097
+ };
1098
+ NullRefImpl.prototype.freshCopyFromScope = function (scope) {
1099
+ return this.jw(scope);
1100
+ };
1101
+ NullRefImpl.prototype.zw = function () {
1102
+ return isInterface(this, Term) ? this : THROW_CCE();
1103
+ };
1104
+ NullRefImpl.prototype.qq = function () {
1105
+ return this.zw();
1106
+ };
1107
+ NullRefImpl.prototype.s16 = function (substitution) {
1108
+ return this;
1109
+ };
1110
+ NullRefImpl.prototype.applySubstitution = function (substitution) {
1111
+ return this.s16(substitution);
1112
+ };
1113
+ NullRefImpl.prototype.c2p = function (substitution, substitutions) {
1114
+ return this;
1115
+ };
1116
+ NullRefImpl.prototype.apply = function (substitution, substitutions) {
1117
+ return this.c2p(substitution, substitutions);
1118
+ };
1119
+ NullRefImpl.prototype.b2p = function (substitution, substitutions) {
1120
+ return this;
1121
+ };
1122
+ NullRefImpl.prototype.getSubstituted = function (substitution, substitutions) {
1123
+ return this.b2p(substitution, substitutions);
1124
+ };
1125
+ NullRefImpl.prototype.y15 = function (visitor) {
1126
+ return visitor.visitAtom(this);
1127
+ };
1128
+ NullRefImpl.prototype.accept = function (visitor) {
1129
+ return this.y15(visitor);
1130
+ };
1131
+ var NullRefImpl_instance;
1132
+ function NullRefImpl_getInstance() {
1133
+ if (NullRefImpl_instance == null)
1134
+ new NullRefImpl();
1135
+ return NullRefImpl_instance;
1136
+ }
1137
+ function ObjectRefImpl(object) {
1138
+ this.z3q_1 = object;
1139
+ this.a3r_1 = Companion_getInstance_5().of(Companion_getInstance_19().u3p(object));
1140
+ }
1141
+ ObjectRefImpl.prototype.i3p = function () {
1142
+ return this.z3q_1;
1143
+ };
1144
+ ObjectRefImpl.prototype.gw = function () {
1145
+ return this.a3r_1.gw();
1146
+ };
1147
+ ObjectRefImpl.prototype.yw = function () {
1148
+ return this.a3r_1.yw();
1149
+ };
1150
+ ObjectRefImpl.prototype.zv = function () {
1151
+ return this.a3r_1.zv();
1152
+ };
1153
+ ObjectRefImpl.prototype.fw = function () {
1154
+ return this.a3r_1.fw();
1155
+ };
1156
+ ObjectRefImpl.prototype.xw = function () {
1157
+ return this.a3r_1.xw();
1158
+ };
1159
+ ObjectRefImpl.prototype.aw = function () {
1160
+ return this.a3r_1.aw();
1161
+ };
1162
+ ObjectRefImpl.prototype.tw = function () {
1163
+ return this.a3r_1.tw();
1164
+ };
1165
+ ObjectRefImpl.prototype.mw = function () {
1166
+ return this.a3r_1.mw();
1167
+ };
1168
+ ObjectRefImpl.prototype.sw = function () {
1169
+ return this.a3r_1.sw();
1170
+ };
1171
+ ObjectRefImpl.prototype.ow = function () {
1172
+ return this.a3r_1.ow();
1173
+ };
1174
+ ObjectRefImpl.prototype.bw = function () {
1175
+ return this.a3r_1.bw();
1176
+ };
1177
+ ObjectRefImpl.prototype.cw = function () {
1178
+ return this.a3r_1.cw();
1179
+ };
1180
+ ObjectRefImpl.prototype.pw = function () {
1181
+ return this.a3r_1.pw();
1182
+ };
1183
+ ObjectRefImpl.prototype.ew = function () {
1184
+ return this.a3r_1.ew();
1185
+ };
1186
+ ObjectRefImpl.prototype.ww = function () {
1187
+ return this.a3r_1.ww();
1188
+ };
1189
+ ObjectRefImpl.prototype.jx = function () {
1190
+ return this.a3r_1.jx();
1191
+ };
1192
+ ObjectRefImpl.prototype.uw = function () {
1193
+ return this.a3r_1.uw();
1194
+ };
1195
+ ObjectRefImpl.prototype.gx = function () {
1196
+ return this.a3r_1.gx();
1197
+ };
1198
+ ObjectRefImpl.prototype.rw = function () {
1199
+ return this.a3r_1.rw();
1200
+ };
1201
+ ObjectRefImpl.prototype.fx = function () {
1202
+ return this.a3r_1.fx();
1203
+ };
1204
+ ObjectRefImpl.prototype.hx = function () {
1205
+ return this.a3r_1.hx();
1206
+ };
1207
+ ObjectRefImpl.prototype.dx = function () {
1208
+ return this.a3r_1.dx();
1209
+ };
1210
+ ObjectRefImpl.prototype.nw = function () {
1211
+ return this.a3r_1.nw();
1212
+ };
1213
+ ObjectRefImpl.prototype.lw = function () {
1214
+ return this.a3r_1.lw();
1215
+ };
1216
+ ObjectRefImpl.prototype.dw = function () {
1217
+ return this.a3r_1.dw();
1218
+ };
1219
+ ObjectRefImpl.prototype.cx = function () {
1220
+ return this.a3r_1.cx();
1221
+ };
1222
+ ObjectRefImpl.prototype.qw = function () {
1223
+ return this.a3r_1.qw();
1224
+ };
1225
+ ObjectRefImpl.prototype.bx = function () {
1226
+ return this.a3r_1.bx();
1227
+ };
1228
+ ObjectRefImpl.prototype.kt = function () {
1229
+ return this.a3r_1.kt();
1230
+ };
1231
+ ObjectRefImpl.prototype.b1 = function () {
1232
+ return this.a3r_1.b1();
1233
+ };
1234
+ ObjectRefImpl.prototype.hw = function () {
1235
+ return this.a3r_1.hw();
1236
+ };
1237
+ ObjectRefImpl.prototype.addFirst = function (argument) {
1238
+ return this.a3r_1.addFirst(argument);
1239
+ };
1240
+ ObjectRefImpl.prototype.addLast = function (argument) {
1241
+ return this.a3r_1.addLast(argument);
1242
+ };
1243
+ ObjectRefImpl.prototype.append = function (argument) {
1244
+ return this.a3r_1.append(argument);
1245
+ };
1246
+ ObjectRefImpl.prototype.kw = function () {
1247
+ return this.a3r_1.kw();
1248
+ };
1249
+ ObjectRefImpl.prototype.asAtom = function () {
1250
+ return this.kw();
1251
+ };
1252
+ ObjectRefImpl.prototype.asBlock = function () {
1253
+ return this.a3r_1.asBlock();
1254
+ };
1255
+ ObjectRefImpl.prototype.asClause = function () {
1256
+ return this.a3r_1.asClause();
1257
+ };
1258
+ ObjectRefImpl.prototype.asCons = function () {
1259
+ return this.a3r_1.asCons();
1260
+ };
1261
+ ObjectRefImpl.prototype.asDirective = function () {
1262
+ return this.a3r_1.asDirective();
1263
+ };
1264
+ ObjectRefImpl.prototype.asEmptyBlock = function () {
1265
+ return this.a3r_1.asEmptyBlock();
1266
+ };
1267
+ ObjectRefImpl.prototype.asEmptyList = function () {
1268
+ return this.a3r_1.asEmptyList();
1269
+ };
1270
+ ObjectRefImpl.prototype.asFact = function () {
1271
+ return this.a3r_1.asFact();
1272
+ };
1273
+ ObjectRefImpl.prototype.asIndicator = function () {
1274
+ return this.a3r_1.asIndicator();
1275
+ };
1276
+ ObjectRefImpl.prototype.asInteger = function () {
1277
+ return this.a3r_1.asInteger();
1278
+ };
1279
+ ObjectRefImpl.prototype.asList = function () {
1280
+ return this.a3r_1.asList();
1281
+ };
1282
+ ObjectRefImpl.prototype.asNumeric = function () {
1283
+ return this.a3r_1.asNumeric();
1284
+ };
1285
+ ObjectRefImpl.prototype.asReal = function () {
1286
+ return this.a3r_1.asReal();
1287
+ };
1288
+ ObjectRefImpl.prototype.asRecursive = function () {
1289
+ return this.a3r_1.asRecursive();
1290
+ };
1291
+ ObjectRefImpl.prototype.asRule = function () {
1292
+ return this.a3r_1.asRule();
1293
+ };
1294
+ ObjectRefImpl.prototype.vw = function () {
1295
+ return this.a3r_1.vw();
1296
+ };
1297
+ ObjectRefImpl.prototype.asStruct = function () {
1298
+ return this.vw();
1299
+ };
1300
+ ObjectRefImpl.prototype.asTerm = function () {
1301
+ return this.a3r_1.asTerm();
1302
+ };
1303
+ ObjectRefImpl.prototype.asTruth = function () {
1304
+ return this.a3r_1.asTruth();
1305
+ };
1306
+ ObjectRefImpl.prototype.asTuple = function () {
1307
+ return this.a3r_1.asTuple();
1308
+ };
1309
+ ObjectRefImpl.prototype.asVar = function () {
1310
+ return this.a3r_1.asVar();
1311
+ };
1312
+ ObjectRefImpl.prototype.castToAtom = function () {
1313
+ return this.a3r_1.castToAtom();
1314
+ };
1315
+ ObjectRefImpl.prototype.castToBlock = function () {
1316
+ return this.a3r_1.castToBlock();
1317
+ };
1318
+ ObjectRefImpl.prototype.castToClause = function () {
1319
+ return this.a3r_1.castToClause();
1320
+ };
1321
+ ObjectRefImpl.prototype.castToCons = function () {
1322
+ return this.a3r_1.castToCons();
1323
+ };
1324
+ ObjectRefImpl.prototype.castToConstant = function () {
1325
+ return this.a3r_1.castToConstant();
1326
+ };
1327
+ ObjectRefImpl.prototype.castToDirective = function () {
1328
+ return this.a3r_1.castToDirective();
1329
+ };
1330
+ ObjectRefImpl.prototype.castToEmptyBlock = function () {
1331
+ return this.a3r_1.castToEmptyBlock();
1332
+ };
1333
+ ObjectRefImpl.prototype.castToEmptyList = function () {
1334
+ return this.a3r_1.castToEmptyList();
1335
+ };
1336
+ ObjectRefImpl.prototype.castToFact = function () {
1337
+ return this.a3r_1.castToFact();
1338
+ };
1339
+ ObjectRefImpl.prototype.castToIndicator = function () {
1340
+ return this.a3r_1.castToIndicator();
1341
+ };
1342
+ ObjectRefImpl.prototype.castToInteger = function () {
1343
+ return this.a3r_1.castToInteger();
1344
+ };
1345
+ ObjectRefImpl.prototype.castToList = function () {
1346
+ return this.a3r_1.castToList();
1347
+ };
1348
+ ObjectRefImpl.prototype.castToNumeric = function () {
1349
+ return this.a3r_1.castToNumeric();
1350
+ };
1351
+ ObjectRefImpl.prototype.castToReal = function () {
1352
+ return this.a3r_1.castToReal();
1353
+ };
1354
+ ObjectRefImpl.prototype.castToRecursive = function () {
1355
+ return this.a3r_1.castToRecursive();
1356
+ };
1357
+ ObjectRefImpl.prototype.castToRule = function () {
1358
+ return this.a3r_1.castToRule();
1359
+ };
1360
+ ObjectRefImpl.prototype.castToStruct = function () {
1361
+ return this.a3r_1.castToStruct();
1362
+ };
1363
+ ObjectRefImpl.prototype.castToTerm = function () {
1364
+ return this.a3r_1.castToTerm();
1365
+ };
1366
+ ObjectRefImpl.prototype.castToTruth = function () {
1367
+ return this.a3r_1.castToTruth();
1368
+ };
1369
+ ObjectRefImpl.prototype.castToTuple = function () {
1370
+ return this.a3r_1.castToTuple();
1371
+ };
1372
+ ObjectRefImpl.prototype.castToVar = function () {
1373
+ return this.a3r_1.castToVar();
1374
+ };
1375
+ ObjectRefImpl.prototype.ax = function (other) {
1376
+ return this.a3r_1.ax(other);
1377
+ };
1378
+ ObjectRefImpl.prototype.aa = function (other) {
1379
+ return this.ax((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
1380
+ };
1381
+ ObjectRefImpl.prototype.containsTag = function (name) {
1382
+ return this.a3r_1.containsTag(name);
1383
+ };
1384
+ ObjectRefImpl.prototype.equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
1385
+ return this.a3r_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
1386
+ };
1387
+ ObjectRefImpl.prototype.equals = function (other) {
1388
+ return this.a3r_1.equals(other);
1389
+ };
1390
+ ObjectRefImpl.prototype.get = function (index) {
1391
+ return this.a3r_1.get(index);
1392
+ };
1393
+ ObjectRefImpl.prototype.getArgAt = function (index) {
1394
+ return this.a3r_1.getArgAt(index);
1395
+ };
1396
+ ObjectRefImpl.prototype.getTag = function (name) {
1397
+ return this.a3r_1.getTag(name);
1398
+ };
1399
+ ObjectRefImpl.prototype.hashCode = function () {
1400
+ return this.a3r_1.hashCode();
1401
+ };
1402
+ ObjectRefImpl.prototype.insertAt = function (index, argument) {
1403
+ return this.a3r_1.insertAt(index, argument);
1404
+ };
1405
+ ObjectRefImpl.prototype.resetTags = function (tags) {
1406
+ return this.a3r_1.resetTags(tags);
1407
+ };
1408
+ ObjectRefImpl.prototype.setArgs = function (args) {
1409
+ return this.a3r_1.setArgs(args);
1410
+ };
1411
+ ObjectRefImpl.prototype.setArgsIterable = function (args) {
1412
+ return this.a3r_1.setArgsIterable(args);
1413
+ };
1414
+ ObjectRefImpl.prototype.setArgsSequence = function (args) {
1415
+ return this.a3r_1.setArgsSequence(args);
1416
+ };
1417
+ ObjectRefImpl.prototype.setFunctor = function (functor) {
1418
+ return this.a3r_1.setFunctor(functor);
1419
+ };
1420
+ ObjectRefImpl.prototype.structurallyEquals = function (other) {
1421
+ return this.a3r_1.structurallyEquals(other);
1422
+ };
1423
+ ObjectRefImpl.prototype.toString = function () {
1424
+ return this.a3r_1.toString();
1425
+ };
1426
+ ObjectRefImpl.prototype.ex = function () {
1427
+ return true;
1428
+ };
1429
+ ObjectRefImpl.prototype.ix = function () {
1430
+ return this;
1431
+ };
1432
+ ObjectRefImpl.prototype.asConstant = function () {
1433
+ return this.ix();
1434
+ };
1435
+ ObjectRefImpl.prototype.j3p = function (objectConverter, methodName, arguments_0) {
1436
+ return invoke_0(this.z3q_1, objectConverter, methodName, arguments_0);
1437
+ };
1438
+ ObjectRefImpl.prototype.k3p = function (objectConverter, propertyName, value) {
1439
+ assign_0(this.z3q_1, objectConverter, propertyName, value);
1440
+ return true;
1441
+ };
1442
+ ObjectRefImpl.prototype.iw = function () {
1443
+ return this;
1444
+ };
1445
+ ObjectRefImpl.prototype.freshCopy = function () {
1446
+ return this.iw();
1447
+ };
1448
+ ObjectRefImpl.prototype.jw = function (scope) {
1449
+ return this;
1450
+ };
1451
+ ObjectRefImpl.prototype.freshCopyFromScope = function (scope) {
1452
+ return this.jw(scope);
1453
+ };
1454
+ ObjectRefImpl.prototype.zw = function () {
1455
+ return isInterface(this, Term) ? this : THROW_CCE();
1456
+ };
1457
+ ObjectRefImpl.prototype.qq = function () {
1458
+ return this.zw();
1459
+ };
1460
+ ObjectRefImpl.prototype.s16 = function (substitution) {
1461
+ return this;
1462
+ };
1463
+ ObjectRefImpl.prototype.applySubstitution = function (substitution) {
1464
+ return this.s16(substitution);
1465
+ };
1466
+ ObjectRefImpl.prototype.c2p = function (substitution, substitutions) {
1467
+ return this;
1468
+ };
1469
+ ObjectRefImpl.prototype.apply = function (substitution, substitutions) {
1470
+ return this.c2p(substitution, substitutions);
1471
+ };
1472
+ ObjectRefImpl.prototype.b2p = function (substitution, substitutions) {
1473
+ return this;
1474
+ };
1475
+ ObjectRefImpl.prototype.getSubstituted = function (substitution, substitutions) {
1476
+ return this.b2p(substitution, substitutions);
1477
+ };
1478
+ ObjectRefImpl.prototype.y15 = function (visitor) {
1479
+ return visitor.visitAtom(this);
1480
+ };
1481
+ ObjectRefImpl.prototype.accept = function (visitor) {
1482
+ return this.y15(visitor);
1483
+ };
1484
+ function ObjectToTermConverterImpl() {
1485
+ this.b3r_1 = new NumberTypeTester();
1486
+ }
1487
+ ObjectToTermConverterImpl.prototype.b3q = function (source) {
1488
+ var tmp$ret$2;
1489
+ // Inline function 'kotlin.with' call
1490
+ var tmp0_with = this.b3r_1;
1491
+ // Inline function 'kotlin.contracts.contract' call
1492
+ var tmp$ret$1;
1493
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.impl.ObjectToTermConverterImpl.convert.<anonymous>' call
1494
+ var tmp0_subject = source;
1495
+ var tmp;
1496
+ if (tmp0_subject == null) {
1497
+ tmp = Companion_getInstance_19().t3p_1;
1498
+ } else {
1499
+ if (!(tmp0_subject == null) ? typeof tmp0_subject === 'string' : false) {
1500
+ tmp = Companion_getInstance_5().of(source);
1501
+ } else {
1502
+ if (isNumber(tmp0_subject)) {
1503
+ tmp = tmp0_with.ct(source) ? Companion_getInstance_8().ofBigInteger(tmp0_with.dt(source)) : Companion_getInstance_7().ofBigDecimal(tmp0_with.et(source));
1504
+ } else {
1505
+ if (tmp0_subject instanceof Char) {
1506
+ var tmp_0 = Companion_getInstance_5();
1507
+ var tmp$ret$0;
1508
+ // Inline function 'kotlin.charArrayOf' call
1509
+ var tmp0_charArrayOf = charArrayOf([source.v8_1]);
1510
+ tmp$ret$0 = tmp0_charArrayOf;
1511
+ tmp = tmp_0.of(concatToString(tmp$ret$0));
1512
+ } else {
1513
+ if (!(tmp0_subject == null) ? typeof tmp0_subject === 'boolean' : false) {
1514
+ tmp = Companion_getInstance_6().of(source);
1515
+ } else {
1516
+ tmp = Companion_getInstance_19().v3p(source);
1517
+ }
1518
+ }
1519
+ }
1520
+ }
1521
+ }
1522
+ tmp$ret$1 = tmp;
1523
+ tmp$ret$2 = tmp$ret$1;
1524
+ return tmp$ret$2;
1525
+ };
1526
+ function explicitConversion($this, castExpression, term, type) {
1527
+ var targetType = getType($this, castExpression, type);
1528
+ try {
1529
+ return $this.h3q(targetType, term);
1530
+ } catch ($p) {
1531
+ if ($p instanceof TermToObjectConversionException) {
1532
+ throw $p;
1533
+ } else {
1534
+ if ($p instanceof Exception) {
1535
+ throw new TermToObjectConversionException(term, targetType);
1536
+ } else {
1537
+ throw $p;
1538
+ }
1539
+ }
1540
+ }
1541
+ }
1542
+ function getType($this, castExpression, typeTerm) {
1543
+ var tmp0_subject = typeTerm;
1544
+ var tmp;
1545
+ if (isInterface(tmp0_subject, TypeRef)) {
1546
+ tmp = typeTerm.c25();
1547
+ } else {
1548
+ if (isInterface(tmp0_subject, Atom)) {
1549
+ var tmp1_elvis_lhs = $this.c3r_1.m3q(typeTerm.b1());
1550
+ var tmp_0;
1551
+ if (tmp1_elvis_lhs == null) {
1552
+ throw TermToObjectConversionException_init_$Create$(castExpression);
1553
+ } else {
1554
+ tmp_0 = tmp1_elvis_lhs;
1555
+ }
1556
+ tmp = tmp_0;
1557
+ } else {
1558
+ if (isInterface(tmp0_subject, Struct)) {
1559
+ var tmp_1;
1560
+ if (Companion_getInstance_2().matches(typeTerm, get_DEALIASING_TEMPLATE())) {
1561
+ var ref = $this.d3r_1(typeTerm);
1562
+ var tmp_2;
1563
+ if (!(ref == null) ? isInterface(ref, TypeRef) : false) {
1564
+ tmp_2 = ref.c25();
1565
+ } else {
1566
+ throw TermToObjectConversionException_init_$Create$(castExpression);
1567
+ }
1568
+ tmp_1 = tmp_2;
1569
+ } else {
1570
+ throw TermToObjectConversionException_init_$Create$(castExpression);
1571
+ }
1572
+ tmp = tmp_1;
1573
+ } else {
1574
+ throw TermToObjectConversionException_init_$Create$(castExpression);
1575
+ }
1576
+ }
1577
+ }
1578
+ return tmp;
1579
+ }
1580
+ function admissibleTypesByPriority($this, term) {
1581
+ var tmp0_subject = term;
1582
+ var tmp;
1583
+ var tmp_0;
1584
+ if (isInterface(tmp0_subject, NullRef)) {
1585
+ tmp_0 = true;
1586
+ } else {
1587
+ tmp_0 = isInterface(tmp0_subject, Var);
1588
+ }
1589
+ if (tmp_0) {
1590
+ tmp = sequenceOf([PrimitiveClasses_getInstance().wd()]);
1591
+ } else {
1592
+ if (isInterface(tmp0_subject, ObjectRef)) {
1593
+ tmp = sequenceOf([getKClassFromExpression(term.i3p())]);
1594
+ } else {
1595
+ if (isInterface(tmp0_subject, Truth)) {
1596
+ tmp = sequenceOf([PrimitiveClasses_getInstance().xd(), PrimitiveClasses_getInstance().ee()]);
1597
+ } else {
1598
+ if (isInterface(tmp0_subject, Atom)) {
1599
+ var admissible = sequenceOf([PrimitiveClasses_getInstance().ee()]);
1600
+ if (term.b1().length === 1) {
1601
+ admissible = plus(admissible, sequenceOf([getKClass(Char)]));
1602
+ }
1603
+ tmp = admissible;
1604
+ } else {
1605
+ if (isInterface(tmp0_subject, Real)) {
1606
+ tmp = sequenceOf([getKClass(BigDecimal), PrimitiveClasses_getInstance().ce(), PrimitiveClasses_getInstance().be()]);
1607
+ } else {
1608
+ if (isInterface(tmp0_subject, Integer)) {
1609
+ var admissible_0 = sequenceOf([getKClass(BigInteger)]);
1610
+ var tmp_1 = Companion_getInstance_9();
1611
+ Companion_getInstance_10();
1612
+ var tmp_2 = tmp_1.ofLong(new Long(0, -2147483648));
1613
+ var tmp_3 = Companion_getInstance_9();
1614
+ Companion_getInstance_10();
1615
+ if (tmp_2.rangeTo(tmp_3.ofLong(new Long(-1, 2147483647))).l3(term.p10())) {
1616
+ admissible_0 = plus(admissible_0, sequenceOf([getKClass(Long)]));
1617
+ }
1618
+ if (Companion_getInstance_9().of(IntCompanionObject_getInstance().MIN_VALUE).rangeTo(Companion_getInstance_9().of(IntCompanionObject_getInstance().MAX_VALUE)).l3(term.p10())) {
1619
+ admissible_0 = plus(admissible_0, sequenceOf([PrimitiveClasses_getInstance().ae()]));
1620
+ }
1621
+ if (Companion_getInstance_9().of(ShortCompanionObject_getInstance().MIN_VALUE).rangeTo(Companion_getInstance_9().of(ShortCompanionObject_getInstance().MAX_VALUE)).l3(term.p10())) {
1622
+ admissible_0 = plus(admissible_0, sequenceOf([PrimitiveClasses_getInstance().zd()]));
1623
+ }
1624
+ if (Companion_getInstance_9().of(ByteCompanionObject_getInstance().MIN_VALUE).rangeTo(Companion_getInstance_9().of(ByteCompanionObject_getInstance().MAX_VALUE)).l3(term.p10())) {
1625
+ admissible_0 = plus(admissible_0, sequenceOf([PrimitiveClasses_getInstance().yd()]));
1626
+ }
1627
+ admissible_0 = plus(admissible_0, sequenceOf([getKClass(BigDecimal)]));
1628
+ var tmp_4 = Companion_getInstance_11();
1629
+ DoubleCompanionObject_getInstance();
1630
+ var containsLower = tmp_4.oj(4.9E-324, null, 2, null);
1631
+ var tmp_5 = Companion_getInstance_11();
1632
+ DoubleCompanionObject_getInstance();
1633
+ var containsUpper = tmp_5.oj(1.7976931348623157E308, null, 2, null);
1634
+ var containsArg = term.x10();
1635
+ if (0 <= compareTo(containsArg, containsLower) ? compareTo(containsArg, containsUpper) <= 0 : false) {
1636
+ admissible_0 = plus(admissible_0, sequenceOf([PrimitiveClasses_getInstance().ce()]));
1637
+ }
1638
+ var tmp_6 = Companion_getInstance_11();
1639
+ FloatCompanionObject_getInstance();
1640
+ var containsLower_0 = tmp_6.qj(1.4E-45, null, 2, null);
1641
+ var tmp_7 = Companion_getInstance_11();
1642
+ FloatCompanionObject_getInstance();
1643
+ var containsUpper_0 = tmp_7.qj(3.4028235E38, null, 2, null);
1644
+ var containsArg_0 = term.x10();
1645
+ if (0 <= compareTo(containsArg_0, containsLower_0) ? compareTo(containsArg_0, containsUpper_0) <= 0 : false) {
1646
+ admissible_0 = plus(admissible_0, sequenceOf([PrimitiveClasses_getInstance().be()]));
1647
+ }
1648
+ tmp = admissible_0;
1649
+ } else {
1650
+ if (isInterface(tmp0_subject, Struct)) {
1651
+ var tmp_8;
1652
+ if (Companion_getInstance_2().matches(term, get_CAST_TEMPLATE())) {
1653
+ tmp_8 = sequenceOf([getType($this, term, term.get(1))]);
1654
+ } else if (Companion_getInstance_2().matches(term, get_DEALIASING_TEMPLATE())) {
1655
+ var ref = $this.d3r_1(term);
1656
+ var tmp_9;
1657
+ if (!(ref == null) ? isInterface(ref, ObjectRef) : false) {
1658
+ tmp_9 = admissibleTypesByPriority($this, ref);
1659
+ } else {
1660
+ throw TermToObjectConversionException_init_$Create$(term);
1661
+ }
1662
+ tmp_8 = tmp_9;
1663
+ } else {
1664
+ throw TermToObjectConversionException_init_$Create$(term);
1665
+ }
1666
+ tmp = tmp_8;
1667
+ } else {
1668
+ throw TermToObjectConversionException_init_$Create$(term);
1669
+ }
1670
+ }
1671
+ }
1672
+ }
1673
+ }
1674
+ }
1675
+ }
1676
+ return tmp;
1677
+ }
1678
+ function TermToObjectConverterImpl(typeFactory, dealiaser) {
1679
+ this.c3r_1 = typeFactory;
1680
+ this.d3r_1 = dealiaser;
1681
+ }
1682
+ TermToObjectConverterImpl.prototype.h3q = function (type, term) {
1683
+ var tmp0_subject = term;
1684
+ var tmp;
1685
+ var tmp_0;
1686
+ if (isInterface(tmp0_subject, NullRef)) {
1687
+ tmp_0 = true;
1688
+ } else {
1689
+ tmp_0 = isInterface(tmp0_subject, Var);
1690
+ }
1691
+ if (tmp_0) {
1692
+ var tmp_1;
1693
+ if (get_isPrimitiveType(type)) {
1694
+ throw new TermToObjectConversionException(term, type);
1695
+ } else {
1696
+ tmp_1 = null;
1697
+ }
1698
+ tmp = tmp_1;
1699
+ } else {
1700
+ if (isInterface(tmp0_subject, ObjectRef)) {
1701
+ var tmp_2;
1702
+ if (isSubtypeOf(getKClassFromExpression(term.i3p()), type)) {
1703
+ tmp_2 = term.i3p();
1704
+ } else {
1705
+ throw new TermToObjectConversionException(term, type);
1706
+ }
1707
+ tmp = tmp_2;
1708
+ } else {
1709
+ if (isInterface(tmp0_subject, Truth)) {
1710
+ var tmp_3;
1711
+ if (isSubtypeOf(PrimitiveClasses_getInstance().xd(), type)) {
1712
+ tmp_3 = term.dw();
1713
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().ee(), type)) {
1714
+ tmp_3 = term.b1();
1715
+ } else {
1716
+ throw new TermToObjectConversionException(term, type);
1717
+ }
1718
+ tmp = tmp_3;
1719
+ } else {
1720
+ if (isInterface(tmp0_subject, Atom)) {
1721
+ var tmp_4;
1722
+ if (isSubtypeOf(PrimitiveClasses_getInstance().ee(), type)) {
1723
+ tmp_4 = term.b1();
1724
+ } else if (isSubtypeOf(getKClass(Char), type)) {
1725
+ var tmp_5;
1726
+ if (term.b1().length === 1) {
1727
+ tmp_5 = charSequenceGet(term.b1(), 0);
1728
+ } else {
1729
+ throw new TermToObjectConversionException(term, type);
1730
+ }
1731
+ tmp_4 = new Char(tmp_5);
1732
+ } else {
1733
+ throw new TermToObjectConversionException(term, type);
1734
+ }
1735
+ tmp = tmp_4;
1736
+ } else {
1737
+ if (isInterface(tmp0_subject, Real)) {
1738
+ var tmp_6;
1739
+ if (isSubtypeOf(getKClass(BigDecimal), type)) {
1740
+ tmp_6 = term.x10();
1741
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().ce(), type)) {
1742
+ tmp_6 = term.x10().toDouble();
1743
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().be(), type)) {
1744
+ tmp_6 = term.x10().toFloat();
1745
+ } else {
1746
+ throw new TermToObjectConversionException(term, type);
1747
+ }
1748
+ tmp = tmp_6;
1749
+ } else {
1750
+ if (isInterface(tmp0_subject, Integer)) {
1751
+ var tmp_7;
1752
+ if (isSubtypeOf(getKClass(BigInteger), type)) {
1753
+ tmp_7 = term.p10();
1754
+ } else if (isSubtypeOf(getKClass(Long), type)) {
1755
+ tmp_7 = term.p10().toLongExact();
1756
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().ae(), type)) {
1757
+ tmp_7 = term.p10().toIntExact();
1758
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().zd(), type)) {
1759
+ tmp_7 = term.p10().toShortExact();
1760
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().yd(), type)) {
1761
+ tmp_7 = term.p10().toByteExact();
1762
+ } else if (isSubtypeOf(getKClass(BigDecimal), type)) {
1763
+ tmp_7 = term.x10();
1764
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().ce(), type)) {
1765
+ tmp_7 = term.x10().toDouble();
1766
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().be(), type)) {
1767
+ tmp_7 = term.x10().toFloat();
1768
+ } else {
1769
+ throw new TermToObjectConversionException(term, type);
1770
+ }
1771
+ tmp = tmp_7;
1772
+ } else {
1773
+ if (isInterface(tmp0_subject, Struct)) {
1774
+ var tmp$ret$0;
1775
+ // Inline function 'kotlin.also' call
1776
+ var tmp_8;
1777
+ if (Companion_getInstance_2().matches(term, get_CAST_TEMPLATE())) {
1778
+ tmp_8 = explicitConversion(this, term, term.get(0), term.get(1));
1779
+ } else if (Companion_getInstance_2().matches(term, get_DEALIASING_TEMPLATE())) {
1780
+ var ref = this.d3r_1(term);
1781
+ var tmp_9;
1782
+ if (!(ref == null) ? isInterface(ref, ObjectRef) : false) {
1783
+ tmp_9 = this.h3q(type, ref);
1784
+ } else {
1785
+ throw TermToObjectConversionException_init_$Create$(term);
1786
+ }
1787
+ tmp_8 = tmp_9;
1788
+ } else {
1789
+ throw TermToObjectConversionException_init_$Create$(term);
1790
+ }
1791
+ var tmp0_also = tmp_8;
1792
+ // Inline function 'kotlin.contracts.contract' call
1793
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.impl.TermToObjectConverterImpl.convertInto.<anonymous>' call
1794
+ if (!(tmp0_also == null) ? !isSubtypeOf(getKClassFromExpression(tmp0_also), type) : false) {
1795
+ throw TermToObjectConversionException_init_$Create$(term);
1796
+ }
1797
+ tmp$ret$0 = tmp0_also;
1798
+ tmp = tmp$ret$0;
1799
+ } else {
1800
+ throw TermToObjectConversionException_init_$Create$(term);
1801
+ }
1802
+ }
1803
+ }
1804
+ }
1805
+ }
1806
+ }
1807
+ }
1808
+ return tmp;
1809
+ };
1810
+ TermToObjectConverterImpl.prototype.j3q = function (term) {
1811
+ return first(admissibleTypesByPriority(this, term));
1812
+ };
1813
+ TermToObjectConverterImpl.prototype.i3q = function (term) {
1814
+ return toSet(admissibleTypesByPriority(this, term));
1815
+ };
1816
+ function TypeFactoryImpl() {
1817
+ }
1818
+ TypeFactoryImpl.prototype.m3q = function (typeName) {
1819
+ return kClassFromName(typeName).b1();
1820
+ };
1821
+ function nameOf_0($this, type) {
1822
+ return '<type:' + get_fullName(type) + '>';
1823
+ }
1824
+ function Companion_6() {
1825
+ Companion_instance_6 = this;
1826
+ }
1827
+ var Companion_instance_6;
1828
+ function Companion_getInstance_26() {
1829
+ if (Companion_instance_6 == null)
1830
+ new Companion_6();
1831
+ return Companion_instance_6;
1832
+ }
1833
+ function TypeRefImpl(type) {
1834
+ Companion_getInstance_26();
1835
+ this.e3r_1 = type;
1836
+ this.f3r_1 = Companion_getInstance_5().of(nameOf_0(Companion_getInstance_26(), type));
1837
+ }
1838
+ TypeRefImpl.prototype.c25 = function () {
1839
+ return this.e3r_1;
1840
+ };
1841
+ TypeRefImpl.prototype.gw = function () {
1842
+ return this.f3r_1.gw();
1843
+ };
1844
+ TypeRefImpl.prototype.yw = function () {
1845
+ return this.f3r_1.yw();
1846
+ };
1847
+ TypeRefImpl.prototype.zv = function () {
1848
+ return this.f3r_1.zv();
1849
+ };
1850
+ TypeRefImpl.prototype.fw = function () {
1851
+ return this.f3r_1.fw();
1852
+ };
1853
+ TypeRefImpl.prototype.xw = function () {
1854
+ return this.f3r_1.xw();
1855
+ };
1856
+ TypeRefImpl.prototype.aw = function () {
1857
+ return this.f3r_1.aw();
1858
+ };
1859
+ TypeRefImpl.prototype.tw = function () {
1860
+ return this.f3r_1.tw();
1861
+ };
1862
+ TypeRefImpl.prototype.mw = function () {
1863
+ return this.f3r_1.mw();
1864
+ };
1865
+ TypeRefImpl.prototype.sw = function () {
1866
+ return this.f3r_1.sw();
1867
+ };
1868
+ TypeRefImpl.prototype.ow = function () {
1869
+ return this.f3r_1.ow();
1870
+ };
1871
+ TypeRefImpl.prototype.bw = function () {
1872
+ return this.f3r_1.bw();
1873
+ };
1874
+ TypeRefImpl.prototype.cw = function () {
1875
+ return this.f3r_1.cw();
1876
+ };
1877
+ TypeRefImpl.prototype.pw = function () {
1878
+ return this.f3r_1.pw();
1879
+ };
1880
+ TypeRefImpl.prototype.ew = function () {
1881
+ return this.f3r_1.ew();
1882
+ };
1883
+ TypeRefImpl.prototype.ww = function () {
1884
+ return this.f3r_1.ww();
1885
+ };
1886
+ TypeRefImpl.prototype.jx = function () {
1887
+ return this.f3r_1.jx();
1888
+ };
1889
+ TypeRefImpl.prototype.uw = function () {
1890
+ return this.f3r_1.uw();
1891
+ };
1892
+ TypeRefImpl.prototype.gx = function () {
1893
+ return this.f3r_1.gx();
1894
+ };
1895
+ TypeRefImpl.prototype.rw = function () {
1896
+ return this.f3r_1.rw();
1897
+ };
1898
+ TypeRefImpl.prototype.fx = function () {
1899
+ return this.f3r_1.fx();
1900
+ };
1901
+ TypeRefImpl.prototype.hx = function () {
1902
+ return this.f3r_1.hx();
1903
+ };
1904
+ TypeRefImpl.prototype.dx = function () {
1905
+ return this.f3r_1.dx();
1906
+ };
1907
+ TypeRefImpl.prototype.nw = function () {
1908
+ return this.f3r_1.nw();
1909
+ };
1910
+ TypeRefImpl.prototype.lw = function () {
1911
+ return this.f3r_1.lw();
1912
+ };
1913
+ TypeRefImpl.prototype.dw = function () {
1914
+ return this.f3r_1.dw();
1915
+ };
1916
+ TypeRefImpl.prototype.cx = function () {
1917
+ return this.f3r_1.cx();
1918
+ };
1919
+ TypeRefImpl.prototype.qw = function () {
1920
+ return this.f3r_1.qw();
1921
+ };
1922
+ TypeRefImpl.prototype.bx = function () {
1923
+ return this.f3r_1.bx();
1924
+ };
1925
+ TypeRefImpl.prototype.kt = function () {
1926
+ return this.f3r_1.kt();
1927
+ };
1928
+ TypeRefImpl.prototype.b1 = function () {
1929
+ return this.f3r_1.b1();
1930
+ };
1931
+ TypeRefImpl.prototype.hw = function () {
1932
+ return this.f3r_1.hw();
1933
+ };
1934
+ TypeRefImpl.prototype.addFirst = function (argument) {
1935
+ return this.f3r_1.addFirst(argument);
1936
+ };
1937
+ TypeRefImpl.prototype.addLast = function (argument) {
1938
+ return this.f3r_1.addLast(argument);
1939
+ };
1940
+ TypeRefImpl.prototype.append = function (argument) {
1941
+ return this.f3r_1.append(argument);
1942
+ };
1943
+ TypeRefImpl.prototype.kw = function () {
1944
+ return this.f3r_1.kw();
1945
+ };
1946
+ TypeRefImpl.prototype.asAtom = function () {
1947
+ return this.kw();
1948
+ };
1949
+ TypeRefImpl.prototype.asBlock = function () {
1950
+ return this.f3r_1.asBlock();
1951
+ };
1952
+ TypeRefImpl.prototype.asClause = function () {
1953
+ return this.f3r_1.asClause();
1954
+ };
1955
+ TypeRefImpl.prototype.asCons = function () {
1956
+ return this.f3r_1.asCons();
1957
+ };
1958
+ TypeRefImpl.prototype.asDirective = function () {
1959
+ return this.f3r_1.asDirective();
1960
+ };
1961
+ TypeRefImpl.prototype.asEmptyBlock = function () {
1962
+ return this.f3r_1.asEmptyBlock();
1963
+ };
1964
+ TypeRefImpl.prototype.asEmptyList = function () {
1965
+ return this.f3r_1.asEmptyList();
1966
+ };
1967
+ TypeRefImpl.prototype.asFact = function () {
1968
+ return this.f3r_1.asFact();
1969
+ };
1970
+ TypeRefImpl.prototype.asIndicator = function () {
1971
+ return this.f3r_1.asIndicator();
1972
+ };
1973
+ TypeRefImpl.prototype.asInteger = function () {
1974
+ return this.f3r_1.asInteger();
1975
+ };
1976
+ TypeRefImpl.prototype.asList = function () {
1977
+ return this.f3r_1.asList();
1978
+ };
1979
+ TypeRefImpl.prototype.asNumeric = function () {
1980
+ return this.f3r_1.asNumeric();
1981
+ };
1982
+ TypeRefImpl.prototype.asReal = function () {
1983
+ return this.f3r_1.asReal();
1984
+ };
1985
+ TypeRefImpl.prototype.asRecursive = function () {
1986
+ return this.f3r_1.asRecursive();
1987
+ };
1988
+ TypeRefImpl.prototype.asRule = function () {
1989
+ return this.f3r_1.asRule();
1990
+ };
1991
+ TypeRefImpl.prototype.vw = function () {
1992
+ return this.f3r_1.vw();
1993
+ };
1994
+ TypeRefImpl.prototype.asStruct = function () {
1995
+ return this.vw();
1996
+ };
1997
+ TypeRefImpl.prototype.asTerm = function () {
1998
+ return this.f3r_1.asTerm();
1999
+ };
2000
+ TypeRefImpl.prototype.asTruth = function () {
2001
+ return this.f3r_1.asTruth();
2002
+ };
2003
+ TypeRefImpl.prototype.asTuple = function () {
2004
+ return this.f3r_1.asTuple();
2005
+ };
2006
+ TypeRefImpl.prototype.asVar = function () {
2007
+ return this.f3r_1.asVar();
2008
+ };
2009
+ TypeRefImpl.prototype.castToAtom = function () {
2010
+ return this.f3r_1.castToAtom();
2011
+ };
2012
+ TypeRefImpl.prototype.castToBlock = function () {
2013
+ return this.f3r_1.castToBlock();
2014
+ };
2015
+ TypeRefImpl.prototype.castToClause = function () {
2016
+ return this.f3r_1.castToClause();
2017
+ };
2018
+ TypeRefImpl.prototype.castToCons = function () {
2019
+ return this.f3r_1.castToCons();
2020
+ };
2021
+ TypeRefImpl.prototype.castToConstant = function () {
2022
+ return this.f3r_1.castToConstant();
2023
+ };
2024
+ TypeRefImpl.prototype.castToDirective = function () {
2025
+ return this.f3r_1.castToDirective();
2026
+ };
2027
+ TypeRefImpl.prototype.castToEmptyBlock = function () {
2028
+ return this.f3r_1.castToEmptyBlock();
2029
+ };
2030
+ TypeRefImpl.prototype.castToEmptyList = function () {
2031
+ return this.f3r_1.castToEmptyList();
2032
+ };
2033
+ TypeRefImpl.prototype.castToFact = function () {
2034
+ return this.f3r_1.castToFact();
2035
+ };
2036
+ TypeRefImpl.prototype.castToIndicator = function () {
2037
+ return this.f3r_1.castToIndicator();
2038
+ };
2039
+ TypeRefImpl.prototype.castToInteger = function () {
2040
+ return this.f3r_1.castToInteger();
2041
+ };
2042
+ TypeRefImpl.prototype.castToList = function () {
2043
+ return this.f3r_1.castToList();
2044
+ };
2045
+ TypeRefImpl.prototype.castToNumeric = function () {
2046
+ return this.f3r_1.castToNumeric();
2047
+ };
2048
+ TypeRefImpl.prototype.castToReal = function () {
2049
+ return this.f3r_1.castToReal();
2050
+ };
2051
+ TypeRefImpl.prototype.castToRecursive = function () {
2052
+ return this.f3r_1.castToRecursive();
2053
+ };
2054
+ TypeRefImpl.prototype.castToRule = function () {
2055
+ return this.f3r_1.castToRule();
2056
+ };
2057
+ TypeRefImpl.prototype.castToStruct = function () {
2058
+ return this.f3r_1.castToStruct();
2059
+ };
2060
+ TypeRefImpl.prototype.castToTerm = function () {
2061
+ return this.f3r_1.castToTerm();
2062
+ };
2063
+ TypeRefImpl.prototype.castToTruth = function () {
2064
+ return this.f3r_1.castToTruth();
2065
+ };
2066
+ TypeRefImpl.prototype.castToTuple = function () {
2067
+ return this.f3r_1.castToTuple();
2068
+ };
2069
+ TypeRefImpl.prototype.castToVar = function () {
2070
+ return this.f3r_1.castToVar();
2071
+ };
2072
+ TypeRefImpl.prototype.ax = function (other) {
2073
+ return this.f3r_1.ax(other);
2074
+ };
2075
+ TypeRefImpl.prototype.aa = function (other) {
2076
+ return this.ax((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
2077
+ };
2078
+ TypeRefImpl.prototype.containsTag = function (name) {
2079
+ return this.f3r_1.containsTag(name);
2080
+ };
2081
+ TypeRefImpl.prototype.equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
2082
+ return this.f3r_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
2083
+ };
2084
+ TypeRefImpl.prototype.equals = function (other) {
2085
+ return this.f3r_1.equals(other);
2086
+ };
2087
+ TypeRefImpl.prototype.get = function (index) {
2088
+ return this.f3r_1.get(index);
2089
+ };
2090
+ TypeRefImpl.prototype.getArgAt = function (index) {
2091
+ return this.f3r_1.getArgAt(index);
2092
+ };
2093
+ TypeRefImpl.prototype.getTag = function (name) {
2094
+ return this.f3r_1.getTag(name);
2095
+ };
2096
+ TypeRefImpl.prototype.hashCode = function () {
2097
+ return this.f3r_1.hashCode();
2098
+ };
2099
+ TypeRefImpl.prototype.insertAt = function (index, argument) {
2100
+ return this.f3r_1.insertAt(index, argument);
2101
+ };
2102
+ TypeRefImpl.prototype.resetTags = function (tags) {
2103
+ return this.f3r_1.resetTags(tags);
2104
+ };
2105
+ TypeRefImpl.prototype.setArgs = function (args) {
2106
+ return this.f3r_1.setArgs(args);
2107
+ };
2108
+ TypeRefImpl.prototype.setArgsIterable = function (args) {
2109
+ return this.f3r_1.setArgsIterable(args);
2110
+ };
2111
+ TypeRefImpl.prototype.setArgsSequence = function (args) {
2112
+ return this.f3r_1.setArgsSequence(args);
2113
+ };
2114
+ TypeRefImpl.prototype.setFunctor = function (functor) {
2115
+ return this.f3r_1.setFunctor(functor);
2116
+ };
2117
+ TypeRefImpl.prototype.structurallyEquals = function (other) {
2118
+ return this.f3r_1.structurallyEquals(other);
2119
+ };
2120
+ TypeRefImpl.prototype.toString = function () {
2121
+ return this.f3r_1.toString();
2122
+ };
2123
+ TypeRefImpl.prototype.p3q = function (objectConverter, arguments_0) {
2124
+ return create_0(this.e3r_1, objectConverter, arguments_0);
2125
+ };
2126
+ TypeRefImpl.prototype.j3p = function (objectConverter, methodName, arguments_0) {
2127
+ var companionObjectRef = get_companionObjectRef(this.e3r_1);
2128
+ var tmp;
2129
+ if (companionObjectRef instanceof Some) {
2130
+ tmp = invoke_0(companionObjectRef.jq_1, objectConverter, methodName, arguments_0);
2131
+ } else {
2132
+ tmp = invoke_1(this.e3r_1, objectConverter, methodName, arguments_0, null);
2133
+ }
2134
+ return tmp;
2135
+ };
2136
+ TypeRefImpl.prototype.ex = function () {
2137
+ return true;
2138
+ };
2139
+ TypeRefImpl.prototype.ix = function () {
2140
+ return this;
2141
+ };
2142
+ TypeRefImpl.prototype.asConstant = function () {
2143
+ return this.ix();
2144
+ };
2145
+ TypeRefImpl.prototype.iw = function () {
2146
+ return this;
2147
+ };
2148
+ TypeRefImpl.prototype.freshCopy = function () {
2149
+ return this.iw();
2150
+ };
2151
+ TypeRefImpl.prototype.jw = function (scope) {
2152
+ return this;
2153
+ };
2154
+ TypeRefImpl.prototype.freshCopyFromScope = function (scope) {
2155
+ return this.jw(scope);
2156
+ };
2157
+ TypeRefImpl.prototype.zw = function () {
2158
+ return isInterface(this, Term) ? this : THROW_CCE();
2159
+ };
2160
+ TypeRefImpl.prototype.qq = function () {
2161
+ return this.zw();
2162
+ };
2163
+ TypeRefImpl.prototype.s16 = function (substitution) {
2164
+ return this;
2165
+ };
2166
+ TypeRefImpl.prototype.applySubstitution = function (substitution) {
2167
+ return this.s16(substitution);
2168
+ };
2169
+ TypeRefImpl.prototype.c2p = function (substitution, substitutions) {
2170
+ return this;
2171
+ };
2172
+ TypeRefImpl.prototype.apply = function (substitution, substitutions) {
2173
+ return this.c2p(substitution, substitutions);
2174
+ };
2175
+ TypeRefImpl.prototype.b2p = function (substitution, substitutions) {
2176
+ return this;
2177
+ };
2178
+ TypeRefImpl.prototype.getSubstituted = function (substitution, substitutions) {
2179
+ return this.b2p(substitution, substitutions);
2180
+ };
2181
+ TypeRefImpl.prototype.y15 = function (visitor) {
2182
+ return visitor.visitAtom(this);
2183
+ };
2184
+ TypeRefImpl.prototype.accept = function (visitor) {
2185
+ return this.y15(visitor);
2186
+ };
2187
+ TypeRefImpl.prototype.k3p = function (objectConverter, propertyName, value) {
2188
+ var companionObjectRef = get_companionObjectRef(this.e3r_1);
2189
+ if (companionObjectRef instanceof Some) {
2190
+ assign_0(companionObjectRef.jq_1, objectConverter, propertyName, value);
2191
+ } else {
2192
+ assign_1(this.e3r_1, objectConverter, propertyName, value, null);
2193
+ }
2194
+ return true;
2195
+ };
2196
+ function actuallyInvoke(_this__u8e3s4, $this, ref, method, resultTerm) {
2197
+ var result = ref.j3p(get_termToObjectConverter(_this__u8e3s4), method.fw(), method.gw());
2198
+ var tmp;
2199
+ if (result instanceof Value) {
2200
+ tmp = Companion_getInstance_13().b2h(_this__u8e3s4, resultTerm, $this.h3r(result));
2201
+ } else {
2202
+ tmp = Companion_getInstance_12().failed();
2203
+ }
2204
+ return tmp;
2205
+ }
2206
+ function AbstractInvoke(suffix) {
2207
+ Functional.call(this, 'invoke_' + suffix);
2208
+ }
2209
+ AbstractInvoke.prototype.k2q = function (_this__u8e3s4, first, second, third) {
2210
+ Companion_getInstance_13().l2h(_this__u8e3s4, 0);
2211
+ Companion_getInstance_13().l2h(_this__u8e3s4, 1);
2212
+ var method = isInterface(second, Struct) ? second : THROW_CCE();
2213
+ var tmp$ret$1;
2214
+ $l$block: {
2215
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.catchingOopExceptions' call
2216
+ try {
2217
+ var tmp$ret$0;
2218
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.AbstractInvoke.computeOneSubstitution.<anonymous>' call
2219
+ var tmp0_subject = first;
2220
+ var tmp;
2221
+ if (isInterface(tmp0_subject, Ref)) {
2222
+ tmp = actuallyInvoke(_this__u8e3s4, this, first, method, third);
2223
+ } else {
2224
+ if (isInterface(tmp0_subject, Struct)) {
2225
+ var ref = findRefFromAlias(_this__u8e3s4, first);
2226
+ tmp = actuallyInvoke(_this__u8e3s4, this, ref, method, third);
2227
+ } else {
2228
+ tmp = Companion_getInstance_12().failed();
2229
+ }
2230
+ }
2231
+ tmp$ret$0 = tmp;
2232
+ tmp$ret$1 = tmp$ret$0;
2233
+ break $l$block;
2234
+ } catch ($p) {
2235
+ if ($p instanceof OopException) {
2236
+ throw $p.u3q(_this__u8e3s4.context, _this__u8e3s4.signature);
2237
+ } else {
2238
+ if ($p instanceof Error) {
2239
+ throw Companion_getInstance_14().forUncaughtKtException(_this__u8e3s4.context, $p);
2240
+ } else {
2241
+ throw $p;
2242
+ }
2243
+ }
2244
+ }
2245
+ }
2246
+ return tmp$ret$1;
2247
+ };
2248
+ AbstractInvoke.prototype.t2j = function (_this__u8e3s4, first, second, third) {
2249
+ return this.k2q(_this__u8e3s4, first, second, third);
2250
+ };
2251
+ function AbstractIterableItems$computeOneSubstitution$lambda($converter) {
2252
+ return function (it) {
2253
+ return $converter.k3q(it);
2254
+ };
2255
+ }
2256
+ function AbstractIterableItems$computeOneSubstitution$lambda_0(it) {
2257
+ return Companion_getInstance_20().w3p_1.b3q(it);
2258
+ }
2259
+ function AbstractIterableItems(iterable, target) {
2260
+ Functional_0.call(this, iterable + '_items');
2261
+ this.j3r_1 = target;
2262
+ }
2263
+ AbstractIterableItems.prototype.h2q = function (_this__u8e3s4, first, second) {
2264
+ var tmp;
2265
+ var tmp_0;
2266
+ if (isInterface(first, Var)) {
2267
+ tmp_0 = isInterface(second, Var);
2268
+ } else {
2269
+ tmp_0 = false;
2270
+ }
2271
+ if (tmp_0) {
2272
+ var tmp$ret$1;
2273
+ // Inline function 'kotlin.let' call
2274
+ var tmp0_let = Companion_getInstance_13().y2f(_this__u8e3s4);
2275
+ // Inline function 'kotlin.contracts.contract' call
2276
+ var tmp$ret$0;
2277
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.AbstractIterableItems.computeOneSubstitution.<anonymous>' call
2278
+ tmp$ret$0 = Companion_getInstance_12().failed();
2279
+ tmp$ret$1 = tmp$ret$0;
2280
+ tmp = tmp$ret$1;
2281
+ } else {
2282
+ if (isInterface(second, List_0)) {
2283
+ var converter = get_termToObjectConverter(_this__u8e3s4);
2284
+ var tmp_1 = second.ju();
2285
+ var items = this.k3r(map(tmp_1, AbstractIterableItems$computeOneSubstitution$lambda(converter)));
2286
+ var objectRef = Companion_getInstance_19().v3p(items);
2287
+ tmp = Companion_getInstance_13().b2h(_this__u8e3s4, first, objectRef);
2288
+ } else {
2289
+ if (isInterface(first, ObjectRef)) {
2290
+ var obj = first.i3p();
2291
+ var tmp_2;
2292
+ if (this.l3r(obj)) {
2293
+ var tmp_3 = this.m3r(isObject(obj) ? obj : THROW_CCE());
2294
+ var items_0 = map(tmp_3, AbstractIterableItems$computeOneSubstitution$lambda_0);
2295
+ tmp_2 = Companion_getInstance_13().b2h(_this__u8e3s4, second, Companion_getInstance_15().ofSequence(items_0));
2296
+ } else {
2297
+ tmp_2 = Companion_getInstance_12().failed();
2298
+ }
2299
+ tmp = tmp_2;
2300
+ } else {
2301
+ throw Companion_getInstance_1().q25(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_OBJECT_REFERENCE_getInstance(), first, 0);
2302
+ }
2303
+ }
2304
+ }
2305
+ return tmp;
2306
+ };
2307
+ AbstractIterableItems.prototype.k2g = function (_this__u8e3s4, first, second) {
2308
+ return this.h2q(_this__u8e3s4, first, second);
2309
+ };
2310
+ function ArrayItems() {
2311
+ ArrayItems_instance = this;
2312
+ AbstractIterableItems.call(this, 'array', PrimitiveClasses_getInstance().de());
2313
+ }
2314
+ ArrayItems.prototype.k3r = function (_this__u8e3s4) {
2315
+ var tmp$ret$0;
2316
+ // Inline function 'kotlin.collections.toTypedArray' call
2317
+ var tmp0_toTypedArray = toList(_this__u8e3s4);
2318
+ tmp$ret$0 = copyToArray(tmp0_toTypedArray);
2319
+ return tmp$ret$0;
2320
+ };
2321
+ ArrayItems.prototype.l3r = function (_this__u8e3s4) {
2322
+ return !(_this__u8e3s4 == null) ? isArray(_this__u8e3s4) : false;
2323
+ };
2324
+ ArrayItems.prototype.p3r = function (_this__u8e3s4) {
2325
+ return asSequence(_this__u8e3s4);
2326
+ };
2327
+ ArrayItems.prototype.m3r = function (_this__u8e3s4) {
2328
+ return this.p3r(isArray(_this__u8e3s4) ? _this__u8e3s4 : THROW_CCE());
2329
+ };
2330
+ var ArrayItems_instance;
2331
+ function ArrayItems_getInstance() {
2332
+ if (ArrayItems_instance == null)
2333
+ new ArrayItems();
2334
+ return ArrayItems_instance;
2335
+ }
2336
+ function Assign() {
2337
+ Assign_instance = this;
2338
+ Predicative.call(this, 'assign');
2339
+ }
2340
+ Assign.prototype.r3r = function (_this__u8e3s4, first, second, third) {
2341
+ Companion_getInstance_13().q2h(_this__u8e3s4, 0);
2342
+ Companion_getInstance_13().q2h(_this__u8e3s4, 1);
2343
+ var tmp$ret$1;
2344
+ $l$block: {
2345
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.catchingOopExceptions' call
2346
+ try {
2347
+ var tmp$ret$0;
2348
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.Assign.compute.<anonymous>' call
2349
+ var tmp0_subject = first;
2350
+ var tmp;
2351
+ if (isInterface(tmp0_subject, Ref)) {
2352
+ tmp = first;
2353
+ } else {
2354
+ tmp = findRefFromAlias(_this__u8e3s4, isInterface(first, Atom) ? first : THROW_CCE());
2355
+ }
2356
+ var ref = tmp;
2357
+ var tmp_0;
2358
+ if (Companion_getInstance_13().c2h(_this__u8e3s4, third, get_DEALIASING_TEMPLATE())) {
2359
+ tmp_0 = findRefFromAlias(_this__u8e3s4, isInterface(third, Struct) ? third : THROW_CCE());
2360
+ } else {
2361
+ tmp_0 = third;
2362
+ }
2363
+ var value = tmp_0;
2364
+ var tmp_1 = get_termToObjectConverter(_this__u8e3s4);
2365
+ tmp$ret$0 = ref.k3p(tmp_1, (isInterface(second, Atom) ? second : THROW_CCE()).b1(), value);
2366
+ tmp$ret$1 = tmp$ret$0;
2367
+ break $l$block;
2368
+ } catch ($p) {
2369
+ if ($p instanceof OopException) {
2370
+ throw $p.u3q(_this__u8e3s4.context, _this__u8e3s4.signature);
2371
+ } else {
2372
+ if ($p instanceof Error) {
2373
+ throw Companion_getInstance_14().forUncaughtKtException(_this__u8e3s4.context, $p);
2374
+ } else {
2375
+ throw $p;
2376
+ }
2377
+ }
2378
+ }
2379
+ }
2380
+ return tmp$ret$1;
2381
+ };
2382
+ Assign.prototype.v2j = function (_this__u8e3s4, first, second, third) {
2383
+ return this.r3r(_this__u8e3s4, first, second, third);
2384
+ };
2385
+ var Assign_instance;
2386
+ function Assign_getInstance() {
2387
+ if (Assign_instance == null)
2388
+ new Assign();
2389
+ return Assign_instance;
2390
+ }
2391
+ function cast(_this__u8e3s4, $this, term, type, result) {
2392
+ var tmp;
2393
+ if (type == null) {
2394
+ tmp = Companion_getInstance_12().failed();
2395
+ } else {
2396
+ var casted = get_termToObjectConverter(_this__u8e3s4).h3q(type, term);
2397
+ tmp = Companion_getInstance_13().b2h(_this__u8e3s4, result, Companion_getInstance_19().v3p(casted));
2398
+ }
2399
+ return tmp;
2400
+ }
2401
+ function Cast$computeAll$lambda(it) {
2402
+ return allSupertypes(it, false);
2403
+ }
2404
+ function Cast$computeAll$lambda_0($this_computeAll, $first, $third, $second) {
2405
+ return function (it) {
2406
+ return cast($this_computeAll, Cast_getInstance(), $first, it, $third).plus(Companion_getInstance_13().b2h($this_computeAll, $second, Companion_getInstance_24().l3q(it)));
2407
+ };
2408
+ }
2409
+ function Cast$computeAll$lambda_1($this_computeAll) {
2410
+ return function (it) {
2411
+ return $this_computeAll.g2g(it, null, [], 6, null);
2412
+ };
2413
+ }
2414
+ function Cast() {
2415
+ Cast_instance = this;
2416
+ TernaryRelation.call(this, 'cast');
2417
+ }
2418
+ Cast.prototype.t3r = function (_this__u8e3s4, first, second, third) {
2419
+ var tmp$ret$1;
2420
+ $l$block: {
2421
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.catchingOopExceptions' call
2422
+ try {
2423
+ var tmp$ret$0;
2424
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.Cast.computeAll.<anonymous>' call
2425
+ var tmp0_subject = second;
2426
+ var tmp;
2427
+ if (isInterface(tmp0_subject, Struct)) {
2428
+ ensuringArgumentIsTypeRef(_this__u8e3s4, 1);
2429
+ var type = getArgumentAsTypeRef(_this__u8e3s4, 1);
2430
+ var tmp_0;
2431
+ try {
2432
+ var tmp_1 = Cast_getInstance();
2433
+ var tmp1_safe_receiver = type;
2434
+ var tmp_2 = cast(_this__u8e3s4, tmp_1, first, tmp1_safe_receiver == null ? null : tmp1_safe_receiver.c25(), third);
2435
+ tmp_0 = sequenceOf([_this__u8e3s4.g2g(tmp_2, null, [], 6, null)]);
2436
+ } catch ($p) {
2437
+ var tmp_3;
2438
+ if ($p instanceof TermToObjectConversionException) {
2439
+ tmp_3 = sequenceOf([_this__u8e3s4.l2g(null, [], 3, null)]);
2440
+ } else {
2441
+ throw $p;
2442
+ }
2443
+ tmp_0 = tmp_3;
2444
+ }
2445
+ tmp = tmp_0;
2446
+ } else {
2447
+ if (isInterface(tmp0_subject, Var)) {
2448
+ var tmp_4 = asSequence_0(get_termToObjectConverter(_this__u8e3s4).i3q(first));
2449
+ var tmp_5 = distinct(flatMap(tmp_4, Cast$computeAll$lambda));
2450
+ var tmp_6 = map(tmp_5, Cast$computeAll$lambda_0(_this__u8e3s4, first, third, second));
2451
+ tmp = map(tmp_6, Cast$computeAll$lambda_1(_this__u8e3s4));
2452
+ } else {
2453
+ ensuringArgumentIsTypeRef(_this__u8e3s4, 1);
2454
+ tmp = sequenceOf([_this__u8e3s4.l2g(null, [], 3, null)]);
2455
+ }
2456
+ }
2457
+ tmp$ret$0 = tmp;
2458
+ tmp$ret$1 = tmp$ret$0;
2459
+ break $l$block;
2460
+ } catch ($p) {
2461
+ if ($p instanceof OopException) {
2462
+ throw $p.u3q(_this__u8e3s4.context, _this__u8e3s4.signature);
2463
+ } else {
2464
+ if ($p instanceof Error) {
2465
+ throw Companion_getInstance_14().forUncaughtKtException(_this__u8e3s4.context, $p);
2466
+ } else {
2467
+ throw $p;
2468
+ }
2469
+ }
2470
+ }
2471
+ }
2472
+ return tmp$ret$1;
2473
+ };
2474
+ Cast.prototype.o2j = function (_this__u8e3s4, first, second, third) {
2475
+ return this.t3r(_this__u8e3s4, first, second, third);
2476
+ };
2477
+ var Cast_instance;
2478
+ function Cast_getInstance() {
2479
+ if (Cast_instance == null)
2480
+ new Cast();
2481
+ return Cast_instance;
2482
+ }
2483
+ function InvokeMethod() {
2484
+ InvokeMethod_instance = this;
2485
+ AbstractInvoke.call(this, 'method');
2486
+ }
2487
+ InvokeMethod.prototype.h3r = function (_this__u8e3s4) {
2488
+ return _this__u8e3s4.r1i();
2489
+ };
2490
+ var InvokeMethod_instance;
2491
+ function InvokeMethod_getInstance() {
2492
+ if (InvokeMethod_instance == null)
2493
+ new InvokeMethod();
2494
+ return InvokeMethod_instance;
2495
+ }
2496
+ function InvokeStrict() {
2497
+ InvokeStrict_instance = this;
2498
+ AbstractInvoke.call(this, 'strict');
2499
+ }
2500
+ InvokeStrict.prototype.h3r = function (_this__u8e3s4) {
2501
+ return _this__u8e3s4.c3q();
2502
+ };
2503
+ var InvokeStrict_instance;
2504
+ function InvokeStrict_getInstance() {
2505
+ if (InvokeStrict_instance == null)
2506
+ new InvokeStrict();
2507
+ return InvokeStrict_instance;
2508
+ }
2509
+ function ListItems() {
2510
+ ListItems_instance = this;
2511
+ AbstractIterableItems.call(this, 'list', getKClass(List));
2512
+ }
2513
+ ListItems.prototype.k3r = function (_this__u8e3s4) {
2514
+ return toList(_this__u8e3s4);
2515
+ };
2516
+ ListItems.prototype.l3r = function (_this__u8e3s4) {
2517
+ return !(_this__u8e3s4 == null) ? isInterface(_this__u8e3s4, List) : false;
2518
+ };
2519
+ ListItems.prototype.y3r = function (_this__u8e3s4) {
2520
+ return asSequence_0(_this__u8e3s4);
2521
+ };
2522
+ ListItems.prototype.m3r = function (_this__u8e3s4) {
2523
+ return this.y3r(isInterface(_this__u8e3s4, List) ? _this__u8e3s4 : THROW_CCE());
2524
+ };
2525
+ var ListItems_instance;
2526
+ function ListItems_getInstance() {
2527
+ if (ListItems_instance == null)
2528
+ new ListItems();
2529
+ return ListItems_instance;
2530
+ }
2531
+ function NewObject3() {
2532
+ NewObject3_instance = this;
2533
+ Functional.call(this, 'new_object');
2534
+ }
2535
+ NewObject3.prototype.k2q = function (_this__u8e3s4, first, second, third) {
2536
+ Companion_getInstance_13().l2h(_this__u8e3s4, 0);
2537
+ Companion_getInstance_13().v2h(_this__u8e3s4, 1);
2538
+ var tmp$ret$3;
2539
+ $l$block: {
2540
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.catchingOopExceptions' call
2541
+ try {
2542
+ var tmp$ret$2;
2543
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.NewObject3.computeOneSubstitution.<anonymous>' call
2544
+ var type = getArgumentAsTypeRef(_this__u8e3s4, 0);
2545
+ var arguments_0 = (isInterface(second, List_0) ? second : THROW_CCE()).toArray();
2546
+ var tmp0_safe_receiver = type;
2547
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.o3q(get_termToObjectConverter(_this__u8e3s4), arguments_0.slice());
2548
+ var objectReference = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.c3q();
2549
+ var tmp2_safe_receiver = objectReference;
2550
+ var tmp;
2551
+ if (tmp2_safe_receiver == null) {
2552
+ tmp = null;
2553
+ } else {
2554
+ var tmp$ret$1;
2555
+ // Inline function 'kotlin.let' call
2556
+ // Inline function 'kotlin.contracts.contract' call
2557
+ var tmp$ret$0;
2558
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.NewObject3.computeOneSubstitution.<anonymous>.<anonymous>' call
2559
+ tmp$ret$0 = Companion_getInstance_13().b2h(_this__u8e3s4, tmp2_safe_receiver, third);
2560
+ tmp$ret$1 = tmp$ret$0;
2561
+ tmp = tmp$ret$1;
2562
+ }
2563
+ var tmp3_elvis_lhs = tmp;
2564
+ tmp$ret$2 = tmp3_elvis_lhs == null ? Companion_getInstance_12().failed() : tmp3_elvis_lhs;
2565
+ tmp$ret$3 = tmp$ret$2;
2566
+ break $l$block;
2567
+ } catch ($p) {
2568
+ if ($p instanceof OopException) {
2569
+ throw $p.u3q(_this__u8e3s4.context, _this__u8e3s4.signature);
2570
+ } else {
2571
+ if ($p instanceof Error) {
2572
+ throw Companion_getInstance_14().forUncaughtKtException(_this__u8e3s4.context, $p);
2573
+ } else {
2574
+ throw $p;
2575
+ }
2576
+ }
2577
+ }
2578
+ }
2579
+ return tmp$ret$3;
2580
+ };
2581
+ NewObject3.prototype.t2j = function (_this__u8e3s4, first, second, third) {
2582
+ return this.k2q(_this__u8e3s4, first, second, third);
2583
+ };
2584
+ var NewObject3_instance;
2585
+ function NewObject3_getInstance() {
2586
+ if (NewObject3_instance == null)
2587
+ new NewObject3();
2588
+ return NewObject3_instance;
2589
+ }
2590
+ function NullRef_0() {
2591
+ NullRef_instance = this;
2592
+ TypeTester.call(this, 'null_ref');
2593
+ }
2594
+ NullRef_0.prototype.f2k = function (term) {
2595
+ return isInterface(term, NullRef);
2596
+ };
2597
+ var NullRef_instance;
2598
+ function NullRef_getInstance() {
2599
+ if (NullRef_instance == null)
2600
+ new NullRef_0();
2601
+ return NullRef_instance;
2602
+ }
2603
+ function ObjectRef_0() {
2604
+ ObjectRef_instance = this;
2605
+ TypeTester.call(this, 'object_ref');
2606
+ }
2607
+ ObjectRef_0.prototype.f2k = function (term) {
2608
+ return isInterface(term, ObjectRef);
2609
+ };
2610
+ var ObjectRef_instance;
2611
+ function ObjectRef_getInstance() {
2612
+ if (ObjectRef_instance == null)
2613
+ new ObjectRef_0();
2614
+ return ObjectRef_instance;
2615
+ }
2616
+ function get_DEALIASING_TEMPLATE() {
2617
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2618
+ return DEALIASING_TEMPLATE;
2619
+ }
2620
+ var DEALIASING_TEMPLATE;
2621
+ function get_CAST_TEMPLATE() {
2622
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2623
+ return CAST_TEMPLATE;
2624
+ }
2625
+ var CAST_TEMPLATE;
2626
+ function findRefFromAlias(_this__u8e3s4, alias) {
2627
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2628
+ var tmp0_elvis_lhs = findRefFromAliasOrNull(_this__u8e3s4, alias);
2629
+ var tmp;
2630
+ if (tmp0_elvis_lhs == null) {
2631
+ throw new NoSuchAnAliasException(alias);
2632
+ } else {
2633
+ tmp = tmp0_elvis_lhs;
2634
+ }
2635
+ return tmp;
2636
+ }
2637
+ function get_termToObjectConverter(_this__u8e3s4) {
2638
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2639
+ var tmp = Companion_getInstance_22();
2640
+ return tmp.e3q(null, _get_termToObjectConverter_$lambda_4bacq4(_this__u8e3s4), 1, null);
2641
+ }
2642
+ function ensuringArgumentIsTypeRef(_this__u8e3s4, index) {
2643
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2644
+ var arg = _this__u8e3s4.arguments.n(index);
2645
+ var tmp;
2646
+ var tmp_0;
2647
+ if (matchesDealiasingTemplate(_this__u8e3s4, arg)) {
2648
+ var tmp_1 = findRefFromAlias(_this__u8e3s4, arg.castToStruct());
2649
+ tmp_0 = isInterface(tmp_1, TypeRef);
2650
+ } else {
2651
+ tmp_0 = false;
2652
+ }
2653
+ if (tmp_0) {
2654
+ tmp = _this__u8e3s4;
2655
+ } else {
2656
+ if (!isInterface(arg, TypeRef)) {
2657
+ throw Companion_getInstance_1().q25(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_TYPE_REFERENCE_getInstance(), arg, index);
2658
+ } else {
2659
+ tmp = _this__u8e3s4;
2660
+ }
2661
+ }
2662
+ return tmp;
2663
+ }
2664
+ function getArgumentAsTypeRef(_this__u8e3s4, index) {
2665
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2666
+ Companion_getInstance_13().l2h(_this__u8e3s4, index);
2667
+ var arg = _this__u8e3s4.arguments.n(index);
2668
+ var tmp;
2669
+ if (isInterface(arg, TypeRef)) {
2670
+ tmp = arg;
2671
+ } else {
2672
+ if (isInterface(arg, Atom)) {
2673
+ tmp = Companion_getInstance_23().g3q_1.n3q(arg.b1());
2674
+ } else {
2675
+ if (isDealiasingExpression(_this__u8e3s4, arg)) {
2676
+ var tmp_0 = findRefFromAlias(_this__u8e3s4, arg.castToStruct());
2677
+ tmp = isInterface(tmp_0, TypeRef) ? tmp_0 : null;
2678
+ } else {
2679
+ ensuringArgumentIsTypeRef(_this__u8e3s4, 1);
2680
+ tmp = null;
2681
+ }
2682
+ }
2683
+ }
2684
+ return tmp;
2685
+ }
2686
+ function ensuringArgumentIsRef(_this__u8e3s4, index) {
2687
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2688
+ var arg = _this__u8e3s4.arguments.n(index);
2689
+ var tmp;
2690
+ if (matchesDealiasingTemplate(_this__u8e3s4, arg) ? ensureAliasIsRegistered(_this__u8e3s4, arg.castToStruct()) : false) {
2691
+ tmp = _this__u8e3s4;
2692
+ } else {
2693
+ if (!isInterface(arg, Ref)) {
2694
+ throw Companion_getInstance_1().q25(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_REFERENCE_getInstance(), arg, index);
2695
+ } else {
2696
+ tmp = _this__u8e3s4;
2697
+ }
2698
+ }
2699
+ return tmp;
2700
+ }
2701
+ function findRefFromAliasOrNull(_this__u8e3s4, alias) {
2702
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2703
+ var tmp;
2704
+ if (isDealiasingExpression(_this__u8e3s4, alias)) {
2705
+ var tmp_0 = alias.get(0);
2706
+ tmp = isInterface(tmp_0, Struct) ? tmp_0 : THROW_CCE();
2707
+ } else {
2708
+ throw new MalformedAliasException(alias);
2709
+ }
2710
+ var actualAlias = tmp;
2711
+ var ActualRef = Companion_getInstance_16().of('ActualRef');
2712
+ var tmp$ret$0;
2713
+ // Inline function 'kotlin.sequences.filterIsInstance' call
2714
+ var tmp_1 = Companion_getInstance_17();
2715
+ Companion_getInstance_27();
2716
+ var tmp_2 = tmp_1.of('alias', [actualAlias, ActualRef]);
2717
+ var tmp0_filterIsInstance = _this__u8e3s4.e2j(tmp_2, new Long(0, 0), 2, null);
2718
+ var tmp_3 = filter(tmp0_filterIsInstance, findRefFromAliasOrNull$lambda);
2719
+ tmp$ret$0 = isInterface(tmp_3, Sequence) ? tmp_3 : THROW_CCE();
2720
+ var tmp0_safe_receiver = firstOrNull(tmp$ret$0);
2721
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.w1v();
2722
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.get(1);
2723
+ return tmp2_safe_receiver == null ? null : tmp2_safe_receiver.zw();
2724
+ }
2725
+ function matchesDealiasingTemplate(_this__u8e3s4, term) {
2726
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2727
+ var tmp;
2728
+ if (isInterface(term, Struct)) {
2729
+ tmp = Companion_getInstance_13().c2h(_this__u8e3s4, term, get_DEALIASING_TEMPLATE());
2730
+ } else {
2731
+ tmp = false;
2732
+ }
2733
+ return tmp;
2734
+ }
2735
+ function isDealiasingExpression(_this__u8e3s4, term) {
2736
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2737
+ var tmp;
2738
+ var tmp_0;
2739
+ if (isInterface(term, Struct)) {
2740
+ tmp_0 = Companion_getInstance_13().c2h(_this__u8e3s4, term, get_DEALIASING_TEMPLATE());
2741
+ } else {
2742
+ tmp_0 = false;
2743
+ }
2744
+ if (tmp_0) {
2745
+ var tmp_1 = term.gw().n(0);
2746
+ tmp = isInterface(tmp_1, Atom);
2747
+ } else {
2748
+ tmp = false;
2749
+ }
2750
+ return tmp;
2751
+ }
2752
+ function ensureAliasIsRegistered(_this__u8e3s4, alias) {
2753
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2754
+ var tmp;
2755
+ if (isAliasRegistered(_this__u8e3s4, alias)) {
2756
+ tmp = true;
2757
+ } else {
2758
+ throw new NoSuchAnAliasException(alias);
2759
+ }
2760
+ return tmp;
2761
+ }
2762
+ function isAliasRegistered(_this__u8e3s4, alias) {
2763
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2764
+ return !(findRefFromAliasOrNull(_this__u8e3s4, alias) == null);
2765
+ }
2766
+ function _get_termToObjectConverter_$lambda_4bacq4($this_termToObjectConverter) {
2767
+ return function (it) {
2768
+ return findRefFromAliasOrNull($this_termToObjectConverter, it);
2769
+ };
2770
+ }
2771
+ function findRefFromAliasOrNull$lambda(it) {
2772
+ init_properties_PrimitiveExtensions_kt_j3o48p();
2773
+ return !(it == null) ? isInterface(it, Yes) : false;
2774
+ }
2775
+ var properties_initialized_PrimitiveExtensions_kt_xhw6ad;
2776
+ function init_properties_PrimitiveExtensions_kt_j3o48p() {
2777
+ if (properties_initialized_PrimitiveExtensions_kt_xhw6ad) {
2778
+ } else {
2779
+ properties_initialized_PrimitiveExtensions_kt_xhw6ad = true;
2780
+ var tmp = Companion_getInstance_17();
2781
+ OOP_getInstance();
2782
+ DEALIASING_TEMPLATE = tmp.of('$', [Companion_getInstance_16().of('Alias')]);
2783
+ var tmp_0 = Companion_getInstance_17();
2784
+ OOP_getInstance();
2785
+ CAST_TEMPLATE = tmp_0.template('as', 2);
2786
+ }
2787
+ }
2788
+ function Ref_0() {
2789
+ Ref_instance = this;
2790
+ TypeTester.call(this, 'ref');
2791
+ }
2792
+ Ref_0.prototype.f2k = function (term) {
2793
+ return isInterface(term, Ref);
2794
+ };
2795
+ var Ref_instance;
2796
+ function Ref_getInstance() {
2797
+ if (Ref_instance == null)
2798
+ new Ref_0();
2799
+ return Ref_instance;
2800
+ }
2801
+ function Register$computeOne$lambda($second, $first) {
2802
+ return function ($this$replySuccess) {
2803
+ var tmp = Companion_getInstance_27();
2804
+ var tmp_0 = isInterface($second, Struct) ? $second : THROW_CCE();
2805
+ var tmp_1 = [tmp.d3s(tmp_0, isInterface($first, Ref) ? $first : THROW_CCE()).j1u()];
2806
+ $this$replySuccess.v2m(tmp_1, false, 2, null);
2807
+ return Unit_getInstance();
2808
+ };
2809
+ }
2810
+ function Register() {
2811
+ Register_instance = this;
2812
+ NonBacktrackable.call(this, 'register');
2813
+ }
2814
+ Register.prototype.x2p = function (_this__u8e3s4, first_0, second) {
2815
+ Companion_getInstance_13().y2f(_this__u8e3s4);
2816
+ ensuringArgumentIsRef(_this__u8e3s4, 0);
2817
+ Companion_getInstance_13().l2h(_this__u8e3s4, 1);
2818
+ if (!second.jx()) {
2819
+ throw Companion_getInstance_18().t26(_this__u8e3s4.context, _this__u8e3s4.signature, first(second.hw()), 0);
2820
+ }
2821
+ return _this__u8e3s4.b2j(null, null, Register$computeOne$lambda(second, first_0), 3, null);
2822
+ };
2823
+ Register.prototype.a2g = function (_this__u8e3s4, first, second) {
2824
+ return this.x2p(_this__u8e3s4, first, second);
2825
+ };
2826
+ var Register_instance;
2827
+ function Register_getInstance() {
2828
+ if (Register_instance == null)
2829
+ new Register();
2830
+ return Register_instance;
2831
+ }
2832
+ function SetItems() {
2833
+ SetItems_instance = this;
2834
+ AbstractIterableItems.call(this, 'set', getKClass(Set));
2835
+ }
2836
+ SetItems.prototype.k3r = function (_this__u8e3s4) {
2837
+ return toSet(_this__u8e3s4);
2838
+ };
2839
+ SetItems.prototype.l3r = function (_this__u8e3s4) {
2840
+ return !(_this__u8e3s4 == null) ? isInterface(_this__u8e3s4, Set) : false;
2841
+ };
2842
+ SetItems.prototype.h3s = function (_this__u8e3s4) {
2843
+ return asSequence_0(_this__u8e3s4);
2844
+ };
2845
+ SetItems.prototype.m3r = function (_this__u8e3s4) {
2846
+ return this.h3s(isInterface(_this__u8e3s4, Set) ? _this__u8e3s4 : THROW_CCE());
2847
+ };
2848
+ var SetItems_instance;
2849
+ function SetItems_getInstance() {
2850
+ if (SetItems_instance == null)
2851
+ new SetItems();
2852
+ return SetItems_instance;
2853
+ }
2854
+ function Type() {
2855
+ Type_instance = this;
2856
+ Functional_0.call(this, 'type');
2857
+ this.j3s_1 = Companion_getInstance_23().g3q_1;
2858
+ }
2859
+ Type.prototype.h2q = function (_this__u8e3s4, first, second) {
2860
+ var tmp$ret$3;
2861
+ $l$block: {
2862
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.catchingOopExceptions' call
2863
+ try {
2864
+ var tmp$ret$2;
2865
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.Type.computeOneSubstitution.<anonymous>' call
2866
+ var tmp;
2867
+ var tmp_0;
2868
+ if (isInterface(first, Var)) {
2869
+ tmp_0 = isInterface(second, Var);
2870
+ } else {
2871
+ tmp_0 = false;
2872
+ }
2873
+ if (tmp_0) {
2874
+ Companion_getInstance_13().h2h(_this__u8e3s4, 0);
2875
+ tmp = Companion_getInstance_12().failed();
2876
+ } else {
2877
+ if (isInterface(first, Var)) {
2878
+ Companion_getInstance_13().q2h(_this__u8e3s4, 1);
2879
+ ensuringArgumentIsTypeRef(_this__u8e3s4, 1);
2880
+ var tmp_1 = Companion_getInstance_13();
2881
+ var tmp_2 = Companion_getInstance_5();
2882
+ tmp = tmp_1.b2h(_this__u8e3s4, first, tmp_2.of(get_name((isInterface(second, TypeRef) ? second : THROW_CCE()).c25())));
2883
+ } else {
2884
+ if (isInterface(second, Var)) {
2885
+ Companion_getInstance_13().q2h(_this__u8e3s4, 0);
2886
+ var tmp_3 = Type_getInstance().j3s_1;
2887
+ var tmp0_safe_receiver = tmp_3.n3q((isInterface(first, Atom) ? first : THROW_CCE()).b1());
2888
+ var tmp_4;
2889
+ if (tmp0_safe_receiver == null) {
2890
+ tmp_4 = null;
2891
+ } else {
2892
+ var tmp$ret$1;
2893
+ // Inline function 'kotlin.let' call
2894
+ // Inline function 'kotlin.contracts.contract' call
2895
+ var tmp$ret$0;
2896
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.Type.computeOneSubstitution.<anonymous>.<anonymous>' call
2897
+ tmp$ret$0 = Companion_getInstance_13().b2h(_this__u8e3s4, tmp0_safe_receiver, second);
2898
+ tmp$ret$1 = tmp$ret$0;
2899
+ tmp_4 = tmp$ret$1;
2900
+ }
2901
+ var tmp1_elvis_lhs = tmp_4;
2902
+ tmp = tmp1_elvis_lhs == null ? Companion_getInstance_12().failed() : tmp1_elvis_lhs;
2903
+ } else {
2904
+ Companion_getInstance_13().q2h(_this__u8e3s4, 0);
2905
+ tmp = Companion_getInstance_12().failed();
2906
+ }
2907
+ }
2908
+ }
2909
+ tmp$ret$2 = tmp;
2910
+ tmp$ret$3 = tmp$ret$2;
2911
+ break $l$block;
2912
+ } catch ($p) {
2913
+ if ($p instanceof OopException) {
2914
+ throw $p.u3q(_this__u8e3s4.context, _this__u8e3s4.signature);
2915
+ } else {
2916
+ if ($p instanceof Error) {
2917
+ throw Companion_getInstance_14().forUncaughtKtException(_this__u8e3s4.context, $p);
2918
+ } else {
2919
+ throw $p;
2920
+ }
2921
+ }
2922
+ }
2923
+ }
2924
+ return tmp$ret$3;
2925
+ };
2926
+ Type.prototype.k2g = function (_this__u8e3s4, first, second) {
2927
+ return this.h2q(_this__u8e3s4, first, second);
2928
+ };
2929
+ var Type_instance;
2930
+ function Type_getInstance() {
2931
+ if (Type_instance == null)
2932
+ new Type();
2933
+ return Type_instance;
2934
+ }
2935
+ function TypeRef_0() {
2936
+ TypeRef_instance = this;
2937
+ TypeTester.call(this, 'type_ref');
2938
+ }
2939
+ TypeRef_0.prototype.f2k = function (term) {
2940
+ return isInterface(term, TypeRef);
2941
+ };
2942
+ var TypeRef_instance;
2943
+ function TypeRef_getInstance() {
2944
+ if (TypeRef_instance == null)
2945
+ new TypeRef_0();
2946
+ return TypeRef_instance;
2947
+ }
2948
+ function Unregister$computeOne$lambda($first) {
2949
+ return function (it) {
2950
+ return it.ly().get(0).equals($first);
2951
+ };
2952
+ }
2953
+ function Unregister$computeOne$lambda_0($toBeRemoved) {
2954
+ return function ($this$replySuccess) {
2955
+ $this$replySuccess.w2m($toBeRemoved);
2956
+ return Unit_getInstance();
2957
+ };
2958
+ }
2959
+ function Unregister() {
2960
+ Unregister_instance = this;
2961
+ NonBacktrackable_0.call(this, 'unregister');
2962
+ }
2963
+ Unregister.prototype.g2p = function (_this__u8e3s4, first_0) {
2964
+ Companion_getInstance_13().l2h(_this__u8e3s4, 0);
2965
+ if (!first_0.jx()) {
2966
+ throw Companion_getInstance_18().t26(_this__u8e3s4.context, _this__u8e3s4.signature, first(first_0.hw()), 0);
2967
+ }
2968
+ var tmp = Companion_getInstance_17();
2969
+ Companion_getInstance_27();
2970
+ var pattern = tmp.of('alias', [first_0, Companion_getInstance_16().anonymous()]);
2971
+ var tmp_0 = _this__u8e3s4.context.y1u().getByHead(pattern);
2972
+ var toBeRemoved = toList(filter(tmp_0, Unregister$computeOne$lambda(first_0)));
2973
+ var tmp_1;
2974
+ if (toBeRemoved.d()) {
2975
+ tmp_1 = _this__u8e3s4.l2g(null, [], 3, null);
2976
+ } else {
2977
+ tmp_1 = _this__u8e3s4.b2j(null, null, Unregister$computeOne$lambda_0(toBeRemoved), 3, null);
2978
+ }
2979
+ return tmp_1;
2980
+ };
2981
+ Unregister.prototype.a2k = function (_this__u8e3s4, first) {
2982
+ return this.g2p(_this__u8e3s4, first);
2983
+ };
2984
+ var Unregister_instance;
2985
+ function Unregister_getInstance() {
2986
+ if (Unregister_instance == null)
2987
+ new Unregister();
2988
+ return Unregister_instance;
2989
+ }
2990
+ function Companion_7() {
2991
+ Companion_instance_7 = this;
2992
+ this.r3p_1 = 'alias';
2993
+ }
2994
+ Companion_7.prototype.s3p = function (alias, type) {
2995
+ return new Alias(Companion_getInstance_5().of(alias), Companion_getInstance_24().l3q(type));
2996
+ };
2997
+ Companion_7.prototype.d3s = function (alias, ref) {
2998
+ return new Alias(alias, ref);
2999
+ };
3000
+ var Companion_instance_7;
3001
+ function Companion_getInstance_27() {
3002
+ if (Companion_instance_7 == null)
3003
+ new Companion_7();
3004
+ return Companion_instance_7;
3005
+ }
3006
+ function Alias(alias, ref) {
3007
+ Companion_getInstance_27();
3008
+ Companion_getInstance_27();
3009
+ RuleWrapper_init_$Init$('alias', 2, false, 4, null, this);
3010
+ this.p3s_1 = alias;
3011
+ this.q3s_1 = ref;
3012
+ // Inline function 'kotlin.require' call
3013
+ var tmp0_require = this.p3s_1.jx();
3014
+ // Inline function 'kotlin.contracts.contract' call
3015
+ if (!tmp0_require) {
3016
+ var tmp$ret$0;
3017
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.rules.Alias.<anonymous>' call
3018
+ tmp$ret$0 = 'Alias must be a ground term, got: ' + this.p3s_1;
3019
+ var message = tmp$ret$0;
3020
+ throw IllegalArgumentException_init_$Create$(toString_0(message));
3021
+ }
3022
+ }
3023
+ Alias.prototype.g2k = function (_this__u8e3s4) {
3024
+ return toList(sequenceOf([this.p3s_1, this.q3s_1]));
3025
+ };
3026
+ function _get_R__7mlo3j($this) {
3027
+ return $this.u3s_1.k1i($this, R$factory());
3028
+ }
3029
+ function _get_X__7mlo8p($this) {
3030
+ return $this.v3s_1.k1i($this, X$factory());
3031
+ }
3032
+ function _get_Y__7mlo9k($this) {
3033
+ return $this.w3s_1.k1i($this, Y$factory());
3034
+ }
3035
+ function _get_T__7mlo59($this) {
3036
+ return $this.x3s_1.k1i($this, T$factory());
3037
+ }
3038
+ function _get_R__7mlo3j_0($this) {
3039
+ return $this.b3t_1.k1i($this, R$factory_0());
3040
+ }
3041
+ function _get_M__7mlnz8($this) {
3042
+ return $this.c3t_1.k1i($this, M$factory());
3043
+ }
3044
+ function _get_C__7mlnqm($this) {
3045
+ return $this.g3t_1.k1i($this, C$factory());
3046
+ }
3047
+ function _get_P__7mlo1t($this) {
3048
+ return $this.h3t_1.k1i($this, P$factory());
3049
+ }
3050
+ function _get_R__7mlo3j_1($this) {
3051
+ return $this.i3t_1.k1i($this, R$factory_1());
3052
+ }
3053
+ function _get_V__7mlo6z($this) {
3054
+ return $this.j3t_1.k1i($this, V$factory());
3055
+ }
3056
+ function Cast_0() {
3057
+ Cast_instance_0 = this;
3058
+ ColonEquals.call(this);
3059
+ this.u3s_1 = this.v2e_1;
3060
+ this.v3s_1 = this.v2e_1;
3061
+ this.w3s_1 = this.v2e_1;
3062
+ this.x3s_1 = this.v2e_1;
3063
+ }
3064
+ Cast_0.prototype.g2k = function (_this__u8e3s4) {
3065
+ var tmp = _get_R__7mlo3j(this);
3066
+ OOP_getInstance();
3067
+ return _this__u8e3s4.ktListOf([tmp, _this__u8e3s4.structOf('as', [_get_X__7mlo8p(this), _get_T__7mlo59(this)])]);
3068
+ };
3069
+ Cast_0.prototype.h2k = function (_this__u8e3s4) {
3070
+ var tmp$ret$0;
3071
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3072
+ var tmp0__get_functor__thl4dk = Var_getInstance();
3073
+ tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
3074
+ var tmp = _this__u8e3s4.structOf(tmp$ret$0, [_get_R__7mlo3j(this)]);
3075
+ var tmp_0 = _this__u8e3s4.atomOf('!');
3076
+ Companion_getInstance_28();
3077
+ var tmp_1 = _this__u8e3s4.structOf('fluent_reduce', [_get_X__7mlo8p(this), _get_Y__7mlo9k(this)]);
3078
+ var tmp$ret$1;
3079
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3080
+ var tmp1__get_functor__4k11yf = Cast_getInstance();
3081
+ tmp$ret$1 = tmp1__get_functor__4k11yf.signature.name;
3082
+ return _this__u8e3s4.tupleOf([tmp, tmp_0, tmp_1, _this__u8e3s4.structOf(tmp$ret$1, [_get_Y__7mlo9k(this), _get_T__7mlo59(this), _get_R__7mlo3j(this)])]);
3083
+ };
3084
+ var Cast_instance_0;
3085
+ function Cast_getInstance_0() {
3086
+ if (Cast_instance_0 == null)
3087
+ new Cast_0();
3088
+ return Cast_instance_0;
3089
+ }
3090
+ function Invocation() {
3091
+ Invocation_instance = this;
3092
+ ColonEquals.call(this);
3093
+ this.b3t_1 = this.v2e_1;
3094
+ this.c3t_1 = this.v2e_1;
3095
+ }
3096
+ Invocation.prototype.g2k = function (_this__u8e3s4) {
3097
+ return listOf([_get_R__7mlo3j_0(this), _get_M__7mlnz8(this)]);
3098
+ };
3099
+ Invocation.prototype.h2k = function (_this__u8e3s4) {
3100
+ var tmp$ret$0;
3101
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3102
+ var tmp0__get_functor__thl4dk = Var_getInstance();
3103
+ tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
3104
+ var tmp = _this__u8e3s4.structOf(tmp$ret$0, [_get_R__7mlo3j_0(this)]);
3105
+ var tmp_0 = _this__u8e3s4.atomOf('!');
3106
+ Companion_getInstance_28();
3107
+ return _this__u8e3s4.tupleOf([tmp, tmp_0, _this__u8e3s4.structOf('fluent_reduce', [_get_M__7mlnz8(this), _get_R__7mlo3j_0(this)])]);
3108
+ };
3109
+ var Invocation_instance;
3110
+ function Invocation_getInstance() {
3111
+ if (Invocation_instance == null)
3112
+ new Invocation();
3113
+ return Invocation_instance;
3114
+ }
3115
+ function Assignment() {
3116
+ Assignment_instance = this;
3117
+ ColonEquals.call(this);
3118
+ this.g3t_1 = this.v2e_1;
3119
+ this.h3t_1 = this.v2e_1;
3120
+ this.i3t_1 = this.v2e_1;
3121
+ this.j3t_1 = this.v2e_1;
3122
+ }
3123
+ Assignment.prototype.g2k = function (_this__u8e3s4) {
3124
+ return listOf([_get_C__7mlnqm(this), _get_V__7mlo6z(this)]);
3125
+ };
3126
+ Assignment.prototype.h2k = function (_this__u8e3s4) {
3127
+ Companion_getInstance_29();
3128
+ var tmp = _this__u8e3s4.structOf('property_reduce', [_get_C__7mlnqm(this), _get_R__7mlo3j_1(this), _get_P__7mlo1t(this)]);
3129
+ var tmp$ret$0;
3130
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3131
+ var tmp0__get_functor__thl4dk = Assign_getInstance();
3132
+ tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
3133
+ return _this__u8e3s4.tupleOf([tmp, _this__u8e3s4.structOf(tmp$ret$0, [_get_R__7mlo3j_1(this), _get_P__7mlo1t(this), _get_V__7mlo6z(this)])]);
3134
+ };
3135
+ var Assignment_instance;
3136
+ function Assignment_getInstance() {
3137
+ if (Assignment_instance == null)
3138
+ new Assignment();
3139
+ return Assignment_instance;
3140
+ }
3141
+ function ColonEquals() {
3142
+ OOP_getInstance();
3143
+ RuleWrapper_init_$Init$(':=', 2, false, 4, null, this);
3144
+ }
3145
+ function R$factory() {
3146
+ return getPropertyCallableRef('R', 1, KProperty1, function (receiver) {
3147
+ return _get_R__7mlo3j(receiver);
3148
+ }, null);
3149
+ }
3150
+ function X$factory() {
3151
+ return getPropertyCallableRef('X', 1, KProperty1, function (receiver) {
3152
+ return _get_X__7mlo8p(receiver);
3153
+ }, null);
3154
+ }
3155
+ function Y$factory() {
3156
+ return getPropertyCallableRef('Y', 1, KProperty1, function (receiver) {
3157
+ return _get_Y__7mlo9k(receiver);
3158
+ }, null);
3159
+ }
3160
+ function T$factory() {
3161
+ return getPropertyCallableRef('T', 1, KProperty1, function (receiver) {
3162
+ return _get_T__7mlo59(receiver);
3163
+ }, null);
3164
+ }
3165
+ function R$factory_0() {
3166
+ return getPropertyCallableRef('R', 1, KProperty1, function (receiver) {
3167
+ return _get_R__7mlo3j_0(receiver);
3168
+ }, null);
3169
+ }
3170
+ function M$factory() {
3171
+ return getPropertyCallableRef('M', 1, KProperty1, function (receiver) {
3172
+ return _get_M__7mlnz8(receiver);
3173
+ }, null);
3174
+ }
3175
+ function C$factory() {
3176
+ return getPropertyCallableRef('C', 1, KProperty1, function (receiver) {
3177
+ return _get_C__7mlnqm(receiver);
3178
+ }, null);
3179
+ }
3180
+ function P$factory() {
3181
+ return getPropertyCallableRef('P', 1, KProperty1, function (receiver) {
3182
+ return _get_P__7mlo1t(receiver);
3183
+ }, null);
3184
+ }
3185
+ function R$factory_1() {
3186
+ return getPropertyCallableRef('R', 1, KProperty1, function (receiver) {
3187
+ return _get_R__7mlo3j_1(receiver);
3188
+ }, null);
3189
+ }
3190
+ function V$factory() {
3191
+ return getPropertyCallableRef('V', 1, KProperty1, function (receiver) {
3192
+ return _get_V__7mlo6z(receiver);
3193
+ }, null);
3194
+ }
3195
+ function _get_Method__a3idyi($this) {
3196
+ return $this.n3t_1.k1i($this, Method$factory());
3197
+ }
3198
+ function _get_Ref__e5vi4e($this) {
3199
+ return $this.o3t_1.k1i($this, Ref$factory());
3200
+ }
3201
+ function Dot() {
3202
+ Dot_instance = this;
3203
+ OOP_getInstance();
3204
+ RuleWrapper_init_$Init$('.', 2, false, 4, null, this);
3205
+ this.n3t_1 = this.v2e_1;
3206
+ this.o3t_1 = this.v2e_1;
3207
+ }
3208
+ Dot.prototype.g2k = function (_this__u8e3s4) {
3209
+ return listOf([_get_Ref__e5vi4e(this), _get_Method__a3idyi(this)]);
3210
+ };
3211
+ Dot.prototype.h2k = function (_this__u8e3s4) {
3212
+ Companion_getInstance_28();
3213
+ return _this__u8e3s4.structOf('fluent_reduce', [_this__u8e3s4.consOf(_get_Ref__e5vi4e(this), _get_Method__a3idyi(this)), _this__u8e3s4.w11()]);
3214
+ };
3215
+ var Dot_instance;
3216
+ function Dot_getInstance() {
3217
+ if (Dot_instance == null)
3218
+ new Dot();
3219
+ return Dot_instance;
3220
+ }
3221
+ function Method$factory() {
3222
+ return getPropertyCallableRef('Method', 1, KProperty1, function (receiver) {
3223
+ return _get_Method__a3idyi(receiver);
3224
+ }, null);
3225
+ }
3226
+ function Ref$factory() {
3227
+ return getPropertyCallableRef('Ref', 1, KProperty1, function (receiver) {
3228
+ return _get_Ref__e5vi4e(receiver);
3229
+ }, null);
3230
+ }
3231
+ function _get_P__7mlo1t_0($this) {
3232
+ return $this.t3t_1.k1i($this, P$factory_0());
3233
+ }
3234
+ function _get_M__7mlnz8_0($this) {
3235
+ return $this.u3t_1.k1i($this, M$factory_0());
3236
+ }
3237
+ function _get_P1__ndbjd6($this) {
3238
+ return $this.v3t_1.k1i($this, P1$factory());
3239
+ }
3240
+ function _get_X__7mlo8p_0($this) {
3241
+ return $this.w3t_1.k1i($this, X$factory_0());
3242
+ }
3243
+ function _get_P__7mlo1t_1($this) {
3244
+ return $this.b3u_1.k1i($this, P$factory_1());
3245
+ }
3246
+ function _get_M__7mlnz8_1($this) {
3247
+ return $this.c3u_1.k1i($this, M$factory_1());
3248
+ }
3249
+ function Companion_8() {
3250
+ Companion_instance_8 = this;
3251
+ this.d3u_1 = 'fluent_reduce';
3252
+ this.e3u_1 = 2;
3253
+ }
3254
+ var Companion_instance_8;
3255
+ function Companion_getInstance_28() {
3256
+ if (Companion_instance_8 == null)
3257
+ new Companion_8();
3258
+ return Companion_instance_8;
3259
+ }
3260
+ function Recursive() {
3261
+ Recursive_instance = this;
3262
+ FluentReduce.call(this);
3263
+ this.t3t_1 = this.v2e_1;
3264
+ this.u3t_1 = this.v2e_1;
3265
+ this.v3t_1 = this.v2e_1;
3266
+ this.w3t_1 = this.v2e_1;
3267
+ }
3268
+ Recursive.prototype.g2k = function (_this__u8e3s4) {
3269
+ return listOf([_this__u8e3s4.x11([_get_P__7mlo1t_0(this), _get_M__7mlnz8_0(this)], _get_X__7mlo8p_0(this)), this.j3u()]);
3270
+ };
3271
+ Recursive.prototype.h2k = function (_this__u8e3s4) {
3272
+ var tmp = _this__u8e3s4.atomOf('!');
3273
+ var tmp$ret$0;
3274
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3275
+ var tmp0__get_functor__thl4dk = InvokeMethod_getInstance();
3276
+ tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
3277
+ var tmp_0 = _this__u8e3s4.structOf(tmp$ret$0, [_get_P__7mlo1t_0(this), _get_M__7mlnz8_0(this), _get_P1__ndbjd6(this)]);
3278
+ Companion_getInstance_28();
3279
+ return _this__u8e3s4.tupleOf([tmp, tmp_0, _this__u8e3s4.structOf('fluent_reduce', [_this__u8e3s4.consOf(_get_P1__ndbjd6(this), _get_X__7mlo8p_0(this)), this.j3u()])]);
3280
+ };
3281
+ var Recursive_instance;
3282
+ function Recursive_getInstance() {
3283
+ if (Recursive_instance == null)
3284
+ new Recursive();
3285
+ return Recursive_instance;
3286
+ }
3287
+ function Couple() {
3288
+ Couple_instance = this;
3289
+ FluentReduce.call(this);
3290
+ this.b3u_1 = this.v2e_1;
3291
+ this.c3u_1 = this.v2e_1;
3292
+ }
3293
+ Couple.prototype.g2k = function (_this__u8e3s4) {
3294
+ return listOf([_this__u8e3s4.consOf(_get_P__7mlo1t_1(this), _get_M__7mlnz8_1(this)), this.j3u()]);
3295
+ };
3296
+ Couple.prototype.h2k = function (_this__u8e3s4) {
3297
+ var tmp = _this__u8e3s4.atomOf('!');
3298
+ var tmp$ret$0;
3299
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3300
+ var tmp0__get_functor__thl4dk = InvokeMethod_getInstance();
3301
+ tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
3302
+ return _this__u8e3s4.tupleOf([tmp, _this__u8e3s4.structOf(tmp$ret$0, [_get_P__7mlo1t_1(this), _get_M__7mlnz8_1(this), this.j3u()])]);
3303
+ };
3304
+ var Couple_instance;
3305
+ function Couple_getInstance() {
3306
+ if (Couple_instance == null)
3307
+ new Couple();
3308
+ return Couple_instance;
3309
+ }
3310
+ function Trivial() {
3311
+ Trivial_instance = this;
3312
+ FluentReduce.call(this);
3313
+ }
3314
+ Trivial.prototype.g2k = function (_this__u8e3s4) {
3315
+ return listOf([this.j3u(), this.j3u()]);
3316
+ };
3317
+ var Trivial_instance;
3318
+ function Trivial_getInstance() {
3319
+ if (Trivial_instance == null)
3320
+ new Trivial();
3321
+ return Trivial_instance;
3322
+ }
3323
+ function FluentReduce() {
3324
+ Companion_getInstance_28();
3325
+ Companion_getInstance_28();
3326
+ Companion_getInstance_28();
3327
+ RuleWrapper_init_$Init$('fluent_reduce', 2, false, 4, null, this);
3328
+ this.i3u_1 = this.v2e_1;
3329
+ }
3330
+ FluentReduce.prototype.j3u = function () {
3331
+ return this.i3u_1.k1i(this, R$factory_2());
3332
+ };
3333
+ FluentReduce.prototype.h2k = function (_this__u8e3s4) {
3334
+ return _this__u8e3s4.atomOf('!');
3335
+ };
3336
+ function R$factory_2() {
3337
+ return getPropertyCallableRef('R', 1, KProperty1, function (receiver) {
3338
+ return receiver.j3u();
3339
+ }, null);
3340
+ }
3341
+ function P$factory_0() {
3342
+ return getPropertyCallableRef('P', 1, KProperty1, function (receiver) {
3343
+ return _get_P__7mlo1t_0(receiver);
3344
+ }, null);
3345
+ }
3346
+ function M$factory_0() {
3347
+ return getPropertyCallableRef('M', 1, KProperty1, function (receiver) {
3348
+ return _get_M__7mlnz8_0(receiver);
3349
+ }, null);
3350
+ }
3351
+ function P1$factory() {
3352
+ return getPropertyCallableRef('P1', 1, KProperty1, function (receiver) {
3353
+ return _get_P1__ndbjd6(receiver);
3354
+ }, null);
3355
+ }
3356
+ function X$factory_0() {
3357
+ return getPropertyCallableRef('X', 1, KProperty1, function (receiver) {
3358
+ return _get_X__7mlo8p_0(receiver);
3359
+ }, null);
3360
+ }
3361
+ function P$factory_1() {
3362
+ return getPropertyCallableRef('P', 1, KProperty1, function (receiver) {
3363
+ return _get_P__7mlo1t_1(receiver);
3364
+ }, null);
3365
+ }
3366
+ function M$factory_1() {
3367
+ return getPropertyCallableRef('M', 1, KProperty1, function (receiver) {
3368
+ return _get_M__7mlnz8_1(receiver);
3369
+ }, null);
3370
+ }
3371
+ function _get_Type__cwwv8x($this) {
3372
+ return $this.r3u_1.k1i($this, Type$factory());
3373
+ }
3374
+ function _get_Instance__cwfjuy($this) {
3375
+ return $this.s3u_1.k1i($this, Instance$factory());
3376
+ }
3377
+ function NewObject2() {
3378
+ NewObject2_instance = this;
3379
+ var tmp$ret$0;
3380
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3381
+ var tmp0__get_functor__thl4dk = NewObject3_getInstance();
3382
+ tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
3383
+ var tmp = tmp$ret$0;
3384
+ RuleWrapper_init_$Init$(tmp, 2, false, 4, null, this);
3385
+ this.r3u_1 = this.v2e_1;
3386
+ this.s3u_1 = this.v2e_1;
3387
+ }
3388
+ NewObject2.prototype.g2k = function (_this__u8e3s4) {
3389
+ return listOf([_get_Type__cwwv8x(this), _get_Instance__cwfjuy(this)]);
3390
+ };
3391
+ NewObject2.prototype.h2k = function (_this__u8e3s4) {
3392
+ var tmp$ret$0;
3393
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3394
+ var tmp0__get_functor__thl4dk = NewObject3_getInstance();
3395
+ tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
3396
+ return _this__u8e3s4.structOf(tmp$ret$0, [_get_Type__cwwv8x(this), _this__u8e3s4.v11(), _get_Instance__cwfjuy(this)]);
3397
+ };
3398
+ var NewObject2_instance;
3399
+ function NewObject2_getInstance() {
3400
+ if (NewObject2_instance == null)
3401
+ new NewObject2();
3402
+ return NewObject2_instance;
3403
+ }
3404
+ function Type$factory() {
3405
+ return getPropertyCallableRef('Type', 1, KProperty1, function (receiver) {
3406
+ return _get_Type__cwwv8x(receiver);
3407
+ }, null);
3408
+ }
3409
+ function Instance$factory() {
3410
+ return getPropertyCallableRef('Instance', 1, KProperty1, function (receiver) {
3411
+ return _get_Instance__cwfjuy(receiver);
3412
+ }, null);
3413
+ }
3414
+ function _get_B1__ndb8zg($this) {
3415
+ return $this.y3u_1.k1i($this, B1$factory());
3416
+ }
3417
+ function _get_C__7mlnqm_0($this) {
3418
+ return $this.z3u_1.k1i($this, C$factory_0());
3419
+ }
3420
+ function _get_O__7mlo0y($this) {
3421
+ return $this.a3v_1.k1i($this, O$factory());
3422
+ }
3423
+ function _get_P__7mlo1t_2($this) {
3424
+ return $this.b3v_1.k1i($this, P$factory_2());
3425
+ }
3426
+ function Companion_9() {
3427
+ Companion_instance_9 = this;
3428
+ this.c3v_1 = 'property_reduce';
3429
+ this.d3v_1 = 3;
3430
+ }
3431
+ var Companion_instance_9;
3432
+ function Companion_getInstance_29() {
3433
+ if (Companion_instance_9 == null)
3434
+ new Companion_9();
3435
+ return Companion_instance_9;
3436
+ }
3437
+ function Recursive_0() {
3438
+ Recursive_instance_0 = this;
3439
+ PropertyReduce.call(this);
3440
+ this.y3u_1 = this.v2e_1;
3441
+ this.z3u_1 = this.v2e_1;
3442
+ this.a3v_1 = this.v2e_1;
3443
+ this.b3v_1 = this.v2e_1;
3444
+ }
3445
+ Recursive_0.prototype.g2k = function (_this__u8e3s4) {
3446
+ return listOf([_this__u8e3s4.x11([this.j3v(), this.k3v()], _get_C__7mlnqm_0(this)), _get_O__7mlo0y(this), _get_P__7mlo1t_2(this)]);
3447
+ };
3448
+ Recursive_0.prototype.h2k = function (_this__u8e3s4) {
3449
+ var tmp = _this__u8e3s4.atomOf('!');
3450
+ var tmp$ret$0;
3451
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3452
+ var tmp0__get_functor__thl4dk = InvokeMethod_getInstance();
3453
+ tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
3454
+ var tmp_0 = _this__u8e3s4.structOf(tmp$ret$0, [this.j3v(), this.k3v(), _get_B1__ndb8zg(this)]);
3455
+ Companion_getInstance_29();
3456
+ return _this__u8e3s4.tupleOf([tmp, tmp_0, _this__u8e3s4.structOf('property_reduce', [_this__u8e3s4.consOf(_get_B1__ndb8zg(this), _get_C__7mlnqm_0(this)), _get_O__7mlo0y(this), _get_P__7mlo1t_2(this)])]);
3457
+ };
3458
+ var Recursive_instance_0;
3459
+ function Recursive_getInstance_0() {
3460
+ if (Recursive_instance_0 == null)
3461
+ new Recursive_0();
3462
+ return Recursive_instance_0;
3463
+ }
3464
+ function Base() {
3465
+ Base_instance = this;
3466
+ PropertyReduce.call(this);
3467
+ }
3468
+ Base.prototype.g2k = function (_this__u8e3s4) {
3469
+ return listOf([_this__u8e3s4.consOf(this.j3v(), this.k3v()), this.j3v(), this.k3v()]);
3470
+ };
3471
+ var Base_instance;
3472
+ function Base_getInstance() {
3473
+ if (Base_instance == null)
3474
+ new Base();
3475
+ return Base_instance;
3476
+ }
3477
+ function PropertyReduce() {
3478
+ Companion_getInstance_29();
3479
+ Companion_getInstance_29();
3480
+ Companion_getInstance_29();
3481
+ RuleWrapper_init_$Init$('property_reduce', 3, false, 4, null, this);
3482
+ this.h3v_1 = this.v2e_1;
3483
+ this.i3v_1 = this.v2e_1;
3484
+ }
3485
+ PropertyReduce.prototype.j3v = function () {
3486
+ return this.h3v_1.k1i(this, A$factory());
3487
+ };
3488
+ PropertyReduce.prototype.k3v = function () {
3489
+ return this.i3v_1.k1i(this, B$factory());
3490
+ };
3491
+ PropertyReduce.prototype.h2k = function (_this__u8e3s4) {
3492
+ return _this__u8e3s4.atomOf('!');
3493
+ };
3494
+ function A$factory() {
3495
+ return getPropertyCallableRef('A', 1, KProperty1, function (receiver) {
3496
+ return receiver.j3v();
3497
+ }, null);
3498
+ }
3499
+ function B$factory() {
3500
+ return getPropertyCallableRef('B', 1, KProperty1, function (receiver) {
3501
+ return receiver.k3v();
3502
+ }, null);
3503
+ }
3504
+ function B1$factory() {
3505
+ return getPropertyCallableRef('B1', 1, KProperty1, function (receiver) {
3506
+ return _get_B1__ndb8zg(receiver);
3507
+ }, null);
3508
+ }
3509
+ function C$factory_0() {
3510
+ return getPropertyCallableRef('C', 1, KProperty1, function (receiver) {
3511
+ return _get_C__7mlnqm_0(receiver);
3512
+ }, null);
3513
+ }
3514
+ function O$factory() {
3515
+ return getPropertyCallableRef('O', 1, KProperty1, function (receiver) {
3516
+ return _get_O__7mlo0y(receiver);
3517
+ }, null);
3518
+ }
3519
+ function P$factory_2() {
3520
+ return getPropertyCallableRef('P', 1, KProperty1, function (receiver) {
3521
+ return _get_P__7mlo1t_2(receiver);
3522
+ }, null);
3523
+ }
3524
+ function get_platformSpecificAliases() {
3525
+ var tmp$ret$0;
3526
+ // Inline function 'kotlin.emptyArray' call
3527
+ tmp$ret$0 = [];
3528
+ return tmp$ret$0;
3529
+ }
3530
+ function get_TODO_EXCEPTION() {
3531
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3532
+ return TODO_EXCEPTION;
3533
+ }
3534
+ var TODO_EXCEPTION;
3535
+ function get_classNamePattern() {
3536
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3537
+ return classNamePattern;
3538
+ }
3539
+ var classNamePattern;
3540
+ function allSupertypes(_this__u8e3s4, strict) {
3541
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3542
+ throw get_TODO_EXCEPTION();
3543
+ }
3544
+ function get_name(_this__u8e3s4) {
3545
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3546
+ throw get_TODO_EXCEPTION();
3547
+ }
3548
+ function get_fullName(_this__u8e3s4) {
3549
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3550
+ throw get_TODO_EXCEPTION();
3551
+ }
3552
+ function get_identifier(_this__u8e3s4) {
3553
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3554
+ return toString_2(getStringHashCode(get_identifier(_this__u8e3s4)), 16);
3555
+ }
3556
+ function get_companionObjectRef(_this__u8e3s4) {
3557
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3558
+ return Companion_getInstance().oq();
3559
+ }
3560
+ function kClassFromName(qualifiedName) {
3561
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3562
+ var match = get_CLASS_NAME_PATTERN().jf(qualifiedName);
3563
+ // Inline function 'kotlin.require' call
3564
+ var tmp0_require = !(match == null);
3565
+ // Inline function 'kotlin.contracts.contract' call
3566
+ if (!tmp0_require) {
3567
+ var tmp$ret$0;
3568
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.kClassFromName.<anonymous>' call
3569
+ tmp$ret$0 = '`' + qualifiedName + '` should match ' + get_CLASS_NAME_PATTERN().te_1 + ", while is doesn't";
3570
+ var message = tmp$ret$0;
3571
+ throw IllegalArgumentException_init_$Create$(toString_0(message));
3572
+ }
3573
+ var module_0 = ensureNotNull(match.l9().n(1)).qf_1;
3574
+ var tmp = ensureNotNull(match.l9().n(2)).qf_1;
3575
+ var tmp_0 = charArrayOf([_Char___init__impl__6a9atx(46)]);
3576
+ var packageSteps = split$default(tmp, tmp_0, false, 0, 6, null);
3577
+ var kClass = require(module_0);
3578
+ var tmp$ret$1;
3579
+ // Inline function 'kotlin.let' call
3580
+ var tmp1_let = packageSteps.j();
3581
+ // Inline function 'kotlin.contracts.contract' call
3582
+ while ((tmp1_let.m() ? kClass != null : false) ? kClass != undefined : false) {
3583
+ kClass = kClass[tmp1_let.p()];
3584
+ }
3585
+ tmp$ret$1 = Unit_getInstance();
3586
+ var tmp_1;
3587
+ if (kClass != null ? kClass != undefined : false) {
3588
+ var tmp_2 = Companion_getInstance();
3589
+ var tmp$ret$2;
3590
+ // Inline function 'kotlin.js.unsafeCast' call
3591
+ var tmp2_unsafeCast = kClass;
3592
+ tmp$ret$2 = tmp2_unsafeCast;
3593
+ tmp_1 = tmp_2.ft(get_kotlin(tmp$ret$2));
3594
+ } else {
3595
+ tmp_1 = Companion_getInstance().oq();
3596
+ }
3597
+ return tmp_1;
3598
+ }
3599
+ function get_setterMethod(_this__u8e3s4) {
3600
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3601
+ throw get_TODO_EXCEPTION();
3602
+ }
3603
+ function catchingPlatformSpecificException(_this__u8e3s4, instance, action) {
3604
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3605
+ return action();
3606
+ }
3607
+ function invoke_2(_this__u8e3s4, instance, args) {
3608
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3609
+ throw get_TODO_EXCEPTION();
3610
+ }
3611
+ function get_formalParameterTypes(_this__u8e3s4) {
3612
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3613
+ throw get_TODO_EXCEPTION();
3614
+ }
3615
+ function get_CLASS_NAME_PATTERN() {
3616
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3617
+ return get_classNamePattern();
3618
+ }
3619
+ function overloadSelector(type, termToObjectConverter) {
3620
+ init_properties_TypeUtilsJs_kt_pjy9o4();
3621
+ throw get_TODO_EXCEPTION();
3622
+ }
3623
+ var properties_initialized_TypeUtilsJs_kt_h8iecw;
3624
+ function init_properties_TypeUtilsJs_kt_pjy9o4() {
3625
+ if (properties_initialized_TypeUtilsJs_kt_h8iecw) {
3626
+ } else {
3627
+ properties_initialized_TypeUtilsJs_kt_h8iecw = true;
3628
+ TODO_EXCEPTION = new NotImplementedError('OOP-Prolog integration is still not supported on JS');
3629
+ var tmp$ret$0;
3630
+ // Inline function 'kotlin.text.toRegex' call
3631
+ var tmp0_toRegex = '^(' + get_id() + '):(' + get_id() + '(\\.' + get_id() + ')*)$';
3632
+ tmp$ret$0 = Regex_init_$Create$(tmp0_toRegex);
3633
+ classNamePattern = tmp$ret$0;
3634
+ }
3635
+ }
3636
+ //region block: post-declaration
3637
+ OOPLib.prototype.containsSignature = containsSignature;
3638
+ OOPLib.prototype.containsOperator = containsOperator;
3639
+ OOPLib.prototype.hasPrimitive = hasPrimitive;
3640
+ OOPLib.prototype.hasFunction = hasFunction;
3641
+ OOPLib.prototype.j2e = get_ruleSignatures;
3642
+ OOPLib.prototype.hasProtected = hasProtected;
3643
+ NullRefImpl.prototype.i3p = get_object;
3644
+ NullRefImpl.prototype.j3p = invoke;
3645
+ NullRefImpl.prototype.k3p = assign;
3646
+ TermToObjectConverterImpl.prototype.k3q = convert;
3647
+ TypeFactoryImpl.prototype.n3q = typeRefFromName;
3648
+ TypeRefImpl.prototype.o3q = create;
3649
+ //endregion
3650
+ //region block: init
3651
+ id = '[a-zA-Z_][a-zA-Z0-9_]*';
3652
+ //endregion
3653
+ //region block: exports
3654
+ _.$_$ = _.$_$ || {};
3655
+ _.$_$.a = OOPLib_getInstance;
3656
+ //endregion
3657
+ return _;
3658
+ }(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./2p-solve.js'), require('./kt-math.js'), require('./2p-core.js'), require('./2p-utils.js'), require('./2p-unify.js')));
3659
+
3660
+ //# sourceMappingURL=2p-oop-lib.js.map