@tuprolog/2p-full 0.31.21 → 0.32.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 +198 -215
- package/2p-bdd.js.map +1 -1
- package/2p-core.js +3282 -5092
- package/2p-core.js.map +1 -1
- package/2p-full.js +6 -6
- package/2p-io-lib.js +874 -1121
- package/2p-io-lib.js.map +1 -1
- package/2p-oop-lib.js +1140 -1327
- package/2p-oop-lib.js.map +1 -1
- package/2p-parser-core.js +438 -609
- package/2p-parser-core.js.map +1 -1
- package/2p-parser-js.js +7 -8
- package/2p-parser-js.js.map +1 -1
- package/2p-parser-theory.js +35 -39
- package/2p-parser-theory.js.map +1 -1
- package/2p-repl.js +152 -179
- package/2p-repl.js.map +1 -1
- package/2p-solve-classic.js +1141 -1371
- package/2p-solve-classic.js.map +1 -1
- package/2p-solve-plp.js +9 -14
- package/2p-solve-plp.js.map +1 -1
- package/2p-solve-problog.js +1689 -1981
- package/2p-solve-problog.js.map +1 -1
- package/2p-solve-streams.js +1206 -1372
- package/2p-solve-streams.js.map +1 -1
- package/2p-solve.js +4880 -6148
- package/2p-solve.js.map +1 -1
- package/2p-theory.js +1820 -2246
- package/2p-theory.js.map +1 -1
- package/2p-unify.js +290 -330
- package/2p-unify.js.map +1 -1
- package/2p-utils.js +483 -557
- package/2p-utils.js.map +1 -1
- package/clikt-clikt-js-ir.js +2243 -3266
- package/clikt-clikt-js-ir.js.map +1 -1
- package/{kotlin-kotlin-stdlib-js-ir.js → kotlin-kotlin-stdlib.js} +9559 -10329
- package/kotlin-kotlin-stdlib.js.map +1 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +15 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -0
- package/kt-math.js +2926 -4247
- package/kt-math.js.map +1 -1
- package/package.json +9 -3
- package/kotlin-kotlin-stdlib-js-ir.js.map +0 -1
package/2p-unify.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
(function (root, factory) {
|
|
2
2
|
if (typeof define === 'function' && define.amd)
|
|
3
|
-
define(['exports', './kotlin-kotlin-stdlib
|
|
3
|
+
define(['exports', './kotlin-kotlin-stdlib.js', './2p-core.js', './2p-utils.js'], factory);
|
|
4
4
|
else if (typeof exports === 'object')
|
|
5
|
-
factory(module.exports, require('./kotlin-kotlin-stdlib
|
|
5
|
+
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./2p-core.js'), require('./2p-utils.js'));
|
|
6
6
|
else {
|
|
7
|
-
if (typeof this['kotlin-kotlin-stdlib
|
|
8
|
-
throw new Error("Error loading module '2p-unify'. Its dependency 'kotlin-kotlin-stdlib
|
|
7
|
+
if (typeof this['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
8
|
+
throw new Error("Error loading module '2p-unify'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to '2p-unify'.");
|
|
9
9
|
}
|
|
10
10
|
if (typeof this['2p-core'] === 'undefined') {
|
|
11
11
|
throw new Error("Error loading module '2p-unify'. Its dependency '2p-core' was not found. Please, check whether '2p-core' is loaded prior to '2p-unify'.");
|
|
@@ -13,61 +13,61 @@
|
|
|
13
13
|
if (typeof this['2p-utils'] === 'undefined') {
|
|
14
14
|
throw new Error("Error loading module '2p-unify'. Its dependency '2p-utils' was not found. Please, check whether '2p-utils' is loaded prior to '2p-unify'.");
|
|
15
15
|
}
|
|
16
|
-
root['2p-unify'] = factory(typeof this['2p-unify'] === 'undefined' ? {} : this['2p-unify'], this['kotlin-kotlin-stdlib
|
|
16
|
+
root['2p-unify'] = factory(typeof this['2p-unify'] === 'undefined' ? {} : this['2p-unify'], this['kotlin-kotlin-stdlib'], this['2p-core'], this['2p-utils']);
|
|
17
17
|
}
|
|
18
18
|
}(this, function (_, kotlin_kotlin, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_utils) {
|
|
19
19
|
'use strict';
|
|
20
20
|
//region block: imports
|
|
21
21
|
var imul = Math.imul;
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var
|
|
22
|
+
var asSequence = kotlin_kotlin.$_$.m2;
|
|
23
|
+
var plus = kotlin_kotlin.$_$.u8;
|
|
24
|
+
var map = kotlin_kotlin.$_$.q8;
|
|
25
|
+
var Unit_instance = kotlin_kotlin.$_$.y1;
|
|
26
26
|
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.e1;
|
|
27
|
-
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.
|
|
28
|
-
var toCollection = kotlin_kotlin.$_$.
|
|
29
|
-
var Pair = kotlin_kotlin.$_$.
|
|
30
|
-
var VOID = kotlin_kotlin.$_$.
|
|
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.$_$.
|
|
38
|
-
var
|
|
39
|
-
var Triple = kotlin_kotlin.$_$.
|
|
27
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.g;
|
|
28
|
+
var toCollection = kotlin_kotlin.$_$.b9;
|
|
29
|
+
var Pair = kotlin_kotlin.$_$.tb;
|
|
30
|
+
var VOID = kotlin_kotlin.$_$.d;
|
|
31
|
+
var lazy = kotlin_kotlin.$_$.ac;
|
|
32
|
+
var protoOf = kotlin_kotlin.$_$.u6;
|
|
33
|
+
var asSequence_0 = kotlin_kotlin.$_$.n2;
|
|
34
|
+
var classMeta = kotlin_kotlin.$_$.v5;
|
|
35
|
+
var setMetadataFor = kotlin_kotlin.$_$.v6;
|
|
36
|
+
var KProperty1 = kotlin_kotlin.$_$.q7;
|
|
37
|
+
var getPropertyCallableRef = kotlin_kotlin.$_$.c6;
|
|
38
|
+
var Companion_instance = kotlin_it_unibo_tuprolog_utils.$_$.a;
|
|
39
|
+
var Triple = kotlin_kotlin.$_$.xb;
|
|
40
40
|
var Some = kotlin_it_unibo_tuprolog_utils.$_$.k;
|
|
41
|
-
var zip = kotlin_kotlin.$_$.
|
|
42
|
-
var flatMap = kotlin_kotlin.$_$.
|
|
43
|
-
var sequenceOf = kotlin_kotlin.$_$.
|
|
44
|
-
var THROW_CCE = kotlin_kotlin.$_$.
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var objectMeta = kotlin_kotlin.$_$.r6;
|
|
41
|
+
var zip = kotlin_kotlin.$_$.i9;
|
|
42
|
+
var flatMap = kotlin_kotlin.$_$.h8;
|
|
43
|
+
var sequenceOf = kotlin_kotlin.$_$.w8;
|
|
44
|
+
var THROW_CCE = kotlin_kotlin.$_$.vb;
|
|
45
|
+
var to = kotlin_kotlin.$_$.hc;
|
|
46
|
+
var objectMeta = kotlin_kotlin.$_$.t6;
|
|
48
47
|
var getKClass = kotlin_kotlin.$_$.c;
|
|
49
|
-
var ClassCastException_init_$Create$ = kotlin_kotlin.$_$.
|
|
50
|
-
var
|
|
51
|
-
var
|
|
48
|
+
var ClassCastException_init_$Create$ = kotlin_kotlin.$_$.t;
|
|
49
|
+
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.d1;
|
|
50
|
+
var castTo = kotlin_it_unibo_tuprolog_utils.$_$.f;
|
|
51
|
+
var defineProp = kotlin_kotlin.$_$.x5;
|
|
52
52
|
var Castable = kotlin_it_unibo_tuprolog_utils.$_$.g;
|
|
53
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.
|
|
54
|
-
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.
|
|
55
|
-
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.
|
|
56
|
-
var interfaceMeta = kotlin_kotlin.$_$.
|
|
53
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.q2;
|
|
54
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.f;
|
|
55
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.v;
|
|
56
|
+
var interfaceMeta = kotlin_kotlin.$_$.f6;
|
|
57
57
|
//endregion
|
|
58
58
|
//region block: pre-declaration
|
|
59
59
|
function mgu(term1, term2) {
|
|
60
|
-
return this.
|
|
60
|
+
return this.c1k(term1, term2, true);
|
|
61
61
|
}
|
|
62
62
|
function matchWithOccurCheck(term1, term2, occurCheckEnabled) {
|
|
63
|
-
return !(this.
|
|
63
|
+
return !(this.c1k(term1, term2, occurCheckEnabled) === Companion_getInstance().failed());
|
|
64
64
|
}
|
|
65
65
|
function match(term1, term2) {
|
|
66
66
|
return this.matchWithOccurCheck(term1, term2, true);
|
|
67
67
|
}
|
|
68
68
|
function unifyWithOccurCheck(term1, term2, occurCheckEnabled) {
|
|
69
|
-
var substitution = this.
|
|
70
|
-
return substitution.
|
|
69
|
+
var substitution = this.c1k(term1, term2, occurCheckEnabled);
|
|
70
|
+
return substitution.x12() ? null : term1.getSubstituted(substitution, []);
|
|
71
71
|
}
|
|
72
72
|
function unify(term1, term2) {
|
|
73
73
|
return this.unifyWithOccurCheck(term1, term2, true);
|
|
@@ -89,28 +89,24 @@
|
|
|
89
89
|
setMetadataFor(Companion_0, 'Companion', objectMeta);
|
|
90
90
|
//endregion
|
|
91
91
|
function _get_contextEquations__x0dd77($this) {
|
|
92
|
-
var tmp$ret$0;
|
|
93
92
|
// Inline function 'kotlin.getValue' call
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
return
|
|
93
|
+
var this_0 = $this.l1j_1;
|
|
94
|
+
contextEquations$factory();
|
|
95
|
+
return this_0.r2();
|
|
97
96
|
}
|
|
98
97
|
function occurrenceCheck($this, variable, term) {
|
|
99
98
|
var tmp;
|
|
100
|
-
if (term.
|
|
101
|
-
tmp = $this.
|
|
102
|
-
} else if (term.
|
|
99
|
+
if (term.mx()) {
|
|
100
|
+
tmp = $this.m1j(variable, term);
|
|
101
|
+
} else if (term.ww()) {
|
|
103
102
|
var tmp$ret$1;
|
|
104
103
|
$l$block: {
|
|
105
104
|
// Inline function 'kotlin.sequences.any' call
|
|
106
|
-
var
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
var element = tmp0_iterator.n();
|
|
110
|
-
var tmp$ret$0;
|
|
105
|
+
var tmp0_iterator = term.sw().r();
|
|
106
|
+
while (tmp0_iterator.s()) {
|
|
107
|
+
var element = tmp0_iterator.u();
|
|
111
108
|
// Inline function 'it.unibo.tuprolog.unify.AbstractUnificator.occurrenceCheck.<anonymous>' call
|
|
112
|
-
|
|
113
|
-
if (tmp$ret$0) {
|
|
109
|
+
if (occurrenceCheck($this, variable, element)) {
|
|
114
110
|
tmp$ret$1 = true;
|
|
115
111
|
break $l$block;
|
|
116
112
|
}
|
|
@@ -124,11 +120,11 @@
|
|
|
124
120
|
return tmp;
|
|
125
121
|
}
|
|
126
122
|
function equationsFor($this, term1, term2) {
|
|
127
|
-
var tmp =
|
|
128
|
-
return tmp.
|
|
123
|
+
var tmp = Companion_instance_0;
|
|
124
|
+
return tmp.n1j(term1, term2, AbstractUnificator$checkTermsEquality$ref($this));
|
|
129
125
|
}
|
|
130
126
|
function equationsFor_0($this, substitution1, substitution2) {
|
|
131
|
-
var tmp =
|
|
127
|
+
var tmp = Companion_instance_0;
|
|
132
128
|
var tmp_0 = plus(asSequence(substitution1), asSequence(substitution2));
|
|
133
129
|
return tmp.fromSequence(map(tmp_0, AbstractUnificator$equationsFor$lambda));
|
|
134
130
|
}
|
|
@@ -143,7 +139,7 @@
|
|
|
143
139
|
}
|
|
144
140
|
while (inductionVariable < exceptIndex);
|
|
145
141
|
var inductionVariable_0 = exceptIndex + 1 | 0;
|
|
146
|
-
var last = equations.
|
|
142
|
+
var last = equations.l();
|
|
147
143
|
if (inductionVariable_0 < last)
|
|
148
144
|
do {
|
|
149
145
|
var i_0 = inductionVariable_0;
|
|
@@ -157,122 +153,113 @@
|
|
|
157
153
|
var changed = true;
|
|
158
154
|
while (changed) {
|
|
159
155
|
changed = false;
|
|
160
|
-
var eqIterator = equations.
|
|
161
|
-
while (eqIterator.
|
|
162
|
-
var eq = eqIterator.
|
|
163
|
-
if (eq.
|
|
156
|
+
var eqIterator = equations.z1();
|
|
157
|
+
while (eqIterator.s()) {
|
|
158
|
+
var eq = eqIterator.u();
|
|
159
|
+
if (eq.s1j()) {
|
|
164
160
|
return Companion_getInstance().failed();
|
|
165
|
-
} else if (eq.
|
|
166
|
-
eqIterator.
|
|
161
|
+
} else if (eq.t1j()) {
|
|
162
|
+
eqIterator.t();
|
|
167
163
|
changed = true;
|
|
168
|
-
} else if (eq.
|
|
169
|
-
var assignment = eq.
|
|
170
|
-
if (occurCheckEnabled ? occurrenceCheck($this, assignment.
|
|
164
|
+
} else if (eq.a1k()) {
|
|
165
|
+
var assignment = eq.v1j();
|
|
166
|
+
if (occurCheckEnabled ? occurrenceCheck($this, assignment.y1j_1, eq.r1j()) : false) {
|
|
171
167
|
return Companion_getInstance().failed();
|
|
172
168
|
} else {
|
|
173
|
-
changed = changed ? true : applySubstitutionToEquations($this, assignment.toSubstitution(), equations, eqIterator.
|
|
169
|
+
changed = changed ? true : applySubstitutionToEquations($this, assignment.toSubstitution(), equations, eqIterator.n1());
|
|
174
170
|
}
|
|
175
|
-
} else if (eq.
|
|
176
|
-
eqIterator.
|
|
177
|
-
var tmp0_iterator = equationsFor($this, eq.
|
|
178
|
-
insertion: while (tmp0_iterator.
|
|
179
|
-
var it = tmp0_iterator.
|
|
180
|
-
if (it.
|
|
171
|
+
} else if (eq.u1j()) {
|
|
172
|
+
eqIterator.t();
|
|
173
|
+
var tmp0_iterator = equationsFor($this, eq.q1j(), eq.r1j()).r();
|
|
174
|
+
insertion: while (tmp0_iterator.s()) {
|
|
175
|
+
var it = tmp0_iterator.u();
|
|
176
|
+
if (it.t1j())
|
|
181
177
|
continue insertion;
|
|
182
|
-
else if (it.
|
|
178
|
+
else if (it.s1j())
|
|
183
179
|
return Companion_getInstance().failed();
|
|
184
180
|
else {
|
|
185
|
-
eqIterator.
|
|
181
|
+
eqIterator.q1(it);
|
|
186
182
|
}
|
|
187
183
|
}
|
|
188
184
|
changed = true;
|
|
189
185
|
}
|
|
190
186
|
}
|
|
191
187
|
}
|
|
192
|
-
var tmp$ret$2;
|
|
193
188
|
// Inline function 'kotlin.collections.filter' call
|
|
194
|
-
var tmp$ret$1;
|
|
195
189
|
// Inline function 'kotlin.collections.filterTo' call
|
|
196
|
-
var
|
|
197
|
-
var tmp0_iterator_0 = equations.
|
|
198
|
-
while (tmp0_iterator_0.
|
|
199
|
-
var element = tmp0_iterator_0.
|
|
200
|
-
var tmp$ret$0;
|
|
190
|
+
var destination = ArrayList_init_$Create$();
|
|
191
|
+
var tmp0_iterator_0 = equations.r();
|
|
192
|
+
while (tmp0_iterator_0.s()) {
|
|
193
|
+
var element = tmp0_iterator_0.u();
|
|
201
194
|
// Inline function 'it.unibo.tuprolog.unify.AbstractUnificator.mgu.<anonymous>' call
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
tmp0_filterTo.g(element);
|
|
195
|
+
if (element.a1k()) {
|
|
196
|
+
destination.o(element);
|
|
205
197
|
}
|
|
206
198
|
}
|
|
207
|
-
|
|
208
|
-
tmp$ret$2 = tmp$ret$1;
|
|
209
|
-
return toSubstitution(tmp$ret$2);
|
|
199
|
+
return toSubstitution(destination);
|
|
210
200
|
}
|
|
211
201
|
function newDeque($this, items) {
|
|
212
|
-
var tmp$ret$0;
|
|
213
202
|
// Inline function 'kotlin.collections.arrayListOf' call
|
|
214
|
-
tmp$ret$0 = ArrayList_init_$Create$();
|
|
203
|
+
var tmp$ret$0 = ArrayList_init_$Create$();
|
|
215
204
|
return toCollection(items, tmp$ret$0);
|
|
216
205
|
}
|
|
217
206
|
function applySubstitutionToEquations$handleIndex($equations, $substitution, this$0, changed, i) {
|
|
218
|
-
if ($equations.
|
|
219
|
-
return
|
|
220
|
-
var currentEq = $equations.
|
|
207
|
+
if ($equations.c1(i).s1j() ? true : $equations.c1(i).t1j())
|
|
208
|
+
return Unit_instance;
|
|
209
|
+
var currentEq = $equations.c1(i);
|
|
221
210
|
var tmp0_container = currentEq.apply($substitution).toPair();
|
|
222
|
-
var newLhs = tmp0_container.
|
|
223
|
-
var newRhs = tmp0_container.
|
|
224
|
-
if (!currentEq.
|
|
225
|
-
var tmp =
|
|
226
|
-
$equations.
|
|
211
|
+
var newLhs = tmp0_container.me();
|
|
212
|
+
var newRhs = tmp0_container.ne();
|
|
213
|
+
if (!currentEq.q1j().equals(newLhs) ? true : !currentEq.r1j().equals(newRhs)) {
|
|
214
|
+
var tmp = Companion_instance_0;
|
|
215
|
+
$equations.m(i, tmp.b1k(newLhs, newRhs, AbstractUnificator$checkTermsEquality$ref_0(this$0)));
|
|
227
216
|
changed._v = true;
|
|
228
217
|
}
|
|
229
218
|
}
|
|
230
219
|
function AbstractUnificator$contextEquations$delegate$lambda(this$0) {
|
|
231
220
|
return function () {
|
|
232
|
-
return toEquations(this$0.
|
|
221
|
+
return toEquations(this$0.uc());
|
|
233
222
|
};
|
|
234
223
|
}
|
|
235
224
|
function AbstractUnificator$checkTermsEquality$ref($boundThis) {
|
|
236
225
|
var l = function (p0, p1) {
|
|
237
|
-
return $boundThis.
|
|
226
|
+
return $boundThis.m1j(p0, p1);
|
|
238
227
|
};
|
|
239
228
|
l.callableName = 'checkTermsEquality';
|
|
240
229
|
return l;
|
|
241
230
|
}
|
|
242
231
|
function AbstractUnificator$equationsFor$lambda(it) {
|
|
243
|
-
var tmp$ret$0;
|
|
244
232
|
// Inline function 'kotlin.collections.toPair' call
|
|
245
|
-
|
|
246
|
-
return tmp$ret$0;
|
|
233
|
+
return new Pair(it.q2(), it.r2());
|
|
247
234
|
}
|
|
248
235
|
function AbstractUnificator$checkTermsEquality$ref_0($boundThis) {
|
|
249
236
|
var l = function (p0, p1) {
|
|
250
|
-
return $boundThis.
|
|
237
|
+
return $boundThis.m1j(p0, p1);
|
|
251
238
|
};
|
|
252
239
|
l.callableName = 'checkTermsEquality';
|
|
253
240
|
return l;
|
|
254
241
|
}
|
|
255
242
|
function AbstractUnificator(context) {
|
|
256
243
|
context = context === VOID ? Companion_getInstance().empty() : context;
|
|
257
|
-
this.
|
|
244
|
+
this.k1j_1 = context;
|
|
258
245
|
var tmp = this;
|
|
259
|
-
tmp.
|
|
246
|
+
tmp.l1j_1 = lazy(AbstractUnificator$contextEquations$delegate$lambda(this));
|
|
260
247
|
}
|
|
261
|
-
protoOf(AbstractUnificator).
|
|
262
|
-
return this.
|
|
248
|
+
protoOf(AbstractUnificator).uc = function () {
|
|
249
|
+
return this.k1j_1;
|
|
263
250
|
};
|
|
264
|
-
protoOf(AbstractUnificator).
|
|
265
|
-
if (this.
|
|
251
|
+
protoOf(AbstractUnificator).c1k = function (term1, term2, occurCheckEnabled) {
|
|
252
|
+
if (this.uc().x12())
|
|
266
253
|
return Companion_getInstance().failed();
|
|
267
254
|
var equations = newDeque(this, plus(asSequence_0(_get_contextEquations__x0dd77(this)), equationsFor(this, term1, term2)));
|
|
268
255
|
return mgu_0(this, equations, occurCheckEnabled);
|
|
269
256
|
};
|
|
270
|
-
protoOf(AbstractUnificator).
|
|
271
|
-
if ((this.
|
|
257
|
+
protoOf(AbstractUnificator).d1k = function (substitution1, substitution2, occurCheckEnabled) {
|
|
258
|
+
if ((this.uc().x12() ? true : substitution1.x12()) ? true : substitution2.x12())
|
|
272
259
|
return Companion_getInstance().failed();
|
|
273
260
|
if (!occurCheckEnabled) {
|
|
274
|
-
var quickMerge = this.
|
|
275
|
-
if (quickMerge.
|
|
261
|
+
var quickMerge = this.uc().plus(substitution1).plus(substitution2);
|
|
262
|
+
if (quickMerge.w12()) {
|
|
276
263
|
return quickMerge;
|
|
277
264
|
}
|
|
278
265
|
}
|
|
@@ -280,7 +267,7 @@
|
|
|
280
267
|
return mgu_0(this, equations, occurCheckEnabled);
|
|
281
268
|
};
|
|
282
269
|
protoOf(AbstractUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
283
|
-
return this.
|
|
270
|
+
return this.d1k(substitution1, substitution2, occurCheckEnabled);
|
|
284
271
|
};
|
|
285
272
|
function contextEquations$factory() {
|
|
286
273
|
return getPropertyCallableRef('contextEquations', 1, KProperty1, function (receiver) {
|
|
@@ -288,37 +275,37 @@
|
|
|
288
275
|
}, null);
|
|
289
276
|
}
|
|
290
277
|
function CachedUnificator(decorated, cacheCapacity) {
|
|
291
|
-
this.
|
|
292
|
-
this.
|
|
278
|
+
this.e1k_1 = decorated;
|
|
279
|
+
this.f1k_1 = Companion_instance.rq(cacheCapacity);
|
|
293
280
|
}
|
|
294
|
-
protoOf(CachedUnificator).
|
|
281
|
+
protoOf(CachedUnificator).c1k = function (term1, term2, occurCheckEnabled) {
|
|
295
282
|
var mguRequest = new Triple(term1, term2, occurCheckEnabled);
|
|
296
|
-
var cached = this.
|
|
283
|
+
var cached = this.f1k_1.x2(mguRequest);
|
|
297
284
|
var tmp;
|
|
298
285
|
if (cached instanceof Some) {
|
|
299
|
-
tmp = cached.
|
|
286
|
+
tmp = cached.uq_1;
|
|
300
287
|
} else {
|
|
301
|
-
var mguResult = this.
|
|
302
|
-
this.
|
|
288
|
+
var mguResult = this.e1k_1.c1k(term1, term2, occurCheckEnabled);
|
|
289
|
+
this.f1k_1.sq(mguRequest, mguResult);
|
|
303
290
|
tmp = mguResult;
|
|
304
291
|
}
|
|
305
292
|
return tmp;
|
|
306
293
|
};
|
|
307
|
-
protoOf(CachedUnificator).
|
|
294
|
+
protoOf(CachedUnificator).d1k = function (substitution1, substitution2, occurCheckEnabled) {
|
|
308
295
|
var mguRequest = new Triple(substitution1, substitution2, occurCheckEnabled);
|
|
309
|
-
var cached = this.
|
|
296
|
+
var cached = this.f1k_1.x2(mguRequest);
|
|
310
297
|
var tmp;
|
|
311
298
|
if (cached instanceof Some) {
|
|
312
|
-
tmp = cached.
|
|
299
|
+
tmp = cached.uq_1;
|
|
313
300
|
} else {
|
|
314
|
-
var mguResult = this.
|
|
315
|
-
this.
|
|
301
|
+
var mguResult = this.e1k_1.mergeWithOccurCheck(substitution1, substitution2, occurCheckEnabled);
|
|
302
|
+
this.f1k_1.sq(mguRequest, mguResult);
|
|
316
303
|
tmp = mguResult;
|
|
317
304
|
}
|
|
318
305
|
return tmp;
|
|
319
306
|
};
|
|
320
307
|
protoOf(CachedUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
321
|
-
return this.
|
|
308
|
+
return this.d1k(substitution1, substitution2, occurCheckEnabled);
|
|
322
309
|
};
|
|
323
310
|
function allOfLists($this, lhs, rhs, equalityChecker) {
|
|
324
311
|
var tmp = zip(lhs.unfold(), rhs.unfold());
|
|
@@ -351,7 +338,7 @@
|
|
|
351
338
|
}
|
|
352
339
|
function Equation$Companion$from$lambda($equalityChecker) {
|
|
353
340
|
return function (it) {
|
|
354
|
-
return
|
|
341
|
+
return Companion_instance_0.g1k(it, $equalityChecker);
|
|
355
342
|
};
|
|
356
343
|
}
|
|
357
344
|
function Term$equals$ref_2() {
|
|
@@ -377,16 +364,16 @@
|
|
|
377
364
|
}
|
|
378
365
|
function Equation$Companion$allOfLists$lambda($equalityChecker) {
|
|
379
366
|
return function (_name_for_destructuring_parameter_0__wldtmu) {
|
|
380
|
-
var l = _name_for_destructuring_parameter_0__wldtmu.
|
|
381
|
-
var r = _name_for_destructuring_parameter_0__wldtmu.
|
|
382
|
-
return (l.
|
|
367
|
+
var l = _name_for_destructuring_parameter_0__wldtmu.me();
|
|
368
|
+
var r = _name_for_destructuring_parameter_0__wldtmu.ne();
|
|
369
|
+
return (l.dx() ? r.dx() : false) ? sequenceOf([Companion_instance_0.b1k(l.castToCons().wy(), r.castToCons().wy(), $equalityChecker)]) : (l.cx() ? r.cx() : false) ? sequenceOf([Companion_instance_0.b1k(l.castToList(), r.castToList(), $equalityChecker)]) : Companion_instance_0.n1j(l, r, $equalityChecker);
|
|
383
370
|
};
|
|
384
371
|
}
|
|
385
372
|
function Equation$Companion$allOfTuples$lambda($equalityChecker) {
|
|
386
373
|
return function (_name_for_destructuring_parameter_0__wldtmu) {
|
|
387
|
-
var l = _name_for_destructuring_parameter_0__wldtmu.
|
|
388
|
-
var r = _name_for_destructuring_parameter_0__wldtmu.
|
|
389
|
-
return (l.
|
|
374
|
+
var l = _name_for_destructuring_parameter_0__wldtmu.me();
|
|
375
|
+
var r = _name_for_destructuring_parameter_0__wldtmu.ne();
|
|
376
|
+
return (l.bx() ? r.bx() : false) ? sequenceOf([Companion_instance_0.b1k(l.castToTuple().ky(), r.castToTuple().ky(), $equalityChecker)]) : Companion_instance_0.n1j(l, r, $equalityChecker);
|
|
390
377
|
};
|
|
391
378
|
}
|
|
392
379
|
function Term$equals$ref_5() {
|
|
@@ -398,29 +385,29 @@
|
|
|
398
385
|
}
|
|
399
386
|
function Equation$Companion$allOf$lambda($equalityChecker) {
|
|
400
387
|
return function (it) {
|
|
401
|
-
return
|
|
388
|
+
return Companion_instance_0.g1k(it, $equalityChecker);
|
|
402
389
|
};
|
|
403
390
|
}
|
|
404
391
|
function Identity(lhs, rhs) {
|
|
405
392
|
Equation.call(this, lhs, rhs);
|
|
406
|
-
this.
|
|
407
|
-
this.
|
|
393
|
+
this.j1k_1 = lhs;
|
|
394
|
+
this.k1k_1 = rhs;
|
|
408
395
|
}
|
|
409
|
-
protoOf(Identity).
|
|
410
|
-
return this.
|
|
396
|
+
protoOf(Identity).q1j = function () {
|
|
397
|
+
return this.j1k_1;
|
|
411
398
|
};
|
|
412
|
-
protoOf(Identity).
|
|
413
|
-
return this.
|
|
399
|
+
protoOf(Identity).r1j = function () {
|
|
400
|
+
return this.k1k_1;
|
|
414
401
|
};
|
|
415
|
-
protoOf(Identity).
|
|
402
|
+
protoOf(Identity).t1j = function () {
|
|
416
403
|
return true;
|
|
417
404
|
};
|
|
418
405
|
protoOf(Identity).toString = function () {
|
|
419
|
-
return 'Identity(lhs=' + this.
|
|
406
|
+
return 'Identity(lhs=' + this.j1k_1 + ', rhs=' + this.k1k_1 + ')';
|
|
420
407
|
};
|
|
421
408
|
protoOf(Identity).hashCode = function () {
|
|
422
|
-
var result = this.
|
|
423
|
-
result = imul(result, 31) + this.
|
|
409
|
+
var result = this.j1k_1.hashCode();
|
|
410
|
+
result = imul(result, 31) + this.k1k_1.hashCode() | 0;
|
|
424
411
|
return result;
|
|
425
412
|
};
|
|
426
413
|
protoOf(Identity).equals = function (other) {
|
|
@@ -429,44 +416,44 @@
|
|
|
429
416
|
if (!(other instanceof Identity))
|
|
430
417
|
return false;
|
|
431
418
|
var tmp0_other_with_cast = other instanceof Identity ? other : THROW_CCE();
|
|
432
|
-
if (!this.
|
|
419
|
+
if (!this.j1k_1.equals(tmp0_other_with_cast.j1k_1))
|
|
433
420
|
return false;
|
|
434
|
-
if (!this.
|
|
421
|
+
if (!this.k1k_1.equals(tmp0_other_with_cast.k1k_1))
|
|
435
422
|
return false;
|
|
436
423
|
return true;
|
|
437
424
|
};
|
|
438
425
|
function Assignment(lhs, rhs) {
|
|
439
426
|
Equation.call(this, lhs, rhs);
|
|
440
|
-
this.
|
|
441
|
-
this.
|
|
427
|
+
this.y1j_1 = lhs;
|
|
428
|
+
this.z1j_1 = rhs;
|
|
442
429
|
}
|
|
443
|
-
protoOf(Assignment).
|
|
444
|
-
return this.
|
|
430
|
+
protoOf(Assignment).q1j = function () {
|
|
431
|
+
return this.y1j_1;
|
|
445
432
|
};
|
|
446
|
-
protoOf(Assignment).
|
|
447
|
-
return this.
|
|
433
|
+
protoOf(Assignment).r1j = function () {
|
|
434
|
+
return this.z1j_1;
|
|
448
435
|
};
|
|
449
436
|
protoOf(Assignment).toSubstitution = function () {
|
|
450
|
-
return Companion_getInstance().unifier(this.
|
|
437
|
+
return Companion_getInstance().unifier(this.y1j_1, this.z1j_1);
|
|
451
438
|
};
|
|
452
|
-
protoOf(Assignment).
|
|
453
|
-
return to(this.
|
|
439
|
+
protoOf(Assignment).n1k = function () {
|
|
440
|
+
return to(this.y1j_1, this.z1j_1);
|
|
454
441
|
};
|
|
455
442
|
protoOf(Assignment).toPair = function () {
|
|
456
|
-
return this.
|
|
443
|
+
return this.n1k();
|
|
457
444
|
};
|
|
458
|
-
protoOf(Assignment).
|
|
445
|
+
protoOf(Assignment).a1k = function () {
|
|
459
446
|
return true;
|
|
460
447
|
};
|
|
461
|
-
protoOf(Assignment).
|
|
448
|
+
protoOf(Assignment).l1k = function () {
|
|
462
449
|
return this;
|
|
463
450
|
};
|
|
464
451
|
protoOf(Assignment).toString = function () {
|
|
465
|
-
return 'Assignment(lhs=' + this.
|
|
452
|
+
return 'Assignment(lhs=' + this.y1j_1 + ', rhs=' + this.z1j_1 + ')';
|
|
466
453
|
};
|
|
467
454
|
protoOf(Assignment).hashCode = function () {
|
|
468
|
-
var result = this.
|
|
469
|
-
result = imul(result, 31) + this.
|
|
455
|
+
var result = this.y1j_1.hashCode();
|
|
456
|
+
result = imul(result, 31) + this.z1j_1.hashCode() | 0;
|
|
470
457
|
return result;
|
|
471
458
|
};
|
|
472
459
|
protoOf(Assignment).equals = function (other) {
|
|
@@ -475,32 +462,32 @@
|
|
|
475
462
|
if (!(other instanceof Assignment))
|
|
476
463
|
return false;
|
|
477
464
|
var tmp0_other_with_cast = other instanceof Assignment ? other : THROW_CCE();
|
|
478
|
-
if (!this.
|
|
465
|
+
if (!this.y1j_1.equals(tmp0_other_with_cast.y1j_1))
|
|
479
466
|
return false;
|
|
480
|
-
if (!this.
|
|
467
|
+
if (!this.z1j_1.equals(tmp0_other_with_cast.z1j_1))
|
|
481
468
|
return false;
|
|
482
469
|
return true;
|
|
483
470
|
};
|
|
484
471
|
function Comparison(lhs, rhs) {
|
|
485
472
|
Equation.call(this, lhs, rhs);
|
|
486
|
-
this.
|
|
487
|
-
this.
|
|
473
|
+
this.q1k_1 = lhs;
|
|
474
|
+
this.r1k_1 = rhs;
|
|
488
475
|
}
|
|
489
|
-
protoOf(Comparison).
|
|
490
|
-
return this.
|
|
476
|
+
protoOf(Comparison).q1j = function () {
|
|
477
|
+
return this.q1k_1;
|
|
491
478
|
};
|
|
492
|
-
protoOf(Comparison).
|
|
493
|
-
return this.
|
|
479
|
+
protoOf(Comparison).r1j = function () {
|
|
480
|
+
return this.r1k_1;
|
|
494
481
|
};
|
|
495
|
-
protoOf(Comparison).
|
|
482
|
+
protoOf(Comparison).u1j = function () {
|
|
496
483
|
return true;
|
|
497
484
|
};
|
|
498
485
|
protoOf(Comparison).toString = function () {
|
|
499
|
-
return 'Comparison(lhs=' + this.
|
|
486
|
+
return 'Comparison(lhs=' + this.q1k_1 + ', rhs=' + this.r1k_1 + ')';
|
|
500
487
|
};
|
|
501
488
|
protoOf(Comparison).hashCode = function () {
|
|
502
|
-
var result = this.
|
|
503
|
-
result = imul(result, 31) + this.
|
|
489
|
+
var result = this.q1k_1.hashCode();
|
|
490
|
+
result = imul(result, 31) + this.r1k_1.hashCode() | 0;
|
|
504
491
|
return result;
|
|
505
492
|
};
|
|
506
493
|
protoOf(Comparison).equals = function (other) {
|
|
@@ -509,32 +496,32 @@
|
|
|
509
496
|
if (!(other instanceof Comparison))
|
|
510
497
|
return false;
|
|
511
498
|
var tmp0_other_with_cast = other instanceof Comparison ? other : THROW_CCE();
|
|
512
|
-
if (!this.
|
|
499
|
+
if (!this.q1k_1.equals(tmp0_other_with_cast.q1k_1))
|
|
513
500
|
return false;
|
|
514
|
-
if (!this.
|
|
501
|
+
if (!this.r1k_1.equals(tmp0_other_with_cast.r1k_1))
|
|
515
502
|
return false;
|
|
516
503
|
return true;
|
|
517
504
|
};
|
|
518
505
|
function Contradiction(lhs, rhs) {
|
|
519
506
|
Equation.call(this, lhs, rhs);
|
|
520
|
-
this.
|
|
521
|
-
this.
|
|
507
|
+
this.u1k_1 = lhs;
|
|
508
|
+
this.v1k_1 = rhs;
|
|
522
509
|
}
|
|
523
|
-
protoOf(Contradiction).
|
|
524
|
-
return this.
|
|
510
|
+
protoOf(Contradiction).q1j = function () {
|
|
511
|
+
return this.u1k_1;
|
|
525
512
|
};
|
|
526
|
-
protoOf(Contradiction).
|
|
527
|
-
return this.
|
|
513
|
+
protoOf(Contradiction).r1j = function () {
|
|
514
|
+
return this.v1k_1;
|
|
528
515
|
};
|
|
529
|
-
protoOf(Contradiction).
|
|
516
|
+
protoOf(Contradiction).s1j = function () {
|
|
530
517
|
return true;
|
|
531
518
|
};
|
|
532
519
|
protoOf(Contradiction).toString = function () {
|
|
533
|
-
return 'Contradiction(lhs=' + this.
|
|
520
|
+
return 'Contradiction(lhs=' + this.u1k_1 + ', rhs=' + this.v1k_1 + ')';
|
|
534
521
|
};
|
|
535
522
|
protoOf(Contradiction).hashCode = function () {
|
|
536
|
-
var result = this.
|
|
537
|
-
result = imul(result, 31) + this.
|
|
523
|
+
var result = this.u1k_1.hashCode();
|
|
524
|
+
result = imul(result, 31) + this.v1k_1.hashCode() | 0;
|
|
538
525
|
return result;
|
|
539
526
|
};
|
|
540
527
|
protoOf(Contradiction).equals = function (other) {
|
|
@@ -543,18 +530,17 @@
|
|
|
543
530
|
if (!(other instanceof Contradiction))
|
|
544
531
|
return false;
|
|
545
532
|
var tmp0_other_with_cast = other instanceof Contradiction ? other : THROW_CCE();
|
|
546
|
-
if (!this.
|
|
533
|
+
if (!this.u1k_1.equals(tmp0_other_with_cast.u1k_1))
|
|
547
534
|
return false;
|
|
548
|
-
if (!this.
|
|
535
|
+
if (!this.v1k_1.equals(tmp0_other_with_cast.v1k_1))
|
|
549
536
|
return false;
|
|
550
537
|
return true;
|
|
551
538
|
};
|
|
552
539
|
function Companion() {
|
|
553
|
-
Companion_instance = this;
|
|
554
540
|
}
|
|
555
|
-
protoOf(Companion).
|
|
541
|
+
protoOf(Companion).b1k = function (lhs, rhs, equalityChecker) {
|
|
556
542
|
var tmp;
|
|
557
|
-
if (lhs.
|
|
543
|
+
if (lhs.mx() ? rhs.mx() : false) {
|
|
558
544
|
var tmp_0;
|
|
559
545
|
if (equalityChecker(lhs, rhs)) {
|
|
560
546
|
tmp_0 = new Identity(lhs, rhs);
|
|
@@ -562,11 +548,11 @@
|
|
|
562
548
|
tmp_0 = new Assignment(lhs.castToVar(), rhs);
|
|
563
549
|
}
|
|
564
550
|
tmp = tmp_0;
|
|
565
|
-
} else if (lhs.
|
|
551
|
+
} else if (lhs.mx()) {
|
|
566
552
|
tmp = new Assignment(lhs.castToVar(), rhs);
|
|
567
|
-
} else if (rhs.
|
|
553
|
+
} else if (rhs.mx()) {
|
|
568
554
|
tmp = new Assignment(rhs.castToVar(), lhs);
|
|
569
|
-
} else if (lhs.
|
|
555
|
+
} else if (lhs.px() ? rhs.px() : false) {
|
|
570
556
|
var tmp_1;
|
|
571
557
|
if (equalityChecker(lhs, rhs)) {
|
|
572
558
|
tmp_1 = new Identity(lhs, rhs);
|
|
@@ -574,13 +560,13 @@
|
|
|
574
560
|
tmp_1 = new Contradiction(lhs, rhs);
|
|
575
561
|
}
|
|
576
562
|
tmp = tmp_1;
|
|
577
|
-
} else if (lhs.
|
|
563
|
+
} else if (lhs.px() ? true : rhs.px()) {
|
|
578
564
|
tmp = new Contradiction(lhs, rhs);
|
|
579
|
-
} else if (lhs.
|
|
565
|
+
} else if (lhs.ww() ? rhs.ww() : false) {
|
|
580
566
|
var lhsStruct = lhs.castToStruct();
|
|
581
567
|
var rhsStruct = rhs.castToStruct();
|
|
582
568
|
var tmp_2;
|
|
583
|
-
if (!(lhsStruct.
|
|
569
|
+
if (!(lhsStruct.kw() === rhsStruct.kw()) ? true : !(lhsStruct.qw() === rhsStruct.qw())) {
|
|
584
570
|
tmp_2 = new Contradiction(lhsStruct, rhsStruct);
|
|
585
571
|
} else {
|
|
586
572
|
tmp_2 = new Comparison(lhsStruct, rhsStruct);
|
|
@@ -599,10 +585,10 @@
|
|
|
599
585
|
tmp = equalityChecker;
|
|
600
586
|
}
|
|
601
587
|
equalityChecker = tmp;
|
|
602
|
-
return $super === VOID ? this.
|
|
588
|
+
return $super === VOID ? this.b1k(lhs, rhs, equalityChecker) : $super.b1k.call(this, lhs, rhs, equalityChecker);
|
|
603
589
|
};
|
|
604
|
-
protoOf(Companion).
|
|
605
|
-
return this.
|
|
590
|
+
protoOf(Companion).w1k = function (pair, equalityChecker) {
|
|
591
|
+
return this.b1k(pair.ye_1, pair.ze_1, equalityChecker);
|
|
606
592
|
};
|
|
607
593
|
protoOf(Companion).ofPair = function (pair, equalityChecker, $super) {
|
|
608
594
|
var tmp;
|
|
@@ -612,9 +598,9 @@
|
|
|
612
598
|
tmp = equalityChecker;
|
|
613
599
|
}
|
|
614
600
|
equalityChecker = tmp;
|
|
615
|
-
return $super === VOID ? this.
|
|
601
|
+
return $super === VOID ? this.w1k(pair, equalityChecker) : $super.w1k.call(this, pair, equalityChecker);
|
|
616
602
|
};
|
|
617
|
-
protoOf(Companion).
|
|
603
|
+
protoOf(Companion).x1k = function (pairs, equalityChecker) {
|
|
618
604
|
return flatMap(pairs, Equation$Companion$from$lambda(equalityChecker));
|
|
619
605
|
};
|
|
620
606
|
protoOf(Companion).fromSequence = function (pairs, equalityChecker, $super) {
|
|
@@ -625,10 +611,10 @@
|
|
|
625
611
|
tmp = equalityChecker;
|
|
626
612
|
}
|
|
627
613
|
equalityChecker = tmp;
|
|
628
|
-
return $super === VOID ? this.
|
|
614
|
+
return $super === VOID ? this.x1k(pairs, equalityChecker) : $super.x1k.call(this, pairs, equalityChecker);
|
|
629
615
|
};
|
|
630
|
-
protoOf(Companion).
|
|
631
|
-
return this.
|
|
616
|
+
protoOf(Companion).y1k = function (pairs, equalityChecker) {
|
|
617
|
+
return this.x1k(asSequence_0(pairs), equalityChecker);
|
|
632
618
|
};
|
|
633
619
|
protoOf(Companion).fromIterable = function (pairs, equalityChecker, $super) {
|
|
634
620
|
var tmp;
|
|
@@ -638,10 +624,10 @@
|
|
|
638
624
|
tmp = equalityChecker;
|
|
639
625
|
}
|
|
640
626
|
equalityChecker = tmp;
|
|
641
|
-
return $super === VOID ? this.
|
|
627
|
+
return $super === VOID ? this.y1k(pairs, equalityChecker) : $super.y1k.call(this, pairs, equalityChecker);
|
|
642
628
|
};
|
|
643
|
-
protoOf(Companion).
|
|
644
|
-
return this.
|
|
629
|
+
protoOf(Companion).z1k = function (pairs, equalityChecker) {
|
|
630
|
+
return this.x1k(sequenceOf(pairs.slice()), equalityChecker);
|
|
645
631
|
};
|
|
646
632
|
protoOf(Companion).from = function (pairs, equalityChecker, $super) {
|
|
647
633
|
var tmp;
|
|
@@ -651,10 +637,10 @@
|
|
|
651
637
|
tmp = equalityChecker;
|
|
652
638
|
}
|
|
653
639
|
equalityChecker = tmp;
|
|
654
|
-
return $super === VOID ? this.
|
|
640
|
+
return $super === VOID ? this.z1k(pairs, equalityChecker) : $super.z1k.call(this, pairs, equalityChecker);
|
|
655
641
|
};
|
|
656
|
-
protoOf(Companion).
|
|
657
|
-
return this.
|
|
642
|
+
protoOf(Companion).g1k = function (pair, equalityChecker) {
|
|
643
|
+
return this.n1j(pair.ye_1, pair.ze_1, equalityChecker);
|
|
658
644
|
};
|
|
659
645
|
protoOf(Companion).allOfPair = function (pair, equalityChecker, $super) {
|
|
660
646
|
var tmp;
|
|
@@ -664,29 +650,29 @@
|
|
|
664
650
|
tmp = equalityChecker;
|
|
665
651
|
}
|
|
666
652
|
equalityChecker = tmp;
|
|
667
|
-
return $super === VOID ? this.
|
|
653
|
+
return $super === VOID ? this.g1k(pair, equalityChecker) : $super.g1k.call(this, pair, equalityChecker);
|
|
668
654
|
};
|
|
669
|
-
protoOf(Companion).
|
|
655
|
+
protoOf(Companion).n1j = function (lhs, rhs, equalityChecker) {
|
|
670
656
|
var tmp;
|
|
671
|
-
if (lhs.
|
|
672
|
-
tmp = sequenceOf([this.
|
|
673
|
-
} else if (lhs.
|
|
657
|
+
if (lhs.lw() ? rhs.lw() : false) {
|
|
658
|
+
tmp = sequenceOf([this.b1k(lhs, rhs, equalityChecker)]);
|
|
659
|
+
} else if (lhs.cx() ? rhs.cx() : false) {
|
|
674
660
|
tmp = allOfLists(this, lhs.castToList(), rhs.castToList(), equalityChecker);
|
|
675
|
-
} else if (lhs.
|
|
661
|
+
} else if (lhs.bx() ? rhs.bx() : false) {
|
|
676
662
|
tmp = allOfTuples(this, lhs.castToTuple(), rhs.castToTuple(), equalityChecker);
|
|
677
|
-
} else if (lhs.
|
|
663
|
+
} else if (lhs.ww() ? rhs.ww() : false) {
|
|
678
664
|
var lhsStruct = lhs.castToStruct();
|
|
679
665
|
var rhsStruct = rhs.castToStruct();
|
|
680
666
|
var tmp_0;
|
|
681
|
-
if (lhsStruct.
|
|
682
|
-
var tmp_1 = zip(lhsStruct.
|
|
667
|
+
if (lhsStruct.kw() === rhsStruct.kw() ? lhsStruct.qw() === rhsStruct.qw() : false) {
|
|
668
|
+
var tmp_1 = zip(lhsStruct.jx(), rhsStruct.jx());
|
|
683
669
|
tmp_0 = flatMap(tmp_1, Equation$Companion$allOf$lambda(equalityChecker));
|
|
684
670
|
} else {
|
|
685
|
-
tmp_0 = sequenceOf([this.
|
|
671
|
+
tmp_0 = sequenceOf([this.b1k(lhs, rhs, equalityChecker)]);
|
|
686
672
|
}
|
|
687
673
|
tmp = tmp_0;
|
|
688
674
|
} else {
|
|
689
|
-
tmp = sequenceOf([this.
|
|
675
|
+
tmp = sequenceOf([this.b1k(lhs, rhs, equalityChecker)]);
|
|
690
676
|
}
|
|
691
677
|
return tmp;
|
|
692
678
|
};
|
|
@@ -698,13 +684,11 @@
|
|
|
698
684
|
tmp = equalityChecker;
|
|
699
685
|
}
|
|
700
686
|
equalityChecker = tmp;
|
|
701
|
-
return $super === VOID ? this.
|
|
687
|
+
return $super === VOID ? this.n1j(lhs, rhs, equalityChecker) : $super.n1j.call(this, lhs, rhs, equalityChecker);
|
|
702
688
|
};
|
|
703
|
-
var
|
|
704
|
-
function
|
|
705
|
-
|
|
706
|
-
new Companion();
|
|
707
|
-
return Companion_instance;
|
|
689
|
+
var Companion_instance_0;
|
|
690
|
+
function Companion_getInstance_1() {
|
|
691
|
+
return Companion_instance_0;
|
|
708
692
|
}
|
|
709
693
|
function Term$equals$ref_6() {
|
|
710
694
|
var l = function (p0, p1) {
|
|
@@ -714,55 +698,54 @@
|
|
|
714
698
|
return l;
|
|
715
699
|
}
|
|
716
700
|
function Equation(lhs, rhs) {
|
|
717
|
-
|
|
718
|
-
this.
|
|
719
|
-
this.q1i_1 = rhs;
|
|
701
|
+
this.o1j_1 = lhs;
|
|
702
|
+
this.p1j_1 = rhs;
|
|
720
703
|
}
|
|
721
|
-
protoOf(Equation).
|
|
722
|
-
return this.
|
|
704
|
+
protoOf(Equation).q1j = function () {
|
|
705
|
+
return this.o1j_1;
|
|
723
706
|
};
|
|
724
|
-
protoOf(Equation).
|
|
725
|
-
return this.
|
|
707
|
+
protoOf(Equation).r1j = function () {
|
|
708
|
+
return this.p1j_1;
|
|
726
709
|
};
|
|
727
|
-
protoOf(Equation).
|
|
710
|
+
protoOf(Equation).t1j = function () {
|
|
728
711
|
return false;
|
|
729
712
|
};
|
|
730
|
-
protoOf(Equation).
|
|
713
|
+
protoOf(Equation).a1k = function () {
|
|
731
714
|
return false;
|
|
732
715
|
};
|
|
733
|
-
protoOf(Equation).
|
|
716
|
+
protoOf(Equation).l1k = function () {
|
|
734
717
|
return null;
|
|
735
718
|
};
|
|
736
|
-
protoOf(Equation).
|
|
737
|
-
var tmp0_elvis_lhs = this.
|
|
719
|
+
protoOf(Equation).v1j = function () {
|
|
720
|
+
var tmp0_elvis_lhs = this.l1k();
|
|
738
721
|
var tmp;
|
|
739
722
|
if (tmp0_elvis_lhs == null) {
|
|
740
|
-
throw ClassCastException_init_$Create$('Cannot cast ' + this + ' to ' + getKClass(Assignment).
|
|
723
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + this + ' to ' + getKClass(Assignment).s6());
|
|
741
724
|
} else {
|
|
742
725
|
tmp = tmp0_elvis_lhs;
|
|
743
726
|
}
|
|
744
727
|
return tmp;
|
|
745
728
|
};
|
|
746
|
-
protoOf(Equation).
|
|
729
|
+
protoOf(Equation).u1j = function () {
|
|
747
730
|
return false;
|
|
748
731
|
};
|
|
749
|
-
protoOf(Equation).
|
|
732
|
+
protoOf(Equation).s1j = function () {
|
|
750
733
|
return false;
|
|
751
734
|
};
|
|
752
|
-
protoOf(Equation).
|
|
753
|
-
return
|
|
735
|
+
protoOf(Equation).t1i = function () {
|
|
736
|
+
return Companion_getInstance_0().of('=', [this.q1j(), this.r1j()]);
|
|
754
737
|
};
|
|
755
738
|
protoOf(Equation).toTerm = function () {
|
|
756
|
-
return this.
|
|
739
|
+
return this.t1i();
|
|
757
740
|
};
|
|
758
741
|
protoOf(Equation).toPair = function () {
|
|
759
|
-
return new Pair(this.
|
|
742
|
+
return new Pair(this.q1j(), this.r1j());
|
|
760
743
|
};
|
|
761
744
|
protoOf(Equation).swap = function () {
|
|
762
|
-
return
|
|
745
|
+
return Companion_instance_0.of(this.r1j(), this.q1j());
|
|
763
746
|
};
|
|
764
|
-
protoOf(Equation).
|
|
765
|
-
return
|
|
747
|
+
protoOf(Equation).m1k = function (substitution, equalityChecker) {
|
|
748
|
+
return Companion_instance_0.b1k(this.q1j().getSubstituted(substitution, []), this.r1j().getSubstituted(substitution, []), equalityChecker);
|
|
766
749
|
};
|
|
767
750
|
protoOf(Equation).apply = function (substitution, equalityChecker, $super) {
|
|
768
751
|
var tmp;
|
|
@@ -772,40 +755,25 @@
|
|
|
772
755
|
tmp = equalityChecker;
|
|
773
756
|
}
|
|
774
757
|
equalityChecker = tmp;
|
|
775
|
-
return $super === VOID ? this.
|
|
758
|
+
return $super === VOID ? this.m1k(substitution, equalityChecker) : $super.m1k.call(this, substitution, equalityChecker);
|
|
776
759
|
};
|
|
777
|
-
defineProp(protoOf(Equation), 'lhs', function () {
|
|
778
|
-
return this.r1i();
|
|
779
|
-
});
|
|
780
|
-
defineProp(protoOf(Equation), 'rhs', function () {
|
|
781
|
-
return this.s1i();
|
|
782
|
-
});
|
|
783
760
|
function toEquations(_this__u8e3s4) {
|
|
784
|
-
var tmp$ret$4;
|
|
785
761
|
// Inline function 'kotlin.collections.map' call
|
|
786
|
-
var
|
|
787
|
-
var tmp$ret$3;
|
|
762
|
+
var this_0 = _this__u8e3s4.p2();
|
|
788
763
|
// Inline function 'kotlin.collections.mapTo' call
|
|
789
|
-
var
|
|
790
|
-
var tmp0_iterator =
|
|
791
|
-
while (tmp0_iterator.
|
|
792
|
-
var item = tmp0_iterator.
|
|
793
|
-
var tmp$ret$2;
|
|
764
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
765
|
+
var tmp0_iterator = this_0.r();
|
|
766
|
+
while (tmp0_iterator.s()) {
|
|
767
|
+
var item = tmp0_iterator.u();
|
|
794
768
|
// Inline function 'it.unibo.tuprolog.unify.toEquations.<anonymous>' call
|
|
795
|
-
var tmp$ret$0;
|
|
796
769
|
// Inline function 'kotlin.collections.component1' call
|
|
797
|
-
|
|
798
|
-
var variable = tmp$ret$0;
|
|
799
|
-
var tmp$ret$1;
|
|
770
|
+
var variable = item.q2();
|
|
800
771
|
// Inline function 'kotlin.collections.component2' call
|
|
801
|
-
|
|
802
|
-
var
|
|
803
|
-
tmp$ret$2
|
|
804
|
-
tmp0_mapTo.g(tmp$ret$2);
|
|
772
|
+
var term = item.r2();
|
|
773
|
+
var tmp$ret$2 = new Assignment(variable, term);
|
|
774
|
+
destination.o(tmp$ret$2);
|
|
805
775
|
}
|
|
806
|
-
|
|
807
|
-
tmp$ret$4 = tmp$ret$3;
|
|
808
|
-
return tmp$ret$4;
|
|
776
|
+
return destination;
|
|
809
777
|
}
|
|
810
778
|
function toSubstitution(_this__u8e3s4) {
|
|
811
779
|
var tmp = Companion_getInstance();
|
|
@@ -814,12 +782,12 @@
|
|
|
814
782
|
}
|
|
815
783
|
function toAssignmentPair(_this__u8e3s4) {
|
|
816
784
|
var tmp;
|
|
817
|
-
if (_this__u8e3s4.
|
|
818
|
-
tmp = _this__u8e3s4.
|
|
819
|
-
} else if (_this__u8e3s4.
|
|
820
|
-
tmp = to(_this__u8e3s4.
|
|
821
|
-
} else if (_this__u8e3s4.
|
|
822
|
-
tmp = to(_this__u8e3s4.
|
|
785
|
+
if (_this__u8e3s4.a1k()) {
|
|
786
|
+
tmp = _this__u8e3s4.v1j().n1k();
|
|
787
|
+
} else if (_this__u8e3s4.q1j().mx()) {
|
|
788
|
+
tmp = to(_this__u8e3s4.q1j().castToVar(), _this__u8e3s4.r1j());
|
|
789
|
+
} else if (_this__u8e3s4.r1j().mx()) {
|
|
790
|
+
tmp = to(_this__u8e3s4.r1j().castToVar(), _this__u8e3s4.q1j());
|
|
823
791
|
} else {
|
|
824
792
|
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + _this__u8e3s4);
|
|
825
793
|
}
|
|
@@ -829,17 +797,17 @@
|
|
|
829
797
|
return toAssignmentPair(it);
|
|
830
798
|
}
|
|
831
799
|
function Unificator$Companion$default$delegate$lambda() {
|
|
832
|
-
return
|
|
800
|
+
return Companion_getInstance_2().strict();
|
|
833
801
|
}
|
|
834
802
|
function Unificator$Companion$naive$1($context) {
|
|
835
803
|
AbstractUnificator.call(this, $context);
|
|
836
804
|
}
|
|
837
|
-
protoOf(Unificator$Companion$naive$1).
|
|
805
|
+
protoOf(Unificator$Companion$naive$1).m1j = function (first, second) {
|
|
838
806
|
var tmp;
|
|
839
|
-
if (first.
|
|
840
|
-
tmp = first.castToInteger().
|
|
841
|
-
} else if (first.
|
|
842
|
-
tmp = first.castToNumeric().
|
|
807
|
+
if (first.rx() ? second.rx() : false) {
|
|
808
|
+
tmp = first.castToInteger().r2().yk(second.castToInteger().r2()) === 0;
|
|
809
|
+
} else if (first.qx() ? second.qx() : false) {
|
|
810
|
+
tmp = first.castToNumeric().g11().pk(second.castToNumeric().g11()) === 0;
|
|
843
811
|
} else {
|
|
844
812
|
tmp = first.equals(second);
|
|
845
813
|
}
|
|
@@ -848,33 +816,32 @@
|
|
|
848
816
|
function Unificator$Companion$strict$1($context) {
|
|
849
817
|
AbstractUnificator.call(this, $context);
|
|
850
818
|
}
|
|
851
|
-
protoOf(Unificator$Companion$strict$1).
|
|
819
|
+
protoOf(Unificator$Companion$strict$1).m1j = function (first, second) {
|
|
852
820
|
return first.equals(second);
|
|
853
821
|
};
|
|
854
822
|
function Companion_0() {
|
|
855
|
-
|
|
823
|
+
Companion_instance_1 = this;
|
|
856
824
|
var tmp = this;
|
|
857
|
-
tmp.
|
|
858
|
-
this.
|
|
825
|
+
tmp.e1l_1 = lazy(Unificator$Companion$default$delegate$lambda);
|
|
826
|
+
this.f1l_1 = 32;
|
|
859
827
|
}
|
|
860
|
-
protoOf(Companion_0).
|
|
861
|
-
var tmp$ret$0;
|
|
828
|
+
protoOf(Companion_0).g1l = function () {
|
|
862
829
|
// Inline function 'kotlin.getValue' call
|
|
863
|
-
var
|
|
864
|
-
|
|
865
|
-
return
|
|
830
|
+
var this_0 = this.e1l_1;
|
|
831
|
+
default$factory();
|
|
832
|
+
return this_0.r2();
|
|
866
833
|
};
|
|
867
834
|
protoOf(Companion_0).mguWith = function (_this__u8e3s4, other) {
|
|
868
|
-
return this.
|
|
835
|
+
return this.g1l().mgu(_this__u8e3s4, other);
|
|
869
836
|
};
|
|
870
837
|
protoOf(Companion_0).matches = function (_this__u8e3s4, other) {
|
|
871
|
-
return this.
|
|
838
|
+
return this.g1l().match(_this__u8e3s4, other);
|
|
872
839
|
};
|
|
873
840
|
protoOf(Companion_0).unifyWith = function (_this__u8e3s4, other) {
|
|
874
|
-
return this.
|
|
841
|
+
return this.g1l().unify(_this__u8e3s4, other);
|
|
875
842
|
};
|
|
876
843
|
protoOf(Companion_0).mergeWith = function (_this__u8e3s4, other) {
|
|
877
|
-
return this.
|
|
844
|
+
return this.g1l().merge(_this__u8e3s4, other);
|
|
878
845
|
};
|
|
879
846
|
protoOf(Companion_0).naiveWithContext = function (context) {
|
|
880
847
|
return new Unificator$Companion$naive$1(context);
|
|
@@ -888,10 +855,10 @@
|
|
|
888
855
|
protoOf(Companion_0).strict = function () {
|
|
889
856
|
return this.strictWithContext(Companion_getInstance().empty());
|
|
890
857
|
};
|
|
891
|
-
protoOf(Companion_0).
|
|
858
|
+
protoOf(Companion_0).h1l = function (other, capacity) {
|
|
892
859
|
var tmp;
|
|
893
860
|
if (other instanceof CachedUnificator) {
|
|
894
|
-
tmp = new CachedUnificator(other.
|
|
861
|
+
tmp = new CachedUnificator(other.e1k_1, capacity);
|
|
895
862
|
} else {
|
|
896
863
|
tmp = new CachedUnificator(other, capacity);
|
|
897
864
|
}
|
|
@@ -899,20 +866,19 @@
|
|
|
899
866
|
};
|
|
900
867
|
protoOf(Companion_0).cached = function (other, capacity, $super) {
|
|
901
868
|
capacity = capacity === VOID ? 32 : capacity;
|
|
902
|
-
return $super === VOID ? this.
|
|
869
|
+
return $super === VOID ? this.h1l(other, capacity) : $super.h1l.call(this, other, capacity);
|
|
903
870
|
};
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
if (Companion_instance_0 == null)
|
|
871
|
+
var Companion_instance_1;
|
|
872
|
+
function Companion_getInstance_2() {
|
|
873
|
+
if (Companion_instance_1 == null)
|
|
908
874
|
new Companion_0();
|
|
909
|
-
return
|
|
875
|
+
return Companion_instance_1;
|
|
910
876
|
}
|
|
911
877
|
function Unificator() {
|
|
912
878
|
}
|
|
913
879
|
function default$factory() {
|
|
914
880
|
return getPropertyCallableRef('default', 1, KProperty1, function (receiver) {
|
|
915
|
-
return receiver.
|
|
881
|
+
return receiver.g1l();
|
|
916
882
|
}, null);
|
|
917
883
|
}
|
|
918
884
|
//region block: post-declaration
|
|
@@ -928,27 +894,21 @@
|
|
|
928
894
|
protoOf(CachedUnificator).unifyWithOccurCheck = unifyWithOccurCheck;
|
|
929
895
|
protoOf(CachedUnificator).unify = unify;
|
|
930
896
|
protoOf(CachedUnificator).merge = merge;
|
|
931
|
-
protoOf(Equation).
|
|
932
|
-
protoOf(
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
protoOf(
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
protoOf(
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
protoOf(Unificator$Companion$strict$1).mgu = mgu;
|
|
943
|
-
protoOf(Unificator$Companion$strict$1).merge = merge;
|
|
944
|
-
protoOf(Unificator$Companion$strict$1).matchWithOccurCheck = matchWithOccurCheck;
|
|
945
|
-
protoOf(Unificator$Companion$strict$1).match = match;
|
|
946
|
-
protoOf(Unificator$Companion$strict$1).unifyWithOccurCheck = unifyWithOccurCheck;
|
|
947
|
-
protoOf(Unificator$Companion$strict$1).unify = unify;
|
|
897
|
+
protoOf(Equation).br = castTo;
|
|
898
|
+
defineProp(protoOf(Equation), 'lhs', function () {
|
|
899
|
+
return this.q1j();
|
|
900
|
+
});
|
|
901
|
+
defineProp(protoOf(Equation), 'rhs', function () {
|
|
902
|
+
return this.r1j();
|
|
903
|
+
});
|
|
904
|
+
defineProp(protoOf(Companion_0), 'default', protoOf(Companion_0).g1l);
|
|
905
|
+
//endregion
|
|
906
|
+
//region block: init
|
|
907
|
+
Companion_instance_0 = new Companion();
|
|
948
908
|
//endregion
|
|
949
909
|
//region block: exports
|
|
950
910
|
_.$_$ = _.$_$ || {};
|
|
951
|
-
_.$_$.a =
|
|
911
|
+
_.$_$.a = Companion_getInstance_2;
|
|
952
912
|
//endregion
|
|
953
913
|
return _;
|
|
954
914
|
}));
|