@tuprolog/2p-full 1.3.1 → 1.4.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-bdd.js +136 -136
- package/2p-core.js +1017 -863
- package/2p-core.js.map +1 -1
- package/2p-solve-classic.js +792 -792
- package/2p-solve-plp.js +1 -1
- package/2p-solve-problog.js +894 -894
- package/2p-solve-streams.js +619 -619
- package/2p-solve.js +2658 -2658
- package/2p-solve.js.map +1 -1
- package/2p-theory.js +1204 -1204
- package/2p-theory.js.map +1 -1
- package/2p-unify.js +520 -194
- package/2p-unify.js.map +1 -1
- package/README.md +3 -3
- package/kotlin-kotlin-stdlib.js +7 -7
- package/package.json +1 -1
package/2p-unify.js
CHANGED
|
@@ -19,6 +19,12 @@
|
|
|
19
19
|
'use strict';
|
|
20
20
|
//region block: imports
|
|
21
21
|
var imul = Math.imul;
|
|
22
|
+
var protoOf = kotlin_kotlin.$_$.p6;
|
|
23
|
+
var getBooleanHashCode = kotlin_kotlin.$_$.v5;
|
|
24
|
+
var initMetadataForClass = kotlin_kotlin.$_$.a6;
|
|
25
|
+
var toString = kotlin_kotlin.$_$.s6;
|
|
26
|
+
var hashCode = kotlin_kotlin.$_$.z5;
|
|
27
|
+
var equals = kotlin_kotlin.$_$.t5;
|
|
22
28
|
var KProperty1 = kotlin_kotlin.$_$.h7;
|
|
23
29
|
var getPropertyCallableRef = kotlin_kotlin.$_$.x5;
|
|
24
30
|
var asSequence = kotlin_kotlin.$_$.z1;
|
|
@@ -30,49 +36,48 @@
|
|
|
30
36
|
var toCollection = kotlin_kotlin.$_$.t8;
|
|
31
37
|
var constructCallableReference = kotlin_kotlin.$_$.r5;
|
|
32
38
|
var Pair = kotlin_kotlin.$_$.la;
|
|
33
|
-
var VOID = kotlin_kotlin.$_$.b;
|
|
34
39
|
var lazy = kotlin_kotlin.$_$.ta;
|
|
35
|
-
var protoOf = kotlin_kotlin.$_$.p6;
|
|
36
40
|
var asSequence_0 = kotlin_kotlin.$_$.a2;
|
|
37
41
|
var THROW_CCE = kotlin_kotlin.$_$.na;
|
|
38
|
-
var
|
|
42
|
+
var VOID = kotlin_kotlin.$_$.b;
|
|
39
43
|
var Companion_instance = kotlin_it_unibo_tuprolog_utils.$_$.a;
|
|
40
44
|
var Triple = kotlin_kotlin.$_$.pa;
|
|
41
45
|
var Some = kotlin_it_unibo_tuprolog_utils.$_$.k;
|
|
42
46
|
var zip = kotlin_kotlin.$_$.a9;
|
|
43
47
|
var flatMap = kotlin_kotlin.$_$.y7;
|
|
44
48
|
var sequenceOf = kotlin_kotlin.$_$.o8;
|
|
45
|
-
var
|
|
49
|
+
var defineProp = kotlin_kotlin.$_$.s5;
|
|
46
50
|
var sequenceOf_0 = kotlin_kotlin.$_$.n8;
|
|
47
51
|
var initMetadataForCompanion = kotlin_kotlin.$_$.b6;
|
|
48
|
-
var toString = kotlin_kotlin.$_$.s6;
|
|
49
52
|
var getKClass = kotlin_kotlin.$_$.g7;
|
|
50
53
|
var ClassCastException_init_$Create$ = kotlin_kotlin.$_$.z;
|
|
54
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.b1;
|
|
55
|
+
var to = kotlin_kotlin.$_$.ya;
|
|
51
56
|
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.o;
|
|
52
57
|
var castTo = kotlin_it_unibo_tuprolog_utils.$_$.e;
|
|
53
|
-
var defineProp = kotlin_kotlin.$_$.s5;
|
|
54
58
|
var Castable = kotlin_it_unibo_tuprolog_utils.$_$.f;
|
|
55
59
|
var collectionSizeOrDefault = kotlin_kotlin.$_$.d2;
|
|
56
60
|
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.n;
|
|
57
|
-
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.b1;
|
|
58
61
|
var initMetadataForInterface = kotlin_kotlin.$_$.d6;
|
|
59
62
|
//endregion
|
|
60
63
|
//region block: pre-declaration
|
|
64
|
+
initMetadataForClass(Mgu, 'Mgu');
|
|
65
|
+
initMetadataForClass(Merge, 'Merge');
|
|
61
66
|
function mguWithOccurCheck(term1, term2, occurCheckEnabled, $super) {
|
|
62
67
|
occurCheckEnabled = occurCheckEnabled === VOID ? true : occurCheckEnabled;
|
|
63
|
-
return $super === VOID ? this.
|
|
68
|
+
return $super === VOID ? this.i1i(term1, term2, occurCheckEnabled) : $super.i1i.call(this, term1, term2, occurCheckEnabled);
|
|
64
69
|
}
|
|
65
70
|
function mgu(term1, term2) {
|
|
66
|
-
return this.
|
|
71
|
+
return this.i1i(term1, term2, true);
|
|
67
72
|
}
|
|
68
73
|
function matchWithOccurCheck(term1, term2, occurCheckEnabled) {
|
|
69
|
-
return !(this.
|
|
74
|
+
return !(this.i1i(term1, term2, occurCheckEnabled) === Companion_getInstance().failed());
|
|
70
75
|
}
|
|
71
76
|
function match(term1, term2) {
|
|
72
77
|
return this.matchWithOccurCheck(term1, term2, true);
|
|
73
78
|
}
|
|
74
79
|
function unifyWithOccurCheck(term1, term2, occurCheckEnabled) {
|
|
75
|
-
var substitution = this.
|
|
80
|
+
var substitution = this.i1i(term1, term2, occurCheckEnabled);
|
|
76
81
|
return substitution.e10() ? null : term1.getSubstituted(substitution, []);
|
|
77
82
|
}
|
|
78
83
|
function unify(term1, term2) {
|
|
@@ -87,6 +92,8 @@
|
|
|
87
92
|
initMetadataForClass(Equation, 'Equation', VOID, VOID, [Castable]);
|
|
88
93
|
initMetadataForClass(Identity, 'Identity', VOID, Equation);
|
|
89
94
|
initMetadataForClass(Assignment, 'Assignment', VOID, Equation);
|
|
95
|
+
initMetadataForClass(LeftAssignment, 'LeftAssignment', VOID, Assignment);
|
|
96
|
+
initMetadataForClass(RightAssignment, 'RightAssignment', VOID, Assignment);
|
|
90
97
|
initMetadataForClass(Comparison, 'Comparison', VOID, Equation);
|
|
91
98
|
initMetadataForClass(Contradiction, 'Contradiction', VOID, Equation);
|
|
92
99
|
initMetadataForCompanion(Companion);
|
|
@@ -94,8 +101,62 @@
|
|
|
94
101
|
initMetadataForClass(Unificator$Companion$strict$1, VOID, VOID, AbstractUnificator);
|
|
95
102
|
initMetadataForCompanion(Companion_0);
|
|
96
103
|
//endregion
|
|
104
|
+
function Mgu(term1, term2, occurCheckEnabled) {
|
|
105
|
+
this.g1h_1 = term1;
|
|
106
|
+
this.h1h_1 = term2;
|
|
107
|
+
this.i1h_1 = occurCheckEnabled;
|
|
108
|
+
}
|
|
109
|
+
protoOf(Mgu).toString = function () {
|
|
110
|
+
return 'Mgu(term1=' + this.g1h_1.toString() + ', term2=' + this.h1h_1.toString() + ', occurCheckEnabled=' + this.i1h_1 + ')';
|
|
111
|
+
};
|
|
112
|
+
protoOf(Mgu).hashCode = function () {
|
|
113
|
+
var result = this.g1h_1.hashCode();
|
|
114
|
+
result = imul(result, 31) + this.h1h_1.hashCode() | 0;
|
|
115
|
+
result = imul(result, 31) + getBooleanHashCode(this.i1h_1) | 0;
|
|
116
|
+
return result;
|
|
117
|
+
};
|
|
118
|
+
protoOf(Mgu).equals = function (other) {
|
|
119
|
+
if (this === other)
|
|
120
|
+
return true;
|
|
121
|
+
if (!(other instanceof Mgu))
|
|
122
|
+
return false;
|
|
123
|
+
if (!this.g1h_1.equals(other.g1h_1))
|
|
124
|
+
return false;
|
|
125
|
+
if (!this.h1h_1.equals(other.h1h_1))
|
|
126
|
+
return false;
|
|
127
|
+
if (!(this.i1h_1 === other.i1h_1))
|
|
128
|
+
return false;
|
|
129
|
+
return true;
|
|
130
|
+
};
|
|
131
|
+
function Merge(substitution1, substitution2, occurCheckEnabled) {
|
|
132
|
+
this.j1h_1 = substitution1;
|
|
133
|
+
this.k1h_1 = substitution2;
|
|
134
|
+
this.l1h_1 = occurCheckEnabled;
|
|
135
|
+
}
|
|
136
|
+
protoOf(Merge).toString = function () {
|
|
137
|
+
return 'Merge(substitution1=' + toString(this.j1h_1) + ', substitution2=' + toString(this.k1h_1) + ', occurCheckEnabled=' + this.l1h_1 + ')';
|
|
138
|
+
};
|
|
139
|
+
protoOf(Merge).hashCode = function () {
|
|
140
|
+
var result = hashCode(this.j1h_1);
|
|
141
|
+
result = imul(result, 31) + hashCode(this.k1h_1) | 0;
|
|
142
|
+
result = imul(result, 31) + getBooleanHashCode(this.l1h_1) | 0;
|
|
143
|
+
return result;
|
|
144
|
+
};
|
|
145
|
+
protoOf(Merge).equals = function (other) {
|
|
146
|
+
if (this === other)
|
|
147
|
+
return true;
|
|
148
|
+
if (!(other instanceof Merge))
|
|
149
|
+
return false;
|
|
150
|
+
if (!equals(this.j1h_1, other.j1h_1))
|
|
151
|
+
return false;
|
|
152
|
+
if (!equals(this.k1h_1, other.k1h_1))
|
|
153
|
+
return false;
|
|
154
|
+
if (!(this.l1h_1 === other.l1h_1))
|
|
155
|
+
return false;
|
|
156
|
+
return true;
|
|
157
|
+
};
|
|
97
158
|
function _get_contextEquations__x0dd77($this) {
|
|
98
|
-
var tmp0 = $this.
|
|
159
|
+
var tmp0 = $this.n1h_1;
|
|
99
160
|
var tmp = KProperty1;
|
|
100
161
|
// Inline function 'kotlin.getValue' call
|
|
101
162
|
getPropertyCallableRef('contextEquations', 1, tmp, AbstractUnificator$_get_contextEquations_$ref_7ajcte(), null);
|
|
@@ -104,7 +165,7 @@
|
|
|
104
165
|
function occurrenceCheck($this, variable, term) {
|
|
105
166
|
var tmp;
|
|
106
167
|
if (term.tu()) {
|
|
107
|
-
tmp = $this.
|
|
168
|
+
tmp = $this.o1h(variable, term);
|
|
108
169
|
} else if (term.du()) {
|
|
109
170
|
var tmp0 = term.zt();
|
|
110
171
|
var tmp$ret$0;
|
|
@@ -128,7 +189,7 @@
|
|
|
128
189
|
}
|
|
129
190
|
function equationsFor($this, term1, term2) {
|
|
130
191
|
var tmp = Companion_instance_0;
|
|
131
|
-
return tmp.
|
|
192
|
+
return tmp.p1h(term1, term2, AbstractUnificator$checkTermsEquality$ref($this));
|
|
132
193
|
}
|
|
133
194
|
function equationsFor_0($this, substitution1, substitution2) {
|
|
134
195
|
var tmp = Companion_instance_0;
|
|
@@ -156,36 +217,37 @@
|
|
|
156
217
|
while (inductionVariable_0 < last);
|
|
157
218
|
return changed._v;
|
|
158
219
|
}
|
|
159
|
-
function mgu_0($this, equations, occurCheckEnabled) {
|
|
220
|
+
function mgu_0($this, request, equations, occurCheckEnabled) {
|
|
160
221
|
var changed = true;
|
|
161
222
|
while (changed) {
|
|
162
223
|
changed = false;
|
|
163
224
|
var eqIterator = equations.b4();
|
|
164
225
|
while (eqIterator.q()) {
|
|
165
|
-
var eq = eqIterator.r();
|
|
166
|
-
if (eq.
|
|
226
|
+
var eq = $this.q1h(request, eqIterator.r());
|
|
227
|
+
if (eq.v1h()) {
|
|
167
228
|
return Companion_getInstance().failed();
|
|
168
|
-
} else if (eq.
|
|
229
|
+
} else if (eq.w1h()) {
|
|
169
230
|
eqIterator.b3();
|
|
170
231
|
changed = true;
|
|
171
|
-
} else if (eq.
|
|
172
|
-
var assignment = eq.
|
|
173
|
-
if (occurCheckEnabled && occurrenceCheck($this, assignment.
|
|
232
|
+
} else if (eq.f1i()) {
|
|
233
|
+
var assignment = eq.castToAssignment();
|
|
234
|
+
if (occurCheckEnabled && occurrenceCheck($this, assignment.d1i(), assignment.e1i())) {
|
|
174
235
|
return Companion_getInstance().failed();
|
|
175
236
|
} else {
|
|
176
|
-
changed = changed || applySubstitutionToEquations($this, assignment.
|
|
237
|
+
changed = changed || applySubstitutionToEquations($this, assignment.c1i(), equations, eqIterator.p3());
|
|
177
238
|
}
|
|
178
|
-
} else if (eq.
|
|
239
|
+
} else if (eq.x1h()) {
|
|
179
240
|
eqIterator.b3();
|
|
180
|
-
var _iterator__ex2g4s = equationsFor($this, eq.
|
|
181
|
-
|
|
241
|
+
var _iterator__ex2g4s = equationsFor($this, eq.t1h(), eq.u1h()).n();
|
|
242
|
+
$l$loop: while (_iterator__ex2g4s.q()) {
|
|
182
243
|
var it = _iterator__ex2g4s.r();
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
244
|
+
var subEq = it.v1h() || it.w1h() ? $this.q1h(request, it) : it;
|
|
245
|
+
if (subEq.w1h())
|
|
246
|
+
continue $l$loop;
|
|
247
|
+
else if (subEq.v1h())
|
|
186
248
|
return Companion_getInstance().failed();
|
|
187
249
|
else {
|
|
188
|
-
eqIterator.s3(
|
|
250
|
+
eqIterator.s3(subEq);
|
|
189
251
|
}
|
|
190
252
|
}
|
|
191
253
|
changed = true;
|
|
@@ -198,11 +260,11 @@
|
|
|
198
260
|
var _iterator__ex2g4s_0 = equations.n();
|
|
199
261
|
while (_iterator__ex2g4s_0.q()) {
|
|
200
262
|
var element = _iterator__ex2g4s_0.r();
|
|
201
|
-
if (element.
|
|
263
|
+
if (element.f1i()) {
|
|
202
264
|
destination.l(element);
|
|
203
265
|
}
|
|
204
266
|
}
|
|
205
|
-
return toSubstitution(destination);
|
|
267
|
+
return $this.g1i(request, toSubstitution(destination));
|
|
206
268
|
}
|
|
207
269
|
function newDeque($this, items) {
|
|
208
270
|
// Inline function 'kotlin.collections.arrayListOf' call
|
|
@@ -221,7 +283,7 @@
|
|
|
221
283
|
}
|
|
222
284
|
function AbstractUnificator$checkTermsEquality$ref(p0) {
|
|
223
285
|
return constructCallableReference(function (p0_0, p1) {
|
|
224
|
-
return p0.
|
|
286
|
+
return p0.o1h(p0_0, p1);
|
|
225
287
|
}, 2, 0, 26, 'checkTermsEquality', [p0]);
|
|
226
288
|
}
|
|
227
289
|
function AbstractUnificator$equationsFor$lambda(it) {
|
|
@@ -229,37 +291,42 @@
|
|
|
229
291
|
return new Pair(it.d2(), it.e2());
|
|
230
292
|
}
|
|
231
293
|
function applySubstitutionToEquations$handleIndex($equations, $substitution, this$0, changed, i) {
|
|
232
|
-
if ($equations.x(i).
|
|
294
|
+
if ($equations.x(i).v1h() || $equations.x(i).w1h())
|
|
233
295
|
return Unit_instance;
|
|
234
296
|
var currentEq = $equations.x(i);
|
|
235
297
|
var _destruct__k2r9zo = currentEq.apply($substitution).toPair();
|
|
236
298
|
var newLhs = _destruct__k2r9zo.oc();
|
|
237
299
|
var newRhs = _destruct__k2r9zo.pc();
|
|
238
|
-
if (!currentEq.
|
|
300
|
+
if (!currentEq.t1h().equals(newLhs) || !currentEq.u1h().equals(newRhs)) {
|
|
239
301
|
var tmp = Companion_instance_0;
|
|
240
|
-
$equations.y3(i, tmp.
|
|
302
|
+
$equations.y3(i, tmp.h1i(newLhs, newRhs, AbstractUnificator$checkTermsEquality$ref(this$0)));
|
|
241
303
|
changed._v = true;
|
|
242
304
|
}
|
|
243
305
|
}
|
|
244
306
|
function AbstractUnificator(context) {
|
|
245
|
-
|
|
246
|
-
this.n1g_1 = context;
|
|
307
|
+
this.m1h_1 = context;
|
|
247
308
|
var tmp = this;
|
|
248
|
-
tmp.
|
|
309
|
+
tmp.n1h_1 = lazy(AbstractUnificator$contextEquations$delegate$lambda(this));
|
|
249
310
|
}
|
|
250
311
|
protoOf(AbstractUnificator).h8 = function () {
|
|
251
|
-
return this.
|
|
312
|
+
return this.m1h_1;
|
|
252
313
|
};
|
|
253
|
-
protoOf(AbstractUnificator).
|
|
314
|
+
protoOf(AbstractUnificator).g1i = function (request, result) {
|
|
315
|
+
return result;
|
|
316
|
+
};
|
|
317
|
+
protoOf(AbstractUnificator).q1h = function (request, equation) {
|
|
318
|
+
return equation;
|
|
319
|
+
};
|
|
320
|
+
protoOf(AbstractUnificator).i1i = function (term1, term2, occurCheckEnabled) {
|
|
254
321
|
if (this.h8().e10())
|
|
255
322
|
return Companion_getInstance().failed();
|
|
256
323
|
var equations = newDeque(this, plus(asSequence_0(_get_contextEquations__x0dd77(this)), equationsFor(this, term1, term2)));
|
|
257
|
-
return mgu_0(this, equations, occurCheckEnabled);
|
|
324
|
+
return mgu_0(this, new Mgu(term1, term2, occurCheckEnabled), equations, occurCheckEnabled);
|
|
258
325
|
};
|
|
259
326
|
protoOf(AbstractUnificator).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
260
327
|
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof AbstractUnificator) ? $super : THROW_CCE());
|
|
261
328
|
};
|
|
262
|
-
protoOf(AbstractUnificator).
|
|
329
|
+
protoOf(AbstractUnificator).j1i = function (substitution1, substitution2, occurCheckEnabled) {
|
|
263
330
|
if (this.h8().e10() || substitution1.e10() || substitution2.e10())
|
|
264
331
|
return Companion_getInstance().failed();
|
|
265
332
|
if (!occurCheckEnabled) {
|
|
@@ -269,24 +336,24 @@
|
|
|
269
336
|
}
|
|
270
337
|
}
|
|
271
338
|
var equations = newDeque(this, plus(asSequence_0(_get_contextEquations__x0dd77(this)), equationsFor_0(this, substitution1, substitution2)));
|
|
272
|
-
return mgu_0(this, equations, occurCheckEnabled);
|
|
339
|
+
return mgu_0(this, new Merge(substitution1, substitution2, occurCheckEnabled), equations, occurCheckEnabled);
|
|
273
340
|
};
|
|
274
341
|
protoOf(AbstractUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
275
|
-
return this.
|
|
342
|
+
return this.j1i(substitution1, substitution2, occurCheckEnabled);
|
|
276
343
|
};
|
|
277
344
|
function CachedUnificator(decorated, cacheCapacity) {
|
|
278
|
-
this.
|
|
279
|
-
this.
|
|
345
|
+
this.k1i_1 = decorated;
|
|
346
|
+
this.l1i_1 = Companion_instance.uo(cacheCapacity);
|
|
280
347
|
}
|
|
281
|
-
protoOf(CachedUnificator).
|
|
348
|
+
protoOf(CachedUnificator).i1i = function (term1, term2, occurCheckEnabled) {
|
|
282
349
|
var mguRequest = new Triple(term1, term2, occurCheckEnabled);
|
|
283
|
-
var cached = this.
|
|
350
|
+
var cached = this.l1i_1.h2(mguRequest);
|
|
284
351
|
var tmp;
|
|
285
352
|
if (cached instanceof Some) {
|
|
286
353
|
tmp = cached.xo_1;
|
|
287
354
|
} else {
|
|
288
|
-
var mguResult = this.
|
|
289
|
-
this.
|
|
355
|
+
var mguResult = this.k1i_1.i1i(term1, term2, occurCheckEnabled);
|
|
356
|
+
this.l1i_1.vo(mguRequest, mguResult);
|
|
290
357
|
tmp = mguResult;
|
|
291
358
|
}
|
|
292
359
|
return tmp;
|
|
@@ -294,21 +361,21 @@
|
|
|
294
361
|
protoOf(CachedUnificator).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
295
362
|
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof CachedUnificator) ? $super : THROW_CCE());
|
|
296
363
|
};
|
|
297
|
-
protoOf(CachedUnificator).
|
|
364
|
+
protoOf(CachedUnificator).j1i = function (substitution1, substitution2, occurCheckEnabled) {
|
|
298
365
|
var mguRequest = new Triple(substitution1, substitution2, occurCheckEnabled);
|
|
299
|
-
var cached = this.
|
|
366
|
+
var cached = this.l1i_1.h2(mguRequest);
|
|
300
367
|
var tmp;
|
|
301
368
|
if (cached instanceof Some) {
|
|
302
369
|
tmp = cached.xo_1;
|
|
303
370
|
} else {
|
|
304
|
-
var mguResult = this.
|
|
305
|
-
this.
|
|
371
|
+
var mguResult = this.k1i_1.mergeWithOccurCheck(substitution1, substitution2, occurCheckEnabled);
|
|
372
|
+
this.l1i_1.vo(mguRequest, mguResult);
|
|
306
373
|
tmp = mguResult;
|
|
307
374
|
}
|
|
308
375
|
return tmp;
|
|
309
376
|
};
|
|
310
377
|
protoOf(CachedUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
311
|
-
return this.
|
|
378
|
+
return this.j1i(substitution1, substitution2, occurCheckEnabled);
|
|
312
379
|
};
|
|
313
380
|
function allOfLists($this, lhs, rhs, equalityChecker) {
|
|
314
381
|
var tmp;
|
|
@@ -339,48 +406,60 @@
|
|
|
339
406
|
}
|
|
340
407
|
function Equation$Companion$from$lambda($equalityChecker) {
|
|
341
408
|
return function (it) {
|
|
342
|
-
return Companion_instance_0.
|
|
409
|
+
return Companion_instance_0.m1i(it, $equalityChecker);
|
|
343
410
|
};
|
|
344
411
|
}
|
|
345
412
|
function Equation$Companion$allOfLists$lambda($equalityChecker) {
|
|
346
413
|
return function (_destruct__k2r9zo) {
|
|
347
414
|
var l = _destruct__k2r9zo.oc();
|
|
348
415
|
var r = _destruct__k2r9zo.pc();
|
|
349
|
-
return l.ku() && r.ku() ? sequenceOf(Companion_instance_0.
|
|
416
|
+
return l.ku() && r.ku() ? sequenceOf(Companion_instance_0.h1i(l.castToCons().dw(), r.castToCons().dw(), $equalityChecker)) : l.ju() && r.ju() ? sequenceOf(Companion_instance_0.h1i(l.castToList(), r.castToList(), $equalityChecker)) : Companion_instance_0.p1h(l, r, $equalityChecker);
|
|
350
417
|
};
|
|
351
418
|
}
|
|
352
419
|
function Equation$Companion$allOfTuples$lambda($equalityChecker) {
|
|
353
420
|
return function (_destruct__k2r9zo) {
|
|
354
421
|
var l = _destruct__k2r9zo.oc();
|
|
355
422
|
var r = _destruct__k2r9zo.pc();
|
|
356
|
-
return l.iu() && r.iu() ? sequenceOf(Companion_instance_0.
|
|
423
|
+
return l.iu() && r.iu() ? sequenceOf(Companion_instance_0.h1i(l.castToTuple().rv(), r.castToTuple().rv(), $equalityChecker)) : Companion_instance_0.p1h(l, r, $equalityChecker);
|
|
357
424
|
};
|
|
358
425
|
}
|
|
359
426
|
function Equation$Companion$allOf$lambda($equalityChecker) {
|
|
360
427
|
return function (it) {
|
|
361
|
-
return Companion_instance_0.
|
|
428
|
+
return Companion_instance_0.m1i(it, $equalityChecker);
|
|
362
429
|
};
|
|
363
430
|
}
|
|
364
431
|
function Identity(lhs, rhs) {
|
|
365
432
|
Equation.call(this, lhs, rhs);
|
|
366
|
-
this.
|
|
367
|
-
this.
|
|
433
|
+
this.p1i_1 = lhs;
|
|
434
|
+
this.q1i_1 = rhs;
|
|
368
435
|
}
|
|
369
|
-
protoOf(Identity).
|
|
370
|
-
return this.
|
|
436
|
+
protoOf(Identity).t1h = function () {
|
|
437
|
+
return this.p1i_1;
|
|
371
438
|
};
|
|
372
|
-
protoOf(Identity).
|
|
373
|
-
return this.
|
|
439
|
+
protoOf(Identity).u1h = function () {
|
|
440
|
+
return this.q1i_1;
|
|
374
441
|
};
|
|
375
|
-
protoOf(Identity).
|
|
442
|
+
protoOf(Identity).w1h = function () {
|
|
376
443
|
return true;
|
|
377
444
|
};
|
|
445
|
+
protoOf(Identity).r1i = function () {
|
|
446
|
+
return this;
|
|
447
|
+
};
|
|
448
|
+
protoOf(Identity).asIdentity = function () {
|
|
449
|
+
return this.r1i();
|
|
450
|
+
};
|
|
451
|
+
protoOf(Identity).s1i = function (lhs, rhs) {
|
|
452
|
+
return this.t1i(lhs, rhs);
|
|
453
|
+
};
|
|
454
|
+
protoOf(Identity).t1i = function (lhs, rhs) {
|
|
455
|
+
return new Identity(lhs, rhs);
|
|
456
|
+
};
|
|
378
457
|
protoOf(Identity).toString = function () {
|
|
379
|
-
return 'Identity(lhs=' + this.
|
|
458
|
+
return 'Identity(lhs=' + this.p1i_1.toString() + ', rhs=' + this.q1i_1.toString() + ')';
|
|
380
459
|
};
|
|
381
460
|
protoOf(Identity).hashCode = function () {
|
|
382
|
-
var result = this.
|
|
383
|
-
result = imul(result, 31) + this.
|
|
461
|
+
var result = this.p1i_1.hashCode();
|
|
462
|
+
result = imul(result, 31) + this.q1i_1.hashCode() | 0;
|
|
384
463
|
return result;
|
|
385
464
|
};
|
|
386
465
|
protoOf(Identity).equals = function (other) {
|
|
@@ -388,77 +467,194 @@
|
|
|
388
467
|
return true;
|
|
389
468
|
if (!(other instanceof Identity))
|
|
390
469
|
return false;
|
|
391
|
-
if (!this.
|
|
470
|
+
if (!this.p1i_1.equals(other.p1i_1))
|
|
392
471
|
return false;
|
|
393
|
-
if (!this.
|
|
472
|
+
if (!this.q1i_1.equals(other.q1i_1))
|
|
394
473
|
return false;
|
|
395
474
|
return true;
|
|
396
475
|
};
|
|
397
476
|
function Assignment(lhs, rhs) {
|
|
398
477
|
Equation.call(this, lhs, rhs);
|
|
399
|
-
this.
|
|
400
|
-
this.
|
|
478
|
+
this.a1i_1 = lhs;
|
|
479
|
+
this.b1i_1 = rhs;
|
|
401
480
|
}
|
|
402
|
-
protoOf(Assignment).
|
|
403
|
-
return this.
|
|
481
|
+
protoOf(Assignment).t1h = function () {
|
|
482
|
+
return this.a1i_1;
|
|
483
|
+
};
|
|
484
|
+
protoOf(Assignment).u1h = function () {
|
|
485
|
+
return this.b1i_1;
|
|
486
|
+
};
|
|
487
|
+
protoOf(Assignment).f1i = function () {
|
|
488
|
+
return true;
|
|
489
|
+
};
|
|
490
|
+
protoOf(Assignment).x1i = function () {
|
|
491
|
+
return this;
|
|
492
|
+
};
|
|
493
|
+
protoOf(Assignment).asAssignment = function () {
|
|
494
|
+
return this.x1i();
|
|
495
|
+
};
|
|
496
|
+
protoOf(Assignment).y1i = function () {
|
|
497
|
+
return new Pair(this.d1i(), this.e1i());
|
|
404
498
|
};
|
|
405
|
-
protoOf(Assignment).
|
|
406
|
-
return this.
|
|
499
|
+
protoOf(Assignment).toAssignmentPair = function () {
|
|
500
|
+
return this.y1i();
|
|
501
|
+
};
|
|
502
|
+
protoOf(Assignment).c1i = function () {
|
|
503
|
+
return Companion_getInstance().unifier(this.d1i(), this.e1i());
|
|
407
504
|
};
|
|
408
505
|
protoOf(Assignment).toSubstitution = function () {
|
|
409
|
-
return
|
|
506
|
+
return this.c1i();
|
|
507
|
+
};
|
|
508
|
+
function LeftAssignment(lhs, rhs) {
|
|
509
|
+
Assignment.call(this, lhs, rhs);
|
|
510
|
+
this.d1j_1 = lhs;
|
|
511
|
+
this.e1j_1 = rhs;
|
|
512
|
+
this.f1j_1 = this.d1j_1;
|
|
513
|
+
this.g1j_1 = this.e1j_1;
|
|
514
|
+
}
|
|
515
|
+
protoOf(LeftAssignment).t1h = function () {
|
|
516
|
+
return this.d1j_1;
|
|
517
|
+
};
|
|
518
|
+
protoOf(LeftAssignment).u1h = function () {
|
|
519
|
+
return this.e1j_1;
|
|
410
520
|
};
|
|
411
|
-
protoOf(
|
|
412
|
-
return
|
|
521
|
+
protoOf(LeftAssignment).d1i = function () {
|
|
522
|
+
return this.f1j_1;
|
|
413
523
|
};
|
|
414
|
-
protoOf(
|
|
415
|
-
return this.
|
|
524
|
+
protoOf(LeftAssignment).e1i = function () {
|
|
525
|
+
return this.g1j_1;
|
|
416
526
|
};
|
|
417
|
-
protoOf(
|
|
527
|
+
protoOf(LeftAssignment).u1i = function () {
|
|
418
528
|
return true;
|
|
419
529
|
};
|
|
420
|
-
protoOf(
|
|
530
|
+
protoOf(LeftAssignment).h1j = function () {
|
|
421
531
|
return this;
|
|
422
532
|
};
|
|
423
|
-
protoOf(
|
|
424
|
-
return
|
|
533
|
+
protoOf(LeftAssignment).asLeftAssignment = function () {
|
|
534
|
+
return this.h1j();
|
|
535
|
+
};
|
|
536
|
+
protoOf(LeftAssignment).s1i = function (lhs, rhs) {
|
|
537
|
+
return this.i1j(lhs.castToVar(), rhs);
|
|
538
|
+
};
|
|
539
|
+
protoOf(LeftAssignment).j1j = function () {
|
|
540
|
+
return new Pair(this.d1j_1, this.e1j_1);
|
|
541
|
+
};
|
|
542
|
+
protoOf(LeftAssignment).toPair = function () {
|
|
543
|
+
return this.j1j();
|
|
544
|
+
};
|
|
545
|
+
protoOf(LeftAssignment).i1j = function (lhs, rhs) {
|
|
546
|
+
return new LeftAssignment(lhs, rhs);
|
|
547
|
+
};
|
|
548
|
+
protoOf(LeftAssignment).toString = function () {
|
|
549
|
+
return 'LeftAssignment(lhs=' + this.d1j_1.toString() + ', rhs=' + this.e1j_1.toString() + ')';
|
|
550
|
+
};
|
|
551
|
+
protoOf(LeftAssignment).hashCode = function () {
|
|
552
|
+
var result = this.d1j_1.hashCode();
|
|
553
|
+
result = imul(result, 31) + this.e1j_1.hashCode() | 0;
|
|
554
|
+
return result;
|
|
555
|
+
};
|
|
556
|
+
protoOf(LeftAssignment).equals = function (other) {
|
|
557
|
+
if (this === other)
|
|
558
|
+
return true;
|
|
559
|
+
if (!(other instanceof LeftAssignment))
|
|
560
|
+
return false;
|
|
561
|
+
if (!this.d1j_1.equals(other.d1j_1))
|
|
562
|
+
return false;
|
|
563
|
+
if (!this.e1j_1.equals(other.e1j_1))
|
|
564
|
+
return false;
|
|
565
|
+
return true;
|
|
566
|
+
};
|
|
567
|
+
function RightAssignment(lhs, rhs) {
|
|
568
|
+
Assignment.call(this, lhs, rhs);
|
|
569
|
+
this.o1j_1 = lhs;
|
|
570
|
+
this.p1j_1 = rhs;
|
|
571
|
+
this.q1j_1 = this.p1j_1;
|
|
572
|
+
this.r1j_1 = this.o1j_1;
|
|
573
|
+
}
|
|
574
|
+
protoOf(RightAssignment).t1h = function () {
|
|
575
|
+
return this.o1j_1;
|
|
576
|
+
};
|
|
577
|
+
protoOf(RightAssignment).u1h = function () {
|
|
578
|
+
return this.p1j_1;
|
|
579
|
+
};
|
|
580
|
+
protoOf(RightAssignment).d1i = function () {
|
|
581
|
+
return this.q1j_1;
|
|
582
|
+
};
|
|
583
|
+
protoOf(RightAssignment).e1i = function () {
|
|
584
|
+
return this.r1j_1;
|
|
585
|
+
};
|
|
586
|
+
protoOf(RightAssignment).v1i = function () {
|
|
587
|
+
return true;
|
|
588
|
+
};
|
|
589
|
+
protoOf(RightAssignment).s1j = function () {
|
|
590
|
+
return this;
|
|
591
|
+
};
|
|
592
|
+
protoOf(RightAssignment).asRightAssignment = function () {
|
|
593
|
+
return this.s1j();
|
|
594
|
+
};
|
|
595
|
+
protoOf(RightAssignment).s1i = function (lhs, rhs) {
|
|
596
|
+
return this.t1j(lhs, rhs.castToVar());
|
|
597
|
+
};
|
|
598
|
+
protoOf(RightAssignment).j1j = function () {
|
|
599
|
+
return new Pair(this.o1j_1, this.p1j_1);
|
|
600
|
+
};
|
|
601
|
+
protoOf(RightAssignment).toPair = function () {
|
|
602
|
+
return this.j1j();
|
|
603
|
+
};
|
|
604
|
+
protoOf(RightAssignment).t1j = function (lhs, rhs) {
|
|
605
|
+
return new RightAssignment(lhs, rhs);
|
|
606
|
+
};
|
|
607
|
+
protoOf(RightAssignment).toString = function () {
|
|
608
|
+
return 'RightAssignment(lhs=' + this.o1j_1.toString() + ', rhs=' + this.p1j_1.toString() + ')';
|
|
425
609
|
};
|
|
426
|
-
protoOf(
|
|
427
|
-
var result = this.
|
|
428
|
-
result = imul(result, 31) + this.
|
|
610
|
+
protoOf(RightAssignment).hashCode = function () {
|
|
611
|
+
var result = this.o1j_1.hashCode();
|
|
612
|
+
result = imul(result, 31) + this.p1j_1.hashCode() | 0;
|
|
429
613
|
return result;
|
|
430
614
|
};
|
|
431
|
-
protoOf(
|
|
615
|
+
protoOf(RightAssignment).equals = function (other) {
|
|
432
616
|
if (this === other)
|
|
433
617
|
return true;
|
|
434
|
-
if (!(other instanceof
|
|
618
|
+
if (!(other instanceof RightAssignment))
|
|
435
619
|
return false;
|
|
436
|
-
if (!this.
|
|
620
|
+
if (!this.o1j_1.equals(other.o1j_1))
|
|
437
621
|
return false;
|
|
438
|
-
if (!this.
|
|
622
|
+
if (!this.p1j_1.equals(other.p1j_1))
|
|
439
623
|
return false;
|
|
440
624
|
return true;
|
|
441
625
|
};
|
|
442
626
|
function Comparison(lhs, rhs) {
|
|
443
627
|
Equation.call(this, lhs, rhs);
|
|
444
|
-
this.
|
|
445
|
-
this.
|
|
628
|
+
this.w1j_1 = lhs;
|
|
629
|
+
this.x1j_1 = rhs;
|
|
446
630
|
}
|
|
447
|
-
protoOf(Comparison).
|
|
448
|
-
return this.
|
|
631
|
+
protoOf(Comparison).t1h = function () {
|
|
632
|
+
return this.w1j_1;
|
|
449
633
|
};
|
|
450
|
-
protoOf(Comparison).
|
|
451
|
-
return this.
|
|
634
|
+
protoOf(Comparison).u1h = function () {
|
|
635
|
+
return this.x1j_1;
|
|
452
636
|
};
|
|
453
|
-
protoOf(Comparison).
|
|
637
|
+
protoOf(Comparison).x1h = function () {
|
|
454
638
|
return true;
|
|
455
639
|
};
|
|
640
|
+
protoOf(Comparison).y1j = function () {
|
|
641
|
+
return this;
|
|
642
|
+
};
|
|
643
|
+
protoOf(Comparison).asComparison = function () {
|
|
644
|
+
return this.y1j();
|
|
645
|
+
};
|
|
646
|
+
protoOf(Comparison).s1i = function (lhs, rhs) {
|
|
647
|
+
return this.t1i(lhs, rhs);
|
|
648
|
+
};
|
|
649
|
+
protoOf(Comparison).t1i = function (lhs, rhs) {
|
|
650
|
+
return new Comparison(lhs, rhs);
|
|
651
|
+
};
|
|
456
652
|
protoOf(Comparison).toString = function () {
|
|
457
|
-
return 'Comparison(lhs=' + this.
|
|
653
|
+
return 'Comparison(lhs=' + this.w1j_1.toString() + ', rhs=' + this.x1j_1.toString() + ')';
|
|
458
654
|
};
|
|
459
655
|
protoOf(Comparison).hashCode = function () {
|
|
460
|
-
var result = this.
|
|
461
|
-
result = imul(result, 31) + this.
|
|
656
|
+
var result = this.w1j_1.hashCode();
|
|
657
|
+
result = imul(result, 31) + this.x1j_1.hashCode() | 0;
|
|
462
658
|
return result;
|
|
463
659
|
};
|
|
464
660
|
protoOf(Comparison).equals = function (other) {
|
|
@@ -466,32 +662,50 @@
|
|
|
466
662
|
return true;
|
|
467
663
|
if (!(other instanceof Comparison))
|
|
468
664
|
return false;
|
|
469
|
-
if (!this.
|
|
665
|
+
if (!this.w1j_1.equals(other.w1j_1))
|
|
470
666
|
return false;
|
|
471
|
-
if (!this.
|
|
667
|
+
if (!this.x1j_1.equals(other.x1j_1))
|
|
472
668
|
return false;
|
|
473
669
|
return true;
|
|
474
670
|
};
|
|
475
671
|
function Contradiction(lhs, rhs) {
|
|
476
672
|
Equation.call(this, lhs, rhs);
|
|
477
|
-
this.
|
|
478
|
-
this.
|
|
673
|
+
this.b1k_1 = lhs;
|
|
674
|
+
this.c1k_1 = rhs;
|
|
479
675
|
}
|
|
480
|
-
protoOf(Contradiction).
|
|
481
|
-
return this.
|
|
676
|
+
protoOf(Contradiction).t1h = function () {
|
|
677
|
+
return this.b1k_1;
|
|
482
678
|
};
|
|
483
|
-
protoOf(Contradiction).
|
|
484
|
-
return this.
|
|
679
|
+
protoOf(Contradiction).u1h = function () {
|
|
680
|
+
return this.c1k_1;
|
|
485
681
|
};
|
|
486
|
-
protoOf(Contradiction).
|
|
682
|
+
protoOf(Contradiction).v1h = function () {
|
|
487
683
|
return true;
|
|
488
684
|
};
|
|
685
|
+
protoOf(Contradiction).d1k = function () {
|
|
686
|
+
return this;
|
|
687
|
+
};
|
|
688
|
+
protoOf(Contradiction).asContradiction = function () {
|
|
689
|
+
return this.d1k();
|
|
690
|
+
};
|
|
691
|
+
protoOf(Contradiction).s1i = function (lhs, rhs) {
|
|
692
|
+
return this.t1i(lhs, rhs);
|
|
693
|
+
};
|
|
694
|
+
protoOf(Contradiction).c1i = function () {
|
|
695
|
+
return Companion_getInstance().failed();
|
|
696
|
+
};
|
|
697
|
+
protoOf(Contradiction).toSubstitution = function () {
|
|
698
|
+
return this.c1i();
|
|
699
|
+
};
|
|
700
|
+
protoOf(Contradiction).t1i = function (lhs, rhs) {
|
|
701
|
+
return new Contradiction(lhs, rhs);
|
|
702
|
+
};
|
|
489
703
|
protoOf(Contradiction).toString = function () {
|
|
490
|
-
return 'Contradiction(lhs=' + this.
|
|
704
|
+
return 'Contradiction(lhs=' + this.b1k_1.toString() + ', rhs=' + this.c1k_1.toString() + ')';
|
|
491
705
|
};
|
|
492
706
|
protoOf(Contradiction).hashCode = function () {
|
|
493
|
-
var result = this.
|
|
494
|
-
result = imul(result, 31) + this.
|
|
707
|
+
var result = this.b1k_1.hashCode();
|
|
708
|
+
result = imul(result, 31) + this.c1k_1.hashCode() | 0;
|
|
495
709
|
return result;
|
|
496
710
|
};
|
|
497
711
|
protoOf(Contradiction).equals = function (other) {
|
|
@@ -499,28 +713,28 @@
|
|
|
499
713
|
return true;
|
|
500
714
|
if (!(other instanceof Contradiction))
|
|
501
715
|
return false;
|
|
502
|
-
if (!this.
|
|
716
|
+
if (!this.b1k_1.equals(other.b1k_1))
|
|
503
717
|
return false;
|
|
504
|
-
if (!this.
|
|
718
|
+
if (!this.c1k_1.equals(other.c1k_1))
|
|
505
719
|
return false;
|
|
506
720
|
return true;
|
|
507
721
|
};
|
|
508
722
|
function Companion() {
|
|
509
723
|
}
|
|
510
|
-
protoOf(Companion).
|
|
724
|
+
protoOf(Companion).h1i = function (lhs, rhs, equalityChecker) {
|
|
511
725
|
var tmp;
|
|
512
726
|
if (lhs.tu() && rhs.tu()) {
|
|
513
727
|
var tmp_0;
|
|
514
728
|
if (equalityChecker(lhs, rhs)) {
|
|
515
729
|
tmp_0 = new Identity(lhs, rhs);
|
|
516
730
|
} else {
|
|
517
|
-
tmp_0 = new
|
|
731
|
+
tmp_0 = new LeftAssignment(lhs.castToVar(), rhs);
|
|
518
732
|
}
|
|
519
733
|
tmp = tmp_0;
|
|
520
734
|
} else if (lhs.tu()) {
|
|
521
|
-
tmp = new
|
|
735
|
+
tmp = new LeftAssignment(lhs.castToVar(), rhs);
|
|
522
736
|
} else if (rhs.tu()) {
|
|
523
|
-
tmp = new
|
|
737
|
+
tmp = new RightAssignment(lhs, rhs.castToVar());
|
|
524
738
|
} else if (lhs.wu() && rhs.wu()) {
|
|
525
739
|
var tmp_1;
|
|
526
740
|
if (equalityChecker(lhs, rhs)) {
|
|
@@ -554,10 +768,10 @@
|
|
|
554
768
|
tmp = equalityChecker;
|
|
555
769
|
}
|
|
556
770
|
equalityChecker = tmp;
|
|
557
|
-
return $super === VOID ? this.
|
|
771
|
+
return $super === VOID ? this.h1i(lhs, rhs, equalityChecker) : $super.h1i.call(this, lhs, rhs, equalityChecker);
|
|
558
772
|
};
|
|
559
|
-
protoOf(Companion).
|
|
560
|
-
return this.
|
|
773
|
+
protoOf(Companion).e1k = function (pair, equalityChecker) {
|
|
774
|
+
return this.h1i(pair.first, pair.second, equalityChecker);
|
|
561
775
|
};
|
|
562
776
|
protoOf(Companion).ofPair = function (pair, equalityChecker, $super) {
|
|
563
777
|
var tmp;
|
|
@@ -567,9 +781,9 @@
|
|
|
567
781
|
tmp = equalityChecker;
|
|
568
782
|
}
|
|
569
783
|
equalityChecker = tmp;
|
|
570
|
-
return $super === VOID ? this.
|
|
784
|
+
return $super === VOID ? this.e1k(pair, equalityChecker) : $super.e1k.call(this, pair, equalityChecker);
|
|
571
785
|
};
|
|
572
|
-
protoOf(Companion).
|
|
786
|
+
protoOf(Companion).f1k = function (pairs, equalityChecker) {
|
|
573
787
|
return flatMap(pairs, Equation$Companion$from$lambda(equalityChecker));
|
|
574
788
|
};
|
|
575
789
|
protoOf(Companion).fromSequence = function (pairs, equalityChecker, $super) {
|
|
@@ -580,10 +794,10 @@
|
|
|
580
794
|
tmp = equalityChecker;
|
|
581
795
|
}
|
|
582
796
|
equalityChecker = tmp;
|
|
583
|
-
return $super === VOID ? this.
|
|
797
|
+
return $super === VOID ? this.f1k(pairs, equalityChecker) : $super.f1k.call(this, pairs, equalityChecker);
|
|
584
798
|
};
|
|
585
|
-
protoOf(Companion).
|
|
586
|
-
return this.
|
|
799
|
+
protoOf(Companion).g1k = function (pairs, equalityChecker) {
|
|
800
|
+
return this.f1k(asSequence_0(pairs), equalityChecker);
|
|
587
801
|
};
|
|
588
802
|
protoOf(Companion).fromIterable = function (pairs, equalityChecker, $super) {
|
|
589
803
|
var tmp;
|
|
@@ -593,10 +807,10 @@
|
|
|
593
807
|
tmp = equalityChecker;
|
|
594
808
|
}
|
|
595
809
|
equalityChecker = tmp;
|
|
596
|
-
return $super === VOID ? this.
|
|
810
|
+
return $super === VOID ? this.g1k(pairs, equalityChecker) : $super.g1k.call(this, pairs, equalityChecker);
|
|
597
811
|
};
|
|
598
|
-
protoOf(Companion).
|
|
599
|
-
return this.
|
|
812
|
+
protoOf(Companion).h1k = function (pairs, equalityChecker) {
|
|
813
|
+
return this.f1k(sequenceOf_0(pairs.slice()), equalityChecker);
|
|
600
814
|
};
|
|
601
815
|
protoOf(Companion).from = function (pairs, equalityChecker, $super) {
|
|
602
816
|
var tmp;
|
|
@@ -606,10 +820,10 @@
|
|
|
606
820
|
tmp = equalityChecker;
|
|
607
821
|
}
|
|
608
822
|
equalityChecker = tmp;
|
|
609
|
-
return $super === VOID ? this.
|
|
823
|
+
return $super === VOID ? this.h1k(pairs, equalityChecker) : $super.h1k.call(this, pairs, equalityChecker);
|
|
610
824
|
};
|
|
611
|
-
protoOf(Companion).
|
|
612
|
-
return this.
|
|
825
|
+
protoOf(Companion).m1i = function (pair, equalityChecker) {
|
|
826
|
+
return this.p1h(pair.first, pair.second, equalityChecker);
|
|
613
827
|
};
|
|
614
828
|
protoOf(Companion).allOfPair = function (pair, equalityChecker, $super) {
|
|
615
829
|
var tmp;
|
|
@@ -619,12 +833,12 @@
|
|
|
619
833
|
tmp = equalityChecker;
|
|
620
834
|
}
|
|
621
835
|
equalityChecker = tmp;
|
|
622
|
-
return $super === VOID ? this.
|
|
836
|
+
return $super === VOID ? this.m1i(pair, equalityChecker) : $super.m1i.call(this, pair, equalityChecker);
|
|
623
837
|
};
|
|
624
|
-
protoOf(Companion).
|
|
838
|
+
protoOf(Companion).p1h = function (lhs, rhs, equalityChecker) {
|
|
625
839
|
var tmp;
|
|
626
840
|
if (lhs.st() && rhs.st()) {
|
|
627
|
-
tmp = sequenceOf(this.
|
|
841
|
+
tmp = sequenceOf(this.h1i(lhs, rhs, equalityChecker));
|
|
628
842
|
} else if (lhs.ju() && rhs.ju()) {
|
|
629
843
|
tmp = allOfLists(this, lhs.castToList(), rhs.castToList(), equalityChecker);
|
|
630
844
|
} else if (lhs.iu() && rhs.iu()) {
|
|
@@ -637,11 +851,11 @@
|
|
|
637
851
|
var tmp_1 = zip(lhsStruct.qu(), rhsStruct.qu());
|
|
638
852
|
tmp_0 = flatMap(tmp_1, Equation$Companion$allOf$lambda(equalityChecker));
|
|
639
853
|
} else {
|
|
640
|
-
tmp_0 = sequenceOf(this.
|
|
854
|
+
tmp_0 = sequenceOf(this.h1i(lhs, rhs, equalityChecker));
|
|
641
855
|
}
|
|
642
856
|
tmp = tmp_0;
|
|
643
857
|
} else {
|
|
644
|
-
tmp = sequenceOf(this.
|
|
858
|
+
tmp = sequenceOf(this.h1i(lhs, rhs, equalityChecker));
|
|
645
859
|
}
|
|
646
860
|
return tmp;
|
|
647
861
|
};
|
|
@@ -653,33 +867,46 @@
|
|
|
653
867
|
tmp = equalityChecker;
|
|
654
868
|
}
|
|
655
869
|
equalityChecker = tmp;
|
|
656
|
-
return $super === VOID ? this.
|
|
870
|
+
return $super === VOID ? this.p1h(lhs, rhs, equalityChecker) : $super.p1h.call(this, lhs, rhs, equalityChecker);
|
|
657
871
|
};
|
|
658
872
|
var Companion_instance_0;
|
|
659
873
|
function Companion_getInstance_1() {
|
|
660
874
|
return Companion_instance_0;
|
|
661
875
|
}
|
|
662
876
|
function Equation(lhs, rhs) {
|
|
663
|
-
this.
|
|
664
|
-
this.
|
|
877
|
+
this.r1h_1 = lhs;
|
|
878
|
+
this.s1h_1 = rhs;
|
|
665
879
|
}
|
|
666
|
-
protoOf(Equation).
|
|
667
|
-
return this.
|
|
880
|
+
protoOf(Equation).t1h = function () {
|
|
881
|
+
return this.r1h_1;
|
|
668
882
|
};
|
|
669
|
-
protoOf(Equation).
|
|
670
|
-
return this.
|
|
883
|
+
protoOf(Equation).u1h = function () {
|
|
884
|
+
return this.s1h_1;
|
|
671
885
|
};
|
|
672
|
-
protoOf(Equation).
|
|
886
|
+
protoOf(Equation).w1h = function () {
|
|
673
887
|
return false;
|
|
674
888
|
};
|
|
675
|
-
protoOf(Equation).
|
|
889
|
+
protoOf(Equation).asIdentity = function () {
|
|
890
|
+
return null;
|
|
891
|
+
};
|
|
892
|
+
protoOf(Equation).castToIdentity = function () {
|
|
893
|
+
var tmp0_elvis_lhs = this.asIdentity();
|
|
894
|
+
var tmp;
|
|
895
|
+
if (tmp0_elvis_lhs == null) {
|
|
896
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(Identity).b9());
|
|
897
|
+
} else {
|
|
898
|
+
tmp = tmp0_elvis_lhs;
|
|
899
|
+
}
|
|
900
|
+
return tmp;
|
|
901
|
+
};
|
|
902
|
+
protoOf(Equation).f1i = function () {
|
|
676
903
|
return false;
|
|
677
904
|
};
|
|
678
|
-
protoOf(Equation).
|
|
905
|
+
protoOf(Equation).asAssignment = function () {
|
|
679
906
|
return null;
|
|
680
907
|
};
|
|
681
|
-
protoOf(Equation).
|
|
682
|
-
var tmp0_elvis_lhs = this.
|
|
908
|
+
protoOf(Equation).castToAssignment = function () {
|
|
909
|
+
var tmp0_elvis_lhs = this.asAssignment();
|
|
683
910
|
var tmp;
|
|
684
911
|
if (tmp0_elvis_lhs == null) {
|
|
685
912
|
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(Assignment).b9());
|
|
@@ -688,26 +915,114 @@
|
|
|
688
915
|
}
|
|
689
916
|
return tmp;
|
|
690
917
|
};
|
|
691
|
-
protoOf(Equation).
|
|
918
|
+
protoOf(Equation).u1i = function () {
|
|
919
|
+
return false;
|
|
920
|
+
};
|
|
921
|
+
protoOf(Equation).asLeftAssignment = function () {
|
|
922
|
+
return null;
|
|
923
|
+
};
|
|
924
|
+
protoOf(Equation).castToLeftAssignment = function () {
|
|
925
|
+
var tmp0_elvis_lhs = this.asLeftAssignment();
|
|
926
|
+
var tmp;
|
|
927
|
+
if (tmp0_elvis_lhs == null) {
|
|
928
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(LeftAssignment).b9());
|
|
929
|
+
} else {
|
|
930
|
+
tmp = tmp0_elvis_lhs;
|
|
931
|
+
}
|
|
932
|
+
return tmp;
|
|
933
|
+
};
|
|
934
|
+
protoOf(Equation).v1i = function () {
|
|
935
|
+
return false;
|
|
936
|
+
};
|
|
937
|
+
protoOf(Equation).asRightAssignment = function () {
|
|
938
|
+
return null;
|
|
939
|
+
};
|
|
940
|
+
protoOf(Equation).castToRightAssignment = function () {
|
|
941
|
+
var tmp0_elvis_lhs = this.asRightAssignment();
|
|
942
|
+
var tmp;
|
|
943
|
+
if (tmp0_elvis_lhs == null) {
|
|
944
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(RightAssignment).b9());
|
|
945
|
+
} else {
|
|
946
|
+
tmp = tmp0_elvis_lhs;
|
|
947
|
+
}
|
|
948
|
+
return tmp;
|
|
949
|
+
};
|
|
950
|
+
protoOf(Equation).x1h = function () {
|
|
692
951
|
return false;
|
|
693
952
|
};
|
|
694
|
-
protoOf(Equation).
|
|
953
|
+
protoOf(Equation).asComparison = function () {
|
|
954
|
+
return null;
|
|
955
|
+
};
|
|
956
|
+
protoOf(Equation).castToComparison = function () {
|
|
957
|
+
var tmp0_elvis_lhs = this.asComparison();
|
|
958
|
+
var tmp;
|
|
959
|
+
if (tmp0_elvis_lhs == null) {
|
|
960
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(Comparison).b9());
|
|
961
|
+
} else {
|
|
962
|
+
tmp = tmp0_elvis_lhs;
|
|
963
|
+
}
|
|
964
|
+
return tmp;
|
|
965
|
+
};
|
|
966
|
+
protoOf(Equation).v1h = function () {
|
|
695
967
|
return false;
|
|
696
968
|
};
|
|
697
|
-
protoOf(Equation).
|
|
698
|
-
return
|
|
969
|
+
protoOf(Equation).asContradiction = function () {
|
|
970
|
+
return null;
|
|
971
|
+
};
|
|
972
|
+
protoOf(Equation).castToContradiction = function () {
|
|
973
|
+
var tmp0_elvis_lhs = this.asContradiction();
|
|
974
|
+
var tmp;
|
|
975
|
+
if (tmp0_elvis_lhs == null) {
|
|
976
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(Contradiction).b9());
|
|
977
|
+
} else {
|
|
978
|
+
tmp = tmp0_elvis_lhs;
|
|
979
|
+
}
|
|
980
|
+
return tmp;
|
|
981
|
+
};
|
|
982
|
+
protoOf(Equation).clone = function (lhs, rhs, $super) {
|
|
983
|
+
lhs = lhs === VOID ? this.t1h() : lhs;
|
|
984
|
+
rhs = rhs === VOID ? this.u1h() : rhs;
|
|
985
|
+
return $super === VOID ? this.s1i(lhs, rhs) : $super.s1i.call(this, lhs, rhs);
|
|
986
|
+
};
|
|
987
|
+
protoOf(Equation).toContradiction = function () {
|
|
988
|
+
return new Contradiction(this.t1h(), this.u1h());
|
|
989
|
+
};
|
|
990
|
+
protoOf(Equation).toAssignmentPair = function () {
|
|
991
|
+
var tmp;
|
|
992
|
+
if (this.t1h().tu()) {
|
|
993
|
+
tmp = to(this.t1h().castToVar(), this.u1h());
|
|
994
|
+
} else if (this.u1h().tu()) {
|
|
995
|
+
tmp = to(this.u1h().castToVar(), this.t1h());
|
|
996
|
+
} else {
|
|
997
|
+
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + toString(this));
|
|
998
|
+
}
|
|
999
|
+
return tmp;
|
|
1000
|
+
};
|
|
1001
|
+
protoOf(Equation).toSubstitution = function () {
|
|
1002
|
+
var tmp;
|
|
1003
|
+
if (this.t1h().tu()) {
|
|
1004
|
+
tmp = Companion_getInstance().unifier(this.t1h().castToVar(), this.u1h());
|
|
1005
|
+
} else if (this.u1h().tu()) {
|
|
1006
|
+
tmp = Companion_getInstance().unifier(this.u1h().castToVar(), this.t1h());
|
|
1007
|
+
} else {
|
|
1008
|
+
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + toString(this));
|
|
1009
|
+
}
|
|
1010
|
+
return tmp;
|
|
1011
|
+
};
|
|
1012
|
+
protoOf(Equation).p1g = function () {
|
|
1013
|
+
return Companion_getInstance_0().of('=', [this.t1h(), this.u1h()]);
|
|
699
1014
|
};
|
|
700
1015
|
protoOf(Equation).toTerm = function () {
|
|
701
|
-
return this.
|
|
1016
|
+
return this.p1g();
|
|
702
1017
|
};
|
|
703
1018
|
protoOf(Equation).toPair = function () {
|
|
704
|
-
return new Pair(this.
|
|
1019
|
+
return new Pair(this.t1h(), this.u1h());
|
|
705
1020
|
};
|
|
706
1021
|
protoOf(Equation).swap = function () {
|
|
707
|
-
return Companion_instance_0.of(this.
|
|
1022
|
+
return Companion_instance_0.of(this.u1h(), this.t1h());
|
|
708
1023
|
};
|
|
709
|
-
protoOf(Equation).
|
|
710
|
-
return Companion_instance_0.
|
|
1024
|
+
protoOf(Equation).w1i = function (substitution, equalityChecker) {
|
|
1025
|
+
return Companion_instance_0.h1i(this.t1h().getSubstituted(substitution, []), this.u1h().getSubstituted(substitution, []), equalityChecker);
|
|
711
1026
|
};
|
|
712
1027
|
protoOf(Equation).apply = function (substitution, equalityChecker, $super) {
|
|
713
1028
|
var tmp;
|
|
@@ -717,7 +1032,7 @@
|
|
|
717
1032
|
tmp = equalityChecker;
|
|
718
1033
|
}
|
|
719
1034
|
equalityChecker = tmp;
|
|
720
|
-
return $super === VOID ? this.
|
|
1035
|
+
return $super === VOID ? this.w1i(substitution, equalityChecker) : $super.w1i.call(this, substitution, equalityChecker);
|
|
721
1036
|
};
|
|
722
1037
|
function toEquations(_this__u8e3s4) {
|
|
723
1038
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -731,7 +1046,7 @@
|
|
|
731
1046
|
var variable = item.d2();
|
|
732
1047
|
// Inline function 'kotlin.collections.component2' call
|
|
733
1048
|
var term = item.e2();
|
|
734
|
-
var tmp$ret$2 = new
|
|
1049
|
+
var tmp$ret$2 = new LeftAssignment(variable, term);
|
|
735
1050
|
destination.l(tmp$ret$2);
|
|
736
1051
|
}
|
|
737
1052
|
return destination;
|
|
@@ -741,34 +1056,21 @@
|
|
|
741
1056
|
var tmp_0 = asSequence_0(_this__u8e3s4);
|
|
742
1057
|
return tmp.ofSequence(map(tmp_0, toSubstitution$lambda));
|
|
743
1058
|
}
|
|
744
|
-
function toAssignmentPair(_this__u8e3s4) {
|
|
745
|
-
var tmp;
|
|
746
|
-
if (_this__u8e3s4.d1h()) {
|
|
747
|
-
tmp = _this__u8e3s4.y1g().q1h();
|
|
748
|
-
} else if (_this__u8e3s4.t1g().tu()) {
|
|
749
|
-
tmp = to(_this__u8e3s4.t1g().castToVar(), _this__u8e3s4.u1g());
|
|
750
|
-
} else if (_this__u8e3s4.u1g().tu()) {
|
|
751
|
-
tmp = to(_this__u8e3s4.u1g().castToVar(), _this__u8e3s4.t1g());
|
|
752
|
-
} else {
|
|
753
|
-
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + toString(_this__u8e3s4));
|
|
754
|
-
}
|
|
755
|
-
return tmp;
|
|
756
|
-
}
|
|
757
1059
|
function toSubstitution$lambda(it) {
|
|
758
|
-
return toAssignmentPair(
|
|
1060
|
+
return it.toAssignmentPair();
|
|
759
1061
|
}
|
|
760
1062
|
function Unificator$Companion$default$delegate$lambda() {
|
|
761
1063
|
return Companion_getInstance_2().strict();
|
|
762
1064
|
}
|
|
763
1065
|
function Unificator$Companion$_get_default_$ref_8i2tx3() {
|
|
764
1066
|
return constructCallableReference(function (p0) {
|
|
765
|
-
return p0.
|
|
1067
|
+
return p0.k1k();
|
|
766
1068
|
}, 1, 0, 28);
|
|
767
1069
|
}
|
|
768
1070
|
function Unificator$Companion$naive$1($context) {
|
|
769
1071
|
AbstractUnificator.call(this, $context);
|
|
770
1072
|
}
|
|
771
|
-
protoOf(Unificator$Companion$naive$1).
|
|
1073
|
+
protoOf(Unificator$Companion$naive$1).o1h = function (first, second) {
|
|
772
1074
|
var tmp;
|
|
773
1075
|
if (first.yu() && second.yu()) {
|
|
774
1076
|
tmp = first.castToInteger().e2().bj(second.castToInteger().e2()) === 0;
|
|
@@ -785,7 +1087,7 @@
|
|
|
785
1087
|
function Unificator$Companion$strict$1($context) {
|
|
786
1088
|
AbstractUnificator.call(this, $context);
|
|
787
1089
|
}
|
|
788
|
-
protoOf(Unificator$Companion$strict$1).
|
|
1090
|
+
protoOf(Unificator$Companion$strict$1).o1h = function (first, second) {
|
|
789
1091
|
return first.equals(second);
|
|
790
1092
|
};
|
|
791
1093
|
protoOf(Unificator$Companion$strict$1).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
@@ -794,27 +1096,27 @@
|
|
|
794
1096
|
function Companion_0() {
|
|
795
1097
|
Companion_instance_1 = this;
|
|
796
1098
|
var tmp = this;
|
|
797
|
-
tmp.
|
|
798
|
-
this.
|
|
1099
|
+
tmp.i1k_1 = lazy(Unificator$Companion$default$delegate$lambda);
|
|
1100
|
+
this.j1k_1 = 32;
|
|
799
1101
|
}
|
|
800
|
-
protoOf(Companion_0).
|
|
801
|
-
var tmp0 = this.
|
|
1102
|
+
protoOf(Companion_0).k1k = function () {
|
|
1103
|
+
var tmp0 = this.i1k_1;
|
|
802
1104
|
var tmp = KProperty1;
|
|
803
1105
|
// Inline function 'kotlin.getValue' call
|
|
804
1106
|
getPropertyCallableRef('default', 1, tmp, Unificator$Companion$_get_default_$ref_8i2tx3(), null);
|
|
805
1107
|
return tmp0.e2();
|
|
806
1108
|
};
|
|
807
1109
|
protoOf(Companion_0).mguWith = function (_this__u8e3s4, other) {
|
|
808
|
-
return this.
|
|
1110
|
+
return this.k1k().mgu(_this__u8e3s4, other);
|
|
809
1111
|
};
|
|
810
1112
|
protoOf(Companion_0).matches = function (_this__u8e3s4, other) {
|
|
811
|
-
return this.
|
|
1113
|
+
return this.k1k().match(_this__u8e3s4, other);
|
|
812
1114
|
};
|
|
813
1115
|
protoOf(Companion_0).unifyWith = function (_this__u8e3s4, other) {
|
|
814
|
-
return this.
|
|
1116
|
+
return this.k1k().unify(_this__u8e3s4, other);
|
|
815
1117
|
};
|
|
816
1118
|
protoOf(Companion_0).mergeWith = function (_this__u8e3s4, other) {
|
|
817
|
-
return this.
|
|
1119
|
+
return this.k1k().merge(_this__u8e3s4, other);
|
|
818
1120
|
};
|
|
819
1121
|
protoOf(Companion_0).naiveWithContext = function (context) {
|
|
820
1122
|
return new Unificator$Companion$naive$1(context);
|
|
@@ -828,10 +1130,10 @@
|
|
|
828
1130
|
protoOf(Companion_0).strict = function () {
|
|
829
1131
|
return this.strictWithContext(Companion_getInstance().empty());
|
|
830
1132
|
};
|
|
831
|
-
protoOf(Companion_0).
|
|
1133
|
+
protoOf(Companion_0).p1k = function (other, capacity) {
|
|
832
1134
|
var tmp;
|
|
833
1135
|
if (other instanceof CachedUnificator) {
|
|
834
|
-
tmp = new CachedUnificator(other.
|
|
1136
|
+
tmp = new CachedUnificator(other.k1i_1, capacity);
|
|
835
1137
|
} else {
|
|
836
1138
|
tmp = new CachedUnificator(other, capacity);
|
|
837
1139
|
}
|
|
@@ -839,7 +1141,7 @@
|
|
|
839
1141
|
};
|
|
840
1142
|
protoOf(Companion_0).cached = function (other, capacity, $super) {
|
|
841
1143
|
capacity = capacity === VOID ? 32 : capacity;
|
|
842
|
-
return $super === VOID ? this.
|
|
1144
|
+
return $super === VOID ? this.p1k(other, capacity) : $super.p1k.call(this, other, capacity);
|
|
843
1145
|
};
|
|
844
1146
|
var Companion_instance_1;
|
|
845
1147
|
function Companion_getInstance_2() {
|
|
@@ -866,12 +1168,36 @@
|
|
|
866
1168
|
protoOf(CachedUnificator).merge = merge;
|
|
867
1169
|
protoOf(Equation).ep = castTo;
|
|
868
1170
|
defineProp(protoOf(Equation), 'lhs', function () {
|
|
869
|
-
return this.
|
|
1171
|
+
return this.t1h();
|
|
870
1172
|
});
|
|
871
1173
|
defineProp(protoOf(Equation), 'rhs', function () {
|
|
872
|
-
return this.
|
|
1174
|
+
return this.u1h();
|
|
1175
|
+
});
|
|
1176
|
+
defineProp(protoOf(Equation), 'isIdentity', function () {
|
|
1177
|
+
return this.w1h();
|
|
1178
|
+
});
|
|
1179
|
+
defineProp(protoOf(Equation), 'isAssignment', function () {
|
|
1180
|
+
return this.f1i();
|
|
1181
|
+
});
|
|
1182
|
+
defineProp(protoOf(Equation), 'isLeftAssignment', function () {
|
|
1183
|
+
return this.u1i();
|
|
1184
|
+
});
|
|
1185
|
+
defineProp(protoOf(Equation), 'isRightAssignment', function () {
|
|
1186
|
+
return this.v1i();
|
|
1187
|
+
});
|
|
1188
|
+
defineProp(protoOf(Equation), 'isComparison', function () {
|
|
1189
|
+
return this.x1h();
|
|
1190
|
+
});
|
|
1191
|
+
defineProp(protoOf(Equation), 'isContradiction', function () {
|
|
1192
|
+
return this.v1h();
|
|
1193
|
+
});
|
|
1194
|
+
defineProp(protoOf(Assignment), 'variable', function () {
|
|
1195
|
+
return this.d1i();
|
|
1196
|
+
});
|
|
1197
|
+
defineProp(protoOf(Assignment), 'term', function () {
|
|
1198
|
+
return this.e1i();
|
|
873
1199
|
});
|
|
874
|
-
defineProp(protoOf(Companion_0), 'default', protoOf(Companion_0).
|
|
1200
|
+
defineProp(protoOf(Companion_0), 'default', protoOf(Companion_0).k1k);
|
|
875
1201
|
//endregion
|
|
876
1202
|
//region block: init
|
|
877
1203
|
Companion_instance_0 = new Companion();
|