@tuprolog/2p-full 2.0.9 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2p-bdd.js +21 -21
- package/2p-core.js +105 -100
- package/2p-core.js.map +1 -1
- package/2p-full.js +7 -11
- package/2p-full.js.map +1 -1
- package/2p-io-lib.js +331 -121
- package/2p-io-lib.js.map +1 -1
- package/2p-oop-lib.js +276 -141
- package/2p-oop-lib.js.map +1 -1
- package/2p-parser-core.js +11 -11
- package/2p-parser-impl.js +65 -65
- package/2p-parser-theory.js +13 -13
- package/2p-repl.js +54 -51
- package/2p-repl.js.map +1 -1
- package/2p-solve-plp.js +1 -1
- package/2p-solve-problog.js +118 -118
- package/2p-solve-problog.js.map +1 -1
- package/{2p-solve-classic.js → 2p-solve-prolog.js} +727 -703
- package/2p-solve-prolog.js.map +1 -0
- package/2p-solve.js +2484 -1305
- package/2p-solve.js.map +1 -1
- package/2p-theory.js +54 -54
- package/2p-unify.js +22 -22
- package/2p-utils.js +42 -42
- package/README.md +1 -1
- package/clikt-clikt-mordant.js +9 -9
- package/clikt-clikt.js +129 -129
- package/colormath-root-colormath.js +29 -29
- package/kotlin-kotlin-stdlib.js +709 -647
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kt-math.js +70 -70
- package/markdown.js +15 -0
- package/markdown.js.map +1 -0
- package/mordant-mordant.js +81 -81
- package/okio-parent-okio-nodefilesystem.js +10 -10
- package/okio-parent-okio.js +33 -33
- package/package.json +1 -1
- package/2p-solve-classic.js.map +0 -1
- package/2p-solve-streams.js +0 -2661
- package/2p-solve-streams.js.map +0 -1
package/2p-oop-lib.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function (factory) {
|
|
2
2
|
if (typeof define === 'function' && define.amd)
|
|
3
|
-
define(['exports', './kotlin-kotlin-stdlib.js', './
|
|
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, require('./kotlin-kotlin-stdlib.js'), require('./
|
|
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
6
|
else {
|
|
7
7
|
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
8
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
9
|
}
|
|
10
|
-
if (typeof globalThis['2p-solve'] === 'undefined') {
|
|
11
|
-
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'.");
|
|
12
|
-
}
|
|
13
10
|
if (typeof globalThis['kt-math'] === 'undefined') {
|
|
14
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'.");
|
|
15
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
16
|
if (typeof globalThis['2p-core'] === 'undefined') {
|
|
17
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
18
|
}
|
|
@@ -22,141 +22,146 @@
|
|
|
22
22
|
if (typeof globalThis['2p-unify'] === 'undefined') {
|
|
23
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
24
|
}
|
|
25
|
-
globalThis['2p-oop-lib'] = factory(typeof globalThis['2p-oop-lib'] === 'undefined' ? {} : globalThis['2p-oop-lib'], globalThis['kotlin-kotlin-stdlib'], globalThis['
|
|
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
26
|
}
|
|
27
|
-
}(function (_, kotlin_kotlin,
|
|
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) {
|
|
28
28
|
'use strict';
|
|
29
29
|
//region block: imports
|
|
30
30
|
var NullPointerException_init_$Create$ = kotlin_kotlin.$_$.t1;
|
|
31
|
-
var protoOf = kotlin_kotlin.$_$.
|
|
32
|
-
var initMetadataForInterface = kotlin_kotlin.$_$.
|
|
31
|
+
var protoOf = kotlin_kotlin.$_$.s8;
|
|
32
|
+
var initMetadataForInterface = kotlin_kotlin.$_$.e8;
|
|
33
33
|
var VOID = kotlin_kotlin.$_$.b;
|
|
34
|
-
var AbstractLibrary = kotlin_it_unibo_tuprolog_solve.$_$.v2;
|
|
35
|
-
var listOf = kotlin_kotlin.$_$.g4;
|
|
36
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.w2;
|
|
37
|
-
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.t;
|
|
38
|
-
var to = kotlin_kotlin.$_$.we;
|
|
39
|
-
var Unit_instance = kotlin_kotlin.$_$.r;
|
|
40
|
-
var toMap = kotlin_kotlin.$_$.w5;
|
|
41
34
|
var PrimitiveClasses_getInstance = kotlin_kotlin.$_$.o;
|
|
42
35
|
var KtList = kotlin_kotlin.$_$.e2;
|
|
43
|
-
var getKClass = kotlin_kotlin.$_$.
|
|
36
|
+
var getKClass = kotlin_kotlin.$_$.q9;
|
|
44
37
|
var ArrayList = kotlin_kotlin.$_$.a2;
|
|
45
38
|
var KtMap = kotlin_kotlin.$_$.f2;
|
|
46
39
|
var LinkedHashMap = kotlin_kotlin.$_$.c2;
|
|
47
|
-
var Char = kotlin_kotlin.$_$.
|
|
40
|
+
var Char = kotlin_kotlin.$_$.rd;
|
|
48
41
|
var BigInteger = kotlin_io_github_gciatto_kt_math.$_$.g;
|
|
49
42
|
var BigDecimal = kotlin_io_github_gciatto_kt_math.$_$.f;
|
|
50
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;
|
|
51
53
|
var Specifier_XFY_getInstance = kotlin_it_unibo_tuprolog_core.$_$.c;
|
|
52
54
|
var Operator = kotlin_it_unibo_tuprolog_core.$_$.n1;
|
|
53
55
|
var Specifier_XFX_getInstance = kotlin_it_unibo_tuprolog_core.$_$.b;
|
|
54
56
|
var Specifier_FX_getInstance = kotlin_it_unibo_tuprolog_core.$_$.a;
|
|
55
57
|
var OperatorSet_init_$Create$ = kotlin_it_unibo_tuprolog_core.$_$.j1;
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
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;
|
|
59
64
|
var Atom = kotlin_it_unibo_tuprolog_core.$_$.o1;
|
|
60
|
-
var KProperty1 = kotlin_kotlin.$_$.
|
|
61
|
-
var getPropertyCallableRef = kotlin_kotlin.$_$.
|
|
62
|
-
var constructCallableReference = kotlin_kotlin.$_$.
|
|
63
|
-
var isInterface = kotlin_kotlin.$_$.
|
|
65
|
+
var KProperty1 = kotlin_kotlin.$_$.t9;
|
|
66
|
+
var getPropertyCallableRef = kotlin_kotlin.$_$.y7;
|
|
67
|
+
var constructCallableReference = kotlin_kotlin.$_$.r7;
|
|
68
|
+
var isInterface = kotlin_kotlin.$_$.k8;
|
|
64
69
|
var lazy = kotlin_kotlin.$_$.pe;
|
|
65
70
|
var toString = kotlin_kotlin.$_$.ve;
|
|
66
|
-
var hashCode = kotlin_kotlin.$_$.
|
|
67
|
-
var equals = kotlin_kotlin.$_$.
|
|
68
|
-
var initMetadataForClass = kotlin_kotlin.$_$.
|
|
71
|
+
var hashCode = kotlin_kotlin.$_$.a8;
|
|
72
|
+
var equals = kotlin_kotlin.$_$.t7;
|
|
73
|
+
var initMetadataForClass = kotlin_kotlin.$_$.b8;
|
|
69
74
|
var Companion_instance = kotlin_it_unibo_tuprolog_utils.$_$.e;
|
|
70
75
|
var contains = kotlin_kotlin.$_$.x2;
|
|
71
|
-
var listOf_0 = kotlin_kotlin.$_$.
|
|
76
|
+
var listOf_0 = kotlin_kotlin.$_$.g4;
|
|
72
77
|
var checkIndexOverflow = kotlin_kotlin.$_$.v2;
|
|
73
78
|
var copyToArray = kotlin_kotlin.$_$.g3;
|
|
74
|
-
var toString_0 = kotlin_kotlin.$_$.
|
|
75
|
-
var trimMargin = kotlin_kotlin.$_$.
|
|
79
|
+
var toString_0 = kotlin_kotlin.$_$.v8;
|
|
80
|
+
var trimMargin = kotlin_kotlin.$_$.nd;
|
|
76
81
|
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.j1;
|
|
77
|
-
var setOf = kotlin_kotlin.$_$.
|
|
82
|
+
var setOf = kotlin_kotlin.$_$.g5;
|
|
78
83
|
var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.z;
|
|
79
84
|
var format = kotlin_it_unibo_tuprolog_core.$_$.c3;
|
|
80
|
-
var captureStack = kotlin_kotlin.$_$.
|
|
81
|
-
var Companion_instance_1 = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
82
|
-
var Expected_DEALIASING_EXPRESSION_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
83
|
-
var charSequenceLength = kotlin_kotlin.$_$.
|
|
84
|
-
var charCodeAt = kotlin_kotlin.$_$.
|
|
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;
|
|
85
90
|
var toString_1 = kotlin_kotlin.$_$.h;
|
|
86
|
-
var substring = kotlin_kotlin.$_$.
|
|
91
|
+
var substring = kotlin_kotlin.$_$.ad;
|
|
87
92
|
var Companion_getInstance = kotlin_it_unibo_tuprolog_unify.$_$.a;
|
|
88
93
|
var Struct = kotlin_it_unibo_tuprolog_core.$_$.z1;
|
|
89
|
-
var Companion_instance_2 = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
94
|
+
var Companion_instance_2 = kotlin_it_unibo_tuprolog_solve.$_$.y;
|
|
90
95
|
var ObjectType_OOP_ALIAS_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.h;
|
|
91
96
|
var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.i1;
|
|
92
97
|
var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.l1;
|
|
93
|
-
var objectCreate = kotlin_kotlin.$_$.
|
|
94
|
-
var Companion_instance_3 = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
95
|
-
var Limit_OOP_OBJECT_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
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;
|
|
96
101
|
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.m;
|
|
97
|
-
var THROW_CCE = kotlin_kotlin.$_$.
|
|
102
|
+
var THROW_CCE = kotlin_kotlin.$_$.fe;
|
|
98
103
|
var Term = kotlin_it_unibo_tuprolog_core.$_$.y2;
|
|
99
104
|
var NumberTypeTester = kotlin_it_unibo_tuprolog_utils.$_$.l;
|
|
100
105
|
var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.a1;
|
|
101
|
-
var charArrayOf = kotlin_kotlin.$_$.
|
|
102
|
-
var concatToString = kotlin_kotlin.$_$.
|
|
106
|
+
var charArrayOf = kotlin_kotlin.$_$.k7;
|
|
107
|
+
var concatToString = kotlin_kotlin.$_$.rb;
|
|
103
108
|
var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.u;
|
|
104
109
|
var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.r;
|
|
105
|
-
var isNumber = kotlin_kotlin.$_$.
|
|
106
|
-
var Exception = kotlin_kotlin.$_$.
|
|
110
|
+
var isNumber = kotlin_kotlin.$_$.l8;
|
|
111
|
+
var Exception = kotlin_kotlin.$_$.wd;
|
|
107
112
|
var Var = kotlin_it_unibo_tuprolog_core.$_$.b3;
|
|
108
|
-
var sequenceOf = kotlin_kotlin.$_$.
|
|
109
|
-
var plus = kotlin_kotlin.$_$.
|
|
113
|
+
var sequenceOf = kotlin_kotlin.$_$.ab;
|
|
114
|
+
var plus = kotlin_kotlin.$_$.ya;
|
|
110
115
|
var Companion_getInstance_4 = kotlin_io_github_gciatto_kt_math.$_$.e;
|
|
111
116
|
var Companion_getInstance_5 = kotlin_io_github_gciatto_kt_math.$_$.d;
|
|
112
|
-
var compareTo = kotlin_kotlin.$_$.
|
|
117
|
+
var compareTo = kotlin_kotlin.$_$.q7;
|
|
113
118
|
var Integer = kotlin_it_unibo_tuprolog_core.$_$.u1;
|
|
114
|
-
var sequenceOf_0 = kotlin_kotlin.$_$.
|
|
119
|
+
var sequenceOf_0 = kotlin_kotlin.$_$.za;
|
|
115
120
|
var Real = kotlin_it_unibo_tuprolog_core.$_$.x1;
|
|
116
121
|
var Truth = kotlin_it_unibo_tuprolog_core.$_$.z2;
|
|
117
122
|
var first = kotlin_kotlin.$_$.ia;
|
|
118
|
-
var toSet = kotlin_kotlin.$_$.
|
|
123
|
+
var toSet = kotlin_kotlin.$_$.jb;
|
|
119
124
|
var Some = kotlin_it_unibo_tuprolog_utils.$_$.m;
|
|
120
125
|
var Companion_getInstance_6 = kotlin_it_unibo_tuprolog_core.$_$.y;
|
|
121
|
-
var Companion_getInstance_7 = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
122
|
-
var Functional = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
123
|
-
var Companion_instance_4 = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
124
|
-
var
|
|
125
|
-
var
|
|
126
|
-
var
|
|
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;
|
|
127
133
|
var Companion_instance_5 = kotlin_it_unibo_tuprolog_core.$_$.s;
|
|
128
134
|
var List = kotlin_it_unibo_tuprolog_core.$_$.v1;
|
|
129
|
-
var toList = kotlin_kotlin.$_$.
|
|
130
|
-
var isArray = kotlin_kotlin.$_$.
|
|
131
|
-
var
|
|
132
|
-
var Predicative = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
133
|
-
var TernaryRelation = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
134
|
-
var asSequence_0 = kotlin_kotlin.$_$.r2;
|
|
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;
|
|
135
140
|
var flatMap = kotlin_kotlin.$_$.ja;
|
|
136
|
-
var distinct = kotlin_kotlin.$_$.
|
|
137
|
-
var TypeTester = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
138
|
-
var Expected_TYPE_REFERENCE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
139
|
-
var Expected_REFERENCE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
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;
|
|
140
145
|
var Companion_getInstance_8 = kotlin_it_unibo_tuprolog_core.$_$.c1;
|
|
141
146
|
var Companion_getInstance_9 = kotlin_it_unibo_tuprolog_core.$_$.x;
|
|
142
147
|
var filter = kotlin_kotlin.$_$.ga;
|
|
143
|
-
var Sequence = kotlin_kotlin.$_$.
|
|
148
|
+
var Sequence = kotlin_kotlin.$_$.v9;
|
|
144
149
|
var firstOrNull = kotlin_kotlin.$_$.ha;
|
|
145
|
-
var Yes = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
146
|
-
var NonBacktrackable = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
147
|
-
var Companion_instance_6 = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
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;
|
|
148
153
|
var KtSet = kotlin_kotlin.$_$.g2;
|
|
149
|
-
var NonBacktrackable_0 = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
150
|
-
var RuleWrapper = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
151
|
-
var RuleWrapper_init_$Init$ = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
152
|
-
var Var_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
153
|
-
var getStringHashCode = kotlin_kotlin.$_$.
|
|
154
|
-
var toString_2 = kotlin_kotlin.$_$.
|
|
155
|
-
var ensureNotNull = kotlin_kotlin.$_$.
|
|
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;
|
|
156
161
|
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.c;
|
|
157
|
-
var split = kotlin_kotlin.$_$.
|
|
158
|
-
var get_kotlin = kotlin_kotlin.$_$.
|
|
159
|
-
var NotImplementedError = kotlin_kotlin.$_$.
|
|
162
|
+
var split = kotlin_kotlin.$_$.tc;
|
|
163
|
+
var get_kotlin = kotlin_kotlin.$_$.m8;
|
|
164
|
+
var NotImplementedError = kotlin_kotlin.$_$.ae;
|
|
160
165
|
var Regex_init_$Create$ = kotlin_kotlin.$_$.z;
|
|
161
166
|
//endregion
|
|
162
167
|
//region block: pre-declaration
|
|
@@ -243,13 +248,23 @@
|
|
|
243
248
|
//endregion
|
|
244
249
|
function NullRef() {
|
|
245
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
|
+
}
|
|
246
257
|
function OOPLib() {
|
|
247
258
|
OOPLib_instance = this;
|
|
248
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.";
|
|
249
261
|
}
|
|
250
262
|
protoOf(OOPLib).get_alias_iooo4n_k$ = function () {
|
|
251
263
|
return 'prolog.oop';
|
|
252
264
|
};
|
|
265
|
+
protoOf(OOPLib).get_help_won7nu_k$ = function () {
|
|
266
|
+
return this.help_1;
|
|
267
|
+
};
|
|
253
268
|
protoOf(OOPLib).get_primitives_xl08ol_k$ = function () {
|
|
254
269
|
// Inline function 'kotlin.collections.map' call
|
|
255
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()]);
|
|
@@ -266,7 +281,7 @@
|
|
|
266
281
|
};
|
|
267
282
|
protoOf(OOPLib).get_clauses_fdta0r_k$ = function () {
|
|
268
283
|
// Inline function 'kotlin.collections.map' call
|
|
269
|
-
var this_0 =
|
|
284
|
+
var this_0 = _get_ruleWrappers__mybpf3(this);
|
|
270
285
|
// Inline function 'kotlin.collections.mapTo' call
|
|
271
286
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
272
287
|
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
@@ -280,6 +295,9 @@
|
|
|
280
295
|
protoOf(OOPLib).get_operators_z0nmfu_k$ = function () {
|
|
281
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)]);
|
|
282
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
|
+
};
|
|
283
301
|
var OOPLib_instance;
|
|
284
302
|
function OOPLib_getInstance() {
|
|
285
303
|
if (OOPLib_instance == null)
|
|
@@ -350,7 +368,7 @@
|
|
|
350
368
|
function Result$Value$_get_termValue_$ref_u3cirl() {
|
|
351
369
|
return constructCallableReference(function (p0) {
|
|
352
370
|
return _get_termValue__ikgccs(p0);
|
|
353
|
-
}, 1, 0,
|
|
371
|
+
}, 1, 0, 130);
|
|
354
372
|
}
|
|
355
373
|
function Result$Value$objectRef$delegate$lambda(this$0) {
|
|
356
374
|
return function () {
|
|
@@ -368,7 +386,7 @@
|
|
|
368
386
|
function Result$Value$_get_objectRef_$ref_8a6ozy() {
|
|
369
387
|
return constructCallableReference(function (p0) {
|
|
370
388
|
return _get_objectRef__3zhern(p0);
|
|
371
|
-
}, 1, 0,
|
|
389
|
+
}, 1, 0, 131);
|
|
372
390
|
}
|
|
373
391
|
function Value(value) {
|
|
374
392
|
Result.call(this);
|
|
@@ -1357,19 +1375,27 @@
|
|
|
1357
1375
|
if (typeof source === 'string') {
|
|
1358
1376
|
tmp = Companion_getInstance_0().of(source);
|
|
1359
1377
|
} else {
|
|
1360
|
-
if (
|
|
1361
|
-
tmp =
|
|
1378
|
+
if (isInterface(source, BigInteger)) {
|
|
1379
|
+
tmp = Companion_getInstance_3().ofBigInteger(source);
|
|
1362
1380
|
} else {
|
|
1363
|
-
if (source
|
|
1364
|
-
|
|
1365
|
-
// Inline function 'kotlin.charArrayOf' call
|
|
1366
|
-
var tmp$ret$2 = charArrayOf([source.value_1]);
|
|
1367
|
-
tmp = tmp_0.of(concatToString(tmp$ret$2));
|
|
1381
|
+
if (isInterface(source, BigDecimal)) {
|
|
1382
|
+
tmp = Companion_getInstance_2().ofBigDecimal(source);
|
|
1368
1383
|
} else {
|
|
1369
|
-
if (
|
|
1370
|
-
tmp =
|
|
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));
|
|
1371
1386
|
} else {
|
|
1372
|
-
|
|
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
|
+
}
|
|
1373
1399
|
}
|
|
1374
1400
|
}
|
|
1375
1401
|
}
|
|
@@ -2052,11 +2078,16 @@
|
|
|
2052
2078
|
var e = $p;
|
|
2053
2079
|
throw e.toLogicError_fiiu4e_k$(_this__u8e3s4.context, _this__u8e3s4.signature);
|
|
2054
2080
|
} else {
|
|
2055
|
-
if ($p instanceof
|
|
2081
|
+
if ($p instanceof ResolutionException) {
|
|
2056
2082
|
var e_0 = $p;
|
|
2057
|
-
throw
|
|
2083
|
+
throw e_0;
|
|
2058
2084
|
} else {
|
|
2059
|
-
|
|
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
|
+
}
|
|
2060
2091
|
}
|
|
2061
2092
|
}
|
|
2062
2093
|
}
|
|
@@ -2122,7 +2153,11 @@
|
|
|
2122
2153
|
function ArrayItems() {
|
|
2123
2154
|
ArrayItems_instance = this;
|
|
2124
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```";
|
|
2125
2157
|
}
|
|
2158
|
+
protoOf(ArrayItems).get_help_won7nu_k$ = function () {
|
|
2159
|
+
return this.help_1;
|
|
2160
|
+
};
|
|
2126
2161
|
protoOf(ArrayItems).toIterable_j8vuup_k$ = function (_this__u8e3s4) {
|
|
2127
2162
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
2128
2163
|
var this_0 = toList(_this__u8e3s4);
|
|
@@ -2132,7 +2167,7 @@
|
|
|
2132
2167
|
return !(_this__u8e3s4 == null) ? isArray(_this__u8e3s4) : false;
|
|
2133
2168
|
};
|
|
2134
2169
|
protoOf(ArrayItems).get_items_dh9b15_k$ = function (_this__u8e3s4) {
|
|
2135
|
-
return
|
|
2170
|
+
return asSequence_0(_this__u8e3s4);
|
|
2136
2171
|
};
|
|
2137
2172
|
protoOf(ArrayItems).get_items_ay3mtl_k$ = function (_this__u8e3s4) {
|
|
2138
2173
|
return this.get_items_dh9b15_k$(isArray(_this__u8e3s4) ? _this__u8e3s4 : THROW_CCE());
|
|
@@ -2146,7 +2181,11 @@
|
|
|
2146
2181
|
function Assign() {
|
|
2147
2182
|
Assign_instance = this;
|
|
2148
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```";
|
|
2149
2185
|
}
|
|
2186
|
+
protoOf(Assign).get_help_won7nu_k$ = function () {
|
|
2187
|
+
return this.help_1;
|
|
2188
|
+
};
|
|
2150
2189
|
protoOf(Assign).compute_ndmwim_k$ = function (_this__u8e3s4, first, second, third) {
|
|
2151
2190
|
Companion_getInstance_7().ensuringArgumentIsAtom_5kuj97_k$(_this__u8e3s4, 0);
|
|
2152
2191
|
Companion_getInstance_7().ensuringArgumentIsAtom_5kuj97_k$(_this__u8e3s4, 1);
|
|
@@ -2176,11 +2215,16 @@
|
|
|
2176
2215
|
var e = $p;
|
|
2177
2216
|
throw e.toLogicError_fiiu4e_k$(_this__u8e3s4.context, _this__u8e3s4.signature);
|
|
2178
2217
|
} else {
|
|
2179
|
-
if ($p instanceof
|
|
2218
|
+
if ($p instanceof ResolutionException) {
|
|
2180
2219
|
var e_0 = $p;
|
|
2181
|
-
throw
|
|
2220
|
+
throw e_0;
|
|
2182
2221
|
} else {
|
|
2183
|
-
|
|
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
|
+
}
|
|
2184
2228
|
}
|
|
2185
2229
|
}
|
|
2186
2230
|
}
|
|
@@ -2222,7 +2266,11 @@
|
|
|
2222
2266
|
function Cast() {
|
|
2223
2267
|
Cast_instance = this;
|
|
2224
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```';
|
|
2225
2270
|
}
|
|
2271
|
+
protoOf(Cast).get_help_won7nu_k$ = function () {
|
|
2272
|
+
return this.help_1;
|
|
2273
|
+
};
|
|
2226
2274
|
protoOf(Cast).computeAll_icj3zj_k$ = function (_this__u8e3s4, first, second, third) {
|
|
2227
2275
|
var tmp$ret$0;
|
|
2228
2276
|
$l$block: {
|
|
@@ -2249,7 +2297,7 @@
|
|
|
2249
2297
|
tmp = tmp_0;
|
|
2250
2298
|
} else {
|
|
2251
2299
|
if (isInterface(second, Var)) {
|
|
2252
|
-
var tmp_3 =
|
|
2300
|
+
var tmp_3 = asSequence(get_termToObjectConverter(_this__u8e3s4).admissibleTypes_1kwmul_k$(first));
|
|
2253
2301
|
var tmp_4 = distinct(flatMap(tmp_3, Cast$computeAll$lambda));
|
|
2254
2302
|
var tmp_5 = map(tmp_4, Cast$computeAll$lambda_0(_this__u8e3s4, first, third, second));
|
|
2255
2303
|
tmp = map(tmp_5, Cast$computeAll$lambda_1(_this__u8e3s4));
|
|
@@ -2265,11 +2313,16 @@
|
|
|
2265
2313
|
var e = $p_0;
|
|
2266
2314
|
throw e.toLogicError_fiiu4e_k$(_this__u8e3s4.context, _this__u8e3s4.signature);
|
|
2267
2315
|
} else {
|
|
2268
|
-
if ($p_0 instanceof
|
|
2316
|
+
if ($p_0 instanceof ResolutionException) {
|
|
2269
2317
|
var e_0 = $p_0;
|
|
2270
|
-
throw
|
|
2318
|
+
throw e_0;
|
|
2271
2319
|
} else {
|
|
2272
|
-
|
|
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
|
+
}
|
|
2273
2326
|
}
|
|
2274
2327
|
}
|
|
2275
2328
|
}
|
|
@@ -2288,7 +2341,11 @@
|
|
|
2288
2341
|
function InvokeMethod() {
|
|
2289
2342
|
InvokeMethod_instance = this;
|
|
2290
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```";
|
|
2291
2345
|
}
|
|
2346
|
+
protoOf(InvokeMethod).get_help_won7nu_k$ = function () {
|
|
2347
|
+
return this.help_1;
|
|
2348
|
+
};
|
|
2292
2349
|
protoOf(InvokeMethod).getInvocationResult_3mb3ft_k$ = function (_this__u8e3s4) {
|
|
2293
2350
|
return _this__u8e3s4.toTerm_edaxrt_k$();
|
|
2294
2351
|
};
|
|
@@ -2301,7 +2358,11 @@
|
|
|
2301
2358
|
function InvokeStrict() {
|
|
2302
2359
|
InvokeStrict_instance = this;
|
|
2303
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```";
|
|
2304
2362
|
}
|
|
2363
|
+
protoOf(InvokeStrict).get_help_won7nu_k$ = function () {
|
|
2364
|
+
return this.help_1;
|
|
2365
|
+
};
|
|
2305
2366
|
protoOf(InvokeStrict).getInvocationResult_3mb3ft_k$ = function (_this__u8e3s4) {
|
|
2306
2367
|
return _this__u8e3s4.asObjectRef_ji97lu_k$();
|
|
2307
2368
|
};
|
|
@@ -2314,7 +2375,11 @@
|
|
|
2314
2375
|
function ListItems() {
|
|
2315
2376
|
ListItems_instance = this;
|
|
2316
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```";
|
|
2317
2379
|
}
|
|
2380
|
+
protoOf(ListItems).get_help_won7nu_k$ = function () {
|
|
2381
|
+
return this.help_1;
|
|
2382
|
+
};
|
|
2318
2383
|
protoOf(ListItems).toIterable_j8vuup_k$ = function (_this__u8e3s4) {
|
|
2319
2384
|
return toList(_this__u8e3s4);
|
|
2320
2385
|
};
|
|
@@ -2322,7 +2387,7 @@
|
|
|
2322
2387
|
return !(_this__u8e3s4 == null) ? isInterface(_this__u8e3s4, KtList) : false;
|
|
2323
2388
|
};
|
|
2324
2389
|
protoOf(ListItems).get_items_cgxsjz_k$ = function (_this__u8e3s4) {
|
|
2325
|
-
return
|
|
2390
|
+
return asSequence(_this__u8e3s4);
|
|
2326
2391
|
};
|
|
2327
2392
|
protoOf(ListItems).get_items_ay3mtl_k$ = function (_this__u8e3s4) {
|
|
2328
2393
|
return this.get_items_cgxsjz_k$(isInterface(_this__u8e3s4, KtList) ? _this__u8e3s4 : THROW_CCE());
|
|
@@ -2336,7 +2401,11 @@
|
|
|
2336
2401
|
function NewObject3() {
|
|
2337
2402
|
NewObject3_instance = this;
|
|
2338
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```";
|
|
2339
2405
|
}
|
|
2406
|
+
protoOf(NewObject3).get_help_won7nu_k$ = function () {
|
|
2407
|
+
return this.help_1;
|
|
2408
|
+
};
|
|
2340
2409
|
protoOf(NewObject3).computeOneSubstitution_omzw8j_k$ = function (_this__u8e3s4, first, second, third) {
|
|
2341
2410
|
Companion_getInstance_7().ensuringArgumentIsStruct_lk4yyp_k$(_this__u8e3s4, 0);
|
|
2342
2411
|
Companion_getInstance_7().ensuringArgumentIsList_n20mbc_k$(_this__u8e3s4, 1);
|
|
@@ -2363,11 +2432,16 @@
|
|
|
2363
2432
|
var e = $p;
|
|
2364
2433
|
throw e.toLogicError_fiiu4e_k$(_this__u8e3s4.context, _this__u8e3s4.signature);
|
|
2365
2434
|
} else {
|
|
2366
|
-
if ($p instanceof
|
|
2435
|
+
if ($p instanceof ResolutionException) {
|
|
2367
2436
|
var e_0 = $p;
|
|
2368
|
-
throw
|
|
2437
|
+
throw e_0;
|
|
2369
2438
|
} else {
|
|
2370
|
-
|
|
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
|
+
}
|
|
2371
2445
|
}
|
|
2372
2446
|
}
|
|
2373
2447
|
}
|
|
@@ -2386,7 +2460,11 @@
|
|
|
2386
2460
|
function NullRef_0() {
|
|
2387
2461
|
NullRef_instance = this;
|
|
2388
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```";
|
|
2389
2464
|
}
|
|
2465
|
+
protoOf(NullRef_0).get_help_won7nu_k$ = function () {
|
|
2466
|
+
return this.help_1;
|
|
2467
|
+
};
|
|
2390
2468
|
protoOf(NullRef_0).testType_81tyi7_k$ = function (term) {
|
|
2391
2469
|
return isInterface(term, NullRef);
|
|
2392
2470
|
};
|
|
@@ -2399,7 +2477,11 @@
|
|
|
2399
2477
|
function ObjectRef_0() {
|
|
2400
2478
|
ObjectRef_instance = this;
|
|
2401
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```";
|
|
2402
2481
|
}
|
|
2482
|
+
protoOf(ObjectRef_0).get_help_won7nu_k$ = function () {
|
|
2483
|
+
return this.help_1;
|
|
2484
|
+
};
|
|
2403
2485
|
protoOf(ObjectRef_0).testType_81tyi7_k$ = function (term) {
|
|
2404
2486
|
return isInterface(term, ObjectRef);
|
|
2405
2487
|
};
|
|
@@ -2575,7 +2657,11 @@
|
|
|
2575
2657
|
function Ref_0() {
|
|
2576
2658
|
Ref_instance = this;
|
|
2577
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```";
|
|
2578
2661
|
}
|
|
2662
|
+
protoOf(Ref_0).get_help_won7nu_k$ = function () {
|
|
2663
|
+
return this.help_1;
|
|
2664
|
+
};
|
|
2579
2665
|
protoOf(Ref_0).testType_81tyi7_k$ = function (term) {
|
|
2580
2666
|
return isInterface(term, Ref);
|
|
2581
2667
|
};
|
|
@@ -2596,7 +2682,11 @@
|
|
|
2596
2682
|
function Register() {
|
|
2597
2683
|
Register_instance = this;
|
|
2598
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```";
|
|
2599
2686
|
}
|
|
2687
|
+
protoOf(Register).get_help_won7nu_k$ = function () {
|
|
2688
|
+
return this.help_1;
|
|
2689
|
+
};
|
|
2600
2690
|
protoOf(Register).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first_0, second) {
|
|
2601
2691
|
Companion_getInstance_7().ensuringAllArgumentsAreInstantiated_60kzw2_k$(_this__u8e3s4);
|
|
2602
2692
|
ensuringArgumentIsRef(_this__u8e3s4, 0);
|
|
@@ -2618,7 +2708,11 @@
|
|
|
2618
2708
|
function SetItems() {
|
|
2619
2709
|
SetItems_instance = this;
|
|
2620
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```';
|
|
2621
2712
|
}
|
|
2713
|
+
protoOf(SetItems).get_help_won7nu_k$ = function () {
|
|
2714
|
+
return this.help_1;
|
|
2715
|
+
};
|
|
2622
2716
|
protoOf(SetItems).toIterable_j8vuup_k$ = function (_this__u8e3s4) {
|
|
2623
2717
|
return toSet(_this__u8e3s4);
|
|
2624
2718
|
};
|
|
@@ -2626,7 +2720,7 @@
|
|
|
2626
2720
|
return !(_this__u8e3s4 == null) ? isInterface(_this__u8e3s4, KtSet) : false;
|
|
2627
2721
|
};
|
|
2628
2722
|
protoOf(SetItems).get_items_ma8yx5_k$ = function (_this__u8e3s4) {
|
|
2629
|
-
return
|
|
2723
|
+
return asSequence(_this__u8e3s4);
|
|
2630
2724
|
};
|
|
2631
2725
|
protoOf(SetItems).get_items_ay3mtl_k$ = function (_this__u8e3s4) {
|
|
2632
2726
|
return this.get_items_ma8yx5_k$(isInterface(_this__u8e3s4, KtSet) ? _this__u8e3s4 : THROW_CCE());
|
|
@@ -2640,8 +2734,12 @@
|
|
|
2640
2734
|
function Type() {
|
|
2641
2735
|
Type_instance = this;
|
|
2642
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```";
|
|
2643
2738
|
this.typeFactory_1 = Companion_getInstance_14().default_1;
|
|
2644
2739
|
}
|
|
2740
|
+
protoOf(Type).get_help_won7nu_k$ = function () {
|
|
2741
|
+
return this.help_1;
|
|
2742
|
+
};
|
|
2645
2743
|
protoOf(Type).computeOneSubstitution_uplwem_k$ = function (_this__u8e3s4, first, second) {
|
|
2646
2744
|
var tmp$ret$0;
|
|
2647
2745
|
$l$block: {
|
|
@@ -2691,11 +2789,16 @@
|
|
|
2691
2789
|
var e = $p;
|
|
2692
2790
|
throw e.toLogicError_fiiu4e_k$(_this__u8e3s4.context, _this__u8e3s4.signature);
|
|
2693
2791
|
} else {
|
|
2694
|
-
if ($p instanceof
|
|
2792
|
+
if ($p instanceof ResolutionException) {
|
|
2695
2793
|
var e_0 = $p;
|
|
2696
|
-
throw
|
|
2794
|
+
throw e_0;
|
|
2697
2795
|
} else {
|
|
2698
|
-
|
|
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
|
+
}
|
|
2699
2802
|
}
|
|
2700
2803
|
}
|
|
2701
2804
|
}
|
|
@@ -2714,7 +2817,11 @@
|
|
|
2714
2817
|
function TypeRef_0() {
|
|
2715
2818
|
TypeRef_instance = this;
|
|
2716
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```";
|
|
2717
2821
|
}
|
|
2822
|
+
protoOf(TypeRef_0).get_help_won7nu_k$ = function () {
|
|
2823
|
+
return this.help_1;
|
|
2824
|
+
};
|
|
2718
2825
|
protoOf(TypeRef_0).testType_81tyi7_k$ = function (term) {
|
|
2719
2826
|
return isInterface(term, TypeRef);
|
|
2720
2827
|
};
|
|
@@ -2738,7 +2845,11 @@
|
|
|
2738
2845
|
function Unregister() {
|
|
2739
2846
|
Unregister_instance = this;
|
|
2740
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```";
|
|
2741
2849
|
}
|
|
2850
|
+
protoOf(Unregister).get_help_won7nu_k$ = function () {
|
|
2851
|
+
return this.help_1;
|
|
2852
|
+
};
|
|
2742
2853
|
protoOf(Unregister).computeOne_6dkmes_k$ = function (_this__u8e3s4, first_0) {
|
|
2743
2854
|
Companion_getInstance_7().ensuringArgumentIsStruct_lk4yyp_k$(_this__u8e3s4, 0);
|
|
2744
2855
|
if (!first_0.get_isGround_twq4nu_k$()) {
|
|
@@ -2781,12 +2892,16 @@
|
|
|
2781
2892
|
RuleWrapper_init_$Init$('alias', 2, VOID, this);
|
|
2782
2893
|
this.alias_1 = alias;
|
|
2783
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```";
|
|
2784
2896
|
// Inline function 'kotlin.require' call
|
|
2785
2897
|
if (!this.alias_1.get_isGround_twq4nu_k$()) {
|
|
2786
2898
|
var message = 'Alias must be a ground term, got: ' + this.alias_1.toString();
|
|
2787
2899
|
throw IllegalArgumentException_init_$Create$(toString_0(message));
|
|
2788
2900
|
}
|
|
2789
2901
|
}
|
|
2902
|
+
protoOf(Alias).get_help_won7nu_k$ = function () {
|
|
2903
|
+
return this.help_1;
|
|
2904
|
+
};
|
|
2790
2905
|
protoOf(Alias).get_head_btpmqe_k$ = function (_this__u8e3s4) {
|
|
2791
2906
|
return toList(sequenceOf_0([this.alias_1, this.ref_1]));
|
|
2792
2907
|
};
|
|
@@ -2809,22 +2924,22 @@
|
|
|
2809
2924
|
function ColonEquals$Cast$_get_R_$ref_879xch() {
|
|
2810
2925
|
return constructCallableReference(function (p0) {
|
|
2811
2926
|
return _get_R__7mlo3j(p0);
|
|
2812
|
-
}, 1, 0,
|
|
2927
|
+
}, 1, 0, 132);
|
|
2813
2928
|
}
|
|
2814
2929
|
function ColonEquals$Cast$_get_X_$ref_5d06zb() {
|
|
2815
2930
|
return constructCallableReference(function (p0) {
|
|
2816
2931
|
return _get_X__7mlo8p(p0);
|
|
2817
|
-
}, 1, 0,
|
|
2932
|
+
}, 1, 0, 133);
|
|
2818
2933
|
}
|
|
2819
2934
|
function ColonEquals$Cast$_get_Y_$ref_4vykl4() {
|
|
2820
2935
|
return constructCallableReference(function (p0) {
|
|
2821
2936
|
return _get_Y__7mlo9k(p0);
|
|
2822
|
-
}, 1, 0,
|
|
2937
|
+
}, 1, 0, 134);
|
|
2823
2938
|
}
|
|
2824
2939
|
function ColonEquals$Cast$_get_T_$ref_796ok3() {
|
|
2825
2940
|
return constructCallableReference(function (p0) {
|
|
2826
2941
|
return _get_T__7mlo59(p0);
|
|
2827
|
-
}, 1, 0,
|
|
2942
|
+
}, 1, 0, 135);
|
|
2828
2943
|
}
|
|
2829
2944
|
function _get_R__7mlo3j_0($this) {
|
|
2830
2945
|
var tmp = KProperty1;
|
|
@@ -2837,12 +2952,12 @@
|
|
|
2837
2952
|
function ColonEquals$Invocation$_get_R_$ref_tlu5kw() {
|
|
2838
2953
|
return constructCallableReference(function (p0) {
|
|
2839
2954
|
return _get_R__7mlo3j_0(p0);
|
|
2840
|
-
}, 1, 0,
|
|
2955
|
+
}, 1, 0, 136);
|
|
2841
2956
|
}
|
|
2842
2957
|
function ColonEquals$Invocation$_get_M_$ref_vz29jv() {
|
|
2843
2958
|
return constructCallableReference(function (p0) {
|
|
2844
2959
|
return _get_M__7mlnz8(p0);
|
|
2845
|
-
}, 1, 0,
|
|
2960
|
+
}, 1, 0, 137);
|
|
2846
2961
|
}
|
|
2847
2962
|
function _get_C__7mlnqm($this) {
|
|
2848
2963
|
var tmp = KProperty1;
|
|
@@ -2863,22 +2978,22 @@
|
|
|
2863
2978
|
function ColonEquals$Assignment$_get_C_$ref_kw9fvw() {
|
|
2864
2979
|
return constructCallableReference(function (p0) {
|
|
2865
2980
|
return _get_C__7mlnqm(p0);
|
|
2866
|
-
}, 1, 0,
|
|
2981
|
+
}, 1, 0, 138);
|
|
2867
2982
|
}
|
|
2868
2983
|
function ColonEquals$Assignment$_get_P_$ref_r1uj0f() {
|
|
2869
2984
|
return constructCallableReference(function (p0) {
|
|
2870
2985
|
return _get_P__7mlo1t(p0);
|
|
2871
|
-
}, 1, 0,
|
|
2986
|
+
}, 1, 0, 139);
|
|
2872
2987
|
}
|
|
2873
2988
|
function ColonEquals$Assignment$_get_R_$ref_rzxrst() {
|
|
2874
2989
|
return constructCallableReference(function (p0) {
|
|
2875
2990
|
return _get_R__7mlo3j_1(p0);
|
|
2876
|
-
}, 1, 0,
|
|
2991
|
+
}, 1, 0, 140);
|
|
2877
2992
|
}
|
|
2878
2993
|
function ColonEquals$Assignment$_get_V_$ref_tw49dl() {
|
|
2879
2994
|
return constructCallableReference(function (p0) {
|
|
2880
2995
|
return _get_V__7mlo6z(p0);
|
|
2881
|
-
}, 1, 0,
|
|
2996
|
+
}, 1, 0, 141);
|
|
2882
2997
|
}
|
|
2883
2998
|
function Cast_0() {
|
|
2884
2999
|
Cast_instance_0 = this;
|
|
@@ -2952,7 +3067,11 @@
|
|
|
2952
3067
|
}
|
|
2953
3068
|
function ColonEquals() {
|
|
2954
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```";
|
|
2955
3071
|
}
|
|
3072
|
+
protoOf(ColonEquals).get_help_won7nu_k$ = function () {
|
|
3073
|
+
return this.help_1;
|
|
3074
|
+
};
|
|
2956
3075
|
function _get_Method__a3idyi($this) {
|
|
2957
3076
|
var tmp = KProperty1;
|
|
2958
3077
|
return $this.Method$delegate_1.getValue($this, getPropertyCallableRef('Method', 1, tmp, Dot$_get_Method_$ref_b7a4zw(), null));
|
|
@@ -2964,19 +3083,23 @@
|
|
|
2964
3083
|
function Dot$_get_Method_$ref_b7a4zw() {
|
|
2965
3084
|
return constructCallableReference(function (p0) {
|
|
2966
3085
|
return _get_Method__a3idyi(p0);
|
|
2967
|
-
}, 1, 0,
|
|
3086
|
+
}, 1, 0, 142);
|
|
2968
3087
|
}
|
|
2969
3088
|
function Dot$_get_Ref_$ref_33uzaq() {
|
|
2970
3089
|
return constructCallableReference(function (p0) {
|
|
2971
3090
|
return _get_Ref__e5vi4e(p0);
|
|
2972
|
-
}, 1, 0,
|
|
3091
|
+
}, 1, 0, 143);
|
|
2973
3092
|
}
|
|
2974
3093
|
function Dot() {
|
|
2975
3094
|
Dot_instance = this;
|
|
2976
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```";
|
|
2977
3097
|
this.Method$delegate_1 = this.variables_1;
|
|
2978
3098
|
this.Ref$delegate_1 = this.variables_1;
|
|
2979
3099
|
}
|
|
3100
|
+
protoOf(Dot).get_help_won7nu_k$ = function () {
|
|
3101
|
+
return this.help_1;
|
|
3102
|
+
};
|
|
2980
3103
|
protoOf(Dot).get_head_btpmqe_k$ = function (_this__u8e3s4) {
|
|
2981
3104
|
return listOf([_get_Ref__e5vi4e(this), _get_Method__a3idyi(this)]);
|
|
2982
3105
|
};
|
|
@@ -3008,22 +3131,22 @@
|
|
|
3008
3131
|
function FluentReduce$Recursive$_get_P_$ref_qmyw78() {
|
|
3009
3132
|
return constructCallableReference(function (p0) {
|
|
3010
3133
|
return _get_P__7mlo1t_0(p0);
|
|
3011
|
-
}, 1, 0,
|
|
3134
|
+
}, 1, 0, 144);
|
|
3012
3135
|
}
|
|
3013
3136
|
function FluentReduce$Recursive$_get_M_$ref_s23rdt() {
|
|
3014
3137
|
return constructCallableReference(function (p0) {
|
|
3015
3138
|
return _get_M__7mlnz8_0(p0);
|
|
3016
|
-
}, 1, 0,
|
|
3139
|
+
}, 1, 0, 145);
|
|
3017
3140
|
}
|
|
3018
3141
|
function FluentReduce$Recursive$_get_P1_$ref_ksmyi5() {
|
|
3019
3142
|
return constructCallableReference(function (p0) {
|
|
3020
3143
|
return _get_P1__ndbjd6(p0);
|
|
3021
|
-
}, 1, 0,
|
|
3144
|
+
}, 1, 0, 146);
|
|
3022
3145
|
}
|
|
3023
3146
|
function FluentReduce$Recursive$_get_X_$ref_mulx1o() {
|
|
3024
3147
|
return constructCallableReference(function (p0) {
|
|
3025
3148
|
return _get_X__7mlo8p_0(p0);
|
|
3026
|
-
}, 1, 0,
|
|
3149
|
+
}, 1, 0, 147);
|
|
3027
3150
|
}
|
|
3028
3151
|
function _get_P__7mlo1t_1($this) {
|
|
3029
3152
|
var tmp = KProperty1;
|
|
@@ -3036,12 +3159,12 @@
|
|
|
3036
3159
|
function FluentReduce$Couple$_get_P_$ref_o7vzn6() {
|
|
3037
3160
|
return constructCallableReference(function (p0) {
|
|
3038
3161
|
return _get_P__7mlo1t_1(p0);
|
|
3039
|
-
}, 1, 0,
|
|
3162
|
+
}, 1, 0, 148);
|
|
3040
3163
|
}
|
|
3041
3164
|
function FluentReduce$Couple$_get_M_$ref_pn0utr() {
|
|
3042
3165
|
return constructCallableReference(function (p0) {
|
|
3043
3166
|
return _get_M__7mlnz8_1(p0);
|
|
3044
|
-
}, 1, 0,
|
|
3167
|
+
}, 1, 0, 149);
|
|
3045
3168
|
}
|
|
3046
3169
|
function Companion_8() {
|
|
3047
3170
|
this.FUNCTOR_1 = 'fluent_reduce';
|
|
@@ -3111,12 +3234,16 @@
|
|
|
3111
3234
|
function FluentReduce$_get_R_$ref_ypb4y4() {
|
|
3112
3235
|
return constructCallableReference(function (p0) {
|
|
3113
3236
|
return p0.get_R_1mhr55_k$();
|
|
3114
|
-
}, 1, 0,
|
|
3237
|
+
}, 1, 0, 150);
|
|
3115
3238
|
}
|
|
3116
3239
|
function FluentReduce() {
|
|
3117
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```";
|
|
3118
3242
|
this.R$delegate_1 = this.variables_1;
|
|
3119
3243
|
}
|
|
3244
|
+
protoOf(FluentReduce).get_help_won7nu_k$ = function () {
|
|
3245
|
+
return this.help_1;
|
|
3246
|
+
};
|
|
3120
3247
|
protoOf(FluentReduce).get_R_1mhr55_k$ = function () {
|
|
3121
3248
|
var tmp = KProperty1;
|
|
3122
3249
|
return this.R$delegate_1.getValue(this, getPropertyCallableRef('R', 1, tmp, FluentReduce$_get_R_$ref_ypb4y4(), null));
|
|
@@ -3135,21 +3262,25 @@
|
|
|
3135
3262
|
function NewObject2$_get_Type_$ref_gxw6of() {
|
|
3136
3263
|
return constructCallableReference(function (p0) {
|
|
3137
3264
|
return _get_Type__cwwv8x(p0);
|
|
3138
|
-
}, 1, 0,
|
|
3265
|
+
}, 1, 0, 151);
|
|
3139
3266
|
}
|
|
3140
3267
|
function NewObject2$_get_Instance_$ref_jt2xca() {
|
|
3141
3268
|
return constructCallableReference(function (p0) {
|
|
3142
3269
|
return _get_Instance__cwfjuy(p0);
|
|
3143
|
-
}, 1, 0,
|
|
3270
|
+
}, 1, 0, 152);
|
|
3144
3271
|
}
|
|
3145
3272
|
function NewObject2() {
|
|
3146
3273
|
NewObject2_instance = this;
|
|
3147
3274
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3148
3275
|
var tmp$ret$0 = NewObject3_getInstance().signature.name;
|
|
3149
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```";
|
|
3150
3278
|
this.Type$delegate_1 = this.variables_1;
|
|
3151
3279
|
this.Instance$delegate_1 = this.variables_1;
|
|
3152
3280
|
}
|
|
3281
|
+
protoOf(NewObject2).get_help_won7nu_k$ = function () {
|
|
3282
|
+
return this.help_1;
|
|
3283
|
+
};
|
|
3153
3284
|
protoOf(NewObject2).get_head_btpmqe_k$ = function (_this__u8e3s4) {
|
|
3154
3285
|
return listOf([_get_Type__cwwv8x(this), _get_Instance__cwfjuy(this)]);
|
|
3155
3286
|
};
|
|
@@ -3183,22 +3314,22 @@
|
|
|
3183
3314
|
function PropertyReduce$Recursive$_get_B1_$ref_kiryiu() {
|
|
3184
3315
|
return constructCallableReference(function (p0) {
|
|
3185
3316
|
return _get_B1__ndb8zg(p0);
|
|
3186
|
-
}, 1, 0,
|
|
3317
|
+
}, 1, 0, 153);
|
|
3187
3318
|
}
|
|
3188
3319
|
function PropertyReduce$Recursive$_get_C_$ref_epsz1a() {
|
|
3189
3320
|
return constructCallableReference(function (p0) {
|
|
3190
3321
|
return _get_C__7mlnqm_0(p0);
|
|
3191
|
-
}, 1, 0,
|
|
3322
|
+
}, 1, 0, 154);
|
|
3192
3323
|
}
|
|
3193
3324
|
function PropertyReduce$Recursive$_get_O_$ref_919iay() {
|
|
3194
3325
|
return constructCallableReference(function (p0) {
|
|
3195
3326
|
return _get_O__7mlo0y(p0);
|
|
3196
|
-
}, 1, 0,
|
|
3327
|
+
}, 1, 0, 155);
|
|
3197
3328
|
}
|
|
3198
3329
|
function PropertyReduce$Recursive$_get_P_$ref_8k7vwr() {
|
|
3199
3330
|
return constructCallableReference(function (p0) {
|
|
3200
3331
|
return _get_P__7mlo1t_2(p0);
|
|
3201
|
-
}, 1, 0,
|
|
3332
|
+
}, 1, 0, 156);
|
|
3202
3333
|
}
|
|
3203
3334
|
function Companion_9() {
|
|
3204
3335
|
this.FUNCTOR_1 = 'property_reduce';
|
|
@@ -3247,18 +3378,22 @@
|
|
|
3247
3378
|
function PropertyReduce$_get_A_$ref_14cvqu() {
|
|
3248
3379
|
return constructCallableReference(function (p0) {
|
|
3249
3380
|
return p0.get_A_1mhr4o_k$();
|
|
3250
|
-
}, 1, 0,
|
|
3381
|
+
}, 1, 0, 157);
|
|
3251
3382
|
}
|
|
3252
3383
|
function PropertyReduce$_get_B_$ref_1lei51() {
|
|
3253
3384
|
return constructCallableReference(function (p0) {
|
|
3254
3385
|
return p0.get_B_1mhr4p_k$();
|
|
3255
|
-
}, 1, 0,
|
|
3386
|
+
}, 1, 0, 158);
|
|
3256
3387
|
}
|
|
3257
3388
|
function PropertyReduce() {
|
|
3258
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```";
|
|
3259
3391
|
this.A$delegate_1 = this.variables_1;
|
|
3260
3392
|
this.B$delegate_1 = this.variables_1;
|
|
3261
3393
|
}
|
|
3394
|
+
protoOf(PropertyReduce).get_help_won7nu_k$ = function () {
|
|
3395
|
+
return this.help_1;
|
|
3396
|
+
};
|
|
3262
3397
|
protoOf(PropertyReduce).get_A_1mhr4o_k$ = function () {
|
|
3263
3398
|
var tmp = KProperty1;
|
|
3264
3399
|
return this.A$delegate_1.getValue(this, getPropertyCallableRef('A', 1, tmp, PropertyReduce$_get_A_$ref_14cvqu(), null));
|