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