@tuprolog/arg2p-core 0.7.3 → 0.8.2
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 +2784 -2731
- package/2p-core.js.map +1 -1
- package/2p-dsl-core.js +1620 -5
- package/2p-dsl-core.js.map +1 -1
- package/2p-dsl-solve.js +949 -5
- package/2p-dsl-solve.js.map +1 -1
- package/2p-dsl-theory.js +796 -5
- package/2p-dsl-theory.js.map +1 -1
- package/2p-dsl-unify.js +69 -5
- package/2p-dsl-unify.js.map +1 -1
- package/2p-parser-core.js +538 -191
- package/2p-parser-core.js.map +1 -1
- package/2p-parser-js.js +1 -1
- package/2p-parser-theory.js +28 -23
- package/2p-parser-theory.js.map +1 -1
- package/2p-solve-classic.js +1034 -1027
- package/2p-solve-classic.js.map +1 -1
- package/2p-solve.js +3833 -3752
- package/2p-solve.js.map +1 -1
- package/2p-theory.js +1649 -1634
- package/2p-theory.js.map +1 -1
- package/2p-unify.js +259 -252
- package/2p-unify.js.map +1 -1
- package/2p-utils.js +542 -455
- package/2p-utils.js.map +1 -1
- package/arg2p-core.js +4333 -364
- package/arg2p-core.js.map +1 -1
- package/kotlin-kotlin-stdlib.js +2599 -2057
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kt-math.js +2222 -2218
- package/kt-math.js.map +1 -1
- package/package.json +1 -1
package/2p-unify.js
CHANGED
|
@@ -19,55 +19,60 @@
|
|
|
19
19
|
'use strict';
|
|
20
20
|
//region block: imports
|
|
21
21
|
var imul = Math.imul;
|
|
22
|
-
var asSequence = kotlin_kotlin.$_$.
|
|
23
|
-
var plus = kotlin_kotlin.$_$.
|
|
24
|
-
var map = kotlin_kotlin.$_$.
|
|
25
|
-
var Unit_instance = kotlin_kotlin.$_$.
|
|
26
|
-
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.
|
|
22
|
+
var asSequence = kotlin_kotlin.$_$.g2;
|
|
23
|
+
var plus = kotlin_kotlin.$_$.w7;
|
|
24
|
+
var map = kotlin_kotlin.$_$.s7;
|
|
25
|
+
var Unit_instance = kotlin_kotlin.$_$.s1;
|
|
26
|
+
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.v;
|
|
27
27
|
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.f;
|
|
28
|
-
var toCollection = kotlin_kotlin.$_$.
|
|
29
|
-
var Pair = kotlin_kotlin.$_$.
|
|
28
|
+
var toCollection = kotlin_kotlin.$_$.e8;
|
|
29
|
+
var Pair = kotlin_kotlin.$_$.t9;
|
|
30
30
|
var VOID = kotlin_kotlin.$_$.d;
|
|
31
|
-
var lazy = kotlin_kotlin.$_$.
|
|
32
|
-
var protoOf = kotlin_kotlin.$_$.
|
|
33
|
-
var asSequence_0 = kotlin_kotlin.$_$.
|
|
34
|
-
var classMeta = kotlin_kotlin.$_$.
|
|
35
|
-
var setMetadataFor = kotlin_kotlin.$_$.
|
|
36
|
-
var KProperty1 = kotlin_kotlin.$_$.
|
|
37
|
-
var getPropertyCallableRef = kotlin_kotlin.$_$.
|
|
31
|
+
var lazy = kotlin_kotlin.$_$.aa;
|
|
32
|
+
var protoOf = kotlin_kotlin.$_$.a6;
|
|
33
|
+
var asSequence_0 = kotlin_kotlin.$_$.h2;
|
|
34
|
+
var classMeta = kotlin_kotlin.$_$.e5;
|
|
35
|
+
var setMetadataFor = kotlin_kotlin.$_$.b6;
|
|
36
|
+
var KProperty1 = kotlin_kotlin.$_$.u6;
|
|
37
|
+
var getPropertyCallableRef = kotlin_kotlin.$_$.k5;
|
|
38
38
|
var Companion_instance = kotlin_it_unibo_tuprolog_utils.$_$.a;
|
|
39
|
-
var Triple = kotlin_kotlin.$_$.
|
|
40
|
-
var Some = kotlin_it_unibo_tuprolog_utils.$_$.
|
|
41
|
-
var zip = kotlin_kotlin.$_$.
|
|
42
|
-
var flatMap = kotlin_kotlin.$_$.
|
|
43
|
-
var sequenceOf = kotlin_kotlin.$_$.
|
|
44
|
-
var THROW_CCE = kotlin_kotlin.$_$.
|
|
45
|
-
var to = kotlin_kotlin.$_$.
|
|
46
|
-
var objectMeta = kotlin_kotlin.$_$.
|
|
39
|
+
var Triple = kotlin_kotlin.$_$.x9;
|
|
40
|
+
var Some = kotlin_it_unibo_tuprolog_utils.$_$.j;
|
|
41
|
+
var zip = kotlin_kotlin.$_$.l8;
|
|
42
|
+
var flatMap = kotlin_kotlin.$_$.k7;
|
|
43
|
+
var sequenceOf = kotlin_kotlin.$_$.y7;
|
|
44
|
+
var THROW_CCE = kotlin_kotlin.$_$.v9;
|
|
45
|
+
var to = kotlin_kotlin.$_$.ha;
|
|
46
|
+
var objectMeta = kotlin_kotlin.$_$.z5;
|
|
47
47
|
var getKClass = kotlin_kotlin.$_$.c;
|
|
48
48
|
var ClassCastException_init_$Create$ = kotlin_kotlin.$_$.q;
|
|
49
|
-
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.
|
|
49
|
+
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.u;
|
|
50
50
|
var castTo = kotlin_it_unibo_tuprolog_utils.$_$.e;
|
|
51
|
-
var defineProp = kotlin_kotlin.$_$.
|
|
51
|
+
var defineProp = kotlin_kotlin.$_$.g5;
|
|
52
|
+
var TermConvertible = kotlin_it_unibo_tuprolog_core.$_$.t1;
|
|
52
53
|
var Castable = kotlin_it_unibo_tuprolog_utils.$_$.f;
|
|
53
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.
|
|
54
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.j2;
|
|
54
55
|
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.e;
|
|
55
56
|
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.s;
|
|
56
|
-
var interfaceMeta = kotlin_kotlin.$_$.
|
|
57
|
+
var interfaceMeta = kotlin_kotlin.$_$.n5;
|
|
57
58
|
//endregion
|
|
58
59
|
//region block: pre-declaration
|
|
60
|
+
function mguWithOccurCheck(term1, term2, occurCheckEnabled, $super) {
|
|
61
|
+
occurCheckEnabled = occurCheckEnabled === VOID ? true : occurCheckEnabled;
|
|
62
|
+
return $super === VOID ? this.u1j(term1, term2, occurCheckEnabled) : $super.u1j.call(this, term1, term2, occurCheckEnabled);
|
|
63
|
+
}
|
|
59
64
|
function mgu(term1, term2) {
|
|
60
|
-
return this.
|
|
65
|
+
return this.u1j(term1, term2, true);
|
|
61
66
|
}
|
|
62
67
|
function matchWithOccurCheck(term1, term2, occurCheckEnabled) {
|
|
63
|
-
return !(this.
|
|
68
|
+
return !(this.u1j(term1, term2, occurCheckEnabled) === Companion_getInstance().failed());
|
|
64
69
|
}
|
|
65
70
|
function match(term1, term2) {
|
|
66
71
|
return this.matchWithOccurCheck(term1, term2, true);
|
|
67
72
|
}
|
|
68
73
|
function unifyWithOccurCheck(term1, term2, occurCheckEnabled) {
|
|
69
|
-
var substitution = this.
|
|
70
|
-
return substitution.
|
|
74
|
+
var substitution = this.u1j(term1, term2, occurCheckEnabled);
|
|
75
|
+
return substitution.e11() ? null : term1.getSubstituted(substitution, []);
|
|
71
76
|
}
|
|
72
77
|
function unify(term1, term2) {
|
|
73
78
|
return this.unifyWithOccurCheck(term1, term2, true);
|
|
@@ -78,7 +83,7 @@
|
|
|
78
83
|
setMetadataFor(Unificator, 'Unificator', interfaceMeta);
|
|
79
84
|
setMetadataFor(AbstractUnificator, 'AbstractUnificator', classMeta, VOID, [Unificator]);
|
|
80
85
|
setMetadataFor(CachedUnificator, 'CachedUnificator', classMeta, VOID, [Unificator]);
|
|
81
|
-
setMetadataFor(Equation, 'Equation', classMeta, VOID, [Castable]);
|
|
86
|
+
setMetadataFor(Equation, 'Equation', classMeta, VOID, [TermConvertible, Castable]);
|
|
82
87
|
setMetadataFor(Identity, 'Identity', classMeta, Equation);
|
|
83
88
|
setMetadataFor(Assignment, 'Assignment', classMeta, Equation);
|
|
84
89
|
setMetadataFor(Comparison, 'Comparison', classMeta, Equation);
|
|
@@ -90,21 +95,21 @@
|
|
|
90
95
|
//endregion
|
|
91
96
|
function _get_contextEquations__x0dd77($this) {
|
|
92
97
|
// Inline function 'kotlin.getValue' call
|
|
93
|
-
var this_0 = $this.
|
|
98
|
+
var this_0 = $this.d1j_1;
|
|
94
99
|
contextEquations$factory();
|
|
95
|
-
return this_0.
|
|
100
|
+
return this_0.r2();
|
|
96
101
|
}
|
|
97
102
|
function occurrenceCheck($this, variable, term) {
|
|
98
103
|
var tmp;
|
|
99
|
-
if (term.
|
|
100
|
-
tmp = $this.
|
|
101
|
-
} else if (term.
|
|
104
|
+
if (term.vv()) {
|
|
105
|
+
tmp = $this.e1j(variable, term);
|
|
106
|
+
} else if (term.fv()) {
|
|
102
107
|
var tmp$ret$1;
|
|
103
108
|
$l$block: {
|
|
104
109
|
// Inline function 'kotlin.sequences.any' call
|
|
105
|
-
var tmp0_iterator = term.
|
|
106
|
-
while (tmp0_iterator.
|
|
107
|
-
var element = tmp0_iterator.
|
|
110
|
+
var tmp0_iterator = term.bv().r();
|
|
111
|
+
while (tmp0_iterator.s()) {
|
|
112
|
+
var element = tmp0_iterator.u();
|
|
108
113
|
// Inline function 'it.unibo.tuprolog.unify.AbstractUnificator.occurrenceCheck.<anonymous>' call
|
|
109
114
|
if (occurrenceCheck($this, variable, element)) {
|
|
110
115
|
tmp$ret$1 = true;
|
|
@@ -121,7 +126,7 @@
|
|
|
121
126
|
}
|
|
122
127
|
function equationsFor($this, term1, term2) {
|
|
123
128
|
var tmp = Companion_instance_0;
|
|
124
|
-
return tmp.
|
|
129
|
+
return tmp.f1j(term1, term2, AbstractUnificator$checkTermsEquality$ref($this));
|
|
125
130
|
}
|
|
126
131
|
function equationsFor_0($this, substitution1, substitution2) {
|
|
127
132
|
var tmp = Companion_instance_0;
|
|
@@ -139,7 +144,7 @@
|
|
|
139
144
|
}
|
|
140
145
|
while (inductionVariable < exceptIndex);
|
|
141
146
|
var inductionVariable_0 = exceptIndex + 1 | 0;
|
|
142
|
-
var last = equations.
|
|
147
|
+
var last = equations.l();
|
|
143
148
|
if (inductionVariable_0 < last)
|
|
144
149
|
do {
|
|
145
150
|
var i_0 = inductionVariable_0;
|
|
@@ -153,32 +158,32 @@
|
|
|
153
158
|
var changed = true;
|
|
154
159
|
while (changed) {
|
|
155
160
|
changed = false;
|
|
156
|
-
var eqIterator = equations.
|
|
157
|
-
while (eqIterator.
|
|
158
|
-
var eq = eqIterator.
|
|
159
|
-
if (eq.
|
|
161
|
+
var eqIterator = equations.z1();
|
|
162
|
+
while (eqIterator.s()) {
|
|
163
|
+
var eq = eqIterator.u();
|
|
164
|
+
if (eq.k1j()) {
|
|
160
165
|
return Companion_getInstance().failed();
|
|
161
|
-
} else if (eq.
|
|
162
|
-
eqIterator.
|
|
166
|
+
} else if (eq.l1j()) {
|
|
167
|
+
eqIterator.t();
|
|
163
168
|
changed = true;
|
|
164
|
-
} else if (eq.
|
|
165
|
-
var assignment = eq.
|
|
166
|
-
if (occurCheckEnabled ? occurrenceCheck($this, assignment.
|
|
169
|
+
} else if (eq.s1j()) {
|
|
170
|
+
var assignment = eq.n1j();
|
|
171
|
+
if (occurCheckEnabled ? occurrenceCheck($this, assignment.q1j_1, eq.j1j()) : false) {
|
|
167
172
|
return Companion_getInstance().failed();
|
|
168
173
|
} else {
|
|
169
|
-
changed = changed ? true : applySubstitutionToEquations($this, assignment.toSubstitution(), equations, eqIterator.
|
|
174
|
+
changed = changed ? true : applySubstitutionToEquations($this, assignment.toSubstitution(), equations, eqIterator.o1());
|
|
170
175
|
}
|
|
171
|
-
} else if (eq.
|
|
172
|
-
eqIterator.
|
|
173
|
-
var tmp0_iterator = equationsFor($this, eq.
|
|
174
|
-
insertion: while (tmp0_iterator.
|
|
175
|
-
var it = tmp0_iterator.
|
|
176
|
-
if (it.
|
|
176
|
+
} else if (eq.m1j()) {
|
|
177
|
+
eqIterator.t();
|
|
178
|
+
var tmp0_iterator = equationsFor($this, eq.i1j(), eq.j1j()).r();
|
|
179
|
+
insertion: while (tmp0_iterator.s()) {
|
|
180
|
+
var it = tmp0_iterator.u();
|
|
181
|
+
if (it.l1j())
|
|
177
182
|
continue insertion;
|
|
178
|
-
else if (it.
|
|
183
|
+
else if (it.k1j())
|
|
179
184
|
return Companion_getInstance().failed();
|
|
180
185
|
else {
|
|
181
|
-
eqIterator.
|
|
186
|
+
eqIterator.r1(it);
|
|
182
187
|
}
|
|
183
188
|
}
|
|
184
189
|
changed = true;
|
|
@@ -188,12 +193,12 @@
|
|
|
188
193
|
// Inline function 'kotlin.collections.filter' call
|
|
189
194
|
// Inline function 'kotlin.collections.filterTo' call
|
|
190
195
|
var destination = ArrayList_init_$Create$();
|
|
191
|
-
var tmp0_iterator_0 = equations.
|
|
192
|
-
while (tmp0_iterator_0.
|
|
193
|
-
var element = tmp0_iterator_0.
|
|
196
|
+
var tmp0_iterator_0 = equations.r();
|
|
197
|
+
while (tmp0_iterator_0.s()) {
|
|
198
|
+
var element = tmp0_iterator_0.u();
|
|
194
199
|
// Inline function 'it.unibo.tuprolog.unify.AbstractUnificator.mgu.<anonymous>' call
|
|
195
|
-
if (element.
|
|
196
|
-
destination.
|
|
200
|
+
if (element.s1j()) {
|
|
201
|
+
destination.o(element);
|
|
197
202
|
}
|
|
198
203
|
}
|
|
199
204
|
return toSubstitution(destination);
|
|
@@ -204,62 +209,62 @@
|
|
|
204
209
|
return toCollection(items, tmp$ret$0);
|
|
205
210
|
}
|
|
206
211
|
function applySubstitutionToEquations$handleIndex($equations, $substitution, this$0, changed, i) {
|
|
207
|
-
if ($equations.
|
|
212
|
+
if ($equations.d1(i).k1j() ? true : $equations.d1(i).l1j())
|
|
208
213
|
return Unit_instance;
|
|
209
|
-
var currentEq = $equations.
|
|
214
|
+
var currentEq = $equations.d1(i);
|
|
210
215
|
var tmp0_container = currentEq.apply($substitution).toPair();
|
|
211
|
-
var newLhs = tmp0_container.
|
|
212
|
-
var newRhs = tmp0_container.
|
|
213
|
-
if (!currentEq.
|
|
216
|
+
var newLhs = tmp0_container.gd();
|
|
217
|
+
var newRhs = tmp0_container.hd();
|
|
218
|
+
if (!currentEq.i1j().equals(newLhs) ? true : !currentEq.j1j().equals(newRhs)) {
|
|
214
219
|
var tmp = Companion_instance_0;
|
|
215
|
-
$equations.
|
|
220
|
+
$equations.m(i, tmp.t1j(newLhs, newRhs, AbstractUnificator$checkTermsEquality$ref_0(this$0)));
|
|
216
221
|
changed._v = true;
|
|
217
222
|
}
|
|
218
223
|
}
|
|
219
224
|
function AbstractUnificator$contextEquations$delegate$lambda(this$0) {
|
|
220
225
|
return function () {
|
|
221
|
-
return toEquations(this$0.
|
|
226
|
+
return toEquations(this$0.mb());
|
|
222
227
|
};
|
|
223
228
|
}
|
|
224
229
|
function AbstractUnificator$checkTermsEquality$ref($boundThis) {
|
|
225
230
|
var l = function (p0, p1) {
|
|
226
|
-
return $boundThis.
|
|
231
|
+
return $boundThis.e1j(p0, p1);
|
|
227
232
|
};
|
|
228
233
|
l.callableName = 'checkTermsEquality';
|
|
229
234
|
return l;
|
|
230
235
|
}
|
|
231
236
|
function AbstractUnificator$equationsFor$lambda(it) {
|
|
232
237
|
// Inline function 'kotlin.collections.toPair' call
|
|
233
|
-
return new Pair(it.
|
|
238
|
+
return new Pair(it.q2(), it.r2());
|
|
234
239
|
}
|
|
235
240
|
function AbstractUnificator$checkTermsEquality$ref_0($boundThis) {
|
|
236
241
|
var l = function (p0, p1) {
|
|
237
|
-
return $boundThis.
|
|
242
|
+
return $boundThis.e1j(p0, p1);
|
|
238
243
|
};
|
|
239
244
|
l.callableName = 'checkTermsEquality';
|
|
240
245
|
return l;
|
|
241
246
|
}
|
|
242
247
|
function AbstractUnificator(context) {
|
|
243
248
|
context = context === VOID ? Companion_getInstance().empty() : context;
|
|
244
|
-
this.
|
|
249
|
+
this.c1j_1 = context;
|
|
245
250
|
var tmp = this;
|
|
246
|
-
tmp.
|
|
251
|
+
tmp.d1j_1 = lazy(AbstractUnificator$contextEquations$delegate$lambda(this));
|
|
247
252
|
}
|
|
248
|
-
protoOf(AbstractUnificator).
|
|
249
|
-
return this.
|
|
253
|
+
protoOf(AbstractUnificator).mb = function () {
|
|
254
|
+
return this.c1j_1;
|
|
250
255
|
};
|
|
251
|
-
protoOf(AbstractUnificator).
|
|
252
|
-
if (this.
|
|
256
|
+
protoOf(AbstractUnificator).u1j = function (term1, term2, occurCheckEnabled) {
|
|
257
|
+
if (this.mb().e11())
|
|
253
258
|
return Companion_getInstance().failed();
|
|
254
259
|
var equations = newDeque(this, plus(asSequence_0(_get_contextEquations__x0dd77(this)), equationsFor(this, term1, term2)));
|
|
255
260
|
return mgu_0(this, equations, occurCheckEnabled);
|
|
256
261
|
};
|
|
257
|
-
protoOf(AbstractUnificator).
|
|
258
|
-
if ((this.
|
|
262
|
+
protoOf(AbstractUnificator).v1j = function (substitution1, substitution2, occurCheckEnabled) {
|
|
263
|
+
if ((this.mb().e11() ? true : substitution1.e11()) ? true : substitution2.e11())
|
|
259
264
|
return Companion_getInstance().failed();
|
|
260
265
|
if (!occurCheckEnabled) {
|
|
261
|
-
var quickMerge = this.
|
|
262
|
-
if (quickMerge.
|
|
266
|
+
var quickMerge = this.mb().plus(substitution1).plus(substitution2);
|
|
267
|
+
if (quickMerge.d11()) {
|
|
263
268
|
return quickMerge;
|
|
264
269
|
}
|
|
265
270
|
}
|
|
@@ -267,7 +272,7 @@
|
|
|
267
272
|
return mgu_0(this, equations, occurCheckEnabled);
|
|
268
273
|
};
|
|
269
274
|
protoOf(AbstractUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
270
|
-
return this.
|
|
275
|
+
return this.v1j(substitution1, substitution2, occurCheckEnabled);
|
|
271
276
|
};
|
|
272
277
|
function contextEquations$factory() {
|
|
273
278
|
return getPropertyCallableRef('contextEquations', 1, KProperty1, function (receiver) {
|
|
@@ -275,37 +280,37 @@
|
|
|
275
280
|
}, null);
|
|
276
281
|
}
|
|
277
282
|
function CachedUnificator(decorated, cacheCapacity) {
|
|
278
|
-
this.
|
|
279
|
-
this.
|
|
283
|
+
this.w1j_1 = decorated;
|
|
284
|
+
this.x1j_1 = Companion_instance.jp(cacheCapacity);
|
|
280
285
|
}
|
|
281
|
-
protoOf(CachedUnificator).
|
|
286
|
+
protoOf(CachedUnificator).u1j = function (term1, term2, occurCheckEnabled) {
|
|
282
287
|
var mguRequest = new Triple(term1, term2, occurCheckEnabled);
|
|
283
|
-
var cached = this.
|
|
288
|
+
var cached = this.x1j_1.x2(mguRequest);
|
|
284
289
|
var tmp;
|
|
285
290
|
if (cached instanceof Some) {
|
|
286
|
-
tmp = cached.
|
|
291
|
+
tmp = cached.mp_1;
|
|
287
292
|
} else {
|
|
288
|
-
var mguResult = this.
|
|
289
|
-
this.
|
|
293
|
+
var mguResult = this.w1j_1.u1j(term1, term2, occurCheckEnabled);
|
|
294
|
+
this.x1j_1.kp(mguRequest, mguResult);
|
|
290
295
|
tmp = mguResult;
|
|
291
296
|
}
|
|
292
297
|
return tmp;
|
|
293
298
|
};
|
|
294
|
-
protoOf(CachedUnificator).
|
|
299
|
+
protoOf(CachedUnificator).v1j = function (substitution1, substitution2, occurCheckEnabled) {
|
|
295
300
|
var mguRequest = new Triple(substitution1, substitution2, occurCheckEnabled);
|
|
296
|
-
var cached = this.
|
|
301
|
+
var cached = this.x1j_1.x2(mguRequest);
|
|
297
302
|
var tmp;
|
|
298
303
|
if (cached instanceof Some) {
|
|
299
|
-
tmp = cached.
|
|
304
|
+
tmp = cached.mp_1;
|
|
300
305
|
} else {
|
|
301
|
-
var mguResult = this.
|
|
302
|
-
this.
|
|
306
|
+
var mguResult = this.w1j_1.mergeWithOccurCheck(substitution1, substitution2, occurCheckEnabled);
|
|
307
|
+
this.x1j_1.kp(mguRequest, mguResult);
|
|
303
308
|
tmp = mguResult;
|
|
304
309
|
}
|
|
305
310
|
return tmp;
|
|
306
311
|
};
|
|
307
312
|
protoOf(CachedUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
308
|
-
return this.
|
|
313
|
+
return this.v1j(substitution1, substitution2, occurCheckEnabled);
|
|
309
314
|
};
|
|
310
315
|
function allOfLists($this, lhs, rhs, equalityChecker) {
|
|
311
316
|
var tmp = zip(lhs.unfold(), rhs.unfold());
|
|
@@ -338,7 +343,7 @@
|
|
|
338
343
|
}
|
|
339
344
|
function Equation$Companion$from$lambda($equalityChecker) {
|
|
340
345
|
return function (it) {
|
|
341
|
-
return Companion_instance_0.
|
|
346
|
+
return Companion_instance_0.y1j(it, $equalityChecker);
|
|
342
347
|
};
|
|
343
348
|
}
|
|
344
349
|
function Term$equals$ref_2() {
|
|
@@ -364,16 +369,16 @@
|
|
|
364
369
|
}
|
|
365
370
|
function Equation$Companion$allOfLists$lambda($equalityChecker) {
|
|
366
371
|
return function (_name_for_destructuring_parameter_0__wldtmu) {
|
|
367
|
-
var l = _name_for_destructuring_parameter_0__wldtmu.
|
|
368
|
-
var r = _name_for_destructuring_parameter_0__wldtmu.
|
|
369
|
-
return (l.
|
|
372
|
+
var l = _name_for_destructuring_parameter_0__wldtmu.gd();
|
|
373
|
+
var r = _name_for_destructuring_parameter_0__wldtmu.hd();
|
|
374
|
+
return (l.mv() ? r.mv() : false) ? sequenceOf([Companion_instance_0.t1j(l.castToCons().fx(), r.castToCons().fx(), $equalityChecker)]) : (l.lv() ? r.lv() : false) ? sequenceOf([Companion_instance_0.t1j(l.castToList(), r.castToList(), $equalityChecker)]) : Companion_instance_0.f1j(l, r, $equalityChecker);
|
|
370
375
|
};
|
|
371
376
|
}
|
|
372
377
|
function Equation$Companion$allOfTuples$lambda($equalityChecker) {
|
|
373
378
|
return function (_name_for_destructuring_parameter_0__wldtmu) {
|
|
374
|
-
var l = _name_for_destructuring_parameter_0__wldtmu.
|
|
375
|
-
var r = _name_for_destructuring_parameter_0__wldtmu.
|
|
376
|
-
return (l.
|
|
379
|
+
var l = _name_for_destructuring_parameter_0__wldtmu.gd();
|
|
380
|
+
var r = _name_for_destructuring_parameter_0__wldtmu.hd();
|
|
381
|
+
return (l.kv() ? r.kv() : false) ? sequenceOf([Companion_instance_0.t1j(l.castToTuple().tw(), r.castToTuple().tw(), $equalityChecker)]) : Companion_instance_0.f1j(l, r, $equalityChecker);
|
|
377
382
|
};
|
|
378
383
|
}
|
|
379
384
|
function Term$equals$ref_5() {
|
|
@@ -385,29 +390,29 @@
|
|
|
385
390
|
}
|
|
386
391
|
function Equation$Companion$allOf$lambda($equalityChecker) {
|
|
387
392
|
return function (it) {
|
|
388
|
-
return Companion_instance_0.
|
|
393
|
+
return Companion_instance_0.y1j(it, $equalityChecker);
|
|
389
394
|
};
|
|
390
395
|
}
|
|
391
396
|
function Identity(lhs, rhs) {
|
|
392
397
|
Equation.call(this, lhs, rhs);
|
|
393
|
-
this.
|
|
394
|
-
this.
|
|
398
|
+
this.b1k_1 = lhs;
|
|
399
|
+
this.c1k_1 = rhs;
|
|
395
400
|
}
|
|
396
|
-
protoOf(Identity).
|
|
397
|
-
return this.
|
|
401
|
+
protoOf(Identity).i1j = function () {
|
|
402
|
+
return this.b1k_1;
|
|
398
403
|
};
|
|
399
|
-
protoOf(Identity).
|
|
400
|
-
return this.
|
|
404
|
+
protoOf(Identity).j1j = function () {
|
|
405
|
+
return this.c1k_1;
|
|
401
406
|
};
|
|
402
|
-
protoOf(Identity).
|
|
407
|
+
protoOf(Identity).l1j = function () {
|
|
403
408
|
return true;
|
|
404
409
|
};
|
|
405
410
|
protoOf(Identity).toString = function () {
|
|
406
|
-
return 'Identity(lhs=' + this.
|
|
411
|
+
return 'Identity(lhs=' + this.b1k_1 + ', rhs=' + this.c1k_1 + ')';
|
|
407
412
|
};
|
|
408
413
|
protoOf(Identity).hashCode = function () {
|
|
409
|
-
var result = this.
|
|
410
|
-
result = imul(result, 31) + this.
|
|
414
|
+
var result = this.b1k_1.hashCode();
|
|
415
|
+
result = imul(result, 31) + this.c1k_1.hashCode() | 0;
|
|
411
416
|
return result;
|
|
412
417
|
};
|
|
413
418
|
protoOf(Identity).equals = function (other) {
|
|
@@ -416,44 +421,44 @@
|
|
|
416
421
|
if (!(other instanceof Identity))
|
|
417
422
|
return false;
|
|
418
423
|
var tmp0_other_with_cast = other instanceof Identity ? other : THROW_CCE();
|
|
419
|
-
if (!this.
|
|
424
|
+
if (!this.b1k_1.equals(tmp0_other_with_cast.b1k_1))
|
|
420
425
|
return false;
|
|
421
|
-
if (!this.
|
|
426
|
+
if (!this.c1k_1.equals(tmp0_other_with_cast.c1k_1))
|
|
422
427
|
return false;
|
|
423
428
|
return true;
|
|
424
429
|
};
|
|
425
430
|
function Assignment(lhs, rhs) {
|
|
426
431
|
Equation.call(this, lhs, rhs);
|
|
427
|
-
this.
|
|
428
|
-
this.
|
|
432
|
+
this.q1j_1 = lhs;
|
|
433
|
+
this.r1j_1 = rhs;
|
|
429
434
|
}
|
|
430
|
-
protoOf(Assignment).
|
|
431
|
-
return this.
|
|
435
|
+
protoOf(Assignment).i1j = function () {
|
|
436
|
+
return this.q1j_1;
|
|
432
437
|
};
|
|
433
|
-
protoOf(Assignment).
|
|
434
|
-
return this.
|
|
438
|
+
protoOf(Assignment).j1j = function () {
|
|
439
|
+
return this.r1j_1;
|
|
435
440
|
};
|
|
436
441
|
protoOf(Assignment).toSubstitution = function () {
|
|
437
|
-
return Companion_getInstance().unifier(this.
|
|
442
|
+
return Companion_getInstance().unifier(this.q1j_1, this.r1j_1);
|
|
438
443
|
};
|
|
439
|
-
protoOf(Assignment).
|
|
440
|
-
return to(this.
|
|
444
|
+
protoOf(Assignment).f1k = function () {
|
|
445
|
+
return to(this.q1j_1, this.r1j_1);
|
|
441
446
|
};
|
|
442
447
|
protoOf(Assignment).toPair = function () {
|
|
443
|
-
return this.
|
|
448
|
+
return this.f1k();
|
|
444
449
|
};
|
|
445
|
-
protoOf(Assignment).
|
|
450
|
+
protoOf(Assignment).s1j = function () {
|
|
446
451
|
return true;
|
|
447
452
|
};
|
|
448
|
-
protoOf(Assignment).
|
|
453
|
+
protoOf(Assignment).d1k = function () {
|
|
449
454
|
return this;
|
|
450
455
|
};
|
|
451
456
|
protoOf(Assignment).toString = function () {
|
|
452
|
-
return 'Assignment(lhs=' + this.
|
|
457
|
+
return 'Assignment(lhs=' + this.q1j_1 + ', rhs=' + this.r1j_1 + ')';
|
|
453
458
|
};
|
|
454
459
|
protoOf(Assignment).hashCode = function () {
|
|
455
|
-
var result = this.
|
|
456
|
-
result = imul(result, 31) + this.
|
|
460
|
+
var result = this.q1j_1.hashCode();
|
|
461
|
+
result = imul(result, 31) + this.r1j_1.hashCode() | 0;
|
|
457
462
|
return result;
|
|
458
463
|
};
|
|
459
464
|
protoOf(Assignment).equals = function (other) {
|
|
@@ -462,32 +467,32 @@
|
|
|
462
467
|
if (!(other instanceof Assignment))
|
|
463
468
|
return false;
|
|
464
469
|
var tmp0_other_with_cast = other instanceof Assignment ? other : THROW_CCE();
|
|
465
|
-
if (!this.
|
|
470
|
+
if (!this.q1j_1.equals(tmp0_other_with_cast.q1j_1))
|
|
466
471
|
return false;
|
|
467
|
-
if (!this.
|
|
472
|
+
if (!this.r1j_1.equals(tmp0_other_with_cast.r1j_1))
|
|
468
473
|
return false;
|
|
469
474
|
return true;
|
|
470
475
|
};
|
|
471
476
|
function Comparison(lhs, rhs) {
|
|
472
477
|
Equation.call(this, lhs, rhs);
|
|
473
|
-
this.
|
|
474
|
-
this.
|
|
478
|
+
this.i1k_1 = lhs;
|
|
479
|
+
this.j1k_1 = rhs;
|
|
475
480
|
}
|
|
476
|
-
protoOf(Comparison).
|
|
477
|
-
return this.
|
|
481
|
+
protoOf(Comparison).i1j = function () {
|
|
482
|
+
return this.i1k_1;
|
|
478
483
|
};
|
|
479
|
-
protoOf(Comparison).
|
|
480
|
-
return this.
|
|
484
|
+
protoOf(Comparison).j1j = function () {
|
|
485
|
+
return this.j1k_1;
|
|
481
486
|
};
|
|
482
|
-
protoOf(Comparison).
|
|
487
|
+
protoOf(Comparison).m1j = function () {
|
|
483
488
|
return true;
|
|
484
489
|
};
|
|
485
490
|
protoOf(Comparison).toString = function () {
|
|
486
|
-
return 'Comparison(lhs=' + this.
|
|
491
|
+
return 'Comparison(lhs=' + this.i1k_1 + ', rhs=' + this.j1k_1 + ')';
|
|
487
492
|
};
|
|
488
493
|
protoOf(Comparison).hashCode = function () {
|
|
489
|
-
var result = this.
|
|
490
|
-
result = imul(result, 31) + this.
|
|
494
|
+
var result = this.i1k_1.hashCode();
|
|
495
|
+
result = imul(result, 31) + this.j1k_1.hashCode() | 0;
|
|
491
496
|
return result;
|
|
492
497
|
};
|
|
493
498
|
protoOf(Comparison).equals = function (other) {
|
|
@@ -496,32 +501,32 @@
|
|
|
496
501
|
if (!(other instanceof Comparison))
|
|
497
502
|
return false;
|
|
498
503
|
var tmp0_other_with_cast = other instanceof Comparison ? other : THROW_CCE();
|
|
499
|
-
if (!this.
|
|
504
|
+
if (!this.i1k_1.equals(tmp0_other_with_cast.i1k_1))
|
|
500
505
|
return false;
|
|
501
|
-
if (!this.
|
|
506
|
+
if (!this.j1k_1.equals(tmp0_other_with_cast.j1k_1))
|
|
502
507
|
return false;
|
|
503
508
|
return true;
|
|
504
509
|
};
|
|
505
510
|
function Contradiction(lhs, rhs) {
|
|
506
511
|
Equation.call(this, lhs, rhs);
|
|
507
|
-
this.
|
|
508
|
-
this.
|
|
512
|
+
this.m1k_1 = lhs;
|
|
513
|
+
this.n1k_1 = rhs;
|
|
509
514
|
}
|
|
510
|
-
protoOf(Contradiction).
|
|
511
|
-
return this.
|
|
515
|
+
protoOf(Contradiction).i1j = function () {
|
|
516
|
+
return this.m1k_1;
|
|
512
517
|
};
|
|
513
|
-
protoOf(Contradiction).
|
|
514
|
-
return this.
|
|
518
|
+
protoOf(Contradiction).j1j = function () {
|
|
519
|
+
return this.n1k_1;
|
|
515
520
|
};
|
|
516
|
-
protoOf(Contradiction).
|
|
521
|
+
protoOf(Contradiction).k1j = function () {
|
|
517
522
|
return true;
|
|
518
523
|
};
|
|
519
524
|
protoOf(Contradiction).toString = function () {
|
|
520
|
-
return 'Contradiction(lhs=' + this.
|
|
525
|
+
return 'Contradiction(lhs=' + this.m1k_1 + ', rhs=' + this.n1k_1 + ')';
|
|
521
526
|
};
|
|
522
527
|
protoOf(Contradiction).hashCode = function () {
|
|
523
|
-
var result = this.
|
|
524
|
-
result = imul(result, 31) + this.
|
|
528
|
+
var result = this.m1k_1.hashCode();
|
|
529
|
+
result = imul(result, 31) + this.n1k_1.hashCode() | 0;
|
|
525
530
|
return result;
|
|
526
531
|
};
|
|
527
532
|
protoOf(Contradiction).equals = function (other) {
|
|
@@ -530,17 +535,17 @@
|
|
|
530
535
|
if (!(other instanceof Contradiction))
|
|
531
536
|
return false;
|
|
532
537
|
var tmp0_other_with_cast = other instanceof Contradiction ? other : THROW_CCE();
|
|
533
|
-
if (!this.
|
|
538
|
+
if (!this.m1k_1.equals(tmp0_other_with_cast.m1k_1))
|
|
534
539
|
return false;
|
|
535
|
-
if (!this.
|
|
540
|
+
if (!this.n1k_1.equals(tmp0_other_with_cast.n1k_1))
|
|
536
541
|
return false;
|
|
537
542
|
return true;
|
|
538
543
|
};
|
|
539
544
|
function Companion() {
|
|
540
545
|
}
|
|
541
|
-
protoOf(Companion).
|
|
546
|
+
protoOf(Companion).t1j = function (lhs, rhs, equalityChecker) {
|
|
542
547
|
var tmp;
|
|
543
|
-
if (lhs.
|
|
548
|
+
if (lhs.vv() ? rhs.vv() : false) {
|
|
544
549
|
var tmp_0;
|
|
545
550
|
if (equalityChecker(lhs, rhs)) {
|
|
546
551
|
tmp_0 = new Identity(lhs, rhs);
|
|
@@ -548,11 +553,11 @@
|
|
|
548
553
|
tmp_0 = new Assignment(lhs.castToVar(), rhs);
|
|
549
554
|
}
|
|
550
555
|
tmp = tmp_0;
|
|
551
|
-
} else if (lhs.
|
|
556
|
+
} else if (lhs.vv()) {
|
|
552
557
|
tmp = new Assignment(lhs.castToVar(), rhs);
|
|
553
|
-
} else if (rhs.
|
|
558
|
+
} else if (rhs.vv()) {
|
|
554
559
|
tmp = new Assignment(rhs.castToVar(), lhs);
|
|
555
|
-
} else if (lhs.
|
|
560
|
+
} else if (lhs.yv() ? rhs.yv() : false) {
|
|
556
561
|
var tmp_1;
|
|
557
562
|
if (equalityChecker(lhs, rhs)) {
|
|
558
563
|
tmp_1 = new Identity(lhs, rhs);
|
|
@@ -560,13 +565,13 @@
|
|
|
560
565
|
tmp_1 = new Contradiction(lhs, rhs);
|
|
561
566
|
}
|
|
562
567
|
tmp = tmp_1;
|
|
563
|
-
} else if (lhs.
|
|
568
|
+
} else if (lhs.yv() ? true : rhs.yv()) {
|
|
564
569
|
tmp = new Contradiction(lhs, rhs);
|
|
565
|
-
} else if (lhs.
|
|
570
|
+
} else if (lhs.fv() ? rhs.fv() : false) {
|
|
566
571
|
var lhsStruct = lhs.castToStruct();
|
|
567
572
|
var rhsStruct = rhs.castToStruct();
|
|
568
573
|
var tmp_2;
|
|
569
|
-
if (!(lhsStruct.
|
|
574
|
+
if (!(lhsStruct.tu() === rhsStruct.tu()) ? true : !(lhsStruct.zu() === rhsStruct.zu())) {
|
|
570
575
|
tmp_2 = new Contradiction(lhsStruct, rhsStruct);
|
|
571
576
|
} else {
|
|
572
577
|
tmp_2 = new Comparison(lhsStruct, rhsStruct);
|
|
@@ -585,10 +590,10 @@
|
|
|
585
590
|
tmp = equalityChecker;
|
|
586
591
|
}
|
|
587
592
|
equalityChecker = tmp;
|
|
588
|
-
return $super === VOID ? this.
|
|
593
|
+
return $super === VOID ? this.t1j(lhs, rhs, equalityChecker) : $super.t1j.call(this, lhs, rhs, equalityChecker);
|
|
589
594
|
};
|
|
590
|
-
protoOf(Companion).
|
|
591
|
-
return this.
|
|
595
|
+
protoOf(Companion).o1k = function (pair, equalityChecker) {
|
|
596
|
+
return this.t1j(pair.qd_1, pair.rd_1, equalityChecker);
|
|
592
597
|
};
|
|
593
598
|
protoOf(Companion).ofPair = function (pair, equalityChecker, $super) {
|
|
594
599
|
var tmp;
|
|
@@ -598,9 +603,9 @@
|
|
|
598
603
|
tmp = equalityChecker;
|
|
599
604
|
}
|
|
600
605
|
equalityChecker = tmp;
|
|
601
|
-
return $super === VOID ? this.
|
|
606
|
+
return $super === VOID ? this.o1k(pair, equalityChecker) : $super.o1k.call(this, pair, equalityChecker);
|
|
602
607
|
};
|
|
603
|
-
protoOf(Companion).
|
|
608
|
+
protoOf(Companion).p1k = function (pairs, equalityChecker) {
|
|
604
609
|
return flatMap(pairs, Equation$Companion$from$lambda(equalityChecker));
|
|
605
610
|
};
|
|
606
611
|
protoOf(Companion).fromSequence = function (pairs, equalityChecker, $super) {
|
|
@@ -611,10 +616,10 @@
|
|
|
611
616
|
tmp = equalityChecker;
|
|
612
617
|
}
|
|
613
618
|
equalityChecker = tmp;
|
|
614
|
-
return $super === VOID ? this.
|
|
619
|
+
return $super === VOID ? this.p1k(pairs, equalityChecker) : $super.p1k.call(this, pairs, equalityChecker);
|
|
615
620
|
};
|
|
616
|
-
protoOf(Companion).
|
|
617
|
-
return this.
|
|
621
|
+
protoOf(Companion).q1k = function (pairs, equalityChecker) {
|
|
622
|
+
return this.p1k(asSequence_0(pairs), equalityChecker);
|
|
618
623
|
};
|
|
619
624
|
protoOf(Companion).fromIterable = function (pairs, equalityChecker, $super) {
|
|
620
625
|
var tmp;
|
|
@@ -624,10 +629,10 @@
|
|
|
624
629
|
tmp = equalityChecker;
|
|
625
630
|
}
|
|
626
631
|
equalityChecker = tmp;
|
|
627
|
-
return $super === VOID ? this.
|
|
632
|
+
return $super === VOID ? this.q1k(pairs, equalityChecker) : $super.q1k.call(this, pairs, equalityChecker);
|
|
628
633
|
};
|
|
629
|
-
protoOf(Companion).
|
|
630
|
-
return this.
|
|
634
|
+
protoOf(Companion).r1k = function (pairs, equalityChecker) {
|
|
635
|
+
return this.p1k(sequenceOf(pairs.slice()), equalityChecker);
|
|
631
636
|
};
|
|
632
637
|
protoOf(Companion).from = function (pairs, equalityChecker, $super) {
|
|
633
638
|
var tmp;
|
|
@@ -637,10 +642,10 @@
|
|
|
637
642
|
tmp = equalityChecker;
|
|
638
643
|
}
|
|
639
644
|
equalityChecker = tmp;
|
|
640
|
-
return $super === VOID ? this.
|
|
645
|
+
return $super === VOID ? this.r1k(pairs, equalityChecker) : $super.r1k.call(this, pairs, equalityChecker);
|
|
641
646
|
};
|
|
642
|
-
protoOf(Companion).
|
|
643
|
-
return this.
|
|
647
|
+
protoOf(Companion).y1j = function (pair, equalityChecker) {
|
|
648
|
+
return this.f1j(pair.qd_1, pair.rd_1, equalityChecker);
|
|
644
649
|
};
|
|
645
650
|
protoOf(Companion).allOfPair = function (pair, equalityChecker, $super) {
|
|
646
651
|
var tmp;
|
|
@@ -650,29 +655,29 @@
|
|
|
650
655
|
tmp = equalityChecker;
|
|
651
656
|
}
|
|
652
657
|
equalityChecker = tmp;
|
|
653
|
-
return $super === VOID ? this.
|
|
658
|
+
return $super === VOID ? this.y1j(pair, equalityChecker) : $super.y1j.call(this, pair, equalityChecker);
|
|
654
659
|
};
|
|
655
|
-
protoOf(Companion).
|
|
660
|
+
protoOf(Companion).f1j = function (lhs, rhs, equalityChecker) {
|
|
656
661
|
var tmp;
|
|
657
|
-
if (lhs.
|
|
658
|
-
tmp = sequenceOf([this.
|
|
659
|
-
} else if (lhs.
|
|
662
|
+
if (lhs.uu() ? rhs.uu() : false) {
|
|
663
|
+
tmp = sequenceOf([this.t1j(lhs, rhs, equalityChecker)]);
|
|
664
|
+
} else if (lhs.lv() ? rhs.lv() : false) {
|
|
660
665
|
tmp = allOfLists(this, lhs.castToList(), rhs.castToList(), equalityChecker);
|
|
661
|
-
} else if (lhs.
|
|
666
|
+
} else if (lhs.kv() ? rhs.kv() : false) {
|
|
662
667
|
tmp = allOfTuples(this, lhs.castToTuple(), rhs.castToTuple(), equalityChecker);
|
|
663
|
-
} else if (lhs.
|
|
668
|
+
} else if (lhs.fv() ? rhs.fv() : false) {
|
|
664
669
|
var lhsStruct = lhs.castToStruct();
|
|
665
670
|
var rhsStruct = rhs.castToStruct();
|
|
666
671
|
var tmp_0;
|
|
667
|
-
if (lhsStruct.
|
|
668
|
-
var tmp_1 = zip(lhsStruct.
|
|
672
|
+
if (lhsStruct.tu() === rhsStruct.tu() ? lhsStruct.zu() === rhsStruct.zu() : false) {
|
|
673
|
+
var tmp_1 = zip(lhsStruct.sv(), rhsStruct.sv());
|
|
669
674
|
tmp_0 = flatMap(tmp_1, Equation$Companion$allOf$lambda(equalityChecker));
|
|
670
675
|
} else {
|
|
671
|
-
tmp_0 = sequenceOf([this.
|
|
676
|
+
tmp_0 = sequenceOf([this.t1j(lhs, rhs, equalityChecker)]);
|
|
672
677
|
}
|
|
673
678
|
tmp = tmp_0;
|
|
674
679
|
} else {
|
|
675
|
-
tmp = sequenceOf([this.
|
|
680
|
+
tmp = sequenceOf([this.t1j(lhs, rhs, equalityChecker)]);
|
|
676
681
|
}
|
|
677
682
|
return tmp;
|
|
678
683
|
};
|
|
@@ -684,7 +689,7 @@
|
|
|
684
689
|
tmp = equalityChecker;
|
|
685
690
|
}
|
|
686
691
|
equalityChecker = tmp;
|
|
687
|
-
return $super === VOID ? this.
|
|
692
|
+
return $super === VOID ? this.f1j(lhs, rhs, equalityChecker) : $super.f1j.call(this, lhs, rhs, equalityChecker);
|
|
688
693
|
};
|
|
689
694
|
var Companion_instance_0;
|
|
690
695
|
function Companion_getInstance_1() {
|
|
@@ -698,54 +703,54 @@
|
|
|
698
703
|
return l;
|
|
699
704
|
}
|
|
700
705
|
function Equation(lhs, rhs) {
|
|
701
|
-
this.
|
|
702
|
-
this.
|
|
706
|
+
this.g1j_1 = lhs;
|
|
707
|
+
this.h1j_1 = rhs;
|
|
703
708
|
}
|
|
704
|
-
protoOf(Equation).
|
|
705
|
-
return this.
|
|
709
|
+
protoOf(Equation).i1j = function () {
|
|
710
|
+
return this.g1j_1;
|
|
706
711
|
};
|
|
707
|
-
protoOf(Equation).
|
|
708
|
-
return this.
|
|
712
|
+
protoOf(Equation).j1j = function () {
|
|
713
|
+
return this.h1j_1;
|
|
709
714
|
};
|
|
710
|
-
protoOf(Equation).
|
|
715
|
+
protoOf(Equation).l1j = function () {
|
|
711
716
|
return false;
|
|
712
717
|
};
|
|
713
|
-
protoOf(Equation).
|
|
718
|
+
protoOf(Equation).s1j = function () {
|
|
714
719
|
return false;
|
|
715
720
|
};
|
|
716
|
-
protoOf(Equation).
|
|
721
|
+
protoOf(Equation).d1k = function () {
|
|
717
722
|
return null;
|
|
718
723
|
};
|
|
719
|
-
protoOf(Equation).
|
|
720
|
-
var tmp0_elvis_lhs = this.
|
|
724
|
+
protoOf(Equation).n1j = function () {
|
|
725
|
+
var tmp0_elvis_lhs = this.d1k();
|
|
721
726
|
var tmp;
|
|
722
727
|
if (tmp0_elvis_lhs == null) {
|
|
723
|
-
throw ClassCastException_init_$Create$('Cannot cast ' + this + ' to ' + getKClass(Assignment).
|
|
728
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + this + ' to ' + getKClass(Assignment).o6());
|
|
724
729
|
} else {
|
|
725
730
|
tmp = tmp0_elvis_lhs;
|
|
726
731
|
}
|
|
727
732
|
return tmp;
|
|
728
733
|
};
|
|
729
|
-
protoOf(Equation).
|
|
734
|
+
protoOf(Equation).m1j = function () {
|
|
730
735
|
return false;
|
|
731
736
|
};
|
|
732
|
-
protoOf(Equation).
|
|
737
|
+
protoOf(Equation).k1j = function () {
|
|
733
738
|
return false;
|
|
734
739
|
};
|
|
735
|
-
protoOf(Equation).
|
|
736
|
-
return Companion_getInstance_0().of('=', [this.
|
|
740
|
+
protoOf(Equation).e1h = function () {
|
|
741
|
+
return Companion_getInstance_0().of('=', [this.i1j(), this.j1j()]);
|
|
737
742
|
};
|
|
738
743
|
protoOf(Equation).toTerm = function () {
|
|
739
|
-
return this.
|
|
744
|
+
return this.e1h();
|
|
740
745
|
};
|
|
741
746
|
protoOf(Equation).toPair = function () {
|
|
742
|
-
return new Pair(this.
|
|
747
|
+
return new Pair(this.i1j(), this.j1j());
|
|
743
748
|
};
|
|
744
749
|
protoOf(Equation).swap = function () {
|
|
745
|
-
return Companion_instance_0.of(this.
|
|
750
|
+
return Companion_instance_0.of(this.j1j(), this.i1j());
|
|
746
751
|
};
|
|
747
|
-
protoOf(Equation).
|
|
748
|
-
return Companion_instance_0.
|
|
752
|
+
protoOf(Equation).e1k = function (substitution, equalityChecker) {
|
|
753
|
+
return Companion_instance_0.t1j(this.i1j().getSubstituted(substitution, []), this.j1j().getSubstituted(substitution, []), equalityChecker);
|
|
749
754
|
};
|
|
750
755
|
protoOf(Equation).apply = function (substitution, equalityChecker, $super) {
|
|
751
756
|
var tmp;
|
|
@@ -755,23 +760,23 @@
|
|
|
755
760
|
tmp = equalityChecker;
|
|
756
761
|
}
|
|
757
762
|
equalityChecker = tmp;
|
|
758
|
-
return $super === VOID ? this.
|
|
763
|
+
return $super === VOID ? this.e1k(substitution, equalityChecker) : $super.e1k.call(this, substitution, equalityChecker);
|
|
759
764
|
};
|
|
760
765
|
function toEquations(_this__u8e3s4) {
|
|
761
766
|
// Inline function 'kotlin.collections.map' call
|
|
762
|
-
var this_0 = _this__u8e3s4.
|
|
767
|
+
var this_0 = _this__u8e3s4.n2();
|
|
763
768
|
// Inline function 'kotlin.collections.mapTo' call
|
|
764
769
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
765
|
-
var tmp0_iterator = this_0.
|
|
766
|
-
while (tmp0_iterator.
|
|
767
|
-
var item = tmp0_iterator.
|
|
770
|
+
var tmp0_iterator = this_0.r();
|
|
771
|
+
while (tmp0_iterator.s()) {
|
|
772
|
+
var item = tmp0_iterator.u();
|
|
768
773
|
// Inline function 'it.unibo.tuprolog.unify.toEquations.<anonymous>' call
|
|
769
774
|
// Inline function 'kotlin.collections.component1' call
|
|
770
|
-
var variable = item.
|
|
775
|
+
var variable = item.q2();
|
|
771
776
|
// Inline function 'kotlin.collections.component2' call
|
|
772
|
-
var term = item.
|
|
777
|
+
var term = item.r2();
|
|
773
778
|
var tmp$ret$2 = new Assignment(variable, term);
|
|
774
|
-
destination.
|
|
779
|
+
destination.o(tmp$ret$2);
|
|
775
780
|
}
|
|
776
781
|
return destination;
|
|
777
782
|
}
|
|
@@ -782,12 +787,12 @@
|
|
|
782
787
|
}
|
|
783
788
|
function toAssignmentPair(_this__u8e3s4) {
|
|
784
789
|
var tmp;
|
|
785
|
-
if (_this__u8e3s4.
|
|
786
|
-
tmp = _this__u8e3s4.
|
|
787
|
-
} else if (_this__u8e3s4.
|
|
788
|
-
tmp = to(_this__u8e3s4.
|
|
789
|
-
} else if (_this__u8e3s4.
|
|
790
|
-
tmp = to(_this__u8e3s4.
|
|
790
|
+
if (_this__u8e3s4.s1j()) {
|
|
791
|
+
tmp = _this__u8e3s4.n1j().f1k();
|
|
792
|
+
} else if (_this__u8e3s4.i1j().vv()) {
|
|
793
|
+
tmp = to(_this__u8e3s4.i1j().castToVar(), _this__u8e3s4.j1j());
|
|
794
|
+
} else if (_this__u8e3s4.j1j().vv()) {
|
|
795
|
+
tmp = to(_this__u8e3s4.j1j().castToVar(), _this__u8e3s4.i1j());
|
|
791
796
|
} else {
|
|
792
797
|
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + _this__u8e3s4);
|
|
793
798
|
}
|
|
@@ -802,12 +807,12 @@
|
|
|
802
807
|
function Unificator$Companion$naive$1($context) {
|
|
803
808
|
AbstractUnificator.call(this, $context);
|
|
804
809
|
}
|
|
805
|
-
protoOf(Unificator$Companion$naive$1).
|
|
810
|
+
protoOf(Unificator$Companion$naive$1).e1j = function (first, second) {
|
|
806
811
|
var tmp;
|
|
807
|
-
if (first.
|
|
808
|
-
tmp = first.castToInteger().
|
|
809
|
-
} else if (first.
|
|
810
|
-
tmp = first.castToNumeric().
|
|
812
|
+
if (first.aw() ? second.aw() : false) {
|
|
813
|
+
tmp = first.castToInteger().r2().qj(second.castToInteger().r2()) === 0;
|
|
814
|
+
} else if (first.zv() ? second.zv() : false) {
|
|
815
|
+
tmp = first.castToNumeric().pz().hj(second.castToNumeric().pz()) === 0;
|
|
811
816
|
} else {
|
|
812
817
|
tmp = first.equals(second);
|
|
813
818
|
}
|
|
@@ -816,32 +821,32 @@
|
|
|
816
821
|
function Unificator$Companion$strict$1($context) {
|
|
817
822
|
AbstractUnificator.call(this, $context);
|
|
818
823
|
}
|
|
819
|
-
protoOf(Unificator$Companion$strict$1).
|
|
824
|
+
protoOf(Unificator$Companion$strict$1).e1j = function (first, second) {
|
|
820
825
|
return first.equals(second);
|
|
821
826
|
};
|
|
822
827
|
function Companion_0() {
|
|
823
828
|
Companion_instance_1 = this;
|
|
824
829
|
var tmp = this;
|
|
825
|
-
tmp.
|
|
826
|
-
this.
|
|
830
|
+
tmp.w1k_1 = lazy(Unificator$Companion$default$delegate$lambda);
|
|
831
|
+
this.x1k_1 = 32;
|
|
827
832
|
}
|
|
828
|
-
protoOf(Companion_0).
|
|
833
|
+
protoOf(Companion_0).y1k = function () {
|
|
829
834
|
// Inline function 'kotlin.getValue' call
|
|
830
|
-
var this_0 = this.
|
|
835
|
+
var this_0 = this.w1k_1;
|
|
831
836
|
default$factory();
|
|
832
|
-
return this_0.
|
|
837
|
+
return this_0.r2();
|
|
833
838
|
};
|
|
834
839
|
protoOf(Companion_0).mguWith = function (_this__u8e3s4, other) {
|
|
835
|
-
return this.
|
|
840
|
+
return this.y1k().mgu(_this__u8e3s4, other);
|
|
836
841
|
};
|
|
837
842
|
protoOf(Companion_0).matches = function (_this__u8e3s4, other) {
|
|
838
|
-
return this.
|
|
843
|
+
return this.y1k().match(_this__u8e3s4, other);
|
|
839
844
|
};
|
|
840
845
|
protoOf(Companion_0).unifyWith = function (_this__u8e3s4, other) {
|
|
841
|
-
return this.
|
|
846
|
+
return this.y1k().unify(_this__u8e3s4, other);
|
|
842
847
|
};
|
|
843
848
|
protoOf(Companion_0).mergeWith = function (_this__u8e3s4, other) {
|
|
844
|
-
return this.
|
|
849
|
+
return this.y1k().merge(_this__u8e3s4, other);
|
|
845
850
|
};
|
|
846
851
|
protoOf(Companion_0).naiveWithContext = function (context) {
|
|
847
852
|
return new Unificator$Companion$naive$1(context);
|
|
@@ -855,10 +860,10 @@
|
|
|
855
860
|
protoOf(Companion_0).strict = function () {
|
|
856
861
|
return this.strictWithContext(Companion_getInstance().empty());
|
|
857
862
|
};
|
|
858
|
-
protoOf(Companion_0).
|
|
863
|
+
protoOf(Companion_0).z1k = function (other, capacity) {
|
|
859
864
|
var tmp;
|
|
860
865
|
if (other instanceof CachedUnificator) {
|
|
861
|
-
tmp = new CachedUnificator(other.
|
|
866
|
+
tmp = new CachedUnificator(other.w1j_1, capacity);
|
|
862
867
|
} else {
|
|
863
868
|
tmp = new CachedUnificator(other, capacity);
|
|
864
869
|
}
|
|
@@ -866,7 +871,7 @@
|
|
|
866
871
|
};
|
|
867
872
|
protoOf(Companion_0).cached = function (other, capacity, $super) {
|
|
868
873
|
capacity = capacity === VOID ? 32 : capacity;
|
|
869
|
-
return $super === VOID ? this.
|
|
874
|
+
return $super === VOID ? this.z1k(other, capacity) : $super.z1k.call(this, other, capacity);
|
|
870
875
|
};
|
|
871
876
|
var Companion_instance_1;
|
|
872
877
|
function Companion_getInstance_2() {
|
|
@@ -878,7 +883,7 @@
|
|
|
878
883
|
}
|
|
879
884
|
function default$factory() {
|
|
880
885
|
return getPropertyCallableRef('default', 1, KProperty1, function (receiver) {
|
|
881
|
-
return receiver.
|
|
886
|
+
return receiver.y1k();
|
|
882
887
|
}, null);
|
|
883
888
|
}
|
|
884
889
|
//region block: post-declaration
|
|
@@ -894,21 +899,23 @@
|
|
|
894
899
|
protoOf(CachedUnificator).unifyWithOccurCheck = unifyWithOccurCheck;
|
|
895
900
|
protoOf(CachedUnificator).unify = unify;
|
|
896
901
|
protoOf(CachedUnificator).merge = merge;
|
|
897
|
-
protoOf(Equation).
|
|
902
|
+
protoOf(Equation).tp = castTo;
|
|
898
903
|
defineProp(protoOf(Equation), 'lhs', function () {
|
|
899
|
-
return this.
|
|
904
|
+
return this.i1j();
|
|
900
905
|
});
|
|
901
906
|
defineProp(protoOf(Equation), 'rhs', function () {
|
|
902
|
-
return this.
|
|
907
|
+
return this.j1j();
|
|
903
908
|
});
|
|
904
|
-
defineProp(protoOf(Companion_0), 'default', protoOf(Companion_0).
|
|
909
|
+
defineProp(protoOf(Companion_0), 'default', protoOf(Companion_0).y1k);
|
|
905
910
|
//endregion
|
|
906
911
|
//region block: init
|
|
907
912
|
Companion_instance_0 = new Companion();
|
|
908
913
|
//endregion
|
|
909
914
|
//region block: exports
|
|
910
915
|
_.$_$ = _.$_$ || {};
|
|
911
|
-
_.$_$.a =
|
|
916
|
+
_.$_$.a = mguWithOccurCheck;
|
|
917
|
+
_.$_$.b = Companion_getInstance_2;
|
|
918
|
+
_.$_$.c = Unificator;
|
|
912
919
|
//endregion
|
|
913
920
|
return _;
|
|
914
921
|
}));
|