@tuprolog/2p-full 2.0.5 → 3.0.0

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 (75) hide show
  1. package/2p-bdd.js +172 -172
  2. package/2p-bdd.js.map +1 -1
  3. package/2p-core.js +3599 -3367
  4. package/2p-core.js.map +1 -1
  5. package/2p-datalog.js.map +1 -1
  6. package/2p-dsl-core.js.map +1 -1
  7. package/2p-dsl-solve.js.map +1 -1
  8. package/2p-dsl-theory.js.map +1 -1
  9. package/2p-dsl-unify.js.map +1 -1
  10. package/2p-full.js +20 -11
  11. package/2p-full.js.map +1 -1
  12. package/2p-gui-plp.js.map +1 -1
  13. package/2p-gui.js.map +1 -1
  14. package/2p-ide-web.js.map +1 -1
  15. package/2p-io-lib.js +3699 -5
  16. package/2p-io-lib.js.map +1 -1
  17. package/2p-oop-lib.js +3517 -5
  18. package/2p-oop-lib.js.map +1 -1
  19. package/2p-parser-core.js +616 -5
  20. package/2p-parser-core.js.map +1 -1
  21. package/2p-parser-impl.js +5636 -5
  22. package/2p-parser-impl.js.map +1 -1
  23. package/2p-parser-theory.js +278 -5
  24. package/2p-parser-theory.js.map +1 -1
  25. package/2p-repl.js +536 -5
  26. package/2p-repl.js.map +1 -1
  27. package/2p-serialize-core.js.map +1 -1
  28. package/2p-serialize-theory.js.map +1 -1
  29. package/2p-solve-concurrent.js.map +1 -1
  30. package/2p-solve-plp.js +3 -3
  31. package/2p-solve-plp.js.map +1 -1
  32. package/2p-solve-problog.js +1459 -1453
  33. package/2p-solve-problog.js.map +1 -1
  34. package/2p-solve-prolog.js +2858 -0
  35. package/2p-solve-prolog.js.map +1 -0
  36. package/2p-solve.js +7034 -4765
  37. package/2p-solve.js.map +1 -1
  38. package/2p-test-dsl.js.map +1 -1
  39. package/2p-theory.js +1725 -1725
  40. package/2p-theory.js.map +1 -1
  41. package/2p-unify.js +375 -375
  42. package/2p-unify.js.map +1 -1
  43. package/2p-utils.js +546 -493
  44. package/2p-utils.js.map +1 -1
  45. package/README.md +1 -1
  46. package/clikt-clikt-mordant.js +311 -5
  47. package/clikt-clikt-mordant.js.map +1 -1
  48. package/clikt-clikt.js +6672 -5
  49. package/clikt-clikt.js.map +1 -1
  50. package/colormath-root-colormath.js +1654 -5
  51. package/colormath-root-colormath.js.map +1 -1
  52. package/kotlin-kotlin-stdlib.js +5607 -2742
  53. package/kotlin-kotlin-stdlib.js.map +1 -1
  54. package/kotlin-kotlin-test.js.map +1 -1
  55. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -1
  56. package/kotlinx-atomicfu.js.map +1 -1
  57. package/kotlinx-coroutines-core.js.map +1 -1
  58. package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -1
  59. package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -1
  60. package/kt-math.js +1622 -1614
  61. package/kt-math.js.map +1 -1
  62. package/markdown.js +15 -0
  63. package/markdown.js.map +1 -0
  64. package/mordant-mordant-omnibus.js.map +1 -1
  65. package/mordant-mordant.js +10375 -5
  66. package/mordant-mordant.js.map +1 -1
  67. package/okio-parent-okio-nodefilesystem.js +201 -5
  68. package/okio-parent-okio-nodefilesystem.js.map +1 -1
  69. package/okio-parent-okio.js +3863 -5
  70. package/okio-parent-okio.js.map +1 -1
  71. package/package.json +4 -4
  72. package/2p-solve-classic.js +0 -2834
  73. package/2p-solve-classic.js.map +0 -1
  74. package/2p-solve-streams.js +0 -2661
  75. package/2p-solve-streams.js.map +0 -1
