@tuprolog/arg2p 0.10.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.
- package/2p-core.js +9458 -0
- package/2p-core.js.map +1 -0
- package/2p-dsl-core.js +1630 -0
- package/2p-dsl-core.js.map +1 -0
- package/2p-dsl-solve.js +959 -0
- package/2p-dsl-solve.js.map +1 -0
- package/2p-dsl-theory.js +806 -0
- package/2p-dsl-theory.js.map +1 -0
- package/2p-dsl-unify.js +79 -0
- package/2p-dsl-unify.js.map +1 -0
- package/2p-parser-core.js +1282 -0
- package/2p-parser-core.js.map +1 -0
- package/2p-parser-js.js +39 -0
- package/2p-parser-js.js.map +1 -0
- package/2p-parser-theory.js +156 -0
- package/2p-parser-theory.js.map +1 -0
- package/2p-solve-classic.js +2825 -0
- package/2p-solve-classic.js.map +1 -0
- package/2p-solve.js +14540 -0
- package/2p-solve.js.map +1 -0
- package/2p-theory.js +4771 -0
- package/2p-theory.js.map +1 -0
- package/2p-unify.js +923 -0
- package/2p-unify.js.map +1 -0
- package/2p-utils.js +1410 -0
- package/2p-utils.js.map +1 -0
- package/README.md +120 -0
- package/arg2p-causality-solver.js +501 -0
- package/arg2p-causality-solver.js.map +1 -0
- package/arg2p-core.js +4798 -0
- package/arg2p-core.js.map +1 -0
- package/arg2p.js +565 -0
- package/arg2p.js.map +1 -0
- package/kotlin-kotlin-stdlib.js +9923 -0
- package/kotlin-kotlin-stdlib.js.map +1 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +15 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -0
- package/kt-math.js +10392 -0
- package/kt-math.js.map +1 -0
- package/package.json +26 -0
package/2p-theory.js
ADDED
|
@@ -0,0 +1,4771 @@
|
|
|
1
|
+
(function (root, factory) {
|
|
2
|
+
if (typeof define === 'function' && define.amd)
|
|
3
|
+
define(['exports', './kotlin-kotlin-stdlib.js', './2p-core.js', './2p-utils.js', './2p-unify.js'], factory);
|
|
4
|
+
else if (typeof exports === 'object')
|
|
5
|
+
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./2p-core.js'), require('./2p-utils.js'), require('./2p-unify.js'));
|
|
6
|
+
else {
|
|
7
|
+
if (typeof this['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
8
|
+
throw new Error("Error loading module '2p-theory'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to '2p-theory'.");
|
|
9
|
+
}
|
|
10
|
+
if (typeof this['2p-core'] === 'undefined') {
|
|
11
|
+
throw new Error("Error loading module '2p-theory'. Its dependency '2p-core' was not found. Please, check whether '2p-core' is loaded prior to '2p-theory'.");
|
|
12
|
+
}
|
|
13
|
+
if (typeof this['2p-utils'] === 'undefined') {
|
|
14
|
+
throw new Error("Error loading module '2p-theory'. Its dependency '2p-utils' was not found. Please, check whether '2p-utils' is loaded prior to '2p-theory'.");
|
|
15
|
+
}
|
|
16
|
+
if (typeof this['2p-unify'] === 'undefined') {
|
|
17
|
+
throw new Error("Error loading module '2p-theory'. Its dependency '2p-unify' was not found. Please, check whether '2p-unify' is loaded prior to '2p-theory'.");
|
|
18
|
+
}
|
|
19
|
+
root['2p-theory'] = factory(typeof this['2p-theory'] === 'undefined' ? {} : this['2p-theory'], this['kotlin-kotlin-stdlib'], this['2p-core'], this['2p-utils'], this['2p-unify']);
|
|
20
|
+
}
|
|
21
|
+
}(this, function (_, kotlin_kotlin, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_utils, kotlin_it_unibo_tuprolog_unify) {
|
|
22
|
+
'use strict';
|
|
23
|
+
//region block: imports
|
|
24
|
+
var imul = Math.imul;
|
|
25
|
+
var protoOf = kotlin_kotlin.$_$.b6;
|
|
26
|
+
var asIterable = kotlin_kotlin.$_$.a7;
|
|
27
|
+
var any = kotlin_kotlin.$_$.z6;
|
|
28
|
+
var asSequence = kotlin_kotlin.$_$.h2;
|
|
29
|
+
var getKClassFromExpression = kotlin_kotlin.$_$.b;
|
|
30
|
+
var joinToString = kotlin_kotlin.$_$.c3;
|
|
31
|
+
var Iterable = kotlin_kotlin.$_$.u1;
|
|
32
|
+
var classMeta = kotlin_kotlin.$_$.f5;
|
|
33
|
+
var setMetadataFor = kotlin_kotlin.$_$.c6;
|
|
34
|
+
var VOID = kotlin_kotlin.$_$.d;
|
|
35
|
+
var Unit_instance = kotlin_kotlin.$_$.s1;
|
|
36
|
+
var toList = kotlin_kotlin.$_$.j8;
|
|
37
|
+
var none = kotlin_kotlin.$_$.x7;
|
|
38
|
+
var emptyList = kotlin_kotlin.$_$.t2;
|
|
39
|
+
var asIterable_0 = kotlin_kotlin.$_$.c2;
|
|
40
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.e;
|
|
41
|
+
var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.t;
|
|
42
|
+
var itemWiseEquals = kotlin_it_unibo_tuprolog_utils.$_$.e1;
|
|
43
|
+
var getKClass = kotlin_kotlin.$_$.c;
|
|
44
|
+
var itemWiseHashCode = kotlin_it_unibo_tuprolog_utils.$_$.f1;
|
|
45
|
+
var itemWiseHashCode_0 = kotlin_it_unibo_tuprolog_utils.$_$.g1;
|
|
46
|
+
var objectMeta = kotlin_kotlin.$_$.a6;
|
|
47
|
+
var interfaceMeta = kotlin_kotlin.$_$.o5;
|
|
48
|
+
var first = kotlin_kotlin.$_$.x2;
|
|
49
|
+
var hashCode = kotlin_kotlin.$_$.n5;
|
|
50
|
+
var THROW_CCE = kotlin_kotlin.$_$.y9;
|
|
51
|
+
var equals = kotlin_kotlin.$_$.i5;
|
|
52
|
+
var defineProp = kotlin_kotlin.$_$.h5;
|
|
53
|
+
var objectCreate = kotlin_kotlin.$_$.z5;
|
|
54
|
+
var toString = kotlin_kotlin.$_$.g6;
|
|
55
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.s;
|
|
56
|
+
var asReversed = kotlin_kotlin.$_$.e2;
|
|
57
|
+
var isInterface = kotlin_kotlin.$_$.r5;
|
|
58
|
+
var lazy = kotlin_kotlin.$_$.ea;
|
|
59
|
+
var KProperty1 = kotlin_kotlin.$_$.w6;
|
|
60
|
+
var getPropertyCallableRef = kotlin_kotlin.$_$.l5;
|
|
61
|
+
var CoroutineImpl = kotlin_kotlin.$_$.x4;
|
|
62
|
+
var SequenceScope = kotlin_kotlin.$_$.x6;
|
|
63
|
+
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.w4;
|
|
64
|
+
var sequence = kotlin_kotlin.$_$.c8;
|
|
65
|
+
var listOf = kotlin_kotlin.$_$.k3;
|
|
66
|
+
var mergeSequences = kotlin_it_unibo_tuprolog_utils.$_$.i1;
|
|
67
|
+
var sequenceOf = kotlin_kotlin.$_$.b8;
|
|
68
|
+
var flatten = kotlin_kotlin.$_$.o7;
|
|
69
|
+
var compareTo = kotlin_it_unibo_tuprolog_utils.$_$.g;
|
|
70
|
+
var LongIndexed = kotlin_it_unibo_tuprolog_utils.$_$.h;
|
|
71
|
+
var Companion_instance_0 = kotlin_it_unibo_tuprolog_utils.$_$.d;
|
|
72
|
+
var copyToArray = kotlin_kotlin.$_$.r2;
|
|
73
|
+
var plus = kotlin_kotlin.$_$.e4;
|
|
74
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.f;
|
|
75
|
+
var minOrNull = kotlin_kotlin.$_$.o3;
|
|
76
|
+
var ensureNotNull = kotlin_kotlin.$_$.ca;
|
|
77
|
+
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.h;
|
|
78
|
+
var map = kotlin_kotlin.$_$.v7;
|
|
79
|
+
var sum = kotlin_kotlin.$_$.e8;
|
|
80
|
+
var Collection = kotlin_kotlin.$_$.t1;
|
|
81
|
+
var dequeOf = kotlin_it_unibo_tuprolog_utils.$_$.z;
|
|
82
|
+
var addFirst = kotlin_it_unibo_tuprolog_utils.$_$.o;
|
|
83
|
+
var filter = kotlin_kotlin.$_$.j7;
|
|
84
|
+
var emptySequence = kotlin_kotlin.$_$.g7;
|
|
85
|
+
var buffered = kotlin_it_unibo_tuprolog_utils.$_$.s;
|
|
86
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.j2;
|
|
87
|
+
var dequeOf_0 = kotlin_it_unibo_tuprolog_utils.$_$.x;
|
|
88
|
+
var Companion_instance_1 = kotlin_it_unibo_tuprolog_utils.$_$.b;
|
|
89
|
+
var firstOrNull = kotlin_kotlin.$_$.k7;
|
|
90
|
+
var NotImplementedError = kotlin_kotlin.$_$.t9;
|
|
91
|
+
var take = kotlin_kotlin.$_$.g8;
|
|
92
|
+
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.v;
|
|
93
|
+
var Long = kotlin_kotlin.$_$.s9;
|
|
94
|
+
var UnsupportedOperationException_init_$Create$ = kotlin_kotlin.$_$.e1;
|
|
95
|
+
var Companion_instance_2 = kotlin_it_unibo_tuprolog_core.$_$.s;
|
|
96
|
+
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.a1;
|
|
97
|
+
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.u;
|
|
98
|
+
var numberRangeToNumber = kotlin_kotlin.$_$.v5;
|
|
99
|
+
var plus_0 = kotlin_kotlin.$_$.z7;
|
|
100
|
+
var getTag = kotlin_it_unibo_tuprolog_utils.$_$.l;
|
|
101
|
+
var containsTag = kotlin_it_unibo_tuprolog_utils.$_$.k;
|
|
102
|
+
var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_unify.$_$.b;
|
|
103
|
+
var Companion_instance_3 = kotlin_it_unibo_tuprolog_core.$_$.m;
|
|
104
|
+
var first_0 = kotlin_kotlin.$_$.y2;
|
|
105
|
+
var filterNotNull = kotlin_kotlin.$_$.h7;
|
|
106
|
+
var Taggable = kotlin_it_unibo_tuprolog_utils.$_$.m;
|
|
107
|
+
var filterNot = kotlin_kotlin.$_$.i7;
|
|
108
|
+
var asSequence_0 = kotlin_kotlin.$_$.i2;
|
|
109
|
+
var toLong = kotlin_kotlin.$_$.e6;
|
|
110
|
+
var emptyMap = kotlin_kotlin.$_$.u2;
|
|
111
|
+
var toList_0 = kotlin_kotlin.$_$.l4;
|
|
112
|
+
var listOf_0 = kotlin_kotlin.$_$.j3;
|
|
113
|
+
var none_0 = kotlin_kotlin.$_$.x3;
|
|
114
|
+
var dequeOf_1 = kotlin_it_unibo_tuprolog_utils.$_$.y;
|
|
115
|
+
var Pair = kotlin_kotlin.$_$.w9;
|
|
116
|
+
var flatMap = kotlin_kotlin.$_$.m7;
|
|
117
|
+
var toMutableList = kotlin_kotlin.$_$.r4;
|
|
118
|
+
var toMutableList_0 = kotlin_kotlin.$_$.k8;
|
|
119
|
+
var addFirst_0 = kotlin_it_unibo_tuprolog_utils.$_$.n;
|
|
120
|
+
var addAll = kotlin_kotlin.$_$.z1;
|
|
121
|
+
//endregion
|
|
122
|
+
//region block: pre-declaration
|
|
123
|
+
setMetadataFor(AbstractClauseCollection, 'AbstractClauseCollection', classMeta, VOID, [Iterable]);
|
|
124
|
+
setMetadataFor(AbstractMutableReteClauseCollection, 'AbstractMutableReteClauseCollection', classMeta, AbstractClauseCollection, [Iterable, AbstractClauseCollection]);
|
|
125
|
+
setMetadataFor(AbstractReteClauseCollection, 'AbstractReteClauseCollection', classMeta, AbstractClauseCollection);
|
|
126
|
+
setMetadataFor(Companion, 'Companion', objectMeta);
|
|
127
|
+
function get(clause) {
|
|
128
|
+
return this.getFifoOrdered(clause);
|
|
129
|
+
}
|
|
130
|
+
function add(clause) {
|
|
131
|
+
return this.addLast(clause);
|
|
132
|
+
}
|
|
133
|
+
function add_0(clause) {
|
|
134
|
+
return this.x1l(clause);
|
|
135
|
+
}
|
|
136
|
+
function retrieve(clause) {
|
|
137
|
+
return this.retrieveFirst(clause);
|
|
138
|
+
}
|
|
139
|
+
function retrieve_0(clause) {
|
|
140
|
+
return this.a1m(clause);
|
|
141
|
+
}
|
|
142
|
+
setMetadataFor(ClauseQueue, 'ClauseQueue', interfaceMeta, VOID, [Iterable]);
|
|
143
|
+
setMetadataFor(Companion_0, 'Companion', objectMeta);
|
|
144
|
+
setMetadataFor(MutableClauseQueue, 'MutableClauseQueue', interfaceMeta, VOID, [ClauseQueue]);
|
|
145
|
+
setMetadataFor(RetrieveResult, 'RetrieveResult', classMeta);
|
|
146
|
+
setMetadataFor(Success, 'Success', classMeta, RetrieveResult);
|
|
147
|
+
setMetadataFor(Failure, 'Failure', classMeta, RetrieveResult);
|
|
148
|
+
setMetadataFor(MutableReteClauseQueue, 'MutableReteClauseQueue', classMeta, AbstractMutableReteClauseCollection, [MutableClauseQueue, AbstractMutableReteClauseCollection]);
|
|
149
|
+
setMetadataFor(ReteClauseQueue, 'ReteClauseQueue', classMeta, AbstractReteClauseCollection, [ClauseQueue, AbstractReteClauseCollection]);
|
|
150
|
+
setMetadataFor(AbstractReteNode$removeAllLazily$slambda, 'AbstractReteNode$removeAllLazily$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]);
|
|
151
|
+
setMetadataFor(AbstractReteNode, 'AbstractReteNode', classMeta);
|
|
152
|
+
setMetadataFor(Companion_1, 'Companion', objectMeta);
|
|
153
|
+
setMetadataFor(Utils$firstArguments$slambda, 'Utils$firstArguments$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]);
|
|
154
|
+
setMetadataFor(Utils, 'Utils', objectMeta);
|
|
155
|
+
function get_innerClause() {
|
|
156
|
+
return this.r2();
|
|
157
|
+
}
|
|
158
|
+
function plus_1(traversed) {
|
|
159
|
+
return Companion_instance_7.b1p(this.hq(), this.q1n(), plus(this.x1o(), traversed));
|
|
160
|
+
}
|
|
161
|
+
setMetadataFor(IndexedClause, 'IndexedClause', interfaceMeta, VOID, [LongIndexed]);
|
|
162
|
+
setMetadataFor(IndexedClause$Companion$wrap$1, VOID, classMeta, VOID, [IndexedClause]);
|
|
163
|
+
setMetadataFor(Companion_2, 'Companion', objectMeta);
|
|
164
|
+
setMetadataFor(SituatedIndexedClause, 'SituatedIndexedClause', interfaceMeta, VOID, [IndexedClause]);
|
|
165
|
+
setMetadataFor(SituatedIndexedClause$Companion$of$1, VOID, classMeta, VOID, [SituatedIndexedClause]);
|
|
166
|
+
setMetadataFor(Companion_3, 'Companion', objectMeta);
|
|
167
|
+
setMetadataFor(AbstractIndexingLeaf, 'AbstractIndexingLeaf', classMeta, AbstractReteNode);
|
|
168
|
+
setMetadataFor(AtomIndex, 'AtomIndex', classMeta, AbstractIndexingLeaf);
|
|
169
|
+
setMetadataFor(CompoundIndex, 'CompoundIndex', classMeta, AbstractReteNode);
|
|
170
|
+
setMetadataFor(DirectiveIndex$getCache$1$1, VOID, classMeta);
|
|
171
|
+
setMetadataFor(DirectiveIndex, 'DirectiveIndex', classMeta, AbstractReteNode);
|
|
172
|
+
setMetadataFor(NumericIndex, 'NumericIndex', classMeta, AbstractIndexingLeaf);
|
|
173
|
+
setMetadataFor(VariableIndex, 'VariableIndex', classMeta, AbstractIndexingLeaf);
|
|
174
|
+
setMetadataFor(ArityNode, 'ArityNode', classMeta, AbstractReteNode);
|
|
175
|
+
setMetadataFor(FamilyArityReteNode, 'FamilyArityReteNode', classMeta, ArityNode);
|
|
176
|
+
setMetadataFor(FamilyArityIndexingNode, 'FamilyArityIndexingNode', classMeta, FamilyArityReteNode);
|
|
177
|
+
setMetadataFor(FunctorNode, 'FunctorNode', classMeta, AbstractReteNode);
|
|
178
|
+
setMetadataFor(FunctorIndexingNode, 'FunctorIndexingNode', classMeta, FunctorNode);
|
|
179
|
+
setMetadataFor(RootNode, 'RootNode', classMeta);
|
|
180
|
+
setMetadataFor(RuleNode, 'RuleNode', classMeta);
|
|
181
|
+
setMetadataFor(TopLevelFunctorReteNode, 'TopLevelFunctorReteNode', classMeta, FunctorNode);
|
|
182
|
+
setMetadataFor(ZeroArityReteNode, 'ZeroArityReteNode', classMeta, ArityNode);
|
|
183
|
+
function get_isMutable() {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
function get_rules() {
|
|
187
|
+
var tmp = asSequence(this.v1l());
|
|
188
|
+
return asIterable(filterNotNull(map(tmp, Theory$_get_rules_$lambda_c39n1s)));
|
|
189
|
+
}
|
|
190
|
+
function get_directives() {
|
|
191
|
+
var tmp = asSequence(this.v1l());
|
|
192
|
+
return asIterable(filterNotNull(map(tmp, Theory$_get_directives_$lambda_zbsn17)));
|
|
193
|
+
}
|
|
194
|
+
function plus_2(clause) {
|
|
195
|
+
return this.assertZ(clause);
|
|
196
|
+
}
|
|
197
|
+
function assertAFact(struct) {
|
|
198
|
+
return this.assertA(Companion_instance_3.of(struct));
|
|
199
|
+
}
|
|
200
|
+
function assertZFact(struct) {
|
|
201
|
+
return this.assertZ(Companion_instance_3.of(struct));
|
|
202
|
+
}
|
|
203
|
+
function retractByHead(head) {
|
|
204
|
+
return this.retract(Companion_instance_2.of(head, [Companion_getInstance().anonymous()]));
|
|
205
|
+
}
|
|
206
|
+
function retractAllByHead(head) {
|
|
207
|
+
return this.retractAll(Companion_instance_2.of(head, [Companion_getInstance().anonymous()]));
|
|
208
|
+
}
|
|
209
|
+
setMetadataFor(Theory, 'Theory', interfaceMeta, VOID, [Iterable, Taggable]);
|
|
210
|
+
setMetadataFor(AbstractTheory, 'AbstractTheory', classMeta, VOID, [Theory]);
|
|
211
|
+
function emptyTheory() {
|
|
212
|
+
return this.emptyTheoryWithUnificator(this.k1l());
|
|
213
|
+
}
|
|
214
|
+
function theoryOfIterable(clauses) {
|
|
215
|
+
return this.theoryOfIterableWithUnificator(clauses, this.k1l());
|
|
216
|
+
}
|
|
217
|
+
function theoryOf(clauses) {
|
|
218
|
+
return this.theoryOfWithUnificator(this.k1l(), clauses.slice());
|
|
219
|
+
}
|
|
220
|
+
function theoryOfSequence(clauses) {
|
|
221
|
+
return this.theoryOfSequenceWithUnificator(clauses, this.k1l());
|
|
222
|
+
}
|
|
223
|
+
function emptyMutableTheory() {
|
|
224
|
+
return this.emptyMutableTheoryWithUnificator(this.k1l());
|
|
225
|
+
}
|
|
226
|
+
function mutableTheoryOfIterable(clauses) {
|
|
227
|
+
return this.mutableTheoryOfIterableWithUnificator(clauses, this.k1l());
|
|
228
|
+
}
|
|
229
|
+
function mutableTheoryOf(clauses) {
|
|
230
|
+
return this.mutableTheoryOfWithUnificator(this.k1l(), clauses.slice());
|
|
231
|
+
}
|
|
232
|
+
function mutableTheoryOfSequence(clauses) {
|
|
233
|
+
return this.mutableTheoryOfSequenceWithUnificator(clauses, this.k1l());
|
|
234
|
+
}
|
|
235
|
+
setMetadataFor(TheoryFactory, 'TheoryFactory', interfaceMeta);
|
|
236
|
+
setMetadataFor(Default, 'Default', objectMeta, VOID, [TheoryFactory]);
|
|
237
|
+
setMetadataFor(IndexedTheoryFactory, 'IndexedTheoryFactory', classMeta, VOID, [TheoryFactory]);
|
|
238
|
+
setMetadataFor(Default_0, 'Default', objectMeta, VOID, [TheoryFactory]);
|
|
239
|
+
setMetadataFor(ListedTheoryFactory, 'ListedTheoryFactory', classMeta, VOID, [TheoryFactory]);
|
|
240
|
+
setMetadataFor(Companion_4, 'Companion', objectMeta);
|
|
241
|
+
function get_isMutable_0() {
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
244
|
+
function toMutableTheory() {
|
|
245
|
+
return this;
|
|
246
|
+
}
|
|
247
|
+
function assertAFact_0(struct) {
|
|
248
|
+
return this.q1s(Companion_instance_3.of(struct));
|
|
249
|
+
}
|
|
250
|
+
function assertZFact_0(struct) {
|
|
251
|
+
return this.u1s(Companion_instance_3.of(struct));
|
|
252
|
+
}
|
|
253
|
+
function retractByHead_0(head) {
|
|
254
|
+
return this.r1t(Companion_instance_2.of(head, [Companion_getInstance().anonymous()]));
|
|
255
|
+
}
|
|
256
|
+
function retractAllByHead_0(head) {
|
|
257
|
+
return this.d1m(Companion_instance_2.of(head, [Companion_getInstance().anonymous()]));
|
|
258
|
+
}
|
|
259
|
+
setMetadataFor(MutableTheory, 'MutableTheory', interfaceMeta, VOID, [Theory]);
|
|
260
|
+
setMetadataFor(RetractResult, 'RetractResult', classMeta);
|
|
261
|
+
setMetadataFor(Success_0, 'Success', classMeta, RetractResult);
|
|
262
|
+
setMetadataFor(Failure_0, 'Failure', classMeta, RetractResult);
|
|
263
|
+
setMetadataFor(Companion_5, 'Companion', objectMeta);
|
|
264
|
+
setMetadataFor(TheoryUtils, 'TheoryUtils', objectMeta);
|
|
265
|
+
setMetadataFor(_no_name_provided__qut3iv, VOID, classMeta, VOID, [Iterable]);
|
|
266
|
+
setMetadataFor(AbstractIndexedTheory, 'AbstractIndexedTheory', classMeta, AbstractTheory);
|
|
267
|
+
setMetadataFor(AbstractListedTheory, 'AbstractListedTheory', classMeta, AbstractTheory);
|
|
268
|
+
setMetadataFor(IndexedTheory, 'IndexedTheory', classMeta, AbstractIndexedTheory);
|
|
269
|
+
setMetadataFor(ListedTheory, 'ListedTheory', classMeta, AbstractListedTheory);
|
|
270
|
+
setMetadataFor(MutableIndexedTheory, 'MutableIndexedTheory', classMeta, AbstractIndexedTheory, [AbstractIndexedTheory, MutableTheory]);
|
|
271
|
+
setMetadataFor(MutableListedTheory, 'MutableListedTheory', classMeta, AbstractListedTheory, [AbstractListedTheory, MutableTheory]);
|
|
272
|
+
//endregion
|
|
273
|
+
function AbstractClauseCollection(rete) {
|
|
274
|
+
this.l1l_1 = rete;
|
|
275
|
+
}
|
|
276
|
+
protoOf(AbstractClauseCollection).k1l = function () {
|
|
277
|
+
return this.l1l_1.k1l();
|
|
278
|
+
};
|
|
279
|
+
protoOf(AbstractClauseCollection).l = function () {
|
|
280
|
+
return this.l1l_1.l();
|
|
281
|
+
};
|
|
282
|
+
protoOf(AbstractClauseCollection).n1l = function () {
|
|
283
|
+
return asIterable(this.l1l_1.o1l());
|
|
284
|
+
};
|
|
285
|
+
protoOf(AbstractClauseCollection).p1l = function () {
|
|
286
|
+
return asIterable(this.l1l_1.p1l());
|
|
287
|
+
};
|
|
288
|
+
protoOf(AbstractClauseCollection).z = function () {
|
|
289
|
+
return this.l1l_1.q1l();
|
|
290
|
+
};
|
|
291
|
+
protoOf(AbstractClauseCollection).isEmpty = function () {
|
|
292
|
+
return this.z();
|
|
293
|
+
};
|
|
294
|
+
protoOf(AbstractClauseCollection).r1l = function () {
|
|
295
|
+
return !this.z();
|
|
296
|
+
};
|
|
297
|
+
protoOf(AbstractClauseCollection).isNonEmpty = function () {
|
|
298
|
+
return this.r1l();
|
|
299
|
+
};
|
|
300
|
+
protoOf(AbstractClauseCollection).s1l = function (element) {
|
|
301
|
+
return any(this.l1l_1.t1l(element));
|
|
302
|
+
};
|
|
303
|
+
protoOf(AbstractClauseCollection).contains = function (element) {
|
|
304
|
+
return this.s1l(element);
|
|
305
|
+
};
|
|
306
|
+
protoOf(AbstractClauseCollection).u1l = function (elements) {
|
|
307
|
+
var tmp$ret$1;
|
|
308
|
+
$l$block: {
|
|
309
|
+
// Inline function 'kotlin.sequences.all' call
|
|
310
|
+
var tmp0_iterator = asSequence(elements).r();
|
|
311
|
+
while (tmp0_iterator.s()) {
|
|
312
|
+
var element = tmp0_iterator.u();
|
|
313
|
+
// Inline function 'it.unibo.tuprolog.collections.AbstractClauseCollection.containsAll.<anonymous>' call
|
|
314
|
+
if (!this.s1l(element)) {
|
|
315
|
+
tmp$ret$1 = false;
|
|
316
|
+
break $l$block;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
tmp$ret$1 = true;
|
|
320
|
+
}
|
|
321
|
+
return tmp$ret$1;
|
|
322
|
+
};
|
|
323
|
+
protoOf(AbstractClauseCollection).containsAll = function (elements) {
|
|
324
|
+
return this.u1l(elements);
|
|
325
|
+
};
|
|
326
|
+
protoOf(AbstractClauseCollection).r = function () {
|
|
327
|
+
return this.l1l_1.v1l().r();
|
|
328
|
+
};
|
|
329
|
+
protoOf(AbstractClauseCollection).toString = function () {
|
|
330
|
+
return '' + getKClassFromExpression(this).o6() + '(' + joinToString(this, ', ') + ')';
|
|
331
|
+
};
|
|
332
|
+
function AbstractMutableReteClauseCollection_init_$Init$(rete, $this) {
|
|
333
|
+
AbstractClauseCollection.call($this, rete);
|
|
334
|
+
AbstractMutableReteClauseCollection.call($this);
|
|
335
|
+
return $this;
|
|
336
|
+
}
|
|
337
|
+
protoOf(AbstractMutableReteClauseCollection).x1l = function (clause) {
|
|
338
|
+
this.l1l_1.y1l(clause);
|
|
339
|
+
return this.m1l();
|
|
340
|
+
};
|
|
341
|
+
protoOf(AbstractMutableReteClauseCollection).add = function (clause) {
|
|
342
|
+
return this.x1l(clause);
|
|
343
|
+
};
|
|
344
|
+
protoOf(AbstractMutableReteClauseCollection).z1l = function (clauses) {
|
|
345
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
346
|
+
var tmp0_iterator = clauses.r();
|
|
347
|
+
while (tmp0_iterator.s()) {
|
|
348
|
+
var element = tmp0_iterator.u();
|
|
349
|
+
// Inline function 'it.unibo.tuprolog.collections.AbstractMutableReteClauseCollection.addAll.<anonymous>' call
|
|
350
|
+
this.l1l_1.y1l(element);
|
|
351
|
+
}
|
|
352
|
+
return this.m1l();
|
|
353
|
+
};
|
|
354
|
+
protoOf(AbstractMutableReteClauseCollection).addAll = function (clauses) {
|
|
355
|
+
return this.z1l(clauses);
|
|
356
|
+
};
|
|
357
|
+
protoOf(AbstractMutableReteClauseCollection).a1m = function (clause) {
|
|
358
|
+
var retracted = this.l1l_1.b1m(clause);
|
|
359
|
+
return none(retracted) ? new Failure(this.m1l()) : new Success(this.m1l(), toList(retracted));
|
|
360
|
+
};
|
|
361
|
+
protoOf(AbstractMutableReteClauseCollection).retrieve = function (clause) {
|
|
362
|
+
return this.a1m(clause);
|
|
363
|
+
};
|
|
364
|
+
protoOf(AbstractMutableReteClauseCollection).c1m = function (clause) {
|
|
365
|
+
var retracted = this.l1l_1.d1m(clause);
|
|
366
|
+
return none(retracted) ? new Failure(this.m1l()) : new Success(this.m1l(), toList(retracted));
|
|
367
|
+
};
|
|
368
|
+
protoOf(AbstractMutableReteClauseCollection).retrieveAll = function (clause) {
|
|
369
|
+
return this.c1m(clause);
|
|
370
|
+
};
|
|
371
|
+
function AbstractMutableReteClauseCollection() {
|
|
372
|
+
}
|
|
373
|
+
function AbstractReteClauseCollection(rete) {
|
|
374
|
+
AbstractClauseCollection.call(this, rete);
|
|
375
|
+
}
|
|
376
|
+
protoOf(AbstractReteClauseCollection).x1l = function (clause) {
|
|
377
|
+
// Inline function 'kotlin.apply' call
|
|
378
|
+
var this_0 = this.l1l_1.g1m();
|
|
379
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
380
|
+
// Inline function 'it.unibo.tuprolog.collections.AbstractReteClauseCollection.add.<anonymous>' call
|
|
381
|
+
this_0.y1l(TheoryUtils_instance.h1m(clause));
|
|
382
|
+
return this.f1m(this_0);
|
|
383
|
+
};
|
|
384
|
+
protoOf(AbstractReteClauseCollection).add = function (clause) {
|
|
385
|
+
return this.x1l(clause);
|
|
386
|
+
};
|
|
387
|
+
protoOf(AbstractReteClauseCollection).z1l = function (clauses) {
|
|
388
|
+
// Inline function 'kotlin.apply' call
|
|
389
|
+
var this_0 = this.l1l_1.g1m();
|
|
390
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
391
|
+
// Inline function 'it.unibo.tuprolog.collections.AbstractReteClauseCollection.addAll.<anonymous>' call
|
|
392
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
393
|
+
var tmp0_iterator = clauses.r();
|
|
394
|
+
while (tmp0_iterator.s()) {
|
|
395
|
+
var element = tmp0_iterator.u();
|
|
396
|
+
// Inline function 'it.unibo.tuprolog.collections.AbstractReteClauseCollection.addAll.<anonymous>.<anonymous>' call
|
|
397
|
+
this_0.y1l(TheoryUtils_instance.h1m(element));
|
|
398
|
+
}
|
|
399
|
+
return this.f1m(this_0);
|
|
400
|
+
};
|
|
401
|
+
protoOf(AbstractReteClauseCollection).addAll = function (clauses) {
|
|
402
|
+
return this.z1l(clauses);
|
|
403
|
+
};
|
|
404
|
+
protoOf(AbstractReteClauseCollection).a1m = function (clause) {
|
|
405
|
+
var newTheory = this.l1l_1.g1m();
|
|
406
|
+
var retracted = newTheory.b1m(clause);
|
|
407
|
+
return none(retracted) ? new Failure(this.m1l()) : new Success(this.f1m(newTheory), toList(retracted));
|
|
408
|
+
};
|
|
409
|
+
protoOf(AbstractReteClauseCollection).retrieve = function (clause) {
|
|
410
|
+
return this.a1m(clause);
|
|
411
|
+
};
|
|
412
|
+
protoOf(AbstractReteClauseCollection).c1m = function (clause) {
|
|
413
|
+
var newTheory = this.l1l_1.g1m();
|
|
414
|
+
var retracted = newTheory.d1m(clause);
|
|
415
|
+
return none(retracted) ? new Failure(this.m1l()) : new Success(this.f1m(newTheory), toList(retracted));
|
|
416
|
+
};
|
|
417
|
+
protoOf(AbstractReteClauseCollection).retrieveAll = function (clause) {
|
|
418
|
+
return this.c1m(clause);
|
|
419
|
+
};
|
|
420
|
+
function Companion() {
|
|
421
|
+
}
|
|
422
|
+
protoOf(Companion).empty = function (unificator) {
|
|
423
|
+
return this.ofIterable(unificator, emptyList());
|
|
424
|
+
};
|
|
425
|
+
protoOf(Companion).of = function (unificator, clause) {
|
|
426
|
+
return this.ofIterable(unificator, asIterable_0(clause));
|
|
427
|
+
};
|
|
428
|
+
protoOf(Companion).ofScopes = function (unificator, clause) {
|
|
429
|
+
// Inline function 'kotlin.collections.map' call
|
|
430
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
431
|
+
var destination = ArrayList_init_$Create$(clause.length);
|
|
432
|
+
var inductionVariable = 0;
|
|
433
|
+
var last = clause.length;
|
|
434
|
+
while (inductionVariable < last) {
|
|
435
|
+
var item = clause[inductionVariable];
|
|
436
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
437
|
+
// Inline function 'it.unibo.tuprolog.collections.Companion.of.<anonymous>' call
|
|
438
|
+
var tmp$ret$0 = Companion_instance.emptyWithFunction(item);
|
|
439
|
+
destination.o(tmp$ret$0);
|
|
440
|
+
}
|
|
441
|
+
return this.ofIterable(unificator, destination);
|
|
442
|
+
};
|
|
443
|
+
protoOf(Companion).ofSequence = function (unificator, clauses) {
|
|
444
|
+
return this.ofIterable(unificator, asIterable(clauses));
|
|
445
|
+
};
|
|
446
|
+
protoOf(Companion).ofIterable = function (unificator, clauses) {
|
|
447
|
+
return ReteClauseQueue_init_$Create$(unificator, clauses);
|
|
448
|
+
};
|
|
449
|
+
protoOf(Companion).areEquals = function (queue1, queue2) {
|
|
450
|
+
return itemWiseEquals(queue1, queue2);
|
|
451
|
+
};
|
|
452
|
+
protoOf(Companion).computeHashCode = function (queue) {
|
|
453
|
+
return itemWiseHashCode_0([getKClass(ClauseQueue), itemWiseHashCode(queue)]);
|
|
454
|
+
};
|
|
455
|
+
var Companion_instance_4;
|
|
456
|
+
function Companion_getInstance_2() {
|
|
457
|
+
return Companion_instance_4;
|
|
458
|
+
}
|
|
459
|
+
function ClauseQueue() {
|
|
460
|
+
}
|
|
461
|
+
function Companion_0() {
|
|
462
|
+
}
|
|
463
|
+
protoOf(Companion_0).empty = function (unificator) {
|
|
464
|
+
return this.ofIterable(unificator, emptyList());
|
|
465
|
+
};
|
|
466
|
+
protoOf(Companion_0).of = function (unificator, clause) {
|
|
467
|
+
return this.ofIterable(unificator, asIterable_0(clause));
|
|
468
|
+
};
|
|
469
|
+
protoOf(Companion_0).ofScopes = function (unificator, clause) {
|
|
470
|
+
// Inline function 'kotlin.collections.map' call
|
|
471
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
472
|
+
var destination = ArrayList_init_$Create$(clause.length);
|
|
473
|
+
var inductionVariable = 0;
|
|
474
|
+
var last = clause.length;
|
|
475
|
+
while (inductionVariable < last) {
|
|
476
|
+
var item = clause[inductionVariable];
|
|
477
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
478
|
+
// Inline function 'it.unibo.tuprolog.collections.Companion.of.<anonymous>' call
|
|
479
|
+
var tmp$ret$0 = Companion_instance.emptyWithFunction(item);
|
|
480
|
+
destination.o(tmp$ret$0);
|
|
481
|
+
}
|
|
482
|
+
return this.ofIterable(unificator, destination);
|
|
483
|
+
};
|
|
484
|
+
protoOf(Companion_0).ofSequence = function (unificator, clauses) {
|
|
485
|
+
return this.ofIterable(unificator, asIterable(clauses));
|
|
486
|
+
};
|
|
487
|
+
protoOf(Companion_0).ofIterable = function (unificator, clauses) {
|
|
488
|
+
return MutableReteClauseQueue_init_$Create$(unificator, clauses);
|
|
489
|
+
};
|
|
490
|
+
protoOf(Companion_0).areEquals = function (queue1, queue2) {
|
|
491
|
+
return Companion_instance_4.areEquals(queue1, queue2);
|
|
492
|
+
};
|
|
493
|
+
protoOf(Companion_0).computeHashCode = function (queue) {
|
|
494
|
+
return itemWiseHashCode_0([getKClass(MutableClauseQueue), itemWiseHashCode(queue)]);
|
|
495
|
+
};
|
|
496
|
+
var Companion_instance_5;
|
|
497
|
+
function Companion_getInstance_3() {
|
|
498
|
+
return Companion_instance_5;
|
|
499
|
+
}
|
|
500
|
+
function MutableClauseQueue() {
|
|
501
|
+
}
|
|
502
|
+
function Success(collection, clauses) {
|
|
503
|
+
RetrieveResult.call(this);
|
|
504
|
+
this.l1m_1 = collection;
|
|
505
|
+
this.m1m_1 = clauses;
|
|
506
|
+
}
|
|
507
|
+
protoOf(Success).n1m = function () {
|
|
508
|
+
return this.l1m_1;
|
|
509
|
+
};
|
|
510
|
+
protoOf(Success).v1l = function () {
|
|
511
|
+
return this.m1m_1;
|
|
512
|
+
};
|
|
513
|
+
protoOf(Success).j11 = function () {
|
|
514
|
+
return true;
|
|
515
|
+
};
|
|
516
|
+
protoOf(Success).o1m = function () {
|
|
517
|
+
return first(this.m1m_1);
|
|
518
|
+
};
|
|
519
|
+
protoOf(Success).toString = function () {
|
|
520
|
+
return 'Success(collection=' + this.l1m_1 + ', clauses=' + this.m1m_1 + ')';
|
|
521
|
+
};
|
|
522
|
+
protoOf(Success).hashCode = function () {
|
|
523
|
+
var result = hashCode(this.l1m_1);
|
|
524
|
+
result = imul(result, 31) + hashCode(this.m1m_1) | 0;
|
|
525
|
+
return result;
|
|
526
|
+
};
|
|
527
|
+
protoOf(Success).equals = function (other) {
|
|
528
|
+
if (this === other)
|
|
529
|
+
return true;
|
|
530
|
+
if (!(other instanceof Success))
|
|
531
|
+
return false;
|
|
532
|
+
var tmp0_other_with_cast = other instanceof Success ? other : THROW_CCE();
|
|
533
|
+
if (!equals(this.l1m_1, tmp0_other_with_cast.l1m_1))
|
|
534
|
+
return false;
|
|
535
|
+
if (!equals(this.m1m_1, tmp0_other_with_cast.m1m_1))
|
|
536
|
+
return false;
|
|
537
|
+
return true;
|
|
538
|
+
};
|
|
539
|
+
function Failure(collection) {
|
|
540
|
+
RetrieveResult.call(this);
|
|
541
|
+
this.q1m_1 = collection;
|
|
542
|
+
}
|
|
543
|
+
protoOf(Failure).n1m = function () {
|
|
544
|
+
return this.q1m_1;
|
|
545
|
+
};
|
|
546
|
+
protoOf(Failure).p1m = function () {
|
|
547
|
+
return true;
|
|
548
|
+
};
|
|
549
|
+
protoOf(Failure).v1l = function () {
|
|
550
|
+
return null;
|
|
551
|
+
};
|
|
552
|
+
protoOf(Failure).o1m = function () {
|
|
553
|
+
return null;
|
|
554
|
+
};
|
|
555
|
+
protoOf(Failure).toString = function () {
|
|
556
|
+
return 'Failure(collection=' + this.q1m_1 + ')';
|
|
557
|
+
};
|
|
558
|
+
protoOf(Failure).hashCode = function () {
|
|
559
|
+
return hashCode(this.q1m_1);
|
|
560
|
+
};
|
|
561
|
+
protoOf(Failure).equals = function (other) {
|
|
562
|
+
if (this === other)
|
|
563
|
+
return true;
|
|
564
|
+
if (!(other instanceof Failure))
|
|
565
|
+
return false;
|
|
566
|
+
var tmp0_other_with_cast = other instanceof Failure ? other : THROW_CCE();
|
|
567
|
+
if (!equals(this.q1m_1, tmp0_other_with_cast.q1m_1))
|
|
568
|
+
return false;
|
|
569
|
+
return true;
|
|
570
|
+
};
|
|
571
|
+
function RetrieveResult() {
|
|
572
|
+
}
|
|
573
|
+
protoOf(RetrieveResult).j11 = function () {
|
|
574
|
+
return false;
|
|
575
|
+
};
|
|
576
|
+
protoOf(RetrieveResult).p1m = function () {
|
|
577
|
+
return false;
|
|
578
|
+
};
|
|
579
|
+
function MutableReteClauseQueue_init_$Init$(unificator, clauses, $this) {
|
|
580
|
+
MutableReteClauseQueue.call($this, Companion_instance_6.r1m(unificator, clauses));
|
|
581
|
+
TheoryUtils_instance.s1m(clauses);
|
|
582
|
+
return $this;
|
|
583
|
+
}
|
|
584
|
+
function MutableReteClauseQueue_init_$Create$(unificator, clauses) {
|
|
585
|
+
return MutableReteClauseQueue_init_$Init$(unificator, clauses, objectCreate(protoOf(MutableReteClauseQueue)));
|
|
586
|
+
}
|
|
587
|
+
function MutableReteClauseQueue(rete) {
|
|
588
|
+
AbstractMutableReteClauseCollection_init_$Init$(rete, this);
|
|
589
|
+
// Inline function 'kotlin.require' call
|
|
590
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
591
|
+
// Inline function 'kotlin.require' call
|
|
592
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
593
|
+
if (!rete.t1m()) {
|
|
594
|
+
// Inline function 'kotlin.require.<anonymous>' call
|
|
595
|
+
var message = 'Failed requirement.';
|
|
596
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
protoOf(MutableReteClauseQueue).v1m = function (clause) {
|
|
600
|
+
return this.l1l_1.t1l(clause);
|
|
601
|
+
};
|
|
602
|
+
protoOf(MutableReteClauseQueue).getFifoOrdered = function (clause) {
|
|
603
|
+
return this.v1m(clause);
|
|
604
|
+
};
|
|
605
|
+
protoOf(MutableReteClauseQueue).w1m = function (clause) {
|
|
606
|
+
return asSequence(asReversed(toList(this.v1m(clause))));
|
|
607
|
+
};
|
|
608
|
+
protoOf(MutableReteClauseQueue).getLifoOrdered = function (clause) {
|
|
609
|
+
return this.w1m(clause);
|
|
610
|
+
};
|
|
611
|
+
protoOf(MutableReteClauseQueue).i1m = function (clause) {
|
|
612
|
+
this.l1l_1.x1m(clause);
|
|
613
|
+
return this;
|
|
614
|
+
};
|
|
615
|
+
protoOf(MutableReteClauseQueue).addFirst = function (clause) {
|
|
616
|
+
return this.i1m(clause);
|
|
617
|
+
};
|
|
618
|
+
protoOf(MutableReteClauseQueue).j1m = function (clause) {
|
|
619
|
+
this.l1l_1.y1l(clause);
|
|
620
|
+
return this;
|
|
621
|
+
};
|
|
622
|
+
protoOf(MutableReteClauseQueue).addLast = function (clause) {
|
|
623
|
+
return this.j1m(clause);
|
|
624
|
+
};
|
|
625
|
+
protoOf(MutableReteClauseQueue).k1m = function (clause) {
|
|
626
|
+
var retracted = this.l1l_1.b1m(clause);
|
|
627
|
+
return none(retracted) ? new Failure(this) : new Success(this, toList(retracted));
|
|
628
|
+
};
|
|
629
|
+
protoOf(MutableReteClauseQueue).retrieveFirst = function (clause) {
|
|
630
|
+
return this.k1m(clause);
|
|
631
|
+
};
|
|
632
|
+
protoOf(MutableReteClauseQueue).equals = function (other) {
|
|
633
|
+
var tmp;
|
|
634
|
+
if (!(other == null) ? isInterface(other, MutableClauseQueue) : false) {
|
|
635
|
+
tmp = Companion_instance_5.areEquals(this, other);
|
|
636
|
+
} else {
|
|
637
|
+
tmp = false;
|
|
638
|
+
}
|
|
639
|
+
return tmp;
|
|
640
|
+
};
|
|
641
|
+
protoOf(MutableReteClauseQueue).hashCode = function () {
|
|
642
|
+
return Companion_instance_5.computeHashCode(this);
|
|
643
|
+
};
|
|
644
|
+
protoOf(MutableReteClauseQueue).m1l = function () {
|
|
645
|
+
return this;
|
|
646
|
+
};
|
|
647
|
+
function _get_hashCodeCache__ny3r0q($this) {
|
|
648
|
+
// Inline function 'kotlin.getValue' call
|
|
649
|
+
var this_0 = $this.z1m_1;
|
|
650
|
+
hashCodeCache$factory();
|
|
651
|
+
return this_0.r2();
|
|
652
|
+
}
|
|
653
|
+
function ReteClauseQueue_init_$Init$(unificator, clauses, $this) {
|
|
654
|
+
ReteClauseQueue.call($this, Companion_instance_6.r1m(unificator, clauses));
|
|
655
|
+
TheoryUtils_instance.s1m(clauses);
|
|
656
|
+
return $this;
|
|
657
|
+
}
|
|
658
|
+
function ReteClauseQueue_init_$Create$(unificator, clauses) {
|
|
659
|
+
return ReteClauseQueue_init_$Init$(unificator, clauses, objectCreate(protoOf(ReteClauseQueue)));
|
|
660
|
+
}
|
|
661
|
+
function ReteClauseQueue$hashCodeCache$delegate$lambda(this$0) {
|
|
662
|
+
return function () {
|
|
663
|
+
return Companion_instance_4.computeHashCode(this$0);
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
function ReteClauseQueue(rete) {
|
|
667
|
+
AbstractReteClauseCollection.call(this, rete);
|
|
668
|
+
var tmp = this;
|
|
669
|
+
tmp.z1m_1 = lazy(ReteClauseQueue$hashCodeCache$delegate$lambda(this));
|
|
670
|
+
// Inline function 'kotlin.require' call
|
|
671
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
672
|
+
// Inline function 'kotlin.require' call
|
|
673
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
674
|
+
if (!rete.t1m()) {
|
|
675
|
+
// Inline function 'kotlin.require.<anonymous>' call
|
|
676
|
+
var message = 'Failed requirement.';
|
|
677
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
protoOf(ReteClauseQueue).i1m = function (clause) {
|
|
681
|
+
// Inline function 'kotlin.apply' call
|
|
682
|
+
var this_0 = this.l1l_1.g1m();
|
|
683
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
684
|
+
// Inline function 'it.unibo.tuprolog.collections.impl.ReteClauseQueue.addFirst.<anonymous>' call
|
|
685
|
+
this_0.x1m(TheoryUtils_instance.h1m(clause));
|
|
686
|
+
return new ReteClauseQueue(this_0);
|
|
687
|
+
};
|
|
688
|
+
protoOf(ReteClauseQueue).addFirst = function (clause) {
|
|
689
|
+
return this.i1m(clause);
|
|
690
|
+
};
|
|
691
|
+
protoOf(ReteClauseQueue).j1m = function (clause) {
|
|
692
|
+
// Inline function 'kotlin.apply' call
|
|
693
|
+
var this_0 = this.l1l_1.g1m();
|
|
694
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
695
|
+
// Inline function 'it.unibo.tuprolog.collections.impl.ReteClauseQueue.addLast.<anonymous>' call
|
|
696
|
+
this_0.y1l(TheoryUtils_instance.h1m(clause));
|
|
697
|
+
return new ReteClauseQueue(this_0);
|
|
698
|
+
};
|
|
699
|
+
protoOf(ReteClauseQueue).addLast = function (clause) {
|
|
700
|
+
return this.j1m(clause);
|
|
701
|
+
};
|
|
702
|
+
protoOf(ReteClauseQueue).v1m = function (clause) {
|
|
703
|
+
return this.l1l_1.t1l(clause);
|
|
704
|
+
};
|
|
705
|
+
protoOf(ReteClauseQueue).getFifoOrdered = function (clause) {
|
|
706
|
+
return this.v1m(clause);
|
|
707
|
+
};
|
|
708
|
+
protoOf(ReteClauseQueue).w1m = function (clause) {
|
|
709
|
+
return asSequence(asReversed(toList(this.v1m(clause))));
|
|
710
|
+
};
|
|
711
|
+
protoOf(ReteClauseQueue).getLifoOrdered = function (clause) {
|
|
712
|
+
return this.w1m(clause);
|
|
713
|
+
};
|
|
714
|
+
protoOf(ReteClauseQueue).x1l = function (clause) {
|
|
715
|
+
return this.j1m(clause);
|
|
716
|
+
};
|
|
717
|
+
protoOf(ReteClauseQueue).add = function (clause) {
|
|
718
|
+
return this.x1l(clause);
|
|
719
|
+
};
|
|
720
|
+
protoOf(ReteClauseQueue).a1m = function (clause) {
|
|
721
|
+
return protoOf(AbstractReteClauseCollection).a1m.call(this, clause);
|
|
722
|
+
};
|
|
723
|
+
protoOf(ReteClauseQueue).retrieve = function (clause) {
|
|
724
|
+
return this.a1m(clause);
|
|
725
|
+
};
|
|
726
|
+
protoOf(ReteClauseQueue).k1m = function (clause) {
|
|
727
|
+
return protoOf(AbstractReteClauseCollection).a1m.call(this, clause);
|
|
728
|
+
};
|
|
729
|
+
protoOf(ReteClauseQueue).retrieveFirst = function (clause) {
|
|
730
|
+
return this.k1m(clause);
|
|
731
|
+
};
|
|
732
|
+
protoOf(ReteClauseQueue).f1m = function (rete) {
|
|
733
|
+
return new ReteClauseQueue(rete);
|
|
734
|
+
};
|
|
735
|
+
protoOf(ReteClauseQueue).equals = function (other) {
|
|
736
|
+
var tmp;
|
|
737
|
+
var tmp_0;
|
|
738
|
+
if (!(other == null) ? isInterface(other, ClauseQueue) : false) {
|
|
739
|
+
tmp_0 = !(!(other == null) ? isInterface(other, MutableClauseQueue) : false);
|
|
740
|
+
} else {
|
|
741
|
+
tmp_0 = false;
|
|
742
|
+
}
|
|
743
|
+
if (tmp_0) {
|
|
744
|
+
tmp = Companion_instance_4.areEquals(this, other);
|
|
745
|
+
} else {
|
|
746
|
+
tmp = false;
|
|
747
|
+
}
|
|
748
|
+
return tmp;
|
|
749
|
+
};
|
|
750
|
+
protoOf(ReteClauseQueue).hashCode = function () {
|
|
751
|
+
return _get_hashCodeCache__ny3r0q(this);
|
|
752
|
+
};
|
|
753
|
+
protoOf(ReteClauseQueue).m1l = function () {
|
|
754
|
+
return this;
|
|
755
|
+
};
|
|
756
|
+
function hashCodeCache$factory() {
|
|
757
|
+
return getPropertyCallableRef('hashCodeCache', 1, KProperty1, function (receiver) {
|
|
758
|
+
return _get_hashCodeCache__ny3r0q(receiver);
|
|
759
|
+
}, null);
|
|
760
|
+
}
|
|
761
|
+
function AbstractReteNode$removeAllLazily$slambda($source, this$0, $clause, resultContinuation) {
|
|
762
|
+
this.i1n_1 = $source;
|
|
763
|
+
this.j1n_1 = this$0;
|
|
764
|
+
this.k1n_1 = $clause;
|
|
765
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
766
|
+
}
|
|
767
|
+
protoOf(AbstractReteNode$removeAllLazily$slambda).xq = function ($this$sequence, $completion) {
|
|
768
|
+
var tmp = this.yq($this$sequence, $completion);
|
|
769
|
+
tmp.hb_1 = Unit_instance;
|
|
770
|
+
tmp.ib_1 = null;
|
|
771
|
+
return tmp.qb();
|
|
772
|
+
};
|
|
773
|
+
protoOf(AbstractReteNode$removeAllLazily$slambda).dc = function (p1, $completion) {
|
|
774
|
+
return this.xq(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
|
|
775
|
+
};
|
|
776
|
+
protoOf(AbstractReteNode$removeAllLazily$slambda).qb = function () {
|
|
777
|
+
var suspendResult = this.hb_1;
|
|
778
|
+
$sm: do
|
|
779
|
+
try {
|
|
780
|
+
var tmp = this.fb_1;
|
|
781
|
+
switch (tmp) {
|
|
782
|
+
case 0:
|
|
783
|
+
this.gb_1 = 5;
|
|
784
|
+
this.m1n_1 = this.i1n_1.r();
|
|
785
|
+
this.fb_1 = 1;
|
|
786
|
+
continue $sm;
|
|
787
|
+
case 1:
|
|
788
|
+
if (!this.m1n_1.s()) {
|
|
789
|
+
this.fb_1 = 4;
|
|
790
|
+
continue $sm;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
this.n1n_1 = this.m1n_1.u();
|
|
794
|
+
if (this.j1n_1.k1l().match(this.n1n_1.q1n(), this.k1n_1)) {
|
|
795
|
+
this.n1n_1.o1n();
|
|
796
|
+
this.m1n_1.t();
|
|
797
|
+
this.fb_1 = 2;
|
|
798
|
+
suspendResult = this.l1n_1.wd(this.n1n_1, this);
|
|
799
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
800
|
+
return suspendResult;
|
|
801
|
+
}
|
|
802
|
+
continue $sm;
|
|
803
|
+
} else {
|
|
804
|
+
this.fb_1 = 3;
|
|
805
|
+
continue $sm;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
case 2:
|
|
809
|
+
this.fb_1 = 3;
|
|
810
|
+
continue $sm;
|
|
811
|
+
case 3:
|
|
812
|
+
this.fb_1 = 1;
|
|
813
|
+
continue $sm;
|
|
814
|
+
case 4:
|
|
815
|
+
return Unit_instance;
|
|
816
|
+
case 5:
|
|
817
|
+
throw this.ib_1;
|
|
818
|
+
}
|
|
819
|
+
} catch ($p) {
|
|
820
|
+
var e = $p;
|
|
821
|
+
if (this.gb_1 === 5) {
|
|
822
|
+
throw e;
|
|
823
|
+
} else {
|
|
824
|
+
this.fb_1 = this.gb_1;
|
|
825
|
+
this.ib_1 = e;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
while (true);
|
|
829
|
+
};
|
|
830
|
+
protoOf(AbstractReteNode$removeAllLazily$slambda).yq = function ($this$sequence, completion) {
|
|
831
|
+
var i = new AbstractReteNode$removeAllLazily$slambda(this.i1n_1, this.j1n_1, this.k1n_1, completion);
|
|
832
|
+
i.l1n_1 = $this$sequence;
|
|
833
|
+
return i;
|
|
834
|
+
};
|
|
835
|
+
function AbstractReteNode$removeAllLazily$slambda_0($source, this$0, $clause, resultContinuation) {
|
|
836
|
+
var i = new AbstractReteNode$removeAllLazily$slambda($source, this$0, $clause, resultContinuation);
|
|
837
|
+
var l = function ($this$sequence, $completion) {
|
|
838
|
+
return i.xq($this$sequence, $completion);
|
|
839
|
+
};
|
|
840
|
+
l.$arity = 1;
|
|
841
|
+
return l;
|
|
842
|
+
}
|
|
843
|
+
function AbstractReteNode(unificator) {
|
|
844
|
+
this.p1n_1 = unificator;
|
|
845
|
+
}
|
|
846
|
+
protoOf(AbstractReteNode).k1l = function () {
|
|
847
|
+
return this.p1n_1;
|
|
848
|
+
};
|
|
849
|
+
protoOf(AbstractReteNode).r1n = function (source, clause) {
|
|
850
|
+
return sequence(AbstractReteNode$removeAllLazily$slambda_0(source, this, clause, null));
|
|
851
|
+
};
|
|
852
|
+
function Companion_1() {
|
|
853
|
+
}
|
|
854
|
+
protoOf(Companion_1).r1m = function (unificator, clauses) {
|
|
855
|
+
return new RootNode(unificator, clauses, true);
|
|
856
|
+
};
|
|
857
|
+
var Companion_instance_6;
|
|
858
|
+
function Companion_getInstance_4() {
|
|
859
|
+
return Companion_instance_6;
|
|
860
|
+
}
|
|
861
|
+
function firstArguments(_this__u8e3s4, $this) {
|
|
862
|
+
return sequence(Utils$firstArguments$slambda_0(_this__u8e3s4, null));
|
|
863
|
+
}
|
|
864
|
+
function Utils$firstArguments$slambda($this_firstArguments, resultContinuation) {
|
|
865
|
+
this.e1o_1 = $this_firstArguments;
|
|
866
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
867
|
+
}
|
|
868
|
+
protoOf(Utils$firstArguments$slambda).h1o = function ($this$sequence, $completion) {
|
|
869
|
+
var tmp = this.i1o($this$sequence, $completion);
|
|
870
|
+
tmp.hb_1 = Unit_instance;
|
|
871
|
+
tmp.ib_1 = null;
|
|
872
|
+
return tmp.qb();
|
|
873
|
+
};
|
|
874
|
+
protoOf(Utils$firstArguments$slambda).dc = function (p1, $completion) {
|
|
875
|
+
return this.h1o(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
|
|
876
|
+
};
|
|
877
|
+
protoOf(Utils$firstArguments$slambda).qb = function () {
|
|
878
|
+
var suspendResult = this.hb_1;
|
|
879
|
+
$sm: do
|
|
880
|
+
try {
|
|
881
|
+
var tmp = this.fb_1;
|
|
882
|
+
switch (tmp) {
|
|
883
|
+
case 0:
|
|
884
|
+
this.gb_1 = 5;
|
|
885
|
+
this.g1o_1 = this.e1o_1;
|
|
886
|
+
this.fb_1 = 1;
|
|
887
|
+
continue $sm;
|
|
888
|
+
case 1:
|
|
889
|
+
if (!this.g1o_1.lv()) {
|
|
890
|
+
this.fb_1 = 3;
|
|
891
|
+
continue $sm;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
this.fb_1 = 2;
|
|
895
|
+
suspendResult = this.f1o_1.wd(this.g1o_1, this);
|
|
896
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
897
|
+
return suspendResult;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
continue $sm;
|
|
901
|
+
case 2:
|
|
902
|
+
this.g1o_1 = this.g1o_1.castToStruct().getArgAt(0);
|
|
903
|
+
this.fb_1 = 1;
|
|
904
|
+
continue $sm;
|
|
905
|
+
case 3:
|
|
906
|
+
this.fb_1 = 4;
|
|
907
|
+
suspendResult = this.f1o_1.wd(this.g1o_1, this);
|
|
908
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
909
|
+
return suspendResult;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
continue $sm;
|
|
913
|
+
case 4:
|
|
914
|
+
return Unit_instance;
|
|
915
|
+
case 5:
|
|
916
|
+
throw this.ib_1;
|
|
917
|
+
}
|
|
918
|
+
} catch ($p) {
|
|
919
|
+
var e = $p;
|
|
920
|
+
if (this.gb_1 === 5) {
|
|
921
|
+
throw e;
|
|
922
|
+
} else {
|
|
923
|
+
this.fb_1 = this.gb_1;
|
|
924
|
+
this.ib_1 = e;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
while (true);
|
|
928
|
+
};
|
|
929
|
+
protoOf(Utils$firstArguments$slambda).i1o = function ($this$sequence, completion) {
|
|
930
|
+
var i = new Utils$firstArguments$slambda(this.e1o_1, completion);
|
|
931
|
+
i.f1o_1 = $this$sequence;
|
|
932
|
+
return i;
|
|
933
|
+
};
|
|
934
|
+
function Utils$firstArguments$slambda_0($this_firstArguments, resultContinuation) {
|
|
935
|
+
var i = new Utils$firstArguments$slambda($this_firstArguments, resultContinuation);
|
|
936
|
+
var l = function ($this$sequence, $completion) {
|
|
937
|
+
return i.h1o($this$sequence, $completion);
|
|
938
|
+
};
|
|
939
|
+
l.$arity = 1;
|
|
940
|
+
return l;
|
|
941
|
+
}
|
|
942
|
+
function SituatedIndexedClause$compareTo$ref() {
|
|
943
|
+
var l = function (p0, p1) {
|
|
944
|
+
return p0.is(p1);
|
|
945
|
+
};
|
|
946
|
+
l.callableName = 'compareTo';
|
|
947
|
+
return l;
|
|
948
|
+
}
|
|
949
|
+
function Utils() {
|
|
950
|
+
}
|
|
951
|
+
protoOf(Utils).j1o = function (_this__u8e3s4, nestingLevel) {
|
|
952
|
+
// Inline function 'kotlin.let' call
|
|
953
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
954
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.Utils.arityOfNestedFirstArgument.<anonymous>' call
|
|
955
|
+
return takeFirstAfterSkipping(firstArguments(_this__u8e3s4, this), nestingLevel).castToStruct().zu();
|
|
956
|
+
};
|
|
957
|
+
protoOf(Utils).k1o = function (_this__u8e3s4, nestingLevel) {
|
|
958
|
+
// Inline function 'kotlin.let' call
|
|
959
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
960
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.Utils.functorOfNestedFirstArgument.<anonymous>' call
|
|
961
|
+
return takeFirstAfterSkipping(firstArguments(_this__u8e3s4, this), nestingLevel).castToStruct().fv();
|
|
962
|
+
};
|
|
963
|
+
protoOf(Utils).l1o = function (_this__u8e3s4, nestingLevel) {
|
|
964
|
+
return takeFirstAfterSkipping(firstArguments(_this__u8e3s4, this), nestingLevel);
|
|
965
|
+
};
|
|
966
|
+
protoOf(Utils).m1o = function (args) {
|
|
967
|
+
return this.n1o(listOf(args.slice()));
|
|
968
|
+
};
|
|
969
|
+
protoOf(Utils).o1o = function (sequence) {
|
|
970
|
+
return this.n1o(asIterable(sequence));
|
|
971
|
+
};
|
|
972
|
+
protoOf(Utils).n1o = function (iterable) {
|
|
973
|
+
return mergeSequences(iterable, SituatedIndexedClause$compareTo$ref());
|
|
974
|
+
};
|
|
975
|
+
protoOf(Utils).p1o = function (args) {
|
|
976
|
+
return this.q1o(sequenceOf(args.slice()));
|
|
977
|
+
};
|
|
978
|
+
protoOf(Utils).q1o = function (sequence) {
|
|
979
|
+
return flatten(sequence);
|
|
980
|
+
};
|
|
981
|
+
protoOf(Utils).r1o = function (iterable) {
|
|
982
|
+
return this.q1o(asSequence(iterable));
|
|
983
|
+
};
|
|
984
|
+
protoOf(Utils).s1o = function (args) {
|
|
985
|
+
return this.t1o(sequenceOf(args.slice()));
|
|
986
|
+
};
|
|
987
|
+
protoOf(Utils).t1o = function (sequence) {
|
|
988
|
+
return flatten(sequence);
|
|
989
|
+
};
|
|
990
|
+
protoOf(Utils).u1o = function (a, b) {
|
|
991
|
+
return (a == null ? b == null : false) ? null : a == null ? b : b == null ? a : a.is(b) < 0 ? a : b;
|
|
992
|
+
};
|
|
993
|
+
var Utils_instance;
|
|
994
|
+
function Utils_getInstance() {
|
|
995
|
+
return Utils_instance;
|
|
996
|
+
}
|
|
997
|
+
function IndexedClause$Companion$wrap$1($traversed, $indexedClause) {
|
|
998
|
+
this.w1o_1 = $indexedClause;
|
|
999
|
+
this.v1o_1 = listOf($traversed.slice());
|
|
1000
|
+
}
|
|
1001
|
+
protoOf(IndexedClause$Companion$wrap$1).hq = function () {
|
|
1002
|
+
return this.w1o_1.hq();
|
|
1003
|
+
};
|
|
1004
|
+
protoOf(IndexedClause$Companion$wrap$1).r2 = function () {
|
|
1005
|
+
return this.w1o_1.r2();
|
|
1006
|
+
};
|
|
1007
|
+
protoOf(IndexedClause$Companion$wrap$1).x1o = function () {
|
|
1008
|
+
return this.v1o_1;
|
|
1009
|
+
};
|
|
1010
|
+
protoOf(IndexedClause$Companion$wrap$1).o1n = function () {
|
|
1011
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
1012
|
+
var tmp0_iterator = this.v1o_1.r();
|
|
1013
|
+
while (tmp0_iterator.s()) {
|
|
1014
|
+
var element = tmp0_iterator.u();
|
|
1015
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.clause.<no name provided>.invalidateAllCaches.<anonymous>' call
|
|
1016
|
+
element.v1n();
|
|
1017
|
+
}
|
|
1018
|
+
};
|
|
1019
|
+
protoOf(IndexedClause$Companion$wrap$1).d = function (other) {
|
|
1020
|
+
return this.is((!(other == null) ? isInterface(other, LongIndexed) : false) ? other : THROW_CCE());
|
|
1021
|
+
};
|
|
1022
|
+
function Companion_2() {
|
|
1023
|
+
}
|
|
1024
|
+
protoOf(Companion_2).z1o = function (indexedClause, traversed) {
|
|
1025
|
+
return new IndexedClause$Companion$wrap$1(traversed, indexedClause);
|
|
1026
|
+
};
|
|
1027
|
+
protoOf(Companion_2).a1p = function (index, clause, traversed) {
|
|
1028
|
+
return this.z1o(Companion_instance_0.hs(index, clause), traversed.slice());
|
|
1029
|
+
};
|
|
1030
|
+
protoOf(Companion_2).b1p = function (index, clause, traversed) {
|
|
1031
|
+
var tmp = Companion_instance_0.hs(index, clause);
|
|
1032
|
+
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1033
|
+
var tmp$ret$0 = copyToArray(traversed);
|
|
1034
|
+
return this.z1o(tmp, tmp$ret$0.slice());
|
|
1035
|
+
};
|
|
1036
|
+
var Companion_instance_7;
|
|
1037
|
+
function Companion_getInstance_5() {
|
|
1038
|
+
return Companion_instance_7;
|
|
1039
|
+
}
|
|
1040
|
+
function IndexedClause() {
|
|
1041
|
+
}
|
|
1042
|
+
function SituatedIndexedClause$Companion$of$1($indexed, $index) {
|
|
1043
|
+
this.c1p_1 = $indexed;
|
|
1044
|
+
this.d1p_1 = $index;
|
|
1045
|
+
}
|
|
1046
|
+
protoOf(SituatedIndexedClause$Companion$of$1).hq = function () {
|
|
1047
|
+
return this.c1p_1.hq();
|
|
1048
|
+
};
|
|
1049
|
+
protoOf(SituatedIndexedClause$Companion$of$1).r2 = function () {
|
|
1050
|
+
return this.c1p_1.r2();
|
|
1051
|
+
};
|
|
1052
|
+
protoOf(SituatedIndexedClause$Companion$of$1).e1p = function () {
|
|
1053
|
+
this.d1p_1.f1p(this);
|
|
1054
|
+
this.o1n();
|
|
1055
|
+
};
|
|
1056
|
+
protoOf(SituatedIndexedClause$Companion$of$1).x1o = function () {
|
|
1057
|
+
return this.c1p_1.x1o();
|
|
1058
|
+
};
|
|
1059
|
+
protoOf(SituatedIndexedClause$Companion$of$1).o1n = function () {
|
|
1060
|
+
this.c1p_1.o1n();
|
|
1061
|
+
};
|
|
1062
|
+
protoOf(SituatedIndexedClause$Companion$of$1).equals = function (other) {
|
|
1063
|
+
if (this === other)
|
|
1064
|
+
return true;
|
|
1065
|
+
if (!(!(other == null) ? isInterface(other, SituatedIndexedClause) : false))
|
|
1066
|
+
return false;
|
|
1067
|
+
if (!this.hq().equals(other.hq()))
|
|
1068
|
+
return false;
|
|
1069
|
+
return true;
|
|
1070
|
+
};
|
|
1071
|
+
protoOf(SituatedIndexedClause$Companion$of$1).d = function (other) {
|
|
1072
|
+
return this.is((!(other == null) ? isInterface(other, LongIndexed) : false) ? other : THROW_CCE());
|
|
1073
|
+
};
|
|
1074
|
+
function Companion_3() {
|
|
1075
|
+
}
|
|
1076
|
+
protoOf(Companion_3).g1p = function (indexed, index) {
|
|
1077
|
+
return new SituatedIndexedClause$Companion$of$1(indexed, index);
|
|
1078
|
+
};
|
|
1079
|
+
var Companion_instance_8;
|
|
1080
|
+
function Companion_getInstance_6() {
|
|
1081
|
+
return Companion_instance_8;
|
|
1082
|
+
}
|
|
1083
|
+
function SituatedIndexedClause() {
|
|
1084
|
+
}
|
|
1085
|
+
function AbstractIndexingLeaf(unificator) {
|
|
1086
|
+
AbstractReteNode.call(this, unificator);
|
|
1087
|
+
}
|
|
1088
|
+
protoOf(AbstractIndexingLeaf).v1n = function () {
|
|
1089
|
+
};
|
|
1090
|
+
function extractFirst($this, clause) {
|
|
1091
|
+
// Inline function 'kotlin.collections.mapNotNull' call
|
|
1092
|
+
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
1093
|
+
var this_0 = $this.p1p_1.m2();
|
|
1094
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1095
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
1096
|
+
var tmp0_iterator = this_0.r();
|
|
1097
|
+
while (tmp0_iterator.s()) {
|
|
1098
|
+
var element = tmp0_iterator.u();
|
|
1099
|
+
// Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
|
|
1100
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.AtomIndex.extractFirst.<anonymous>' call
|
|
1101
|
+
var tmp0_safe_receiver = extractFirst_0($this, clause, element);
|
|
1102
|
+
if (tmp0_safe_receiver == null)
|
|
1103
|
+
null;
|
|
1104
|
+
else {
|
|
1105
|
+
// Inline function 'kotlin.let' call
|
|
1106
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1107
|
+
destination.o(tmp0_safe_receiver);
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
return minOrNull(destination);
|
|
1111
|
+
}
|
|
1112
|
+
function extractFirst_0($this, clause, index) {
|
|
1113
|
+
var tmp$ret$1;
|
|
1114
|
+
$l$block: {
|
|
1115
|
+
// Inline function 'kotlin.collections.indexOfFirst' call
|
|
1116
|
+
var index_0 = 0;
|
|
1117
|
+
var tmp0_iterator = index.r();
|
|
1118
|
+
while (tmp0_iterator.s()) {
|
|
1119
|
+
var item = tmp0_iterator.u();
|
|
1120
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.AtomIndex.extractFirst.<anonymous>' call
|
|
1121
|
+
if ($this.k1l().match(item.q1n(), clause)) {
|
|
1122
|
+
tmp$ret$1 = index_0;
|
|
1123
|
+
break $l$block;
|
|
1124
|
+
}
|
|
1125
|
+
index_0 = index_0 + 1 | 0;
|
|
1126
|
+
}
|
|
1127
|
+
tmp$ret$1 = -1;
|
|
1128
|
+
}
|
|
1129
|
+
var actualIndex = tmp$ret$1;
|
|
1130
|
+
var tmp;
|
|
1131
|
+
if (actualIndex === -1) {
|
|
1132
|
+
tmp = null;
|
|
1133
|
+
} else {
|
|
1134
|
+
tmp = index.d1(actualIndex);
|
|
1135
|
+
}
|
|
1136
|
+
return tmp;
|
|
1137
|
+
}
|
|
1138
|
+
function nestedFirstArgument(_this__u8e3s4, $this) {
|
|
1139
|
+
return Utils_instance.l1o(ensureNotNull(_this__u8e3s4.lx()), $this.o1p_1 + 1 | 0);
|
|
1140
|
+
}
|
|
1141
|
+
function asInnerAtom(_this__u8e3s4, $this) {
|
|
1142
|
+
return nestedFirstArgument(_this__u8e3s4, $this).castToAtom();
|
|
1143
|
+
}
|
|
1144
|
+
function asInnerAtom_0(_this__u8e3s4, $this) {
|
|
1145
|
+
return nestedFirstArgument(_this__u8e3s4.q1n(), $this).castToAtom();
|
|
1146
|
+
}
|
|
1147
|
+
function asInnerAtom_1(_this__u8e3s4, $this) {
|
|
1148
|
+
return nestedFirstArgument(_this__u8e3s4.q1n(), $this).castToAtom();
|
|
1149
|
+
}
|
|
1150
|
+
function AtomIndex$_get_size_$lambda_ygjfwe(it) {
|
|
1151
|
+
return it.l();
|
|
1152
|
+
}
|
|
1153
|
+
function AtomIndex$getIndexed$lambda(this$0, $clause) {
|
|
1154
|
+
return function (it) {
|
|
1155
|
+
return this$0.k1l().match(it.q1n(), $clause);
|
|
1156
|
+
};
|
|
1157
|
+
}
|
|
1158
|
+
function AtomIndex$retractAllIndexed$lambda(this$0, $clause) {
|
|
1159
|
+
return function (it) {
|
|
1160
|
+
return this$0.r1n(it, $clause);
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
function AtomIndex$getCache$lambda(it) {
|
|
1164
|
+
return asSequence(it);
|
|
1165
|
+
}
|
|
1166
|
+
function AtomIndex$extractGlobalIndexedSequence$lambda(this$0, $clause) {
|
|
1167
|
+
return function (it) {
|
|
1168
|
+
return this$0.k1l().match(it.q1n(), $clause);
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
function AtomIndex(unificator, ordered, nestingLevel) {
|
|
1172
|
+
AbstractIndexingLeaf.call(this, unificator);
|
|
1173
|
+
this.n1p_1 = ordered;
|
|
1174
|
+
this.o1p_1 = nestingLevel;
|
|
1175
|
+
var tmp = this;
|
|
1176
|
+
// Inline function 'kotlin.collections.mutableMapOf' call
|
|
1177
|
+
tmp.p1p_1 = LinkedHashMap_init_$Create$();
|
|
1178
|
+
}
|
|
1179
|
+
protoOf(AtomIndex).l = function () {
|
|
1180
|
+
var tmp = asSequence(this.p1p_1.m2());
|
|
1181
|
+
return sum(map(tmp, AtomIndex$_get_size_$lambda_ygjfwe));
|
|
1182
|
+
};
|
|
1183
|
+
protoOf(AtomIndex).q1l = function () {
|
|
1184
|
+
var tmp;
|
|
1185
|
+
if (this.p1p_1.z()) {
|
|
1186
|
+
tmp = true;
|
|
1187
|
+
} else {
|
|
1188
|
+
var tmp$ret$0;
|
|
1189
|
+
$l$block_0: {
|
|
1190
|
+
// Inline function 'kotlin.collections.all' call
|
|
1191
|
+
var this_0 = this.p1p_1.m2();
|
|
1192
|
+
var tmp_0;
|
|
1193
|
+
if (isInterface(this_0, Collection)) {
|
|
1194
|
+
tmp_0 = this_0.z();
|
|
1195
|
+
} else {
|
|
1196
|
+
tmp_0 = false;
|
|
1197
|
+
}
|
|
1198
|
+
if (tmp_0) {
|
|
1199
|
+
tmp$ret$0 = true;
|
|
1200
|
+
break $l$block_0;
|
|
1201
|
+
}
|
|
1202
|
+
var tmp0_iterator = this_0.r();
|
|
1203
|
+
while (tmp0_iterator.s()) {
|
|
1204
|
+
var element = tmp0_iterator.u();
|
|
1205
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.AtomIndex.<get-isEmpty>.<anonymous>' call
|
|
1206
|
+
if (!element.z()) {
|
|
1207
|
+
tmp$ret$0 = false;
|
|
1208
|
+
break $l$block_0;
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
tmp$ret$0 = true;
|
|
1212
|
+
}
|
|
1213
|
+
tmp = tmp$ret$0;
|
|
1214
|
+
}
|
|
1215
|
+
return tmp;
|
|
1216
|
+
};
|
|
1217
|
+
protoOf(AtomIndex).s1n = function (clause) {
|
|
1218
|
+
if (this.n1p_1) {
|
|
1219
|
+
// Inline function 'kotlin.let' call
|
|
1220
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1221
|
+
var it = asInnerAtom_1(clause, this);
|
|
1222
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
1223
|
+
var this_0 = this.p1p_1;
|
|
1224
|
+
var value = this_0.x2(it);
|
|
1225
|
+
var tmp;
|
|
1226
|
+
if (value == null) {
|
|
1227
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.AtomIndex.assertA.<anonymous>.<anonymous>' call
|
|
1228
|
+
var answer = dequeOf([]);
|
|
1229
|
+
this_0.o2(it, answer);
|
|
1230
|
+
tmp = answer;
|
|
1231
|
+
} else {
|
|
1232
|
+
tmp = value;
|
|
1233
|
+
}
|
|
1234
|
+
var tmp$ret$1 = tmp;
|
|
1235
|
+
addFirst(tmp$ret$1, Companion_instance_8.g1p(clause.y1o(this), this));
|
|
1236
|
+
} else {
|
|
1237
|
+
this.t1n(clause);
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
protoOf(AtomIndex).t1n = function (clause) {
|
|
1241
|
+
// Inline function 'kotlin.let' call
|
|
1242
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1243
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.AtomIndex.assertZ.<anonymous>' call
|
|
1244
|
+
var it = asInnerAtom_1(clause, this);
|
|
1245
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
1246
|
+
var this_0 = this.p1p_1;
|
|
1247
|
+
var value = this_0.x2(it);
|
|
1248
|
+
var tmp;
|
|
1249
|
+
if (value == null) {
|
|
1250
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.AtomIndex.assertZ.<anonymous>.<anonymous>' call
|
|
1251
|
+
var answer = dequeOf([]);
|
|
1252
|
+
this_0.o2(it, answer);
|
|
1253
|
+
tmp = answer;
|
|
1254
|
+
} else {
|
|
1255
|
+
tmp = value;
|
|
1256
|
+
}
|
|
1257
|
+
tmp.o(Companion_instance_8.g1p(clause.y1o(this), this));
|
|
1258
|
+
};
|
|
1259
|
+
protoOf(AtomIndex).i1p = function (clause) {
|
|
1260
|
+
var tmp;
|
|
1261
|
+
if (nestedFirstArgument(clause, this).av()) {
|
|
1262
|
+
// Inline function 'kotlin.let' call
|
|
1263
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1264
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.AtomIndex.getFirstIndexed.<anonymous>' call
|
|
1265
|
+
var it = this.p1p_1.x2(asInnerAtom(clause, this));
|
|
1266
|
+
var tmp_0;
|
|
1267
|
+
if (it == null) {
|
|
1268
|
+
tmp_0 = null;
|
|
1269
|
+
} else {
|
|
1270
|
+
tmp_0 = extractFirst_0(this, clause, it);
|
|
1271
|
+
}
|
|
1272
|
+
tmp = tmp_0;
|
|
1273
|
+
} else {
|
|
1274
|
+
tmp = extractFirst(this, clause);
|
|
1275
|
+
}
|
|
1276
|
+
return tmp;
|
|
1277
|
+
};
|
|
1278
|
+
protoOf(AtomIndex).j1p = function (clause) {
|
|
1279
|
+
var tmp;
|
|
1280
|
+
if (nestedFirstArgument(clause, this).av()) {
|
|
1281
|
+
var tmp0_safe_receiver = this.p1p_1.x2(asInnerAtom(clause, this));
|
|
1282
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : asSequence(tmp0_safe_receiver);
|
|
1283
|
+
var tmp_0;
|
|
1284
|
+
if (tmp1_safe_receiver == null) {
|
|
1285
|
+
tmp_0 = null;
|
|
1286
|
+
} else {
|
|
1287
|
+
tmp_0 = filter(tmp1_safe_receiver, AtomIndex$getIndexed$lambda(this, clause));
|
|
1288
|
+
}
|
|
1289
|
+
var tmp2_elvis_lhs = tmp_0;
|
|
1290
|
+
tmp = tmp2_elvis_lhs == null ? emptySequence() : tmp2_elvis_lhs;
|
|
1291
|
+
} else {
|
|
1292
|
+
tmp = this.l1p(clause);
|
|
1293
|
+
}
|
|
1294
|
+
return tmp;
|
|
1295
|
+
};
|
|
1296
|
+
protoOf(AtomIndex).f1p = function (indexed) {
|
|
1297
|
+
ensureNotNull(this.p1p_1.x2(asInnerAtom_0(indexed, this))).p(indexed);
|
|
1298
|
+
};
|
|
1299
|
+
protoOf(AtomIndex).k1p = function (clause) {
|
|
1300
|
+
var tmp;
|
|
1301
|
+
if (nestedFirstArgument(clause, this).av()) {
|
|
1302
|
+
var partialIndex = this.p1p_1.x2(asInnerAtom(clause, this));
|
|
1303
|
+
tmp = partialIndex == null ? emptySequence() : this.r1n(partialIndex, clause);
|
|
1304
|
+
} else {
|
|
1305
|
+
var tmp_0 = Utils_instance;
|
|
1306
|
+
var tmp_1 = asSequence(this.p1p_1.m2());
|
|
1307
|
+
tmp = tmp_0.o1o(map(tmp_1, AtomIndex$retractAllIndexed$lambda(this, clause)));
|
|
1308
|
+
}
|
|
1309
|
+
return buffered(tmp);
|
|
1310
|
+
};
|
|
1311
|
+
protoOf(AtomIndex).u1n = function () {
|
|
1312
|
+
var tmp = Utils_instance;
|
|
1313
|
+
var tmp_0 = asSequence(this.p1p_1.m2());
|
|
1314
|
+
return tmp.o1o(map(tmp_0, AtomIndex$getCache$lambda));
|
|
1315
|
+
};
|
|
1316
|
+
protoOf(AtomIndex).l1p = function (clause) {
|
|
1317
|
+
var tmp = this.u1n();
|
|
1318
|
+
return filter(tmp, AtomIndex$extractGlobalIndexedSequence$lambda(this, clause));
|
|
1319
|
+
};
|
|
1320
|
+
function nestedFunctor(_this__u8e3s4, $this) {
|
|
1321
|
+
return Utils_instance.k1o(ensureNotNull(_this__u8e3s4.lx()), $this.s1p_1);
|
|
1322
|
+
}
|
|
1323
|
+
function nestedFunctor_0(_this__u8e3s4, $this) {
|
|
1324
|
+
return Utils_instance.k1o(ensureNotNull(_this__u8e3s4.q1n().lx()), $this.s1p_1);
|
|
1325
|
+
}
|
|
1326
|
+
function isGlobal(_this__u8e3s4, $this) {
|
|
1327
|
+
return Utils_instance.l1o(ensureNotNull(_this__u8e3s4.lx()), $this.s1p_1).bw();
|
|
1328
|
+
}
|
|
1329
|
+
function regenerateCache($this) {
|
|
1330
|
+
var tmp;
|
|
1331
|
+
if ($this.r1p_1) {
|
|
1332
|
+
var tmp_0 = Utils_instance;
|
|
1333
|
+
// Inline function 'kotlin.collections.map' call
|
|
1334
|
+
var this_0 = $this.t1p_1.m2();
|
|
1335
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1336
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1337
|
+
var tmp0_iterator = this_0.r();
|
|
1338
|
+
while (tmp0_iterator.s()) {
|
|
1339
|
+
var item = tmp0_iterator.u();
|
|
1340
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.CompoundIndex.regenerateCache.<anonymous>' call
|
|
1341
|
+
var tmp$ret$0 = item.u1n();
|
|
1342
|
+
destination.o(tmp$ret$0);
|
|
1343
|
+
}
|
|
1344
|
+
tmp = tmp_0.n1o(destination);
|
|
1345
|
+
} else {
|
|
1346
|
+
var tmp_1 = Utils_instance;
|
|
1347
|
+
// Inline function 'kotlin.collections.map' call
|
|
1348
|
+
var this_1 = $this.t1p_1.m2();
|
|
1349
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1350
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
1351
|
+
var tmp0_iterator_0 = this_1.r();
|
|
1352
|
+
while (tmp0_iterator_0.s()) {
|
|
1353
|
+
var item_0 = tmp0_iterator_0.u();
|
|
1354
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.CompoundIndex.regenerateCache.<anonymous>' call
|
|
1355
|
+
var tmp$ret$3 = item_0.u1n();
|
|
1356
|
+
destination_0.o(tmp$ret$3);
|
|
1357
|
+
}
|
|
1358
|
+
tmp = tmp_1.r1o(destination_0);
|
|
1359
|
+
}
|
|
1360
|
+
return dequeOf_0(tmp);
|
|
1361
|
+
}
|
|
1362
|
+
function CompoundIndex$regenerateCache$ref($boundThis) {
|
|
1363
|
+
var l = function () {
|
|
1364
|
+
return regenerateCache($boundThis);
|
|
1365
|
+
};
|
|
1366
|
+
l.callableName = 'regenerateCache';
|
|
1367
|
+
return l;
|
|
1368
|
+
}
|
|
1369
|
+
function CompoundIndex$_get_size_$lambda_91vt0k(it) {
|
|
1370
|
+
return it.l();
|
|
1371
|
+
}
|
|
1372
|
+
function CompoundIndex(unificator, ordered, nestingLevel) {
|
|
1373
|
+
AbstractReteNode.call(this, unificator);
|
|
1374
|
+
this.r1p_1 = ordered;
|
|
1375
|
+
this.s1p_1 = nestingLevel;
|
|
1376
|
+
var tmp = this;
|
|
1377
|
+
// Inline function 'kotlin.collections.mutableMapOf' call
|
|
1378
|
+
tmp.t1p_1 = LinkedHashMap_init_$Create$();
|
|
1379
|
+
var tmp_0 = this;
|
|
1380
|
+
var tmp_1 = Companion_instance_1;
|
|
1381
|
+
tmp_0.u1p_1 = tmp_1.tp(CompoundIndex$regenerateCache$ref(this));
|
|
1382
|
+
}
|
|
1383
|
+
protoOf(CompoundIndex).l = function () {
|
|
1384
|
+
var tmp = asSequence(this.t1p_1.m2());
|
|
1385
|
+
return sum(map(tmp, CompoundIndex$_get_size_$lambda_91vt0k));
|
|
1386
|
+
};
|
|
1387
|
+
protoOf(CompoundIndex).q1l = function () {
|
|
1388
|
+
var tmp;
|
|
1389
|
+
if (this.t1p_1.z()) {
|
|
1390
|
+
tmp = true;
|
|
1391
|
+
} else {
|
|
1392
|
+
var tmp$ret$0;
|
|
1393
|
+
$l$block_0: {
|
|
1394
|
+
// Inline function 'kotlin.collections.all' call
|
|
1395
|
+
var this_0 = this.t1p_1.m2();
|
|
1396
|
+
var tmp_0;
|
|
1397
|
+
if (isInterface(this_0, Collection)) {
|
|
1398
|
+
tmp_0 = this_0.z();
|
|
1399
|
+
} else {
|
|
1400
|
+
tmp_0 = false;
|
|
1401
|
+
}
|
|
1402
|
+
if (tmp_0) {
|
|
1403
|
+
tmp$ret$0 = true;
|
|
1404
|
+
break $l$block_0;
|
|
1405
|
+
}
|
|
1406
|
+
var tmp0_iterator = this_0.r();
|
|
1407
|
+
while (tmp0_iterator.s()) {
|
|
1408
|
+
var element = tmp0_iterator.u();
|
|
1409
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.CompoundIndex.<get-isEmpty>.<anonymous>' call
|
|
1410
|
+
if (!element.q1l()) {
|
|
1411
|
+
tmp$ret$0 = false;
|
|
1412
|
+
break $l$block_0;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
tmp$ret$0 = true;
|
|
1416
|
+
}
|
|
1417
|
+
tmp = tmp$ret$0;
|
|
1418
|
+
}
|
|
1419
|
+
return tmp;
|
|
1420
|
+
};
|
|
1421
|
+
protoOf(CompoundIndex).s1n = function (clause) {
|
|
1422
|
+
// Inline function 'kotlin.let' call
|
|
1423
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1424
|
+
var it = nestedFunctor_0(clause, this);
|
|
1425
|
+
var tmp;
|
|
1426
|
+
if (this.r1p_1) {
|
|
1427
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
1428
|
+
var this_0 = this.t1p_1;
|
|
1429
|
+
var value = this_0.x2(it);
|
|
1430
|
+
var tmp_0;
|
|
1431
|
+
if (value == null) {
|
|
1432
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.CompoundIndex.assertA.<anonymous>.<anonymous>' call
|
|
1433
|
+
var answer = new FunctorIndexingNode(this.k1l(), this.r1p_1, this.s1p_1);
|
|
1434
|
+
this_0.o2(it, answer);
|
|
1435
|
+
tmp_0 = answer;
|
|
1436
|
+
} else {
|
|
1437
|
+
tmp_0 = value;
|
|
1438
|
+
}
|
|
1439
|
+
tmp_0.s1n(clause.y1o(this));
|
|
1440
|
+
tmp = Unit_instance;
|
|
1441
|
+
} else {
|
|
1442
|
+
this.t1n(clause);
|
|
1443
|
+
tmp = Unit_instance;
|
|
1444
|
+
}
|
|
1445
|
+
return tmp;
|
|
1446
|
+
};
|
|
1447
|
+
protoOf(CompoundIndex).t1n = function (clause) {
|
|
1448
|
+
// Inline function 'kotlin.let' call
|
|
1449
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1450
|
+
var it = nestedFunctor_0(clause, this);
|
|
1451
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
1452
|
+
var this_0 = this.t1p_1;
|
|
1453
|
+
var value = this_0.x2(it);
|
|
1454
|
+
var tmp;
|
|
1455
|
+
if (value == null) {
|
|
1456
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.CompoundIndex.assertZ.<anonymous>.<anonymous>' call
|
|
1457
|
+
var answer = new FunctorIndexingNode(this.k1l(), this.r1p_1, this.s1p_1);
|
|
1458
|
+
this_0.o2(it, answer);
|
|
1459
|
+
tmp = answer;
|
|
1460
|
+
} else {
|
|
1461
|
+
tmp = value;
|
|
1462
|
+
}
|
|
1463
|
+
tmp.t1n(clause.y1o(this));
|
|
1464
|
+
return Unit_instance;
|
|
1465
|
+
};
|
|
1466
|
+
protoOf(CompoundIndex).u1n = function () {
|
|
1467
|
+
return asSequence(this.u1p_1.r2());
|
|
1468
|
+
};
|
|
1469
|
+
protoOf(CompoundIndex).i1p = function (clause) {
|
|
1470
|
+
var tmp;
|
|
1471
|
+
if (isGlobal(clause, this)) {
|
|
1472
|
+
var tmp_0 = Utils_instance;
|
|
1473
|
+
// Inline function 'kotlin.collections.mapNotNull' call
|
|
1474
|
+
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
1475
|
+
var this_0 = this.t1p_1.m2();
|
|
1476
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1477
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
1478
|
+
var tmp0_iterator = this_0.r();
|
|
1479
|
+
while (tmp0_iterator.s()) {
|
|
1480
|
+
var element = tmp0_iterator.u();
|
|
1481
|
+
// Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
|
|
1482
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.CompoundIndex.getFirstIndexed.<anonymous>' call
|
|
1483
|
+
var tmp0_safe_receiver = element.i1p(clause);
|
|
1484
|
+
if (tmp0_safe_receiver == null)
|
|
1485
|
+
null;
|
|
1486
|
+
else {
|
|
1487
|
+
// Inline function 'kotlin.let' call
|
|
1488
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1489
|
+
destination.o(tmp0_safe_receiver);
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
tmp = firstOrNull(tmp_0.o1o(sequenceOf([asSequence(destination)])));
|
|
1493
|
+
} else {
|
|
1494
|
+
var tmp0_safe_receiver_0 = this.t1p_1.x2(nestedFunctor(clause, this));
|
|
1495
|
+
tmp = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.i1p(clause);
|
|
1496
|
+
}
|
|
1497
|
+
return tmp;
|
|
1498
|
+
};
|
|
1499
|
+
protoOf(CompoundIndex).j1p = function (clause) {
|
|
1500
|
+
var tmp;
|
|
1501
|
+
if (isGlobal(clause, this)) {
|
|
1502
|
+
var tmp_0 = Utils_instance;
|
|
1503
|
+
// Inline function 'kotlin.collections.map' call
|
|
1504
|
+
var this_0 = this.t1p_1.m2();
|
|
1505
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1506
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1507
|
+
var tmp0_iterator = this_0.r();
|
|
1508
|
+
while (tmp0_iterator.s()) {
|
|
1509
|
+
var item = tmp0_iterator.u();
|
|
1510
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.CompoundIndex.getIndexed.<anonymous>' call
|
|
1511
|
+
var tmp$ret$0 = item.l1p(clause);
|
|
1512
|
+
destination.o(tmp$ret$0);
|
|
1513
|
+
}
|
|
1514
|
+
tmp = tmp_0.n1o(destination);
|
|
1515
|
+
} else {
|
|
1516
|
+
var tmp0_safe_receiver = this.t1p_1.x2(nestedFunctor(clause, this));
|
|
1517
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.j1p(clause);
|
|
1518
|
+
tmp = tmp1_elvis_lhs == null ? emptySequence() : tmp1_elvis_lhs;
|
|
1519
|
+
}
|
|
1520
|
+
return tmp;
|
|
1521
|
+
};
|
|
1522
|
+
protoOf(CompoundIndex).k1p = function (clause) {
|
|
1523
|
+
var tmp;
|
|
1524
|
+
if (isGlobal(clause, this)) {
|
|
1525
|
+
var tmp_0 = Utils_instance;
|
|
1526
|
+
// Inline function 'kotlin.collections.map' call
|
|
1527
|
+
var this_0 = this.t1p_1.m2();
|
|
1528
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1529
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1530
|
+
var tmp0_iterator = this_0.r();
|
|
1531
|
+
while (tmp0_iterator.s()) {
|
|
1532
|
+
var item = tmp0_iterator.u();
|
|
1533
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.CompoundIndex.retractAllIndexed.<anonymous>' call
|
|
1534
|
+
var tmp$ret$0 = item.k1p(clause);
|
|
1535
|
+
destination.o(tmp$ret$0);
|
|
1536
|
+
}
|
|
1537
|
+
tmp = tmp_0.n1o(destination);
|
|
1538
|
+
} else {
|
|
1539
|
+
var tmp0_safe_receiver = this.t1p_1.x2(nestedFunctor(clause, this));
|
|
1540
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.k1p(clause);
|
|
1541
|
+
tmp = tmp1_elvis_lhs == null ? emptySequence() : tmp1_elvis_lhs;
|
|
1542
|
+
}
|
|
1543
|
+
return tmp;
|
|
1544
|
+
};
|
|
1545
|
+
protoOf(CompoundIndex).l1p = function (clause) {
|
|
1546
|
+
var tmp;
|
|
1547
|
+
if (this.r1p_1) {
|
|
1548
|
+
var tmp_0 = Utils_instance;
|
|
1549
|
+
// Inline function 'kotlin.collections.map' call
|
|
1550
|
+
var this_0 = this.t1p_1.m2();
|
|
1551
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1552
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1553
|
+
var tmp0_iterator = this_0.r();
|
|
1554
|
+
while (tmp0_iterator.s()) {
|
|
1555
|
+
var item = tmp0_iterator.u();
|
|
1556
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.CompoundIndex.extractGlobalIndexedSequence.<anonymous>' call
|
|
1557
|
+
var tmp$ret$0 = item.l1p(clause);
|
|
1558
|
+
destination.o(tmp$ret$0);
|
|
1559
|
+
}
|
|
1560
|
+
tmp = tmp_0.n1o(destination);
|
|
1561
|
+
} else {
|
|
1562
|
+
var tmp_1 = Utils_instance;
|
|
1563
|
+
// Inline function 'kotlin.collections.map' call
|
|
1564
|
+
var this_1 = this.t1p_1.m2();
|
|
1565
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1566
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
1567
|
+
var tmp0_iterator_0 = this_1.r();
|
|
1568
|
+
while (tmp0_iterator_0.s()) {
|
|
1569
|
+
var item_0 = tmp0_iterator_0.u();
|
|
1570
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.CompoundIndex.extractGlobalIndexedSequence.<anonymous>' call
|
|
1571
|
+
var tmp$ret$3 = item_0.l1p(clause);
|
|
1572
|
+
destination_0.o(tmp$ret$3);
|
|
1573
|
+
}
|
|
1574
|
+
tmp = tmp_1.r1o(destination_0);
|
|
1575
|
+
}
|
|
1576
|
+
return tmp;
|
|
1577
|
+
};
|
|
1578
|
+
protoOf(CompoundIndex).v1n = function () {
|
|
1579
|
+
this.u1p_1.vp();
|
|
1580
|
+
};
|
|
1581
|
+
function DirectiveIndex$retractFirst$lambda(it) {
|
|
1582
|
+
return it.q1n();
|
|
1583
|
+
}
|
|
1584
|
+
function DirectiveIndex$retractAll$lambda(it) {
|
|
1585
|
+
return it.q1n();
|
|
1586
|
+
}
|
|
1587
|
+
function DirectiveIndex$getCache$lambda(it) {
|
|
1588
|
+
var tmp = Companion_instance_8;
|
|
1589
|
+
return tmp.g1p(it, new DirectiveIndex$getCache$1$1());
|
|
1590
|
+
}
|
|
1591
|
+
function DirectiveIndex$getCache$1$1() {
|
|
1592
|
+
}
|
|
1593
|
+
protoOf(DirectiveIndex$getCache$1$1).f1p = function (indexed) {
|
|
1594
|
+
// Inline function 'kotlin.TODO' call
|
|
1595
|
+
var reason = 'Directives are adapted as a SituatedIndexedClause, but they are not actually stored with this type. Given their particular semantic, try retracting directly with a proper query, or opening a pull request implementing this indexing class as a proper typed data structure';
|
|
1596
|
+
throw new NotImplementedError('An operation is not implemented: ' + reason);
|
|
1597
|
+
};
|
|
1598
|
+
function DirectiveIndex(unificator, ordered) {
|
|
1599
|
+
AbstractReteNode.call(this, unificator);
|
|
1600
|
+
this.w1p_1 = ordered;
|
|
1601
|
+
this.x1p_1 = dequeOf([]);
|
|
1602
|
+
}
|
|
1603
|
+
protoOf(DirectiveIndex).l = function () {
|
|
1604
|
+
return this.x1p_1.l();
|
|
1605
|
+
};
|
|
1606
|
+
protoOf(DirectiveIndex).q1l = function () {
|
|
1607
|
+
return this.x1p_1.z();
|
|
1608
|
+
};
|
|
1609
|
+
protoOf(DirectiveIndex).t1l = function (clause) {
|
|
1610
|
+
// Inline function 'kotlin.collections.map' call
|
|
1611
|
+
// Inline function 'kotlin.collections.filter' call
|
|
1612
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
1613
|
+
var this_0 = this.x1p_1;
|
|
1614
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1615
|
+
var tmp0_iterator = this_0.r();
|
|
1616
|
+
while (tmp0_iterator.s()) {
|
|
1617
|
+
var element = tmp0_iterator.u();
|
|
1618
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.DirectiveIndex.get.<anonymous>' call
|
|
1619
|
+
if (this.k1l().match(element.q1n(), clause)) {
|
|
1620
|
+
destination.o(element);
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1624
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(destination, 10));
|
|
1625
|
+
var tmp0_iterator_0 = destination.r();
|
|
1626
|
+
while (tmp0_iterator_0.s()) {
|
|
1627
|
+
var item = tmp0_iterator_0.u();
|
|
1628
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.DirectiveIndex.get.<anonymous>' call
|
|
1629
|
+
var tmp$ret$3 = item.q1n();
|
|
1630
|
+
destination_0.o(tmp$ret$3);
|
|
1631
|
+
}
|
|
1632
|
+
return asSequence(destination_0);
|
|
1633
|
+
};
|
|
1634
|
+
protoOf(DirectiveIndex).s1n = function (clause) {
|
|
1635
|
+
if (this.w1p_1) {
|
|
1636
|
+
addFirst(this.x1p_1, clause.y1o(this));
|
|
1637
|
+
} else {
|
|
1638
|
+
this.t1n(clause);
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1641
|
+
protoOf(DirectiveIndex).t1n = function (clause) {
|
|
1642
|
+
this.x1p_1.o(clause.y1o(this));
|
|
1643
|
+
};
|
|
1644
|
+
protoOf(DirectiveIndex).b1m = function (clause) {
|
|
1645
|
+
var tmp = this.r1n(this.x1p_1, clause);
|
|
1646
|
+
return buffered(take(map(tmp, DirectiveIndex$retractFirst$lambda), 1));
|
|
1647
|
+
};
|
|
1648
|
+
protoOf(DirectiveIndex).d1m = function (clause) {
|
|
1649
|
+
var tmp = this.r1n(this.x1p_1, clause);
|
|
1650
|
+
return buffered(map(tmp, DirectiveIndex$retractAll$lambda));
|
|
1651
|
+
};
|
|
1652
|
+
protoOf(DirectiveIndex).u1n = function () {
|
|
1653
|
+
var tmp = asSequence(this.x1p_1);
|
|
1654
|
+
return map(tmp, DirectiveIndex$getCache$lambda);
|
|
1655
|
+
};
|
|
1656
|
+
protoOf(DirectiveIndex).v1n = function () {
|
|
1657
|
+
};
|
|
1658
|
+
function extractFirst_1($this, clause) {
|
|
1659
|
+
// Inline function 'kotlin.collections.mapNotNull' call
|
|
1660
|
+
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
1661
|
+
var this_0 = $this.b1q_1.m2();
|
|
1662
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1663
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
1664
|
+
var tmp0_iterator = this_0.r();
|
|
1665
|
+
while (tmp0_iterator.s()) {
|
|
1666
|
+
var element = tmp0_iterator.u();
|
|
1667
|
+
// Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
|
|
1668
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.NumericIndex.extractFirst.<anonymous>' call
|
|
1669
|
+
var tmp0_safe_receiver = extractFirst_2($this, clause, element);
|
|
1670
|
+
if (tmp0_safe_receiver == null)
|
|
1671
|
+
null;
|
|
1672
|
+
else {
|
|
1673
|
+
// Inline function 'kotlin.let' call
|
|
1674
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1675
|
+
destination.o(tmp0_safe_receiver);
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
return minOrNull(destination);
|
|
1679
|
+
}
|
|
1680
|
+
function extractFirst_2($this, clause, index) {
|
|
1681
|
+
var tmp$ret$1;
|
|
1682
|
+
$l$block: {
|
|
1683
|
+
// Inline function 'kotlin.collections.indexOfFirst' call
|
|
1684
|
+
var index_0 = 0;
|
|
1685
|
+
var tmp0_iterator = index.r();
|
|
1686
|
+
while (tmp0_iterator.s()) {
|
|
1687
|
+
var item = tmp0_iterator.u();
|
|
1688
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.NumericIndex.extractFirst.<anonymous>' call
|
|
1689
|
+
if ($this.k1l().match(item.q1n(), clause)) {
|
|
1690
|
+
tmp$ret$1 = index_0;
|
|
1691
|
+
break $l$block;
|
|
1692
|
+
}
|
|
1693
|
+
index_0 = index_0 + 1 | 0;
|
|
1694
|
+
}
|
|
1695
|
+
tmp$ret$1 = -1;
|
|
1696
|
+
}
|
|
1697
|
+
var actualIndex = tmp$ret$1;
|
|
1698
|
+
var tmp;
|
|
1699
|
+
if (actualIndex === -1) {
|
|
1700
|
+
tmp = null;
|
|
1701
|
+
} else {
|
|
1702
|
+
tmp = index.d1(actualIndex);
|
|
1703
|
+
}
|
|
1704
|
+
return tmp;
|
|
1705
|
+
}
|
|
1706
|
+
function nestedFirstArgument_0(_this__u8e3s4, $this) {
|
|
1707
|
+
return Utils_instance.l1o(ensureNotNull(_this__u8e3s4.lx()), $this.a1q_1 + 1 | 0);
|
|
1708
|
+
}
|
|
1709
|
+
function asInnerNumeric(_this__u8e3s4, $this) {
|
|
1710
|
+
return nestedFirstArgument_0(_this__u8e3s4, $this).castToNumeric();
|
|
1711
|
+
}
|
|
1712
|
+
function asInnerNumeric_0(_this__u8e3s4, $this) {
|
|
1713
|
+
return nestedFirstArgument_0(_this__u8e3s4.q1n(), $this).castToNumeric();
|
|
1714
|
+
}
|
|
1715
|
+
function asInnerNumeric_1(_this__u8e3s4, $this) {
|
|
1716
|
+
return nestedFirstArgument_0(_this__u8e3s4.q1n(), $this).castToNumeric();
|
|
1717
|
+
}
|
|
1718
|
+
function NumericIndex$_get_size_$lambda_exo30i(it) {
|
|
1719
|
+
return it.l();
|
|
1720
|
+
}
|
|
1721
|
+
function NumericIndex$getIndexed$lambda(this$0, $clause) {
|
|
1722
|
+
return function (it) {
|
|
1723
|
+
return this$0.k1l().match(it.q1n(), $clause);
|
|
1724
|
+
};
|
|
1725
|
+
}
|
|
1726
|
+
function NumericIndex$retractAllIndexed$lambda(this$0, $clause) {
|
|
1727
|
+
return function (it) {
|
|
1728
|
+
return this$0.r1n(it, $clause);
|
|
1729
|
+
};
|
|
1730
|
+
}
|
|
1731
|
+
function NumericIndex$getCache$lambda(it) {
|
|
1732
|
+
return asSequence(it);
|
|
1733
|
+
}
|
|
1734
|
+
function NumericIndex$extractGlobalIndexedSequence$lambda(this$0, $clause) {
|
|
1735
|
+
return function (it) {
|
|
1736
|
+
return this$0.k1l().match(it.q1n(), $clause);
|
|
1737
|
+
};
|
|
1738
|
+
}
|
|
1739
|
+
function NumericIndex(unificator, ordered, nestingLevel) {
|
|
1740
|
+
AbstractIndexingLeaf.call(this, unificator);
|
|
1741
|
+
this.z1p_1 = ordered;
|
|
1742
|
+
this.a1q_1 = nestingLevel;
|
|
1743
|
+
var tmp = this;
|
|
1744
|
+
// Inline function 'kotlin.collections.mutableMapOf' call
|
|
1745
|
+
tmp.b1q_1 = LinkedHashMap_init_$Create$();
|
|
1746
|
+
}
|
|
1747
|
+
protoOf(NumericIndex).l = function () {
|
|
1748
|
+
var tmp = asSequence(this.b1q_1.m2());
|
|
1749
|
+
return sum(map(tmp, NumericIndex$_get_size_$lambda_exo30i));
|
|
1750
|
+
};
|
|
1751
|
+
protoOf(NumericIndex).q1l = function () {
|
|
1752
|
+
var tmp;
|
|
1753
|
+
if (this.b1q_1.z()) {
|
|
1754
|
+
tmp = true;
|
|
1755
|
+
} else {
|
|
1756
|
+
var tmp$ret$0;
|
|
1757
|
+
$l$block_0: {
|
|
1758
|
+
// Inline function 'kotlin.collections.all' call
|
|
1759
|
+
var this_0 = this.b1q_1.m2();
|
|
1760
|
+
var tmp_0;
|
|
1761
|
+
if (isInterface(this_0, Collection)) {
|
|
1762
|
+
tmp_0 = this_0.z();
|
|
1763
|
+
} else {
|
|
1764
|
+
tmp_0 = false;
|
|
1765
|
+
}
|
|
1766
|
+
if (tmp_0) {
|
|
1767
|
+
tmp$ret$0 = true;
|
|
1768
|
+
break $l$block_0;
|
|
1769
|
+
}
|
|
1770
|
+
var tmp0_iterator = this_0.r();
|
|
1771
|
+
while (tmp0_iterator.s()) {
|
|
1772
|
+
var element = tmp0_iterator.u();
|
|
1773
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.NumericIndex.<get-isEmpty>.<anonymous>' call
|
|
1774
|
+
if (!element.z()) {
|
|
1775
|
+
tmp$ret$0 = false;
|
|
1776
|
+
break $l$block_0;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
tmp$ret$0 = true;
|
|
1780
|
+
}
|
|
1781
|
+
tmp = tmp$ret$0;
|
|
1782
|
+
}
|
|
1783
|
+
return tmp;
|
|
1784
|
+
};
|
|
1785
|
+
protoOf(NumericIndex).s1n = function (clause) {
|
|
1786
|
+
if (this.z1p_1) {
|
|
1787
|
+
// Inline function 'kotlin.let' call
|
|
1788
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1789
|
+
var it = asInnerNumeric_1(clause, this);
|
|
1790
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
1791
|
+
var this_0 = this.b1q_1;
|
|
1792
|
+
var value = this_0.x2(it);
|
|
1793
|
+
var tmp;
|
|
1794
|
+
if (value == null) {
|
|
1795
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.NumericIndex.assertA.<anonymous>.<anonymous>' call
|
|
1796
|
+
var answer = dequeOf([]);
|
|
1797
|
+
this_0.o2(it, answer);
|
|
1798
|
+
tmp = answer;
|
|
1799
|
+
} else {
|
|
1800
|
+
tmp = value;
|
|
1801
|
+
}
|
|
1802
|
+
var tmp$ret$1 = tmp;
|
|
1803
|
+
addFirst(tmp$ret$1, Companion_instance_8.g1p(clause.y1o(this), this));
|
|
1804
|
+
} else {
|
|
1805
|
+
this.t1n(clause);
|
|
1806
|
+
}
|
|
1807
|
+
};
|
|
1808
|
+
protoOf(NumericIndex).t1n = function (clause) {
|
|
1809
|
+
// Inline function 'kotlin.let' call
|
|
1810
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1811
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.NumericIndex.assertZ.<anonymous>' call
|
|
1812
|
+
var it = asInnerNumeric_1(clause, this);
|
|
1813
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
1814
|
+
var this_0 = this.b1q_1;
|
|
1815
|
+
var value = this_0.x2(it);
|
|
1816
|
+
var tmp;
|
|
1817
|
+
if (value == null) {
|
|
1818
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.NumericIndex.assertZ.<anonymous>.<anonymous>' call
|
|
1819
|
+
var answer = dequeOf([]);
|
|
1820
|
+
this_0.o2(it, answer);
|
|
1821
|
+
tmp = answer;
|
|
1822
|
+
} else {
|
|
1823
|
+
tmp = value;
|
|
1824
|
+
}
|
|
1825
|
+
tmp.o(Companion_instance_8.g1p(clause.y1o(this), this));
|
|
1826
|
+
};
|
|
1827
|
+
protoOf(NumericIndex).i1p = function (clause) {
|
|
1828
|
+
if (nestedFirstArgument_0(clause, this).fw()) {
|
|
1829
|
+
// Inline function 'kotlin.let' call
|
|
1830
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1831
|
+
var it = this.b1q_1.x2(asInnerNumeric(clause, this));
|
|
1832
|
+
var tmp;
|
|
1833
|
+
if (it == null) {
|
|
1834
|
+
tmp = null;
|
|
1835
|
+
} else {
|
|
1836
|
+
tmp = extractFirst_2(this, clause, it);
|
|
1837
|
+
}
|
|
1838
|
+
return tmp;
|
|
1839
|
+
} else {
|
|
1840
|
+
return extractFirst_1(this, clause);
|
|
1841
|
+
}
|
|
1842
|
+
};
|
|
1843
|
+
protoOf(NumericIndex).j1p = function (clause) {
|
|
1844
|
+
var tmp;
|
|
1845
|
+
if (nestedFirstArgument_0(clause, this).fw()) {
|
|
1846
|
+
var tmp0_safe_receiver = this.b1q_1.x2(asInnerNumeric(clause, this));
|
|
1847
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : asSequence(tmp0_safe_receiver);
|
|
1848
|
+
var tmp_0;
|
|
1849
|
+
if (tmp1_safe_receiver == null) {
|
|
1850
|
+
tmp_0 = null;
|
|
1851
|
+
} else {
|
|
1852
|
+
tmp_0 = filter(tmp1_safe_receiver, NumericIndex$getIndexed$lambda(this, clause));
|
|
1853
|
+
}
|
|
1854
|
+
var tmp2_elvis_lhs = tmp_0;
|
|
1855
|
+
tmp = tmp2_elvis_lhs == null ? emptySequence() : tmp2_elvis_lhs;
|
|
1856
|
+
} else {
|
|
1857
|
+
tmp = this.l1p(clause);
|
|
1858
|
+
}
|
|
1859
|
+
return tmp;
|
|
1860
|
+
};
|
|
1861
|
+
protoOf(NumericIndex).f1p = function (indexed) {
|
|
1862
|
+
ensureNotNull(this.b1q_1.x2(asInnerNumeric_0(indexed, this))).p(indexed);
|
|
1863
|
+
};
|
|
1864
|
+
protoOf(NumericIndex).k1p = function (clause) {
|
|
1865
|
+
var tmp;
|
|
1866
|
+
if (nestedFirstArgument_0(clause, this).fw()) {
|
|
1867
|
+
var partialIndex = this.b1q_1.x2(asInnerNumeric(clause, this));
|
|
1868
|
+
tmp = partialIndex == null ? emptySequence() : buffered(this.r1n(partialIndex, clause));
|
|
1869
|
+
} else {
|
|
1870
|
+
var tmp_0 = Utils_instance;
|
|
1871
|
+
var tmp_1 = asSequence(this.b1q_1.m2());
|
|
1872
|
+
tmp = buffered(tmp_0.o1o(map(tmp_1, NumericIndex$retractAllIndexed$lambda(this, clause))));
|
|
1873
|
+
}
|
|
1874
|
+
return tmp;
|
|
1875
|
+
};
|
|
1876
|
+
protoOf(NumericIndex).u1n = function () {
|
|
1877
|
+
var tmp = Utils_instance;
|
|
1878
|
+
var tmp_0 = asSequence(this.b1q_1.m2());
|
|
1879
|
+
return tmp.o1o(map(tmp_0, NumericIndex$getCache$lambda));
|
|
1880
|
+
};
|
|
1881
|
+
protoOf(NumericIndex).l1p = function (clause) {
|
|
1882
|
+
var tmp = this.u1n();
|
|
1883
|
+
return filter(tmp, NumericIndex$extractGlobalIndexedSequence$lambda(this, clause));
|
|
1884
|
+
};
|
|
1885
|
+
function extractFirst_3($this, clause, index) {
|
|
1886
|
+
var tmp$ret$1;
|
|
1887
|
+
$l$block: {
|
|
1888
|
+
// Inline function 'kotlin.collections.indexOfFirst' call
|
|
1889
|
+
var index_0 = 0;
|
|
1890
|
+
var tmp0_iterator = index.r();
|
|
1891
|
+
while (tmp0_iterator.s()) {
|
|
1892
|
+
var item = tmp0_iterator.u();
|
|
1893
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.leaf.VariableIndex.extractFirst.<anonymous>' call
|
|
1894
|
+
if ($this.k1l().match(item.q1n(), clause)) {
|
|
1895
|
+
tmp$ret$1 = index_0;
|
|
1896
|
+
break $l$block;
|
|
1897
|
+
}
|
|
1898
|
+
index_0 = index_0 + 1 | 0;
|
|
1899
|
+
}
|
|
1900
|
+
tmp$ret$1 = -1;
|
|
1901
|
+
}
|
|
1902
|
+
var actualIndex = tmp$ret$1;
|
|
1903
|
+
var tmp;
|
|
1904
|
+
if (actualIndex === -1) {
|
|
1905
|
+
tmp = null;
|
|
1906
|
+
} else {
|
|
1907
|
+
tmp = index.d1(actualIndex);
|
|
1908
|
+
}
|
|
1909
|
+
return tmp;
|
|
1910
|
+
}
|
|
1911
|
+
function VariableIndex$extractGlobalIndexedSequence$lambda(this$0, $clause) {
|
|
1912
|
+
return function (it) {
|
|
1913
|
+
return this$0.k1l().match(it.q1n(), $clause);
|
|
1914
|
+
};
|
|
1915
|
+
}
|
|
1916
|
+
function VariableIndex(unificator, ordered) {
|
|
1917
|
+
AbstractIndexingLeaf.call(this, unificator);
|
|
1918
|
+
this.d1q_1 = ordered;
|
|
1919
|
+
this.e1q_1 = dequeOf([]);
|
|
1920
|
+
}
|
|
1921
|
+
protoOf(VariableIndex).l = function () {
|
|
1922
|
+
return this.e1q_1.l();
|
|
1923
|
+
};
|
|
1924
|
+
protoOf(VariableIndex).q1l = function () {
|
|
1925
|
+
return this.e1q_1.z();
|
|
1926
|
+
};
|
|
1927
|
+
protoOf(VariableIndex).s1n = function (clause) {
|
|
1928
|
+
var tmp;
|
|
1929
|
+
if (this.d1q_1) {
|
|
1930
|
+
addFirst(this.e1q_1, Companion_instance_8.g1p(clause.y1o(this), this));
|
|
1931
|
+
tmp = Unit_instance;
|
|
1932
|
+
} else {
|
|
1933
|
+
this.t1n(clause);
|
|
1934
|
+
tmp = Unit_instance;
|
|
1935
|
+
}
|
|
1936
|
+
return tmp;
|
|
1937
|
+
};
|
|
1938
|
+
protoOf(VariableIndex).t1n = function (clause) {
|
|
1939
|
+
this.e1q_1.o(Companion_instance_8.g1p(clause.y1o(this), this));
|
|
1940
|
+
};
|
|
1941
|
+
protoOf(VariableIndex).u1n = function () {
|
|
1942
|
+
return asSequence(this.e1q_1);
|
|
1943
|
+
};
|
|
1944
|
+
protoOf(VariableIndex).i1p = function (clause) {
|
|
1945
|
+
return extractFirst_3(this, clause, this.e1q_1);
|
|
1946
|
+
};
|
|
1947
|
+
protoOf(VariableIndex).j1p = function (clause) {
|
|
1948
|
+
return this.l1p(clause);
|
|
1949
|
+
};
|
|
1950
|
+
protoOf(VariableIndex).f1p = function (indexed) {
|
|
1951
|
+
this.e1q_1.p(indexed);
|
|
1952
|
+
};
|
|
1953
|
+
protoOf(VariableIndex).k1p = function (clause) {
|
|
1954
|
+
return buffered(this.r1n(this.e1q_1, clause));
|
|
1955
|
+
};
|
|
1956
|
+
protoOf(VariableIndex).l1p = function (clause) {
|
|
1957
|
+
var tmp = asSequence(this.e1q_1);
|
|
1958
|
+
return filter(tmp, VariableIndex$extractGlobalIndexedSequence$lambda(this, clause));
|
|
1959
|
+
};
|
|
1960
|
+
function ArityNode(unificator) {
|
|
1961
|
+
AbstractReteNode.call(this, unificator);
|
|
1962
|
+
}
|
|
1963
|
+
function FamilyArityIndexingNode(unificator, ordered, nestingLevel) {
|
|
1964
|
+
FamilyArityReteNode.call(this, unificator, ordered, nestingLevel);
|
|
1965
|
+
this.n1q_1 = ordered;
|
|
1966
|
+
}
|
|
1967
|
+
protoOf(FamilyArityIndexingNode).i1p = function (clause) {
|
|
1968
|
+
var tmp;
|
|
1969
|
+
if (this.n1q_1) {
|
|
1970
|
+
tmp = this.x1q(clause);
|
|
1971
|
+
} else {
|
|
1972
|
+
tmp = this.w1q(clause);
|
|
1973
|
+
}
|
|
1974
|
+
return tmp;
|
|
1975
|
+
};
|
|
1976
|
+
protoOf(FamilyArityIndexingNode).j1p = function (clause) {
|
|
1977
|
+
var tmp;
|
|
1978
|
+
if (this.n1q_1) {
|
|
1979
|
+
tmp = this.z1q(clause);
|
|
1980
|
+
} else {
|
|
1981
|
+
tmp = this.y1q(clause);
|
|
1982
|
+
}
|
|
1983
|
+
return tmp;
|
|
1984
|
+
};
|
|
1985
|
+
protoOf(FamilyArityIndexingNode).k1p = function (clause) {
|
|
1986
|
+
var tmp;
|
|
1987
|
+
if (this.n1q_1) {
|
|
1988
|
+
tmp = this.b1r(clause);
|
|
1989
|
+
} else {
|
|
1990
|
+
tmp = this.a1r(clause);
|
|
1991
|
+
}
|
|
1992
|
+
return tmp;
|
|
1993
|
+
};
|
|
1994
|
+
protoOf(FamilyArityIndexingNode).l1p = function (clause) {
|
|
1995
|
+
var tmp;
|
|
1996
|
+
if (this.n1q_1) {
|
|
1997
|
+
tmp = Utils_instance.m1o([this.s1q_1.l1p(clause), this.r1q_1.l1p(clause), this.t1q_1.l1p(clause), this.u1q_1.l1p(clause)]);
|
|
1998
|
+
} else {
|
|
1999
|
+
tmp = Utils_instance.p1o([this.s1q_1.l1p(clause), this.r1q_1.l1p(clause), this.t1q_1.l1p(clause), this.u1q_1.l1p(clause)]);
|
|
2000
|
+
}
|
|
2001
|
+
return tmp;
|
|
2002
|
+
};
|
|
2003
|
+
function retractAllOrdered($this, clause) {
|
|
2004
|
+
var tmp = $this.b1r(clause);
|
|
2005
|
+
return map(tmp, FamilyArityReteNode$retractAllOrdered$lambda);
|
|
2006
|
+
}
|
|
2007
|
+
function getOrdered($this, clause) {
|
|
2008
|
+
var tmp = $this.z1q(clause);
|
|
2009
|
+
return map(tmp, FamilyArityReteNode$getOrdered$lambda);
|
|
2010
|
+
}
|
|
2011
|
+
function retractAllUnordered($this, clause) {
|
|
2012
|
+
var tmp = $this.a1r(clause);
|
|
2013
|
+
return map(tmp, FamilyArityReteNode$retractAllUnordered$lambda);
|
|
2014
|
+
}
|
|
2015
|
+
function getUnordered($this, clause) {
|
|
2016
|
+
var tmp = $this.y1q(clause);
|
|
2017
|
+
return map(tmp, FamilyArityReteNode$getUnordered$lambda);
|
|
2018
|
+
}
|
|
2019
|
+
function regenerateCache_0($this) {
|
|
2020
|
+
var tmp;
|
|
2021
|
+
if ($this.p1q_1) {
|
|
2022
|
+
tmp = Utils_instance.m1o([$this.s1q_1.u1n(), $this.r1q_1.u1n(), $this.t1q_1.u1n(), $this.u1q_1.u1n()]);
|
|
2023
|
+
} else {
|
|
2024
|
+
tmp = Utils_instance.p1o([$this.s1q_1.u1n(), $this.r1q_1.u1n(), $this.t1q_1.u1n(), $this.u1q_1.u1n()]);
|
|
2025
|
+
}
|
|
2026
|
+
return dequeOf_0(tmp);
|
|
2027
|
+
}
|
|
2028
|
+
function nestedFirstArgument_1(_this__u8e3s4, $this) {
|
|
2029
|
+
return Utils_instance.l1o(ensureNotNull(_this__u8e3s4.lx()), $this.q1q_1 + 1 | 0);
|
|
2030
|
+
}
|
|
2031
|
+
function assertByFirstParameter($this, clause) {
|
|
2032
|
+
var innerFirst = nestedFirstArgument_1(clause.q1n(), $this);
|
|
2033
|
+
return innerFirst.fw() ? $this.r1q_1 : innerFirst.av() ? $this.s1q_1 : innerFirst.bw() ? $this.t1q_1 : $this.u1q_1;
|
|
2034
|
+
}
|
|
2035
|
+
function isGlobal_0(_this__u8e3s4, $this) {
|
|
2036
|
+
return Utils_instance.l1o(ensureNotNull(_this__u8e3s4.lx()), $this.q1q_1 + 1 | 0).bw();
|
|
2037
|
+
}
|
|
2038
|
+
function FamilyArityReteNode$regenerateCache$ref($boundThis) {
|
|
2039
|
+
var l = function () {
|
|
2040
|
+
return regenerateCache_0($boundThis);
|
|
2041
|
+
};
|
|
2042
|
+
l.callableName = 'regenerateCache';
|
|
2043
|
+
return l;
|
|
2044
|
+
}
|
|
2045
|
+
function FamilyArityReteNode$_get_size_$lambda_sxz8zo(it) {
|
|
2046
|
+
return it.l();
|
|
2047
|
+
}
|
|
2048
|
+
function FamilyArityReteNode$get$lambda(it) {
|
|
2049
|
+
return it.q1n();
|
|
2050
|
+
}
|
|
2051
|
+
function FamilyArityReteNode$get$lambda_0(it) {
|
|
2052
|
+
return it.q1n();
|
|
2053
|
+
}
|
|
2054
|
+
function FamilyArityReteNode$retractAllOrdered$lambda(it) {
|
|
2055
|
+
return it.q1n();
|
|
2056
|
+
}
|
|
2057
|
+
function FamilyArityReteNode$getOrdered$lambda(it) {
|
|
2058
|
+
return it.q1n();
|
|
2059
|
+
}
|
|
2060
|
+
function FamilyArityReteNode$retractAllUnordered$lambda(it) {
|
|
2061
|
+
return it.q1n();
|
|
2062
|
+
}
|
|
2063
|
+
function FamilyArityReteNode$getUnordered$lambda(it) {
|
|
2064
|
+
return it.q1n();
|
|
2065
|
+
}
|
|
2066
|
+
function FamilyArityReteNode(unificator, ordered, nestingLevel) {
|
|
2067
|
+
ArityNode.call(this, unificator);
|
|
2068
|
+
this.p1q_1 = ordered;
|
|
2069
|
+
this.q1q_1 = nestingLevel;
|
|
2070
|
+
this.r1q_1 = new NumericIndex(unificator, this.p1q_1, this.q1q_1);
|
|
2071
|
+
this.s1q_1 = new AtomIndex(unificator, this.p1q_1, this.q1q_1);
|
|
2072
|
+
this.t1q_1 = new VariableIndex(unificator, this.p1q_1);
|
|
2073
|
+
this.u1q_1 = new CompoundIndex(unificator, this.p1q_1, this.q1q_1 + 1 | 0);
|
|
2074
|
+
var tmp = this;
|
|
2075
|
+
var tmp_0 = Companion_instance_1;
|
|
2076
|
+
tmp.v1q_1 = tmp_0.tp(FamilyArityReteNode$regenerateCache$ref(this));
|
|
2077
|
+
}
|
|
2078
|
+
protoOf(FamilyArityReteNode).b1m = function (clause) {
|
|
2079
|
+
var tmp;
|
|
2080
|
+
if (this.p1q_1) {
|
|
2081
|
+
tmp = this.x1q(clause);
|
|
2082
|
+
} else {
|
|
2083
|
+
tmp = this.w1q(clause);
|
|
2084
|
+
}
|
|
2085
|
+
var result = tmp;
|
|
2086
|
+
var tmp_0;
|
|
2087
|
+
if (result == null) {
|
|
2088
|
+
tmp_0 = emptySequence();
|
|
2089
|
+
} else {
|
|
2090
|
+
result.e1p();
|
|
2091
|
+
this.v1n();
|
|
2092
|
+
tmp_0 = sequenceOf([result.q1n()]);
|
|
2093
|
+
}
|
|
2094
|
+
return tmp_0;
|
|
2095
|
+
};
|
|
2096
|
+
protoOf(FamilyArityReteNode).l = function () {
|
|
2097
|
+
var tmp = sequenceOf([this.r1q_1, this.s1q_1, this.t1q_1, this.u1q_1]);
|
|
2098
|
+
return sum(map(tmp, FamilyArityReteNode$_get_size_$lambda_sxz8zo));
|
|
2099
|
+
};
|
|
2100
|
+
protoOf(FamilyArityReteNode).q1l = function () {
|
|
2101
|
+
var tmp$ret$1;
|
|
2102
|
+
$l$block: {
|
|
2103
|
+
// Inline function 'kotlin.sequences.all' call
|
|
2104
|
+
var tmp0_iterator = sequenceOf([this.r1q_1, this.s1q_1, this.t1q_1, this.u1q_1]).r();
|
|
2105
|
+
while (tmp0_iterator.s()) {
|
|
2106
|
+
var element = tmp0_iterator.u();
|
|
2107
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FamilyArityReteNode.<get-isEmpty>.<anonymous>' call
|
|
2108
|
+
if (!element.q1l()) {
|
|
2109
|
+
tmp$ret$1 = false;
|
|
2110
|
+
break $l$block;
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
tmp$ret$1 = true;
|
|
2114
|
+
}
|
|
2115
|
+
return tmp$ret$1;
|
|
2116
|
+
};
|
|
2117
|
+
protoOf(FamilyArityReteNode).t1l = function (clause) {
|
|
2118
|
+
var tmp;
|
|
2119
|
+
if (isGlobal_0(clause, this)) {
|
|
2120
|
+
var tmp_0;
|
|
2121
|
+
if (this.p1q_1) {
|
|
2122
|
+
var tmp_1 = Utils_instance.m1o([this.s1q_1.l1p(clause), this.t1q_1.l1p(clause), this.r1q_1.l1p(clause), this.u1q_1.l1p(clause)]);
|
|
2123
|
+
tmp_0 = map(tmp_1, FamilyArityReteNode$get$lambda);
|
|
2124
|
+
} else {
|
|
2125
|
+
var tmp_2 = Utils_instance.p1o([this.s1q_1.l1p(clause), this.t1q_1.l1p(clause), this.r1q_1.l1p(clause), this.u1q_1.l1p(clause)]);
|
|
2126
|
+
tmp_0 = map(tmp_2, FamilyArityReteNode$get$lambda_0);
|
|
2127
|
+
}
|
|
2128
|
+
tmp = tmp_0;
|
|
2129
|
+
} else {
|
|
2130
|
+
var tmp_3;
|
|
2131
|
+
if (this.p1q_1) {
|
|
2132
|
+
tmp_3 = getOrdered(this, clause);
|
|
2133
|
+
} else {
|
|
2134
|
+
tmp_3 = getUnordered(this, clause);
|
|
2135
|
+
}
|
|
2136
|
+
tmp = tmp_3;
|
|
2137
|
+
}
|
|
2138
|
+
return tmp;
|
|
2139
|
+
};
|
|
2140
|
+
protoOf(FamilyArityReteNode).s1n = function (clause) {
|
|
2141
|
+
return assertByFirstParameter(this, clause).s1n(clause.y1o(this));
|
|
2142
|
+
};
|
|
2143
|
+
protoOf(FamilyArityReteNode).t1n = function (clause) {
|
|
2144
|
+
return assertByFirstParameter(this, clause).t1n(clause.y1o(this));
|
|
2145
|
+
};
|
|
2146
|
+
protoOf(FamilyArityReteNode).d1m = function (clause) {
|
|
2147
|
+
var tmp;
|
|
2148
|
+
if (this.p1q_1) {
|
|
2149
|
+
tmp = retractAllOrdered(this, clause);
|
|
2150
|
+
} else {
|
|
2151
|
+
tmp = retractAllUnordered(this, clause);
|
|
2152
|
+
}
|
|
2153
|
+
return tmp;
|
|
2154
|
+
};
|
|
2155
|
+
protoOf(FamilyArityReteNode).u1n = function () {
|
|
2156
|
+
return asSequence(this.v1q_1.r2());
|
|
2157
|
+
};
|
|
2158
|
+
protoOf(FamilyArityReteNode).b1r = function (clause) {
|
|
2159
|
+
var innerFirst = nestedFirstArgument_1(clause, this);
|
|
2160
|
+
var tmp;
|
|
2161
|
+
if (innerFirst.fw()) {
|
|
2162
|
+
tmp = Utils_instance.m1o([this.t1q_1.k1p(clause), this.r1q_1.k1p(clause)]);
|
|
2163
|
+
} else if (innerFirst.av()) {
|
|
2164
|
+
tmp = Utils_instance.m1o([this.t1q_1.k1p(clause), this.s1q_1.k1p(clause)]);
|
|
2165
|
+
} else if (innerFirst.bw()) {
|
|
2166
|
+
tmp = Utils_instance.m1o([this.t1q_1.k1p(clause), this.r1q_1.k1p(clause), this.s1q_1.k1p(clause), this.u1q_1.k1p(clause)]);
|
|
2167
|
+
} else {
|
|
2168
|
+
tmp = Utils_instance.m1o([this.t1q_1.k1p(clause), this.u1q_1.k1p(clause)]);
|
|
2169
|
+
}
|
|
2170
|
+
return tmp;
|
|
2171
|
+
};
|
|
2172
|
+
protoOf(FamilyArityReteNode).a1r = function (clause) {
|
|
2173
|
+
var innerFirst = nestedFirstArgument_1(clause, this);
|
|
2174
|
+
return innerFirst.fw() ? Utils_instance.p1o([this.t1q_1.k1p(clause), this.r1q_1.k1p(clause)]) : innerFirst.av() ? Utils_instance.p1o([this.t1q_1.k1p(clause), this.s1q_1.k1p(clause)]) : innerFirst.bw() ? Utils_instance.p1o([this.t1q_1.k1p(clause), this.r1q_1.k1p(clause), this.s1q_1.k1p(clause), this.u1q_1.k1p(clause)]) : Utils_instance.p1o([this.t1q_1.k1p(clause), this.u1q_1.k1p(clause)]);
|
|
2175
|
+
};
|
|
2176
|
+
protoOf(FamilyArityReteNode).z1q = function (clause) {
|
|
2177
|
+
var innerFirst = nestedFirstArgument_1(clause, this);
|
|
2178
|
+
return innerFirst.fw() ? Utils_instance.m1o([this.t1q_1.j1p(clause), this.r1q_1.j1p(clause)]) : innerFirst.av() ? Utils_instance.m1o([this.t1q_1.j1p(clause), this.s1q_1.j1p(clause)]) : innerFirst.bw() ? Utils_instance.m1o([this.t1q_1.j1p(clause), this.r1q_1.j1p(clause), this.s1q_1.j1p(clause), this.u1q_1.j1p(clause)]) : Utils_instance.m1o([this.t1q_1.j1p(clause), this.u1q_1.j1p(clause)]);
|
|
2179
|
+
};
|
|
2180
|
+
protoOf(FamilyArityReteNode).y1q = function (clause) {
|
|
2181
|
+
var innerFirst = nestedFirstArgument_1(clause, this);
|
|
2182
|
+
return innerFirst.fw() ? Utils_instance.p1o([this.t1q_1.j1p(clause), this.r1q_1.j1p(clause)]) : innerFirst.av() ? Utils_instance.p1o([this.t1q_1.j1p(clause), this.s1q_1.j1p(clause)]) : innerFirst.bw() ? Utils_instance.p1o([this.t1q_1.j1p(clause), this.r1q_1.j1p(clause), this.s1q_1.j1p(clause), this.u1q_1.j1p(clause)]) : Utils_instance.p1o([this.t1q_1.j1p(clause), this.u1q_1.j1p(clause)]);
|
|
2183
|
+
};
|
|
2184
|
+
protoOf(FamilyArityReteNode).w1q = function (clause) {
|
|
2185
|
+
var innerFirst = nestedFirstArgument_1(clause, this);
|
|
2186
|
+
var tmp;
|
|
2187
|
+
if (innerFirst.fw()) {
|
|
2188
|
+
var tmp0_elvis_lhs = this.t1q_1.i1p(clause);
|
|
2189
|
+
tmp = tmp0_elvis_lhs == null ? this.r1q_1.i1p(clause) : tmp0_elvis_lhs;
|
|
2190
|
+
} else if (innerFirst.av()) {
|
|
2191
|
+
var tmp1_elvis_lhs = this.t1q_1.i1p(clause);
|
|
2192
|
+
tmp = tmp1_elvis_lhs == null ? this.s1q_1.i1p(clause) : tmp1_elvis_lhs;
|
|
2193
|
+
} else if (innerFirst.bw()) {
|
|
2194
|
+
var tmp2_elvis_lhs = this.t1q_1.i1p(clause);
|
|
2195
|
+
var tmp3_elvis_lhs = tmp2_elvis_lhs == null ? this.r1q_1.i1p(clause) : tmp2_elvis_lhs;
|
|
2196
|
+
var tmp4_elvis_lhs = tmp3_elvis_lhs == null ? this.s1q_1.i1p(clause) : tmp3_elvis_lhs;
|
|
2197
|
+
tmp = tmp4_elvis_lhs == null ? this.u1q_1.i1p(clause) : tmp4_elvis_lhs;
|
|
2198
|
+
} else {
|
|
2199
|
+
var tmp5_elvis_lhs = this.t1q_1.i1p(clause);
|
|
2200
|
+
tmp = tmp5_elvis_lhs == null ? this.u1q_1.i1p(clause) : tmp5_elvis_lhs;
|
|
2201
|
+
}
|
|
2202
|
+
return tmp;
|
|
2203
|
+
};
|
|
2204
|
+
protoOf(FamilyArityReteNode).x1q = function (clause) {
|
|
2205
|
+
var innerFirst = nestedFirstArgument_1(clause, this);
|
|
2206
|
+
var tmp;
|
|
2207
|
+
if (innerFirst.fw()) {
|
|
2208
|
+
tmp = Utils_instance.u1o(this.r1q_1.i1p(clause), this.t1q_1.i1p(clause));
|
|
2209
|
+
} else if (innerFirst.av()) {
|
|
2210
|
+
tmp = Utils_instance.u1o(this.s1q_1.i1p(clause), this.t1q_1.i1p(clause));
|
|
2211
|
+
} else if (innerFirst.bw()) {
|
|
2212
|
+
tmp = Utils_instance.u1o(Utils_instance.u1o(this.r1q_1.i1p(clause), this.s1q_1.i1p(clause)), Utils_instance.u1o(this.t1q_1.i1p(clause), this.u1q_1.i1p(clause)));
|
|
2213
|
+
} else {
|
|
2214
|
+
tmp = Utils_instance.u1o(this.t1q_1.i1p(clause), this.u1q_1.i1p(clause));
|
|
2215
|
+
}
|
|
2216
|
+
return tmp;
|
|
2217
|
+
};
|
|
2218
|
+
protoOf(FamilyArityReteNode).v1n = function () {
|
|
2219
|
+
this.v1q_1.vp();
|
|
2220
|
+
};
|
|
2221
|
+
function isGlobal_1(_this__u8e3s4, $this) {
|
|
2222
|
+
return _this__u8e3s4.nv() ? Utils_instance.l1o(_this__u8e3s4.castToRule().lx(), $this.e1r_1).bw() : false;
|
|
2223
|
+
}
|
|
2224
|
+
function nestedArity(_this__u8e3s4, $this) {
|
|
2225
|
+
var tmp0_safe_receiver = _this__u8e3s4.asRule();
|
|
2226
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.lx();
|
|
2227
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : Utils_instance.j1o(tmp1_safe_receiver, $this.e1r_1);
|
|
2228
|
+
var tmp;
|
|
2229
|
+
if (tmp2_elvis_lhs == null) {
|
|
2230
|
+
var message = 'The nestedArity method cannot be invoked on non-rule clauses';
|
|
2231
|
+
throw IllegalStateException_init_$Create$(toString(message));
|
|
2232
|
+
} else {
|
|
2233
|
+
tmp = tmp2_elvis_lhs;
|
|
2234
|
+
}
|
|
2235
|
+
return tmp;
|
|
2236
|
+
}
|
|
2237
|
+
function nestedArity_0(_this__u8e3s4, $this) {
|
|
2238
|
+
return Utils_instance.j1o(ensureNotNull(_this__u8e3s4.q1n().lx()), $this.e1r_1);
|
|
2239
|
+
}
|
|
2240
|
+
function regenerateCache_1($this) {
|
|
2241
|
+
var tmp;
|
|
2242
|
+
if ($this.d1r_1) {
|
|
2243
|
+
var tmp_0 = Utils_instance;
|
|
2244
|
+
// Inline function 'kotlin.collections.map' call
|
|
2245
|
+
var this_0 = $this.f1r_1.m2();
|
|
2246
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2247
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2248
|
+
var tmp0_iterator = this_0.r();
|
|
2249
|
+
while (tmp0_iterator.s()) {
|
|
2250
|
+
var item = tmp0_iterator.u();
|
|
2251
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.regenerateCache.<anonymous>' call
|
|
2252
|
+
var tmp$ret$0 = item.u1n();
|
|
2253
|
+
destination.o(tmp$ret$0);
|
|
2254
|
+
}
|
|
2255
|
+
tmp = tmp_0.n1o(destination);
|
|
2256
|
+
} else {
|
|
2257
|
+
var tmp_1 = Utils_instance;
|
|
2258
|
+
// Inline function 'kotlin.collections.map' call
|
|
2259
|
+
var this_1 = $this.f1r_1.m2();
|
|
2260
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2261
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
2262
|
+
var tmp0_iterator_0 = this_1.r();
|
|
2263
|
+
while (tmp0_iterator_0.s()) {
|
|
2264
|
+
var item_0 = tmp0_iterator_0.u();
|
|
2265
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.regenerateCache.<anonymous>' call
|
|
2266
|
+
var tmp$ret$3 = item_0.u1n();
|
|
2267
|
+
destination_0.o(tmp$ret$3);
|
|
2268
|
+
}
|
|
2269
|
+
tmp = tmp_1.r1o(destination_0);
|
|
2270
|
+
}
|
|
2271
|
+
return dequeOf_0(tmp);
|
|
2272
|
+
}
|
|
2273
|
+
function FunctorIndexingNode$regenerateCache$ref($boundThis) {
|
|
2274
|
+
var l = function () {
|
|
2275
|
+
return regenerateCache_1($boundThis);
|
|
2276
|
+
};
|
|
2277
|
+
l.callableName = 'regenerateCache';
|
|
2278
|
+
return l;
|
|
2279
|
+
}
|
|
2280
|
+
function FunctorIndexingNode$_get_size_$lambda_vcufvm(it) {
|
|
2281
|
+
return it.l();
|
|
2282
|
+
}
|
|
2283
|
+
function FunctorIndexingNode$retractAllIndexed$lambda(this$0, $clause) {
|
|
2284
|
+
return function (it) {
|
|
2285
|
+
return this$0.k1l().match(it.q1n(), $clause);
|
|
2286
|
+
};
|
|
2287
|
+
}
|
|
2288
|
+
function FunctorIndexingNode(unificator, ordered, nestingLevel) {
|
|
2289
|
+
FunctorNode.call(this, unificator);
|
|
2290
|
+
this.d1r_1 = ordered;
|
|
2291
|
+
this.e1r_1 = nestingLevel;
|
|
2292
|
+
var tmp = this;
|
|
2293
|
+
// Inline function 'kotlin.collections.mutableMapOf' call
|
|
2294
|
+
tmp.f1r_1 = LinkedHashMap_init_$Create$();
|
|
2295
|
+
var tmp_0 = this;
|
|
2296
|
+
var tmp_1 = Companion_instance_1;
|
|
2297
|
+
tmp_0.g1r_1 = tmp_1.tp(FunctorIndexingNode$regenerateCache$ref(this));
|
|
2298
|
+
}
|
|
2299
|
+
protoOf(FunctorIndexingNode).l = function () {
|
|
2300
|
+
var tmp = asSequence(this.f1r_1.m2());
|
|
2301
|
+
return sum(map(tmp, FunctorIndexingNode$_get_size_$lambda_vcufvm));
|
|
2302
|
+
};
|
|
2303
|
+
protoOf(FunctorIndexingNode).q1l = function () {
|
|
2304
|
+
var tmp;
|
|
2305
|
+
if (this.f1r_1.z()) {
|
|
2306
|
+
tmp = true;
|
|
2307
|
+
} else {
|
|
2308
|
+
var tmp$ret$0;
|
|
2309
|
+
$l$block_0: {
|
|
2310
|
+
// Inline function 'kotlin.collections.all' call
|
|
2311
|
+
var this_0 = this.f1r_1.m2();
|
|
2312
|
+
var tmp_0;
|
|
2313
|
+
if (isInterface(this_0, Collection)) {
|
|
2314
|
+
tmp_0 = this_0.z();
|
|
2315
|
+
} else {
|
|
2316
|
+
tmp_0 = false;
|
|
2317
|
+
}
|
|
2318
|
+
if (tmp_0) {
|
|
2319
|
+
tmp$ret$0 = true;
|
|
2320
|
+
break $l$block_0;
|
|
2321
|
+
}
|
|
2322
|
+
var tmp0_iterator = this_0.r();
|
|
2323
|
+
while (tmp0_iterator.s()) {
|
|
2324
|
+
var element = tmp0_iterator.u();
|
|
2325
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.<get-isEmpty>.<anonymous>' call
|
|
2326
|
+
if (!element.q1l()) {
|
|
2327
|
+
tmp$ret$0 = false;
|
|
2328
|
+
break $l$block_0;
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
tmp$ret$0 = true;
|
|
2332
|
+
}
|
|
2333
|
+
tmp = tmp$ret$0;
|
|
2334
|
+
}
|
|
2335
|
+
return tmp;
|
|
2336
|
+
};
|
|
2337
|
+
protoOf(FunctorIndexingNode).s1n = function (clause) {
|
|
2338
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
2339
|
+
var this_0 = this.f1r_1;
|
|
2340
|
+
var key = nestedArity_0(clause, this);
|
|
2341
|
+
var value = this_0.x2(key);
|
|
2342
|
+
var tmp;
|
|
2343
|
+
if (value == null) {
|
|
2344
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.assertA.<anonymous>' call
|
|
2345
|
+
var answer = new FamilyArityIndexingNode(this.k1l(), this.d1r_1, this.e1r_1);
|
|
2346
|
+
this_0.o2(key, answer);
|
|
2347
|
+
tmp = answer;
|
|
2348
|
+
} else {
|
|
2349
|
+
tmp = value;
|
|
2350
|
+
}
|
|
2351
|
+
tmp.s1n(clause.y1o(this));
|
|
2352
|
+
};
|
|
2353
|
+
protoOf(FunctorIndexingNode).t1n = function (clause) {
|
|
2354
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
2355
|
+
var this_0 = this.f1r_1;
|
|
2356
|
+
var key = nestedArity_0(clause, this);
|
|
2357
|
+
var value = this_0.x2(key);
|
|
2358
|
+
var tmp;
|
|
2359
|
+
if (value == null) {
|
|
2360
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.assertZ.<anonymous>' call
|
|
2361
|
+
var answer = new FamilyArityIndexingNode(this.k1l(), this.d1r_1, this.e1r_1);
|
|
2362
|
+
this_0.o2(key, answer);
|
|
2363
|
+
tmp = answer;
|
|
2364
|
+
} else {
|
|
2365
|
+
tmp = value;
|
|
2366
|
+
}
|
|
2367
|
+
tmp.t1n(clause.y1o(this));
|
|
2368
|
+
};
|
|
2369
|
+
protoOf(FunctorIndexingNode).u1n = function () {
|
|
2370
|
+
return asSequence(this.g1r_1.r2());
|
|
2371
|
+
};
|
|
2372
|
+
protoOf(FunctorIndexingNode).i1p = function (clause) {
|
|
2373
|
+
var tmp;
|
|
2374
|
+
if (isGlobal_1(clause, this)) {
|
|
2375
|
+
var tmp$ret$4;
|
|
2376
|
+
$l$block: {
|
|
2377
|
+
// Inline function 'kotlin.sequences.firstOrNull' call
|
|
2378
|
+
var tmp_0 = Utils_instance;
|
|
2379
|
+
// Inline function 'kotlin.collections.map' call
|
|
2380
|
+
var this_0 = this.f1r_1.m2();
|
|
2381
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2382
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2383
|
+
var tmp0_iterator = this_0.r();
|
|
2384
|
+
while (tmp0_iterator.s()) {
|
|
2385
|
+
var item = tmp0_iterator.u();
|
|
2386
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.getFirstIndexed.<anonymous>' call
|
|
2387
|
+
var tmp$ret$0 = item.l1p(clause);
|
|
2388
|
+
destination.o(tmp$ret$0);
|
|
2389
|
+
}
|
|
2390
|
+
var tmp0_iterator_0 = tmp_0.n1o(destination).r();
|
|
2391
|
+
while (tmp0_iterator_0.s()) {
|
|
2392
|
+
var element = tmp0_iterator_0.u();
|
|
2393
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.getFirstIndexed.<anonymous>' call
|
|
2394
|
+
if (this.k1l().match(element.q1n(), clause)) {
|
|
2395
|
+
tmp$ret$4 = element;
|
|
2396
|
+
break $l$block;
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
tmp$ret$4 = null;
|
|
2400
|
+
}
|
|
2401
|
+
tmp = tmp$ret$4;
|
|
2402
|
+
} else {
|
|
2403
|
+
var tmp0_safe_receiver = this.f1r_1.x2(nestedArity(clause, this));
|
|
2404
|
+
tmp = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.i1p(clause);
|
|
2405
|
+
}
|
|
2406
|
+
return tmp;
|
|
2407
|
+
};
|
|
2408
|
+
protoOf(FunctorIndexingNode).j1p = function (clause) {
|
|
2409
|
+
var tmp;
|
|
2410
|
+
if (isGlobal_1(clause, this)) {
|
|
2411
|
+
var tmp_0 = Utils_instance;
|
|
2412
|
+
// Inline function 'kotlin.collections.map' call
|
|
2413
|
+
var this_0 = this.f1r_1.m2();
|
|
2414
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2415
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2416
|
+
var tmp0_iterator = this_0.r();
|
|
2417
|
+
while (tmp0_iterator.s()) {
|
|
2418
|
+
var item = tmp0_iterator.u();
|
|
2419
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.getIndexed.<anonymous>' call
|
|
2420
|
+
var tmp$ret$0 = item.l1p(clause);
|
|
2421
|
+
destination.o(tmp$ret$0);
|
|
2422
|
+
}
|
|
2423
|
+
tmp = tmp_0.n1o(destination);
|
|
2424
|
+
} else {
|
|
2425
|
+
var tmp0_safe_receiver = this.f1r_1.x2(nestedArity(clause, this));
|
|
2426
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.j1p(clause);
|
|
2427
|
+
tmp = tmp1_elvis_lhs == null ? emptySequence() : tmp1_elvis_lhs;
|
|
2428
|
+
}
|
|
2429
|
+
return tmp;
|
|
2430
|
+
};
|
|
2431
|
+
protoOf(FunctorIndexingNode).k1p = function (clause) {
|
|
2432
|
+
var tmp;
|
|
2433
|
+
if (isGlobal_1(clause, this)) {
|
|
2434
|
+
var tmp_0 = Utils_instance;
|
|
2435
|
+
// Inline function 'kotlin.collections.map' call
|
|
2436
|
+
var this_0 = this.f1r_1.m2();
|
|
2437
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2438
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2439
|
+
var tmp0_iterator = this_0.r();
|
|
2440
|
+
while (tmp0_iterator.s()) {
|
|
2441
|
+
var item = tmp0_iterator.u();
|
|
2442
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.retractAllIndexed.<anonymous>' call
|
|
2443
|
+
var tmp$ret$0 = item.l1p(clause);
|
|
2444
|
+
destination.o(tmp$ret$0);
|
|
2445
|
+
}
|
|
2446
|
+
var tmp_1 = tmp_0.n1o(destination);
|
|
2447
|
+
var partialResult = toList(filter(tmp_1, FunctorIndexingNode$retractAllIndexed$lambda(this, clause)));
|
|
2448
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
2449
|
+
if (!partialResult.z()) {
|
|
2450
|
+
this.v1n();
|
|
2451
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
2452
|
+
var tmp0_iterator_0 = partialResult.r();
|
|
2453
|
+
while (tmp0_iterator_0.s()) {
|
|
2454
|
+
var element = tmp0_iterator_0.u();
|
|
2455
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.retractAllIndexed.<anonymous>' call
|
|
2456
|
+
element.e1p();
|
|
2457
|
+
}
|
|
2458
|
+
}
|
|
2459
|
+
tmp = asSequence(partialResult);
|
|
2460
|
+
} else {
|
|
2461
|
+
var tmp0_safe_receiver = this.f1r_1.x2(nestedArity(clause, this));
|
|
2462
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.k1p(clause);
|
|
2463
|
+
tmp = tmp1_elvis_lhs == null ? emptySequence() : tmp1_elvis_lhs;
|
|
2464
|
+
}
|
|
2465
|
+
return tmp;
|
|
2466
|
+
};
|
|
2467
|
+
protoOf(FunctorIndexingNode).l1p = function (clause) {
|
|
2468
|
+
var tmp;
|
|
2469
|
+
if (this.d1r_1) {
|
|
2470
|
+
var tmp_0 = Utils_instance;
|
|
2471
|
+
// Inline function 'kotlin.collections.map' call
|
|
2472
|
+
var this_0 = this.f1r_1.m2();
|
|
2473
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2474
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2475
|
+
var tmp0_iterator = this_0.r();
|
|
2476
|
+
while (tmp0_iterator.s()) {
|
|
2477
|
+
var item = tmp0_iterator.u();
|
|
2478
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.extractGlobalIndexedSequence.<anonymous>' call
|
|
2479
|
+
var tmp$ret$0 = item.l1p(clause);
|
|
2480
|
+
destination.o(tmp$ret$0);
|
|
2481
|
+
}
|
|
2482
|
+
tmp = tmp_0.n1o(destination);
|
|
2483
|
+
} else {
|
|
2484
|
+
var tmp_1 = Utils_instance;
|
|
2485
|
+
// Inline function 'kotlin.collections.map' call
|
|
2486
|
+
var this_1 = this.f1r_1.m2();
|
|
2487
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2488
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
2489
|
+
var tmp0_iterator_0 = this_1.r();
|
|
2490
|
+
while (tmp0_iterator_0.s()) {
|
|
2491
|
+
var item_0 = tmp0_iterator_0.u();
|
|
2492
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.FunctorIndexingNode.extractGlobalIndexedSequence.<anonymous>' call
|
|
2493
|
+
var tmp$ret$3 = item_0.l1p(clause);
|
|
2494
|
+
destination_0.o(tmp$ret$3);
|
|
2495
|
+
}
|
|
2496
|
+
tmp = tmp_1.r1o(destination_0);
|
|
2497
|
+
}
|
|
2498
|
+
return tmp;
|
|
2499
|
+
};
|
|
2500
|
+
protoOf(FunctorIndexingNode).v1n = function () {
|
|
2501
|
+
this.g1r_1.vp();
|
|
2502
|
+
};
|
|
2503
|
+
function FunctorNode(unificator) {
|
|
2504
|
+
AbstractReteNode.call(this, unificator);
|
|
2505
|
+
}
|
|
2506
|
+
function assignHigherIndex($this, clause) {
|
|
2507
|
+
var tmp = Companion_instance_7;
|
|
2508
|
+
$this.n1r_1 = $this.n1r_1.qa();
|
|
2509
|
+
return tmp.a1p($this.n1r_1, clause, [$this]);
|
|
2510
|
+
}
|
|
2511
|
+
function assignLowerIndex($this, clause) {
|
|
2512
|
+
var tmp = Companion_instance_7;
|
|
2513
|
+
$this.m1r_1 = $this.m1r_1.ra();
|
|
2514
|
+
return tmp.a1p($this.m1r_1, clause, [$this]);
|
|
2515
|
+
}
|
|
2516
|
+
function regenerateCache_2($this) {
|
|
2517
|
+
var tmp;
|
|
2518
|
+
if ($this.i1r_1) {
|
|
2519
|
+
var tmp_0 = Utils_instance.m1o([$this.l1r_1.u1n(), $this.k1r_1.u1n()]);
|
|
2520
|
+
tmp = map(tmp_0, RootNode$regenerateCache$lambda);
|
|
2521
|
+
} else {
|
|
2522
|
+
var tmp_1 = Utils_instance;
|
|
2523
|
+
var tmp_2 = $this.l1r_1.u1n();
|
|
2524
|
+
var tmp_3 = map(tmp_2, RootNode$regenerateCache$lambda_0);
|
|
2525
|
+
var tmp_4 = $this.k1r_1.u1n();
|
|
2526
|
+
tmp = tmp_1.s1o([tmp_3, map(tmp_4, RootNode$regenerateCache$lambda_1)]);
|
|
2527
|
+
}
|
|
2528
|
+
return dequeOf_0(tmp);
|
|
2529
|
+
}
|
|
2530
|
+
function RootNode$regenerateCache$ref($boundThis) {
|
|
2531
|
+
var l = function () {
|
|
2532
|
+
return regenerateCache_2($boundThis);
|
|
2533
|
+
};
|
|
2534
|
+
l.callableName = 'regenerateCache';
|
|
2535
|
+
return l;
|
|
2536
|
+
}
|
|
2537
|
+
function RootNode$_get_directives_$lambda_9lfp1g(it) {
|
|
2538
|
+
return it.r2().castToDirective();
|
|
2539
|
+
}
|
|
2540
|
+
function RootNode$_get_rules_$lambda_py6utr(it) {
|
|
2541
|
+
return it.r2().castToRule();
|
|
2542
|
+
}
|
|
2543
|
+
function RootNode$assertA$lambda($clause) {
|
|
2544
|
+
return function (it) {
|
|
2545
|
+
addFirst(it, $clause);
|
|
2546
|
+
return Unit_instance;
|
|
2547
|
+
};
|
|
2548
|
+
}
|
|
2549
|
+
function RootNode$assertZ$lambda($clause) {
|
|
2550
|
+
return function (it) {
|
|
2551
|
+
return it.o($clause);
|
|
2552
|
+
};
|
|
2553
|
+
}
|
|
2554
|
+
function RootNode$regenerateCache$lambda(it) {
|
|
2555
|
+
return it.q1n();
|
|
2556
|
+
}
|
|
2557
|
+
function RootNode$regenerateCache$lambda_0(it) {
|
|
2558
|
+
return it.q1n();
|
|
2559
|
+
}
|
|
2560
|
+
function RootNode$regenerateCache$lambda_1(it) {
|
|
2561
|
+
return it.q1n();
|
|
2562
|
+
}
|
|
2563
|
+
function RootNode(unificator, clauses, isOrdered) {
|
|
2564
|
+
this.h1r_1 = unificator;
|
|
2565
|
+
this.i1r_1 = isOrdered;
|
|
2566
|
+
var tmp = this;
|
|
2567
|
+
var tmp_0 = Companion_instance_1;
|
|
2568
|
+
tmp.j1r_1 = tmp_0.tp(RootNode$regenerateCache$ref(this));
|
|
2569
|
+
this.k1r_1 = new RuleNode(this.h1r_1, this.i1r_1);
|
|
2570
|
+
this.l1r_1 = new DirectiveIndex(this.h1r_1, this.i1r_1);
|
|
2571
|
+
this.m1r_1 = new Long(0, 0);
|
|
2572
|
+
this.n1r_1 = new Long(0, 0);
|
|
2573
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
2574
|
+
var tmp0_iterator = clauses.r();
|
|
2575
|
+
while (tmp0_iterator.s()) {
|
|
2576
|
+
var element = tmp0_iterator.u();
|
|
2577
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.RootNode.<anonymous>' call
|
|
2578
|
+
this.y1l(element);
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
protoOf(RootNode).k1l = function () {
|
|
2582
|
+
return this.h1r_1;
|
|
2583
|
+
};
|
|
2584
|
+
protoOf(RootNode).t1m = function () {
|
|
2585
|
+
return this.i1r_1;
|
|
2586
|
+
};
|
|
2587
|
+
protoOf(RootNode).l = function () {
|
|
2588
|
+
return this.l1r_1.l() + this.k1r_1.l() | 0;
|
|
2589
|
+
};
|
|
2590
|
+
protoOf(RootNode).q1l = function () {
|
|
2591
|
+
return this.l1r_1.q1l() ? this.k1r_1.q1l() : false;
|
|
2592
|
+
};
|
|
2593
|
+
protoOf(RootNode).v1l = function () {
|
|
2594
|
+
return asSequence(this.j1r_1.r2());
|
|
2595
|
+
};
|
|
2596
|
+
protoOf(RootNode).o1l = function () {
|
|
2597
|
+
var tmp = this.l1r_1.u1n();
|
|
2598
|
+
return map(tmp, RootNode$_get_directives_$lambda_9lfp1g);
|
|
2599
|
+
};
|
|
2600
|
+
protoOf(RootNode).p1l = function () {
|
|
2601
|
+
var tmp = this.k1r_1.u1n();
|
|
2602
|
+
return map(tmp, RootNode$_get_rules_$lambda_py6utr);
|
|
2603
|
+
};
|
|
2604
|
+
protoOf(RootNode).t1l = function (clause) {
|
|
2605
|
+
var tmp;
|
|
2606
|
+
if (clause.ov()) {
|
|
2607
|
+
tmp = this.l1r_1.t1l(clause);
|
|
2608
|
+
} else {
|
|
2609
|
+
tmp = this.k1r_1.t1l(clause);
|
|
2610
|
+
}
|
|
2611
|
+
return tmp;
|
|
2612
|
+
};
|
|
2613
|
+
protoOf(RootNode).b1m = function (clause) {
|
|
2614
|
+
var tmp;
|
|
2615
|
+
if (clause.ov()) {
|
|
2616
|
+
tmp = this.l1r_1.b1m(clause);
|
|
2617
|
+
} else {
|
|
2618
|
+
tmp = this.k1r_1.b1m(clause);
|
|
2619
|
+
}
|
|
2620
|
+
return tmp;
|
|
2621
|
+
};
|
|
2622
|
+
protoOf(RootNode).d1m = function (clause) {
|
|
2623
|
+
var tmp;
|
|
2624
|
+
if (clause.ov()) {
|
|
2625
|
+
tmp = this.l1r_1.d1m(clause);
|
|
2626
|
+
} else {
|
|
2627
|
+
tmp = this.k1r_1.d1m(clause);
|
|
2628
|
+
}
|
|
2629
|
+
return tmp;
|
|
2630
|
+
};
|
|
2631
|
+
protoOf(RootNode).g1m = function () {
|
|
2632
|
+
return new RootNode(this.h1r_1, asIterable(this.v1l()), this.i1r_1);
|
|
2633
|
+
};
|
|
2634
|
+
protoOf(RootNode).x1m = function (clause) {
|
|
2635
|
+
var indexed = assignLowerIndex(this, clause);
|
|
2636
|
+
if (this.i1r_1) {
|
|
2637
|
+
this.j1r_1.wp(RootNode$assertA$lambda(clause));
|
|
2638
|
+
if (clause.ov()) {
|
|
2639
|
+
this.l1r_1.s1n(indexed);
|
|
2640
|
+
} else {
|
|
2641
|
+
this.k1r_1.s1n(indexed);
|
|
2642
|
+
}
|
|
2643
|
+
} else {
|
|
2644
|
+
throw UnsupportedOperationException_init_$Create$('An unordered ReteTree cannot perform the assertA operation.');
|
|
2645
|
+
}
|
|
2646
|
+
};
|
|
2647
|
+
protoOf(RootNode).y1l = function (clause) {
|
|
2648
|
+
var indexed = assignHigherIndex(this, clause);
|
|
2649
|
+
this.j1r_1.wp(RootNode$assertZ$lambda(clause));
|
|
2650
|
+
if (clause.ov()) {
|
|
2651
|
+
this.l1r_1.t1n(indexed);
|
|
2652
|
+
} else {
|
|
2653
|
+
this.k1r_1.t1n(indexed);
|
|
2654
|
+
}
|
|
2655
|
+
};
|
|
2656
|
+
protoOf(RootNode).v1n = function () {
|
|
2657
|
+
this.j1r_1.vp();
|
|
2658
|
+
};
|
|
2659
|
+
function nestedFunctor_1(_this__u8e3s4, $this) {
|
|
2660
|
+
return Utils_instance.k1o(ensureNotNull(_this__u8e3s4.lx()), 0);
|
|
2661
|
+
}
|
|
2662
|
+
function nestedFunctor_2(_this__u8e3s4, $this) {
|
|
2663
|
+
return nestedFunctor_1(_this__u8e3s4.q1n(), $this);
|
|
2664
|
+
}
|
|
2665
|
+
function regenerateCache_3($this) {
|
|
2666
|
+
var tmp;
|
|
2667
|
+
if ($this.p1r_1) {
|
|
2668
|
+
var tmp_0 = Utils_instance;
|
|
2669
|
+
// Inline function 'kotlin.collections.map' call
|
|
2670
|
+
var this_0 = $this.q1r_1.m2();
|
|
2671
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2672
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2673
|
+
var tmp0_iterator = this_0.r();
|
|
2674
|
+
while (tmp0_iterator.s()) {
|
|
2675
|
+
var item = tmp0_iterator.u();
|
|
2676
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.RuleNode.regenerateCache.<anonymous>' call
|
|
2677
|
+
var tmp$ret$0 = item.u1n();
|
|
2678
|
+
destination.o(tmp$ret$0);
|
|
2679
|
+
}
|
|
2680
|
+
tmp = tmp_0.n1o(destination);
|
|
2681
|
+
} else {
|
|
2682
|
+
var tmp_1 = Utils_instance;
|
|
2683
|
+
// Inline function 'kotlin.collections.map' call
|
|
2684
|
+
var this_1 = $this.q1r_1.m2();
|
|
2685
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2686
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
2687
|
+
var tmp0_iterator_0 = this_1.r();
|
|
2688
|
+
while (tmp0_iterator_0.s()) {
|
|
2689
|
+
var item_0 = tmp0_iterator_0.u();
|
|
2690
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.RuleNode.regenerateCache.<anonymous>' call
|
|
2691
|
+
var tmp$ret$3 = item_0.u1n();
|
|
2692
|
+
destination_0.o(tmp$ret$3);
|
|
2693
|
+
}
|
|
2694
|
+
tmp = tmp_1.r1o(destination_0);
|
|
2695
|
+
}
|
|
2696
|
+
return dequeOf_0(tmp);
|
|
2697
|
+
}
|
|
2698
|
+
function RuleNode$regenerateCache$ref($boundThis) {
|
|
2699
|
+
var l = function () {
|
|
2700
|
+
return regenerateCache_3($boundThis);
|
|
2701
|
+
};
|
|
2702
|
+
l.callableName = 'regenerateCache';
|
|
2703
|
+
return l;
|
|
2704
|
+
}
|
|
2705
|
+
function RuleNode$_get_size_$lambda_xjenvf(it) {
|
|
2706
|
+
return it.l();
|
|
2707
|
+
}
|
|
2708
|
+
function RuleNode(unificator, ordered) {
|
|
2709
|
+
this.o1r_1 = unificator;
|
|
2710
|
+
this.p1r_1 = ordered;
|
|
2711
|
+
var tmp = this;
|
|
2712
|
+
// Inline function 'kotlin.collections.mutableMapOf' call
|
|
2713
|
+
tmp.q1r_1 = LinkedHashMap_init_$Create$();
|
|
2714
|
+
var tmp_0 = this;
|
|
2715
|
+
var tmp_1 = Companion_instance_1;
|
|
2716
|
+
tmp_0.r1r_1 = tmp_1.tp(RuleNode$regenerateCache$ref(this));
|
|
2717
|
+
}
|
|
2718
|
+
protoOf(RuleNode).t1l = function (clause) {
|
|
2719
|
+
var tmp0_safe_receiver = this.q1r_1.x2(nestedFunctor_1(clause, this));
|
|
2720
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.t1l(clause);
|
|
2721
|
+
return tmp1_elvis_lhs == null ? emptySequence() : tmp1_elvis_lhs;
|
|
2722
|
+
};
|
|
2723
|
+
protoOf(RuleNode).s1n = function (clause) {
|
|
2724
|
+
// Inline function 'kotlin.let' call
|
|
2725
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2726
|
+
var it = nestedFunctor_2(clause, this);
|
|
2727
|
+
var tmp;
|
|
2728
|
+
if (this.p1r_1) {
|
|
2729
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
2730
|
+
var this_0 = this.q1r_1;
|
|
2731
|
+
var value = this_0.x2(it);
|
|
2732
|
+
var tmp_0;
|
|
2733
|
+
if (value == null) {
|
|
2734
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.RuleNode.assertA.<anonymous>.<anonymous>' call
|
|
2735
|
+
var answer = new TopLevelFunctorReteNode(this.o1r_1, this.p1r_1, 0);
|
|
2736
|
+
this_0.o2(it, answer);
|
|
2737
|
+
tmp_0 = answer;
|
|
2738
|
+
} else {
|
|
2739
|
+
tmp_0 = value;
|
|
2740
|
+
}
|
|
2741
|
+
tmp_0.s1n(clause.y1o(this));
|
|
2742
|
+
tmp = Unit_instance;
|
|
2743
|
+
} else {
|
|
2744
|
+
this.t1n(clause);
|
|
2745
|
+
tmp = Unit_instance;
|
|
2746
|
+
}
|
|
2747
|
+
};
|
|
2748
|
+
protoOf(RuleNode).t1n = function (clause) {
|
|
2749
|
+
// Inline function 'kotlin.let' call
|
|
2750
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2751
|
+
var it = nestedFunctor_2(clause, this);
|
|
2752
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
2753
|
+
var this_0 = this.q1r_1;
|
|
2754
|
+
var value = this_0.x2(it);
|
|
2755
|
+
var tmp;
|
|
2756
|
+
if (value == null) {
|
|
2757
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.RuleNode.assertZ.<anonymous>.<anonymous>' call
|
|
2758
|
+
var answer = new TopLevelFunctorReteNode(this.o1r_1, this.p1r_1, 0);
|
|
2759
|
+
this_0.o2(it, answer);
|
|
2760
|
+
tmp = answer;
|
|
2761
|
+
} else {
|
|
2762
|
+
tmp = value;
|
|
2763
|
+
}
|
|
2764
|
+
tmp.t1n(clause.y1o(this));
|
|
2765
|
+
};
|
|
2766
|
+
protoOf(RuleNode).b1m = function (clause) {
|
|
2767
|
+
var tmp0_safe_receiver = this.q1r_1.x2(nestedFunctor_1(clause, this));
|
|
2768
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.b1m(clause);
|
|
2769
|
+
return tmp1_elvis_lhs == null ? emptySequence() : tmp1_elvis_lhs;
|
|
2770
|
+
};
|
|
2771
|
+
protoOf(RuleNode).l = function () {
|
|
2772
|
+
var tmp = asSequence(this.q1r_1.m2());
|
|
2773
|
+
return sum(map(tmp, RuleNode$_get_size_$lambda_xjenvf));
|
|
2774
|
+
};
|
|
2775
|
+
protoOf(RuleNode).q1l = function () {
|
|
2776
|
+
var tmp;
|
|
2777
|
+
if (this.q1r_1.z()) {
|
|
2778
|
+
tmp = true;
|
|
2779
|
+
} else {
|
|
2780
|
+
var tmp$ret$0;
|
|
2781
|
+
$l$block_0: {
|
|
2782
|
+
// Inline function 'kotlin.collections.all' call
|
|
2783
|
+
var this_0 = this.q1r_1.m2();
|
|
2784
|
+
var tmp_0;
|
|
2785
|
+
if (isInterface(this_0, Collection)) {
|
|
2786
|
+
tmp_0 = this_0.z();
|
|
2787
|
+
} else {
|
|
2788
|
+
tmp_0 = false;
|
|
2789
|
+
}
|
|
2790
|
+
if (tmp_0) {
|
|
2791
|
+
tmp$ret$0 = true;
|
|
2792
|
+
break $l$block_0;
|
|
2793
|
+
}
|
|
2794
|
+
var tmp0_iterator = this_0.r();
|
|
2795
|
+
while (tmp0_iterator.s()) {
|
|
2796
|
+
var element = tmp0_iterator.u();
|
|
2797
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.RuleNode.<get-isEmpty>.<anonymous>' call
|
|
2798
|
+
if (!element.q1l()) {
|
|
2799
|
+
tmp$ret$0 = false;
|
|
2800
|
+
break $l$block_0;
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
tmp$ret$0 = true;
|
|
2804
|
+
}
|
|
2805
|
+
tmp = tmp$ret$0;
|
|
2806
|
+
}
|
|
2807
|
+
return tmp;
|
|
2808
|
+
};
|
|
2809
|
+
protoOf(RuleNode).d1m = function (clause) {
|
|
2810
|
+
var tmp0_safe_receiver = this.q1r_1.x2(nestedFunctor_1(clause, this));
|
|
2811
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.d1m(clause);
|
|
2812
|
+
return tmp1_elvis_lhs == null ? emptySequence() : tmp1_elvis_lhs;
|
|
2813
|
+
};
|
|
2814
|
+
protoOf(RuleNode).u1n = function () {
|
|
2815
|
+
return asSequence(this.r1r_1.r2());
|
|
2816
|
+
};
|
|
2817
|
+
protoOf(RuleNode).v1n = function () {
|
|
2818
|
+
this.r1r_1.vp();
|
|
2819
|
+
};
|
|
2820
|
+
function selectArity($this, clause) {
|
|
2821
|
+
return $this.v1r_1.x2(Utils_instance.j1o(ensureNotNull(clause.lx()), $this.u1r_1));
|
|
2822
|
+
}
|
|
2823
|
+
function chooseAssertionBranch($this, clause, op) {
|
|
2824
|
+
// Inline function 'kotlin.let' call
|
|
2825
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2826
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.TopLevelFunctorReteNode.chooseAssertionBranch.<anonymous>' call
|
|
2827
|
+
var it = Utils_instance.j1o(ensureNotNull(clause.q1n().lx()), $this.u1r_1);
|
|
2828
|
+
var tmp;
|
|
2829
|
+
if (it === 0) {
|
|
2830
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
2831
|
+
var this_0 = $this.v1r_1;
|
|
2832
|
+
var value = this_0.x2(it);
|
|
2833
|
+
var tmp_0;
|
|
2834
|
+
if (value == null) {
|
|
2835
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.TopLevelFunctorReteNode.chooseAssertionBranch.<anonymous>.<anonymous>' call
|
|
2836
|
+
var answer = new ZeroArityReteNode($this.k1l(), $this.t1r_1);
|
|
2837
|
+
this_0.o2(it, answer);
|
|
2838
|
+
tmp_0 = answer;
|
|
2839
|
+
} else {
|
|
2840
|
+
tmp_0 = value;
|
|
2841
|
+
}
|
|
2842
|
+
tmp = tmp_0;
|
|
2843
|
+
} else {
|
|
2844
|
+
// Inline function 'kotlin.collections.getOrPut' call
|
|
2845
|
+
var this_1 = $this.v1r_1;
|
|
2846
|
+
var value_0 = this_1.x2(it);
|
|
2847
|
+
var tmp_1;
|
|
2848
|
+
if (value_0 == null) {
|
|
2849
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.TopLevelFunctorReteNode.chooseAssertionBranch.<anonymous>.<anonymous>' call
|
|
2850
|
+
var answer_0 = new FamilyArityReteNode($this.k1l(), $this.t1r_1, $this.u1r_1);
|
|
2851
|
+
this_1.o2(it, answer_0);
|
|
2852
|
+
tmp_1 = answer_0;
|
|
2853
|
+
} else {
|
|
2854
|
+
tmp_1 = value_0;
|
|
2855
|
+
}
|
|
2856
|
+
tmp = tmp_1;
|
|
2857
|
+
}
|
|
2858
|
+
op(tmp, clause);
|
|
2859
|
+
}
|
|
2860
|
+
function regenerateCache_4($this) {
|
|
2861
|
+
var tmp;
|
|
2862
|
+
if ($this.t1r_1) {
|
|
2863
|
+
var tmp_0 = Utils_instance;
|
|
2864
|
+
// Inline function 'kotlin.collections.map' call
|
|
2865
|
+
var this_0 = $this.v1r_1.m2();
|
|
2866
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2867
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2868
|
+
var tmp0_iterator = this_0.r();
|
|
2869
|
+
while (tmp0_iterator.s()) {
|
|
2870
|
+
var item = tmp0_iterator.u();
|
|
2871
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.TopLevelFunctorReteNode.regenerateCache.<anonymous>' call
|
|
2872
|
+
var tmp$ret$0 = item.u1n();
|
|
2873
|
+
destination.o(tmp$ret$0);
|
|
2874
|
+
}
|
|
2875
|
+
tmp = tmp_0.n1o(destination);
|
|
2876
|
+
} else {
|
|
2877
|
+
var tmp_1 = Utils_instance;
|
|
2878
|
+
// Inline function 'kotlin.collections.map' call
|
|
2879
|
+
var this_1 = $this.v1r_1.m2();
|
|
2880
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2881
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
2882
|
+
var tmp0_iterator_0 = this_1.r();
|
|
2883
|
+
while (tmp0_iterator_0.s()) {
|
|
2884
|
+
var item_0 = tmp0_iterator_0.u();
|
|
2885
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.TopLevelFunctorReteNode.regenerateCache.<anonymous>' call
|
|
2886
|
+
var tmp$ret$3 = item_0.u1n();
|
|
2887
|
+
destination_0.o(tmp$ret$3);
|
|
2888
|
+
}
|
|
2889
|
+
tmp = tmp_1.r1o(destination_0);
|
|
2890
|
+
}
|
|
2891
|
+
return dequeOf_0(tmp);
|
|
2892
|
+
}
|
|
2893
|
+
function TopLevelFunctorReteNode$regenerateCache$ref($boundThis) {
|
|
2894
|
+
var l = function () {
|
|
2895
|
+
return regenerateCache_4($boundThis);
|
|
2896
|
+
};
|
|
2897
|
+
l.callableName = 'regenerateCache';
|
|
2898
|
+
return l;
|
|
2899
|
+
}
|
|
2900
|
+
function TopLevelFunctorReteNode$_get_size_$lambda_6i36rr(it) {
|
|
2901
|
+
return it.l();
|
|
2902
|
+
}
|
|
2903
|
+
function ReteNode$assertA$ref() {
|
|
2904
|
+
var l = function (p0, p1) {
|
|
2905
|
+
p0.s1n(p1);
|
|
2906
|
+
return Unit_instance;
|
|
2907
|
+
};
|
|
2908
|
+
l.callableName = 'assertA';
|
|
2909
|
+
return l;
|
|
2910
|
+
}
|
|
2911
|
+
function ReteNode$assertZ$ref() {
|
|
2912
|
+
var l = function (p0, p1) {
|
|
2913
|
+
p0.t1n(p1);
|
|
2914
|
+
return Unit_instance;
|
|
2915
|
+
};
|
|
2916
|
+
l.callableName = 'assertZ';
|
|
2917
|
+
return l;
|
|
2918
|
+
}
|
|
2919
|
+
function TopLevelFunctorReteNode(unificator, ordered, nestingLevel) {
|
|
2920
|
+
FunctorNode.call(this, unificator);
|
|
2921
|
+
this.t1r_1 = ordered;
|
|
2922
|
+
this.u1r_1 = nestingLevel;
|
|
2923
|
+
var tmp = this;
|
|
2924
|
+
// Inline function 'kotlin.collections.mutableMapOf' call
|
|
2925
|
+
tmp.v1r_1 = LinkedHashMap_init_$Create$();
|
|
2926
|
+
var tmp_0 = this;
|
|
2927
|
+
var tmp_1 = Companion_instance_1;
|
|
2928
|
+
tmp_0.w1r_1 = tmp_1.tp(TopLevelFunctorReteNode$regenerateCache$ref(this));
|
|
2929
|
+
}
|
|
2930
|
+
protoOf(TopLevelFunctorReteNode).l = function () {
|
|
2931
|
+
var tmp = asSequence(this.v1r_1.m2());
|
|
2932
|
+
return sum(map(tmp, TopLevelFunctorReteNode$_get_size_$lambda_6i36rr));
|
|
2933
|
+
};
|
|
2934
|
+
protoOf(TopLevelFunctorReteNode).q1l = function () {
|
|
2935
|
+
var tmp;
|
|
2936
|
+
if (this.v1r_1.z()) {
|
|
2937
|
+
tmp = true;
|
|
2938
|
+
} else {
|
|
2939
|
+
var tmp$ret$0;
|
|
2940
|
+
$l$block_0: {
|
|
2941
|
+
// Inline function 'kotlin.collections.all' call
|
|
2942
|
+
var this_0 = this.v1r_1.m2();
|
|
2943
|
+
var tmp_0;
|
|
2944
|
+
if (isInterface(this_0, Collection)) {
|
|
2945
|
+
tmp_0 = this_0.z();
|
|
2946
|
+
} else {
|
|
2947
|
+
tmp_0 = false;
|
|
2948
|
+
}
|
|
2949
|
+
if (tmp_0) {
|
|
2950
|
+
tmp$ret$0 = true;
|
|
2951
|
+
break $l$block_0;
|
|
2952
|
+
}
|
|
2953
|
+
var tmp0_iterator = this_0.r();
|
|
2954
|
+
while (tmp0_iterator.s()) {
|
|
2955
|
+
var element = tmp0_iterator.u();
|
|
2956
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.custom.nodes.TopLevelFunctorReteNode.<get-isEmpty>.<anonymous>' call
|
|
2957
|
+
if (!element.q1l()) {
|
|
2958
|
+
tmp$ret$0 = false;
|
|
2959
|
+
break $l$block_0;
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
tmp$ret$0 = true;
|
|
2963
|
+
}
|
|
2964
|
+
tmp = tmp$ret$0;
|
|
2965
|
+
}
|
|
2966
|
+
return tmp;
|
|
2967
|
+
};
|
|
2968
|
+
protoOf(TopLevelFunctorReteNode).t1l = function (clause) {
|
|
2969
|
+
var tmp0_safe_receiver = selectArity(this, clause);
|
|
2970
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.t1l(clause);
|
|
2971
|
+
return tmp1_elvis_lhs == null ? emptySequence() : tmp1_elvis_lhs;
|
|
2972
|
+
};
|
|
2973
|
+
protoOf(TopLevelFunctorReteNode).s1n = function (clause) {
|
|
2974
|
+
var tmp = clause.y1o(this);
|
|
2975
|
+
chooseAssertionBranch(this, tmp, ReteNode$assertA$ref());
|
|
2976
|
+
};
|
|
2977
|
+
protoOf(TopLevelFunctorReteNode).t1n = function (clause) {
|
|
2978
|
+
var tmp = clause.y1o(this);
|
|
2979
|
+
chooseAssertionBranch(this, tmp, ReteNode$assertZ$ref());
|
|
2980
|
+
};
|
|
2981
|
+
protoOf(TopLevelFunctorReteNode).b1m = function (clause) {
|
|
2982
|
+
var tmp0_safe_receiver = selectArity(this, clause);
|
|
2983
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.b1m(clause);
|
|
2984
|
+
return tmp1_elvis_lhs == null ? emptySequence() : tmp1_elvis_lhs;
|
|
2985
|
+
};
|
|
2986
|
+
protoOf(TopLevelFunctorReteNode).d1m = function (clause) {
|
|
2987
|
+
var tmp0_safe_receiver = selectArity(this, clause);
|
|
2988
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.d1m(clause);
|
|
2989
|
+
return tmp1_elvis_lhs == null ? emptySequence() : tmp1_elvis_lhs;
|
|
2990
|
+
};
|
|
2991
|
+
protoOf(TopLevelFunctorReteNode).u1n = function () {
|
|
2992
|
+
return asSequence(this.w1r_1.r2());
|
|
2993
|
+
};
|
|
2994
|
+
protoOf(TopLevelFunctorReteNode).v1n = function () {
|
|
2995
|
+
this.w1r_1.vp();
|
|
2996
|
+
};
|
|
2997
|
+
function ZeroArityReteNode$retractFirst$lambda(it) {
|
|
2998
|
+
return it.q1n();
|
|
2999
|
+
}
|
|
3000
|
+
function ZeroArityReteNode$get$lambda(this$0, $clause) {
|
|
3001
|
+
return function (it) {
|
|
3002
|
+
return this$0.k1l().match(it.q1n(), $clause);
|
|
3003
|
+
};
|
|
3004
|
+
}
|
|
3005
|
+
function ZeroArityReteNode$get$lambda_0(it) {
|
|
3006
|
+
return it.q1n();
|
|
3007
|
+
}
|
|
3008
|
+
function ZeroArityReteNode$retractAll$lambda(it) {
|
|
3009
|
+
return it.q1n();
|
|
3010
|
+
}
|
|
3011
|
+
function ZeroArityReteNode(unificator, ordered) {
|
|
3012
|
+
ArityNode.call(this, unificator);
|
|
3013
|
+
this.y1r_1 = ordered;
|
|
3014
|
+
this.z1r_1 = dequeOf([]);
|
|
3015
|
+
}
|
|
3016
|
+
protoOf(ZeroArityReteNode).b1m = function (clause) {
|
|
3017
|
+
var tmp = this.r1n(this.z1r_1, clause);
|
|
3018
|
+
return buffered(take(map(tmp, ZeroArityReteNode$retractFirst$lambda), 1));
|
|
3019
|
+
};
|
|
3020
|
+
protoOf(ZeroArityReteNode).l = function () {
|
|
3021
|
+
return this.z1r_1.l();
|
|
3022
|
+
};
|
|
3023
|
+
protoOf(ZeroArityReteNode).q1l = function () {
|
|
3024
|
+
return this.z1r_1.z();
|
|
3025
|
+
};
|
|
3026
|
+
protoOf(ZeroArityReteNode).t1l = function (clause) {
|
|
3027
|
+
var tmp = asSequence(this.z1r_1);
|
|
3028
|
+
var tmp_0 = filter(tmp, ZeroArityReteNode$get$lambda(this, clause));
|
|
3029
|
+
return map(tmp_0, ZeroArityReteNode$get$lambda_0);
|
|
3030
|
+
};
|
|
3031
|
+
protoOf(ZeroArityReteNode).s1n = function (clause) {
|
|
3032
|
+
if (this.y1r_1) {
|
|
3033
|
+
addFirst(this.z1r_1, Companion_instance_8.g1p(clause.y1o(this), this));
|
|
3034
|
+
} else {
|
|
3035
|
+
this.t1n(clause);
|
|
3036
|
+
}
|
|
3037
|
+
};
|
|
3038
|
+
protoOf(ZeroArityReteNode).t1n = function (clause) {
|
|
3039
|
+
this.z1r_1.o(Companion_instance_8.g1p(clause.y1o(this), this));
|
|
3040
|
+
};
|
|
3041
|
+
protoOf(ZeroArityReteNode).d1m = function (clause) {
|
|
3042
|
+
var tmp = this.r1n(this.z1r_1, clause);
|
|
3043
|
+
return buffered(map(tmp, ZeroArityReteNode$retractAll$lambda));
|
|
3044
|
+
};
|
|
3045
|
+
protoOf(ZeroArityReteNode).u1n = function () {
|
|
3046
|
+
return asSequence(this.z1r_1);
|
|
3047
|
+
};
|
|
3048
|
+
protoOf(ZeroArityReteNode).v1n = function () {
|
|
3049
|
+
};
|
|
3050
|
+
protoOf(ZeroArityReteNode).f1p = function (indexed) {
|
|
3051
|
+
this.z1r_1.p(indexed);
|
|
3052
|
+
};
|
|
3053
|
+
function AbstractTheory$get$lambda(it) {
|
|
3054
|
+
return it.castToRule();
|
|
3055
|
+
}
|
|
3056
|
+
function AbstractTheory$get$lambda_0(it) {
|
|
3057
|
+
return it.castToRule();
|
|
3058
|
+
}
|
|
3059
|
+
function AbstractTheory(tags) {
|
|
3060
|
+
this.a1s_1 = tags;
|
|
3061
|
+
}
|
|
3062
|
+
protoOf(AbstractTheory).us = function () {
|
|
3063
|
+
return this.a1s_1;
|
|
3064
|
+
};
|
|
3065
|
+
protoOf(AbstractTheory).b1s = function () {
|
|
3066
|
+
return this;
|
|
3067
|
+
};
|
|
3068
|
+
protoOf(AbstractTheory).toImmutableTheory = function () {
|
|
3069
|
+
return this.b1s();
|
|
3070
|
+
};
|
|
3071
|
+
protoOf(AbstractTheory).c1s = function (clause) {
|
|
3072
|
+
return plus_2.call(this, TheoryUtils_instance.h1m(clause));
|
|
3073
|
+
};
|
|
3074
|
+
protoOf(AbstractTheory).plus = function (clause) {
|
|
3075
|
+
return this.c1s(clause);
|
|
3076
|
+
};
|
|
3077
|
+
protoOf(AbstractTheory).s1l = function (clause) {
|
|
3078
|
+
return any(this.get(clause));
|
|
3079
|
+
};
|
|
3080
|
+
protoOf(AbstractTheory).contains = function (clause) {
|
|
3081
|
+
return this.s1l(clause);
|
|
3082
|
+
};
|
|
3083
|
+
protoOf(AbstractTheory).d1s = function (head) {
|
|
3084
|
+
return this.s1l(Companion_instance_2.of(head, [Companion_getInstance().anonymous()]));
|
|
3085
|
+
};
|
|
3086
|
+
protoOf(AbstractTheory).containsHead = function (head) {
|
|
3087
|
+
return this.d1s(head);
|
|
3088
|
+
};
|
|
3089
|
+
protoOf(AbstractTheory).e1s = function (indicator) {
|
|
3090
|
+
return any(this.f1s(indicator));
|
|
3091
|
+
};
|
|
3092
|
+
protoOf(AbstractTheory).containsIndicator = function (indicator) {
|
|
3093
|
+
return this.e1s(indicator);
|
|
3094
|
+
};
|
|
3095
|
+
protoOf(AbstractTheory).g1s = function (head) {
|
|
3096
|
+
var tmp = this.get(Companion_instance_2.of(head, [Companion_getInstance().anonymous()]));
|
|
3097
|
+
return map(tmp, AbstractTheory$get$lambda);
|
|
3098
|
+
};
|
|
3099
|
+
protoOf(AbstractTheory).getByHead = function (head) {
|
|
3100
|
+
return this.g1s(head);
|
|
3101
|
+
};
|
|
3102
|
+
protoOf(AbstractTheory).f1s = function (indicator) {
|
|
3103
|
+
// Inline function 'kotlin.require' call
|
|
3104
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
3105
|
+
if (!indicator.vx()) {
|
|
3106
|
+
// Inline function 'it.unibo.tuprolog.theory.AbstractTheory.get.<anonymous>' call
|
|
3107
|
+
var message = 'The provided indicator is not well formed: ' + indicator;
|
|
3108
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
3109
|
+
}
|
|
3110
|
+
var tmp = Companion_instance_2;
|
|
3111
|
+
var tmp_0 = Companion_getInstance_0();
|
|
3112
|
+
var tmp_1 = ensureNotNull(indicator.oz());
|
|
3113
|
+
// Inline function 'kotlin.collections.map' call
|
|
3114
|
+
var this_0 = numberRangeToNumber(1, ensureNotNull(indicator.pz()));
|
|
3115
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
3116
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
3117
|
+
var tmp0_iterator = this_0.r();
|
|
3118
|
+
while (tmp0_iterator.s()) {
|
|
3119
|
+
var item = tmp0_iterator.u();
|
|
3120
|
+
// Inline function 'it.unibo.tuprolog.theory.AbstractTheory.get.<anonymous>' call
|
|
3121
|
+
var tmp$ret$1 = Companion_getInstance().anonymous();
|
|
3122
|
+
destination.o(tmp$ret$1);
|
|
3123
|
+
}
|
|
3124
|
+
var tmp_2 = this.get(tmp.of(tmp_0.ofList(tmp_1, destination), [Companion_getInstance().anonymous()]));
|
|
3125
|
+
return map(tmp_2, AbstractTheory$get$lambda_0);
|
|
3126
|
+
};
|
|
3127
|
+
protoOf(AbstractTheory).getByIndicator = function (indicator) {
|
|
3128
|
+
return this.f1s(indicator);
|
|
3129
|
+
};
|
|
3130
|
+
protoOf(AbstractTheory).h1s = function (indicator) {
|
|
3131
|
+
// Inline function 'kotlin.require' call
|
|
3132
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
3133
|
+
if (!indicator.vx()) {
|
|
3134
|
+
// Inline function 'it.unibo.tuprolog.theory.AbstractTheory.abolish.<anonymous>' call
|
|
3135
|
+
var message = 'The provided indicator is not well formed: ' + indicator;
|
|
3136
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
3137
|
+
}
|
|
3138
|
+
return this.retractAllByHead(Companion_getInstance_0().template(ensureNotNull(indicator.oz()), ensureNotNull(indicator.pz()))).i1s();
|
|
3139
|
+
};
|
|
3140
|
+
protoOf(AbstractTheory).abolish = function (indicator) {
|
|
3141
|
+
return this.h1s(indicator);
|
|
3142
|
+
};
|
|
3143
|
+
protoOf(AbstractTheory).toString = function () {
|
|
3144
|
+
return '' + getKClassFromExpression(this).o6() + '{ ' + joinToString(this.v1l(), '. ') + ' }';
|
|
3145
|
+
};
|
|
3146
|
+
protoOf(AbstractTheory).j1s = function (asPrologText) {
|
|
3147
|
+
var tmp;
|
|
3148
|
+
if (asPrologText) {
|
|
3149
|
+
tmp = joinToString(this.v1l(), '.\n', '', '.\n');
|
|
3150
|
+
} else {
|
|
3151
|
+
tmp = this.toString();
|
|
3152
|
+
}
|
|
3153
|
+
return tmp;
|
|
3154
|
+
};
|
|
3155
|
+
protoOf(AbstractTheory).toStringAsProlog = function (asPrologText) {
|
|
3156
|
+
return this.j1s(asPrologText);
|
|
3157
|
+
};
|
|
3158
|
+
protoOf(AbstractTheory).r = function () {
|
|
3159
|
+
return this.v1l().r();
|
|
3160
|
+
};
|
|
3161
|
+
protoOf(AbstractTheory).equals = function (other) {
|
|
3162
|
+
if (other == null)
|
|
3163
|
+
return false;
|
|
3164
|
+
if (!(!(other == null) ? isInterface(other, Theory) : false))
|
|
3165
|
+
return false;
|
|
3166
|
+
return this.k1s(other, true);
|
|
3167
|
+
};
|
|
3168
|
+
protoOf(AbstractTheory).k1s = function (other, useVarCompleteName) {
|
|
3169
|
+
if (this === other)
|
|
3170
|
+
return true;
|
|
3171
|
+
var i = this.v1l().r();
|
|
3172
|
+
var j = other.v1l().r();
|
|
3173
|
+
while (i.s() ? j.s() : false) {
|
|
3174
|
+
if (!i.u().equalsUsingVarCompleteNames(j.u(), useVarCompleteName)) {
|
|
3175
|
+
return false;
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
return i.s() === j.s();
|
|
3179
|
+
};
|
|
3180
|
+
protoOf(AbstractTheory).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
3181
|
+
return this.k1s(other, useVarCompleteName);
|
|
3182
|
+
};
|
|
3183
|
+
protoOf(AbstractTheory).hashCode = function () {
|
|
3184
|
+
// Inline function 'kotlin.hashCode' call
|
|
3185
|
+
var tmp0_safe_receiver = getKClass(AbstractTheory).o6();
|
|
3186
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : hashCode(tmp0_safe_receiver);
|
|
3187
|
+
var base = tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs;
|
|
3188
|
+
var result = base ^ (base >>> 32 | 0);
|
|
3189
|
+
var tmp0_iterator = this.v1l().r();
|
|
3190
|
+
while (tmp0_iterator.s()) {
|
|
3191
|
+
var clause = tmp0_iterator.u();
|
|
3192
|
+
result = imul(31, result) + clause.hashCode() | 0;
|
|
3193
|
+
}
|
|
3194
|
+
return result;
|
|
3195
|
+
};
|
|
3196
|
+
protoOf(AbstractTheory).l = function () {
|
|
3197
|
+
var i = new Long(0, 0);
|
|
3198
|
+
var iter = this.r();
|
|
3199
|
+
while (iter.s()) {
|
|
3200
|
+
iter.u();
|
|
3201
|
+
i = i.qa();
|
|
3202
|
+
}
|
|
3203
|
+
return i;
|
|
3204
|
+
};
|
|
3205
|
+
protoOf(AbstractTheory).q1l = function () {
|
|
3206
|
+
return !this.l1s();
|
|
3207
|
+
};
|
|
3208
|
+
protoOf(AbstractTheory).l1s = function () {
|
|
3209
|
+
return this.r().s();
|
|
3210
|
+
};
|
|
3211
|
+
protoOf(AbstractTheory).m1s = function (unificator) {
|
|
3212
|
+
var tmp;
|
|
3213
|
+
if (!equals(unificator, this.k1l())) {
|
|
3214
|
+
tmp = this.n1s(asSequence(this.v1l()), VOID, unificator);
|
|
3215
|
+
} else {
|
|
3216
|
+
tmp = this;
|
|
3217
|
+
}
|
|
3218
|
+
return tmp;
|
|
3219
|
+
};
|
|
3220
|
+
protoOf(AbstractTheory).setUnificator = function (unificator) {
|
|
3221
|
+
return this.m1s(unificator);
|
|
3222
|
+
};
|
|
3223
|
+
protoOf(AbstractTheory).o1s = function (theory) {
|
|
3224
|
+
var tmp;
|
|
3225
|
+
if (theory.l1s()) {
|
|
3226
|
+
tmp = this.n1s(plus_0(asSequence(this.v1l()), TheoryUtils_instance.p1s(asSequence(theory.v1l()))));
|
|
3227
|
+
} else {
|
|
3228
|
+
tmp = this;
|
|
3229
|
+
}
|
|
3230
|
+
return tmp;
|
|
3231
|
+
};
|
|
3232
|
+
protoOf(AbstractTheory).plusTheory = function (theory) {
|
|
3233
|
+
return this.o1s(theory);
|
|
3234
|
+
};
|
|
3235
|
+
protoOf(AbstractTheory).q1s = function (clause) {
|
|
3236
|
+
return this.n1s(plus_0(TheoryUtils_instance.r1s([clause]), asSequence(this.v1l())));
|
|
3237
|
+
};
|
|
3238
|
+
protoOf(AbstractTheory).assertA = function (clause) {
|
|
3239
|
+
return this.q1s(clause);
|
|
3240
|
+
};
|
|
3241
|
+
protoOf(AbstractTheory).s1s = function (clauses) {
|
|
3242
|
+
return this.n1s(plus_0(TheoryUtils_instance.p1s(asSequence(clauses)), asSequence(this.v1l())));
|
|
3243
|
+
};
|
|
3244
|
+
protoOf(AbstractTheory).assertAIterable = function (clauses) {
|
|
3245
|
+
return this.s1s(clauses);
|
|
3246
|
+
};
|
|
3247
|
+
protoOf(AbstractTheory).t1s = function (clauses) {
|
|
3248
|
+
return this.n1s(plus_0(TheoryUtils_instance.p1s(clauses), asSequence(this.v1l())));
|
|
3249
|
+
};
|
|
3250
|
+
protoOf(AbstractTheory).assertASequence = function (clauses) {
|
|
3251
|
+
return this.t1s(clauses);
|
|
3252
|
+
};
|
|
3253
|
+
protoOf(AbstractTheory).u1s = function (clause) {
|
|
3254
|
+
return this.n1s(plus_0(asSequence(this.v1l()), TheoryUtils_instance.p1s(sequenceOf([clause]))));
|
|
3255
|
+
};
|
|
3256
|
+
protoOf(AbstractTheory).assertZ = function (clause) {
|
|
3257
|
+
return this.u1s(clause);
|
|
3258
|
+
};
|
|
3259
|
+
protoOf(AbstractTheory).v1s = function (clauses) {
|
|
3260
|
+
return this.n1s(plus_0(asSequence(this.v1l()), asSequence(TheoryUtils_instance.s1m(clauses))));
|
|
3261
|
+
};
|
|
3262
|
+
protoOf(AbstractTheory).assertZIterable = function (clauses) {
|
|
3263
|
+
return this.v1s(clauses);
|
|
3264
|
+
};
|
|
3265
|
+
protoOf(AbstractTheory).w1s = function (clauses) {
|
|
3266
|
+
return this.n1s(plus_0(asSequence(this.v1l()), TheoryUtils_instance.p1s(clauses)));
|
|
3267
|
+
};
|
|
3268
|
+
protoOf(AbstractTheory).assertZSequence = function (clauses) {
|
|
3269
|
+
return this.w1s(clauses);
|
|
3270
|
+
};
|
|
3271
|
+
protoOf(AbstractTheory).n1s = function (clauses, tags, unificator, $super) {
|
|
3272
|
+
tags = tags === VOID ? this.us() : tags;
|
|
3273
|
+
unificator = unificator === VOID ? this.k1l() : unificator;
|
|
3274
|
+
return $super === VOID ? this.x1s(clauses, tags, unificator) : $super.x1s.call(this, clauses, tags, unificator);
|
|
3275
|
+
};
|
|
3276
|
+
protoOf(AbstractTheory).y1s = function (clauses) {
|
|
3277
|
+
return this.z1s(asIterable(clauses));
|
|
3278
|
+
};
|
|
3279
|
+
protoOf(AbstractTheory).retractSequence = function (clauses) {
|
|
3280
|
+
return this.y1s(clauses);
|
|
3281
|
+
};
|
|
3282
|
+
protoOf(AbstractTheory).a1t = function () {
|
|
3283
|
+
return this;
|
|
3284
|
+
};
|
|
3285
|
+
protoOf(AbstractTheory).clone = function () {
|
|
3286
|
+
return this.a1t();
|
|
3287
|
+
};
|
|
3288
|
+
function Default() {
|
|
3289
|
+
Default_instance = this;
|
|
3290
|
+
this.c1t_1 = new IndexedTheoryFactory(Companion_getInstance_1().e1l());
|
|
3291
|
+
}
|
|
3292
|
+
protoOf(Default).k1l = function () {
|
|
3293
|
+
return this.c1t_1.d1t_1;
|
|
3294
|
+
};
|
|
3295
|
+
protoOf(Default).j1l = function (unificator) {
|
|
3296
|
+
return this.c1t_1.j1l(unificator);
|
|
3297
|
+
};
|
|
3298
|
+
protoOf(Default).emptyMutableTheory = function () {
|
|
3299
|
+
return this.c1t_1.emptyMutableTheory();
|
|
3300
|
+
};
|
|
3301
|
+
protoOf(Default).emptyMutableTheoryWithUnificator = function (unificator) {
|
|
3302
|
+
return this.c1t_1.e1t(unificator);
|
|
3303
|
+
};
|
|
3304
|
+
protoOf(Default).emptyTheory = function () {
|
|
3305
|
+
return this.c1t_1.emptyTheory();
|
|
3306
|
+
};
|
|
3307
|
+
protoOf(Default).emptyTheoryWithUnificator = function (unificator) {
|
|
3308
|
+
return this.c1t_1.f1t(unificator);
|
|
3309
|
+
};
|
|
3310
|
+
protoOf(Default).mutableTheoryOfWithUnificator = function (unificator, clauses) {
|
|
3311
|
+
return this.c1t_1.g1t(unificator, clauses);
|
|
3312
|
+
};
|
|
3313
|
+
protoOf(Default).mutableTheoryOf = function (clauses) {
|
|
3314
|
+
return this.c1t_1.mutableTheoryOf(clauses);
|
|
3315
|
+
};
|
|
3316
|
+
protoOf(Default).mutableTheoryOfIterable = function (clauses) {
|
|
3317
|
+
return this.c1t_1.mutableTheoryOfIterable(clauses);
|
|
3318
|
+
};
|
|
3319
|
+
protoOf(Default).mutableTheoryOfIterableWithUnificator = function (clauses, unificator) {
|
|
3320
|
+
return this.c1t_1.h1t(clauses, unificator);
|
|
3321
|
+
};
|
|
3322
|
+
protoOf(Default).mutableTheoryOfSequence = function (clauses) {
|
|
3323
|
+
return this.c1t_1.mutableTheoryOfSequence(clauses);
|
|
3324
|
+
};
|
|
3325
|
+
protoOf(Default).mutableTheoryOfSequenceWithUnificator = function (clauses, unificator) {
|
|
3326
|
+
return this.c1t_1.i1t(clauses, unificator);
|
|
3327
|
+
};
|
|
3328
|
+
protoOf(Default).theoryOfWithUnificator = function (unificator, clauses) {
|
|
3329
|
+
return this.c1t_1.j1t(unificator, clauses);
|
|
3330
|
+
};
|
|
3331
|
+
protoOf(Default).theoryOf = function (clauses) {
|
|
3332
|
+
return this.c1t_1.theoryOf(clauses);
|
|
3333
|
+
};
|
|
3334
|
+
protoOf(Default).theoryOfIterable = function (clauses) {
|
|
3335
|
+
return this.c1t_1.theoryOfIterable(clauses);
|
|
3336
|
+
};
|
|
3337
|
+
protoOf(Default).theoryOfIterableWithUnificator = function (clauses, unificator) {
|
|
3338
|
+
return this.c1t_1.k1t(clauses, unificator);
|
|
3339
|
+
};
|
|
3340
|
+
protoOf(Default).theoryOfSequence = function (clauses) {
|
|
3341
|
+
return this.c1t_1.theoryOfSequence(clauses);
|
|
3342
|
+
};
|
|
3343
|
+
protoOf(Default).theoryOfSequenceWithUnificator = function (clauses, unificator) {
|
|
3344
|
+
return this.c1t_1.l1t(clauses, unificator);
|
|
3345
|
+
};
|
|
3346
|
+
var Default_instance;
|
|
3347
|
+
function Default_getInstance() {
|
|
3348
|
+
if (Default_instance == null)
|
|
3349
|
+
new Default();
|
|
3350
|
+
return Default_instance;
|
|
3351
|
+
}
|
|
3352
|
+
function IndexedTheoryFactory(unificator) {
|
|
3353
|
+
this.d1t_1 = unificator;
|
|
3354
|
+
}
|
|
3355
|
+
protoOf(IndexedTheoryFactory).k1l = function () {
|
|
3356
|
+
return this.d1t_1;
|
|
3357
|
+
};
|
|
3358
|
+
protoOf(IndexedTheoryFactory).j1l = function (unificator) {
|
|
3359
|
+
return new IndexedTheoryFactory(unificator);
|
|
3360
|
+
};
|
|
3361
|
+
protoOf(IndexedTheoryFactory).f1t = function (unificator) {
|
|
3362
|
+
return IndexedTheory_init_$Create$(unificator, emptyList());
|
|
3363
|
+
};
|
|
3364
|
+
protoOf(IndexedTheoryFactory).emptyTheoryWithUnificator = function (unificator) {
|
|
3365
|
+
return this.f1t(unificator);
|
|
3366
|
+
};
|
|
3367
|
+
protoOf(IndexedTheoryFactory).k1t = function (clauses, unificator) {
|
|
3368
|
+
return IndexedTheory_init_$Create$(unificator, clauses);
|
|
3369
|
+
};
|
|
3370
|
+
protoOf(IndexedTheoryFactory).theoryOfIterableWithUnificator = function (clauses, unificator) {
|
|
3371
|
+
return this.k1t(clauses, unificator);
|
|
3372
|
+
};
|
|
3373
|
+
protoOf(IndexedTheoryFactory).j1t = function (unificator, clauses) {
|
|
3374
|
+
return IndexedTheory_init_$Create$(unificator, asIterable_0(clauses));
|
|
3375
|
+
};
|
|
3376
|
+
protoOf(IndexedTheoryFactory).theoryOfWithUnificator = function (unificator, clauses) {
|
|
3377
|
+
return this.j1t(unificator, clauses);
|
|
3378
|
+
};
|
|
3379
|
+
protoOf(IndexedTheoryFactory).l1t = function (clauses, unificator) {
|
|
3380
|
+
return IndexedTheory_init_$Create$_0(unificator, clauses);
|
|
3381
|
+
};
|
|
3382
|
+
protoOf(IndexedTheoryFactory).theoryOfSequenceWithUnificator = function (clauses, unificator) {
|
|
3383
|
+
return this.l1t(clauses, unificator);
|
|
3384
|
+
};
|
|
3385
|
+
protoOf(IndexedTheoryFactory).e1t = function (unificator) {
|
|
3386
|
+
return MutableIndexedTheory_init_$Create$(unificator, emptyList());
|
|
3387
|
+
};
|
|
3388
|
+
protoOf(IndexedTheoryFactory).emptyMutableTheoryWithUnificator = function (unificator) {
|
|
3389
|
+
return this.e1t(unificator);
|
|
3390
|
+
};
|
|
3391
|
+
protoOf(IndexedTheoryFactory).h1t = function (clauses, unificator) {
|
|
3392
|
+
return MutableIndexedTheory_init_$Create$(unificator, clauses);
|
|
3393
|
+
};
|
|
3394
|
+
protoOf(IndexedTheoryFactory).mutableTheoryOfIterableWithUnificator = function (clauses, unificator) {
|
|
3395
|
+
return this.h1t(clauses, unificator);
|
|
3396
|
+
};
|
|
3397
|
+
protoOf(IndexedTheoryFactory).g1t = function (unificator, clauses) {
|
|
3398
|
+
return MutableIndexedTheory_init_$Create$(unificator, asIterable_0(clauses));
|
|
3399
|
+
};
|
|
3400
|
+
protoOf(IndexedTheoryFactory).mutableTheoryOfWithUnificator = function (unificator, clauses) {
|
|
3401
|
+
return this.g1t(unificator, clauses);
|
|
3402
|
+
};
|
|
3403
|
+
protoOf(IndexedTheoryFactory).i1t = function (clauses, unificator) {
|
|
3404
|
+
return MutableIndexedTheory_init_$Create$_0(unificator, clauses);
|
|
3405
|
+
};
|
|
3406
|
+
protoOf(IndexedTheoryFactory).mutableTheoryOfSequenceWithUnificator = function (clauses, unificator) {
|
|
3407
|
+
return this.i1t(clauses, unificator);
|
|
3408
|
+
};
|
|
3409
|
+
function Default_0() {
|
|
3410
|
+
Default_instance_0 = this;
|
|
3411
|
+
this.m1t_1 = new ListedTheoryFactory(Companion_getInstance_1().e1l());
|
|
3412
|
+
}
|
|
3413
|
+
protoOf(Default_0).k1l = function () {
|
|
3414
|
+
return this.m1t_1.n1t_1;
|
|
3415
|
+
};
|
|
3416
|
+
protoOf(Default_0).j1l = function (unificator) {
|
|
3417
|
+
return this.m1t_1.j1l(unificator);
|
|
3418
|
+
};
|
|
3419
|
+
protoOf(Default_0).emptyMutableTheory = function () {
|
|
3420
|
+
return this.m1t_1.emptyMutableTheory();
|
|
3421
|
+
};
|
|
3422
|
+
protoOf(Default_0).emptyMutableTheoryWithUnificator = function (unificator) {
|
|
3423
|
+
return this.m1t_1.e1t(unificator);
|
|
3424
|
+
};
|
|
3425
|
+
protoOf(Default_0).emptyTheory = function () {
|
|
3426
|
+
return this.m1t_1.emptyTheory();
|
|
3427
|
+
};
|
|
3428
|
+
protoOf(Default_0).emptyTheoryWithUnificator = function (unificator) {
|
|
3429
|
+
return this.m1t_1.f1t(unificator);
|
|
3430
|
+
};
|
|
3431
|
+
protoOf(Default_0).mutableTheoryOfWithUnificator = function (unificator, clauses) {
|
|
3432
|
+
return this.m1t_1.g1t(unificator, clauses);
|
|
3433
|
+
};
|
|
3434
|
+
protoOf(Default_0).mutableTheoryOf = function (clauses) {
|
|
3435
|
+
return this.m1t_1.mutableTheoryOf(clauses);
|
|
3436
|
+
};
|
|
3437
|
+
protoOf(Default_0).mutableTheoryOfIterable = function (clauses) {
|
|
3438
|
+
return this.m1t_1.mutableTheoryOfIterable(clauses);
|
|
3439
|
+
};
|
|
3440
|
+
protoOf(Default_0).mutableTheoryOfIterableWithUnificator = function (clauses, unificator) {
|
|
3441
|
+
return this.m1t_1.h1t(clauses, unificator);
|
|
3442
|
+
};
|
|
3443
|
+
protoOf(Default_0).mutableTheoryOfSequence = function (clauses) {
|
|
3444
|
+
return this.m1t_1.mutableTheoryOfSequence(clauses);
|
|
3445
|
+
};
|
|
3446
|
+
protoOf(Default_0).mutableTheoryOfSequenceWithUnificator = function (clauses, unificator) {
|
|
3447
|
+
return this.m1t_1.i1t(clauses, unificator);
|
|
3448
|
+
};
|
|
3449
|
+
protoOf(Default_0).theoryOfWithUnificator = function (unificator, clauses) {
|
|
3450
|
+
return this.m1t_1.j1t(unificator, clauses);
|
|
3451
|
+
};
|
|
3452
|
+
protoOf(Default_0).theoryOf = function (clauses) {
|
|
3453
|
+
return this.m1t_1.theoryOf(clauses);
|
|
3454
|
+
};
|
|
3455
|
+
protoOf(Default_0).theoryOfIterable = function (clauses) {
|
|
3456
|
+
return this.m1t_1.theoryOfIterable(clauses);
|
|
3457
|
+
};
|
|
3458
|
+
protoOf(Default_0).theoryOfIterableWithUnificator = function (clauses, unificator) {
|
|
3459
|
+
return this.m1t_1.k1t(clauses, unificator);
|
|
3460
|
+
};
|
|
3461
|
+
protoOf(Default_0).theoryOfSequence = function (clauses) {
|
|
3462
|
+
return this.m1t_1.theoryOfSequence(clauses);
|
|
3463
|
+
};
|
|
3464
|
+
protoOf(Default_0).theoryOfSequenceWithUnificator = function (clauses, unificator) {
|
|
3465
|
+
return this.m1t_1.l1t(clauses, unificator);
|
|
3466
|
+
};
|
|
3467
|
+
var Default_instance_0;
|
|
3468
|
+
function Default_getInstance_0() {
|
|
3469
|
+
if (Default_instance_0 == null)
|
|
3470
|
+
new Default_0();
|
|
3471
|
+
return Default_instance_0;
|
|
3472
|
+
}
|
|
3473
|
+
function ListedTheoryFactory(unificator) {
|
|
3474
|
+
this.n1t_1 = unificator;
|
|
3475
|
+
}
|
|
3476
|
+
protoOf(ListedTheoryFactory).k1l = function () {
|
|
3477
|
+
return this.n1t_1;
|
|
3478
|
+
};
|
|
3479
|
+
protoOf(ListedTheoryFactory).j1l = function (unificator) {
|
|
3480
|
+
return new ListedTheoryFactory(unificator);
|
|
3481
|
+
};
|
|
3482
|
+
protoOf(ListedTheoryFactory).f1t = function (unificator) {
|
|
3483
|
+
return ListedTheory_init_$Create$(unificator, emptyList());
|
|
3484
|
+
};
|
|
3485
|
+
protoOf(ListedTheoryFactory).emptyTheoryWithUnificator = function (unificator) {
|
|
3486
|
+
return this.f1t(unificator);
|
|
3487
|
+
};
|
|
3488
|
+
protoOf(ListedTheoryFactory).k1t = function (clauses, unificator) {
|
|
3489
|
+
return ListedTheory_init_$Create$(unificator, clauses);
|
|
3490
|
+
};
|
|
3491
|
+
protoOf(ListedTheoryFactory).theoryOfIterableWithUnificator = function (clauses, unificator) {
|
|
3492
|
+
return this.k1t(clauses, unificator);
|
|
3493
|
+
};
|
|
3494
|
+
protoOf(ListedTheoryFactory).j1t = function (unificator, clauses) {
|
|
3495
|
+
return ListedTheory_init_$Create$(unificator, asIterable_0(clauses));
|
|
3496
|
+
};
|
|
3497
|
+
protoOf(ListedTheoryFactory).theoryOfWithUnificator = function (unificator, clauses) {
|
|
3498
|
+
return this.j1t(unificator, clauses);
|
|
3499
|
+
};
|
|
3500
|
+
protoOf(ListedTheoryFactory).l1t = function (clauses, unificator) {
|
|
3501
|
+
return ListedTheory_init_$Create$_0(unificator, clauses);
|
|
3502
|
+
};
|
|
3503
|
+
protoOf(ListedTheoryFactory).theoryOfSequenceWithUnificator = function (clauses, unificator) {
|
|
3504
|
+
return this.l1t(clauses, unificator);
|
|
3505
|
+
};
|
|
3506
|
+
protoOf(ListedTheoryFactory).e1t = function (unificator) {
|
|
3507
|
+
return MutableListedTheory_init_$Create$(unificator, emptyList());
|
|
3508
|
+
};
|
|
3509
|
+
protoOf(ListedTheoryFactory).emptyMutableTheoryWithUnificator = function (unificator) {
|
|
3510
|
+
return this.e1t(unificator);
|
|
3511
|
+
};
|
|
3512
|
+
protoOf(ListedTheoryFactory).h1t = function (clauses, unificator) {
|
|
3513
|
+
return MutableListedTheory_init_$Create$(unificator, clauses);
|
|
3514
|
+
};
|
|
3515
|
+
protoOf(ListedTheoryFactory).mutableTheoryOfIterableWithUnificator = function (clauses, unificator) {
|
|
3516
|
+
return this.h1t(clauses, unificator);
|
|
3517
|
+
};
|
|
3518
|
+
protoOf(ListedTheoryFactory).g1t = function (unificator, clauses) {
|
|
3519
|
+
return MutableListedTheory_init_$Create$(unificator, asIterable_0(clauses));
|
|
3520
|
+
};
|
|
3521
|
+
protoOf(ListedTheoryFactory).mutableTheoryOfWithUnificator = function (unificator, clauses) {
|
|
3522
|
+
return this.g1t(unificator, clauses);
|
|
3523
|
+
};
|
|
3524
|
+
protoOf(ListedTheoryFactory).i1t = function (clauses, unificator) {
|
|
3525
|
+
return MutableListedTheory_init_$Create$_0(unificator, clauses);
|
|
3526
|
+
};
|
|
3527
|
+
protoOf(ListedTheoryFactory).mutableTheoryOfSequenceWithUnificator = function (clauses, unificator) {
|
|
3528
|
+
return this.i1t(clauses, unificator);
|
|
3529
|
+
};
|
|
3530
|
+
function Companion_4() {
|
|
3531
|
+
}
|
|
3532
|
+
protoOf(Companion_4).empty = function (unificator) {
|
|
3533
|
+
return this.indexedOfIterable(unificator, emptyList());
|
|
3534
|
+
};
|
|
3535
|
+
protoOf(Companion_4).of = function (unificator, clause) {
|
|
3536
|
+
return this.indexedOf(unificator, clause.slice());
|
|
3537
|
+
};
|
|
3538
|
+
protoOf(Companion_4).ofIterable = function (unificator, clauses) {
|
|
3539
|
+
return this.indexedOfIterable(unificator, clauses);
|
|
3540
|
+
};
|
|
3541
|
+
protoOf(Companion_4).ofSequence = function (unificator, clauses) {
|
|
3542
|
+
return this.indexedOfSequence(unificator, clauses);
|
|
3543
|
+
};
|
|
3544
|
+
protoOf(Companion_4).ofScopes = function (unificator, clauses) {
|
|
3545
|
+
return this.indexedOfScopes(unificator, clauses.slice());
|
|
3546
|
+
};
|
|
3547
|
+
protoOf(Companion_4).emptyIndexed = function (unificator) {
|
|
3548
|
+
return this.indexedOfIterable(unificator, emptyList());
|
|
3549
|
+
};
|
|
3550
|
+
protoOf(Companion_4).indexedOf = function (unificator, clause) {
|
|
3551
|
+
return this.indexedOfIterable(unificator, asIterable_0(clause));
|
|
3552
|
+
};
|
|
3553
|
+
protoOf(Companion_4).indexedOfScopes = function (unificator, clauses) {
|
|
3554
|
+
// Inline function 'kotlin.collections.map' call
|
|
3555
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
3556
|
+
var destination = ArrayList_init_$Create$(clauses.length);
|
|
3557
|
+
var inductionVariable = 0;
|
|
3558
|
+
var last = clauses.length;
|
|
3559
|
+
while (inductionVariable < last) {
|
|
3560
|
+
var item = clauses[inductionVariable];
|
|
3561
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
3562
|
+
// Inline function 'it.unibo.tuprolog.theory.Companion.indexedOf.<anonymous>' call
|
|
3563
|
+
var tmp$ret$0 = Companion_instance.emptyWithFunction(item);
|
|
3564
|
+
destination.o(tmp$ret$0);
|
|
3565
|
+
}
|
|
3566
|
+
return this.indexedOfIterable(unificator, destination);
|
|
3567
|
+
};
|
|
3568
|
+
protoOf(Companion_4).indexedOfSequence = function (unificator, clauses) {
|
|
3569
|
+
return this.indexedOfIterable(unificator, asIterable(clauses));
|
|
3570
|
+
};
|
|
3571
|
+
protoOf(Companion_4).indexedOfIterable = function (unificator, clauses) {
|
|
3572
|
+
return MutableIndexedTheory_init_$Create$(unificator, clauses);
|
|
3573
|
+
};
|
|
3574
|
+
protoOf(Companion_4).emptyListed = function (unificator) {
|
|
3575
|
+
return this.listedOfSequence(unificator, emptySequence());
|
|
3576
|
+
};
|
|
3577
|
+
protoOf(Companion_4).listedOf = function (unificator, clause) {
|
|
3578
|
+
return this.listedOfIterable(unificator, asIterable_0(clause));
|
|
3579
|
+
};
|
|
3580
|
+
protoOf(Companion_4).listedOfScopes = function (unificator, clause) {
|
|
3581
|
+
// Inline function 'kotlin.collections.map' call
|
|
3582
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
3583
|
+
var destination = ArrayList_init_$Create$(clause.length);
|
|
3584
|
+
var inductionVariable = 0;
|
|
3585
|
+
var last = clause.length;
|
|
3586
|
+
while (inductionVariable < last) {
|
|
3587
|
+
var item = clause[inductionVariable];
|
|
3588
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
3589
|
+
// Inline function 'it.unibo.tuprolog.theory.Companion.listedOf.<anonymous>' call
|
|
3590
|
+
var tmp$ret$0 = Companion_instance.emptyWithFunction(item);
|
|
3591
|
+
destination.o(tmp$ret$0);
|
|
3592
|
+
}
|
|
3593
|
+
return this.listedOfIterable(unificator, destination);
|
|
3594
|
+
};
|
|
3595
|
+
protoOf(Companion_4).listedOfSequence = function (unificator, clauses) {
|
|
3596
|
+
return this.listedOfIterable(unificator, asIterable(clauses));
|
|
3597
|
+
};
|
|
3598
|
+
protoOf(Companion_4).listedOfIterable = function (unificator, clauses) {
|
|
3599
|
+
return MutableListedTheory_init_$Create$(unificator, clauses);
|
|
3600
|
+
};
|
|
3601
|
+
var Companion_instance_9;
|
|
3602
|
+
function Companion_getInstance_7() {
|
|
3603
|
+
return Companion_instance_9;
|
|
3604
|
+
}
|
|
3605
|
+
function MutableTheory() {
|
|
3606
|
+
}
|
|
3607
|
+
function Success_0(theory, clauses) {
|
|
3608
|
+
RetractResult.call(this);
|
|
3609
|
+
this.u1t_1 = theory;
|
|
3610
|
+
this.v1t_1 = clauses;
|
|
3611
|
+
}
|
|
3612
|
+
protoOf(Success_0).i1s = function () {
|
|
3613
|
+
return this.u1t_1;
|
|
3614
|
+
};
|
|
3615
|
+
protoOf(Success_0).v1l = function () {
|
|
3616
|
+
return this.v1t_1;
|
|
3617
|
+
};
|
|
3618
|
+
protoOf(Success_0).o1m = function () {
|
|
3619
|
+
return first_0(this.v1t_1);
|
|
3620
|
+
};
|
|
3621
|
+
protoOf(Success_0).toString = function () {
|
|
3622
|
+
return 'Success(theory=' + this.u1t_1 + ', clauses=' + this.v1t_1 + ')';
|
|
3623
|
+
};
|
|
3624
|
+
protoOf(Success_0).hashCode = function () {
|
|
3625
|
+
var result = hashCode(this.u1t_1);
|
|
3626
|
+
result = imul(result, 31) + hashCode(this.v1t_1) | 0;
|
|
3627
|
+
return result;
|
|
3628
|
+
};
|
|
3629
|
+
protoOf(Success_0).equals = function (other) {
|
|
3630
|
+
if (this === other)
|
|
3631
|
+
return true;
|
|
3632
|
+
if (!(other instanceof Success_0))
|
|
3633
|
+
return false;
|
|
3634
|
+
var tmp0_other_with_cast = other instanceof Success_0 ? other : THROW_CCE();
|
|
3635
|
+
if (!equals(this.u1t_1, tmp0_other_with_cast.u1t_1))
|
|
3636
|
+
return false;
|
|
3637
|
+
if (!equals(this.v1t_1, tmp0_other_with_cast.v1t_1))
|
|
3638
|
+
return false;
|
|
3639
|
+
return true;
|
|
3640
|
+
};
|
|
3641
|
+
function Failure_0(theory) {
|
|
3642
|
+
RetractResult.call(this);
|
|
3643
|
+
this.w1t_1 = theory;
|
|
3644
|
+
}
|
|
3645
|
+
protoOf(Failure_0).i1s = function () {
|
|
3646
|
+
return this.w1t_1;
|
|
3647
|
+
};
|
|
3648
|
+
protoOf(Failure_0).v1l = function () {
|
|
3649
|
+
return null;
|
|
3650
|
+
};
|
|
3651
|
+
protoOf(Failure_0).o1m = function () {
|
|
3652
|
+
return null;
|
|
3653
|
+
};
|
|
3654
|
+
protoOf(Failure_0).toString = function () {
|
|
3655
|
+
return 'Failure(theory=' + this.w1t_1 + ')';
|
|
3656
|
+
};
|
|
3657
|
+
protoOf(Failure_0).hashCode = function () {
|
|
3658
|
+
return hashCode(this.w1t_1);
|
|
3659
|
+
};
|
|
3660
|
+
protoOf(Failure_0).equals = function (other) {
|
|
3661
|
+
if (this === other)
|
|
3662
|
+
return true;
|
|
3663
|
+
if (!(other instanceof Failure_0))
|
|
3664
|
+
return false;
|
|
3665
|
+
var tmp0_other_with_cast = other instanceof Failure_0 ? other : THROW_CCE();
|
|
3666
|
+
if (!equals(this.w1t_1, tmp0_other_with_cast.w1t_1))
|
|
3667
|
+
return false;
|
|
3668
|
+
return true;
|
|
3669
|
+
};
|
|
3670
|
+
function RetractResult() {
|
|
3671
|
+
}
|
|
3672
|
+
function Companion_5() {
|
|
3673
|
+
}
|
|
3674
|
+
protoOf(Companion_5).empty = function (unificator) {
|
|
3675
|
+
return this.indexedOfSequence(unificator, emptySequence());
|
|
3676
|
+
};
|
|
3677
|
+
protoOf(Companion_5).emptyWithDefaultUnificator = function () {
|
|
3678
|
+
return this.empty(Companion_getInstance_1().e1l());
|
|
3679
|
+
};
|
|
3680
|
+
protoOf(Companion_5).of = function (unificator, clause) {
|
|
3681
|
+
return this.indexedOf(unificator, clause.slice());
|
|
3682
|
+
};
|
|
3683
|
+
protoOf(Companion_5).ofWithDefaultUnificator = function (clause) {
|
|
3684
|
+
return this.indexedOf(Companion_getInstance_1().e1l(), clause.slice());
|
|
3685
|
+
};
|
|
3686
|
+
protoOf(Companion_5).ofIterable = function (unificator, clauses) {
|
|
3687
|
+
return this.indexedOfIterable(unificator, clauses);
|
|
3688
|
+
};
|
|
3689
|
+
protoOf(Companion_5).ofIterableWithDefaultUnificator = function (clauses) {
|
|
3690
|
+
return this.indexedOfIterable(Companion_getInstance_1().e1l(), clauses);
|
|
3691
|
+
};
|
|
3692
|
+
protoOf(Companion_5).ofSequence = function (unificator, clauses) {
|
|
3693
|
+
return this.indexedOfSequence(unificator, clauses);
|
|
3694
|
+
};
|
|
3695
|
+
protoOf(Companion_5).ofSequenceWithDefaultUnificator = function (clauses) {
|
|
3696
|
+
return this.indexedOfSequence(Companion_getInstance_1().e1l(), clauses);
|
|
3697
|
+
};
|
|
3698
|
+
protoOf(Companion_5).ofScopes = function (unificator, clauses) {
|
|
3699
|
+
return this.indexedOfScopes(unificator, clauses.slice());
|
|
3700
|
+
};
|
|
3701
|
+
protoOf(Companion_5).ofScopesWithDefaultUnificator = function (clauses) {
|
|
3702
|
+
return this.indexedOfScopes(Companion_getInstance_1().e1l(), clauses.slice());
|
|
3703
|
+
};
|
|
3704
|
+
protoOf(Companion_5).emptyIndexed = function (unificator) {
|
|
3705
|
+
return this.indexedOfIterable(unificator, emptyList());
|
|
3706
|
+
};
|
|
3707
|
+
protoOf(Companion_5).indexedOf = function (unificator, clause) {
|
|
3708
|
+
return this.indexedOfIterable(unificator, asIterable_0(clause));
|
|
3709
|
+
};
|
|
3710
|
+
protoOf(Companion_5).indexedOfScopes = function (unificator, clauses) {
|
|
3711
|
+
// Inline function 'kotlin.collections.map' call
|
|
3712
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
3713
|
+
var destination = ArrayList_init_$Create$(clauses.length);
|
|
3714
|
+
var inductionVariable = 0;
|
|
3715
|
+
var last = clauses.length;
|
|
3716
|
+
while (inductionVariable < last) {
|
|
3717
|
+
var item = clauses[inductionVariable];
|
|
3718
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
3719
|
+
// Inline function 'it.unibo.tuprolog.theory.Companion.indexedOf.<anonymous>' call
|
|
3720
|
+
var tmp$ret$0 = Companion_instance.emptyWithFunction(item);
|
|
3721
|
+
destination.o(tmp$ret$0);
|
|
3722
|
+
}
|
|
3723
|
+
return this.indexedOfIterable(unificator, destination);
|
|
3724
|
+
};
|
|
3725
|
+
protoOf(Companion_5).indexedOfSequence = function (unificator, clauses) {
|
|
3726
|
+
return this.indexedOfIterable(unificator, asIterable(clauses));
|
|
3727
|
+
};
|
|
3728
|
+
protoOf(Companion_5).indexedOfIterable = function (unificator, clauses) {
|
|
3729
|
+
return Default_getInstance().theoryOfIterableWithUnificator(clauses, unificator);
|
|
3730
|
+
};
|
|
3731
|
+
protoOf(Companion_5).emptyListed = function (unificator) {
|
|
3732
|
+
return this.listedOfSequence(unificator, emptySequence());
|
|
3733
|
+
};
|
|
3734
|
+
protoOf(Companion_5).listedOf = function (unificator, clause) {
|
|
3735
|
+
return this.listedOfIterable(unificator, asIterable_0(clause));
|
|
3736
|
+
};
|
|
3737
|
+
protoOf(Companion_5).listedOfScopes = function (unificator, clause) {
|
|
3738
|
+
// Inline function 'kotlin.collections.map' call
|
|
3739
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
3740
|
+
var destination = ArrayList_init_$Create$(clause.length);
|
|
3741
|
+
var inductionVariable = 0;
|
|
3742
|
+
var last = clause.length;
|
|
3743
|
+
while (inductionVariable < last) {
|
|
3744
|
+
var item = clause[inductionVariable];
|
|
3745
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
3746
|
+
// Inline function 'it.unibo.tuprolog.theory.Companion.listedOf.<anonymous>' call
|
|
3747
|
+
var tmp$ret$0 = Companion_instance.emptyWithFunction(item);
|
|
3748
|
+
destination.o(tmp$ret$0);
|
|
3749
|
+
}
|
|
3750
|
+
return this.listedOfIterable(unificator, destination);
|
|
3751
|
+
};
|
|
3752
|
+
protoOf(Companion_5).listedOfSequence = function (unificator, clauses) {
|
|
3753
|
+
return this.listedOfIterable(unificator, asIterable(clauses));
|
|
3754
|
+
};
|
|
3755
|
+
protoOf(Companion_5).listedOfIterable = function (unificator, clauses) {
|
|
3756
|
+
return Default_getInstance_0().theoryOfIterableWithUnificator(clauses, unificator);
|
|
3757
|
+
};
|
|
3758
|
+
var Companion_instance_10;
|
|
3759
|
+
function Companion_getInstance_8() {
|
|
3760
|
+
return Companion_instance_10;
|
|
3761
|
+
}
|
|
3762
|
+
function Theory$_get_rules_$lambda_c39n1s(it) {
|
|
3763
|
+
return it.asRule();
|
|
3764
|
+
}
|
|
3765
|
+
function Theory$_get_directives_$lambda_zbsn17(it) {
|
|
3766
|
+
return it.asDirective();
|
|
3767
|
+
}
|
|
3768
|
+
function Theory() {
|
|
3769
|
+
}
|
|
3770
|
+
function TheoryFactory() {
|
|
3771
|
+
}
|
|
3772
|
+
function actualCheck($this, clauses) {
|
|
3773
|
+
// Inline function 'kotlin.require' call
|
|
3774
|
+
var tmp$ret$1;
|
|
3775
|
+
$l$block: {
|
|
3776
|
+
// Inline function 'kotlin.sequences.all' call
|
|
3777
|
+
var tmp0_iterator = clauses.r();
|
|
3778
|
+
while (tmp0_iterator.s()) {
|
|
3779
|
+
var element = tmp0_iterator.u();
|
|
3780
|
+
// Inline function 'it.unibo.tuprolog.theory.TheoryUtils.actualCheck.<anonymous>' call
|
|
3781
|
+
if (!element.vx()) {
|
|
3782
|
+
tmp$ret$1 = false;
|
|
3783
|
+
break $l$block;
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
tmp$ret$1 = true;
|
|
3787
|
+
}
|
|
3788
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
3789
|
+
if (!tmp$ret$1) {
|
|
3790
|
+
// Inline function 'it.unibo.tuprolog.theory.TheoryUtils.actualCheck.<anonymous>' call
|
|
3791
|
+
var message = "ClauseDatabase can contain only well formed clauses: these aren't " + ('' + toList(filterNot(clauses, TheoryUtils$actualCheck$lambda)));
|
|
3792
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
3793
|
+
}
|
|
3794
|
+
}
|
|
3795
|
+
function TheoryUtils$actualCheck$lambda(it) {
|
|
3796
|
+
return it.vx();
|
|
3797
|
+
}
|
|
3798
|
+
function TheoryUtils() {
|
|
3799
|
+
}
|
|
3800
|
+
protoOf(TheoryUtils).h1m = function (clause) {
|
|
3801
|
+
// Inline function 'kotlin.also' call
|
|
3802
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
3803
|
+
// Inline function 'it.unibo.tuprolog.theory.TheoryUtils.checkClauseCorrect.<anonymous>' call
|
|
3804
|
+
// Inline function 'kotlin.require' call
|
|
3805
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
3806
|
+
if (!clause.vx()) {
|
|
3807
|
+
// Inline function 'it.unibo.tuprolog.theory.TheoryUtils.checkClauseCorrect.<anonymous>.<anonymous>' call
|
|
3808
|
+
var message = 'ClauseDatabase can contain only well formed clauses: ' + ("this isn't " + clause);
|
|
3809
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
3810
|
+
}
|
|
3811
|
+
return clause;
|
|
3812
|
+
};
|
|
3813
|
+
protoOf(TheoryUtils).r1s = function (clauses) {
|
|
3814
|
+
// Inline function 'kotlin.also' call
|
|
3815
|
+
var this_0 = asSequence_0(clauses);
|
|
3816
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
3817
|
+
// Inline function 'it.unibo.tuprolog.theory.TheoryUtils.checkClausesCorrect.<anonymous>' call
|
|
3818
|
+
actualCheck(TheoryUtils_instance, this_0);
|
|
3819
|
+
return this_0;
|
|
3820
|
+
};
|
|
3821
|
+
protoOf(TheoryUtils).s1m = function (clauses) {
|
|
3822
|
+
// Inline function 'kotlin.also' call
|
|
3823
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
3824
|
+
// Inline function 'it.unibo.tuprolog.theory.TheoryUtils.checkClausesCorrect.<anonymous>' call
|
|
3825
|
+
actualCheck(TheoryUtils_instance, asSequence(clauses));
|
|
3826
|
+
return clauses;
|
|
3827
|
+
};
|
|
3828
|
+
protoOf(TheoryUtils).p1s = function (clauses) {
|
|
3829
|
+
// Inline function 'kotlin.also' call
|
|
3830
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
3831
|
+
// Inline function 'it.unibo.tuprolog.theory.TheoryUtils.checkClausesCorrect.<anonymous>' call
|
|
3832
|
+
actualCheck(TheoryUtils_instance, clauses);
|
|
3833
|
+
return clauses;
|
|
3834
|
+
};
|
|
3835
|
+
var TheoryUtils_instance;
|
|
3836
|
+
function TheoryUtils_getInstance() {
|
|
3837
|
+
return TheoryUtils_instance;
|
|
3838
|
+
}
|
|
3839
|
+
function _no_name_provided__qut3iv(this$0) {
|
|
3840
|
+
this.x1t_1 = this$0;
|
|
3841
|
+
}
|
|
3842
|
+
protoOf(_no_name_provided__qut3iv).r = function () {
|
|
3843
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.AbstractIndexedTheory.<get-clauses>.<anonymous>' call
|
|
3844
|
+
return this.x1t_1.a1u().r();
|
|
3845
|
+
};
|
|
3846
|
+
function AbstractIndexedTheory(queue, tags) {
|
|
3847
|
+
AbstractTheory.call(this, tags);
|
|
3848
|
+
this.z1t_1 = queue;
|
|
3849
|
+
}
|
|
3850
|
+
protoOf(AbstractIndexedTheory).k1l = function () {
|
|
3851
|
+
return this.a1u().k1l();
|
|
3852
|
+
};
|
|
3853
|
+
protoOf(AbstractIndexedTheory).a1u = function () {
|
|
3854
|
+
return this.z1t_1;
|
|
3855
|
+
};
|
|
3856
|
+
protoOf(AbstractIndexedTheory).o1l = function () {
|
|
3857
|
+
return this.a1u().n1l();
|
|
3858
|
+
};
|
|
3859
|
+
protoOf(AbstractIndexedTheory).p1l = function () {
|
|
3860
|
+
return this.a1u().p1l();
|
|
3861
|
+
};
|
|
3862
|
+
protoOf(AbstractIndexedTheory).v1l = function () {
|
|
3863
|
+
// Inline function 'kotlin.collections.Iterable' call
|
|
3864
|
+
return new _no_name_provided__qut3iv(this);
|
|
3865
|
+
};
|
|
3866
|
+
protoOf(AbstractIndexedTheory).t1l = function (clause) {
|
|
3867
|
+
return this.a1u().t1l(clause);
|
|
3868
|
+
};
|
|
3869
|
+
protoOf(AbstractIndexedTheory).get = function (clause) {
|
|
3870
|
+
return this.t1l(clause);
|
|
3871
|
+
};
|
|
3872
|
+
protoOf(AbstractIndexedTheory).l = function () {
|
|
3873
|
+
return toLong(this.a1u().l());
|
|
3874
|
+
};
|
|
3875
|
+
protoOf(AbstractIndexedTheory).q1l = function () {
|
|
3876
|
+
return this.a1u().isEmpty();
|
|
3877
|
+
};
|
|
3878
|
+
protoOf(AbstractIndexedTheory).l1s = function () {
|
|
3879
|
+
return !this.q1l();
|
|
3880
|
+
};
|
|
3881
|
+
function AbstractListedTheory(unificator, clauses, tags) {
|
|
3882
|
+
AbstractTheory.call(this, tags);
|
|
3883
|
+
this.c1u_1 = clauses;
|
|
3884
|
+
this.d1u_1 = unificator;
|
|
3885
|
+
}
|
|
3886
|
+
protoOf(AbstractListedTheory).v1l = function () {
|
|
3887
|
+
return this.c1u_1;
|
|
3888
|
+
};
|
|
3889
|
+
protoOf(AbstractListedTheory).e1u = function (_set____db54di) {
|
|
3890
|
+
this.d1u_1 = _set____db54di;
|
|
3891
|
+
};
|
|
3892
|
+
protoOf(AbstractListedTheory).k1l = function () {
|
|
3893
|
+
return this.d1u_1;
|
|
3894
|
+
};
|
|
3895
|
+
protoOf(AbstractListedTheory).t1l = function (clause) {
|
|
3896
|
+
// Inline function 'kotlin.collections.filter' call
|
|
3897
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
3898
|
+
var this_0 = this.v1l();
|
|
3899
|
+
var destination = ArrayList_init_$Create$_0();
|
|
3900
|
+
var tmp0_iterator = this_0.r();
|
|
3901
|
+
while (tmp0_iterator.s()) {
|
|
3902
|
+
var element = tmp0_iterator.u();
|
|
3903
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.AbstractListedTheory.get.<anonymous>' call
|
|
3904
|
+
if (this.k1l().match(element, clause)) {
|
|
3905
|
+
destination.o(element);
|
|
3906
|
+
}
|
|
3907
|
+
}
|
|
3908
|
+
return asSequence(destination);
|
|
3909
|
+
};
|
|
3910
|
+
protoOf(AbstractListedTheory).get = function (clause) {
|
|
3911
|
+
return this.t1l(clause);
|
|
3912
|
+
};
|
|
3913
|
+
function IndexedTheory_init_$Init$(unificator, clauses, tags, $this) {
|
|
3914
|
+
tags = tags === VOID ? emptyMap() : tags;
|
|
3915
|
+
IndexedTheory.call($this, Companion_instance_4.ofIterable(unificator, clauses), tags);
|
|
3916
|
+
TheoryUtils_instance.s1m(clauses);
|
|
3917
|
+
return $this;
|
|
3918
|
+
}
|
|
3919
|
+
function IndexedTheory_init_$Create$(unificator, clauses, tags) {
|
|
3920
|
+
return IndexedTheory_init_$Init$(unificator, clauses, tags, objectCreate(protoOf(IndexedTheory)));
|
|
3921
|
+
}
|
|
3922
|
+
function IndexedTheory_init_$Init$_0(unificator, clauses, tags, $this) {
|
|
3923
|
+
tags = tags === VOID ? emptyMap() : tags;
|
|
3924
|
+
IndexedTheory_init_$Init$(unificator, asIterable(clauses), tags, $this);
|
|
3925
|
+
return $this;
|
|
3926
|
+
}
|
|
3927
|
+
function IndexedTheory_init_$Create$_0(unificator, clauses, tags) {
|
|
3928
|
+
return IndexedTheory_init_$Init$_0(unificator, clauses, tags, objectCreate(protoOf(IndexedTheory)));
|
|
3929
|
+
}
|
|
3930
|
+
function _get_hashCodeCache__ny3r0q_0($this) {
|
|
3931
|
+
// Inline function 'kotlin.getValue' call
|
|
3932
|
+
var this_0 = $this.h1u_1;
|
|
3933
|
+
hashCodeCache$factory_0();
|
|
3934
|
+
return this_0.r2();
|
|
3935
|
+
}
|
|
3936
|
+
function _get_sizeCache__6eswog($this) {
|
|
3937
|
+
// Inline function 'kotlin.getValue' call
|
|
3938
|
+
var this_0 = $this.i1u_1;
|
|
3939
|
+
sizeCache$factory();
|
|
3940
|
+
return this_0.r2();
|
|
3941
|
+
}
|
|
3942
|
+
function IndexedTheory$hashCodeCache$delegate$lambda(this$0) {
|
|
3943
|
+
return function () {
|
|
3944
|
+
return protoOf(AbstractIndexedTheory).hashCode.call(this$0);
|
|
3945
|
+
};
|
|
3946
|
+
}
|
|
3947
|
+
function IndexedTheory$sizeCache$delegate$lambda(this$0) {
|
|
3948
|
+
return function () {
|
|
3949
|
+
return protoOf(AbstractIndexedTheory).l.call(this$0);
|
|
3950
|
+
};
|
|
3951
|
+
}
|
|
3952
|
+
function IndexedTheory(queue, tags) {
|
|
3953
|
+
AbstractIndexedTheory.call(this, queue, tags);
|
|
3954
|
+
var tmp = this;
|
|
3955
|
+
tmp.h1u_1 = lazy(IndexedTheory$hashCodeCache$delegate$lambda(this));
|
|
3956
|
+
var tmp_0 = this;
|
|
3957
|
+
tmp_0.i1u_1 = lazy(IndexedTheory$sizeCache$delegate$lambda(this));
|
|
3958
|
+
}
|
|
3959
|
+
protoOf(IndexedTheory).x1s = function (clauses, tags, unificator) {
|
|
3960
|
+
return IndexedTheory_init_$Create$_0(unificator, clauses, tags);
|
|
3961
|
+
};
|
|
3962
|
+
protoOf(IndexedTheory).r1t = function (clause) {
|
|
3963
|
+
var newTheory = Companion_instance_4.ofIterable(this.k1l(), this.v1l());
|
|
3964
|
+
var retracted = newTheory.retrieveFirst(clause);
|
|
3965
|
+
return retracted.p1m() ? new Failure_0(this) : new Success_0(new IndexedTheory(retracted.n1m(), this.us()), ensureNotNull(retracted.v1l()));
|
|
3966
|
+
};
|
|
3967
|
+
protoOf(IndexedTheory).retract = function (clause) {
|
|
3968
|
+
return this.r1t(clause);
|
|
3969
|
+
};
|
|
3970
|
+
protoOf(IndexedTheory).o1s = function (theory) {
|
|
3971
|
+
return this.q1l() ? theory.toImmutableTheory() : theory.q1l() ? this : protoOf(AbstractIndexedTheory).o1s.call(this, theory);
|
|
3972
|
+
};
|
|
3973
|
+
protoOf(IndexedTheory).plusTheory = function (theory) {
|
|
3974
|
+
return this.o1s(theory);
|
|
3975
|
+
};
|
|
3976
|
+
protoOf(IndexedTheory).o1t = function () {
|
|
3977
|
+
return Companion_instance_9.indexedOfIterable(this.k1l(), this);
|
|
3978
|
+
};
|
|
3979
|
+
protoOf(IndexedTheory).toMutableTheory = function () {
|
|
3980
|
+
return this.o1t();
|
|
3981
|
+
};
|
|
3982
|
+
protoOf(IndexedTheory).z1s = function (clauses) {
|
|
3983
|
+
var newTheory = Companion_instance_5.ofIterable(this.k1l(), this.v1l());
|
|
3984
|
+
var removed = dequeOf([]);
|
|
3985
|
+
var tmp0_iterator = clauses.r();
|
|
3986
|
+
while (tmp0_iterator.s()) {
|
|
3987
|
+
var clause = tmp0_iterator.u();
|
|
3988
|
+
var result = newTheory.k1m(clause);
|
|
3989
|
+
if (result.j11()) {
|
|
3990
|
+
removed.v(ensureNotNull(result.v1l()));
|
|
3991
|
+
}
|
|
3992
|
+
}
|
|
3993
|
+
var tmp;
|
|
3994
|
+
if (removed.z()) {
|
|
3995
|
+
tmp = new Failure_0(this);
|
|
3996
|
+
} else {
|
|
3997
|
+
tmp = new Success_0(new IndexedTheory(newTheory, this.us()), removed);
|
|
3998
|
+
}
|
|
3999
|
+
return tmp;
|
|
4000
|
+
};
|
|
4001
|
+
protoOf(IndexedTheory).retractIterable = function (clauses) {
|
|
4002
|
+
return this.z1s(clauses);
|
|
4003
|
+
};
|
|
4004
|
+
protoOf(IndexedTheory).d1m = function (clause) {
|
|
4005
|
+
var newTheory = Companion_instance_4.ofIterable(this.k1l(), this.v1l());
|
|
4006
|
+
var retracted = newTheory.c1m(clause);
|
|
4007
|
+
return retracted.p1m() ? new Failure_0(this) : new Success_0(new IndexedTheory(retracted.n1m(), this.us()), ensureNotNull(retracted.v1l()));
|
|
4008
|
+
};
|
|
4009
|
+
protoOf(IndexedTheory).retractAll = function (clause) {
|
|
4010
|
+
return this.d1m(clause);
|
|
4011
|
+
};
|
|
4012
|
+
protoOf(IndexedTheory).hashCode = function () {
|
|
4013
|
+
return _get_hashCodeCache__ny3r0q_0(this);
|
|
4014
|
+
};
|
|
4015
|
+
protoOf(IndexedTheory).l = function () {
|
|
4016
|
+
return _get_sizeCache__6eswog(this);
|
|
4017
|
+
};
|
|
4018
|
+
protoOf(IndexedTheory).h11 = function (tags) {
|
|
4019
|
+
var tmp;
|
|
4020
|
+
if (tags === this.us()) {
|
|
4021
|
+
tmp = this;
|
|
4022
|
+
} else {
|
|
4023
|
+
tmp = new IndexedTheory(this.a1u(), tags);
|
|
4024
|
+
}
|
|
4025
|
+
return tmp;
|
|
4026
|
+
};
|
|
4027
|
+
protoOf(IndexedTheory).resetTags = function (tags) {
|
|
4028
|
+
return this.h11(tags);
|
|
4029
|
+
};
|
|
4030
|
+
function hashCodeCache$factory_0() {
|
|
4031
|
+
return getPropertyCallableRef('hashCodeCache', 1, KProperty1, function (receiver) {
|
|
4032
|
+
return _get_hashCodeCache__ny3r0q_0(receiver);
|
|
4033
|
+
}, null);
|
|
4034
|
+
}
|
|
4035
|
+
function sizeCache$factory() {
|
|
4036
|
+
return getPropertyCallableRef('sizeCache', 1, KProperty1, function (receiver) {
|
|
4037
|
+
return _get_sizeCache__6eswog(receiver);
|
|
4038
|
+
}, null);
|
|
4039
|
+
}
|
|
4040
|
+
function ListedTheory_init_$Init$(unificator, clauses, tags, $this) {
|
|
4041
|
+
tags = tags === VOID ? emptyMap() : tags;
|
|
4042
|
+
ListedTheory.call($this, unificator, toList_0(clauses), tags);
|
|
4043
|
+
TheoryUtils_instance.s1m(clauses);
|
|
4044
|
+
return $this;
|
|
4045
|
+
}
|
|
4046
|
+
function ListedTheory_init_$Create$(unificator, clauses, tags) {
|
|
4047
|
+
return ListedTheory_init_$Init$(unificator, clauses, tags, objectCreate(protoOf(ListedTheory)));
|
|
4048
|
+
}
|
|
4049
|
+
function ListedTheory_init_$Init$_0(unificator, clauses, tags, $this) {
|
|
4050
|
+
tags = tags === VOID ? emptyMap() : tags;
|
|
4051
|
+
ListedTheory.call($this, unificator, toList(clauses), tags);
|
|
4052
|
+
TheoryUtils_instance.p1s(clauses);
|
|
4053
|
+
return $this;
|
|
4054
|
+
}
|
|
4055
|
+
function ListedTheory_init_$Create$_0(unificator, clauses, tags) {
|
|
4056
|
+
return ListedTheory_init_$Init$_0(unificator, clauses, tags, objectCreate(protoOf(ListedTheory)));
|
|
4057
|
+
}
|
|
4058
|
+
function _get_hashCodeCache__ny3r0q_1($this) {
|
|
4059
|
+
// Inline function 'kotlin.getValue' call
|
|
4060
|
+
var this_0 = $this.m1u_1;
|
|
4061
|
+
hashCodeCache$factory_1();
|
|
4062
|
+
return this_0.r2();
|
|
4063
|
+
}
|
|
4064
|
+
function _get_sizeCache__6eswog_0($this) {
|
|
4065
|
+
// Inline function 'kotlin.getValue' call
|
|
4066
|
+
var this_0 = $this.n1u_1;
|
|
4067
|
+
sizeCache$factory_0();
|
|
4068
|
+
return this_0.r2();
|
|
4069
|
+
}
|
|
4070
|
+
function ListedTheory$hashCodeCache$delegate$lambda(this$0) {
|
|
4071
|
+
return function () {
|
|
4072
|
+
return protoOf(AbstractListedTheory).hashCode.call(this$0);
|
|
4073
|
+
};
|
|
4074
|
+
}
|
|
4075
|
+
function ListedTheory$sizeCache$delegate$lambda(this$0) {
|
|
4076
|
+
return function () {
|
|
4077
|
+
return protoOf(AbstractListedTheory).l.call(this$0);
|
|
4078
|
+
};
|
|
4079
|
+
}
|
|
4080
|
+
function ListedTheory(unificator, clauses, tags) {
|
|
4081
|
+
AbstractListedTheory.call(this, unificator, clauses, tags);
|
|
4082
|
+
var tmp = this;
|
|
4083
|
+
tmp.m1u_1 = lazy(ListedTheory$hashCodeCache$delegate$lambda(this));
|
|
4084
|
+
var tmp_0 = this;
|
|
4085
|
+
tmp_0.n1u_1 = lazy(ListedTheory$sizeCache$delegate$lambda(this));
|
|
4086
|
+
}
|
|
4087
|
+
protoOf(ListedTheory).x1s = function (clauses, tags, unificator) {
|
|
4088
|
+
return ListedTheory_init_$Create$_0(unificator, clauses, tags);
|
|
4089
|
+
};
|
|
4090
|
+
protoOf(ListedTheory).r1t = function (clause) {
|
|
4091
|
+
// Inline function 'kotlin.collections.filter' call
|
|
4092
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
4093
|
+
var this_0 = this.v1l();
|
|
4094
|
+
var destination = ArrayList_init_$Create$_0();
|
|
4095
|
+
var tmp0_iterator = this_0.r();
|
|
4096
|
+
while (tmp0_iterator.s()) {
|
|
4097
|
+
var element = tmp0_iterator.u();
|
|
4098
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.ListedTheory.retract.<anonymous>' call
|
|
4099
|
+
if (this.k1l().match(element, clause)) {
|
|
4100
|
+
destination.o(element);
|
|
4101
|
+
}
|
|
4102
|
+
}
|
|
4103
|
+
var retractability = destination;
|
|
4104
|
+
var tmp;
|
|
4105
|
+
if (none_0(retractability)) {
|
|
4106
|
+
tmp = new Failure_0(this);
|
|
4107
|
+
} else {
|
|
4108
|
+
var toBeActuallyRetracted = first(retractability);
|
|
4109
|
+
// Inline function 'kotlin.collections.filter' call
|
|
4110
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
4111
|
+
var this_1 = this.v1l();
|
|
4112
|
+
var destination_0 = ArrayList_init_$Create$_0();
|
|
4113
|
+
var tmp0_iterator_0 = this_1.r();
|
|
4114
|
+
while (tmp0_iterator_0.s()) {
|
|
4115
|
+
var element_0 = tmp0_iterator_0.u();
|
|
4116
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.ListedTheory.retract.<anonymous>' call
|
|
4117
|
+
if (!element_0.equals(toBeActuallyRetracted)) {
|
|
4118
|
+
destination_0.o(element_0);
|
|
4119
|
+
}
|
|
4120
|
+
}
|
|
4121
|
+
var newTheory = destination_0;
|
|
4122
|
+
tmp = new Success_0(new ListedTheory(this.k1l(), newTheory, this.us()), listOf_0(toBeActuallyRetracted));
|
|
4123
|
+
}
|
|
4124
|
+
return tmp;
|
|
4125
|
+
};
|
|
4126
|
+
protoOf(ListedTheory).retract = function (clause) {
|
|
4127
|
+
return this.r1t(clause);
|
|
4128
|
+
};
|
|
4129
|
+
protoOf(ListedTheory).o1t = function () {
|
|
4130
|
+
return Companion_instance_9.listedOfIterable(this.k1l(), this);
|
|
4131
|
+
};
|
|
4132
|
+
protoOf(ListedTheory).toMutableTheory = function () {
|
|
4133
|
+
return this.o1t();
|
|
4134
|
+
};
|
|
4135
|
+
protoOf(ListedTheory).z1s = function (clauses) {
|
|
4136
|
+
var residual = dequeOf_1(this.v1l());
|
|
4137
|
+
var removed = dequeOf([]);
|
|
4138
|
+
var i = residual.r();
|
|
4139
|
+
while (i.s()) {
|
|
4140
|
+
var current = i.u();
|
|
4141
|
+
var tmp$ret$0;
|
|
4142
|
+
$l$block_0: {
|
|
4143
|
+
// Inline function 'kotlin.collections.any' call
|
|
4144
|
+
var tmp;
|
|
4145
|
+
if (isInterface(clauses, Collection)) {
|
|
4146
|
+
tmp = clauses.z();
|
|
4147
|
+
} else {
|
|
4148
|
+
tmp = false;
|
|
4149
|
+
}
|
|
4150
|
+
if (tmp) {
|
|
4151
|
+
tmp$ret$0 = false;
|
|
4152
|
+
break $l$block_0;
|
|
4153
|
+
}
|
|
4154
|
+
var tmp0_iterator = clauses.r();
|
|
4155
|
+
while (tmp0_iterator.s()) {
|
|
4156
|
+
var element = tmp0_iterator.u();
|
|
4157
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.ListedTheory.retract.<anonymous>' call
|
|
4158
|
+
if (this.k1l().match(element, current)) {
|
|
4159
|
+
tmp$ret$0 = true;
|
|
4160
|
+
break $l$block_0;
|
|
4161
|
+
}
|
|
4162
|
+
}
|
|
4163
|
+
tmp$ret$0 = false;
|
|
4164
|
+
}
|
|
4165
|
+
if (tmp$ret$0) {
|
|
4166
|
+
i.t();
|
|
4167
|
+
removed.o(current);
|
|
4168
|
+
}
|
|
4169
|
+
}
|
|
4170
|
+
var tmp_0;
|
|
4171
|
+
if (removed.z()) {
|
|
4172
|
+
tmp_0 = new Failure_0(this);
|
|
4173
|
+
} else {
|
|
4174
|
+
tmp_0 = new Success_0(new ListedTheory(this.k1l(), residual, this.us()), removed);
|
|
4175
|
+
}
|
|
4176
|
+
return tmp_0;
|
|
4177
|
+
};
|
|
4178
|
+
protoOf(ListedTheory).retractIterable = function (clauses) {
|
|
4179
|
+
return this.z1s(clauses);
|
|
4180
|
+
};
|
|
4181
|
+
protoOf(ListedTheory).d1m = function (clause) {
|
|
4182
|
+
// Inline function 'kotlin.collections.filter' call
|
|
4183
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
4184
|
+
var this_0 = this.v1l();
|
|
4185
|
+
var destination = ArrayList_init_$Create$_0();
|
|
4186
|
+
var tmp0_iterator = this_0.r();
|
|
4187
|
+
while (tmp0_iterator.s()) {
|
|
4188
|
+
var element = tmp0_iterator.u();
|
|
4189
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.ListedTheory.retractAll.<anonymous>' call
|
|
4190
|
+
if (this.k1l().match(element, clause)) {
|
|
4191
|
+
destination.o(element);
|
|
4192
|
+
}
|
|
4193
|
+
}
|
|
4194
|
+
var retractability = destination;
|
|
4195
|
+
var tmp;
|
|
4196
|
+
if (none_0(retractability)) {
|
|
4197
|
+
tmp = new Failure_0(this);
|
|
4198
|
+
} else {
|
|
4199
|
+
// Inline function 'kotlin.collections.partition' call
|
|
4200
|
+
var this_1 = toList_0(this.v1l());
|
|
4201
|
+
var first = ArrayList_init_$Create$_0();
|
|
4202
|
+
var second = ArrayList_init_$Create$_0();
|
|
4203
|
+
var tmp0_iterator_0 = this_1.r();
|
|
4204
|
+
while (tmp0_iterator_0.s()) {
|
|
4205
|
+
var element_0 = tmp0_iterator_0.u();
|
|
4206
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.ListedTheory.retractAll.<anonymous>' call
|
|
4207
|
+
if (this.k1l().match(element_0, clause)) {
|
|
4208
|
+
first.o(element_0);
|
|
4209
|
+
} else {
|
|
4210
|
+
second.o(element_0);
|
|
4211
|
+
}
|
|
4212
|
+
}
|
|
4213
|
+
var partitionedClauses = new Pair(first, second);
|
|
4214
|
+
var newTheory = partitionedClauses.rd_1;
|
|
4215
|
+
var toBeActuallyRetracted = partitionedClauses.qd_1;
|
|
4216
|
+
tmp = new Success_0(new ListedTheory(this.k1l(), newTheory, this.us()), toBeActuallyRetracted);
|
|
4217
|
+
}
|
|
4218
|
+
return tmp;
|
|
4219
|
+
};
|
|
4220
|
+
protoOf(ListedTheory).retractAll = function (clause) {
|
|
4221
|
+
return this.d1m(clause);
|
|
4222
|
+
};
|
|
4223
|
+
protoOf(ListedTheory).hashCode = function () {
|
|
4224
|
+
return _get_hashCodeCache__ny3r0q_1(this);
|
|
4225
|
+
};
|
|
4226
|
+
protoOf(ListedTheory).l = function () {
|
|
4227
|
+
return _get_sizeCache__6eswog_0(this);
|
|
4228
|
+
};
|
|
4229
|
+
protoOf(ListedTheory).h11 = function (tags) {
|
|
4230
|
+
return tags === this.us() ? this : new ListedTheory(this.k1l(), this.v1l(), tags);
|
|
4231
|
+
};
|
|
4232
|
+
protoOf(ListedTheory).resetTags = function (tags) {
|
|
4233
|
+
return this.h11(tags);
|
|
4234
|
+
};
|
|
4235
|
+
protoOf(ListedTheory).o1s = function (theory) {
|
|
4236
|
+
return this.q1l() ? theory.toImmutableTheory() : theory.q1l() ? this : protoOf(AbstractListedTheory).o1s.call(this, theory);
|
|
4237
|
+
};
|
|
4238
|
+
protoOf(ListedTheory).plusTheory = function (theory) {
|
|
4239
|
+
return this.o1s(theory);
|
|
4240
|
+
};
|
|
4241
|
+
function hashCodeCache$factory_1() {
|
|
4242
|
+
return getPropertyCallableRef('hashCodeCache', 1, KProperty1, function (receiver) {
|
|
4243
|
+
return _get_hashCodeCache__ny3r0q_1(receiver);
|
|
4244
|
+
}, null);
|
|
4245
|
+
}
|
|
4246
|
+
function sizeCache$factory_0() {
|
|
4247
|
+
return getPropertyCallableRef('sizeCache', 1, KProperty1, function (receiver) {
|
|
4248
|
+
return _get_sizeCache__6eswog_0(receiver);
|
|
4249
|
+
}, null);
|
|
4250
|
+
}
|
|
4251
|
+
function MutableIndexedTheory_init_$Init$(unificator, clauses, tags, $this) {
|
|
4252
|
+
tags = tags === VOID ? emptyMap() : tags;
|
|
4253
|
+
MutableIndexedTheory.call($this, Companion_instance_5.ofIterable(unificator, clauses), tags);
|
|
4254
|
+
TheoryUtils_instance.s1m(clauses);
|
|
4255
|
+
return $this;
|
|
4256
|
+
}
|
|
4257
|
+
function MutableIndexedTheory_init_$Create$(unificator, clauses, tags) {
|
|
4258
|
+
return MutableIndexedTheory_init_$Init$(unificator, clauses, tags, objectCreate(protoOf(MutableIndexedTheory)));
|
|
4259
|
+
}
|
|
4260
|
+
function MutableIndexedTheory_init_$Init$_0(unificator, clauses, tags, $this) {
|
|
4261
|
+
tags = tags === VOID ? emptyMap() : tags;
|
|
4262
|
+
MutableIndexedTheory_init_$Init$(unificator, asIterable(clauses), tags, $this);
|
|
4263
|
+
return $this;
|
|
4264
|
+
}
|
|
4265
|
+
function MutableIndexedTheory_init_$Create$_0(unificator, clauses, tags) {
|
|
4266
|
+
return MutableIndexedTheory_init_$Init$_0(unificator, clauses, tags, objectCreate(protoOf(MutableIndexedTheory)));
|
|
4267
|
+
}
|
|
4268
|
+
function toRetractResult(_this__u8e3s4, $this) {
|
|
4269
|
+
return _this__u8e3s4.j11() ? new Success_0($this, ensureNotNull(_this__u8e3s4.v1l())) : new Failure_0($this);
|
|
4270
|
+
}
|
|
4271
|
+
function MutableIndexedTheory$retract$lambda(this$0) {
|
|
4272
|
+
return function (it) {
|
|
4273
|
+
return this$0.q1u_1.a1m(it);
|
|
4274
|
+
};
|
|
4275
|
+
}
|
|
4276
|
+
function MutableIndexedTheory$retract$lambda_0(it) {
|
|
4277
|
+
return it.j11();
|
|
4278
|
+
}
|
|
4279
|
+
function MutableIndexedTheory$retract$lambda_1(it) {
|
|
4280
|
+
return asSequence(ensureNotNull(it.v1l()));
|
|
4281
|
+
}
|
|
4282
|
+
function MutableIndexedTheory(queue, tags) {
|
|
4283
|
+
AbstractIndexedTheory.call(this, queue, tags);
|
|
4284
|
+
this.q1u_1 = queue;
|
|
4285
|
+
}
|
|
4286
|
+
protoOf(MutableIndexedTheory).a1u = function () {
|
|
4287
|
+
return this.q1u_1;
|
|
4288
|
+
};
|
|
4289
|
+
protoOf(MutableIndexedTheory).m1s = function (unificator) {
|
|
4290
|
+
return protoOf(AbstractIndexedTheory).m1s.call(this, unificator).toMutableTheory();
|
|
4291
|
+
};
|
|
4292
|
+
protoOf(MutableIndexedTheory).setUnificator = function (unificator) {
|
|
4293
|
+
return this.m1s(unificator);
|
|
4294
|
+
};
|
|
4295
|
+
protoOf(MutableIndexedTheory).o1t = function () {
|
|
4296
|
+
return toMutableTheory.call(this);
|
|
4297
|
+
};
|
|
4298
|
+
protoOf(MutableIndexedTheory).toMutableTheory = function () {
|
|
4299
|
+
return this.o1t();
|
|
4300
|
+
};
|
|
4301
|
+
protoOf(MutableIndexedTheory).v1l = function () {
|
|
4302
|
+
return toList_0(this.q1u_1);
|
|
4303
|
+
};
|
|
4304
|
+
protoOf(MutableIndexedTheory).r = function () {
|
|
4305
|
+
return this.q1u_1.r();
|
|
4306
|
+
};
|
|
4307
|
+
protoOf(MutableIndexedTheory).x1s = function (clauses, tags, unificator) {
|
|
4308
|
+
return MutableIndexedTheory_init_$Create$_0(unificator, clauses, tags);
|
|
4309
|
+
};
|
|
4310
|
+
protoOf(MutableIndexedTheory).r1t = function (clause) {
|
|
4311
|
+
return toRetractResult(this.q1u_1.a1m(clause), this);
|
|
4312
|
+
};
|
|
4313
|
+
protoOf(MutableIndexedTheory).retract = function (clause) {
|
|
4314
|
+
return this.r1t(clause);
|
|
4315
|
+
};
|
|
4316
|
+
protoOf(MutableIndexedTheory).z1s = function (clauses) {
|
|
4317
|
+
var tmp = asSequence(clauses);
|
|
4318
|
+
var tmp_0 = map(tmp, MutableIndexedTheory$retract$lambda(this));
|
|
4319
|
+
var tmp_1 = filter(tmp_0, MutableIndexedTheory$retract$lambda_0);
|
|
4320
|
+
var retracted = toList(flatMap(tmp_1, MutableIndexedTheory$retract$lambda_1));
|
|
4321
|
+
var tmp_2;
|
|
4322
|
+
if (retracted.z()) {
|
|
4323
|
+
tmp_2 = new Failure_0(this);
|
|
4324
|
+
} else {
|
|
4325
|
+
tmp_2 = new Success_0(this, retracted);
|
|
4326
|
+
}
|
|
4327
|
+
return tmp_2;
|
|
4328
|
+
};
|
|
4329
|
+
protoOf(MutableIndexedTheory).retractIterable = function (clauses) {
|
|
4330
|
+
return this.z1s(clauses);
|
|
4331
|
+
};
|
|
4332
|
+
protoOf(MutableIndexedTheory).d1m = function (clause) {
|
|
4333
|
+
return toRetractResult(this.q1u_1.c1m(clause), this);
|
|
4334
|
+
};
|
|
4335
|
+
protoOf(MutableIndexedTheory).retractAll = function (clause) {
|
|
4336
|
+
return this.d1m(clause);
|
|
4337
|
+
};
|
|
4338
|
+
protoOf(MutableIndexedTheory).c1s = function (clause) {
|
|
4339
|
+
return this.u1s(TheoryUtils_instance.h1m(clause));
|
|
4340
|
+
};
|
|
4341
|
+
protoOf(MutableIndexedTheory).plus = function (clause) {
|
|
4342
|
+
return this.c1s(clause);
|
|
4343
|
+
};
|
|
4344
|
+
protoOf(MutableIndexedTheory).o1s = function (theory) {
|
|
4345
|
+
var tmp;
|
|
4346
|
+
if (theory === this) {
|
|
4347
|
+
tmp = this.v1s(toList_0(theory));
|
|
4348
|
+
} else {
|
|
4349
|
+
tmp = this.v1s(theory);
|
|
4350
|
+
}
|
|
4351
|
+
return tmp;
|
|
4352
|
+
};
|
|
4353
|
+
protoOf(MutableIndexedTheory).plusTheory = function (theory) {
|
|
4354
|
+
return this.o1s(theory);
|
|
4355
|
+
};
|
|
4356
|
+
protoOf(MutableIndexedTheory).q1s = function (clause) {
|
|
4357
|
+
// Inline function 'kotlin.also' call
|
|
4358
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
4359
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.MutableIndexedTheory.assertA.<anonymous>' call
|
|
4360
|
+
this.q1u_1.i1m(TheoryUtils_instance.h1m(clause));
|
|
4361
|
+
return this;
|
|
4362
|
+
};
|
|
4363
|
+
protoOf(MutableIndexedTheory).assertA = function (clause) {
|
|
4364
|
+
return this.q1s(clause);
|
|
4365
|
+
};
|
|
4366
|
+
protoOf(MutableIndexedTheory).s1s = function (clauses) {
|
|
4367
|
+
// Inline function 'kotlin.also' call
|
|
4368
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
4369
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.MutableIndexedTheory.assertA.<anonymous>' call
|
|
4370
|
+
var tmp0_iterator = asReversed(toList_0(TheoryUtils_instance.s1m(clauses))).r();
|
|
4371
|
+
while (tmp0_iterator.s()) {
|
|
4372
|
+
var clause = tmp0_iterator.u();
|
|
4373
|
+
this.q1u_1.i1m(clause);
|
|
4374
|
+
}
|
|
4375
|
+
return this;
|
|
4376
|
+
};
|
|
4377
|
+
protoOf(MutableIndexedTheory).assertAIterable = function (clauses) {
|
|
4378
|
+
return this.s1s(clauses);
|
|
4379
|
+
};
|
|
4380
|
+
protoOf(MutableIndexedTheory).t1s = function (clauses) {
|
|
4381
|
+
return this.s1s(asIterable(clauses));
|
|
4382
|
+
};
|
|
4383
|
+
protoOf(MutableIndexedTheory).assertASequence = function (clauses) {
|
|
4384
|
+
return this.t1s(clauses);
|
|
4385
|
+
};
|
|
4386
|
+
protoOf(MutableIndexedTheory).u1s = function (clause) {
|
|
4387
|
+
// Inline function 'kotlin.also' call
|
|
4388
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
4389
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.MutableIndexedTheory.assertZ.<anonymous>' call
|
|
4390
|
+
this.q1u_1.j1m(TheoryUtils_instance.h1m(clause));
|
|
4391
|
+
return this;
|
|
4392
|
+
};
|
|
4393
|
+
protoOf(MutableIndexedTheory).assertZ = function (clause) {
|
|
4394
|
+
return this.u1s(clause);
|
|
4395
|
+
};
|
|
4396
|
+
protoOf(MutableIndexedTheory).v1s = function (clauses) {
|
|
4397
|
+
// Inline function 'kotlin.also' call
|
|
4398
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
4399
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.MutableIndexedTheory.assertZ.<anonymous>' call
|
|
4400
|
+
this.q1u_1.z1l(TheoryUtils_instance.s1m(clauses));
|
|
4401
|
+
return this;
|
|
4402
|
+
};
|
|
4403
|
+
protoOf(MutableIndexedTheory).assertZIterable = function (clauses) {
|
|
4404
|
+
return this.v1s(clauses);
|
|
4405
|
+
};
|
|
4406
|
+
protoOf(MutableIndexedTheory).w1s = function (clauses) {
|
|
4407
|
+
return this.v1s(TheoryUtils_instance.s1m(asIterable(clauses)));
|
|
4408
|
+
};
|
|
4409
|
+
protoOf(MutableIndexedTheory).assertZSequence = function (clauses) {
|
|
4410
|
+
return this.w1s(clauses);
|
|
4411
|
+
};
|
|
4412
|
+
protoOf(MutableIndexedTheory).y1s = function (clauses) {
|
|
4413
|
+
return this.z1s(asIterable(clauses));
|
|
4414
|
+
};
|
|
4415
|
+
protoOf(MutableIndexedTheory).retractSequence = function (clauses) {
|
|
4416
|
+
return this.y1s(clauses);
|
|
4417
|
+
};
|
|
4418
|
+
protoOf(MutableIndexedTheory).h1s = function (indicator) {
|
|
4419
|
+
return protoOf(AbstractIndexedTheory).h1s.call(this, indicator).toMutableTheory();
|
|
4420
|
+
};
|
|
4421
|
+
protoOf(MutableIndexedTheory).abolish = function (indicator) {
|
|
4422
|
+
return this.h1s(indicator);
|
|
4423
|
+
};
|
|
4424
|
+
protoOf(MutableIndexedTheory).b1s = function () {
|
|
4425
|
+
return Companion_instance_10.indexedOfIterable(this.k1l(), this);
|
|
4426
|
+
};
|
|
4427
|
+
protoOf(MutableIndexedTheory).toImmutableTheory = function () {
|
|
4428
|
+
return this.b1s();
|
|
4429
|
+
};
|
|
4430
|
+
protoOf(MutableIndexedTheory).h11 = function (tags) {
|
|
4431
|
+
return tags === this.us() ? this : new MutableIndexedTheory(this.q1u_1, tags);
|
|
4432
|
+
};
|
|
4433
|
+
protoOf(MutableIndexedTheory).resetTags = function (tags) {
|
|
4434
|
+
return this.h11(tags);
|
|
4435
|
+
};
|
|
4436
|
+
protoOf(MutableIndexedTheory).a1t = function () {
|
|
4437
|
+
return this.n1s(asSequence(this.v1l()));
|
|
4438
|
+
};
|
|
4439
|
+
protoOf(MutableIndexedTheory).clone = function () {
|
|
4440
|
+
return this.a1t();
|
|
4441
|
+
};
|
|
4442
|
+
protoOf(MutableIndexedTheory).assertAFact = function (struct) {
|
|
4443
|
+
return this.p1t(struct);
|
|
4444
|
+
};
|
|
4445
|
+
protoOf(MutableIndexedTheory).assertZFact = function (struct) {
|
|
4446
|
+
return this.q1t(struct);
|
|
4447
|
+
};
|
|
4448
|
+
protoOf(MutableIndexedTheory).retractByHead = function (head) {
|
|
4449
|
+
return this.s1t(head);
|
|
4450
|
+
};
|
|
4451
|
+
protoOf(MutableIndexedTheory).retractAllByHead = function (head) {
|
|
4452
|
+
return this.t1t(head);
|
|
4453
|
+
};
|
|
4454
|
+
function MutableListedTheory_init_$Init$(unificator, clauses, tags, $this) {
|
|
4455
|
+
tags = tags === VOID ? emptyMap() : tags;
|
|
4456
|
+
MutableListedTheory.call($this, unificator, toMutableList(clauses), tags);
|
|
4457
|
+
TheoryUtils_instance.s1m(clauses);
|
|
4458
|
+
return $this;
|
|
4459
|
+
}
|
|
4460
|
+
function MutableListedTheory_init_$Create$(unificator, clauses, tags) {
|
|
4461
|
+
return MutableListedTheory_init_$Init$(unificator, clauses, tags, objectCreate(protoOf(MutableListedTheory)));
|
|
4462
|
+
}
|
|
4463
|
+
function MutableListedTheory_init_$Init$_0(unificator, clauses, tags, $this) {
|
|
4464
|
+
tags = tags === VOID ? emptyMap() : tags;
|
|
4465
|
+
MutableListedTheory.call($this, unificator, toMutableList_0(clauses), tags);
|
|
4466
|
+
TheoryUtils_instance.p1s(clauses);
|
|
4467
|
+
return $this;
|
|
4468
|
+
}
|
|
4469
|
+
function MutableListedTheory_init_$Create$_0(unificator, clauses, tags) {
|
|
4470
|
+
return MutableListedTheory_init_$Init$_0(unificator, clauses, tags, objectCreate(protoOf(MutableListedTheory)));
|
|
4471
|
+
}
|
|
4472
|
+
function MutableListedTheory(unificator, clauses, tags) {
|
|
4473
|
+
AbstractListedTheory.call(this, unificator, clauses, tags);
|
|
4474
|
+
this.u1u_1 = clauses;
|
|
4475
|
+
}
|
|
4476
|
+
protoOf(MutableListedTheory).v1l = function () {
|
|
4477
|
+
return this.u1u_1;
|
|
4478
|
+
};
|
|
4479
|
+
protoOf(MutableListedTheory).m1s = function (unificator) {
|
|
4480
|
+
this.e1u(unificator);
|
|
4481
|
+
return this;
|
|
4482
|
+
};
|
|
4483
|
+
protoOf(MutableListedTheory).setUnificator = function (unificator) {
|
|
4484
|
+
return this.m1s(unificator);
|
|
4485
|
+
};
|
|
4486
|
+
protoOf(MutableListedTheory).o1t = function () {
|
|
4487
|
+
return toMutableTheory.call(this);
|
|
4488
|
+
};
|
|
4489
|
+
protoOf(MutableListedTheory).toMutableTheory = function () {
|
|
4490
|
+
return this.o1t();
|
|
4491
|
+
};
|
|
4492
|
+
protoOf(MutableListedTheory).x1s = function (clauses, tags, unificator) {
|
|
4493
|
+
return MutableListedTheory_init_$Create$_0(unificator, clauses, tags);
|
|
4494
|
+
};
|
|
4495
|
+
protoOf(MutableListedTheory).r1t = function (clause) {
|
|
4496
|
+
var i = this.u1u_1.z1();
|
|
4497
|
+
while (i.s()) {
|
|
4498
|
+
var c = i.u();
|
|
4499
|
+
if (this.k1l().match(c, clause)) {
|
|
4500
|
+
i.t();
|
|
4501
|
+
return new Success_0(this, listOf_0(c));
|
|
4502
|
+
}
|
|
4503
|
+
}
|
|
4504
|
+
return new Failure_0(this);
|
|
4505
|
+
};
|
|
4506
|
+
protoOf(MutableListedTheory).retract = function (clause) {
|
|
4507
|
+
return this.r1t(clause);
|
|
4508
|
+
};
|
|
4509
|
+
protoOf(MutableListedTheory).z1s = function (clauses) {
|
|
4510
|
+
var i = this.u1u_1.z1();
|
|
4511
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
4512
|
+
var retracted = ArrayList_init_$Create$_0();
|
|
4513
|
+
while (i.s()) {
|
|
4514
|
+
var c = i.u();
|
|
4515
|
+
var tmp0_iterator = clauses.r();
|
|
4516
|
+
while (tmp0_iterator.s()) {
|
|
4517
|
+
var clause = tmp0_iterator.u();
|
|
4518
|
+
if (this.k1l().match(c, clause)) {
|
|
4519
|
+
retracted.o(c);
|
|
4520
|
+
i.t();
|
|
4521
|
+
}
|
|
4522
|
+
}
|
|
4523
|
+
}
|
|
4524
|
+
var tmp;
|
|
4525
|
+
if (retracted.z()) {
|
|
4526
|
+
tmp = new Failure_0(this);
|
|
4527
|
+
} else {
|
|
4528
|
+
tmp = new Success_0(this, retracted);
|
|
4529
|
+
}
|
|
4530
|
+
return tmp;
|
|
4531
|
+
};
|
|
4532
|
+
protoOf(MutableListedTheory).retractIterable = function (clauses) {
|
|
4533
|
+
return this.z1s(clauses);
|
|
4534
|
+
};
|
|
4535
|
+
protoOf(MutableListedTheory).d1m = function (clause) {
|
|
4536
|
+
var i = this.u1u_1.z1();
|
|
4537
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
4538
|
+
var retracted = ArrayList_init_$Create$_0();
|
|
4539
|
+
while (i.s()) {
|
|
4540
|
+
var c = i.u();
|
|
4541
|
+
if (this.k1l().match(c, clause)) {
|
|
4542
|
+
retracted.o(c);
|
|
4543
|
+
i.t();
|
|
4544
|
+
}
|
|
4545
|
+
}
|
|
4546
|
+
var tmp;
|
|
4547
|
+
if (retracted.z()) {
|
|
4548
|
+
tmp = new Failure_0(this);
|
|
4549
|
+
} else {
|
|
4550
|
+
tmp = new Success_0(this, retracted);
|
|
4551
|
+
}
|
|
4552
|
+
return tmp;
|
|
4553
|
+
};
|
|
4554
|
+
protoOf(MutableListedTheory).retractAll = function (clause) {
|
|
4555
|
+
return this.d1m(clause);
|
|
4556
|
+
};
|
|
4557
|
+
protoOf(MutableListedTheory).c1s = function (clause) {
|
|
4558
|
+
return this.u1s(clause);
|
|
4559
|
+
};
|
|
4560
|
+
protoOf(MutableListedTheory).plus = function (clause) {
|
|
4561
|
+
return this.c1s(clause);
|
|
4562
|
+
};
|
|
4563
|
+
protoOf(MutableListedTheory).o1s = function (theory) {
|
|
4564
|
+
var tmp;
|
|
4565
|
+
if (theory === this) {
|
|
4566
|
+
tmp = this.v1s(toList_0(theory));
|
|
4567
|
+
} else {
|
|
4568
|
+
tmp = this.v1s(theory);
|
|
4569
|
+
}
|
|
4570
|
+
return tmp;
|
|
4571
|
+
};
|
|
4572
|
+
protoOf(MutableListedTheory).plusTheory = function (theory) {
|
|
4573
|
+
return this.o1s(theory);
|
|
4574
|
+
};
|
|
4575
|
+
protoOf(MutableListedTheory).q1s = function (clause) {
|
|
4576
|
+
// Inline function 'kotlin.also' call
|
|
4577
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
4578
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.MutableListedTheory.assertA.<anonymous>' call
|
|
4579
|
+
addFirst(this.u1u_1, TheoryUtils_instance.h1m(clause));
|
|
4580
|
+
return this;
|
|
4581
|
+
};
|
|
4582
|
+
protoOf(MutableListedTheory).assertA = function (clause) {
|
|
4583
|
+
return this.q1s(clause);
|
|
4584
|
+
};
|
|
4585
|
+
protoOf(MutableListedTheory).s1s = function (clauses) {
|
|
4586
|
+
// Inline function 'kotlin.also' call
|
|
4587
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
4588
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.MutableListedTheory.assertA.<anonymous>' call
|
|
4589
|
+
addFirst_0(this.u1u_1, TheoryUtils_instance.s1m(clauses));
|
|
4590
|
+
return this;
|
|
4591
|
+
};
|
|
4592
|
+
protoOf(MutableListedTheory).assertAIterable = function (clauses) {
|
|
4593
|
+
return this.s1s(clauses);
|
|
4594
|
+
};
|
|
4595
|
+
protoOf(MutableListedTheory).t1s = function (clauses) {
|
|
4596
|
+
return this.s1s(asIterable(clauses));
|
|
4597
|
+
};
|
|
4598
|
+
protoOf(MutableListedTheory).assertASequence = function (clauses) {
|
|
4599
|
+
return this.t1s(clauses);
|
|
4600
|
+
};
|
|
4601
|
+
protoOf(MutableListedTheory).u1s = function (clause) {
|
|
4602
|
+
// Inline function 'kotlin.also' call
|
|
4603
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
4604
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.MutableListedTheory.assertZ.<anonymous>' call
|
|
4605
|
+
this.u1u_1.o(TheoryUtils_instance.h1m(clause));
|
|
4606
|
+
return this;
|
|
4607
|
+
};
|
|
4608
|
+
protoOf(MutableListedTheory).assertZ = function (clause) {
|
|
4609
|
+
return this.u1s(clause);
|
|
4610
|
+
};
|
|
4611
|
+
protoOf(MutableListedTheory).v1s = function (clauses) {
|
|
4612
|
+
// Inline function 'kotlin.also' call
|
|
4613
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
4614
|
+
// Inline function 'it.unibo.tuprolog.theory.impl.MutableListedTheory.assertZ.<anonymous>' call
|
|
4615
|
+
addAll(this.u1u_1, TheoryUtils_instance.s1m(clauses));
|
|
4616
|
+
return this;
|
|
4617
|
+
};
|
|
4618
|
+
protoOf(MutableListedTheory).assertZIterable = function (clauses) {
|
|
4619
|
+
return this.v1s(clauses);
|
|
4620
|
+
};
|
|
4621
|
+
protoOf(MutableListedTheory).w1s = function (clauses) {
|
|
4622
|
+
return this.v1s(asIterable(clauses));
|
|
4623
|
+
};
|
|
4624
|
+
protoOf(MutableListedTheory).assertZSequence = function (clauses) {
|
|
4625
|
+
return this.w1s(clauses);
|
|
4626
|
+
};
|
|
4627
|
+
protoOf(MutableListedTheory).y1s = function (clauses) {
|
|
4628
|
+
return this.z1s(asIterable(clauses));
|
|
4629
|
+
};
|
|
4630
|
+
protoOf(MutableListedTheory).retractSequence = function (clauses) {
|
|
4631
|
+
return this.y1s(clauses);
|
|
4632
|
+
};
|
|
4633
|
+
protoOf(MutableListedTheory).h1s = function (indicator) {
|
|
4634
|
+
return protoOf(AbstractListedTheory).h1s.call(this, indicator).toMutableTheory();
|
|
4635
|
+
};
|
|
4636
|
+
protoOf(MutableListedTheory).abolish = function (indicator) {
|
|
4637
|
+
return this.h1s(indicator);
|
|
4638
|
+
};
|
|
4639
|
+
protoOf(MutableListedTheory).b1s = function () {
|
|
4640
|
+
return Companion_instance_10.listedOfIterable(this.k1l(), this);
|
|
4641
|
+
};
|
|
4642
|
+
protoOf(MutableListedTheory).toImmutableTheory = function () {
|
|
4643
|
+
return this.b1s();
|
|
4644
|
+
};
|
|
4645
|
+
protoOf(MutableListedTheory).h11 = function (tags) {
|
|
4646
|
+
return tags === this.us() ? this : new MutableListedTheory(this.k1l(), this.u1u_1, tags);
|
|
4647
|
+
};
|
|
4648
|
+
protoOf(MutableListedTheory).resetTags = function (tags) {
|
|
4649
|
+
return this.h11(tags);
|
|
4650
|
+
};
|
|
4651
|
+
protoOf(MutableListedTheory).a1t = function () {
|
|
4652
|
+
return this.n1s(asSequence(this.u1u_1));
|
|
4653
|
+
};
|
|
4654
|
+
protoOf(MutableListedTheory).clone = function () {
|
|
4655
|
+
return this.a1t();
|
|
4656
|
+
};
|
|
4657
|
+
protoOf(MutableListedTheory).assertAFact = function (struct) {
|
|
4658
|
+
return this.p1t(struct);
|
|
4659
|
+
};
|
|
4660
|
+
protoOf(MutableListedTheory).assertZFact = function (struct) {
|
|
4661
|
+
return this.q1t(struct);
|
|
4662
|
+
};
|
|
4663
|
+
protoOf(MutableListedTheory).retractByHead = function (head) {
|
|
4664
|
+
return this.s1t(head);
|
|
4665
|
+
};
|
|
4666
|
+
protoOf(MutableListedTheory).retractAllByHead = function (head) {
|
|
4667
|
+
return this.t1t(head);
|
|
4668
|
+
};
|
|
4669
|
+
function takeFirstAfterSkipping(_this__u8e3s4, n) {
|
|
4670
|
+
var iter = _this__u8e3s4.r();
|
|
4671
|
+
// Inline function 'kotlin.repeat' call
|
|
4672
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
4673
|
+
var inductionVariable = 0;
|
|
4674
|
+
if (inductionVariable < n)
|
|
4675
|
+
do {
|
|
4676
|
+
var index = inductionVariable;
|
|
4677
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
4678
|
+
// Inline function 'it.unibo.tuprolog.collections.rete.takeFirstAfterSkipping.<anonymous>' call
|
|
4679
|
+
iter.u();
|
|
4680
|
+
}
|
|
4681
|
+
while (inductionVariable < n);
|
|
4682
|
+
return iter.u();
|
|
4683
|
+
}
|
|
4684
|
+
//region block: post-declaration
|
|
4685
|
+
defineProp(protoOf(RetrieveResult), 'collection', function () {
|
|
4686
|
+
return this.n1m();
|
|
4687
|
+
});
|
|
4688
|
+
defineProp(protoOf(RetrieveResult), 'clauses', function () {
|
|
4689
|
+
return this.v1l();
|
|
4690
|
+
});
|
|
4691
|
+
defineProp(protoOf(RetrieveResult), 'firstClause', function () {
|
|
4692
|
+
return this.o1m();
|
|
4693
|
+
});
|
|
4694
|
+
protoOf(MutableReteClauseQueue).t1l = get;
|
|
4695
|
+
protoOf(ReteClauseQueue).t1l = get;
|
|
4696
|
+
protoOf(IndexedClause$Companion$wrap$1).q1n = get_innerClause;
|
|
4697
|
+
protoOf(IndexedClause$Companion$wrap$1).y1o = plus_1;
|
|
4698
|
+
protoOf(IndexedClause$Companion$wrap$1).is = compareTo;
|
|
4699
|
+
protoOf(SituatedIndexedClause$Companion$of$1).q1n = get_innerClause;
|
|
4700
|
+
protoOf(SituatedIndexedClause$Companion$of$1).y1o = plus_1;
|
|
4701
|
+
protoOf(SituatedIndexedClause$Companion$of$1).is = compareTo;
|
|
4702
|
+
protoOf(AbstractTheory).b1t = get_isMutable;
|
|
4703
|
+
protoOf(AbstractTheory).p1l = get_rules;
|
|
4704
|
+
protoOf(AbstractTheory).o1l = get_directives;
|
|
4705
|
+
protoOf(AbstractTheory).assertAFact = assertAFact;
|
|
4706
|
+
protoOf(AbstractTheory).assertZFact = assertZFact;
|
|
4707
|
+
protoOf(AbstractTheory).retractByHead = retractByHead;
|
|
4708
|
+
protoOf(AbstractTheory).retractAllByHead = retractAllByHead;
|
|
4709
|
+
protoOf(AbstractTheory).getTag = getTag;
|
|
4710
|
+
protoOf(AbstractTheory).containsTag = containsTag;
|
|
4711
|
+
protoOf(IndexedTheoryFactory).emptyTheory = emptyTheory;
|
|
4712
|
+
protoOf(IndexedTheoryFactory).theoryOfIterable = theoryOfIterable;
|
|
4713
|
+
protoOf(IndexedTheoryFactory).theoryOf = theoryOf;
|
|
4714
|
+
protoOf(IndexedTheoryFactory).theoryOfSequence = theoryOfSequence;
|
|
4715
|
+
protoOf(IndexedTheoryFactory).emptyMutableTheory = emptyMutableTheory;
|
|
4716
|
+
protoOf(IndexedTheoryFactory).mutableTheoryOfIterable = mutableTheoryOfIterable;
|
|
4717
|
+
protoOf(IndexedTheoryFactory).mutableTheoryOf = mutableTheoryOf;
|
|
4718
|
+
protoOf(IndexedTheoryFactory).mutableTheoryOfSequence = mutableTheoryOfSequence;
|
|
4719
|
+
protoOf(ListedTheoryFactory).emptyTheory = emptyTheory;
|
|
4720
|
+
protoOf(ListedTheoryFactory).theoryOfIterable = theoryOfIterable;
|
|
4721
|
+
protoOf(ListedTheoryFactory).theoryOf = theoryOf;
|
|
4722
|
+
protoOf(ListedTheoryFactory).theoryOfSequence = theoryOfSequence;
|
|
4723
|
+
protoOf(ListedTheoryFactory).emptyMutableTheory = emptyMutableTheory;
|
|
4724
|
+
protoOf(ListedTheoryFactory).mutableTheoryOfIterable = mutableTheoryOfIterable;
|
|
4725
|
+
protoOf(ListedTheoryFactory).mutableTheoryOf = mutableTheoryOf;
|
|
4726
|
+
protoOf(ListedTheoryFactory).mutableTheoryOfSequence = mutableTheoryOfSequence;
|
|
4727
|
+
defineProp(protoOf(RetractResult), 'theory', function () {
|
|
4728
|
+
return this.i1s();
|
|
4729
|
+
});
|
|
4730
|
+
defineProp(protoOf(RetractResult), 'clauses', function () {
|
|
4731
|
+
return this.v1l();
|
|
4732
|
+
});
|
|
4733
|
+
defineProp(protoOf(RetractResult), 'firstClause', function () {
|
|
4734
|
+
return this.o1m();
|
|
4735
|
+
});
|
|
4736
|
+
protoOf(MutableIndexedTheory).p1t = assertAFact_0;
|
|
4737
|
+
protoOf(MutableIndexedTheory).q1t = assertZFact_0;
|
|
4738
|
+
protoOf(MutableIndexedTheory).s1t = retractByHead_0;
|
|
4739
|
+
protoOf(MutableIndexedTheory).b1t = get_isMutable_0;
|
|
4740
|
+
protoOf(MutableIndexedTheory).t1t = retractAllByHead_0;
|
|
4741
|
+
protoOf(MutableListedTheory).p1t = assertAFact_0;
|
|
4742
|
+
protoOf(MutableListedTheory).q1t = assertZFact_0;
|
|
4743
|
+
protoOf(MutableListedTheory).s1t = retractByHead_0;
|
|
4744
|
+
protoOf(MutableListedTheory).b1t = get_isMutable_0;
|
|
4745
|
+
protoOf(MutableListedTheory).t1t = retractAllByHead_0;
|
|
4746
|
+
//endregion
|
|
4747
|
+
//region block: init
|
|
4748
|
+
Companion_instance_4 = new Companion();
|
|
4749
|
+
Companion_instance_5 = new Companion_0();
|
|
4750
|
+
Companion_instance_6 = new Companion_1();
|
|
4751
|
+
Utils_instance = new Utils();
|
|
4752
|
+
Companion_instance_7 = new Companion_2();
|
|
4753
|
+
Companion_instance_8 = new Companion_3();
|
|
4754
|
+
Companion_instance_9 = new Companion_4();
|
|
4755
|
+
Companion_instance_10 = new Companion_5();
|
|
4756
|
+
TheoryUtils_instance = new TheoryUtils();
|
|
4757
|
+
//endregion
|
|
4758
|
+
//region block: exports
|
|
4759
|
+
_.$_$ = _.$_$ || {};
|
|
4760
|
+
_.$_$.a = Companion_instance_9;
|
|
4761
|
+
_.$_$.b = Companion_instance_10;
|
|
4762
|
+
_.$_$.c = IndexedTheoryFactory;
|
|
4763
|
+
_.$_$.d = MutableTheory;
|
|
4764
|
+
_.$_$.e = Success_0;
|
|
4765
|
+
_.$_$.f = TheoryFactory;
|
|
4766
|
+
_.$_$.g = Theory;
|
|
4767
|
+
//endregion
|
|
4768
|
+
return _;
|
|
4769
|
+
}));
|
|
4770
|
+
|
|
4771
|
+
//# sourceMappingURL=2p-theory.js.map
|