package/2p-oop-lib.js CHANGED
@@ -1,13 +1,3525 @@
1
1
  (function (factory) {
2
2
  if (typeof define === 'function' && define.amd)
3
- define(['exports'], factory);
3
+ define(['exports', './kotlin-kotlin-stdlib.js', './kt-math.js', './2p-solve.js', './2p-core.js', './2p-utils.js', './2p-unify.js'], factory);
4
4
  else if (typeof exports === 'object')
5
- factory(module.exports);
6
- else
7
- globalThis['2p-oop-lib'] = factory(typeof globalThis['2p-oop-lib'] === 'undefined' ? {} : globalThis['2p-oop-lib']);
8
- }(function (_) {
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kt-math.js'), require('./2p-solve.js'), require('./2p-core.js'), require('./2p-utils.js'), require('./2p-unify.js'));
6
+ else {
7
+ if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
8
+ throw new Error("Error loading module '2p-oop-lib'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to '2p-oop-lib'.");
9
+ }
10
+ if (typeof globalThis['kt-math'] === 'undefined') {
11
+ throw new Error("Error loading module '2p-oop-lib'. Its dependency 'kt-math' was not found. Please, check whether 'kt-math' is loaded prior to '2p-oop-lib'.");
12
+ }
13
+ if (typeof globalThis['2p-solve'] === 'undefined') {
14
+ throw new Error("Error loading module '2p-oop-lib'. Its dependency '2p-solve' was not found. Please, check whether '2p-solve' is loaded prior to '2p-oop-lib'.");
15
+ }
16
+ if (typeof globalThis['2p-core'] === 'undefined') {
17
+ throw new Error("Error loading module '2p-oop-lib'. Its dependency '2p-core' was not found. Please, check whether '2p-core' is loaded prior to '2p-oop-lib'.");
18
+ }
19
+ if (typeof globalThis['2p-utils'] === 'undefined') {
20
+ throw new Error("Error loading module '2p-oop-lib'. Its dependency '2p-utils' was not found. Please, check whether '2p-utils' is loaded prior to '2p-oop-lib'.");
21
+ }
22
+ if (typeof globalThis['2p-unify'] === 'undefined') {
23
+ throw new Error("Error loading module '2p-oop-lib'. Its dependency '2p-unify' was not found. Please, check whether '2p-unify' is loaded prior to '2p-oop-lib'.");
24
+ }
25
+ globalThis['2p-oop-lib'] = factory(typeof globalThis['2p-oop-lib'] === 'undefined' ? {} : globalThis['2p-oop-lib'], globalThis['kotlin-kotlin-stdlib'], globalThis['kt-math'], globalThis['2p-solve'], globalThis['2p-core'], globalThis['2p-utils'], globalThis['2p-unify']);
26
+ }
27
+ }(function (_, kotlin_kotlin, kotlin_io_github_gciatto_kt_math, kotlin_it_unibo_tuprolog_solve, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_utils, kotlin_it_unibo_tuprolog_unify) {
9
28
  'use strict';
29
+ //region block: imports
30
+ var NullPointerException_init_$Create$ = kotlin_kotlin.$_$.t1;
31
+ var protoOf = kotlin_kotlin.$_$.s8;
32
+ var initMetadataForInterface = kotlin_kotlin.$_$.e8;
33
+ var VOID = kotlin_kotlin.$_$.b;
34
+ var PrimitiveClasses_getInstance = kotlin_kotlin.$_$.o;
35
+ var KtList = kotlin_kotlin.$_$.e2;
36
+ var getKClass = kotlin_kotlin.$_$.q9;
37
+ var ArrayList = kotlin_kotlin.$_$.a2;
38
+ var KtMap = kotlin_kotlin.$_$.f2;
39
+ var LinkedHashMap = kotlin_kotlin.$_$.c2;
40
+ var Char = kotlin_kotlin.$_$.rd;
41
+ var BigInteger = kotlin_io_github_gciatto_kt_math.$_$.g;
42
+ var BigDecimal = kotlin_io_github_gciatto_kt_math.$_$.f;
43
+ var arrayConcat = kotlin_kotlin.$_$.a;
44
+ var listOf = kotlin_kotlin.$_$.h4;
45
+ var Signature = kotlin_it_unibo_tuprolog_solve.$_$.l4;
46
+ var to = kotlin_kotlin.$_$.we;
47
+ var mapOf = kotlin_kotlin.$_$.k4;
48
+ var AbstractLibrary = kotlin_it_unibo_tuprolog_solve.$_$.w2;
49
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.w2;
50
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.t;
51
+ var Unit_instance = kotlin_kotlin.$_$.r;
52
+ var toMap = kotlin_kotlin.$_$.y5;
53
+ var Specifier_XFY_getInstance = kotlin_it_unibo_tuprolog_core.$_$.c;
54
+ var Operator = kotlin_it_unibo_tuprolog_core.$_$.n1;
55
+ var Specifier_XFX_getInstance = kotlin_it_unibo_tuprolog_core.$_$.b;
56
+ var Specifier_FX_getInstance = kotlin_it_unibo_tuprolog_core.$_$.a;
57
+ var OperatorSet_init_$Create$ = kotlin_it_unibo_tuprolog_core.$_$.j1;
58
+ var asSequence = kotlin_kotlin.$_$.r2;
59
+ var documentationOf = kotlin_it_unibo_tuprolog_solve.$_$.y2;
60
+ var mergeDocumentation = kotlin_it_unibo_tuprolog_solve.$_$.z2;
61
+ var initMetadataForObject = kotlin_kotlin.$_$.g8;
62
+ var getKClassFromExpression = kotlin_kotlin.$_$.p9;
63
+ var initMetadataForCompanion = kotlin_kotlin.$_$.c8;
64
+ var Atom = kotlin_it_unibo_tuprolog_core.$_$.o1;
65
+ var KProperty1 = kotlin_kotlin.$_$.t9;
66
+ var getPropertyCallableRef = kotlin_kotlin.$_$.y7;
67
+ var constructCallableReference = kotlin_kotlin.$_$.r7;
68
+ var isInterface = kotlin_kotlin.$_$.k8;
69
+ var lazy = kotlin_kotlin.$_$.pe;
70
+ var toString = kotlin_kotlin.$_$.ve;
71
+ var hashCode = kotlin_kotlin.$_$.a8;
72
+ var equals = kotlin_kotlin.$_$.t7;
73
+ var initMetadataForClass = kotlin_kotlin.$_$.b8;
74
+ var Companion_instance = kotlin_it_unibo_tuprolog_utils.$_$.e;
75
+ var contains = kotlin_kotlin.$_$.x2;
76
+ var listOf_0 = kotlin_kotlin.$_$.g4;
77
+ var checkIndexOverflow = kotlin_kotlin.$_$.v2;
78
+ var copyToArray = kotlin_kotlin.$_$.g3;
79
+ var toString_0 = kotlin_kotlin.$_$.v8;
80
+ var trimMargin = kotlin_kotlin.$_$.nd;
81
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.j1;
82
+ var setOf = kotlin_kotlin.$_$.g5;
83
+ var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.z;
84
+ var format = kotlin_it_unibo_tuprolog_core.$_$.c3;
85
+ var captureStack = kotlin_kotlin.$_$.j7;
86
+ var Companion_instance_1 = kotlin_it_unibo_tuprolog_solve.$_$.e1;
87
+ var Expected_DEALIASING_EXPRESSION_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.m;
88
+ var charSequenceLength = kotlin_kotlin.$_$.o7;
89
+ var charCodeAt = kotlin_kotlin.$_$.m7;
90
+ var toString_1 = kotlin_kotlin.$_$.h;
91
+ var substring = kotlin_kotlin.$_$.ad;
92
+ var Companion_getInstance = kotlin_it_unibo_tuprolog_unify.$_$.a;
93
+ var Struct = kotlin_it_unibo_tuprolog_core.$_$.z1;
94
+ var Companion_instance_2 = kotlin_it_unibo_tuprolog_solve.$_$.y;
95
+ var ObjectType_OOP_ALIAS_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.h;
96
+ var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.i1;
97
+ var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.l1;
98
+ var objectCreate = kotlin_kotlin.$_$.r8;
99
+ var Companion_instance_3 = kotlin_it_unibo_tuprolog_solve.$_$.b1;
100
+ var Limit_OOP_OBJECT_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.k;
101
+ var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.m;
102
+ var THROW_CCE = kotlin_kotlin.$_$.fe;
103
+ var Term = kotlin_it_unibo_tuprolog_core.$_$.y2;
104
+ var NumberTypeTester = kotlin_it_unibo_tuprolog_utils.$_$.l;
105
+ var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.a1;
106
+ var charArrayOf = kotlin_kotlin.$_$.k7;
107
+ var concatToString = kotlin_kotlin.$_$.rb;
108
+ var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.u;
109
+ var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.r;
110
+ var isNumber = kotlin_kotlin.$_$.l8;
111
+ var Exception = kotlin_kotlin.$_$.wd;
112
+ var Var = kotlin_it_unibo_tuprolog_core.$_$.b3;
113
+ var sequenceOf = kotlin_kotlin.$_$.ab;
114
+ var plus = kotlin_kotlin.$_$.ya;
115
+ var Companion_getInstance_4 = kotlin_io_github_gciatto_kt_math.$_$.e;
116
+ var Companion_getInstance_5 = kotlin_io_github_gciatto_kt_math.$_$.d;
117
+ var compareTo = kotlin_kotlin.$_$.q7;
118
+ var Integer = kotlin_it_unibo_tuprolog_core.$_$.u1;
119
+ var sequenceOf_0 = kotlin_kotlin.$_$.za;
120
+ var Real = kotlin_it_unibo_tuprolog_core.$_$.x1;
121
+ var Truth = kotlin_it_unibo_tuprolog_core.$_$.z2;
122
+ var first = kotlin_kotlin.$_$.ia;
123
+ var toSet = kotlin_kotlin.$_$.jb;
124
+ var Some = kotlin_it_unibo_tuprolog_utils.$_$.m;
125
+ var Companion_getInstance_6 = kotlin_it_unibo_tuprolog_core.$_$.y;
126
+ var Companion_getInstance_7 = kotlin_it_unibo_tuprolog_solve.$_$.n1;
127
+ var Functional = kotlin_it_unibo_tuprolog_solve.$_$.i3;
128
+ var Companion_instance_4 = kotlin_it_unibo_tuprolog_solve.$_$.d1;
129
+ var ResolutionException = kotlin_it_unibo_tuprolog_solve.$_$.t2;
130
+ var Functional_0 = kotlin_it_unibo_tuprolog_solve.$_$.a3;
131
+ var Expected_OBJECT_REFERENCE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.o;
132
+ var map = kotlin_kotlin.$_$.ta;
133
+ var Companion_instance_5 = kotlin_it_unibo_tuprolog_core.$_$.s;
134
+ var List = kotlin_it_unibo_tuprolog_core.$_$.v1;
135
+ var toList = kotlin_kotlin.$_$.hb;
136
+ var isArray = kotlin_kotlin.$_$.h8;
137
+ var asSequence_0 = kotlin_kotlin.$_$.s2;
138
+ var Predicative = kotlin_it_unibo_tuprolog_solve.$_$.k3;
139
+ var TernaryRelation = kotlin_it_unibo_tuprolog_solve.$_$.m3;
140
+ var flatMap = kotlin_kotlin.$_$.ja;
141
+ var distinct = kotlin_kotlin.$_$.ba;
142
+ var TypeTester = kotlin_it_unibo_tuprolog_solve.$_$.n3;
143
+ var Expected_TYPE_REFERENCE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.q;
144
+ var Expected_REFERENCE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.p;
145
+ var Companion_getInstance_8 = kotlin_it_unibo_tuprolog_core.$_$.c1;
146
+ var Companion_getInstance_9 = kotlin_it_unibo_tuprolog_core.$_$.x;
147
+ var filter = kotlin_kotlin.$_$.ga;
148
+ var Sequence = kotlin_kotlin.$_$.v9;
149
+ var firstOrNull = kotlin_kotlin.$_$.ha;
150
+ var Yes = kotlin_it_unibo_tuprolog_solve.$_$.o4;
151
+ var NonBacktrackable = kotlin_it_unibo_tuprolog_solve.$_$.b3;
152
+ var Companion_instance_6 = kotlin_it_unibo_tuprolog_solve.$_$.z;
153
+ var KtSet = kotlin_kotlin.$_$.g2;
154
+ var NonBacktrackable_0 = kotlin_it_unibo_tuprolog_solve.$_$.o3;
155
+ var RuleWrapper = kotlin_it_unibo_tuprolog_solve.$_$.r3;
156
+ var RuleWrapper_init_$Init$ = kotlin_it_unibo_tuprolog_solve.$_$.k2;
157
+ var Var_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.q1;
158
+ var getStringHashCode = kotlin_kotlin.$_$.z7;
159
+ var toString_2 = kotlin_kotlin.$_$.kd;
160
+ var ensureNotNull = kotlin_kotlin.$_$.le;
161
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.c;
162
+ var split = kotlin_kotlin.$_$.tc;
163
+ var get_kotlin = kotlin_kotlin.$_$.m8;
164
+ var NotImplementedError = kotlin_kotlin.$_$.ae;
165
+ var Regex_init_$Create$ = kotlin_kotlin.$_$.z;
166
+ //endregion
10
167
  //region block: pre-declaration
168
+ initMetadataForInterface(Ref, 'Ref', VOID, VOID, [Atom]);
169
+ initMetadataForInterface(ObjectRef, 'ObjectRef', VOID, VOID, [Ref]);
170
+ function get_object() {
171
+ throw NullPointerException_init_$Create$();
172
+ }
173
+ function invoke(objectConverter, methodName, arguments_0) {
174
+ throw NullPointerException_init_$Create$();
175
+ }
176
+ function assign(objectConverter, propertyName, value) {
177
+ throw NullPointerException_init_$Create$();
178
+ }
179
+ initMetadataForInterface(NullRef, 'NullRef', VOID, VOID, [ObjectRef]);
180
+ initMetadataForObject(OOPLib, 'OOPLib', VOID, AbstractLibrary);
181
+ initMetadataForCompanion(Companion);
182
+ initMetadataForCompanion(Companion_0);
183
+ initMetadataForCompanion(Companion_1);
184
+ initMetadataForClass(Result, 'Result');
185
+ initMetadataForClass(Value, 'Value', VOID, Result);
186
+ initMetadataForCompanion(Companion_2);
187
+ function convert(term) {
188
+ return this.convertInto_62bmhg_k$(this.mostAdequateType_bmnk7m_k$(term), term);
189
+ }
190
+ initMetadataForInterface(TermToObjectConverter, 'TermToObjectConverter');
191
+ initMetadataForCompanion(Companion_3);
192
+ function typeRefFromName(typeName) {
193
+ var tmp = Companion_instance.of_f8fyqr_k$(this.typeFromName_xpqoph_k$(typeName));
194
+ return tmp.map_nscup_k$(TypeFactory$typeRefFromName$lambda).get_value_j01efc_k$();
195
+ }
196
+ initMetadataForInterface(TypeFactory, 'TypeFactory');
197
+ initMetadataForCompanion(Companion_4);
198
+ function create(objectConverter, arguments_0) {
199
+ return this.create_1rher4_k$(objectConverter, listOf(arguments_0.slice()));
200
+ }
201
+ initMetadataForInterface(TypeRef, 'TypeRef', VOID, VOID, [Ref]);
202
+ initMetadataForClass(OopException, 'OopException', VOID, TuPrologException);
203
+ initMetadataForClass(MalformedAliasException, 'MalformedAliasException', VOID, OopException);
204
+ initMetadataForClass(NoSuchAnAliasException, 'NoSuchAnAliasException', VOID, OopException);
205
+ initMetadataForCompanion(Companion_5);
206
+ initMetadataForClass(TermToObjectConversionException, 'TermToObjectConversionException', VOID, OopException);
207
+ initMetadataForObject(NullRefImpl, 'NullRefImpl', VOID, VOID, [NullRef, Atom]);
208
+ initMetadataForClass(ObjectRefImpl, 'ObjectRefImpl', VOID, VOID, [ObjectRef, Atom]);
209
+ initMetadataForClass(ObjectToTermConverterImpl, 'ObjectToTermConverterImpl', ObjectToTermConverterImpl);
210
+ initMetadataForClass(TermToObjectConverterImpl, 'TermToObjectConverterImpl', VOID, VOID, [TermToObjectConverter]);
211
+ initMetadataForClass(TypeFactoryImpl, 'TypeFactoryImpl', TypeFactoryImpl, VOID, [TypeFactory]);
212
+ initMetadataForCompanion(Companion_6);
213
+ initMetadataForClass(TypeRefImpl, 'TypeRefImpl', VOID, VOID, [TypeRef, Atom]);
214
+ initMetadataForClass(AbstractInvoke, 'AbstractInvoke', VOID, Functional);
215
+ initMetadataForClass(AbstractIterableItems, 'AbstractIterableItems', VOID, Functional_0);
216
+ initMetadataForObject(ArrayItems, 'ArrayItems', VOID, AbstractIterableItems);
217
+ initMetadataForObject(Assign, 'Assign', VOID, Predicative);
218
+ initMetadataForObject(Cast, 'Cast', VOID, TernaryRelation);
219
+ initMetadataForObject(InvokeMethod, 'InvokeMethod', VOID, AbstractInvoke);
220
+ initMetadataForObject(InvokeStrict, 'InvokeStrict', VOID, AbstractInvoke);
221
+ initMetadataForObject(ListItems, 'ListItems', VOID, AbstractIterableItems);
222
+ initMetadataForObject(NewObject3, 'NewObject3', VOID, Functional);
223
+ initMetadataForObject(NullRef_0, 'NullRef', VOID, TypeTester);
224
+ initMetadataForObject(ObjectRef_0, 'ObjectRef', VOID, TypeTester);
225
+ initMetadataForObject(Ref_0, 'Ref', VOID, TypeTester);
226
+ initMetadataForObject(Register, 'Register', VOID, NonBacktrackable);
227
+ initMetadataForObject(SetItems, 'SetItems', VOID, AbstractIterableItems);
228
+ initMetadataForObject(Type, 'Type', VOID, Functional_0);
229
+ initMetadataForObject(TypeRef_0, 'TypeRef', VOID, TypeTester);
230
+ initMetadataForObject(Unregister, 'Unregister', VOID, NonBacktrackable_0);
231
+ initMetadataForCompanion(Companion_7);
232
+ initMetadataForClass(Alias, 'Alias', VOID, RuleWrapper);
233
+ initMetadataForClass(ColonEquals, 'ColonEquals', VOID, RuleWrapper);
234
+ initMetadataForObject(Cast_0, 'Cast', VOID, ColonEquals);
235
+ initMetadataForObject(Invocation, 'Invocation', VOID, ColonEquals);
236
+ initMetadataForObject(Assignment, 'Assignment', VOID, ColonEquals);
237
+ initMetadataForObject(Dot, 'Dot', VOID, RuleWrapper);
238
+ initMetadataForCompanion(Companion_8);
239
+ initMetadataForClass(FluentReduce, 'FluentReduce', VOID, RuleWrapper);
240
+ initMetadataForObject(Recursive, 'Recursive', VOID, FluentReduce);
241
+ initMetadataForObject(Couple, 'Couple', VOID, FluentReduce);
242
+ initMetadataForObject(Trivial, 'Trivial', VOID, FluentReduce);
243
+ initMetadataForObject(NewObject2, 'NewObject2', VOID, RuleWrapper);
244
+ initMetadataForCompanion(Companion_9);
245
+ initMetadataForClass(PropertyReduce, 'PropertyReduce', VOID, RuleWrapper);
246
+ initMetadataForObject(Recursive_0, 'Recursive', VOID, PropertyReduce);
247
+ initMetadataForObject(Base, 'Base', VOID, PropertyReduce);
248
+ //endregion
249
+ function NullRef() {
250
+ }
251
+ function _get_ruleWrappers__mybpf3($this) {
252
+ return 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_instance_15.forType_lwe2s5_k$('string', PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$()), Companion_instance_15.forType_lwe2s5_k$('array', PrimitiveClasses_getInstance().get_arrayClass_udg0fc_k$()), Companion_instance_15.forType_lwe2s5_k$('list', getKClass(KtList)), Companion_instance_15.forType_lwe2s5_k$('arraylist', getKClass(ArrayList)), Companion_instance_15.forType_lwe2s5_k$('map', getKClass(KtMap)), Companion_instance_15.forType_lwe2s5_k$('hashmap', getKClass(LinkedHashMap)), Companion_instance_15.forType_lwe2s5_k$('int', PrimitiveClasses_getInstance().get_intClass_mw4y9a_k$()), Companion_instance_15.forType_lwe2s5_k$('integer', PrimitiveClasses_getInstance().get_intClass_mw4y9a_k$()), Companion_instance_15.forType_lwe2s5_k$('double', PrimitiveClasses_getInstance().get_doubleClass_dahzcy_k$()), Companion_instance_15.forType_lwe2s5_k$('float', PrimitiveClasses_getInstance().get_floatClass_xlwq2t_k$()), Companion_instance_15.forType_lwe2s5_k$('long', PrimitiveClasses_getInstance().get_longClass_a79cj7_k$()), Companion_instance_15.forType_lwe2s5_k$('short', PrimitiveClasses_getInstance().get_shortClass_5ajsv9_k$()), Companion_instance_15.forType_lwe2s5_k$('byte', PrimitiveClasses_getInstance().get_byteClass_pu7s61_k$()), Companion_instance_15.forType_lwe2s5_k$('char', getKClass(Char)), Companion_instance_15.forType_lwe2s5_k$('bool', PrimitiveClasses_getInstance().get_booleanClass_d285fr_k$()), Companion_instance_15.forType_lwe2s5_k$('boolean', PrimitiveClasses_getInstance().get_booleanClass_d285fr_k$()), Companion_instance_15.forType_lwe2s5_k$('any', PrimitiveClasses_getInstance().get_anyClass_x0jl4l_k$()), Companion_instance_15.forType_lwe2s5_k$('nothing', PrimitiveClasses_getInstance().get_nothingClass_7ivpcc_k$()), Companion_instance_15.forType_lwe2s5_k$('big_integer', getKClass(BigInteger)), Companion_instance_15.forType_lwe2s5_k$('big_decimal', getKClass(BigDecimal))], get_platformSpecificAliases()]));
253
+ }
254
+ function _get_operatorDocumentation__vy55az($this) {
255
+ return mapOf([to(new Signature('$', 1), "`$+Alias`\n\nAlias reference, with no predicate behind it: `$Alias` stands for the object or type reference registered under the atom `Alias` by an `alias/2` fact, i.e. one of the library's default aliases (`string`, `int`, `arraylist`, `stdout`, ...) or one added via `register/2`. It is resolved by the library wherever a reference is expected: as the receiver of `invoke_method/3`, `invoke_strict/3`, `./2` and `:=/2`, as the type of `new_object/2,3` and `cast/3`, as the value of `assign/3`, as the type in `as/2` casts, and inside method or constructor arguments (where it must denote an object). An unregistered alias raises an existence error.\n\n**Examples**\n\n```prolog\n?- $stdout.println(hello).\n% prints: hello\nyes.\n\n?- new_object($arraylist, L), L.add(a), N := L.size.\nN = 1.\n\n?- invoke_method($nope, toString, R).\nthrows error(existence_error(_, _), _).\n```"), to(new Signature('as', 2), "`+Term as +Type`\n\nExplicit conversion, with no predicate behind it. Inside method or constructor arguments (of `invoke_method/3`, `invoke_strict/3`, `new_object/3`, `./2` chains, `*_items/2` lists and `assign/3` values), `Term as Type` converts `Term` into exactly `Type` instead of the automatically inferred type, which also steers overload selection. There `Type` is an atom holding a fully qualified type name (e.g. `'java.lang.Long'`), a type reference, or a `$Alias` reference to a type; if `Term` cannot be represented as `Type`, an error is raised. On the right of `:=/2`, `Result := Term as Type` instead calls `cast/3`, which requires a type reference or a `$Alias`. Since `as` binds tighter than `.`, parenthesise chains: `R := (Obj.size) as $long`.\n\n**Examples**\n\n```prolog\n?- X := $math.max(1 as 'java.lang.Double', 2).\nX = 2.0.\n\n?- new_object('java.util.ArrayList', [], L), L.add(1 as 'java.lang.Long'), A := L.contains(1 as 'java.lang.Long'), B := L.contains(1).\nA = true, B = false.\n\n?- new_object('java.util.ArrayList', [], L), L.add(abc as 'java.lang.Long').\nthrows error(representation_error(_), _).\n```")]);
256
+ }
257
+ function OOPLib() {
258
+ OOPLib_instance = this;
259
+ AbstractLibrary.call(this);
260
+ this.help_1 = "`library('prolog.oop')`\n\nBridges Prolog with the JVM/Kotlin object world via reflection: Prolog code can create objects, call their (possibly overloaded) methods and constructors, read and write their properties, and convert values back and forth. Objects and classes are represented by opaque reference terms (see `object_ref/1`, `type_ref/1`, `null_ref/1`); Prolog atoms, numbers and booleans are converted automatically to and from strings, numbers and booleans.\n\nMain entry points are `new_object/2,3` (instantiation), `invoke_method/3` and `invoke_strict/3` (method calls), `assign/3` (property writes), `cast/3` and `type/2` (types and conversions), `array_items/2`, `list_items/2` and `set_items/2` (collections), and `register/2`/`unregister/1` (aliases, see `alias/2`).\n\nThe operators `./2` (method call or property read, chainable), `:=/2` (capture a result or assign a property), `as/2` (explicit conversion) and `$/1` (alias reference, e.g. `$stdout`) provide a fluent syntax on top of these predicates. Example: `new_object('java.util.ArrayList', [], L), L.add(1 as 'java.lang.Long'), N := L.size, $stdout.println(N)`. Reflective invocation is only available on the JVM.";
261
+ }
262
+ protoOf(OOPLib).get_alias_iooo4n_k$ = function () {
263
+ return 'prolog.oop';
264
+ };
265
+ protoOf(OOPLib).get_help_won7nu_k$ = function () {
266
+ return this.help_1;
267
+ };
268
+ protoOf(OOPLib).get_primitives_xl08ol_k$ = function () {
269
+ // Inline function 'kotlin.collections.map' call
270
+ var this_0 = 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()]);
271
+ // Inline function 'kotlin.collections.mapTo' call
272
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
273
+ var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
274
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
275
+ var item = _iterator__ex2g4s.next_20eer_k$();
276
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.descriptionPair' call
277
+ var tmp$ret$2 = to(item.signature, item.get_wrappedImplementation_qo1fgy_k$());
278
+ destination.add_utx5q5_k$(tmp$ret$2);
279
+ }
280
+ return toMap(destination);
281
+ };
282
+ protoOf(OOPLib).get_clauses_fdta0r_k$ = function () {
283
+ // Inline function 'kotlin.collections.map' call
284
+ var this_0 = _get_ruleWrappers__mybpf3(this);
285
+ // Inline function 'kotlin.collections.mapTo' call
286
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
287
+ var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
288
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
289
+ var item = _iterator__ex2g4s.next_20eer_k$();
290
+ var tmp$ret$2 = item.get_wrappedImplementation_qo1fgy_k$();
291
+ destination.add_utx5q5_k$(tmp$ret$2);
292
+ }
293
+ return destination;
294
+ };
295
+ protoOf(OOPLib).get_operators_z0nmfu_k$ = function () {
296
+ 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)]);
297
+ };
298
+ protoOf(OOPLib).get_documentation_p1cqdt_k$ = function () {
299
+ return mergeDocumentation([protoOf(AbstractLibrary).get_documentation_p1cqdt_k$.call(this), documentationOf(asSequence(_get_ruleWrappers__mybpf3(this))), _get_operatorDocumentation__vy55az(this)]);
300
+ };
301
+ var OOPLib_instance;
302
+ function OOPLib_getInstance() {
303
+ if (OOPLib_instance == null)
304
+ new OOPLib();
305
+ return OOPLib_instance;
306
+ }
307
+ function nameOf($this, type, identifier) {
308
+ return '<object:' + get_fullName(type) + '#' + identifier + '>';
309
+ }
310
+ function Companion() {
311
+ Companion_instance_7 = this;
312
+ this.NULL_1 = NullRefImpl_getInstance();
313
+ }
314
+ protoOf(Companion).nameOf_kdy799_k$ = function (any) {
315
+ return any == null ? nameOf(this, PrimitiveClasses_getInstance().get_nothingClass_7ivpcc_k$(), 'null') : nameOf(this, getKClassFromExpression(any), get_identifier(any));
316
+ };
317
+ protoOf(Companion).of_u40ndk_k$ = function (any) {
318
+ return any == null ? this.NULL_1 : new ObjectRefImpl(any);
319
+ };
320
+ var Companion_instance_7;
321
+ function Companion_getInstance_10() {
322
+ if (Companion_instance_7 == null)
323
+ new Companion();
324
+ return Companion_instance_7;
325
+ }
326
+ function ObjectRef() {
327
+ }
328
+ function Companion_0() {
329
+ Companion_instance_8 = this;
330
+ this.default_1 = new ObjectToTermConverterImpl();
331
+ }
332
+ var Companion_instance_8;
333
+ function Companion_getInstance_11() {
334
+ if (Companion_instance_8 == null)
335
+ new Companion_0();
336
+ return Companion_instance_8;
337
+ }
338
+ function Companion_1() {
339
+ }
340
+ protoOf(Companion_1).of_m6gyn8_k$ = function (type, termToObjectConverter) {
341
+ return overloadSelector(type, termToObjectConverter);
342
+ };
343
+ var Companion_instance_9;
344
+ function Companion_getInstance_12() {
345
+ return Companion_instance_9;
346
+ }
347
+ function Ref() {
348
+ }
349
+ function _get_termValue__ikgccs($this) {
350
+ var tmp0 = $this.termValue$delegate_1;
351
+ var tmp = KProperty1;
352
+ // Inline function 'kotlin.getValue' call
353
+ getPropertyCallableRef('termValue', 1, tmp, Result$Value$_get_termValue_$ref_u3cirl(), null);
354
+ return tmp0.get_value_j01efc_k$();
355
+ }
356
+ function _get_objectRef__3zhern($this) {
357
+ var tmp0 = $this.objectRef$delegate_1;
358
+ var tmp = KProperty1;
359
+ // Inline function 'kotlin.getValue' call
360
+ getPropertyCallableRef('objectRef', 1, tmp, Result$Value$_get_objectRef_$ref_8a6ozy(), null);
361
+ return tmp0.get_value_j01efc_k$();
362
+ }
363
+ function Result$Value$termValue$delegate$lambda(this$0) {
364
+ return function () {
365
+ return Companion_getInstance_11().default_1.convert_2fnsng_k$(this$0.value_1);
366
+ };
367
+ }
368
+ function Result$Value$_get_termValue_$ref_u3cirl() {
369
+ return constructCallableReference(function (p0) {
370
+ return _get_termValue__ikgccs(p0);
371
+ }, 1, 0, 130);
372
+ }
373
+ function Result$Value$objectRef$delegate$lambda(this$0) {
374
+ return function () {
375
+ // Inline function 'kotlin.let' call
376
+ var it = _get_termValue__ikgccs(this$0);
377
+ var tmp;
378
+ if (isInterface(it, ObjectRef)) {
379
+ tmp = it;
380
+ } else {
381
+ tmp = Companion_getInstance_10().of_u40ndk_k$(this$0.value_1);
382
+ }
383
+ return tmp;
384
+ };
385
+ }
386
+ function Result$Value$_get_objectRef_$ref_8a6ozy() {
387
+ return constructCallableReference(function (p0) {
388
+ return _get_objectRef__3zhern(p0);
389
+ }, 1, 0, 131);
390
+ }
391
+ function Value(value) {
392
+ Result.call(this);
393
+ this.value_1 = value;
394
+ var tmp = this;
395
+ tmp.termValue$delegate_1 = lazy(Result$Value$termValue$delegate$lambda(this));
396
+ var tmp_0 = this;
397
+ tmp_0.objectRef$delegate_1 = lazy(Result$Value$objectRef$delegate$lambda(this));
398
+ }
399
+ protoOf(Value).toTerm_edaxrt_k$ = function () {
400
+ return _get_termValue__ikgccs(this);
401
+ };
402
+ protoOf(Value).toTerm = function () {
403
+ return this.toTerm_edaxrt_k$();
404
+ };
405
+ protoOf(Value).asObjectRef_ji97lu_k$ = function () {
406
+ return _get_objectRef__3zhern(this);
407
+ };
408
+ protoOf(Value).toString = function () {
409
+ return 'Value(value=' + toString(this.value_1) + ')';
410
+ };
411
+ protoOf(Value).hashCode = function () {
412
+ return this.value_1 == null ? 0 : hashCode(this.value_1);
413
+ };
414
+ protoOf(Value).equals = function (other) {
415
+ if (this === other)
416
+ return true;
417
+ if (!(other instanceof Value))
418
+ return false;
419
+ if (!equals(this.value_1, other.value_1))
420
+ return false;
421
+ return true;
422
+ };
423
+ function Result() {
424
+ }
425
+ function TermToObjectConverter$Companion$of$lambda(it) {
426
+ return null;
427
+ }
428
+ function Companion_2() {
429
+ Companion_instance_10 = this;
430
+ this.default_1 = this.of$default_5ni81d_k$();
431
+ }
432
+ protoOf(Companion_2).of_77qmvk_k$ = function (typeFactory, dealiaser) {
433
+ return new TermToObjectConverterImpl(typeFactory, dealiaser);
434
+ };
435
+ protoOf(Companion_2).of$default_5ni81d_k$ = function (typeFactory, dealiaser, $super) {
436
+ typeFactory = typeFactory === VOID ? Companion_getInstance_14().default_1 : typeFactory;
437
+ var tmp;
438
+ if (dealiaser === VOID) {
439
+ tmp = TermToObjectConverter$Companion$of$lambda;
440
+ } else {
441
+ tmp = dealiaser;
442
+ }
443
+ dealiaser = tmp;
444
+ return $super === VOID ? this.of_77qmvk_k$(typeFactory, dealiaser) : $super.of_77qmvk_k$.call(this, typeFactory, dealiaser);
445
+ };
446
+ var Companion_instance_10;
447
+ function Companion_getInstance_13() {
448
+ if (Companion_instance_10 == null)
449
+ new Companion_2();
450
+ return Companion_instance_10;
451
+ }
452
+ function TermToObjectConverter() {
453
+ }
454
+ function Companion_3() {
455
+ Companion_instance_11 = this;
456
+ this.default_1 = new TypeFactoryImpl();
457
+ }
458
+ var Companion_instance_11;
459
+ function Companion_getInstance_14() {
460
+ if (Companion_instance_11 == null)
461
+ new Companion_3();
462
+ return Companion_instance_11;
463
+ }
464
+ function TypeFactory$typeRefFromName$lambda(it) {
465
+ return Companion_instance_12.of_7pw7zp_k$(it);
466
+ }
467
+ function TypeFactory() {
468
+ }
469
+ function Companion_4() {
470
+ }
471
+ protoOf(Companion_4).of_7pw7zp_k$ = function (type) {
472
+ return new TypeRefImpl(type);
473
+ };
474
+ var Companion_instance_12;
475
+ function Companion_getInstance_15() {
476
+ return Companion_instance_12;
477
+ }
478
+ function TypeRef() {
479
+ }
480
+ function get_PRIMITIVE_TYPES() {
481
+ _init_properties_TypeUtils_kt__wnsx0l();
482
+ return PRIMITIVE_TYPES;
483
+ }
484
+ var PRIMITIVE_TYPES;
485
+ function get_isPrimitiveType(_this__u8e3s4) {
486
+ _init_properties_TypeUtils_kt__wnsx0l();
487
+ return contains(get_PRIMITIVE_TYPES(), _this__u8e3s4);
488
+ }
489
+ function isSubtypeOf(_this__u8e3s4, other) {
490
+ _init_properties_TypeUtils_kt__wnsx0l();
491
+ return isSubtypeOf_0(_this__u8e3s4, other, false);
492
+ }
493
+ function create_0(_this__u8e3s4, objectConverter, arguments_0) {
494
+ _init_properties_TypeUtils_kt__wnsx0l();
495
+ var constructorRef = Companion_instance_9.of_m6gyn8_k$(_this__u8e3s4, objectConverter).findConstructor_3gpb1g_k$(arguments_0);
496
+ return callWithPrologArguments(constructorRef, objectConverter, arguments_0);
497
+ }
498
+ function invoke_0(_this__u8e3s4, objectConverter, methodName, arguments_0) {
499
+ _init_properties_TypeUtils_kt__wnsx0l();
500
+ return invoke_1(getKClassFromExpression(_this__u8e3s4), objectConverter, methodName, arguments_0, _this__u8e3s4);
501
+ }
502
+ function invoke_1(_this__u8e3s4, objectConverter, methodName, arguments_0, instance) {
503
+ _init_properties_TypeUtils_kt__wnsx0l();
504
+ var methodRef = Companion_instance_9.of_m6gyn8_k$(_this__u8e3s4, objectConverter).findMethod_jqoe5h_k$(methodName, arguments_0);
505
+ return callWithPrologArguments(methodRef, objectConverter, arguments_0, instance);
506
+ }
507
+ function assign_0(_this__u8e3s4, objectConverter, propertyName, value) {
508
+ _init_properties_TypeUtils_kt__wnsx0l();
509
+ return assign_1(getKClassFromExpression(_this__u8e3s4), objectConverter, propertyName, value, _this__u8e3s4);
510
+ }
511
+ function assign_1(_this__u8e3s4, objectConverter, propertyName, value, instance) {
512
+ _init_properties_TypeUtils_kt__wnsx0l();
513
+ var setterRef = get_setterMethod(Companion_instance_9.of_m6gyn8_k$(_this__u8e3s4, objectConverter).findProperty_xjxstt_k$(propertyName, value));
514
+ return callWithPrologArguments(setterRef, objectConverter, listOf_0(value), instance);
515
+ }
516
+ function isSubtypeOf_0(_this__u8e3s4, other, strict) {
517
+ _init_properties_TypeUtils_kt__wnsx0l();
518
+ return isSupertypeOf(other, _this__u8e3s4, strict);
519
+ }
520
+ function callWithPrologArguments(_this__u8e3s4, converter, arguments_0, instance) {
521
+ instance = instance === VOID ? null : instance;
522
+ _init_properties_TypeUtils_kt__wnsx0l();
523
+ var formalArgumentsTypes = ensureArgumentsListIsOfSize(_this__u8e3s4, arguments_0);
524
+ // Inline function 'kotlin.collections.mapIndexed' call
525
+ // Inline function 'kotlin.collections.mapIndexedTo' call
526
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(arguments_0, 10));
527
+ var index = 0;
528
+ var _iterator__ex2g4s = arguments_0.iterator_jk1svi_k$();
529
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
530
+ var item = _iterator__ex2g4s.next_20eer_k$();
531
+ var _unary__edvuaz = index;
532
+ index = _unary__edvuaz + 1 | 0;
533
+ var i = checkIndexOverflow(_unary__edvuaz);
534
+ var tmp$ret$2 = converter.convertInto_62bmhg_k$(formalArgumentsTypes.get_c1px32_k$(i), item);
535
+ destination.add_utx5q5_k$(tmp$ret$2);
536
+ }
537
+ // Inline function 'kotlin.collections.toTypedArray' call
538
+ var args = copyToArray(destination);
539
+ return catchingPlatformSpecificException(_this__u8e3s4, instance, callWithPrologArguments$lambda(_this__u8e3s4, instance, args));
540
+ }
541
+ function isSupertypeOf(_this__u8e3s4, other, strict) {
542
+ _init_properties_TypeUtils_kt__wnsx0l();
543
+ var tmp0 = allSupertypes(other, strict);
544
+ var tmp$ret$0;
545
+ $l$block: {
546
+ // Inline function 'kotlin.sequences.any' call
547
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
548
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
549
+ var element = _iterator__ex2g4s.next_20eer_k$();
550
+ if (element.equals(_this__u8e3s4)) {
551
+ tmp$ret$0 = true;
552
+ break $l$block;
553
+ }
554
+ }
555
+ tmp$ret$0 = false;
556
+ }
557
+ return tmp$ret$0;
558
+ }
559
+ function ensureArgumentsListIsOfSize(_this__u8e3s4, actualArguments) {
560
+ _init_properties_TypeUtils_kt__wnsx0l();
561
+ // Inline function 'kotlin.also' call
562
+ var this_0 = get_formalParameterTypes(_this__u8e3s4);
563
+ // Inline function 'kotlin.require' call
564
+ if (!(get_formalParameterTypes(_this__u8e3s4).get_size_woubt6_k$() === actualArguments.get_size_woubt6_k$())) {
565
+ var tmp = _this__u8e3s4.callableName;
566
+ // Inline function 'kotlin.collections.map' call
567
+ // Inline function 'kotlin.collections.mapTo' call
568
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
569
+ var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
570
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
571
+ var item = _iterator__ex2g4s.next_20eer_k$();
572
+ var tmp$ret$6 = get_name(item);
573
+ destination.add_utx5q5_k$(tmp$ret$6);
574
+ }
575
+ var message = trimMargin('\n |\n |Error while invoking ' + tmp + ' the expected argument types \n | ' + toString_0(destination) + ' \n |are not as many as the as the actual parameters (' + this_0.get_size_woubt6_k$() + ' vs. ' + actualArguments.get_size_woubt6_k$() + '):\n | ' + toString_0(actualArguments) + '\n |\n ');
576
+ throw IllegalArgumentException_init_$Create$(toString_0(message));
577
+ }
578
+ return this_0;
579
+ }
580
+ function callWithPrologArguments$lambda($this_callWithPrologArguments, $instance, $args) {
581
+ return function () {
582
+ var result = invoke_2($this_callWithPrologArguments, $instance, $args.slice());
583
+ return new Value(result);
584
+ };
585
+ }
586
+ var properties_initialized_TypeUtils_kt_7pe6qv;
587
+ function _init_properties_TypeUtils_kt__wnsx0l() {
588
+ if (!properties_initialized_TypeUtils_kt_7pe6qv) {
589
+ properties_initialized_TypeUtils_kt_7pe6qv = true;
590
+ PRIMITIVE_TYPES = setOf([PrimitiveClasses_getInstance().get_longClass_a79cj7_k$(), PrimitiveClasses_getInstance().get_intClass_mw4y9a_k$(), PrimitiveClasses_getInstance().get_shortClass_5ajsv9_k$(), PrimitiveClasses_getInstance().get_byteClass_pu7s61_k$(), getKClass(Char), PrimitiveClasses_getInstance().get_doubleClass_dahzcy_k$(), PrimitiveClasses_getInstance().get_floatClass_xlwq2t_k$()]);
591
+ }
592
+ }
593
+ function MalformedAliasException(dealiasingExpression) {
594
+ OopException_init_$Init$('This is not a dealiasing expression `' + dealiasingExpression.toString() + '` in the form ' + format(get_DEALIASING_TEMPLATE(), Companion_instance_0.prettyExpressionsPrettyVariablesDefaultOperators()), VOID, this);
595
+ captureStack(this, MalformedAliasException);
596
+ this.dealiasingExpression_1 = dealiasingExpression;
597
+ }
598
+ protoOf(MalformedAliasException).toLogicError_fiiu4e_k$ = function (context, signature) {
599
+ var tmp = Companion_instance_1;
600
+ var tmp_0 = Expected_DEALIASING_EXPRESSION_getInstance();
601
+ var tmp_1 = this.get_culprit_jt6eim_k$();
602
+ var tmp_2 = signature.toIndicator().toString();
603
+ var tmp0_safe_receiver = this.message;
604
+ var tmp_3;
605
+ if (tmp0_safe_receiver == null) {
606
+ tmp_3 = null;
607
+ } else {
608
+ // Inline function 'kotlin.text.replaceFirstChar' call
609
+ var tmp_4;
610
+ // Inline function 'kotlin.text.isNotEmpty' call
611
+ if (charSequenceLength(tmp0_safe_receiver) > 0) {
612
+ // Inline function 'kotlin.text.lowercase' call
613
+ var this_0 = charCodeAt(tmp0_safe_receiver, 0);
614
+ // Inline function 'kotlin.js.asDynamic' call
615
+ // Inline function 'kotlin.js.unsafeCast' call
616
+ var tmp$ret$2 = toString_1(this_0).toLowerCase();
617
+ tmp_4 = toString_0(tmp$ret$2) + substring(tmp0_safe_receiver, 1);
618
+ } else {
619
+ tmp_4 = tmp0_safe_receiver;
620
+ }
621
+ tmp_3 = tmp_4;
622
+ }
623
+ return tmp.of(context, tmp_0, tmp_1, 'Error in ' + tmp_2 + ': ' + tmp_3);
624
+ };
625
+ protoOf(MalformedAliasException).get_culprit_jt6eim_k$ = function () {
626
+ return this.dealiasingExpression_1;
627
+ };
628
+ function NoSuchAnAliasException(dealiasingExpression) {
629
+ OopException_init_$Init$('There exists no reference whose alias is `' + dealiasingExpression.get(0).toString() + '`', VOID, this);
630
+ captureStack(this, NoSuchAnAliasException);
631
+ this.dealiasingExpression_1 = dealiasingExpression;
632
+ // Inline function 'kotlin.require' call
633
+ // Inline function 'kotlin.require' call
634
+ if (!Companion_getInstance().matches(this.dealiasingExpression_1, get_DEALIASING_TEMPLATE())) {
635
+ var message = 'Failed requirement.';
636
+ throw IllegalArgumentException_init_$Create$(toString_0(message));
637
+ }
638
+ var tmp = this.dealiasingExpression_1.get(0);
639
+ // Inline function 'kotlin.require' call
640
+ // Inline function 'kotlin.require' call
641
+ if (!isInterface(tmp, Struct)) {
642
+ var message_0 = 'Failed requirement.';
643
+ throw IllegalArgumentException_init_$Create$(toString_0(message_0));
644
+ }
645
+ }
646
+ protoOf(NoSuchAnAliasException).toLogicError_fiiu4e_k$ = function (context, signature) {
647
+ var tmp = Companion_instance_2;
648
+ var tmp_0 = ObjectType_OOP_ALIAS_getInstance();
649
+ var tmp_1 = this.get_culprit_jt6eim_k$();
650
+ var tmp0_elvis_lhs = this.message;
651
+ return tmp.of(context, tmp_0, tmp_1, tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs);
652
+ };
653
+ protoOf(NoSuchAnAliasException).get_culprit_jt6eim_k$ = function () {
654
+ return this.dealiasingExpression_1;
655
+ };
656
+ function OopException_init_$Init$(message, cause, $this) {
657
+ message = message === VOID ? null : message;
658
+ cause = cause === VOID ? null : cause;
659
+ TuPrologException_init_$Init$(message, cause, $this);
660
+ OopException.call($this);
661
+ return $this;
662
+ }
663
+ function Companion_5() {
664
+ }
665
+ var Companion_instance_13;
666
+ function Companion_getInstance_16() {
667
+ return Companion_instance_13;
668
+ }
669
+ function OopException() {
670
+ captureStack(this, OopException);
671
+ }
672
+ function TermToObjectConversionException_init_$Init$(term, $this) {
673
+ TermToObjectConversionException.call($this, term, null);
674
+ return $this;
675
+ }
676
+ function TermToObjectConversionException_init_$Create$(term) {
677
+ var tmp = TermToObjectConversionException_init_$Init$(term, objectCreate(protoOf(TermToObjectConversionException)));
678
+ captureStack(tmp, TermToObjectConversionException_init_$Create$);
679
+ return tmp;
680
+ }
681
+ function TermToObjectConversionException(term, targetType) {
682
+ targetType = targetType === VOID ? null : targetType;
683
+ var tmp;
684
+ if (targetType == null) {
685
+ tmp = null;
686
+ } else {
687
+ // Inline function 'kotlin.let' call
688
+ tmp = 'Term `' + term.toString() + '` cannot be converted into an object of type ' + get_fullName(targetType);
689
+ }
690
+ var tmp1_elvis_lhs = tmp;
691
+ OopException_init_$Init$(tmp1_elvis_lhs == null ? 'Term `' + term.toString() + '` cannot be converted into an object' : tmp1_elvis_lhs, VOID, this);
692
+ captureStack(this, TermToObjectConversionException);
693
+ this.term_1 = term;
694
+ this.targetType_1 = targetType;
695
+ }
696
+ protoOf(TermToObjectConversionException).toLogicError_fiiu4e_k$ = function (context, signature) {
697
+ return Companion_instance_3.of_nfh9rh_k$(context, signature, Limit_OOP_OBJECT_getInstance(), this);
698
+ };
699
+ function NullRefImpl() {
700
+ NullRefImpl_instance = this;
701
+ this.$$delegate_0__1 = Companion_getInstance_0().of(Companion_getInstance_10().nameOf_kdy799_k$(null));
702
+ }
703
+ protoOf(NullRefImpl).get_isConstant_scia2f_k$ = function () {
704
+ return true;
705
+ };
706
+ protoOf(NullRefImpl).asConstant_3hn112_k$ = function () {
707
+ return this;
708
+ };
709
+ protoOf(NullRefImpl).asConstant = function () {
710
+ return this.asConstant_3hn112_k$();
711
+ };
712
+ protoOf(NullRefImpl).freshCopy_fcm65_k$ = function () {
713
+ return this;
714
+ };
715
+ protoOf(NullRefImpl).freshCopy = function () {
716
+ return this.freshCopy_fcm65_k$();
717
+ };
718
+ protoOf(NullRefImpl).freshCopyFromScope_tnhsyi_k$ = function (scope) {
719
+ return this;
720
+ };
721
+ protoOf(NullRefImpl).freshCopyFromScope = function (scope) {
722
+ return this.freshCopyFromScope_tnhsyi_k$(scope);
723
+ };
724
+ protoOf(NullRefImpl).castTo_8vzplt_k$ = function () {
725
+ return isInterface(this, Term) ? this : THROW_CCE();
726
+ };
727
+ protoOf(NullRefImpl).castTo_mm7cm3_k$ = function () {
728
+ return this.castTo_8vzplt_k$();
729
+ };
730
+ protoOf(NullRefImpl).applySubstitution_t7osbf_k$ = function (substitution) {
731
+ return this;
732
+ };
733
+ protoOf(NullRefImpl).applySubstitution = function (substitution) {
734
+ return this.applySubstitution_t7osbf_k$(substitution);
735
+ };
736
+ protoOf(NullRefImpl).apply_jso7fw_k$ = function (substitution, substitutions) {
737
+ return this;
738
+ };
739
+ protoOf(NullRefImpl).apply = function (substitution, substitutions) {
740
+ return this.apply_jso7fw_k$(substitution, substitutions);
741
+ };
742
+ protoOf(NullRefImpl).getSubstituted_8310r6_k$ = function (substitution, substitutions) {
743
+ return this;
744
+ };
745
+ protoOf(NullRefImpl).getSubstituted = function (substitution, substitutions) {
746
+ return this.getSubstituted_8310r6_k$(substitution, substitutions);
747
+ };
748
+ protoOf(NullRefImpl).accept_bf9pe1_k$ = function (visitor) {
749
+ return visitor.visitAtom(this);
750
+ };
751
+ protoOf(NullRefImpl).accept = function (visitor) {
752
+ return this.accept_bf9pe1_k$(visitor);
753
+ };
754
+ protoOf(NullRefImpl).asAtom_nbael9_k$ = function () {
755
+ return this.$$delegate_0__1.asAtom_nbael9_k$();
756
+ };
757
+ protoOf(NullRefImpl).asAtom = function () {
758
+ return this.asAtom_nbael9_k$();
759
+ };
760
+ protoOf(NullRefImpl).get_arity_iosiic_k$ = function () {
761
+ return this.$$delegate_0__1.get_arity_iosiic_k$();
762
+ };
763
+ protoOf(NullRefImpl).get_isAtom_evuq3o_k$ = function () {
764
+ return this.$$delegate_0__1.get_isAtom_evuq3o_k$();
765
+ };
766
+ protoOf(NullRefImpl).get_isEmptyBlock_mhm4pf_k$ = function () {
767
+ return this.$$delegate_0__1.get_isEmptyBlock_mhm4pf_k$();
768
+ };
769
+ protoOf(NullRefImpl).get_isEmptyList_9w8q3c_k$ = function () {
770
+ return this.$$delegate_0__1.get_isEmptyList_9w8q3c_k$();
771
+ };
772
+ protoOf(NullRefImpl).get_isTrue_ew6ti9_k$ = function () {
773
+ return this.$$delegate_0__1.get_isTrue_ew6ti9_k$();
774
+ };
775
+ protoOf(NullRefImpl).get_value_j01efc_k$ = function () {
776
+ return this.$$delegate_0__1.get_value_j01efc_k$();
777
+ };
778
+ protoOf(NullRefImpl).get_argsList_cw1bs4_k$ = function () {
779
+ return this.$$delegate_0__1.get_argsList_cw1bs4_k$();
780
+ };
781
+ protoOf(NullRefImpl).get_variables_75f0zy_k$ = function () {
782
+ return this.$$delegate_0__1.get_variables_75f0zy_k$();
783
+ };
784
+ protoOf(NullRefImpl).asStruct_l3eul5_k$ = function () {
785
+ return this.$$delegate_0__1.asStruct_l3eul5_k$();
786
+ };
787
+ protoOf(NullRefImpl).asStruct = function () {
788
+ return this.asStruct_l3eul5_k$();
789
+ };
790
+ protoOf(NullRefImpl).append = function (argument) {
791
+ return this.$$delegate_0__1.append(argument);
792
+ };
793
+ protoOf(NullRefImpl).addLast = function (argument) {
794
+ return this.$$delegate_0__1.addLast(argument);
795
+ };
796
+ protoOf(NullRefImpl).addFirst = function (argument) {
797
+ return this.$$delegate_0__1.addFirst(argument);
798
+ };
799
+ protoOf(NullRefImpl).insertAt = function (index, argument) {
800
+ return this.$$delegate_0__1.insertAt(index, argument);
801
+ };
802
+ protoOf(NullRefImpl).setFunctor = function (functor) {
803
+ return this.$$delegate_0__1.setFunctor(functor);
804
+ };
805
+ protoOf(NullRefImpl).getArgAt = function (index) {
806
+ return this.$$delegate_0__1.getArgAt(index);
807
+ };
808
+ protoOf(NullRefImpl).setArgs = function (args) {
809
+ return this.$$delegate_0__1.setArgs(args);
810
+ };
811
+ protoOf(NullRefImpl).setArgsIterable = function (args) {
812
+ return this.$$delegate_0__1.setArgsIterable(args);
813
+ };
814
+ protoOf(NullRefImpl).setArgsSequence = function (args) {
815
+ return this.$$delegate_0__1.setArgsSequence(args);
816
+ };
817
+ protoOf(NullRefImpl).get = function (index) {
818
+ return this.$$delegate_0__1.get(index);
819
+ };
820
+ protoOf(NullRefImpl).get_isStruct_zeoyoo_k$ = function () {
821
+ return this.$$delegate_0__1.get_isStruct_zeoyoo_k$();
822
+ };
823
+ protoOf(NullRefImpl).get_isClause_rwzxtu_k$ = function () {
824
+ return this.$$delegate_0__1.get_isClause_rwzxtu_k$();
825
+ };
826
+ protoOf(NullRefImpl).get_isRule_ew5ljj_k$ = function () {
827
+ return this.$$delegate_0__1.get_isRule_ew5ljj_k$();
828
+ };
829
+ protoOf(NullRefImpl).get_isTuple_zhv5m3_k$ = function () {
830
+ return this.$$delegate_0__1.get_isTuple_zhv5m3_k$();
831
+ };
832
+ protoOf(NullRefImpl).get_isList_ew1iwh_k$ = function () {
833
+ return this.$$delegate_0__1.get_isList_ew1iwh_k$();
834
+ };
835
+ protoOf(NullRefImpl).get_isCons_evvwck_k$ = function () {
836
+ return this.$$delegate_0__1.get_isCons_evvwck_k$();
837
+ };
838
+ protoOf(NullRefImpl).get_isIndicator_llw8m4_k$ = function () {
839
+ return this.$$delegate_0__1.get_isIndicator_llw8m4_k$();
840
+ };
841
+ protoOf(NullRefImpl).get_functor_75vgt2_k$ = function () {
842
+ return this.$$delegate_0__1.get_functor_75vgt2_k$();
843
+ };
844
+ protoOf(NullRefImpl).get_isFunctorWellFormed_fgwhjl_k$ = function () {
845
+ return this.$$delegate_0__1.get_isFunctorWellFormed_fgwhjl_k$();
846
+ };
847
+ protoOf(NullRefImpl).get_indicator_39dti2_k$ = function () {
848
+ return this.$$delegate_0__1.get_indicator_39dti2_k$();
849
+ };
850
+ protoOf(NullRefImpl).get_argsSequence_z7gge1_k$ = function () {
851
+ return this.$$delegate_0__1.get_argsSequence_z7gge1_k$();
852
+ };
853
+ protoOf(NullRefImpl).compareTo_kfa5id_k$ = function (other) {
854
+ return this.$$delegate_0__1.compareTo_kfa5id_k$(other);
855
+ };
856
+ protoOf(NullRefImpl).compareTo_hpufkf_k$ = function (other) {
857
+ return this.compareTo_kfa5id_k$((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
858
+ };
859
+ protoOf(NullRefImpl).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
860
+ return this.$$delegate_0__1.equalsUsingVarCompleteNames(other, useVarCompleteName);
861
+ };
862
+ protoOf(NullRefImpl).equals = function (other) {
863
+ return this.$$delegate_0__1.equals(other);
864
+ };
865
+ protoOf(NullRefImpl).structurallyEquals = function (other) {
866
+ return this.$$delegate_0__1.structurallyEquals(other);
867
+ };
868
+ protoOf(NullRefImpl).castToAtom = function () {
869
+ return this.$$delegate_0__1.castToAtom();
870
+ };
871
+ protoOf(NullRefImpl).castToClause = function () {
872
+ return this.$$delegate_0__1.castToClause();
873
+ };
874
+ protoOf(NullRefImpl).castToCons = function () {
875
+ return this.$$delegate_0__1.castToCons();
876
+ };
877
+ protoOf(NullRefImpl).castToConstant = function () {
878
+ return this.$$delegate_0__1.castToConstant();
879
+ };
880
+ protoOf(NullRefImpl).castToDirective = function () {
881
+ return this.$$delegate_0__1.castToDirective();
882
+ };
883
+ protoOf(NullRefImpl).castToEmptyList = function () {
884
+ return this.$$delegate_0__1.castToEmptyList();
885
+ };
886
+ protoOf(NullRefImpl).castToEmptyBlock = function () {
887
+ return this.$$delegate_0__1.castToEmptyBlock();
888
+ };
889
+ protoOf(NullRefImpl).castToFact = function () {
890
+ return this.$$delegate_0__1.castToFact();
891
+ };
892
+ protoOf(NullRefImpl).castToIndicator = function () {
893
+ return this.$$delegate_0__1.castToIndicator();
894
+ };
895
+ protoOf(NullRefImpl).castToInteger = function () {
896
+ return this.$$delegate_0__1.castToInteger();
897
+ };
898
+ protoOf(NullRefImpl).castToList = function () {
899
+ return this.$$delegate_0__1.castToList();
900
+ };
901
+ protoOf(NullRefImpl).castToNumeric = function () {
902
+ return this.$$delegate_0__1.castToNumeric();
903
+ };
904
+ protoOf(NullRefImpl).castToReal = function () {
905
+ return this.$$delegate_0__1.castToReal();
906
+ };
907
+ protoOf(NullRefImpl).castToRule = function () {
908
+ return this.$$delegate_0__1.castToRule();
909
+ };
910
+ protoOf(NullRefImpl).castToBlock = function () {
911
+ return this.$$delegate_0__1.castToBlock();
912
+ };
913
+ protoOf(NullRefImpl).castToStruct = function () {
914
+ return this.$$delegate_0__1.castToStruct();
915
+ };
916
+ protoOf(NullRefImpl).castToRecursive = function () {
917
+ return this.$$delegate_0__1.castToRecursive();
918
+ };
919
+ protoOf(NullRefImpl).castToTerm = function () {
920
+ return this.$$delegate_0__1.castToTerm();
921
+ };
922
+ protoOf(NullRefImpl).castToTruth = function () {
923
+ return this.$$delegate_0__1.castToTruth();
924
+ };
925
+ protoOf(NullRefImpl).castToTuple = function () {
926
+ return this.$$delegate_0__1.castToTuple();
927
+ };
928
+ protoOf(NullRefImpl).castToVar = function () {
929
+ return this.$$delegate_0__1.castToVar();
930
+ };
931
+ protoOf(NullRefImpl).asClause = function () {
932
+ return this.$$delegate_0__1.asClause();
933
+ };
934
+ protoOf(NullRefImpl).asCons = function () {
935
+ return this.$$delegate_0__1.asCons();
936
+ };
937
+ protoOf(NullRefImpl).asDirective = function () {
938
+ return this.$$delegate_0__1.asDirective();
939
+ };
940
+ protoOf(NullRefImpl).asEmptyList = function () {
941
+ return this.$$delegate_0__1.asEmptyList();
942
+ };
943
+ protoOf(NullRefImpl).asEmptyBlock = function () {
944
+ return this.$$delegate_0__1.asEmptyBlock();
945
+ };
946
+ protoOf(NullRefImpl).asFact = function () {
947
+ return this.$$delegate_0__1.asFact();
948
+ };
949
+ protoOf(NullRefImpl).asIndicator = function () {
950
+ return this.$$delegate_0__1.asIndicator();
951
+ };
952
+ protoOf(NullRefImpl).asInteger = function () {
953
+ return this.$$delegate_0__1.asInteger();
954
+ };
955
+ protoOf(NullRefImpl).asList = function () {
956
+ return this.$$delegate_0__1.asList();
957
+ };
958
+ protoOf(NullRefImpl).asNumeric = function () {
959
+ return this.$$delegate_0__1.asNumeric();
960
+ };
961
+ protoOf(NullRefImpl).asReal = function () {
962
+ return this.$$delegate_0__1.asReal();
963
+ };
964
+ protoOf(NullRefImpl).asRule = function () {
965
+ return this.$$delegate_0__1.asRule();
966
+ };
967
+ protoOf(NullRefImpl).asBlock = function () {
968
+ return this.$$delegate_0__1.asBlock();
969
+ };
970
+ protoOf(NullRefImpl).asRecursive = function () {
971
+ return this.$$delegate_0__1.asRecursive();
972
+ };
973
+ protoOf(NullRefImpl).asTerm = function () {
974
+ return this.$$delegate_0__1.asTerm();
975
+ };
976
+ protoOf(NullRefImpl).asTruth = function () {
977
+ return this.$$delegate_0__1.asTruth();
978
+ };
979
+ protoOf(NullRefImpl).asTuple = function () {
980
+ return this.$$delegate_0__1.asTuple();
981
+ };
982
+ protoOf(NullRefImpl).asVar = function () {
983
+ return this.$$delegate_0__1.asVar();
984
+ };
985
+ protoOf(NullRefImpl).hashCode = function () {
986
+ return this.$$delegate_0__1.hashCode();
987
+ };
988
+ protoOf(NullRefImpl).toString = function () {
989
+ return this.$$delegate_0__1.toString();
990
+ };
991
+ protoOf(NullRefImpl).get_isVar_it73p0_k$ = function () {
992
+ return this.$$delegate_0__1.get_isVar_it73p0_k$();
993
+ };
994
+ protoOf(NullRefImpl).get_isTruth_zhwyo8_k$ = function () {
995
+ return this.$$delegate_0__1.get_isTruth_zhwyo8_k$();
996
+ };
997
+ protoOf(NullRefImpl).get_isRecursive_id8h1d_k$ = function () {
998
+ return this.$$delegate_0__1.get_isRecursive_id8h1d_k$();
999
+ };
1000
+ protoOf(NullRefImpl).get_isNumber_x9n6xo_k$ = function () {
1001
+ return this.$$delegate_0__1.get_isNumber_x9n6xo_k$();
1002
+ };
1003
+ protoOf(NullRefImpl).get_isInteger_vb3zt7_k$ = function () {
1004
+ return this.$$delegate_0__1.get_isInteger_vb3zt7_k$();
1005
+ };
1006
+ protoOf(NullRefImpl).get_isReal_ew59f5_k$ = function () {
1007
+ return this.$$delegate_0__1.get_isReal_ew59f5_k$();
1008
+ };
1009
+ protoOf(NullRefImpl).getTag = function (name) {
1010
+ return this.$$delegate_0__1.getTag(name);
1011
+ };
1012
+ protoOf(NullRefImpl).resetTags = function (tags) {
1013
+ return this.$$delegate_0__1.resetTags(tags);
1014
+ };
1015
+ protoOf(NullRefImpl).containsTag = function (name) {
1016
+ return this.$$delegate_0__1.containsTag(name);
1017
+ };
1018
+ protoOf(NullRefImpl).get_tags_wousf6_k$ = function () {
1019
+ return this.$$delegate_0__1.get_tags_wousf6_k$();
1020
+ };
1021
+ protoOf(NullRefImpl).get_isGround_twq4nu_k$ = function () {
1022
+ return this.$$delegate_0__1.get_isGround_twq4nu_k$();
1023
+ };
1024
+ var NullRefImpl_instance;
1025
+ function NullRefImpl_getInstance() {
1026
+ if (NullRefImpl_instance == null)
1027
+ new NullRefImpl();
1028
+ return NullRefImpl_instance;
1029
+ }
1030
+ function ObjectRefImpl(object) {
1031
+ this.$$delegate_0__1 = Companion_getInstance_0().of(Companion_getInstance_10().nameOf_kdy799_k$(object));
1032
+ this.object_1 = object;
1033
+ }
1034
+ protoOf(ObjectRefImpl).get_object_hhhtfs_k$ = function () {
1035
+ return this.object_1;
1036
+ };
1037
+ protoOf(ObjectRefImpl).get_isConstant_scia2f_k$ = function () {
1038
+ return true;
1039
+ };
1040
+ protoOf(ObjectRefImpl).asConstant_3hn112_k$ = function () {
1041
+ return this;
1042
+ };
1043
+ protoOf(ObjectRefImpl).asConstant = function () {
1044
+ return this.asConstant_3hn112_k$();
1045
+ };
1046
+ protoOf(ObjectRefImpl).invoke_yaglp8_k$ = function (objectConverter, methodName, arguments_0) {
1047
+ return invoke_0(this.object_1, objectConverter, methodName, arguments_0);
1048
+ };
1049
+ protoOf(ObjectRefImpl).assign_9qr39z_k$ = function (objectConverter, propertyName, value) {
1050
+ assign_0(this.object_1, objectConverter, propertyName, value);
1051
+ return true;
1052
+ };
1053
+ protoOf(ObjectRefImpl).freshCopy_fcm65_k$ = function () {
1054
+ return this;
1055
+ };
1056
+ protoOf(ObjectRefImpl).freshCopy = function () {
1057
+ return this.freshCopy_fcm65_k$();
1058
+ };
1059
+ protoOf(ObjectRefImpl).freshCopyFromScope_tnhsyi_k$ = function (scope) {
1060
+ return this;
1061
+ };
1062
+ protoOf(ObjectRefImpl).freshCopyFromScope = function (scope) {
1063
+ return this.freshCopyFromScope_tnhsyi_k$(scope);
1064
+ };
1065
+ protoOf(ObjectRefImpl).castTo_8vzplt_k$ = function () {
1066
+ return isInterface(this, Term) ? this : THROW_CCE();
1067
+ };
1068
+ protoOf(ObjectRefImpl).castTo_mm7cm3_k$ = function () {
1069
+ return this.castTo_8vzplt_k$();
1070
+ };
1071
+ protoOf(ObjectRefImpl).applySubstitution_t7osbf_k$ = function (substitution) {
1072
+ return this;
1073
+ };
1074
+ protoOf(ObjectRefImpl).applySubstitution = function (substitution) {
1075
+ return this.applySubstitution_t7osbf_k$(substitution);
1076
+ };
1077
+ protoOf(ObjectRefImpl).apply_jso7fw_k$ = function (substitution, substitutions) {
1078
+ return this;
1079
+ };
1080
+ protoOf(ObjectRefImpl).apply = function (substitution, substitutions) {
1081
+ return this.apply_jso7fw_k$(substitution, substitutions);
1082
+ };
1083
+ protoOf(ObjectRefImpl).getSubstituted_8310r6_k$ = function (substitution, substitutions) {
1084
+ return this;
1085
+ };
1086
+ protoOf(ObjectRefImpl).getSubstituted = function (substitution, substitutions) {
1087
+ return this.getSubstituted_8310r6_k$(substitution, substitutions);
1088
+ };
1089
+ protoOf(ObjectRefImpl).accept_bf9pe1_k$ = function (visitor) {
1090
+ return visitor.visitAtom(this);
1091
+ };
1092
+ protoOf(ObjectRefImpl).accept = function (visitor) {
1093
+ return this.accept_bf9pe1_k$(visitor);
1094
+ };
1095
+ protoOf(ObjectRefImpl).asAtom_nbael9_k$ = function () {
1096
+ return this.$$delegate_0__1.asAtom_nbael9_k$();
1097
+ };
1098
+ protoOf(ObjectRefImpl).asAtom = function () {
1099
+ return this.asAtom_nbael9_k$();
1100
+ };
1101
+ protoOf(ObjectRefImpl).get_arity_iosiic_k$ = function () {
1102
+ return this.$$delegate_0__1.get_arity_iosiic_k$();
1103
+ };
1104
+ protoOf(ObjectRefImpl).get_isAtom_evuq3o_k$ = function () {
1105
+ return this.$$delegate_0__1.get_isAtom_evuq3o_k$();
1106
+ };
1107
+ protoOf(ObjectRefImpl).get_isEmptyBlock_mhm4pf_k$ = function () {
1108
+ return this.$$delegate_0__1.get_isEmptyBlock_mhm4pf_k$();
1109
+ };
1110
+ protoOf(ObjectRefImpl).get_isEmptyList_9w8q3c_k$ = function () {
1111
+ return this.$$delegate_0__1.get_isEmptyList_9w8q3c_k$();
1112
+ };
1113
+ protoOf(ObjectRefImpl).get_isTrue_ew6ti9_k$ = function () {
1114
+ return this.$$delegate_0__1.get_isTrue_ew6ti9_k$();
1115
+ };
1116
+ protoOf(ObjectRefImpl).get_value_j01efc_k$ = function () {
1117
+ return this.$$delegate_0__1.get_value_j01efc_k$();
1118
+ };
1119
+ protoOf(ObjectRefImpl).get_argsList_cw1bs4_k$ = function () {
1120
+ return this.$$delegate_0__1.get_argsList_cw1bs4_k$();
1121
+ };
1122
+ protoOf(ObjectRefImpl).get_variables_75f0zy_k$ = function () {
1123
+ return this.$$delegate_0__1.get_variables_75f0zy_k$();
1124
+ };
1125
+ protoOf(ObjectRefImpl).asStruct_l3eul5_k$ = function () {
1126
+ return this.$$delegate_0__1.asStruct_l3eul5_k$();
1127
+ };
1128
+ protoOf(ObjectRefImpl).asStruct = function () {
1129
+ return this.asStruct_l3eul5_k$();
1130
+ };
1131
+ protoOf(ObjectRefImpl).append = function (argument) {
1132
+ return this.$$delegate_0__1.append(argument);
1133
+ };
1134
+ protoOf(ObjectRefImpl).addLast = function (argument) {
1135
+ return this.$$delegate_0__1.addLast(argument);
1136
+ };
1137
+ protoOf(ObjectRefImpl).addFirst = function (argument) {
1138
+ return this.$$delegate_0__1.addFirst(argument);
1139
+ };
1140
+ protoOf(ObjectRefImpl).insertAt = function (index, argument) {
1141
+ return this.$$delegate_0__1.insertAt(index, argument);
1142
+ };
1143
+ protoOf(ObjectRefImpl).setFunctor = function (functor) {
1144
+ return this.$$delegate_0__1.setFunctor(functor);
1145
+ };
1146
+ protoOf(ObjectRefImpl).getArgAt = function (index) {
1147
+ return this.$$delegate_0__1.getArgAt(index);
1148
+ };
1149
+ protoOf(ObjectRefImpl).setArgs = function (args) {
1150
+ return this.$$delegate_0__1.setArgs(args);
1151
+ };
1152
+ protoOf(ObjectRefImpl).setArgsIterable = function (args) {
1153
+ return this.$$delegate_0__1.setArgsIterable(args);
1154
+ };
1155
+ protoOf(ObjectRefImpl).setArgsSequence = function (args) {
1156
+ return this.$$delegate_0__1.setArgsSequence(args);
1157
+ };
1158
+ protoOf(ObjectRefImpl).get = function (index) {
1159
+ return this.$$delegate_0__1.get(index);
1160
+ };
1161
+ protoOf(ObjectRefImpl).get_isStruct_zeoyoo_k$ = function () {
1162
+ return this.$$delegate_0__1.get_isStruct_zeoyoo_k$();
1163
+ };
1164
+ protoOf(ObjectRefImpl).get_isClause_rwzxtu_k$ = function () {
1165
+ return this.$$delegate_0__1.get_isClause_rwzxtu_k$();
1166
+ };
1167
+ protoOf(ObjectRefImpl).get_isRule_ew5ljj_k$ = function () {
1168
+ return this.$$delegate_0__1.get_isRule_ew5ljj_k$();
1169
+ };
1170
+ protoOf(ObjectRefImpl).get_isTuple_zhv5m3_k$ = function () {
1171
+ return this.$$delegate_0__1.get_isTuple_zhv5m3_k$();
1172
+ };
1173
+ protoOf(ObjectRefImpl).get_isList_ew1iwh_k$ = function () {
1174
+ return this.$$delegate_0__1.get_isList_ew1iwh_k$();
1175
+ };
1176
+ protoOf(ObjectRefImpl).get_isCons_evvwck_k$ = function () {
1177
+ return this.$$delegate_0__1.get_isCons_evvwck_k$();
1178
+ };
1179
+ protoOf(ObjectRefImpl).get_isIndicator_llw8m4_k$ = function () {
1180
+ return this.$$delegate_0__1.get_isIndicator_llw8m4_k$();
1181
+ };
1182
+ protoOf(ObjectRefImpl).get_functor_75vgt2_k$ = function () {
1183
+ return this.$$delegate_0__1.get_functor_75vgt2_k$();
1184
+ };
1185
+ protoOf(ObjectRefImpl).get_isFunctorWellFormed_fgwhjl_k$ = function () {
1186
+ return this.$$delegate_0__1.get_isFunctorWellFormed_fgwhjl_k$();
1187
+ };
1188
+ protoOf(ObjectRefImpl).get_indicator_39dti2_k$ = function () {
1189
+ return this.$$delegate_0__1.get_indicator_39dti2_k$();
1190
+ };
1191
+ protoOf(ObjectRefImpl).get_argsSequence_z7gge1_k$ = function () {
1192
+ return this.$$delegate_0__1.get_argsSequence_z7gge1_k$();
1193
+ };
1194
+ protoOf(ObjectRefImpl).compareTo_kfa5id_k$ = function (other) {
1195
+ return this.$$delegate_0__1.compareTo_kfa5id_k$(other);
1196
+ };
1197
+ protoOf(ObjectRefImpl).compareTo_hpufkf_k$ = function (other) {
1198
+ return this.compareTo_kfa5id_k$((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
1199
+ };
1200
+ protoOf(ObjectRefImpl).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
1201
+ return this.$$delegate_0__1.equalsUsingVarCompleteNames(other, useVarCompleteName);
1202
+ };
1203
+ protoOf(ObjectRefImpl).equals = function (other) {
1204
+ return this.$$delegate_0__1.equals(other);
1205
+ };
1206
+ protoOf(ObjectRefImpl).structurallyEquals = function (other) {
1207
+ return this.$$delegate_0__1.structurallyEquals(other);
1208
+ };
1209
+ protoOf(ObjectRefImpl).castToAtom = function () {
1210
+ return this.$$delegate_0__1.castToAtom();
1211
+ };
1212
+ protoOf(ObjectRefImpl).castToClause = function () {
1213
+ return this.$$delegate_0__1.castToClause();
1214
+ };
1215
+ protoOf(ObjectRefImpl).castToCons = function () {
1216
+ return this.$$delegate_0__1.castToCons();
1217
+ };
1218
+ protoOf(ObjectRefImpl).castToConstant = function () {
1219
+ return this.$$delegate_0__1.castToConstant();
1220
+ };
1221
+ protoOf(ObjectRefImpl).castToDirective = function () {
1222
+ return this.$$delegate_0__1.castToDirective();
1223
+ };
1224
+ protoOf(ObjectRefImpl).castToEmptyList = function () {
1225
+ return this.$$delegate_0__1.castToEmptyList();
1226
+ };
1227
+ protoOf(ObjectRefImpl).castToEmptyBlock = function () {
1228
+ return this.$$delegate_0__1.castToEmptyBlock();
1229
+ };
1230
+ protoOf(ObjectRefImpl).castToFact = function () {
1231
+ return this.$$delegate_0__1.castToFact();
1232
+ };
1233
+ protoOf(ObjectRefImpl).castToIndicator = function () {
1234
+ return this.$$delegate_0__1.castToIndicator();
1235
+ };
1236
+ protoOf(ObjectRefImpl).castToInteger = function () {
1237
+ return this.$$delegate_0__1.castToInteger();
1238
+ };
1239
+ protoOf(ObjectRefImpl).castToList = function () {
1240
+ return this.$$delegate_0__1.castToList();
1241
+ };
1242
+ protoOf(ObjectRefImpl).castToNumeric = function () {
1243
+ return this.$$delegate_0__1.castToNumeric();
1244
+ };
1245
+ protoOf(ObjectRefImpl).castToReal = function () {
1246
+ return this.$$delegate_0__1.castToReal();
1247
+ };
1248
+ protoOf(ObjectRefImpl).castToRule = function () {
1249
+ return this.$$delegate_0__1.castToRule();
1250
+ };
1251
+ protoOf(ObjectRefImpl).castToBlock = function () {
1252
+ return this.$$delegate_0__1.castToBlock();
1253
+ };
1254
+ protoOf(ObjectRefImpl).castToStruct = function () {
1255
+ return this.$$delegate_0__1.castToStruct();
1256
+ };
1257
+ protoOf(ObjectRefImpl).castToRecursive = function () {
1258
+ return this.$$delegate_0__1.castToRecursive();
1259
+ };
1260
+ protoOf(ObjectRefImpl).castToTerm = function () {
1261
+ return this.$$delegate_0__1.castToTerm();
1262
+ };
1263
+ protoOf(ObjectRefImpl).castToTruth = function () {
1264
+ return this.$$delegate_0__1.castToTruth();
1265
+ };
1266
+ protoOf(ObjectRefImpl).castToTuple = function () {
1267
+ return this.$$delegate_0__1.castToTuple();
1268
+ };
1269
+ protoOf(ObjectRefImpl).castToVar = function () {
1270
+ return this.$$delegate_0__1.castToVar();
1271
+ };
1272
+ protoOf(ObjectRefImpl).asClause = function () {
1273
+ return this.$$delegate_0__1.asClause();
1274
+ };
1275
+ protoOf(ObjectRefImpl).asCons = function () {
1276
+ return this.$$delegate_0__1.asCons();
1277
+ };
1278
+ protoOf(ObjectRefImpl).asDirective = function () {
1279
+ return this.$$delegate_0__1.asDirective();
1280
+ };
1281
+ protoOf(ObjectRefImpl).asEmptyList = function () {
1282
+ return this.$$delegate_0__1.asEmptyList();
1283
+ };
1284
+ protoOf(ObjectRefImpl).asEmptyBlock = function () {
1285
+ return this.$$delegate_0__1.asEmptyBlock();
1286
+ };
1287
+ protoOf(ObjectRefImpl).asFact = function () {
1288
+ return this.$$delegate_0__1.asFact();
1289
+ };
1290
+ protoOf(ObjectRefImpl).asIndicator = function () {
1291
+ return this.$$delegate_0__1.asIndicator();
1292
+ };
1293
+ protoOf(ObjectRefImpl).asInteger = function () {
1294
+ return this.$$delegate_0__1.asInteger();
1295
+ };
1296
+ protoOf(ObjectRefImpl).asList = function () {
1297
+ return this.$$delegate_0__1.asList();
1298
+ };
1299
+ protoOf(ObjectRefImpl).asNumeric = function () {
1300
+ return this.$$delegate_0__1.asNumeric();
1301
+ };
1302
+ protoOf(ObjectRefImpl).asReal = function () {
1303
+ return this.$$delegate_0__1.asReal();
1304
+ };
1305
+ protoOf(ObjectRefImpl).asRule = function () {
1306
+ return this.$$delegate_0__1.asRule();
1307
+ };
1308
+ protoOf(ObjectRefImpl).asBlock = function () {
1309
+ return this.$$delegate_0__1.asBlock();
1310
+ };
1311
+ protoOf(ObjectRefImpl).asRecursive = function () {
1312
+ return this.$$delegate_0__1.asRecursive();
1313
+ };
1314
+ protoOf(ObjectRefImpl).asTerm = function () {
1315
+ return this.$$delegate_0__1.asTerm();
1316
+ };
1317
+ protoOf(ObjectRefImpl).asTruth = function () {
1318
+ return this.$$delegate_0__1.asTruth();
1319
+ };
1320
+ protoOf(ObjectRefImpl).asTuple = function () {
1321
+ return this.$$delegate_0__1.asTuple();
1322
+ };
1323
+ protoOf(ObjectRefImpl).asVar = function () {
1324
+ return this.$$delegate_0__1.asVar();
1325
+ };
1326
+ protoOf(ObjectRefImpl).hashCode = function () {
1327
+ return this.$$delegate_0__1.hashCode();
1328
+ };
1329
+ protoOf(ObjectRefImpl).toString = function () {
1330
+ return this.$$delegate_0__1.toString();
1331
+ };
1332
+ protoOf(ObjectRefImpl).get_isVar_it73p0_k$ = function () {
1333
+ return this.$$delegate_0__1.get_isVar_it73p0_k$();
1334
+ };
1335
+ protoOf(ObjectRefImpl).get_isTruth_zhwyo8_k$ = function () {
1336
+ return this.$$delegate_0__1.get_isTruth_zhwyo8_k$();
1337
+ };
1338
+ protoOf(ObjectRefImpl).get_isRecursive_id8h1d_k$ = function () {
1339
+ return this.$$delegate_0__1.get_isRecursive_id8h1d_k$();
1340
+ };
1341
+ protoOf(ObjectRefImpl).get_isNumber_x9n6xo_k$ = function () {
1342
+ return this.$$delegate_0__1.get_isNumber_x9n6xo_k$();
1343
+ };
1344
+ protoOf(ObjectRefImpl).get_isInteger_vb3zt7_k$ = function () {
1345
+ return this.$$delegate_0__1.get_isInteger_vb3zt7_k$();
1346
+ };
1347
+ protoOf(ObjectRefImpl).get_isReal_ew59f5_k$ = function () {
1348
+ return this.$$delegate_0__1.get_isReal_ew59f5_k$();
1349
+ };
1350
+ protoOf(ObjectRefImpl).getTag = function (name) {
1351
+ return this.$$delegate_0__1.getTag(name);
1352
+ };
1353
+ protoOf(ObjectRefImpl).resetTags = function (tags) {
1354
+ return this.$$delegate_0__1.resetTags(tags);
1355
+ };
1356
+ protoOf(ObjectRefImpl).containsTag = function (name) {
1357
+ return this.$$delegate_0__1.containsTag(name);
1358
+ };
1359
+ protoOf(ObjectRefImpl).get_tags_wousf6_k$ = function () {
1360
+ return this.$$delegate_0__1.get_tags_wousf6_k$();
1361
+ };
1362
+ protoOf(ObjectRefImpl).get_isGround_twq4nu_k$ = function () {
1363
+ return this.$$delegate_0__1.get_isGround_twq4nu_k$();
1364
+ };
1365
+ function ObjectToTermConverterImpl() {
1366
+ this.numberTypeTester_1 = new NumberTypeTester();
1367
+ }
1368
+ protoOf(ObjectToTermConverterImpl).convert_2fnsng_k$ = function (source) {
1369
+ // Inline function 'kotlin.with' call
1370
+ var $this$with = this.numberTypeTester_1;
1371
+ var tmp;
1372
+ if (source == null) {
1373
+ tmp = Companion_getInstance_10().NULL_1;
1374
+ } else {
1375
+ if (typeof source === 'string') {
1376
+ tmp = Companion_getInstance_0().of(source);
1377
+ } else {
1378
+ if (isInterface(source, BigInteger)) {
1379
+ tmp = Companion_getInstance_3().ofBigInteger(source);
1380
+ } else {
1381
+ if (isInterface(source, BigDecimal)) {
1382
+ tmp = Companion_getInstance_2().ofBigDecimal(source);
1383
+ } else {
1384
+ if (isNumber(source)) {
1385
+ tmp = $this$with.get_isInteger_cpv3bm_k$(source) ? Companion_getInstance_3().ofBigInteger($this$with.toInteger_cr7ezq_k$(source)) : Companion_getInstance_2().ofBigDecimal($this$with.toDecimal_f0xy7b_k$(source));
1386
+ } else {
1387
+ if (source instanceof Char) {
1388
+ var tmp_0 = Companion_getInstance_0();
1389
+ // Inline function 'kotlin.charArrayOf' call
1390
+ var tmp$ret$2 = charArrayOf([source.value_1]);
1391
+ tmp = tmp_0.of(concatToString(tmp$ret$2));
1392
+ } else {
1393
+ if (typeof source === 'boolean') {
1394
+ tmp = Companion_getInstance_1().of(source);
1395
+ } else {
1396
+ tmp = Companion_getInstance_10().of_u40ndk_k$(source);
1397
+ }
1398
+ }
1399
+ }
1400
+ }
1401
+ }
1402
+ }
1403
+ }
1404
+ return tmp;
1405
+ };
1406
+ function explicitConversion($this, castExpression, term, type) {
1407
+ var targetType = getType($this, castExpression, type);
1408
+ try {
1409
+ return $this.convertInto_62bmhg_k$(targetType, term);
1410
+ } catch ($p) {
1411
+ if ($p instanceof TermToObjectConversionException) {
1412
+ var e = $p;
1413
+ throw e;
1414
+ } else {
1415
+ if ($p instanceof Exception) {
1416
+ var _unused_var__etf5q3 = $p;
1417
+ throw new TermToObjectConversionException(term, targetType);
1418
+ } else {
1419
+ throw $p;
1420
+ }
1421
+ }
1422
+ }
1423
+ }
1424
+ function getType($this, castExpression, typeTerm) {
1425
+ var tmp;
1426
+ if (isInterface(typeTerm, TypeRef)) {
1427
+ tmp = typeTerm.get_type_wovaf7_k$();
1428
+ } else {
1429
+ if (isInterface(typeTerm, Atom)) {
1430
+ var tmp1_elvis_lhs = $this.typeFactory_1.typeFromName_xpqoph_k$(typeTerm.get_value_j01efc_k$());
1431
+ var tmp_0;
1432
+ if (tmp1_elvis_lhs == null) {
1433
+ throw TermToObjectConversionException_init_$Create$(castExpression);
1434
+ } else {
1435
+ tmp_0 = tmp1_elvis_lhs;
1436
+ }
1437
+ tmp = tmp_0;
1438
+ } else {
1439
+ if (isInterface(typeTerm, Struct)) {
1440
+ var tmp_1;
1441
+ if (Companion_getInstance().matches(typeTerm, get_DEALIASING_TEMPLATE())) {
1442
+ var ref = $this.dealiaser_1(typeTerm);
1443
+ var tmp_2;
1444
+ if (!(ref == null) ? isInterface(ref, TypeRef) : false) {
1445
+ tmp_2 = ref.get_type_wovaf7_k$();
1446
+ } else {
1447
+ throw TermToObjectConversionException_init_$Create$(castExpression);
1448
+ }
1449
+ tmp_1 = tmp_2;
1450
+ } else {
1451
+ throw TermToObjectConversionException_init_$Create$(castExpression);
1452
+ }
1453
+ tmp = tmp_1;
1454
+ } else {
1455
+ throw TermToObjectConversionException_init_$Create$(castExpression);
1456
+ }
1457
+ }
1458
+ }
1459
+ return tmp;
1460
+ }
1461
+ function admissibleTypesByPriority($this, term) {
1462
+ var tmp;
1463
+ var tmp_0;
1464
+ if (isInterface(term, NullRef)) {
1465
+ tmp_0 = true;
1466
+ } else {
1467
+ tmp_0 = isInterface(term, Var);
1468
+ }
1469
+ if (tmp_0) {
1470
+ tmp = sequenceOf(PrimitiveClasses_getInstance().get_nothingClass_7ivpcc_k$());
1471
+ } else {
1472
+ if (isInterface(term, ObjectRef)) {
1473
+ tmp = sequenceOf(getKClassFromExpression(term.get_object_hhhtfs_k$()));
1474
+ } else {
1475
+ if (isInterface(term, Truth)) {
1476
+ tmp = sequenceOf_0([PrimitiveClasses_getInstance().get_booleanClass_d285fr_k$(), PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$()]);
1477
+ } else {
1478
+ if (isInterface(term, Atom)) {
1479
+ var admissible = sequenceOf(PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$());
1480
+ if (term.get_value_j01efc_k$().length === 1) {
1481
+ admissible = plus(admissible, sequenceOf(getKClass(Char)));
1482
+ }
1483
+ tmp = admissible;
1484
+ } else {
1485
+ if (isInterface(term, Real)) {
1486
+ tmp = sequenceOf_0([getKClass(BigDecimal), PrimitiveClasses_getInstance().get_doubleClass_dahzcy_k$(), PrimitiveClasses_getInstance().get_floatClass_xlwq2t_k$()]);
1487
+ } else {
1488
+ if (isInterface(term, Integer)) {
1489
+ var admissible_0 = sequenceOf(getKClass(BigInteger));
1490
+ if (Companion_getInstance_4().ofLong(-9223372036854775808n).rangeTo(Companion_getInstance_4().ofLong(9223372036854775807n)).contains_3tkdvy_k$(term.get_intValue_mlvnn9_k$())) {
1491
+ admissible_0 = plus(admissible_0, sequenceOf(PrimitiveClasses_getInstance().get_longClass_a79cj7_k$()));
1492
+ }
1493
+ if (Companion_getInstance_4().of(-2147483648).rangeTo(Companion_getInstance_4().of(2147483647)).contains_3tkdvy_k$(term.get_intValue_mlvnn9_k$())) {
1494
+ admissible_0 = plus(admissible_0, sequenceOf(PrimitiveClasses_getInstance().get_intClass_mw4y9a_k$()));
1495
+ }
1496
+ if (Companion_getInstance_4().of(-32768).rangeTo(Companion_getInstance_4().of(32767)).contains_3tkdvy_k$(term.get_intValue_mlvnn9_k$())) {
1497
+ admissible_0 = plus(admissible_0, sequenceOf(PrimitiveClasses_getInstance().get_shortClass_5ajsv9_k$()));
1498
+ }
1499
+ if (Companion_getInstance_4().of(-128).rangeTo(Companion_getInstance_4().of(127)).contains_3tkdvy_k$(term.get_intValue_mlvnn9_k$())) {
1500
+ admissible_0 = plus(admissible_0, sequenceOf(PrimitiveClasses_getInstance().get_byteClass_pu7s61_k$()));
1501
+ }
1502
+ admissible_0 = plus(admissible_0, sequenceOf(getKClass(BigDecimal)));
1503
+ var containsLower = Companion_getInstance_5().ofDouble(4.9E-324);
1504
+ var containsUpper = Companion_getInstance_5().ofDouble(1.7976931348623157E308);
1505
+ var containsArg = term.get_decimalValue_7pja3t_k$();
1506
+ if (0 <= compareTo(containsArg, containsLower) ? compareTo(containsArg, containsUpper) <= 0 : false) {
1507
+ admissible_0 = plus(admissible_0, sequenceOf(PrimitiveClasses_getInstance().get_doubleClass_dahzcy_k$()));
1508
+ }
1509
+ var containsLower_0 = Companion_getInstance_5().ofFloat(1.4E-45);
1510
+ var containsUpper_0 = Companion_getInstance_5().ofFloat(3.4028235E38);
1511
+ var containsArg_0 = term.get_decimalValue_7pja3t_k$();
1512
+ if (0 <= compareTo(containsArg_0, containsLower_0) ? compareTo(containsArg_0, containsUpper_0) <= 0 : false) {
1513
+ admissible_0 = plus(admissible_0, sequenceOf(PrimitiveClasses_getInstance().get_floatClass_xlwq2t_k$()));
1514
+ }
1515
+ tmp = admissible_0;
1516
+ } else {
1517
+ if (isInterface(term, Struct)) {
1518
+ var tmp_1;
1519
+ if (Companion_getInstance().matches(term, get_CAST_TEMPLATE())) {
1520
+ tmp_1 = sequenceOf(getType($this, term, term.get(1)));
1521
+ } else if (Companion_getInstance().matches(term, get_DEALIASING_TEMPLATE())) {
1522
+ var ref = $this.dealiaser_1(term);
1523
+ var tmp_2;
1524
+ if (!(ref == null) ? isInterface(ref, ObjectRef) : false) {
1525
+ tmp_2 = admissibleTypesByPriority($this, ref);
1526
+ } else {
1527
+ throw TermToObjectConversionException_init_$Create$(term);
1528
+ }
1529
+ tmp_1 = tmp_2;
1530
+ } else {
1531
+ throw TermToObjectConversionException_init_$Create$(term);
1532
+ }
1533
+ tmp = tmp_1;
1534
+ } else {
1535
+ throw TermToObjectConversionException_init_$Create$(term);
1536
+ }
1537
+ }
1538
+ }
1539
+ }
1540
+ }
1541
+ }
1542
+ }
1543
+ return tmp;
1544
+ }
1545
+ function TermToObjectConverterImpl(typeFactory, dealiaser) {
1546
+ this.typeFactory_1 = typeFactory;
1547
+ this.dealiaser_1 = dealiaser;
1548
+ }
1549
+ protoOf(TermToObjectConverterImpl).convertInto_62bmhg_k$ = function (type, term) {
1550
+ var tmp;
1551
+ var tmp_0;
1552
+ if (isInterface(term, NullRef)) {
1553
+ tmp_0 = true;
1554
+ } else {
1555
+ tmp_0 = isInterface(term, Var);
1556
+ }
1557
+ if (tmp_0) {
1558
+ var tmp_1;
1559
+ if (get_isPrimitiveType(type)) {
1560
+ throw new TermToObjectConversionException(term, type);
1561
+ } else {
1562
+ tmp_1 = null;
1563
+ }
1564
+ tmp = tmp_1;
1565
+ } else {
1566
+ if (isInterface(term, ObjectRef)) {
1567
+ var tmp_2;
1568
+ if (isSubtypeOf(getKClassFromExpression(term.get_object_hhhtfs_k$()), type)) {
1569
+ tmp_2 = term.get_object_hhhtfs_k$();
1570
+ } else {
1571
+ throw new TermToObjectConversionException(term, type);
1572
+ }
1573
+ tmp = tmp_2;
1574
+ } else {
1575
+ if (isInterface(term, Truth)) {
1576
+ var tmp_3;
1577
+ if (isSubtypeOf(PrimitiveClasses_getInstance().get_booleanClass_d285fr_k$(), type)) {
1578
+ tmp_3 = term.get_isTrue_ew6ti9_k$();
1579
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$(), type)) {
1580
+ tmp_3 = term.get_value_j01efc_k$();
1581
+ } else {
1582
+ throw new TermToObjectConversionException(term, type);
1583
+ }
1584
+ tmp = tmp_3;
1585
+ } else {
1586
+ if (isInterface(term, Atom)) {
1587
+ var tmp_4;
1588
+ if (isSubtypeOf(PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$(), type)) {
1589
+ tmp_4 = term.get_value_j01efc_k$();
1590
+ } else if (isSubtypeOf(getKClass(Char), type)) {
1591
+ var tmp_5;
1592
+ if (term.get_value_j01efc_k$().length === 1) {
1593
+ tmp_5 = charCodeAt(term.get_value_j01efc_k$(), 0);
1594
+ } else {
1595
+ throw new TermToObjectConversionException(term, type);
1596
+ }
1597
+ tmp_4 = new Char(tmp_5);
1598
+ } else {
1599
+ throw new TermToObjectConversionException(term, type);
1600
+ }
1601
+ tmp = tmp_4;
1602
+ } else {
1603
+ if (isInterface(term, Real)) {
1604
+ var tmp_6;
1605
+ if (isSubtypeOf(getKClass(BigDecimal), type)) {
1606
+ tmp_6 = term.get_decimalValue_7pja3t_k$();
1607
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().get_doubleClass_dahzcy_k$(), type)) {
1608
+ tmp_6 = term.get_decimalValue_7pja3t_k$().toDouble();
1609
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().get_floatClass_xlwq2t_k$(), type)) {
1610
+ tmp_6 = term.get_decimalValue_7pja3t_k$().toFloat();
1611
+ } else {
1612
+ throw new TermToObjectConversionException(term, type);
1613
+ }
1614
+ tmp = tmp_6;
1615
+ } else {
1616
+ if (isInterface(term, Integer)) {
1617
+ var tmp_7;
1618
+ if (isSubtypeOf(getKClass(BigInteger), type)) {
1619
+ tmp_7 = term.get_intValue_mlvnn9_k$();
1620
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().get_longClass_a79cj7_k$(), type)) {
1621
+ tmp_7 = term.get_intValue_mlvnn9_k$().toLongExact();
1622
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().get_intClass_mw4y9a_k$(), type)) {
1623
+ tmp_7 = term.get_intValue_mlvnn9_k$().toIntExact();
1624
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().get_shortClass_5ajsv9_k$(), type)) {
1625
+ tmp_7 = term.get_intValue_mlvnn9_k$().toShortExact();
1626
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().get_byteClass_pu7s61_k$(), type)) {
1627
+ tmp_7 = term.get_intValue_mlvnn9_k$().toByteExact();
1628
+ } else if (isSubtypeOf(getKClass(BigDecimal), type)) {
1629
+ tmp_7 = term.get_decimalValue_7pja3t_k$();
1630
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().get_doubleClass_dahzcy_k$(), type)) {
1631
+ tmp_7 = term.get_decimalValue_7pja3t_k$().toDouble();
1632
+ } else if (isSubtypeOf(PrimitiveClasses_getInstance().get_floatClass_xlwq2t_k$(), type)) {
1633
+ tmp_7 = term.get_decimalValue_7pja3t_k$().toFloat();
1634
+ } else {
1635
+ throw new TermToObjectConversionException(term, type);
1636
+ }
1637
+ tmp = tmp_7;
1638
+ } else {
1639
+ if (isInterface(term, Struct)) {
1640
+ var tmp_8;
1641
+ if (Companion_getInstance().matches(term, get_CAST_TEMPLATE())) {
1642
+ tmp_8 = explicitConversion(this, term, term.get(0), term.get(1));
1643
+ } else if (Companion_getInstance().matches(term, get_DEALIASING_TEMPLATE())) {
1644
+ var ref = this.dealiaser_1(term);
1645
+ var tmp_9;
1646
+ if (!(ref == null) ? isInterface(ref, ObjectRef) : false) {
1647
+ tmp_9 = this.convertInto_62bmhg_k$(type, ref);
1648
+ } else {
1649
+ throw TermToObjectConversionException_init_$Create$(term);
1650
+ }
1651
+ tmp_8 = tmp_9;
1652
+ } else {
1653
+ throw TermToObjectConversionException_init_$Create$(term);
1654
+ }
1655
+ // Inline function 'kotlin.also' call
1656
+ var this_0 = tmp_8;
1657
+ if (!(this_0 == null) && !isSubtypeOf(getKClassFromExpression(this_0), type)) {
1658
+ throw TermToObjectConversionException_init_$Create$(term);
1659
+ }
1660
+ tmp = this_0;
1661
+ } else {
1662
+ throw TermToObjectConversionException_init_$Create$(term);
1663
+ }
1664
+ }
1665
+ }
1666
+ }
1667
+ }
1668
+ }
1669
+ }
1670
+ return tmp;
1671
+ };
1672
+ protoOf(TermToObjectConverterImpl).mostAdequateType_bmnk7m_k$ = function (term) {
1673
+ return first(admissibleTypesByPriority(this, term));
1674
+ };
1675
+ protoOf(TermToObjectConverterImpl).admissibleTypes_1kwmul_k$ = function (term) {
1676
+ return toSet(admissibleTypesByPriority(this, term));
1677
+ };
1678
+ function TypeFactoryImpl() {
1679
+ }
1680
+ protoOf(TypeFactoryImpl).typeFromName_xpqoph_k$ = function (typeName) {
1681
+ return kClassFromName(typeName).get_value_j01efc_k$();
1682
+ };
1683
+ function nameOf_0($this, type) {
1684
+ return '<type:' + get_fullName(type) + '>';
1685
+ }
1686
+ function Companion_6() {
1687
+ }
1688
+ var Companion_instance_14;
1689
+ function Companion_getInstance_17() {
1690
+ return Companion_instance_14;
1691
+ }
1692
+ function TypeRefImpl(type) {
1693
+ this.$$delegate_0__1 = Companion_getInstance_0().of(nameOf_0(Companion_instance_14, type));
1694
+ this.type_1 = type;
1695
+ }
1696
+ protoOf(TypeRefImpl).get_type_wovaf7_k$ = function () {
1697
+ return this.type_1;
1698
+ };
1699
+ protoOf(TypeRefImpl).create_1rher4_k$ = function (objectConverter, arguments_0) {
1700
+ return create_0(this.type_1, objectConverter, arguments_0);
1701
+ };
1702
+ protoOf(TypeRefImpl).invoke_yaglp8_k$ = function (objectConverter, methodName, arguments_0) {
1703
+ var companionObjectRef = get_companionObjectRef(this.type_1);
1704
+ var tmp;
1705
+ if (companionObjectRef instanceof Some) {
1706
+ tmp = invoke_0(companionObjectRef.value_1, objectConverter, methodName, arguments_0);
1707
+ } else {
1708
+ tmp = invoke_1(this.type_1, objectConverter, methodName, arguments_0, null);
1709
+ }
1710
+ return tmp;
1711
+ };
1712
+ protoOf(TypeRefImpl).get_isConstant_scia2f_k$ = function () {
1713
+ return true;
1714
+ };
1715
+ protoOf(TypeRefImpl).asConstant_3hn112_k$ = function () {
1716
+ return this;
1717
+ };
1718
+ protoOf(TypeRefImpl).asConstant = function () {
1719
+ return this.asConstant_3hn112_k$();
1720
+ };
1721
+ protoOf(TypeRefImpl).freshCopy_fcm65_k$ = function () {
1722
+ return this;
1723
+ };
1724
+ protoOf(TypeRefImpl).freshCopy = function () {
1725
+ return this.freshCopy_fcm65_k$();
1726
+ };
1727
+ protoOf(TypeRefImpl).freshCopyFromScope_tnhsyi_k$ = function (scope) {
1728
+ return this;
1729
+ };
1730
+ protoOf(TypeRefImpl).freshCopyFromScope = function (scope) {
1731
+ return this.freshCopyFromScope_tnhsyi_k$(scope);
1732
+ };
1733
+ protoOf(TypeRefImpl).castTo_8vzplt_k$ = function () {
1734
+ return isInterface(this, Term) ? this : THROW_CCE();
1735
+ };
1736
+ protoOf(TypeRefImpl).castTo_mm7cm3_k$ = function () {
1737
+ return this.castTo_8vzplt_k$();
1738
+ };
1739
+ protoOf(TypeRefImpl).applySubstitution_t7osbf_k$ = function (substitution) {
1740
+ return this;
1741
+ };
1742
+ protoOf(TypeRefImpl).applySubstitution = function (substitution) {
1743
+ return this.applySubstitution_t7osbf_k$(substitution);
1744
+ };
1745
+ protoOf(TypeRefImpl).apply_jso7fw_k$ = function (substitution, substitutions) {
1746
+ return this;
1747
+ };
1748
+ protoOf(TypeRefImpl).apply = function (substitution, substitutions) {
1749
+ return this.apply_jso7fw_k$(substitution, substitutions);
1750
+ };
1751
+ protoOf(TypeRefImpl).getSubstituted_8310r6_k$ = function (substitution, substitutions) {
1752
+ return this;
1753
+ };
1754
+ protoOf(TypeRefImpl).getSubstituted = function (substitution, substitutions) {
1755
+ return this.getSubstituted_8310r6_k$(substitution, substitutions);
1756
+ };
1757
+ protoOf(TypeRefImpl).accept_bf9pe1_k$ = function (visitor) {
1758
+ return visitor.visitAtom(this);
1759
+ };
1760
+ protoOf(TypeRefImpl).accept = function (visitor) {
1761
+ return this.accept_bf9pe1_k$(visitor);
1762
+ };
1763
+ protoOf(TypeRefImpl).assign_9qr39z_k$ = function (objectConverter, propertyName, value) {
1764
+ var companionObjectRef = get_companionObjectRef(this.type_1);
1765
+ if (companionObjectRef instanceof Some)
1766
+ assign_0(companionObjectRef.value_1, objectConverter, propertyName, value);
1767
+ else {
1768
+ assign_1(this.type_1, objectConverter, propertyName, value, null);
1769
+ }
1770
+ return true;
1771
+ };
1772
+ protoOf(TypeRefImpl).asAtom_nbael9_k$ = function () {
1773
+ return this.$$delegate_0__1.asAtom_nbael9_k$();
1774
+ };
1775
+ protoOf(TypeRefImpl).asAtom = function () {
1776
+ return this.asAtom_nbael9_k$();
1777
+ };
1778
+ protoOf(TypeRefImpl).get_arity_iosiic_k$ = function () {
1779
+ return this.$$delegate_0__1.get_arity_iosiic_k$();
1780
+ };
1781
+ protoOf(TypeRefImpl).get_isAtom_evuq3o_k$ = function () {
1782
+ return this.$$delegate_0__1.get_isAtom_evuq3o_k$();
1783
+ };
1784
+ protoOf(TypeRefImpl).get_isEmptyBlock_mhm4pf_k$ = function () {
1785
+ return this.$$delegate_0__1.get_isEmptyBlock_mhm4pf_k$();
1786
+ };
1787
+ protoOf(TypeRefImpl).get_isEmptyList_9w8q3c_k$ = function () {
1788
+ return this.$$delegate_0__1.get_isEmptyList_9w8q3c_k$();
1789
+ };
1790
+ protoOf(TypeRefImpl).get_isTrue_ew6ti9_k$ = function () {
1791
+ return this.$$delegate_0__1.get_isTrue_ew6ti9_k$();
1792
+ };
1793
+ protoOf(TypeRefImpl).get_value_j01efc_k$ = function () {
1794
+ return this.$$delegate_0__1.get_value_j01efc_k$();
1795
+ };
1796
+ protoOf(TypeRefImpl).get_argsList_cw1bs4_k$ = function () {
1797
+ return this.$$delegate_0__1.get_argsList_cw1bs4_k$();
1798
+ };
1799
+ protoOf(TypeRefImpl).get_variables_75f0zy_k$ = function () {
1800
+ return this.$$delegate_0__1.get_variables_75f0zy_k$();
1801
+ };
1802
+ protoOf(TypeRefImpl).asStruct_l3eul5_k$ = function () {
1803
+ return this.$$delegate_0__1.asStruct_l3eul5_k$();
1804
+ };
1805
+ protoOf(TypeRefImpl).asStruct = function () {
1806
+ return this.asStruct_l3eul5_k$();
1807
+ };
1808
+ protoOf(TypeRefImpl).append = function (argument) {
1809
+ return this.$$delegate_0__1.append(argument);
1810
+ };
1811
+ protoOf(TypeRefImpl).addLast = function (argument) {
1812
+ return this.$$delegate_0__1.addLast(argument);
1813
+ };
1814
+ protoOf(TypeRefImpl).addFirst = function (argument) {
1815
+ return this.$$delegate_0__1.addFirst(argument);
1816
+ };
1817
+ protoOf(TypeRefImpl).insertAt = function (index, argument) {
1818
+ return this.$$delegate_0__1.insertAt(index, argument);
1819
+ };
1820
+ protoOf(TypeRefImpl).setFunctor = function (functor) {
1821
+ return this.$$delegate_0__1.setFunctor(functor);
1822
+ };
1823
+ protoOf(TypeRefImpl).getArgAt = function (index) {
1824
+ return this.$$delegate_0__1.getArgAt(index);
1825
+ };
1826
+ protoOf(TypeRefImpl).setArgs = function (args) {
1827
+ return this.$$delegate_0__1.setArgs(args);
1828
+ };
1829
+ protoOf(TypeRefImpl).setArgsIterable = function (args) {
1830
+ return this.$$delegate_0__1.setArgsIterable(args);
1831
+ };
1832
+ protoOf(TypeRefImpl).setArgsSequence = function (args) {
1833
+ return this.$$delegate_0__1.setArgsSequence(args);
1834
+ };
1835
+ protoOf(TypeRefImpl).get = function (index) {
1836
+ return this.$$delegate_0__1.get(index);
1837
+ };
1838
+ protoOf(TypeRefImpl).get_isStruct_zeoyoo_k$ = function () {
1839
+ return this.$$delegate_0__1.get_isStruct_zeoyoo_k$();
1840
+ };
1841
+ protoOf(TypeRefImpl).get_isClause_rwzxtu_k$ = function () {
1842
+ return this.$$delegate_0__1.get_isClause_rwzxtu_k$();
1843
+ };
1844
+ protoOf(TypeRefImpl).get_isRule_ew5ljj_k$ = function () {
1845
+ return this.$$delegate_0__1.get_isRule_ew5ljj_k$();
1846
+ };
1847
+ protoOf(TypeRefImpl).get_isTuple_zhv5m3_k$ = function () {
1848
+ return this.$$delegate_0__1.get_isTuple_zhv5m3_k$();
1849
+ };
1850
+ protoOf(TypeRefImpl).get_isList_ew1iwh_k$ = function () {
1851
+ return this.$$delegate_0__1.get_isList_ew1iwh_k$();
1852
+ };
1853
+ protoOf(TypeRefImpl).get_isCons_evvwck_k$ = function () {
1854
+ return this.$$delegate_0__1.get_isCons_evvwck_k$();
1855
+ };
1856
+ protoOf(TypeRefImpl).get_isIndicator_llw8m4_k$ = function () {
1857
+ return this.$$delegate_0__1.get_isIndicator_llw8m4_k$();
1858
+ };
1859
+ protoOf(TypeRefImpl).get_functor_75vgt2_k$ = function () {
1860
+ return this.$$delegate_0__1.get_functor_75vgt2_k$();
1861
+ };
1862
+ protoOf(TypeRefImpl).get_isFunctorWellFormed_fgwhjl_k$ = function () {
1863
+ return this.$$delegate_0__1.get_isFunctorWellFormed_fgwhjl_k$();
1864
+ };
1865
+ protoOf(TypeRefImpl).get_indicator_39dti2_k$ = function () {
1866
+ return this.$$delegate_0__1.get_indicator_39dti2_k$();
1867
+ };
1868
+ protoOf(TypeRefImpl).get_argsSequence_z7gge1_k$ = function () {
1869
+ return this.$$delegate_0__1.get_argsSequence_z7gge1_k$();
1870
+ };
1871
+ protoOf(TypeRefImpl).compareTo_kfa5id_k$ = function (other) {
1872
+ return this.$$delegate_0__1.compareTo_kfa5id_k$(other);
1873
+ };
1874
+ protoOf(TypeRefImpl).compareTo_hpufkf_k$ = function (other) {
1875
+ return this.compareTo_kfa5id_k$((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
1876
+ };
1877
+ protoOf(TypeRefImpl).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
1878
+ return this.$$delegate_0__1.equalsUsingVarCompleteNames(other, useVarCompleteName);
1879
+ };
1880
+ protoOf(TypeRefImpl).equals = function (other) {
1881
+ return this.$$delegate_0__1.equals(other);
1882
+ };
1883
+ protoOf(TypeRefImpl).structurallyEquals = function (other) {
1884
+ return this.$$delegate_0__1.structurallyEquals(other);
1885
+ };
1886
+ protoOf(TypeRefImpl).castToAtom = function () {
1887
+ return this.$$delegate_0__1.castToAtom();
1888
+ };
1889
+ protoOf(TypeRefImpl).castToClause = function () {
1890
+ return this.$$delegate_0__1.castToClause();
1891
+ };
1892
+ protoOf(TypeRefImpl).castToCons = function () {
1893
+ return this.$$delegate_0__1.castToCons();
1894
+ };
1895
+ protoOf(TypeRefImpl).castToConstant = function () {
1896
+ return this.$$delegate_0__1.castToConstant();
1897
+ };
1898
+ protoOf(TypeRefImpl).castToDirective = function () {
1899
+ return this.$$delegate_0__1.castToDirective();
1900
+ };
1901
+ protoOf(TypeRefImpl).castToEmptyList = function () {
1902
+ return this.$$delegate_0__1.castToEmptyList();
1903
+ };
1904
+ protoOf(TypeRefImpl).castToEmptyBlock = function () {
1905
+ return this.$$delegate_0__1.castToEmptyBlock();
1906
+ };
1907
+ protoOf(TypeRefImpl).castToFact = function () {
1908
+ return this.$$delegate_0__1.castToFact();
1909
+ };
1910
+ protoOf(TypeRefImpl).castToIndicator = function () {
1911
+ return this.$$delegate_0__1.castToIndicator();
1912
+ };
1913
+ protoOf(TypeRefImpl).castToInteger = function () {
1914
+ return this.$$delegate_0__1.castToInteger();
1915
+ };
1916
+ protoOf(TypeRefImpl).castToList = function () {
1917
+ return this.$$delegate_0__1.castToList();
1918
+ };
1919
+ protoOf(TypeRefImpl).castToNumeric = function () {
1920
+ return this.$$delegate_0__1.castToNumeric();
1921
+ };
1922
+ protoOf(TypeRefImpl).castToReal = function () {
1923
+ return this.$$delegate_0__1.castToReal();
1924
+ };
1925
+ protoOf(TypeRefImpl).castToRule = function () {
1926
+ return this.$$delegate_0__1.castToRule();
1927
+ };
1928
+ protoOf(TypeRefImpl).castToBlock = function () {
1929
+ return this.$$delegate_0__1.castToBlock();
1930
+ };
1931
+ protoOf(TypeRefImpl).castToStruct = function () {
1932
+ return this.$$delegate_0__1.castToStruct();
1933
+ };
1934
+ protoOf(TypeRefImpl).castToRecursive = function () {
1935
+ return this.$$delegate_0__1.castToRecursive();
1936
+ };
1937
+ protoOf(TypeRefImpl).castToTerm = function () {
1938
+ return this.$$delegate_0__1.castToTerm();
1939
+ };
1940
+ protoOf(TypeRefImpl).castToTruth = function () {
1941
+ return this.$$delegate_0__1.castToTruth();
1942
+ };
1943
+ protoOf(TypeRefImpl).castToTuple = function () {
1944
+ return this.$$delegate_0__1.castToTuple();
1945
+ };
1946
+ protoOf(TypeRefImpl).castToVar = function () {
1947
+ return this.$$delegate_0__1.castToVar();
1948
+ };
1949
+ protoOf(TypeRefImpl).asClause = function () {
1950
+ return this.$$delegate_0__1.asClause();
1951
+ };
1952
+ protoOf(TypeRefImpl).asCons = function () {
1953
+ return this.$$delegate_0__1.asCons();
1954
+ };
1955
+ protoOf(TypeRefImpl).asDirective = function () {
1956
+ return this.$$delegate_0__1.asDirective();
1957
+ };
1958
+ protoOf(TypeRefImpl).asEmptyList = function () {
1959
+ return this.$$delegate_0__1.asEmptyList();
1960
+ };
1961
+ protoOf(TypeRefImpl).asEmptyBlock = function () {
1962
+ return this.$$delegate_0__1.asEmptyBlock();
1963
+ };
1964
+ protoOf(TypeRefImpl).asFact = function () {
1965
+ return this.$$delegate_0__1.asFact();
1966
+ };
1967
+ protoOf(TypeRefImpl).asIndicator = function () {
1968
+ return this.$$delegate_0__1.asIndicator();
1969
+ };
1970
+ protoOf(TypeRefImpl).asInteger = function () {
1971
+ return this.$$delegate_0__1.asInteger();
1972
+ };
1973
+ protoOf(TypeRefImpl).asList = function () {
1974
+ return this.$$delegate_0__1.asList();
1975
+ };
1976
+ protoOf(TypeRefImpl).asNumeric = function () {
1977
+ return this.$$delegate_0__1.asNumeric();
1978
+ };
1979
+ protoOf(TypeRefImpl).asReal = function () {
1980
+ return this.$$delegate_0__1.asReal();
1981
+ };
1982
+ protoOf(TypeRefImpl).asRule = function () {
1983
+ return this.$$delegate_0__1.asRule();
1984
+ };
1985
+ protoOf(TypeRefImpl).asBlock = function () {
1986
+ return this.$$delegate_0__1.asBlock();
1987
+ };
1988
+ protoOf(TypeRefImpl).asRecursive = function () {
1989
+ return this.$$delegate_0__1.asRecursive();
1990
+ };
1991
+ protoOf(TypeRefImpl).asTerm = function () {
1992
+ return this.$$delegate_0__1.asTerm();
1993
+ };
1994
+ protoOf(TypeRefImpl).asTruth = function () {
1995
+ return this.$$delegate_0__1.asTruth();
1996
+ };
1997
+ protoOf(TypeRefImpl).asTuple = function () {
1998
+ return this.$$delegate_0__1.asTuple();
1999
+ };
2000
+ protoOf(TypeRefImpl).asVar = function () {
2001
+ return this.$$delegate_0__1.asVar();
2002
+ };
2003
+ protoOf(TypeRefImpl).hashCode = function () {
2004
+ return this.$$delegate_0__1.hashCode();
2005
+ };
2006
+ protoOf(TypeRefImpl).toString = function () {
2007
+ return this.$$delegate_0__1.toString();
2008
+ };
2009
+ protoOf(TypeRefImpl).get_isVar_it73p0_k$ = function () {
2010
+ return this.$$delegate_0__1.get_isVar_it73p0_k$();
2011
+ };
2012
+ protoOf(TypeRefImpl).get_isTruth_zhwyo8_k$ = function () {
2013
+ return this.$$delegate_0__1.get_isTruth_zhwyo8_k$();
2014
+ };
2015
+ protoOf(TypeRefImpl).get_isRecursive_id8h1d_k$ = function () {
2016
+ return this.$$delegate_0__1.get_isRecursive_id8h1d_k$();
2017
+ };
2018
+ protoOf(TypeRefImpl).get_isNumber_x9n6xo_k$ = function () {
2019
+ return this.$$delegate_0__1.get_isNumber_x9n6xo_k$();
2020
+ };
2021
+ protoOf(TypeRefImpl).get_isInteger_vb3zt7_k$ = function () {
2022
+ return this.$$delegate_0__1.get_isInteger_vb3zt7_k$();
2023
+ };
2024
+ protoOf(TypeRefImpl).get_isReal_ew59f5_k$ = function () {
2025
+ return this.$$delegate_0__1.get_isReal_ew59f5_k$();
2026
+ };
2027
+ protoOf(TypeRefImpl).getTag = function (name) {
2028
+ return this.$$delegate_0__1.getTag(name);
2029
+ };
2030
+ protoOf(TypeRefImpl).resetTags = function (tags) {
2031
+ return this.$$delegate_0__1.resetTags(tags);
2032
+ };
2033
+ protoOf(TypeRefImpl).containsTag = function (name) {
2034
+ return this.$$delegate_0__1.containsTag(name);
2035
+ };
2036
+ protoOf(TypeRefImpl).get_tags_wousf6_k$ = function () {
2037
+ return this.$$delegate_0__1.get_tags_wousf6_k$();
2038
+ };
2039
+ protoOf(TypeRefImpl).get_isGround_twq4nu_k$ = function () {
2040
+ return this.$$delegate_0__1.get_isGround_twq4nu_k$();
2041
+ };
2042
+ function actuallyInvoke($this, $receiver, ref, method, resultTerm) {
2043
+ var result = ref.invoke_yaglp8_k$(get_termToObjectConverter($receiver), method.get_functor_75vgt2_k$(), method.get_argsList_cw1bs4_k$());
2044
+ var tmp;
2045
+ if (result instanceof Value) {
2046
+ tmp = Companion_getInstance_7().mgu_jyyt35_k$($receiver, resultTerm, $this.getInvocationResult_3mb3ft_k$(result));
2047
+ } else {
2048
+ tmp = Companion_getInstance_6().failed();
2049
+ }
2050
+ return tmp;
2051
+ }
2052
+ function AbstractInvoke(suffix) {
2053
+ Functional.call(this, 'invoke_' + suffix);
2054
+ }
2055
+ protoOf(AbstractInvoke).computeOneSubstitution_omzw8j_k$ = function (_this__u8e3s4, first, second, third) {
2056
+ Companion_getInstance_7().ensuringArgumentIsStruct_lk4yyp_k$(_this__u8e3s4, 0);
2057
+ Companion_getInstance_7().ensuringArgumentIsStruct_lk4yyp_k$(_this__u8e3s4, 1);
2058
+ var method = isInterface(second, Struct) ? second : THROW_CCE();
2059
+ var tmp$ret$0;
2060
+ $l$block: {
2061
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.catchingOopExceptions' call
2062
+ try {
2063
+ var tmp;
2064
+ if (isInterface(first, Ref)) {
2065
+ tmp = actuallyInvoke(this, _this__u8e3s4, first, method, third);
2066
+ } else {
2067
+ if (isInterface(first, Struct)) {
2068
+ var ref = findRefFromAlias(_this__u8e3s4, first);
2069
+ tmp = actuallyInvoke(this, _this__u8e3s4, ref, method, third);
2070
+ } else {
2071
+ tmp = Companion_getInstance_6().failed();
2072
+ }
2073
+ }
2074
+ tmp$ret$0 = tmp;
2075
+ break $l$block;
2076
+ } catch ($p) {
2077
+ if ($p instanceof OopException) {
2078
+ var e = $p;
2079
+ throw e.toLogicError_fiiu4e_k$(_this__u8e3s4.context, _this__u8e3s4.signature);
2080
+ } else {
2081
+ if ($p instanceof ResolutionException) {
2082
+ var e_0 = $p;
2083
+ throw e_0;
2084
+ } else {
2085
+ if ($p instanceof Error) {
2086
+ var e_1 = $p;
2087
+ throw Companion_instance_4.forUncaughtKtException(_this__u8e3s4.context, e_1);
2088
+ } else {
2089
+ throw $p;
2090
+ }
2091
+ }
2092
+ }
2093
+ }
2094
+ }
2095
+ return tmp$ret$0;
2096
+ };
2097
+ protoOf(AbstractInvoke).computeOneSubstitution_c4wm0a_k$ = function (_this__u8e3s4, first, second, third) {
2098
+ return this.computeOneSubstitution_omzw8j_k$(_this__u8e3s4, first, second, third);
2099
+ };
2100
+ function AbstractIterableItems$computeOneSubstitution$lambda($converter) {
2101
+ return function (it) {
2102
+ return $converter.convert_i46eqg_k$(it);
2103
+ };
2104
+ }
2105
+ function AbstractIterableItems$computeOneSubstitution$lambda_0(it) {
2106
+ return Companion_getInstance_11().default_1.convert_2fnsng_k$(it);
2107
+ }
2108
+ function AbstractIterableItems(iterable, target) {
2109
+ Functional_0.call(this, iterable + '_items');
2110
+ this.target_1 = target;
2111
+ }
2112
+ protoOf(AbstractIterableItems).computeOneSubstitution_uplwem_k$ = function (_this__u8e3s4, first, second) {
2113
+ var tmp;
2114
+ var tmp_0;
2115
+ if (isInterface(first, Var)) {
2116
+ tmp_0 = isInterface(second, Var);
2117
+ } else {
2118
+ tmp_0 = false;
2119
+ }
2120
+ if (tmp_0) {
2121
+ // Inline function 'kotlin.let' call
2122
+ Companion_getInstance_7().ensuringAllArgumentsAreInstantiated_60kzw2_k$(_this__u8e3s4);
2123
+ tmp = Companion_getInstance_6().failed();
2124
+ } else {
2125
+ if (isInterface(second, List)) {
2126
+ var converter = get_termToObjectConverter(_this__u8e3s4);
2127
+ var tmp_1 = second.toSequence_lzjcyk_k$();
2128
+ var items = this.toIterable_j8vuup_k$(map(tmp_1, AbstractIterableItems$computeOneSubstitution$lambda(converter)));
2129
+ var objectRef = Companion_getInstance_10().of_u40ndk_k$(items);
2130
+ tmp = Companion_getInstance_7().mgu_jyyt35_k$(_this__u8e3s4, first, objectRef);
2131
+ } else {
2132
+ if (isInterface(first, ObjectRef)) {
2133
+ var obj = first.get_object_hhhtfs_k$();
2134
+ var tmp_2;
2135
+ if (this.get_isIterable_d32sbw_k$(obj)) {
2136
+ var tmp_3 = this.get_items_ay3mtl_k$(!(obj == null) ? obj : THROW_CCE());
2137
+ var items_0 = map(tmp_3, AbstractIterableItems$computeOneSubstitution$lambda_0);
2138
+ tmp_2 = Companion_getInstance_7().mgu_jyyt35_k$(_this__u8e3s4, second, Companion_instance_5.ofSequence(items_0));
2139
+ } else {
2140
+ tmp_2 = Companion_getInstance_6().failed();
2141
+ }
2142
+ tmp = tmp_2;
2143
+ } else {
2144
+ throw Companion_instance_1.forArgument_54essq_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_OBJECT_REFERENCE_getInstance(), first, 0);
2145
+ }
2146
+ }
2147
+ }
2148
+ return tmp;
2149
+ };
2150
+ protoOf(AbstractIterableItems).computeOneSubstitution_a2ny4b_k$ = function (_this__u8e3s4, first, second) {
2151
+ return this.computeOneSubstitution_uplwem_k$(_this__u8e3s4, first, second);
2152
+ };
2153
+ function ArrayItems() {
2154
+ ArrayItems_instance = this;
2155
+ AbstractIterableItems.call(this, 'array', PrimitiveClasses_getInstance().get_arrayClass_udg0fc_k$());
2156
+ this.help_1 = "`array_items(?ArrayRef, ?Items)`\n\nConverts between a Prolog list `Items` and an object reference `ArrayRef` wrapping a JVM/Kotlin array (`Object[]`) with the same elements. If `Items` is a list, each item is converted to an object (respecting `as` casts and `$Alias` references) and `ArrayRef` is unified with a reference to a fresh array; otherwise, if `ArrayRef` references an array, `Items` is unified with the list of its elements converted back to terms: strings become atoms, numbers become Prolog numbers, and other objects stay object references. Deterministic. Raises an instantiation error if both arguments are unbound, and a type error if `ArrayRef` is neither unbound nor an object reference; fails if it references something that is not an array.\n\n**Examples**\n\n```prolog\n?- array_items(A, [a, b, c]), array_items(A, L).\nL = [a, b, c].\n\n?- array_items(A, [1, 2.5]), array_items(A, L).\nL = [1, 2.5].\n\n?- new_object('java.util.ArrayList', [], L), array_items(L, Items).\nno.\n\n?- array_items(A, L).\nthrows error(instantiation_error, _).\n```";
2157
+ }
2158
+ protoOf(ArrayItems).get_help_won7nu_k$ = function () {
2159
+ return this.help_1;
2160
+ };
2161
+ protoOf(ArrayItems).toIterable_j8vuup_k$ = function (_this__u8e3s4) {
2162
+ // Inline function 'kotlin.collections.toTypedArray' call
2163
+ var this_0 = toList(_this__u8e3s4);
2164
+ return copyToArray(this_0);
2165
+ };
2166
+ protoOf(ArrayItems).get_isIterable_d32sbw_k$ = function (_this__u8e3s4) {
2167
+ return !(_this__u8e3s4 == null) ? isArray(_this__u8e3s4) : false;
2168
+ };
2169
+ protoOf(ArrayItems).get_items_dh9b15_k$ = function (_this__u8e3s4) {
2170
+ return asSequence_0(_this__u8e3s4);
2171
+ };
2172
+ protoOf(ArrayItems).get_items_ay3mtl_k$ = function (_this__u8e3s4) {
2173
+ return this.get_items_dh9b15_k$(isArray(_this__u8e3s4) ? _this__u8e3s4 : THROW_CCE());
2174
+ };
2175
+ var ArrayItems_instance;
2176
+ function ArrayItems_getInstance() {
2177
+ if (ArrayItems_instance == null)
2178
+ new ArrayItems();
2179
+ return ArrayItems_instance;
2180
+ }
2181
+ function Assign() {
2182
+ Assign_instance = this;
2183
+ Predicative.call(this, 'assign');
2184
+ this.help_1 = "`assign(+Ref, +Property, +Value)`\n\nWrites `Value` into the public mutable property named `Property` of the object (or, for a type reference, the static/companion member) referenced by `Ref`. `Ref` must be an object or type reference (not a `$Alias` term); `Value` is converted to the property's type (it may use `as` casts or be a `$Alias` reference). If several properties share the name, the one whose type best fits `Value` is chosen. Succeeds once. Raises a type error if `Ref` is not a reference or `Property` is not an atom, an existence error if no suitable mutable property exists, and a representation error if `Value` cannot be converted. This is what `Obj.prop := Value` (see `:=/2`) lowers to.\n\n**Examples**\n\n```prolog\n?- new_object('java.awt.Point', [1, 2], P), assign(P, x, 5), X := P.x.\nX = 5.\n\n?- new_object('java.awt.Point', [1, 2], P), assign(P, nope, 5).\nthrows error(existence_error(_, _), _).\n\n?- assign(foo, x, 5).\nthrows error(type_error(_, foo), _).\n```";
2185
+ }
2186
+ protoOf(Assign).get_help_won7nu_k$ = function () {
2187
+ return this.help_1;
2188
+ };
2189
+ protoOf(Assign).compute_ndmwim_k$ = function (_this__u8e3s4, first, second, third) {
2190
+ Companion_getInstance_7().ensuringArgumentIsAtom_5kuj97_k$(_this__u8e3s4, 0);
2191
+ Companion_getInstance_7().ensuringArgumentIsAtom_5kuj97_k$(_this__u8e3s4, 1);
2192
+ var tmp$ret$0;
2193
+ $l$block: {
2194
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.catchingOopExceptions' call
2195
+ try {
2196
+ var tmp;
2197
+ if (isInterface(first, Ref)) {
2198
+ tmp = first;
2199
+ } else {
2200
+ tmp = findRefFromAlias(_this__u8e3s4, isInterface(first, Atom) ? first : THROW_CCE());
2201
+ }
2202
+ var ref = tmp;
2203
+ var tmp_0;
2204
+ if (Companion_getInstance_7().match_tf8j11_k$(_this__u8e3s4, third, get_DEALIASING_TEMPLATE())) {
2205
+ tmp_0 = findRefFromAlias(_this__u8e3s4, isInterface(third, Struct) ? third : THROW_CCE());
2206
+ } else {
2207
+ tmp_0 = third;
2208
+ }
2209
+ var value = tmp_0;
2210
+ var tmp_1 = get_termToObjectConverter(_this__u8e3s4);
2211
+ tmp$ret$0 = ref.assign_9qr39z_k$(tmp_1, (isInterface(second, Atom) ? second : THROW_CCE()).get_value_j01efc_k$(), value);
2212
+ break $l$block;
2213
+ } catch ($p) {
2214
+ if ($p instanceof OopException) {
2215
+ var e = $p;
2216
+ throw e.toLogicError_fiiu4e_k$(_this__u8e3s4.context, _this__u8e3s4.signature);
2217
+ } else {
2218
+ if ($p instanceof ResolutionException) {
2219
+ var e_0 = $p;
2220
+ throw e_0;
2221
+ } else {
2222
+ if ($p instanceof Error) {
2223
+ var e_1 = $p;
2224
+ throw Companion_instance_4.forUncaughtKtException(_this__u8e3s4.context, e_1);
2225
+ } else {
2226
+ throw $p;
2227
+ }
2228
+ }
2229
+ }
2230
+ }
2231
+ }
2232
+ return tmp$ret$0;
2233
+ };
2234
+ protoOf(Assign).compute_rgfli7_k$ = function (_this__u8e3s4, first, second, third) {
2235
+ return this.compute_ndmwim_k$(_this__u8e3s4, first, second, third);
2236
+ };
2237
+ var Assign_instance;
2238
+ function Assign_getInstance() {
2239
+ if (Assign_instance == null)
2240
+ new Assign();
2241
+ return Assign_instance;
2242
+ }
2243
+ function cast($this, $receiver, term, type, result) {
2244
+ var tmp;
2245
+ if (type == null) {
2246
+ tmp = Companion_getInstance_6().failed();
2247
+ } else {
2248
+ var casted = get_termToObjectConverter($receiver).convertInto_62bmhg_k$(type, term);
2249
+ tmp = Companion_getInstance_7().mgu_jyyt35_k$($receiver, result, Companion_getInstance_10().of_u40ndk_k$(casted));
2250
+ }
2251
+ return tmp;
2252
+ }
2253
+ function Cast$computeAll$lambda(it) {
2254
+ return allSupertypes(it, false);
2255
+ }
2256
+ function Cast$computeAll$lambda_0($$this$catchingOopExceptions, $first, $third, $second) {
2257
+ return function (it) {
2258
+ return cast(Cast_getInstance(), $$this$catchingOopExceptions, $first, it, $third).plus(Companion_getInstance_7().mgu_jyyt35_k$($$this$catchingOopExceptions, $second, Companion_instance_12.of_7pw7zp_k$(it)));
2259
+ };
2260
+ }
2261
+ function Cast$computeAll$lambda_1($$this$catchingOopExceptions) {
2262
+ return function (it) {
2263
+ return $$this$catchingOopExceptions.replyWith(it, VOID, []);
2264
+ };
2265
+ }
2266
+ function Cast() {
2267
+ Cast_instance = this;
2268
+ TernaryRelation.call(this, 'cast');
2269
+ this.help_1 = '`cast(+Term, ?Type, ?ObjectRef)`\n\nConverts `Term` into an instance of `Type` and unifies `ObjectRef` with a reference to the resulting object. `Type` must be a type reference or a `$Alias` reference to a type (e.g. `$long`); any other bound value raises a type error, and an unregistered alias raises an existence error. Fails if `Term` cannot be converted into `Type`. If `Type` is unbound, it enumerates on backtracking every type `Term` can be converted into (and all their supertypes), binding `Type` to a type reference each time. Use it to force a specific representation, e.g. `cast(1, $long, L)` yields a reference to a `Long` rather than an `Int`; inside method or constructor arguments, the `X as Type` notation (`as/2`) forces a conversion inline.\n\n**Examples**\n\n```prolog\n?- cast(1, $long, R), object_ref(R).\nyes.\n\n?- cast(abc, $int, R).\nno.\n```';
2270
+ }
2271
+ protoOf(Cast).get_help_won7nu_k$ = function () {
2272
+ return this.help_1;
2273
+ };
2274
+ protoOf(Cast).computeAll_icj3zj_k$ = function (_this__u8e3s4, first, second, third) {
2275
+ var tmp$ret$0;
2276
+ $l$block: {
2277
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.catchingOopExceptions' call
2278
+ try {
2279
+ var tmp;
2280
+ if (isInterface(second, Struct)) {
2281
+ ensuringArgumentIsTypeRef(_this__u8e3s4, 1);
2282
+ var type = getArgumentAsTypeRef(_this__u8e3s4, 1);
2283
+ var tmp_0;
2284
+ try {
2285
+ var tmp_1 = Cast_getInstance();
2286
+ tmp_0 = sequenceOf(_this__u8e3s4.replyWith(cast(tmp_1, _this__u8e3s4, first, type == null ? null : type.get_type_wovaf7_k$(), third), VOID, []));
2287
+ } catch ($p) {
2288
+ var tmp_2;
2289
+ if ($p instanceof TermToObjectConversionException) {
2290
+ var _unused_var__etf5q3 = $p;
2291
+ tmp_2 = sequenceOf(_this__u8e3s4.replyFail(VOID, []));
2292
+ } else {
2293
+ throw $p;
2294
+ }
2295
+ tmp_0 = tmp_2;
2296
+ }
2297
+ tmp = tmp_0;
2298
+ } else {
2299
+ if (isInterface(second, Var)) {
2300
+ var tmp_3 = asSequence(get_termToObjectConverter(_this__u8e3s4).admissibleTypes_1kwmul_k$(first));
2301
+ var tmp_4 = distinct(flatMap(tmp_3, Cast$computeAll$lambda));
2302
+ var tmp_5 = map(tmp_4, Cast$computeAll$lambda_0(_this__u8e3s4, first, third, second));
2303
+ tmp = map(tmp_5, Cast$computeAll$lambda_1(_this__u8e3s4));
2304
+ } else {
2305
+ ensuringArgumentIsTypeRef(_this__u8e3s4, 1);
2306
+ tmp = sequenceOf(_this__u8e3s4.replyFail(VOID, []));
2307
+ }
2308
+ }
2309
+ tmp$ret$0 = tmp;
2310
+ break $l$block;
2311
+ } catch ($p_0) {
2312
+ if ($p_0 instanceof OopException) {
2313
+ var e = $p_0;
2314
+ throw e.toLogicError_fiiu4e_k$(_this__u8e3s4.context, _this__u8e3s4.signature);
2315
+ } else {
2316
+ if ($p_0 instanceof ResolutionException) {
2317
+ var e_0 = $p_0;
2318
+ throw e_0;
2319
+ } else {
2320
+ if ($p_0 instanceof Error) {
2321
+ var e_1 = $p_0;
2322
+ throw Companion_instance_4.forUncaughtKtException(_this__u8e3s4.context, e_1);
2323
+ } else {
2324
+ throw $p_0;
2325
+ }
2326
+ }
2327
+ }
2328
+ }
2329
+ }
2330
+ return tmp$ret$0;
2331
+ };
2332
+ protoOf(Cast).computeAll_1dzsi4_k$ = function (_this__u8e3s4, first, second, third) {
2333
+ return this.computeAll_icj3zj_k$(_this__u8e3s4, first, second, third);
2334
+ };
2335
+ var Cast_instance;
2336
+ function Cast_getInstance() {
2337
+ if (Cast_instance == null)
2338
+ new Cast();
2339
+ return Cast_instance;
2340
+ }
2341
+ function InvokeMethod() {
2342
+ InvokeMethod_instance = this;
2343
+ AbstractInvoke.call(this, 'method');
2344
+ this.help_1 = "`invoke_method(+Ref, +Method, ?Result)`\n\nInvokes a public member of the object referenced by `Ref` and unifies `Result` with the returned value, converted to a plain term when possible: strings and characters become atoms, numbers become numbers, booleans become `true`/`false`, `null` becomes the null reference, and any other object stays an object reference. `Ref` may be an object reference, a type reference (to call static or companion-object members) or a `$Alias` reference; `Method` is an atom (no arguments; also reads a property) or a compound `name(Arg1, ..., ArgN)`. Arguments are converted to objects and the best-matching overload is selected; use `as` casts to steer the choice. Succeeds once. Raises a type error if `Ref` is neither a reference nor a `$Alias` term, an existence error if the alias is not registered or no suitable method exists, a representation error if an argument cannot be converted, and a system error if the method itself throws. This is what `Obj.method(...)` (see `./2`) lowers to.\n\n**Examples**\n\n```prolog\n?- invoke_method($math, max(1, 2), M).\nM = 2.\n\n?- new_object('java.lang.StringBuilder', [abc], B), invoke_method(B, reverse, R), invoke_method(R, toString, S).\nS = cba.\n\n?- invoke_method($math, nope, M).\nthrows error(existence_error(_, _), _).\n\n?- invoke_method(foo, toString, R).\nthrows error(type_error(_, foo), _).\n```";
2345
+ }
2346
+ protoOf(InvokeMethod).get_help_won7nu_k$ = function () {
2347
+ return this.help_1;
2348
+ };
2349
+ protoOf(InvokeMethod).getInvocationResult_3mb3ft_k$ = function (_this__u8e3s4) {
2350
+ return _this__u8e3s4.toTerm_edaxrt_k$();
2351
+ };
2352
+ var InvokeMethod_instance;
2353
+ function InvokeMethod_getInstance() {
2354
+ if (InvokeMethod_instance == null)
2355
+ new InvokeMethod();
2356
+ return InvokeMethod_instance;
2357
+ }
2358
+ function InvokeStrict() {
2359
+ InvokeStrict_instance = this;
2360
+ AbstractInvoke.call(this, 'strict');
2361
+ this.help_1 = "`invoke_strict(+Ref, +Method, ?Result)`\n\nLike `invoke_method/3`, but `Result` is always unified with an object reference wrapping the returned value, even when it could be converted to a plain term (e.g. a string or number stays a reference). Useful to keep calling methods on the result with its exact runtime type preserved, e.g. a `String` you want to keep manipulating as a JVM object. Accepts the same `Ref` and `Method` shapes, and raises the same errors, as `invoke_method/3`.\n\n**Examples**\n\n```prolog\n?- new_object('java.lang.StringBuilder', [abc], B), invoke_strict(B, toString, S), object_ref(S), N := S.length.\nN = 3.\n\n?- new_object('java.lang.StringBuilder', [abc], B), invoke_method(B, toString, S).\nS = abc.\n\n?- invoke_strict($math, nope, R).\nthrows error(existence_error(_, _), _).\n```";
2362
+ }
2363
+ protoOf(InvokeStrict).get_help_won7nu_k$ = function () {
2364
+ return this.help_1;
2365
+ };
2366
+ protoOf(InvokeStrict).getInvocationResult_3mb3ft_k$ = function (_this__u8e3s4) {
2367
+ return _this__u8e3s4.asObjectRef_ji97lu_k$();
2368
+ };
2369
+ var InvokeStrict_instance;
2370
+ function InvokeStrict_getInstance() {
2371
+ if (InvokeStrict_instance == null)
2372
+ new InvokeStrict();
2373
+ return InvokeStrict_instance;
2374
+ }
2375
+ function ListItems() {
2376
+ ListItems_instance = this;
2377
+ AbstractIterableItems.call(this, 'list', getKClass(KtList));
2378
+ this.help_1 = "`list_items(?ListRef, ?Items)`\n\nConverts between a Prolog list `Items` and an object reference `ListRef` wrapping a JVM/Kotlin `List` with the same elements. If `Items` is a list, each item is converted to an object (respecting `as` casts and `$Alias` references) and `ListRef` is unified with a reference to a fresh list; otherwise, if `ListRef` references a `List`, `Items` is unified with its elements converted back to terms. Deterministic. Raises an instantiation error if both arguments are unbound, and a type error if `ListRef` is neither unbound nor an object reference; fails if it references something that is not a `List`.\n\n**Examples**\n\n```prolog\n?- list_items(L, [a, b]), N := L.size.\nN = 2.\n\n?- list_items(L, [1, 2.5]), list_items(L, Items).\nItems = [1, 2.5].\n\n?- new_object('java.util.ArrayList', [], L), L.add(x), L.add(y), list_items(L, Items).\nItems = [x, y].\n\n?- list_items(L, Items).\nthrows error(instantiation_error, _).\n```";
2379
+ }
2380
+ protoOf(ListItems).get_help_won7nu_k$ = function () {
2381
+ return this.help_1;
2382
+ };
2383
+ protoOf(ListItems).toIterable_j8vuup_k$ = function (_this__u8e3s4) {
2384
+ return toList(_this__u8e3s4);
2385
+ };
2386
+ protoOf(ListItems).get_isIterable_d32sbw_k$ = function (_this__u8e3s4) {
2387
+ return !(_this__u8e3s4 == null) ? isInterface(_this__u8e3s4, KtList) : false;
2388
+ };
2389
+ protoOf(ListItems).get_items_cgxsjz_k$ = function (_this__u8e3s4) {
2390
+ return asSequence(_this__u8e3s4);
2391
+ };
2392
+ protoOf(ListItems).get_items_ay3mtl_k$ = function (_this__u8e3s4) {
2393
+ return this.get_items_cgxsjz_k$(isInterface(_this__u8e3s4, KtList) ? _this__u8e3s4 : THROW_CCE());
2394
+ };
2395
+ var ListItems_instance;
2396
+ function ListItems_getInstance() {
2397
+ if (ListItems_instance == null)
2398
+ new ListItems();
2399
+ return ListItems_instance;
2400
+ }
2401
+ function NewObject3() {
2402
+ NewObject3_instance = this;
2403
+ Functional.call(this, 'new_object');
2404
+ this.help_1 = "`new_object(+Type, +Arguments, -ObjectRef)`\n\nInstantiates `Type` by calling its public constructor that best matches the list `Arguments`, and unifies `ObjectRef` with a reference to the new object. `Type` may be an atom holding a fully qualified type name (e.g. `'java.util.ArrayList'`), a type reference, or a `$Alias` reference to a type (e.g. `$arraylist`). Arguments are converted to objects as in `invoke_method/3`; use `as` casts to disambiguate overloaded constructors. Fails if the type name cannot be resolved. Raises a type error if `Type` is not callable or `Arguments` is not a list, an existence error if no constructor accepts the arguments, and a system error if the constructor throws.\n\n**Examples**\n\n```prolog\n?- new_object('java.util.ArrayList', [], L), L.add(a), N := L.size.\nN = 1.\n\n?- new_object($arraylist, [], L), list_items(L, Items).\nItems = [].\n\n?- new_object('no.such.Type', [], L).\nno.\n\n?- new_object('java.util.ArrayList', [a], L).\nthrows error(representation_error(_), _).\n\n?- new_object('java.util.ArrayList', [a, b, c], L).\nthrows error(existence_error(oop_constructor, _), _).\n```";
2405
+ }
2406
+ protoOf(NewObject3).get_help_won7nu_k$ = function () {
2407
+ return this.help_1;
2408
+ };
2409
+ protoOf(NewObject3).computeOneSubstitution_omzw8j_k$ = function (_this__u8e3s4, first, second, third) {
2410
+ Companion_getInstance_7().ensuringArgumentIsStruct_lk4yyp_k$(_this__u8e3s4, 0);
2411
+ Companion_getInstance_7().ensuringArgumentIsList_n20mbc_k$(_this__u8e3s4, 1);
2412
+ var tmp$ret$0;
2413
+ $l$block: {
2414
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.catchingOopExceptions' call
2415
+ try {
2416
+ var type = getArgumentAsTypeRef(_this__u8e3s4, 0);
2417
+ var arguments_0 = (isInterface(second, List) ? second : THROW_CCE()).toArray();
2418
+ var tmp1_safe_receiver = type == null ? null : type.create_4i78so_k$(get_termToObjectConverter(_this__u8e3s4), arguments_0.slice());
2419
+ var objectReference = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.asObjectRef_ji97lu_k$();
2420
+ var tmp;
2421
+ if (objectReference == null) {
2422
+ tmp = null;
2423
+ } else {
2424
+ // Inline function 'kotlin.let' call
2425
+ tmp = Companion_getInstance_7().mgu_jyyt35_k$(_this__u8e3s4, third, objectReference);
2426
+ }
2427
+ var tmp3_elvis_lhs = tmp;
2428
+ tmp$ret$0 = tmp3_elvis_lhs == null ? Companion_getInstance_6().failed() : tmp3_elvis_lhs;
2429
+ break $l$block;
2430
+ } catch ($p) {
2431
+ if ($p instanceof OopException) {
2432
+ var e = $p;
2433
+ throw e.toLogicError_fiiu4e_k$(_this__u8e3s4.context, _this__u8e3s4.signature);
2434
+ } else {
2435
+ if ($p instanceof ResolutionException) {
2436
+ var e_0 = $p;
2437
+ throw e_0;
2438
+ } else {
2439
+ if ($p instanceof Error) {
2440
+ var e_1 = $p;
2441
+ throw Companion_instance_4.forUncaughtKtException(_this__u8e3s4.context, e_1);
2442
+ } else {
2443
+ throw $p;
2444
+ }
2445
+ }
2446
+ }
2447
+ }
2448
+ }
2449
+ return tmp$ret$0;
2450
+ };
2451
+ protoOf(NewObject3).computeOneSubstitution_c4wm0a_k$ = function (_this__u8e3s4, first, second, third) {
2452
+ return this.computeOneSubstitution_omzw8j_k$(_this__u8e3s4, first, second, third);
2453
+ };
2454
+ var NewObject3_instance;
2455
+ function NewObject3_getInstance() {
2456
+ if (NewObject3_instance == null)
2457
+ new NewObject3();
2458
+ return NewObject3_instance;
2459
+ }
2460
+ function NullRef_0() {
2461
+ NullRef_instance = this;
2462
+ TypeTester.call(this, 'null_ref');
2463
+ this.help_1 = "`null_ref(@Term)`\n\nSucceeds if `Term` is the null reference, i.e. the term representing a JVM/Kotlin `null` value (as returned, for instance, by a method returning `null`). Fails otherwise, including when `Term` is unbound.\n\n**Examples**\n\n```prolog\n?- new_object('java.util.HashMap', [], M), invoke_method(M, get(k), V), null_ref(V).\nyes.\n\n?- null_ref(foo).\nno.\n\n?- null_ref(X).\nno.\n```";
2464
+ }
2465
+ protoOf(NullRef_0).get_help_won7nu_k$ = function () {
2466
+ return this.help_1;
2467
+ };
2468
+ protoOf(NullRef_0).testType_81tyi7_k$ = function (term) {
2469
+ return isInterface(term, NullRef);
2470
+ };
2471
+ var NullRef_instance;
2472
+ function NullRef_getInstance() {
2473
+ if (NullRef_instance == null)
2474
+ new NullRef_0();
2475
+ return NullRef_instance;
2476
+ }
2477
+ function ObjectRef_0() {
2478
+ ObjectRef_instance = this;
2479
+ TypeTester.call(this, 'object_ref');
2480
+ this.help_1 = "`object_ref(@Term)`\n\nSucceeds if `Term` is an object reference, i.e. a term wrapping a JVM/Kotlin object (rendered like `<object:java.util.ArrayList#123>`), as produced by `new_object/3`, `cast/3`, `invoke_strict/3` and friends. The null reference counts as an object reference. Fails otherwise, including when `Term` is unbound.\n\n**Examples**\n\n```prolog\n?- new_object('java.util.ArrayList', [], L), object_ref(L).\nyes.\n\n?- type('java.lang.String', T), object_ref(T).\nno.\n\n?- object_ref(X).\nno.\n```";
2481
+ }
2482
+ protoOf(ObjectRef_0).get_help_won7nu_k$ = function () {
2483
+ return this.help_1;
2484
+ };
2485
+ protoOf(ObjectRef_0).testType_81tyi7_k$ = function (term) {
2486
+ return isInterface(term, ObjectRef);
2487
+ };
2488
+ var ObjectRef_instance;
2489
+ function ObjectRef_getInstance() {
2490
+ if (ObjectRef_instance == null)
2491
+ new ObjectRef_0();
2492
+ return ObjectRef_instance;
2493
+ }
2494
+ function get_DEALIASING_TEMPLATE() {
2495
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2496
+ return DEALIASING_TEMPLATE;
2497
+ }
2498
+ var DEALIASING_TEMPLATE;
2499
+ function get_CAST_TEMPLATE() {
2500
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2501
+ return CAST_TEMPLATE;
2502
+ }
2503
+ var CAST_TEMPLATE;
2504
+ function findRefFromAlias(_this__u8e3s4, alias) {
2505
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2506
+ var tmp0_elvis_lhs = findRefFromAliasOrNull(_this__u8e3s4, alias);
2507
+ var tmp;
2508
+ if (tmp0_elvis_lhs == null) {
2509
+ throw new NoSuchAnAliasException(alias);
2510
+ } else {
2511
+ tmp = tmp0_elvis_lhs;
2512
+ }
2513
+ return tmp;
2514
+ }
2515
+ function get_termToObjectConverter(_this__u8e3s4) {
2516
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2517
+ var tmp = Companion_getInstance_13();
2518
+ return tmp.of$default_5ni81d_k$(VOID, _get_termToObjectConverter_$lambda_4bacq4(_this__u8e3s4));
2519
+ }
2520
+ function ensuringArgumentIsTypeRef(_this__u8e3s4, index) {
2521
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2522
+ var arg = _this__u8e3s4.arguments.get_c1px32_k$(index);
2523
+ var tmp;
2524
+ var tmp_0;
2525
+ if (matchesDealiasingTemplate(_this__u8e3s4, arg)) {
2526
+ var tmp_1 = findRefFromAlias(_this__u8e3s4, arg.castToStruct());
2527
+ tmp_0 = isInterface(tmp_1, TypeRef);
2528
+ } else {
2529
+ tmp_0 = false;
2530
+ }
2531
+ if (tmp_0) {
2532
+ tmp = _this__u8e3s4;
2533
+ } else {
2534
+ if (!isInterface(arg, TypeRef)) {
2535
+ throw Companion_instance_1.forArgument_54essq_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_TYPE_REFERENCE_getInstance(), arg, index);
2536
+ } else {
2537
+ tmp = _this__u8e3s4;
2538
+ }
2539
+ }
2540
+ return tmp;
2541
+ }
2542
+ function getArgumentAsTypeRef(_this__u8e3s4, index) {
2543
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2544
+ Companion_getInstance_7().ensuringArgumentIsStruct_lk4yyp_k$(_this__u8e3s4, index);
2545
+ var arg = _this__u8e3s4.arguments.get_c1px32_k$(index);
2546
+ var tmp;
2547
+ if (isInterface(arg, TypeRef)) {
2548
+ tmp = arg;
2549
+ } else {
2550
+ if (isInterface(arg, Atom)) {
2551
+ tmp = Companion_getInstance_14().default_1.typeRefFromName_8i9x2s_k$(arg.get_value_j01efc_k$());
2552
+ } else {
2553
+ if (isDealiasingExpression(_this__u8e3s4, arg)) {
2554
+ var tmp_0 = findRefFromAlias(_this__u8e3s4, arg.castToStruct());
2555
+ tmp = isInterface(tmp_0, TypeRef) ? tmp_0 : null;
2556
+ } else {
2557
+ ensuringArgumentIsTypeRef(_this__u8e3s4, 1);
2558
+ tmp = null;
2559
+ }
2560
+ }
2561
+ }
2562
+ return tmp;
2563
+ }
2564
+ function ensuringArgumentIsRef(_this__u8e3s4, index) {
2565
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2566
+ var arg = _this__u8e3s4.arguments.get_c1px32_k$(index);
2567
+ var tmp;
2568
+ if (matchesDealiasingTemplate(_this__u8e3s4, arg) && ensureAliasIsRegistered(_this__u8e3s4, arg.castToStruct())) {
2569
+ tmp = _this__u8e3s4;
2570
+ } else {
2571
+ if (!isInterface(arg, Ref)) {
2572
+ throw Companion_instance_1.forArgument_54essq_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_REFERENCE_getInstance(), arg, index);
2573
+ } else {
2574
+ tmp = _this__u8e3s4;
2575
+ }
2576
+ }
2577
+ return tmp;
2578
+ }
2579
+ function findRefFromAliasOrNull(_this__u8e3s4, alias) {
2580
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2581
+ var tmp;
2582
+ if (isDealiasingExpression(_this__u8e3s4, alias)) {
2583
+ var tmp_0 = alias.get(0);
2584
+ tmp = isInterface(tmp_0, Struct) ? tmp_0 : THROW_CCE();
2585
+ } else {
2586
+ throw new MalformedAliasException(alias);
2587
+ }
2588
+ var actualAlias = tmp;
2589
+ var ActualRef = Companion_getInstance_8().of('ActualRef');
2590
+ // Inline function 'kotlin.sequences.filterIsInstance' call
2591
+ var this_0 = _this__u8e3s4.solve(Companion_getInstance_9().of('alias', [actualAlias, ActualRef]));
2592
+ var tmp_1 = filter(this_0, findRefFromAliasOrNull$lambda);
2593
+ var tmp$ret$0 = isInterface(tmp_1, Sequence) ? tmp_1 : THROW_CCE();
2594
+ var tmp0_safe_receiver = firstOrNull(tmp$ret$0);
2595
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_solvedQuery_paqw6_k$();
2596
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.get(1);
2597
+ return tmp2_safe_receiver == null ? null : tmp2_safe_receiver.castTo_8vzplt_k$();
2598
+ }
2599
+ function matchesDealiasingTemplate(_this__u8e3s4, term) {
2600
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2601
+ var tmp;
2602
+ if (isInterface(term, Struct)) {
2603
+ tmp = Companion_getInstance_7().match_tf8j11_k$(_this__u8e3s4, term, get_DEALIASING_TEMPLATE());
2604
+ } else {
2605
+ tmp = false;
2606
+ }
2607
+ return tmp;
2608
+ }
2609
+ function isDealiasingExpression(_this__u8e3s4, term) {
2610
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2611
+ var tmp;
2612
+ var tmp_0;
2613
+ if (isInterface(term, Struct)) {
2614
+ tmp_0 = Companion_getInstance_7().match_tf8j11_k$(_this__u8e3s4, term, get_DEALIASING_TEMPLATE());
2615
+ } else {
2616
+ tmp_0 = false;
2617
+ }
2618
+ if (tmp_0) {
2619
+ var tmp_1 = term.get_argsList_cw1bs4_k$().get_c1px32_k$(0);
2620
+ tmp = isInterface(tmp_1, Atom);
2621
+ } else {
2622
+ tmp = false;
2623
+ }
2624
+ return tmp;
2625
+ }
2626
+ function ensureAliasIsRegistered(_this__u8e3s4, alias) {
2627
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2628
+ var tmp;
2629
+ if (isAliasRegistered(_this__u8e3s4, alias)) {
2630
+ tmp = true;
2631
+ } else {
2632
+ throw new NoSuchAnAliasException(alias);
2633
+ }
2634
+ return tmp;
2635
+ }
2636
+ function isAliasRegistered(_this__u8e3s4, alias) {
2637
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2638
+ return !(findRefFromAliasOrNull(_this__u8e3s4, alias) == null);
2639
+ }
2640
+ function _get_termToObjectConverter_$lambda_4bacq4($this_termToObjectConverter) {
2641
+ return function (it) {
2642
+ return findRefFromAliasOrNull($this_termToObjectConverter, it);
2643
+ };
2644
+ }
2645
+ function findRefFromAliasOrNull$lambda(it) {
2646
+ _init_properties_PrimitiveExtensions_kt__hfa11z();
2647
+ return !(it == null) ? isInterface(it, Yes) : false;
2648
+ }
2649
+ var properties_initialized_PrimitiveExtensions_kt_xhw6ad;
2650
+ function _init_properties_PrimitiveExtensions_kt__hfa11z() {
2651
+ if (!properties_initialized_PrimitiveExtensions_kt_xhw6ad) {
2652
+ properties_initialized_PrimitiveExtensions_kt_xhw6ad = true;
2653
+ DEALIASING_TEMPLATE = Companion_getInstance_9().of('$', [Companion_getInstance_8().of('Alias')]);
2654
+ CAST_TEMPLATE = Companion_getInstance_9().template('as', 2);
2655
+ }
2656
+ }
2657
+ function Ref_0() {
2658
+ Ref_instance = this;
2659
+ TypeTester.call(this, 'ref');
2660
+ this.help_1 = "`ref(@Term)`\n\nSucceeds if `Term` is a reference of any kind: either an object reference (see `object_ref/1`, including the null reference) or a type reference (see `type_ref/1`). Fails otherwise, including when `Term` is unbound. References are opaque atomic terms that can be passed around, unified, and used as receivers of method calls.\n\n**Examples**\n\n```prolog\n?- type('java.lang.String', T), ref(T).\nyes.\n\n?- new_object('java.util.ArrayList', [], L), ref(L).\nyes.\n\n?- ref(hello).\nno.\n```";
2661
+ }
2662
+ protoOf(Ref_0).get_help_won7nu_k$ = function () {
2663
+ return this.help_1;
2664
+ };
2665
+ protoOf(Ref_0).testType_81tyi7_k$ = function (term) {
2666
+ return isInterface(term, Ref);
2667
+ };
2668
+ var Ref_instance;
2669
+ function Ref_getInstance() {
2670
+ if (Ref_instance == null)
2671
+ new Ref_0();
2672
+ return Ref_instance;
2673
+ }
2674
+ function Register$computeOne$lambda($second, $first) {
2675
+ return function ($this$replySuccess) {
2676
+ var tmp = Companion_instance_15;
2677
+ var tmp_0 = isInterface($second, Struct) ? $second : THROW_CCE();
2678
+ $this$replySuccess.addStaticClauses$default_9uvwyb_k$([tmp.of_lt5e18_k$(tmp_0, isInterface($first, Ref) ? $first : THROW_CCE()).get_wrappedImplementation_qo1fgy_k$()]);
2679
+ return Unit_instance;
2680
+ };
2681
+ }
2682
+ function Register() {
2683
+ Register_instance = this;
2684
+ NonBacktrackable.call(this, 'register');
2685
+ this.help_1 = "`register(+Ref, +Alias)`\n\nRegisters the object or type reference `Ref` under the ground term `Alias`, by adding an `alias(Alias, Ref)` fact to the static knowledge base. Afterwards `$Alias` can be used wherever a reference is expected, e.g. as the receiver of a method call. Registering an already-used alias adds another fact, so the earliest registration keeps taking precedence until removed with `unregister/1`. Raises an instantiation error if an argument is unbound or `Alias` is not ground, and a type error if `Ref` is not a reference or `Alias` is not callable.\n\n**Examples**\n\n```prolog\n?- new_object('java.util.ArrayList', [], L), register(L, my_list).\nyes.\n\n?- $my_list.add(a), N := $my_list.size.\nN = 1.\n\n?- register(X, my_alias).\nthrows error(instantiation_error, _).\n```";
2686
+ }
2687
+ protoOf(Register).get_help_won7nu_k$ = function () {
2688
+ return this.help_1;
2689
+ };
2690
+ protoOf(Register).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first_0, second) {
2691
+ Companion_getInstance_7().ensuringAllArgumentsAreInstantiated_60kzw2_k$(_this__u8e3s4);
2692
+ ensuringArgumentIsRef(_this__u8e3s4, 0);
2693
+ Companion_getInstance_7().ensuringArgumentIsStruct_lk4yyp_k$(_this__u8e3s4, 1);
2694
+ if (!second.get_isGround_twq4nu_k$()) {
2695
+ throw Companion_instance_6.forArgument_7otpa_k$(_this__u8e3s4.context, _this__u8e3s4.signature, first(second.get_variables_75f0zy_k$()), 0);
2696
+ }
2697
+ return _this__u8e3s4.replySuccessBuildingSideEffects(VOID, VOID, Register$computeOne$lambda(second, first_0));
2698
+ };
2699
+ protoOf(Register).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
2700
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
2701
+ };
2702
+ var Register_instance;
2703
+ function Register_getInstance() {
2704
+ if (Register_instance == null)
2705
+ new Register();
2706
+ return Register_instance;
2707
+ }
2708
+ function SetItems() {
2709
+ SetItems_instance = this;
2710
+ AbstractIterableItems.call(this, 'set', getKClass(KtSet));
2711
+ this.help_1 = '`set_items(?SetRef, ?Items)`\n\nConverts between a Prolog list `Items` and an object reference `SetRef` wrapping a JVM/Kotlin `Set` with the same elements (duplicates are dropped, insertion order is kept). If `Items` is a list, each item is converted to an object (respecting `as` casts and `$Alias` references) and `SetRef` is unified with a reference to a fresh set; otherwise, if `SetRef` references a `Set`, `Items` is unified with its elements converted back to terms: strings become atoms, numbers become Prolog numbers, and other objects stay object references. Deterministic. Raises an instantiation error if both arguments are unbound, and a type error if `SetRef` is neither unbound nor an object reference; fails if it references something that is not a `Set`.\n\n**Examples**\n\n```prolog\n?- set_items(S, [a, b, b]), set_items(S, L).\nL = [a, b].\n\n?- set_items(S, [1, 1, 2.5]), set_items(S, L).\nL = [1, 2.5].\n\n?- set_items(S, [a, b]), N := S.size.\nN = 2.\n\n?- list_items(L, [a]), set_items(L, Items).\nno.\n```';
2712
+ }
2713
+ protoOf(SetItems).get_help_won7nu_k$ = function () {
2714
+ return this.help_1;
2715
+ };
2716
+ protoOf(SetItems).toIterable_j8vuup_k$ = function (_this__u8e3s4) {
2717
+ return toSet(_this__u8e3s4);
2718
+ };
2719
+ protoOf(SetItems).get_isIterable_d32sbw_k$ = function (_this__u8e3s4) {
2720
+ return !(_this__u8e3s4 == null) ? isInterface(_this__u8e3s4, KtSet) : false;
2721
+ };
2722
+ protoOf(SetItems).get_items_ma8yx5_k$ = function (_this__u8e3s4) {
2723
+ return asSequence(_this__u8e3s4);
2724
+ };
2725
+ protoOf(SetItems).get_items_ay3mtl_k$ = function (_this__u8e3s4) {
2726
+ return this.get_items_ma8yx5_k$(isInterface(_this__u8e3s4, KtSet) ? _this__u8e3s4 : THROW_CCE());
2727
+ };
2728
+ var SetItems_instance;
2729
+ function SetItems_getInstance() {
2730
+ if (SetItems_instance == null)
2731
+ new SetItems();
2732
+ return SetItems_instance;
2733
+ }
2734
+ function Type() {
2735
+ Type_instance = this;
2736
+ Functional_0.call(this, 'type');
2737
+ this.help_1 = "`type(?TypeName, ?TypeRef)`\n\nConverts between an atom `TypeName` and a type reference `TypeRef` to the class it names. Given an atom holding a fully qualified type name (e.g. `'java.lang.String'`), unifies `TypeRef` with a reference to that class, failing if no such class exists; given a type reference, unifies `TypeName` with the name of its class. Deterministic. Raises an instantiation error if both arguments are unbound and a type error if the bound argument has the wrong shape.\n\n**Examples**\n\n```prolog\n?- type('java.util.ArrayList', T), new_object(T, [], L), N := L.size.\nN = 0.\n\n?- type('java.util.ArrayList', T), type(Name, T).\nName = 'ArrayList'.\n\n?- type('no.such.Type', T).\nno.\n\n?- type(Name, 'java.lang.String').\nthrows error(type_error(type_reference, 'java.lang.String'), _).\n```";
2738
+ this.typeFactory_1 = Companion_getInstance_14().default_1;
2739
+ }
2740
+ protoOf(Type).get_help_won7nu_k$ = function () {
2741
+ return this.help_1;
2742
+ };
2743
+ protoOf(Type).computeOneSubstitution_uplwem_k$ = function (_this__u8e3s4, first, second) {
2744
+ var tmp$ret$0;
2745
+ $l$block: {
2746
+ // Inline function 'it.unibo.tuprolog.solve.libs.oop.primitives.catchingOopExceptions' call
2747
+ try {
2748
+ var tmp;
2749
+ var tmp_0;
2750
+ if (isInterface(first, Var)) {
2751
+ tmp_0 = isInterface(second, Var);
2752
+ } else {
2753
+ tmp_0 = false;
2754
+ }
2755
+ if (tmp_0) {
2756
+ Companion_getInstance_7().ensuringArgumentIsInstantiated_dpjvac_k$(_this__u8e3s4, 0);
2757
+ tmp = Companion_getInstance_6().failed();
2758
+ } else {
2759
+ if (isInterface(first, Var)) {
2760
+ Companion_getInstance_7().ensuringArgumentIsAtom_5kuj97_k$(_this__u8e3s4, 1);
2761
+ ensuringArgumentIsTypeRef(_this__u8e3s4, 1);
2762
+ var tmp_1 = Companion_getInstance_7();
2763
+ var tmp_2 = Companion_getInstance_0();
2764
+ tmp = tmp_1.mgu_jyyt35_k$(_this__u8e3s4, first, tmp_2.of(get_name((isInterface(second, TypeRef) ? second : THROW_CCE()).get_type_wovaf7_k$())));
2765
+ } else {
2766
+ if (isInterface(second, Var)) {
2767
+ Companion_getInstance_7().ensuringArgumentIsAtom_5kuj97_k$(_this__u8e3s4, 0);
2768
+ var tmp_3 = Type_getInstance().typeFactory_1;
2769
+ var tmp0_safe_receiver = tmp_3.typeRefFromName_8i9x2s_k$((isInterface(first, Atom) ? first : THROW_CCE()).get_value_j01efc_k$());
2770
+ var tmp_4;
2771
+ if (tmp0_safe_receiver == null) {
2772
+ tmp_4 = null;
2773
+ } else {
2774
+ // Inline function 'kotlin.let' call
2775
+ tmp_4 = Companion_getInstance_7().mgu_jyyt35_k$(_this__u8e3s4, second, tmp0_safe_receiver);
2776
+ }
2777
+ var tmp1_elvis_lhs = tmp_4;
2778
+ tmp = tmp1_elvis_lhs == null ? Companion_getInstance_6().failed() : tmp1_elvis_lhs;
2779
+ } else {
2780
+ Companion_getInstance_7().ensuringArgumentIsAtom_5kuj97_k$(_this__u8e3s4, 0);
2781
+ tmp = Companion_getInstance_6().failed();
2782
+ }
2783
+ }
2784
+ }
2785
+ tmp$ret$0 = tmp;
2786
+ break $l$block;
2787
+ } catch ($p) {
2788
+ if ($p instanceof OopException) {
2789
+ var e = $p;
2790
+ throw e.toLogicError_fiiu4e_k$(_this__u8e3s4.context, _this__u8e3s4.signature);
2791
+ } else {
2792
+ if ($p instanceof ResolutionException) {
2793
+ var e_0 = $p;
2794
+ throw e_0;
2795
+ } else {
2796
+ if ($p instanceof Error) {
2797
+ var e_1 = $p;
2798
+ throw Companion_instance_4.forUncaughtKtException(_this__u8e3s4.context, e_1);
2799
+ } else {
2800
+ throw $p;
2801
+ }
2802
+ }
2803
+ }
2804
+ }
2805
+ }
2806
+ return tmp$ret$0;
2807
+ };
2808
+ protoOf(Type).computeOneSubstitution_a2ny4b_k$ = function (_this__u8e3s4, first, second) {
2809
+ return this.computeOneSubstitution_uplwem_k$(_this__u8e3s4, first, second);
2810
+ };
2811
+ var Type_instance;
2812
+ function Type_getInstance() {
2813
+ if (Type_instance == null)
2814
+ new Type();
2815
+ return Type_instance;
2816
+ }
2817
+ function TypeRef_0() {
2818
+ TypeRef_instance = this;
2819
+ TypeTester.call(this, 'type_ref');
2820
+ this.help_1 = "`type_ref(@Term)`\n\nSucceeds if `Term` is a type reference, i.e. a term wrapping a JVM/Kotlin class (rendered like `<type:java.lang.String>`), as produced by `type/2` or by `$Alias` references to types such as `$string`. Type references can be used to instantiate a class (`new_object/3`) or to invoke its static members. Fails otherwise, including when `Term` is unbound.\n\n**Examples**\n\n```prolog\n?- alias(string, T), type_ref(T).\nyes.\n\n?- type_ref('java.lang.String').\nno.\n\n?- new_object('java.util.ArrayList', [], L), type_ref(L).\nno.\n```";
2821
+ }
2822
+ protoOf(TypeRef_0).get_help_won7nu_k$ = function () {
2823
+ return this.help_1;
2824
+ };
2825
+ protoOf(TypeRef_0).testType_81tyi7_k$ = function (term) {
2826
+ return isInterface(term, TypeRef);
2827
+ };
2828
+ var TypeRef_instance;
2829
+ function TypeRef_getInstance() {
2830
+ if (TypeRef_instance == null)
2831
+ new TypeRef_0();
2832
+ return TypeRef_instance;
2833
+ }
2834
+ function Unregister$computeOne$lambda($first) {
2835
+ return function (it) {
2836
+ return it.get_head_won7e1_k$().get(0).equals($first);
2837
+ };
2838
+ }
2839
+ function Unregister$computeOne$lambda_0($toBeRemoved) {
2840
+ return function ($this$replySuccess) {
2841
+ $this$replySuccess.removeStaticClauses_rn03rg_k$($toBeRemoved);
2842
+ return Unit_instance;
2843
+ };
2844
+ }
2845
+ function Unregister() {
2846
+ Unregister_instance = this;
2847
+ NonBacktrackable_0.call(this, 'unregister');
2848
+ this.help_1 = "`unregister(+Alias)`\n\nRemoves every `alias(Alias, _)` fact for the ground term `Alias` from the static knowledge base, undoing `register/2` (it can also remove the library's default aliases, such as `string` or `stdout`). Fails if no such alias is registered. Raises a type error if `Alias` is unbound or not callable, and an instantiation error if it is not ground.\n\n**Examples**\n\n```prolog\n?- new_object('java.util.ArrayList', [], L), register(L, my_list).\nyes.\n\n?- unregister(my_list).\nyes.\n\n?- alias(my_list, R).\nno.\n\n?- unregister(my_list).\nno.\n```";
2849
+ }
2850
+ protoOf(Unregister).get_help_won7nu_k$ = function () {
2851
+ return this.help_1;
2852
+ };
2853
+ protoOf(Unregister).computeOne_6dkmes_k$ = function (_this__u8e3s4, first_0) {
2854
+ Companion_getInstance_7().ensuringArgumentIsStruct_lk4yyp_k$(_this__u8e3s4, 0);
2855
+ if (!first_0.get_isGround_twq4nu_k$()) {
2856
+ throw Companion_instance_6.forArgument_7otpa_k$(_this__u8e3s4.context, _this__u8e3s4.signature, first(first_0.get_variables_75f0zy_k$()), 0);
2857
+ }
2858
+ var pattern = Companion_getInstance_9().of('alias', [first_0, Companion_getInstance_8().anonymous()]);
2859
+ var tmp = _this__u8e3s4.context.get_staticKb_a01l1u_k$().getByHead(pattern);
2860
+ var toBeRemoved = toList(filter(tmp, Unregister$computeOne$lambda(first_0)));
2861
+ var tmp_0;
2862
+ if (toBeRemoved.isEmpty_y1axqb_k$()) {
2863
+ tmp_0 = _this__u8e3s4.replyFail(VOID, []);
2864
+ } else {
2865
+ tmp_0 = _this__u8e3s4.replySuccessBuildingSideEffects(VOID, VOID, Unregister$computeOne$lambda_0(toBeRemoved));
2866
+ }
2867
+ return tmp_0;
2868
+ };
2869
+ protoOf(Unregister).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2870
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2871
+ };
2872
+ var Unregister_instance;
2873
+ function Unregister_getInstance() {
2874
+ if (Unregister_instance == null)
2875
+ new Unregister();
2876
+ return Unregister_instance;
2877
+ }
2878
+ function Companion_7() {
2879
+ this.FUNCTOR_1 = 'alias';
2880
+ }
2881
+ protoOf(Companion_7).forType_lwe2s5_k$ = function (alias, type) {
2882
+ return new Alias(Companion_getInstance_0().of(alias), Companion_instance_12.of_7pw7zp_k$(type));
2883
+ };
2884
+ protoOf(Companion_7).of_lt5e18_k$ = function (alias, ref) {
2885
+ return new Alias(alias, ref);
2886
+ };
2887
+ var Companion_instance_15;
2888
+ function Companion_getInstance_18() {
2889
+ return Companion_instance_15;
2890
+ }
2891
+ function Alias(alias, ref) {
2892
+ RuleWrapper_init_$Init$('alias', 2, VOID, this);
2893
+ this.alias_1 = alias;
2894
+ this.ref_1 = ref;
2895
+ this.help_1 = "`alias(?Alias, ?Ref)`\n\nAssociates a ground term `Alias` with an object or type reference `Ref`, so that `$Alias` can stand for `Ref` wherever a reference is expected (as a method receiver, as a constructor or method argument, or as the type in `as` casts and `cast/3`). The library ships facts for common types (`string`, `array`, `list`, `arraylist`, `map`, `hashmap`, `int`, `integer`, `double`, `float`, `long`, `short`, `byte`, `char`, `bool`, `boolean`, `any`, `nothing`, `big_integer`, `big_decimal`) and, on the JVM, `system` and `math` (types) plus `stdout`, `stderr` and `stdin` (objects). Querying it enumerates the registered aliases on backtracking; add or remove aliases with `register/2` and `unregister/1`.\n\n**Examples**\n\n```prolog\n?- alias(A, _).\nA = string ; A = array ; A = list.\n\n?- alias(string, T), type(Name, T).\nName = 'String'.\n\n?- alias(nope, R).\nno.\n```";
2896
+ // Inline function 'kotlin.require' call
2897
+ if (!this.alias_1.get_isGround_twq4nu_k$()) {
2898
+ var message = 'Alias must be a ground term, got: ' + this.alias_1.toString();
2899
+ throw IllegalArgumentException_init_$Create$(toString_0(message));
2900
+ }
2901
+ }
2902
+ protoOf(Alias).get_help_won7nu_k$ = function () {
2903
+ return this.help_1;
2904
+ };
2905
+ protoOf(Alias).get_head_btpmqe_k$ = function (_this__u8e3s4) {
2906
+ return toList(sequenceOf_0([this.alias_1, this.ref_1]));
2907
+ };
2908
+ function _get_R__7mlo3j($this) {
2909
+ var tmp = KProperty1;
2910
+ return $this.R$delegate_1.getValue($this, getPropertyCallableRef('R', 1, tmp, ColonEquals$Cast$_get_R_$ref_879xch(), null));
2911
+ }
2912
+ function _get_X__7mlo8p($this) {
2913
+ var tmp = KProperty1;
2914
+ return $this.X$delegate_1.getValue($this, getPropertyCallableRef('X', 1, tmp, ColonEquals$Cast$_get_X_$ref_5d06zb(), null));
2915
+ }
2916
+ function _get_Y__7mlo9k($this) {
2917
+ var tmp = KProperty1;
2918
+ return $this.Y$delegate_1.getValue($this, getPropertyCallableRef('Y', 1, tmp, ColonEquals$Cast$_get_Y_$ref_4vykl4(), null));
2919
+ }
2920
+ function _get_T__7mlo59($this) {
2921
+ var tmp = KProperty1;
2922
+ return $this.T$delegate_1.getValue($this, getPropertyCallableRef('T', 1, tmp, ColonEquals$Cast$_get_T_$ref_796ok3(), null));
2923
+ }
2924
+ function ColonEquals$Cast$_get_R_$ref_879xch() {
2925
+ return constructCallableReference(function (p0) {
2926
+ return _get_R__7mlo3j(p0);
2927
+ }, 1, 0, 132);
2928
+ }
2929
+ function ColonEquals$Cast$_get_X_$ref_5d06zb() {
2930
+ return constructCallableReference(function (p0) {
2931
+ return _get_X__7mlo8p(p0);
2932
+ }, 1, 0, 133);
2933
+ }
2934
+ function ColonEquals$Cast$_get_Y_$ref_4vykl4() {
2935
+ return constructCallableReference(function (p0) {
2936
+ return _get_Y__7mlo9k(p0);
2937
+ }, 1, 0, 134);
2938
+ }
2939
+ function ColonEquals$Cast$_get_T_$ref_796ok3() {
2940
+ return constructCallableReference(function (p0) {
2941
+ return _get_T__7mlo59(p0);
2942
+ }, 1, 0, 135);
2943
+ }
2944
+ function _get_R__7mlo3j_0($this) {
2945
+ var tmp = KProperty1;
2946
+ return $this.R$delegate_1.getValue($this, getPropertyCallableRef('R', 1, tmp, ColonEquals$Invocation$_get_R_$ref_tlu5kw(), null));
2947
+ }
2948
+ function _get_M__7mlnz8($this) {
2949
+ var tmp = KProperty1;
2950
+ return $this.M$delegate_1.getValue($this, getPropertyCallableRef('M', 1, tmp, ColonEquals$Invocation$_get_M_$ref_vz29jv(), null));
2951
+ }
2952
+ function ColonEquals$Invocation$_get_R_$ref_tlu5kw() {
2953
+ return constructCallableReference(function (p0) {
2954
+ return _get_R__7mlo3j_0(p0);
2955
+ }, 1, 0, 136);
2956
+ }
2957
+ function ColonEquals$Invocation$_get_M_$ref_vz29jv() {
2958
+ return constructCallableReference(function (p0) {
2959
+ return _get_M__7mlnz8(p0);
2960
+ }, 1, 0, 137);
2961
+ }
2962
+ function _get_C__7mlnqm($this) {
2963
+ var tmp = KProperty1;
2964
+ return $this.C$delegate_1.getValue($this, getPropertyCallableRef('C', 1, tmp, ColonEquals$Assignment$_get_C_$ref_kw9fvw(), null));
2965
+ }
2966
+ function _get_P__7mlo1t($this) {
2967
+ var tmp = KProperty1;
2968
+ return $this.P$delegate_1.getValue($this, getPropertyCallableRef('P', 1, tmp, ColonEquals$Assignment$_get_P_$ref_r1uj0f(), null));
2969
+ }
2970
+ function _get_R__7mlo3j_1($this) {
2971
+ var tmp = KProperty1;
2972
+ return $this.R$delegate_1.getValue($this, getPropertyCallableRef('R', 1, tmp, ColonEquals$Assignment$_get_R_$ref_rzxrst(), null));
2973
+ }
2974
+ function _get_V__7mlo6z($this) {
2975
+ var tmp = KProperty1;
2976
+ return $this.V$delegate_1.getValue($this, getPropertyCallableRef('V', 1, tmp, ColonEquals$Assignment$_get_V_$ref_tw49dl(), null));
2977
+ }
2978
+ function ColonEquals$Assignment$_get_C_$ref_kw9fvw() {
2979
+ return constructCallableReference(function (p0) {
2980
+ return _get_C__7mlnqm(p0);
2981
+ }, 1, 0, 138);
2982
+ }
2983
+ function ColonEquals$Assignment$_get_P_$ref_r1uj0f() {
2984
+ return constructCallableReference(function (p0) {
2985
+ return _get_P__7mlo1t(p0);
2986
+ }, 1, 0, 139);
2987
+ }
2988
+ function ColonEquals$Assignment$_get_R_$ref_rzxrst() {
2989
+ return constructCallableReference(function (p0) {
2990
+ return _get_R__7mlo3j_1(p0);
2991
+ }, 1, 0, 140);
2992
+ }
2993
+ function ColonEquals$Assignment$_get_V_$ref_tw49dl() {
2994
+ return constructCallableReference(function (p0) {
2995
+ return _get_V__7mlo6z(p0);
2996
+ }, 1, 0, 141);
2997
+ }
2998
+ function Cast_0() {
2999
+ Cast_instance_0 = this;
3000
+ ColonEquals.call(this);
3001
+ this.R$delegate_1 = this.variables_1;
3002
+ this.X$delegate_1 = this.variables_1;
3003
+ this.Y$delegate_1 = this.variables_1;
3004
+ this.T$delegate_1 = this.variables_1;
3005
+ }
3006
+ protoOf(Cast_0).get_head_btpmqe_k$ = function (_this__u8e3s4) {
3007
+ return listOf([_get_R__7mlo3j(this), _this__u8e3s4.structOf('as', [_get_X__7mlo8p(this), _get_T__7mlo59(this)])]);
3008
+ };
3009
+ protoOf(Cast_0).get_body_3ji99k_k$ = function (_this__u8e3s4) {
3010
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3011
+ var tmp$ret$0 = Var_getInstance().signature.name;
3012
+ var tmp = _this__u8e3s4.structOf(tmp$ret$0, [_get_R__7mlo3j(this)]);
3013
+ var tmp_0 = _this__u8e3s4.atomOf('!');
3014
+ var tmp_1 = _this__u8e3s4.structOf('fluent_reduce', [_get_X__7mlo8p(this), _get_Y__7mlo9k(this)]);
3015
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3016
+ var tmp$ret$1 = Cast_getInstance().signature.name;
3017
+ 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)])]);
3018
+ };
3019
+ var Cast_instance_0;
3020
+ function Cast_getInstance_0() {
3021
+ if (Cast_instance_0 == null)
3022
+ new Cast_0();
3023
+ return Cast_instance_0;
3024
+ }
3025
+ function Invocation() {
3026
+ Invocation_instance = this;
3027
+ ColonEquals.call(this);
3028
+ this.R$delegate_1 = this.variables_1;
3029
+ this.M$delegate_1 = this.variables_1;
3030
+ }
3031
+ protoOf(Invocation).get_head_btpmqe_k$ = function (_this__u8e3s4) {
3032
+ return listOf([_get_R__7mlo3j_0(this), _get_M__7mlnz8(this)]);
3033
+ };
3034
+ protoOf(Invocation).get_body_3ji99k_k$ = function (_this__u8e3s4) {
3035
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3036
+ var tmp$ret$0 = Var_getInstance().signature.name;
3037
+ return _this__u8e3s4.tupleOf([_this__u8e3s4.structOf(tmp$ret$0, [_get_R__7mlo3j_0(this)]), _this__u8e3s4.atomOf('!'), _this__u8e3s4.structOf('fluent_reduce', [_get_M__7mlnz8(this), _get_R__7mlo3j_0(this)])]);
3038
+ };
3039
+ var Invocation_instance;
3040
+ function Invocation_getInstance() {
3041
+ if (Invocation_instance == null)
3042
+ new Invocation();
3043
+ return Invocation_instance;
3044
+ }
3045
+ function Assignment() {
3046
+ Assignment_instance = this;
3047
+ ColonEquals.call(this);
3048
+ this.C$delegate_1 = this.variables_1;
3049
+ this.P$delegate_1 = this.variables_1;
3050
+ this.R$delegate_1 = this.variables_1;
3051
+ this.V$delegate_1 = this.variables_1;
3052
+ }
3053
+ protoOf(Assignment).get_head_btpmqe_k$ = function (_this__u8e3s4) {
3054
+ return listOf([_get_C__7mlnqm(this), _get_V__7mlo6z(this)]);
3055
+ };
3056
+ protoOf(Assignment).get_body_3ji99k_k$ = function (_this__u8e3s4) {
3057
+ var tmp = _this__u8e3s4.structOf('property_reduce', [_get_C__7mlnqm(this), _get_R__7mlo3j_1(this), _get_P__7mlo1t(this)]);
3058
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3059
+ var tmp$ret$0 = Assign_getInstance().signature.name;
3060
+ return _this__u8e3s4.tupleOf([tmp, _this__u8e3s4.structOf(tmp$ret$0, [_get_R__7mlo3j_1(this), _get_P__7mlo1t(this), _get_V__7mlo6z(this)])]);
3061
+ };
3062
+ var Assignment_instance;
3063
+ function Assignment_getInstance() {
3064
+ if (Assignment_instance == null)
3065
+ new Assignment();
3066
+ return Assignment_instance;
3067
+ }
3068
+ function ColonEquals() {
3069
+ RuleWrapper_init_$Init$(':=', 2, VOID, this);
3070
+ this.help_1 = "`?Target := +Expression`\n\nFluent evaluation and assignment. If `Target` is unbound, `Target := Receiver.m1(...).m2` evaluates the method/property chain on the right (see `./2`) and binds `Target` to the converted result of the last access; a right-hand side that is not a chain is just unified with `Target` (e.g. `X := 5`). `Target := Term as Type` additionally converts the (evaluated) `Term` via `cast/3`, binding `Target` to an object reference; here `Type` must be a type reference or a `$Alias` such as `$long`, and since `as` binds tighter than `.`, a chain must be parenthesised: `R := (Obj.size) as $long`. If `Target` is bound, it must be a chain `Receiver.Property` (possibly longer), and `:=` evaluates everything but the last access and then assigns `Expression` to `Property` via `assign/3`.\n\n**Examples**\n\n```prolog\n?- new_object('java.util.ArrayList', [], L), L.add(a), N := L.size.\nN = 1.\n\n?- X := 5.\nX = 5.\n\n?- new_object('java.util.ArrayList', [], L), R := (L.size) as $long, object_ref(R).\nyes.\n\n?- new_object('java.awt.Point', [1, 2], P), P.x := 7, X := P.x.\nX = 7.\n```";
3071
+ }
3072
+ protoOf(ColonEquals).get_help_won7nu_k$ = function () {
3073
+ return this.help_1;
3074
+ };
3075
+ function _get_Method__a3idyi($this) {
3076
+ var tmp = KProperty1;
3077
+ return $this.Method$delegate_1.getValue($this, getPropertyCallableRef('Method', 1, tmp, Dot$_get_Method_$ref_b7a4zw(), null));
3078
+ }
3079
+ function _get_Ref__e5vi4e($this) {
3080
+ var tmp = KProperty1;
3081
+ return $this.Ref$delegate_1.getValue($this, getPropertyCallableRef('Ref', 1, tmp, Dot$_get_Ref_$ref_33uzaq(), null));
3082
+ }
3083
+ function Dot$_get_Method_$ref_b7a4zw() {
3084
+ return constructCallableReference(function (p0) {
3085
+ return _get_Method__a3idyi(p0);
3086
+ }, 1, 0, 142);
3087
+ }
3088
+ function Dot$_get_Ref_$ref_33uzaq() {
3089
+ return constructCallableReference(function (p0) {
3090
+ return _get_Ref__e5vi4e(p0);
3091
+ }, 1, 0, 143);
3092
+ }
3093
+ function Dot() {
3094
+ Dot_instance = this;
3095
+ RuleWrapper_init_$Init$('.', 2, VOID, this);
3096
+ this.help_1 = "`+Receiver.+Message`\n\nFluent member access: invokes `Message` on the object, type, or `$Alias` referenced by `Receiver`, discarding the result. `Message` is an atom (a no-argument method, or a property to read) or a compound `name(Arg1, ..., ArgN)`; arguments are converted to objects, with `as` casts to steer overload selection. Since `.` is right-associative, accesses can be chained: `Obj.foo(1).bar` calls `foo(1)` on `Obj`, then `bar` on its result, each step via `invoke_method/3`. Used as a goal, it runs the chain for its side effects; to capture the final result write `Result := Obj.foo(1).bar` (see `:=/2`). Errors are those of `invoke_method/3`.\n\n**Examples**\n\n```prolog\n?- $stdout.println(hello).\n% prints: hello\nyes.\n\n?- new_object('java.util.ArrayList', [], L), L.add(a), L.add(b), list_items(L, Items).\nItems = [a, b].\n\n?- new_object('java.util.ArrayList', [], L), L.nope.\nthrows error(existence_error(_, _), _).\n```";
3097
+ this.Method$delegate_1 = this.variables_1;
3098
+ this.Ref$delegate_1 = this.variables_1;
3099
+ }
3100
+ protoOf(Dot).get_help_won7nu_k$ = function () {
3101
+ return this.help_1;
3102
+ };
3103
+ protoOf(Dot).get_head_btpmqe_k$ = function (_this__u8e3s4) {
3104
+ return listOf([_get_Ref__e5vi4e(this), _get_Method__a3idyi(this)]);
3105
+ };
3106
+ protoOf(Dot).get_body_3ji99k_k$ = function (_this__u8e3s4) {
3107
+ return _this__u8e3s4.structOf('fluent_reduce', [_this__u8e3s4.consOf(_get_Ref__e5vi4e(this), _get_Method__a3idyi(this)), _this__u8e3s4.get___1mhr5i_k$()]);
3108
+ };
3109
+ var Dot_instance;
3110
+ function Dot_getInstance() {
3111
+ if (Dot_instance == null)
3112
+ new Dot();
3113
+ return Dot_instance;
3114
+ }
3115
+ function _get_P__7mlo1t_0($this) {
3116
+ var tmp = KProperty1;
3117
+ return $this.P$delegate_1.getValue($this, getPropertyCallableRef('P', 1, tmp, FluentReduce$Recursive$_get_P_$ref_qmyw78(), null));
3118
+ }
3119
+ function _get_M__7mlnz8_0($this) {
3120
+ var tmp = KProperty1;
3121
+ return $this.M$delegate_1.getValue($this, getPropertyCallableRef('M', 1, tmp, FluentReduce$Recursive$_get_M_$ref_s23rdt(), null));
3122
+ }
3123
+ function _get_P1__ndbjd6($this) {
3124
+ var tmp = KProperty1;
3125
+ return $this.P1$delegate_1.getValue($this, getPropertyCallableRef('P1', 1, tmp, FluentReduce$Recursive$_get_P1_$ref_ksmyi5(), null));
3126
+ }
3127
+ function _get_X__7mlo8p_0($this) {
3128
+ var tmp = KProperty1;
3129
+ return $this.X$delegate_1.getValue($this, getPropertyCallableRef('X', 1, tmp, FluentReduce$Recursive$_get_X_$ref_mulx1o(), null));
3130
+ }
3131
+ function FluentReduce$Recursive$_get_P_$ref_qmyw78() {
3132
+ return constructCallableReference(function (p0) {
3133
+ return _get_P__7mlo1t_0(p0);
3134
+ }, 1, 0, 144);
3135
+ }
3136
+ function FluentReduce$Recursive$_get_M_$ref_s23rdt() {
3137
+ return constructCallableReference(function (p0) {
3138
+ return _get_M__7mlnz8_0(p0);
3139
+ }, 1, 0, 145);
3140
+ }
3141
+ function FluentReduce$Recursive$_get_P1_$ref_ksmyi5() {
3142
+ return constructCallableReference(function (p0) {
3143
+ return _get_P1__ndbjd6(p0);
3144
+ }, 1, 0, 146);
3145
+ }
3146
+ function FluentReduce$Recursive$_get_X_$ref_mulx1o() {
3147
+ return constructCallableReference(function (p0) {
3148
+ return _get_X__7mlo8p_0(p0);
3149
+ }, 1, 0, 147);
3150
+ }
3151
+ function _get_P__7mlo1t_1($this) {
3152
+ var tmp = KProperty1;
3153
+ return $this.P$delegate_1.getValue($this, getPropertyCallableRef('P', 1, tmp, FluentReduce$Couple$_get_P_$ref_o7vzn6(), null));
3154
+ }
3155
+ function _get_M__7mlnz8_1($this) {
3156
+ var tmp = KProperty1;
3157
+ return $this.M$delegate_1.getValue($this, getPropertyCallableRef('M', 1, tmp, FluentReduce$Couple$_get_M_$ref_pn0utr(), null));
3158
+ }
3159
+ function FluentReduce$Couple$_get_P_$ref_o7vzn6() {
3160
+ return constructCallableReference(function (p0) {
3161
+ return _get_P__7mlo1t_1(p0);
3162
+ }, 1, 0, 148);
3163
+ }
3164
+ function FluentReduce$Couple$_get_M_$ref_pn0utr() {
3165
+ return constructCallableReference(function (p0) {
3166
+ return _get_M__7mlnz8_1(p0);
3167
+ }, 1, 0, 149);
3168
+ }
3169
+ function Companion_8() {
3170
+ this.FUNCTOR_1 = 'fluent_reduce';
3171
+ this.ARITY_1 = 2;
3172
+ }
3173
+ var Companion_instance_16;
3174
+ function Companion_getInstance_19() {
3175
+ return Companion_instance_16;
3176
+ }
3177
+ function Recursive() {
3178
+ Recursive_instance = this;
3179
+ FluentReduce.call(this);
3180
+ this.P$delegate_1 = this.variables_1;
3181
+ this.M$delegate_1 = this.variables_1;
3182
+ this.P1$delegate_1 = this.variables_1;
3183
+ this.X$delegate_1 = this.variables_1;
3184
+ }
3185
+ protoOf(Recursive).get_head_btpmqe_k$ = function (_this__u8e3s4) {
3186
+ return listOf([_this__u8e3s4.logicListFrom_pxemlx_k$([_get_P__7mlo1t_0(this), _get_M__7mlnz8_0(this)], _get_X__7mlo8p_0(this)), this.get_R_1mhr55_k$()]);
3187
+ };
3188
+ protoOf(Recursive).get_body_3ji99k_k$ = function (_this__u8e3s4) {
3189
+ var tmp = _this__u8e3s4.atomOf('!');
3190
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3191
+ var tmp$ret$0 = InvokeMethod_getInstance().signature.name;
3192
+ return _this__u8e3s4.tupleOf([tmp, _this__u8e3s4.structOf(tmp$ret$0, [_get_P__7mlo1t_0(this), _get_M__7mlnz8_0(this), _get_P1__ndbjd6(this)]), _this__u8e3s4.structOf('fluent_reduce', [_this__u8e3s4.consOf(_get_P1__ndbjd6(this), _get_X__7mlo8p_0(this)), this.get_R_1mhr55_k$()])]);
3193
+ };
3194
+ var Recursive_instance;
3195
+ function Recursive_getInstance() {
3196
+ if (Recursive_instance == null)
3197
+ new Recursive();
3198
+ return Recursive_instance;
3199
+ }
3200
+ function Couple() {
3201
+ Couple_instance = this;
3202
+ FluentReduce.call(this);
3203
+ this.P$delegate_1 = this.variables_1;
3204
+ this.M$delegate_1 = this.variables_1;
3205
+ }
3206
+ protoOf(Couple).get_head_btpmqe_k$ = function (_this__u8e3s4) {
3207
+ return listOf([_this__u8e3s4.consOf(_get_P__7mlo1t_1(this), _get_M__7mlnz8_1(this)), this.get_R_1mhr55_k$()]);
3208
+ };
3209
+ protoOf(Couple).get_body_3ji99k_k$ = function (_this__u8e3s4) {
3210
+ var tmp = _this__u8e3s4.atomOf('!');
3211
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3212
+ var tmp$ret$0 = InvokeMethod_getInstance().signature.name;
3213
+ return _this__u8e3s4.tupleOf([tmp, _this__u8e3s4.structOf(tmp$ret$0, [_get_P__7mlo1t_1(this), _get_M__7mlnz8_1(this), this.get_R_1mhr55_k$()])]);
3214
+ };
3215
+ var Couple_instance;
3216
+ function Couple_getInstance() {
3217
+ if (Couple_instance == null)
3218
+ new Couple();
3219
+ return Couple_instance;
3220
+ }
3221
+ function Trivial() {
3222
+ Trivial_instance = this;
3223
+ FluentReduce.call(this);
3224
+ }
3225
+ protoOf(Trivial).get_head_btpmqe_k$ = function (_this__u8e3s4) {
3226
+ return listOf([this.get_R_1mhr55_k$(), this.get_R_1mhr55_k$()]);
3227
+ };
3228
+ var Trivial_instance;
3229
+ function Trivial_getInstance() {
3230
+ if (Trivial_instance == null)
3231
+ new Trivial();
3232
+ return Trivial_instance;
3233
+ }
3234
+ function FluentReduce$_get_R_$ref_ypb4y4() {
3235
+ return constructCallableReference(function (p0) {
3236
+ return p0.get_R_1mhr55_k$();
3237
+ }, 1, 0, 150);
3238
+ }
3239
+ function FluentReduce() {
3240
+ RuleWrapper_init_$Init$('fluent_reduce', 2, VOID, this);
3241
+ this.help_1 = "`fluent_reduce(+Expression, ?Result)`\n\nHelper behind `./2` and `:=/2`: evaluates a chain of member accesses `Receiver.M1.M2...` (which, as `.` is the list constructor, is the same term as the improper list `[Receiver, M1 | M2]`) by invoking `M1` on `Receiver` via `invoke_method/3`, then `M2` on that result, and so on, unifying `Result` with the last result. A term that is not a chain is unified with `Result` unchanged. Deterministic (each clause cuts). Errors are those of `invoke_method/3`.\n\n**Examples**\n\n```prolog\n?- fluent_reduce($math.max(1, 2), M).\nM = 2.\n\n?- new_object('java.lang.StringBuilder', [abc], B), fluent_reduce(B.reverse.toString, S).\nS = cba.\n\n?- fluent_reduce(foo, R).\nR = foo.\n```";
3242
+ this.R$delegate_1 = this.variables_1;
3243
+ }
3244
+ protoOf(FluentReduce).get_help_won7nu_k$ = function () {
3245
+ return this.help_1;
3246
+ };
3247
+ protoOf(FluentReduce).get_R_1mhr55_k$ = function () {
3248
+ var tmp = KProperty1;
3249
+ return this.R$delegate_1.getValue(this, getPropertyCallableRef('R', 1, tmp, FluentReduce$_get_R_$ref_ypb4y4(), null));
3250
+ };
3251
+ protoOf(FluentReduce).get_body_3ji99k_k$ = function (_this__u8e3s4) {
3252
+ return _this__u8e3s4.atomOf('!');
3253
+ };
3254
+ function _get_Type__cwwv8x($this) {
3255
+ var tmp = KProperty1;
3256
+ return $this.Type$delegate_1.getValue($this, getPropertyCallableRef('Type', 1, tmp, NewObject2$_get_Type_$ref_gxw6of(), null));
3257
+ }
3258
+ function _get_Instance__cwfjuy($this) {
3259
+ var tmp = KProperty1;
3260
+ return $this.Instance$delegate_1.getValue($this, getPropertyCallableRef('Instance', 1, tmp, NewObject2$_get_Instance_$ref_jt2xca(), null));
3261
+ }
3262
+ function NewObject2$_get_Type_$ref_gxw6of() {
3263
+ return constructCallableReference(function (p0) {
3264
+ return _get_Type__cwwv8x(p0);
3265
+ }, 1, 0, 151);
3266
+ }
3267
+ function NewObject2$_get_Instance_$ref_jt2xca() {
3268
+ return constructCallableReference(function (p0) {
3269
+ return _get_Instance__cwfjuy(p0);
3270
+ }, 1, 0, 152);
3271
+ }
3272
+ function NewObject2() {
3273
+ NewObject2_instance = this;
3274
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3275
+ var tmp$ret$0 = NewObject3_getInstance().signature.name;
3276
+ RuleWrapper_init_$Init$(tmp$ret$0, 2, VOID, this);
3277
+ this.help_1 = "`new_object(+Type, -ObjectRef)`\n\nInstantiates `Type` through its public no-argument constructor and unifies `ObjectRef` with a reference to the new object; shorthand for `new_object(Type, [], ObjectRef)`. `Type` may be an atom holding a fully qualified type name, a type reference, or a `$Alias` reference to a type. Errors are those of `new_object/3`.\n\n**Examples**\n\n```prolog\n?- new_object('java.util.ArrayList', L), N := L.size.\nN = 0.\n\n?- new_object($hashmap, M), M.put(k, v), V := M.get(k).\nV = v.\n\n?- new_object('java.lang.Integer', I).\nthrows error(existence_error(_, _), _).\n```";
3278
+ this.Type$delegate_1 = this.variables_1;
3279
+ this.Instance$delegate_1 = this.variables_1;
3280
+ }
3281
+ protoOf(NewObject2).get_help_won7nu_k$ = function () {
3282
+ return this.help_1;
3283
+ };
3284
+ protoOf(NewObject2).get_head_btpmqe_k$ = function (_this__u8e3s4) {
3285
+ return listOf([_get_Type__cwwv8x(this), _get_Instance__cwfjuy(this)]);
3286
+ };
3287
+ protoOf(NewObject2).get_body_3ji99k_k$ = function (_this__u8e3s4) {
3288
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3289
+ var tmp$ret$0 = NewObject3_getInstance().signature.name;
3290
+ return _this__u8e3s4.structOf(tmp$ret$0, [_get_Type__cwwv8x(this), _this__u8e3s4.get_emptyLogicList_z7wjmg_k$(), _get_Instance__cwfjuy(this)]);
3291
+ };
3292
+ var NewObject2_instance;
3293
+ function NewObject2_getInstance() {
3294
+ if (NewObject2_instance == null)
3295
+ new NewObject2();
3296
+ return NewObject2_instance;
3297
+ }
3298
+ function _get_B1__ndb8zg($this) {
3299
+ var tmp = KProperty1;
3300
+ return $this.B1$delegate_1.getValue($this, getPropertyCallableRef('B1', 1, tmp, PropertyReduce$Recursive$_get_B1_$ref_kiryiu(), null));
3301
+ }
3302
+ function _get_C__7mlnqm_0($this) {
3303
+ var tmp = KProperty1;
3304
+ return $this.C$delegate_1.getValue($this, getPropertyCallableRef('C', 1, tmp, PropertyReduce$Recursive$_get_C_$ref_epsz1a(), null));
3305
+ }
3306
+ function _get_O__7mlo0y($this) {
3307
+ var tmp = KProperty1;
3308
+ return $this.O$delegate_1.getValue($this, getPropertyCallableRef('O', 1, tmp, PropertyReduce$Recursive$_get_O_$ref_919iay(), null));
3309
+ }
3310
+ function _get_P__7mlo1t_2($this) {
3311
+ var tmp = KProperty1;
3312
+ return $this.P$delegate_1.getValue($this, getPropertyCallableRef('P', 1, tmp, PropertyReduce$Recursive$_get_P_$ref_8k7vwr(), null));
3313
+ }
3314
+ function PropertyReduce$Recursive$_get_B1_$ref_kiryiu() {
3315
+ return constructCallableReference(function (p0) {
3316
+ return _get_B1__ndb8zg(p0);
3317
+ }, 1, 0, 153);
3318
+ }
3319
+ function PropertyReduce$Recursive$_get_C_$ref_epsz1a() {
3320
+ return constructCallableReference(function (p0) {
3321
+ return _get_C__7mlnqm_0(p0);
3322
+ }, 1, 0, 154);
3323
+ }
3324
+ function PropertyReduce$Recursive$_get_O_$ref_919iay() {
3325
+ return constructCallableReference(function (p0) {
3326
+ return _get_O__7mlo0y(p0);
3327
+ }, 1, 0, 155);
3328
+ }
3329
+ function PropertyReduce$Recursive$_get_P_$ref_8k7vwr() {
3330
+ return constructCallableReference(function (p0) {
3331
+ return _get_P__7mlo1t_2(p0);
3332
+ }, 1, 0, 156);
3333
+ }
3334
+ function Companion_9() {
3335
+ this.FUNCTOR_1 = 'property_reduce';
3336
+ this.ARITY_1 = 3;
3337
+ }
3338
+ var Companion_instance_17;
3339
+ function Companion_getInstance_20() {
3340
+ return Companion_instance_17;
3341
+ }
3342
+ function Recursive_0() {
3343
+ Recursive_instance_0 = this;
3344
+ PropertyReduce.call(this);
3345
+ this.B1$delegate_1 = this.variables_1;
3346
+ this.C$delegate_1 = this.variables_1;
3347
+ this.O$delegate_1 = this.variables_1;
3348
+ this.P$delegate_1 = this.variables_1;
3349
+ }
3350
+ protoOf(Recursive_0).get_head_btpmqe_k$ = function (_this__u8e3s4) {
3351
+ return listOf([_this__u8e3s4.logicListFrom_pxemlx_k$([this.get_A_1mhr4o_k$(), this.get_B_1mhr4p_k$()], _get_C__7mlnqm_0(this)), _get_O__7mlo0y(this), _get_P__7mlo1t_2(this)]);
3352
+ };
3353
+ protoOf(Recursive_0).get_body_3ji99k_k$ = function (_this__u8e3s4) {
3354
+ var tmp = _this__u8e3s4.atomOf('!');
3355
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
3356
+ var tmp$ret$0 = InvokeMethod_getInstance().signature.name;
3357
+ return _this__u8e3s4.tupleOf([tmp, _this__u8e3s4.structOf(tmp$ret$0, [this.get_A_1mhr4o_k$(), this.get_B_1mhr4p_k$(), _get_B1__ndb8zg(this)]), _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)])]);
3358
+ };
3359
+ var Recursive_instance_0;
3360
+ function Recursive_getInstance_0() {
3361
+ if (Recursive_instance_0 == null)
3362
+ new Recursive_0();
3363
+ return Recursive_instance_0;
3364
+ }
3365
+ function Base() {
3366
+ Base_instance = this;
3367
+ PropertyReduce.call(this);
3368
+ }
3369
+ protoOf(Base).get_head_btpmqe_k$ = function (_this__u8e3s4) {
3370
+ return listOf([_this__u8e3s4.consOf(this.get_A_1mhr4o_k$(), this.get_B_1mhr4p_k$()), this.get_A_1mhr4o_k$(), this.get_B_1mhr4p_k$()]);
3371
+ };
3372
+ var Base_instance;
3373
+ function Base_getInstance() {
3374
+ if (Base_instance == null)
3375
+ new Base();
3376
+ return Base_instance;
3377
+ }
3378
+ function PropertyReduce$_get_A_$ref_14cvqu() {
3379
+ return constructCallableReference(function (p0) {
3380
+ return p0.get_A_1mhr4o_k$();
3381
+ }, 1, 0, 157);
3382
+ }
3383
+ function PropertyReduce$_get_B_$ref_1lei51() {
3384
+ return constructCallableReference(function (p0) {
3385
+ return p0.get_B_1mhr4p_k$();
3386
+ }, 1, 0, 158);
3387
+ }
3388
+ function PropertyReduce() {
3389
+ RuleWrapper_init_$Init$('property_reduce', 3, VOID, this);
3390
+ this.help_1 = "`property_reduce(+Expression, ?Ref, ?Property)`\n\nHelper behind the assignment form of `:=/2`: given a chain of member accesses `Receiver.M1....Mn.Property`, evaluates every access but the last one (as `fluent_reduce/2` does, via `invoke_method/3`), unifying `Ref` with the reference reached that way and `Property` with the final access. Deterministic (each clause cuts); fails if `Expression` is not a chain.\n\n**Examples**\n\n```prolog\n?- new_object('java.lang.StringBuilder', [abc], B), property_reduce(B.reverse.length, R, P), S := R.toString.\nP = length, S = cba.\n\n?- property_reduce(foo, R, P).\nno.\n```";
3391
+ this.A$delegate_1 = this.variables_1;
3392
+ this.B$delegate_1 = this.variables_1;
3393
+ }
3394
+ protoOf(PropertyReduce).get_help_won7nu_k$ = function () {
3395
+ return this.help_1;
3396
+ };
3397
+ protoOf(PropertyReduce).get_A_1mhr4o_k$ = function () {
3398
+ var tmp = KProperty1;
3399
+ return this.A$delegate_1.getValue(this, getPropertyCallableRef('A', 1, tmp, PropertyReduce$_get_A_$ref_14cvqu(), null));
3400
+ };
3401
+ protoOf(PropertyReduce).get_B_1mhr4p_k$ = function () {
3402
+ var tmp = KProperty1;
3403
+ return this.B$delegate_1.getValue(this, getPropertyCallableRef('B', 1, tmp, PropertyReduce$_get_B_$ref_1lei51(), null));
3404
+ };
3405
+ protoOf(PropertyReduce).get_body_3ji99k_k$ = function (_this__u8e3s4) {
3406
+ return _this__u8e3s4.atomOf('!');
3407
+ };
3408
+ function get_platformSpecificAliases() {
3409
+ // Inline function 'kotlin.emptyArray' call
3410
+ return [];
3411
+ }
3412
+ function get_TODO_EXCEPTION() {
3413
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3414
+ return TODO_EXCEPTION;
3415
+ }
3416
+ var TODO_EXCEPTION;
3417
+ function get_classNamePattern() {
3418
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3419
+ return classNamePattern;
3420
+ }
3421
+ var classNamePattern;
3422
+ function allSupertypes(_this__u8e3s4, strict) {
3423
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3424
+ throw get_TODO_EXCEPTION();
3425
+ }
3426
+ function get_name(_this__u8e3s4) {
3427
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3428
+ throw get_TODO_EXCEPTION();
3429
+ }
3430
+ function get_fullName(_this__u8e3s4) {
3431
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3432
+ throw get_TODO_EXCEPTION();
3433
+ }
3434
+ function get_identifier(_this__u8e3s4) {
3435
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3436
+ return toString_2(getStringHashCode(get_identifier(_this__u8e3s4)), 16);
3437
+ }
3438
+ function get_companionObjectRef(_this__u8e3s4) {
3439
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3440
+ return Companion_instance.none_6mb3x4_k$();
3441
+ }
3442
+ function kClassFromName(qualifiedName) {
3443
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3444
+ var match = get_CLASS_NAME_PATTERN().matchEntire_6100vb_k$(qualifiedName);
3445
+ // Inline function 'kotlin.require' call
3446
+ if (!!(match == null)) {
3447
+ var message = '`' + qualifiedName + '` should match ' + get_CLASS_NAME_PATTERN().pattern_1 + ", while is doesn't";
3448
+ throw IllegalArgumentException_init_$Create$(toString_0(message));
3449
+ }
3450
+ var module_0 = ensureNotNull(match.get_groups_dy12vx_k$().get_c1px32_k$(1)).value_1;
3451
+ var packageSteps = split(ensureNotNull(match.get_groups_dy12vx_k$().get_c1px32_k$(2)).value_1, charArrayOf([_Char___init__impl__6a9atx(46)]));
3452
+ var kClass = require(module_0);
3453
+ // Inline function 'kotlin.let' call
3454
+ var it = packageSteps.iterator_jk1svi_k$();
3455
+ while (it.hasNext_bitz1p_k$() && kClass != null && kClass != undefined) {
3456
+ kClass = kClass[it.next_20eer_k$()];
3457
+ }
3458
+ var tmp;
3459
+ if (kClass != null && kClass != undefined) {
3460
+ var tmp_0 = Companion_instance;
3461
+ // Inline function 'kotlin.js.unsafeCast' call
3462
+ var tmp$ret$4 = kClass;
3463
+ tmp = tmp_0.some_qfcpk3_k$(get_kotlin(tmp$ret$4));
3464
+ } else {
3465
+ tmp = Companion_instance.none_6mb3x4_k$();
3466
+ }
3467
+ return tmp;
3468
+ }
3469
+ function get_setterMethod(_this__u8e3s4) {
3470
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3471
+ throw get_TODO_EXCEPTION();
3472
+ }
3473
+ function catchingPlatformSpecificException(_this__u8e3s4, instance, action) {
3474
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3475
+ return action();
3476
+ }
3477
+ function invoke_2(_this__u8e3s4, instance, args) {
3478
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3479
+ throw get_TODO_EXCEPTION();
3480
+ }
3481
+ function get_formalParameterTypes(_this__u8e3s4) {
3482
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3483
+ throw get_TODO_EXCEPTION();
3484
+ }
3485
+ function get_CLASS_NAME_PATTERN() {
3486
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3487
+ return get_classNamePattern();
3488
+ }
3489
+ function overloadSelector(type, termToObjectConverter) {
3490
+ _init_properties_TypeUtilsJs_kt__53l6dq();
3491
+ throw get_TODO_EXCEPTION();
3492
+ }
3493
+ var properties_initialized_TypeUtilsJs_kt_h8iecw;
3494
+ function _init_properties_TypeUtilsJs_kt__53l6dq() {
3495
+ if (!properties_initialized_TypeUtilsJs_kt_h8iecw) {
3496
+ properties_initialized_TypeUtilsJs_kt_h8iecw = true;
3497
+ TODO_EXCEPTION = new NotImplementedError('OOP-Prolog integration is still not supported on JS');
3498
+ // Inline function 'kotlin.text.toRegex' call
3499
+ var this_0 = '^([a-zA-Z_][a-zA-Z0-9_]*):([a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*)$';
3500
+ classNamePattern = Regex_init_$Create$(this_0);
3501
+ }
3502
+ }
3503
+ //region block: post-declaration
3504
+ protoOf(NullRefImpl).get_object_hhhtfs_k$ = get_object;
3505
+ protoOf(NullRefImpl).invoke_yaglp8_k$ = invoke;
3506
+ protoOf(NullRefImpl).assign_9qr39z_k$ = assign;
3507
+ protoOf(TermToObjectConverterImpl).convert_i46eqg_k$ = convert;
3508
+ protoOf(TypeFactoryImpl).typeRefFromName_8i9x2s_k$ = typeRefFromName;
3509
+ protoOf(TypeRefImpl).create_4i78so_k$ = create;
3510
+ //endregion
3511
+ //region block: init
3512
+ Companion_instance_9 = new Companion_1();
3513
+ Companion_instance_12 = new Companion_4();
3514
+ Companion_instance_13 = new Companion_5();
3515
+ Companion_instance_14 = new Companion_6();
3516
+ Companion_instance_15 = new Companion_7();
3517
+ Companion_instance_16 = new Companion_8();
3518
+ Companion_instance_17 = new Companion_9();
3519
+ //endregion
3520
+ //region block: exports
3521
+ _.$_$ = _.$_$ || {};
3522
+ _.$_$.a = OOPLib_getInstance;
11
3523
  //endregion
12
3524
  return _;
13
3525
  }));