@tuprolog/arg2p 0.10.2 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2p-core.js +3187 -3471
- package/2p-core.js.map +1 -1
- package/2p-dsl-core.js +737 -758
- package/2p-dsl-core.js.map +1 -1
- package/2p-dsl-solve.js +372 -372
- package/2p-dsl-solve.js.map +1 -1
- package/2p-dsl-theory.js +248 -260
- package/2p-dsl-theory.js.map +1 -1
- package/2p-dsl-unify.js +19 -20
- package/2p-dsl-unify.js.map +1 -1
- package/2p-parser-core.js +263 -303
- package/2p-parser-core.js.map +1 -1
- package/2p-parser-js.js +5 -5
- package/2p-parser-js.js.map +1 -1
- package/2p-parser-theory.js +29 -30
- package/2p-parser-theory.js.map +1 -1
- package/2p-solve-classic.js +1176 -1163
- package/2p-solve-classic.js.map +1 -1
- package/2p-solve.js +5197 -5478
- package/2p-solve.js.map +1 -1
- package/2p-theory.js +2106 -2007
- package/2p-theory.js.map +1 -1
- package/2p-unify.js +309 -298
- package/2p-unify.js.map +1 -1
- package/2p-utils.js +648 -604
- package/2p-utils.js.map +1 -1
- package/README.md +1 -1
- package/arg2p-causality-solver.js +187 -212
- package/arg2p-causality-solver.js.map +1 -1
- package/arg2p-core.js +2174 -2214
- package/arg2p-core.js.map +1 -1
- package/arg2p.js +148 -156
- package/arg2p.js.map +1 -1
- package/kotlin-kotlin-stdlib.js +7137 -7365
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +3 -3
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -1
- package/kt-math.js +3143 -3506
- package/kt-math.js.map +1 -1
- package/package.json +2 -3
package/2p-unify.js
CHANGED
|
@@ -1,78 +1,79 @@
|
|
|
1
|
-
(function (
|
|
1
|
+
(function (factory) {
|
|
2
2
|
if (typeof define === 'function' && define.amd)
|
|
3
3
|
define(['exports', './kotlin-kotlin-stdlib.js', './2p-core.js', './2p-utils.js'], factory);
|
|
4
4
|
else if (typeof exports === 'object')
|
|
5
5
|
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./2p-core.js'), require('./2p-utils.js'));
|
|
6
6
|
else {
|
|
7
|
-
if (typeof
|
|
7
|
+
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
8
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
|
-
if (typeof
|
|
10
|
+
if (typeof globalThis['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'.");
|
|
12
12
|
}
|
|
13
|
-
if (typeof
|
|
13
|
+
if (typeof globalThis['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
|
-
|
|
16
|
+
globalThis['2p-unify'] = factory(typeof globalThis['2p-unify'] === 'undefined' ? {} : globalThis['2p-unify'], globalThis['kotlin-kotlin-stdlib'], globalThis['2p-core'], globalThis['2p-utils']);
|
|
17
17
|
}
|
|
18
|
-
}(
|
|
18
|
+
}(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 KProperty1 = kotlin_kotlin.$_$.g7;
|
|
23
|
+
var getPropertyCallableRef = kotlin_kotlin.$_$.u5;
|
|
24
|
+
var asSequence = kotlin_kotlin.$_$.y1;
|
|
25
|
+
var plus = kotlin_kotlin.$_$.j8;
|
|
26
|
+
var map = kotlin_kotlin.$_$.f8;
|
|
27
|
+
var Unit_instance = kotlin_kotlin.$_$.k1;
|
|
26
28
|
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.v;
|
|
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
|
|
35
|
-
var
|
|
36
|
-
var KProperty1 = kotlin_kotlin.$_$.w6;
|
|
37
|
-
var getPropertyCallableRef = kotlin_kotlin.$_$.l5;
|
|
29
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.d;
|
|
30
|
+
var toCollection = kotlin_kotlin.$_$.s8;
|
|
31
|
+
var Pair = kotlin_kotlin.$_$.ja;
|
|
32
|
+
var VOID = kotlin_kotlin.$_$.b;
|
|
33
|
+
var lazy = kotlin_kotlin.$_$.ra;
|
|
34
|
+
var protoOf = kotlin_kotlin.$_$.m6;
|
|
35
|
+
var asSequence_0 = kotlin_kotlin.$_$.z1;
|
|
36
|
+
var THROW_CCE = kotlin_kotlin.$_$.la;
|
|
37
|
+
var initMetadataForClass = kotlin_kotlin.$_$.x5;
|
|
38
38
|
var Companion_instance = kotlin_it_unibo_tuprolog_utils.$_$.a;
|
|
39
|
-
var Triple = kotlin_kotlin.$_$.
|
|
40
|
-
var Some = kotlin_it_unibo_tuprolog_utils.$_$.
|
|
41
|
-
var zip = kotlin_kotlin.$_$.
|
|
42
|
-
var flatMap = kotlin_kotlin.$_$.
|
|
43
|
-
var sequenceOf = kotlin_kotlin.$_$.
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
39
|
+
var Triple = kotlin_kotlin.$_$.na;
|
|
40
|
+
var Some = kotlin_it_unibo_tuprolog_utils.$_$.l;
|
|
41
|
+
var zip = kotlin_kotlin.$_$.z8;
|
|
42
|
+
var flatMap = kotlin_kotlin.$_$.w7;
|
|
43
|
+
var sequenceOf = kotlin_kotlin.$_$.m8;
|
|
44
|
+
var to = kotlin_kotlin.$_$.ya;
|
|
45
|
+
var sequenceOf_0 = kotlin_kotlin.$_$.l8;
|
|
46
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.y5;
|
|
47
|
+
var toString = kotlin_kotlin.$_$.p6;
|
|
48
|
+
var getKClass = kotlin_kotlin.$_$.e7;
|
|
49
|
+
var ClassCastException_init_$Create$ = kotlin_kotlin.$_$.o;
|
|
49
50
|
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.u;
|
|
50
51
|
var castTo = kotlin_it_unibo_tuprolog_utils.$_$.e;
|
|
51
|
-
var defineProp = kotlin_kotlin.$_$.
|
|
52
|
+
var defineProp = kotlin_kotlin.$_$.q5;
|
|
52
53
|
var TermConvertible = kotlin_it_unibo_tuprolog_core.$_$.u1;
|
|
53
54
|
var Castable = kotlin_it_unibo_tuprolog_utils.$_$.f;
|
|
54
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.
|
|
55
|
-
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.
|
|
56
|
-
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.
|
|
57
|
-
var
|
|
55
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.b2;
|
|
56
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.c;
|
|
57
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.q;
|
|
58
|
+
var initMetadataForInterface = kotlin_kotlin.$_$.z5;
|
|
58
59
|
//endregion
|
|
59
60
|
//region block: pre-declaration
|
|
60
61
|
function mguWithOccurCheck(term1, term2, occurCheckEnabled, $super) {
|
|
61
62
|
occurCheckEnabled = occurCheckEnabled === VOID ? true : occurCheckEnabled;
|
|
62
|
-
return $super === VOID ? this.
|
|
63
|
+
return $super === VOID ? this.u1h(term1, term2, occurCheckEnabled) : $super.u1h.call(this, term1, term2, occurCheckEnabled);
|
|
63
64
|
}
|
|
64
65
|
function mgu(term1, term2) {
|
|
65
|
-
return this.
|
|
66
|
+
return this.u1h(term1, term2, true);
|
|
66
67
|
}
|
|
67
68
|
function matchWithOccurCheck(term1, term2, occurCheckEnabled) {
|
|
68
|
-
return !(this.
|
|
69
|
+
return !(this.u1h(term1, term2, occurCheckEnabled) === Companion_getInstance().failed());
|
|
69
70
|
}
|
|
70
71
|
function match(term1, term2) {
|
|
71
72
|
return this.matchWithOccurCheck(term1, term2, true);
|
|
72
73
|
}
|
|
73
74
|
function unifyWithOccurCheck(term1, term2, occurCheckEnabled) {
|
|
74
|
-
var substitution = this.
|
|
75
|
-
return substitution.
|
|
75
|
+
var substitution = this.u1h(term1, term2, occurCheckEnabled);
|
|
76
|
+
return substitution.m10() ? null : term1.getSubstituted(substitution, []);
|
|
76
77
|
}
|
|
77
78
|
function unify(term1, term2) {
|
|
78
79
|
return this.unifyWithOccurCheck(term1, term2, true);
|
|
@@ -80,37 +81,38 @@
|
|
|
80
81
|
function merge(substitution1, substitution2) {
|
|
81
82
|
return this.mergeWithOccurCheck(substitution1, substitution2, true);
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
initMetadataForInterface(Unificator, 'Unificator');
|
|
85
|
+
initMetadataForClass(AbstractUnificator, 'AbstractUnificator', VOID, VOID, [Unificator]);
|
|
86
|
+
initMetadataForClass(CachedUnificator, 'CachedUnificator', VOID, VOID, [Unificator]);
|
|
87
|
+
initMetadataForClass(Equation, 'Equation', VOID, VOID, [TermConvertible, Castable]);
|
|
88
|
+
initMetadataForClass(Identity, 'Identity', VOID, Equation);
|
|
89
|
+
initMetadataForClass(Assignment, 'Assignment', VOID, Equation);
|
|
90
|
+
initMetadataForClass(Comparison, 'Comparison', VOID, Equation);
|
|
91
|
+
initMetadataForClass(Contradiction, 'Contradiction', VOID, Equation);
|
|
92
|
+
initMetadataForCompanion(Companion);
|
|
93
|
+
initMetadataForClass(Unificator$Companion$naive$1, VOID, VOID, AbstractUnificator);
|
|
94
|
+
initMetadataForClass(Unificator$Companion$strict$1, VOID, VOID, AbstractUnificator);
|
|
95
|
+
initMetadataForCompanion(Companion_0);
|
|
95
96
|
//endregion
|
|
96
97
|
function _get_contextEquations__x0dd77($this) {
|
|
98
|
+
var tmp0 = $this.d1h_1;
|
|
99
|
+
var tmp = KProperty1;
|
|
97
100
|
// Inline function 'kotlin.getValue' call
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return this_0.r2();
|
|
101
|
+
getPropertyCallableRef('contextEquations', 1, tmp, AbstractUnificator$_get_contextEquations_$ref_7ajcte(), null);
|
|
102
|
+
return tmp0.e2();
|
|
101
103
|
}
|
|
102
104
|
function occurrenceCheck($this, variable, term) {
|
|
103
105
|
var tmp;
|
|
104
|
-
if (term.
|
|
105
|
-
tmp = $this.
|
|
106
|
-
} else if (term.
|
|
106
|
+
if (term.dv()) {
|
|
107
|
+
tmp = $this.e1h(variable, term);
|
|
108
|
+
} else if (term.nu()) {
|
|
109
|
+
var tmp0 = term.ju();
|
|
107
110
|
var tmp$ret$1;
|
|
108
111
|
$l$block: {
|
|
109
112
|
// Inline function 'kotlin.sequences.any' call
|
|
110
|
-
var
|
|
111
|
-
while (
|
|
112
|
-
var element =
|
|
113
|
-
// Inline function 'it.unibo.tuprolog.unify.AbstractUnificator.occurrenceCheck.<anonymous>' call
|
|
113
|
+
var _iterator__ex2g4s = tmp0.p();
|
|
114
|
+
while (_iterator__ex2g4s.s()) {
|
|
115
|
+
var element = _iterator__ex2g4s.t();
|
|
114
116
|
if (occurrenceCheck($this, variable, element)) {
|
|
115
117
|
tmp$ret$1 = true;
|
|
116
118
|
break $l$block;
|
|
@@ -126,7 +128,7 @@
|
|
|
126
128
|
}
|
|
127
129
|
function equationsFor($this, term1, term2) {
|
|
128
130
|
var tmp = Companion_instance_0;
|
|
129
|
-
return tmp.
|
|
131
|
+
return tmp.f1h(term1, term2, AbstractUnificator$checkTermsEquality$ref($this));
|
|
130
132
|
}
|
|
131
133
|
function equationsFor_0($this, substitution1, substitution2) {
|
|
132
134
|
var tmp = Companion_instance_0;
|
|
@@ -144,7 +146,7 @@
|
|
|
144
146
|
}
|
|
145
147
|
while (inductionVariable < exceptIndex);
|
|
146
148
|
var inductionVariable_0 = exceptIndex + 1 | 0;
|
|
147
|
-
var last = equations.
|
|
149
|
+
var last = equations.v();
|
|
148
150
|
if (inductionVariable_0 < last)
|
|
149
151
|
do {
|
|
150
152
|
var i_0 = inductionVariable_0;
|
|
@@ -158,32 +160,32 @@
|
|
|
158
160
|
var changed = true;
|
|
159
161
|
while (changed) {
|
|
160
162
|
changed = false;
|
|
161
|
-
var eqIterator = equations.
|
|
163
|
+
var eqIterator = equations.b4();
|
|
162
164
|
while (eqIterator.s()) {
|
|
163
|
-
var eq = eqIterator.
|
|
164
|
-
if (eq.
|
|
165
|
+
var eq = eqIterator.t();
|
|
166
|
+
if (eq.k1h()) {
|
|
165
167
|
return Companion_getInstance().failed();
|
|
166
|
-
} else if (eq.
|
|
167
|
-
eqIterator.
|
|
168
|
+
} else if (eq.l1h()) {
|
|
169
|
+
eqIterator.c3();
|
|
168
170
|
changed = true;
|
|
169
|
-
} else if (eq.
|
|
170
|
-
var assignment = eq.
|
|
171
|
-
if (occurCheckEnabled
|
|
171
|
+
} else if (eq.s1h()) {
|
|
172
|
+
var assignment = eq.n1h();
|
|
173
|
+
if (occurCheckEnabled && occurrenceCheck($this, assignment.q1h_1, eq.j1h())) {
|
|
172
174
|
return Companion_getInstance().failed();
|
|
173
175
|
} else {
|
|
174
|
-
changed = changed
|
|
176
|
+
changed = changed || applySubstitutionToEquations($this, assignment.toSubstitution(), equations, eqIterator.r3());
|
|
175
177
|
}
|
|
176
|
-
} else if (eq.
|
|
177
|
-
eqIterator.
|
|
178
|
-
var
|
|
179
|
-
insertion: while (
|
|
180
|
-
var it =
|
|
181
|
-
if (it.
|
|
178
|
+
} else if (eq.m1h()) {
|
|
179
|
+
eqIterator.c3();
|
|
180
|
+
var _iterator__ex2g4s = equationsFor($this, eq.i1h(), eq.j1h()).p();
|
|
181
|
+
insertion: while (_iterator__ex2g4s.s()) {
|
|
182
|
+
var it = _iterator__ex2g4s.t();
|
|
183
|
+
if (it.l1h())
|
|
182
184
|
continue insertion;
|
|
183
|
-
else if (it.
|
|
185
|
+
else if (it.k1h())
|
|
184
186
|
return Companion_getInstance().failed();
|
|
185
187
|
else {
|
|
186
|
-
eqIterator.
|
|
188
|
+
eqIterator.u3(it);
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
changed = true;
|
|
@@ -193,12 +195,11 @@
|
|
|
193
195
|
// Inline function 'kotlin.collections.filter' call
|
|
194
196
|
// Inline function 'kotlin.collections.filterTo' call
|
|
195
197
|
var destination = ArrayList_init_$Create$();
|
|
196
|
-
var
|
|
197
|
-
while (
|
|
198
|
-
var element =
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
destination.o(element);
|
|
198
|
+
var _iterator__ex2g4s_0 = equations.p();
|
|
199
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
200
|
+
var element = _iterator__ex2g4s_0.t();
|
|
201
|
+
if (element.s1h()) {
|
|
202
|
+
destination.m(element);
|
|
202
203
|
}
|
|
203
204
|
}
|
|
204
205
|
return toSubstitution(destination);
|
|
@@ -209,62 +210,70 @@
|
|
|
209
210
|
return toCollection(items, tmp$ret$0);
|
|
210
211
|
}
|
|
211
212
|
function applySubstitutionToEquations$handleIndex($equations, $substitution, this$0, changed, i) {
|
|
212
|
-
if ($equations.
|
|
213
|
+
if ($equations.w(i).k1h() || $equations.w(i).l1h())
|
|
213
214
|
return Unit_instance;
|
|
214
|
-
var currentEq = $equations.
|
|
215
|
-
var
|
|
216
|
-
var newLhs =
|
|
217
|
-
var newRhs =
|
|
218
|
-
if (!currentEq.
|
|
215
|
+
var currentEq = $equations.w(i);
|
|
216
|
+
var _destruct__k2r9zo = currentEq.apply($substitution).toPair();
|
|
217
|
+
var newLhs = _destruct__k2r9zo.zb();
|
|
218
|
+
var newRhs = _destruct__k2r9zo.ac();
|
|
219
|
+
if (!currentEq.i1h().equals(newLhs) || !currentEq.j1h().equals(newRhs)) {
|
|
219
220
|
var tmp = Companion_instance_0;
|
|
220
|
-
$equations.
|
|
221
|
+
$equations.z2(i, tmp.t1h(newLhs, newRhs, AbstractUnificator$checkTermsEquality$ref_0(this$0)));
|
|
221
222
|
changed._v = true;
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
function AbstractUnificator$contextEquations$delegate$lambda(this$0) {
|
|
225
226
|
return function () {
|
|
226
|
-
return toEquations(this$0.
|
|
227
|
+
return toEquations(this$0.h8());
|
|
227
228
|
};
|
|
228
229
|
}
|
|
229
|
-
function AbstractUnificator$
|
|
230
|
-
|
|
231
|
-
return
|
|
230
|
+
function AbstractUnificator$_get_contextEquations_$ref_7ajcte() {
|
|
231
|
+
return function (p0) {
|
|
232
|
+
return _get_contextEquations__x0dd77(p0);
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function AbstractUnificator$checkTermsEquality$ref(p0) {
|
|
236
|
+
var l = function (_this__u8e3s4, p0_0) {
|
|
237
|
+
return p0.e1h(_this__u8e3s4, p0_0);
|
|
232
238
|
};
|
|
233
239
|
l.callableName = 'checkTermsEquality';
|
|
234
240
|
return l;
|
|
235
241
|
}
|
|
236
242
|
function AbstractUnificator$equationsFor$lambda(it) {
|
|
237
243
|
// Inline function 'kotlin.collections.toPair' call
|
|
238
|
-
return new Pair(it.
|
|
244
|
+
return new Pair(it.d2(), it.e2());
|
|
239
245
|
}
|
|
240
|
-
function AbstractUnificator$checkTermsEquality$ref_0(
|
|
241
|
-
var l = function (
|
|
242
|
-
return
|
|
246
|
+
function AbstractUnificator$checkTermsEquality$ref_0(p0) {
|
|
247
|
+
var l = function (_this__u8e3s4, p0_0) {
|
|
248
|
+
return p0.e1h(_this__u8e3s4, p0_0);
|
|
243
249
|
};
|
|
244
250
|
l.callableName = 'checkTermsEquality';
|
|
245
251
|
return l;
|
|
246
252
|
}
|
|
247
253
|
function AbstractUnificator(context) {
|
|
248
254
|
context = context === VOID ? Companion_getInstance().empty() : context;
|
|
249
|
-
this.
|
|
255
|
+
this.c1h_1 = context;
|
|
250
256
|
var tmp = this;
|
|
251
|
-
tmp.
|
|
257
|
+
tmp.d1h_1 = lazy(AbstractUnificator$contextEquations$delegate$lambda(this));
|
|
252
258
|
}
|
|
253
|
-
protoOf(AbstractUnificator).
|
|
254
|
-
return this.
|
|
259
|
+
protoOf(AbstractUnificator).h8 = function () {
|
|
260
|
+
return this.c1h_1;
|
|
255
261
|
};
|
|
256
|
-
protoOf(AbstractUnificator).
|
|
257
|
-
if (this.
|
|
262
|
+
protoOf(AbstractUnificator).u1h = function (term1, term2, occurCheckEnabled) {
|
|
263
|
+
if (this.h8().m10())
|
|
258
264
|
return Companion_getInstance().failed();
|
|
259
265
|
var equations = newDeque(this, plus(asSequence_0(_get_contextEquations__x0dd77(this)), equationsFor(this, term1, term2)));
|
|
260
266
|
return mgu_0(this, equations, occurCheckEnabled);
|
|
261
267
|
};
|
|
262
|
-
protoOf(AbstractUnificator).
|
|
263
|
-
|
|
268
|
+
protoOf(AbstractUnificator).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
269
|
+
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof AbstractUnificator) ? $super : THROW_CCE());
|
|
270
|
+
};
|
|
271
|
+
protoOf(AbstractUnificator).v1h = function (substitution1, substitution2, occurCheckEnabled) {
|
|
272
|
+
if (this.h8().m10() || substitution1.m10() || substitution2.m10())
|
|
264
273
|
return Companion_getInstance().failed();
|
|
265
274
|
if (!occurCheckEnabled) {
|
|
266
|
-
var quickMerge = this.
|
|
267
|
-
if (quickMerge.
|
|
275
|
+
var quickMerge = this.h8().plus(substitution1).plus(substitution2);
|
|
276
|
+
if (quickMerge.l10()) {
|
|
268
277
|
return quickMerge;
|
|
269
278
|
}
|
|
270
279
|
}
|
|
@@ -272,45 +281,43 @@
|
|
|
272
281
|
return mgu_0(this, equations, occurCheckEnabled);
|
|
273
282
|
};
|
|
274
283
|
protoOf(AbstractUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
275
|
-
return this.
|
|
284
|
+
return this.v1h(substitution1, substitution2, occurCheckEnabled);
|
|
276
285
|
};
|
|
277
|
-
function contextEquations$factory() {
|
|
278
|
-
return getPropertyCallableRef('contextEquations', 1, KProperty1, function (receiver) {
|
|
279
|
-
return _get_contextEquations__x0dd77(receiver);
|
|
280
|
-
}, null);
|
|
281
|
-
}
|
|
282
286
|
function CachedUnificator(decorated, cacheCapacity) {
|
|
283
|
-
this.
|
|
284
|
-
this.
|
|
287
|
+
this.w1h_1 = decorated;
|
|
288
|
+
this.x1h_1 = Companion_instance.wo(cacheCapacity);
|
|
285
289
|
}
|
|
286
|
-
protoOf(CachedUnificator).
|
|
290
|
+
protoOf(CachedUnificator).u1h = function (term1, term2, occurCheckEnabled) {
|
|
287
291
|
var mguRequest = new Triple(term1, term2, occurCheckEnabled);
|
|
288
|
-
var cached = this.
|
|
292
|
+
var cached = this.x1h_1.h2(mguRequest);
|
|
289
293
|
var tmp;
|
|
290
294
|
if (cached instanceof Some) {
|
|
291
|
-
tmp = cached.
|
|
295
|
+
tmp = cached.zo_1;
|
|
292
296
|
} else {
|
|
293
|
-
var mguResult = this.
|
|
294
|
-
this.
|
|
297
|
+
var mguResult = this.w1h_1.u1h(term1, term2, occurCheckEnabled);
|
|
298
|
+
this.x1h_1.xo(mguRequest, mguResult);
|
|
295
299
|
tmp = mguResult;
|
|
296
300
|
}
|
|
297
301
|
return tmp;
|
|
298
302
|
};
|
|
299
|
-
protoOf(CachedUnificator).
|
|
303
|
+
protoOf(CachedUnificator).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
304
|
+
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof CachedUnificator) ? $super : THROW_CCE());
|
|
305
|
+
};
|
|
306
|
+
protoOf(CachedUnificator).v1h = function (substitution1, substitution2, occurCheckEnabled) {
|
|
300
307
|
var mguRequest = new Triple(substitution1, substitution2, occurCheckEnabled);
|
|
301
|
-
var cached = this.
|
|
308
|
+
var cached = this.x1h_1.h2(mguRequest);
|
|
302
309
|
var tmp;
|
|
303
310
|
if (cached instanceof Some) {
|
|
304
|
-
tmp = cached.
|
|
311
|
+
tmp = cached.zo_1;
|
|
305
312
|
} else {
|
|
306
|
-
var mguResult = this.
|
|
307
|
-
this.
|
|
313
|
+
var mguResult = this.w1h_1.mergeWithOccurCheck(substitution1, substitution2, occurCheckEnabled);
|
|
314
|
+
this.x1h_1.xo(mguRequest, mguResult);
|
|
308
315
|
tmp = mguResult;
|
|
309
316
|
}
|
|
310
317
|
return tmp;
|
|
311
318
|
};
|
|
312
319
|
protoOf(CachedUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
313
|
-
return this.
|
|
320
|
+
return this.v1h(substitution1, substitution2, occurCheckEnabled);
|
|
314
321
|
};
|
|
315
322
|
function allOfLists($this, lhs, rhs, equalityChecker) {
|
|
316
323
|
var tmp = zip(lhs.unfold(), rhs.unfold());
|
|
@@ -343,7 +350,7 @@
|
|
|
343
350
|
}
|
|
344
351
|
function Equation$Companion$from$lambda($equalityChecker) {
|
|
345
352
|
return function (it) {
|
|
346
|
-
return Companion_instance_0.
|
|
353
|
+
return Companion_instance_0.y1h(it, $equalityChecker);
|
|
347
354
|
};
|
|
348
355
|
}
|
|
349
356
|
function Term$equals$ref_2() {
|
|
@@ -368,17 +375,17 @@
|
|
|
368
375
|
return l;
|
|
369
376
|
}
|
|
370
377
|
function Equation$Companion$allOfLists$lambda($equalityChecker) {
|
|
371
|
-
return function (
|
|
372
|
-
var l =
|
|
373
|
-
var r =
|
|
374
|
-
return
|
|
378
|
+
return function (_destruct__k2r9zo) {
|
|
379
|
+
var l = _destruct__k2r9zo.zb();
|
|
380
|
+
var r = _destruct__k2r9zo.ac();
|
|
381
|
+
return l.uu() && r.uu() ? sequenceOf(Companion_instance_0.t1h(l.castToCons().nw(), r.castToCons().nw(), $equalityChecker)) : l.tu() && r.tu() ? sequenceOf(Companion_instance_0.t1h(l.castToList(), r.castToList(), $equalityChecker)) : Companion_instance_0.f1h(l, r, $equalityChecker);
|
|
375
382
|
};
|
|
376
383
|
}
|
|
377
384
|
function Equation$Companion$allOfTuples$lambda($equalityChecker) {
|
|
378
|
-
return function (
|
|
379
|
-
var l =
|
|
380
|
-
var r =
|
|
381
|
-
return
|
|
385
|
+
return function (_destruct__k2r9zo) {
|
|
386
|
+
var l = _destruct__k2r9zo.zb();
|
|
387
|
+
var r = _destruct__k2r9zo.ac();
|
|
388
|
+
return l.su() && r.su() ? sequenceOf(Companion_instance_0.t1h(l.castToTuple().bw(), r.castToTuple().bw(), $equalityChecker)) : Companion_instance_0.f1h(l, r, $equalityChecker);
|
|
382
389
|
};
|
|
383
390
|
}
|
|
384
391
|
function Term$equals$ref_5() {
|
|
@@ -390,29 +397,29 @@
|
|
|
390
397
|
}
|
|
391
398
|
function Equation$Companion$allOf$lambda($equalityChecker) {
|
|
392
399
|
return function (it) {
|
|
393
|
-
return Companion_instance_0.
|
|
400
|
+
return Companion_instance_0.y1h(it, $equalityChecker);
|
|
394
401
|
};
|
|
395
402
|
}
|
|
396
403
|
function Identity(lhs, rhs) {
|
|
397
404
|
Equation.call(this, lhs, rhs);
|
|
398
|
-
this.
|
|
399
|
-
this.
|
|
405
|
+
this.b1i_1 = lhs;
|
|
406
|
+
this.c1i_1 = rhs;
|
|
400
407
|
}
|
|
401
|
-
protoOf(Identity).
|
|
402
|
-
return this.
|
|
408
|
+
protoOf(Identity).i1h = function () {
|
|
409
|
+
return this.b1i_1;
|
|
403
410
|
};
|
|
404
|
-
protoOf(Identity).
|
|
405
|
-
return this.
|
|
411
|
+
protoOf(Identity).j1h = function () {
|
|
412
|
+
return this.c1i_1;
|
|
406
413
|
};
|
|
407
|
-
protoOf(Identity).
|
|
414
|
+
protoOf(Identity).l1h = function () {
|
|
408
415
|
return true;
|
|
409
416
|
};
|
|
410
417
|
protoOf(Identity).toString = function () {
|
|
411
|
-
return 'Identity(lhs=' + this.
|
|
418
|
+
return 'Identity(lhs=' + this.b1i_1.toString() + ', rhs=' + this.c1i_1.toString() + ')';
|
|
412
419
|
};
|
|
413
420
|
protoOf(Identity).hashCode = function () {
|
|
414
|
-
var result = this.
|
|
415
|
-
result = imul(result, 31) + this.
|
|
421
|
+
var result = this.b1i_1.hashCode();
|
|
422
|
+
result = imul(result, 31) + this.c1i_1.hashCode() | 0;
|
|
416
423
|
return result;
|
|
417
424
|
};
|
|
418
425
|
protoOf(Identity).equals = function (other) {
|
|
@@ -420,45 +427,44 @@
|
|
|
420
427
|
return true;
|
|
421
428
|
if (!(other instanceof Identity))
|
|
422
429
|
return false;
|
|
423
|
-
|
|
424
|
-
if (!this.h1k_1.equals(tmp0_other_with_cast.h1k_1))
|
|
430
|
+
if (!this.b1i_1.equals(other.b1i_1))
|
|
425
431
|
return false;
|
|
426
|
-
if (!this.
|
|
432
|
+
if (!this.c1i_1.equals(other.c1i_1))
|
|
427
433
|
return false;
|
|
428
434
|
return true;
|
|
429
435
|
};
|
|
430
436
|
function Assignment(lhs, rhs) {
|
|
431
437
|
Equation.call(this, lhs, rhs);
|
|
432
|
-
this.
|
|
433
|
-
this.
|
|
438
|
+
this.q1h_1 = lhs;
|
|
439
|
+
this.r1h_1 = rhs;
|
|
434
440
|
}
|
|
435
|
-
protoOf(Assignment).
|
|
436
|
-
return this.
|
|
441
|
+
protoOf(Assignment).i1h = function () {
|
|
442
|
+
return this.q1h_1;
|
|
437
443
|
};
|
|
438
|
-
protoOf(Assignment).
|
|
439
|
-
return this.
|
|
444
|
+
protoOf(Assignment).j1h = function () {
|
|
445
|
+
return this.r1h_1;
|
|
440
446
|
};
|
|
441
447
|
protoOf(Assignment).toSubstitution = function () {
|
|
442
|
-
return Companion_getInstance().unifier(this.
|
|
448
|
+
return Companion_getInstance().unifier(this.q1h_1, this.r1h_1);
|
|
443
449
|
};
|
|
444
|
-
protoOf(Assignment).
|
|
445
|
-
return to(this.
|
|
450
|
+
protoOf(Assignment).f1i = function () {
|
|
451
|
+
return to(this.q1h_1, this.r1h_1);
|
|
446
452
|
};
|
|
447
453
|
protoOf(Assignment).toPair = function () {
|
|
448
|
-
return this.
|
|
454
|
+
return this.f1i();
|
|
449
455
|
};
|
|
450
|
-
protoOf(Assignment).
|
|
456
|
+
protoOf(Assignment).s1h = function () {
|
|
451
457
|
return true;
|
|
452
458
|
};
|
|
453
|
-
protoOf(Assignment).
|
|
459
|
+
protoOf(Assignment).d1i = function () {
|
|
454
460
|
return this;
|
|
455
461
|
};
|
|
456
462
|
protoOf(Assignment).toString = function () {
|
|
457
|
-
return 'Assignment(lhs=' + this.
|
|
463
|
+
return 'Assignment(lhs=' + this.q1h_1.toString() + ', rhs=' + this.r1h_1.toString() + ')';
|
|
458
464
|
};
|
|
459
465
|
protoOf(Assignment).hashCode = function () {
|
|
460
|
-
var result = this.
|
|
461
|
-
result = imul(result, 31) + this.
|
|
466
|
+
var result = this.q1h_1.hashCode();
|
|
467
|
+
result = imul(result, 31) + this.r1h_1.hashCode() | 0;
|
|
462
468
|
return result;
|
|
463
469
|
};
|
|
464
470
|
protoOf(Assignment).equals = function (other) {
|
|
@@ -466,33 +472,32 @@
|
|
|
466
472
|
return true;
|
|
467
473
|
if (!(other instanceof Assignment))
|
|
468
474
|
return false;
|
|
469
|
-
|
|
470
|
-
if (!this.w1j_1.equals(tmp0_other_with_cast.w1j_1))
|
|
475
|
+
if (!this.q1h_1.equals(other.q1h_1))
|
|
471
476
|
return false;
|
|
472
|
-
if (!this.
|
|
477
|
+
if (!this.r1h_1.equals(other.r1h_1))
|
|
473
478
|
return false;
|
|
474
479
|
return true;
|
|
475
480
|
};
|
|
476
481
|
function Comparison(lhs, rhs) {
|
|
477
482
|
Equation.call(this, lhs, rhs);
|
|
478
|
-
this.
|
|
479
|
-
this.
|
|
483
|
+
this.i1i_1 = lhs;
|
|
484
|
+
this.j1i_1 = rhs;
|
|
480
485
|
}
|
|
481
|
-
protoOf(Comparison).
|
|
482
|
-
return this.
|
|
486
|
+
protoOf(Comparison).i1h = function () {
|
|
487
|
+
return this.i1i_1;
|
|
483
488
|
};
|
|
484
|
-
protoOf(Comparison).
|
|
485
|
-
return this.
|
|
489
|
+
protoOf(Comparison).j1h = function () {
|
|
490
|
+
return this.j1i_1;
|
|
486
491
|
};
|
|
487
|
-
protoOf(Comparison).
|
|
492
|
+
protoOf(Comparison).m1h = function () {
|
|
488
493
|
return true;
|
|
489
494
|
};
|
|
490
495
|
protoOf(Comparison).toString = function () {
|
|
491
|
-
return 'Comparison(lhs=' + this.
|
|
496
|
+
return 'Comparison(lhs=' + this.i1i_1.toString() + ', rhs=' + this.j1i_1.toString() + ')';
|
|
492
497
|
};
|
|
493
498
|
protoOf(Comparison).hashCode = function () {
|
|
494
|
-
var result = this.
|
|
495
|
-
result = imul(result, 31) + this.
|
|
499
|
+
var result = this.i1i_1.hashCode();
|
|
500
|
+
result = imul(result, 31) + this.j1i_1.hashCode() | 0;
|
|
496
501
|
return result;
|
|
497
502
|
};
|
|
498
503
|
protoOf(Comparison).equals = function (other) {
|
|
@@ -500,33 +505,32 @@
|
|
|
500
505
|
return true;
|
|
501
506
|
if (!(other instanceof Comparison))
|
|
502
507
|
return false;
|
|
503
|
-
|
|
504
|
-
if (!this.o1k_1.equals(tmp0_other_with_cast.o1k_1))
|
|
508
|
+
if (!this.i1i_1.equals(other.i1i_1))
|
|
505
509
|
return false;
|
|
506
|
-
if (!this.
|
|
510
|
+
if (!this.j1i_1.equals(other.j1i_1))
|
|
507
511
|
return false;
|
|
508
512
|
return true;
|
|
509
513
|
};
|
|
510
514
|
function Contradiction(lhs, rhs) {
|
|
511
515
|
Equation.call(this, lhs, rhs);
|
|
512
|
-
this.
|
|
513
|
-
this.
|
|
516
|
+
this.m1i_1 = lhs;
|
|
517
|
+
this.n1i_1 = rhs;
|
|
514
518
|
}
|
|
515
|
-
protoOf(Contradiction).
|
|
516
|
-
return this.
|
|
519
|
+
protoOf(Contradiction).i1h = function () {
|
|
520
|
+
return this.m1i_1;
|
|
517
521
|
};
|
|
518
|
-
protoOf(Contradiction).
|
|
519
|
-
return this.
|
|
522
|
+
protoOf(Contradiction).j1h = function () {
|
|
523
|
+
return this.n1i_1;
|
|
520
524
|
};
|
|
521
|
-
protoOf(Contradiction).
|
|
525
|
+
protoOf(Contradiction).k1h = function () {
|
|
522
526
|
return true;
|
|
523
527
|
};
|
|
524
528
|
protoOf(Contradiction).toString = function () {
|
|
525
|
-
return 'Contradiction(lhs=' + this.
|
|
529
|
+
return 'Contradiction(lhs=' + this.m1i_1.toString() + ', rhs=' + this.n1i_1.toString() + ')';
|
|
526
530
|
};
|
|
527
531
|
protoOf(Contradiction).hashCode = function () {
|
|
528
|
-
var result = this.
|
|
529
|
-
result = imul(result, 31) + this.
|
|
532
|
+
var result = this.m1i_1.hashCode();
|
|
533
|
+
result = imul(result, 31) + this.n1i_1.hashCode() | 0;
|
|
530
534
|
return result;
|
|
531
535
|
};
|
|
532
536
|
protoOf(Contradiction).equals = function (other) {
|
|
@@ -534,18 +538,17 @@
|
|
|
534
538
|
return true;
|
|
535
539
|
if (!(other instanceof Contradiction))
|
|
536
540
|
return false;
|
|
537
|
-
|
|
538
|
-
if (!this.s1k_1.equals(tmp0_other_with_cast.s1k_1))
|
|
541
|
+
if (!this.m1i_1.equals(other.m1i_1))
|
|
539
542
|
return false;
|
|
540
|
-
if (!this.
|
|
543
|
+
if (!this.n1i_1.equals(other.n1i_1))
|
|
541
544
|
return false;
|
|
542
545
|
return true;
|
|
543
546
|
};
|
|
544
547
|
function Companion() {
|
|
545
548
|
}
|
|
546
|
-
protoOf(Companion).
|
|
549
|
+
protoOf(Companion).t1h = function (lhs, rhs, equalityChecker) {
|
|
547
550
|
var tmp;
|
|
548
|
-
if (lhs.
|
|
551
|
+
if (lhs.dv() && rhs.dv()) {
|
|
549
552
|
var tmp_0;
|
|
550
553
|
if (equalityChecker(lhs, rhs)) {
|
|
551
554
|
tmp_0 = new Identity(lhs, rhs);
|
|
@@ -553,11 +556,11 @@
|
|
|
553
556
|
tmp_0 = new Assignment(lhs.castToVar(), rhs);
|
|
554
557
|
}
|
|
555
558
|
tmp = tmp_0;
|
|
556
|
-
} else if (lhs.
|
|
559
|
+
} else if (lhs.dv()) {
|
|
557
560
|
tmp = new Assignment(lhs.castToVar(), rhs);
|
|
558
|
-
} else if (rhs.
|
|
561
|
+
} else if (rhs.dv()) {
|
|
559
562
|
tmp = new Assignment(rhs.castToVar(), lhs);
|
|
560
|
-
} else if (lhs.
|
|
563
|
+
} else if (lhs.gv() && rhs.gv()) {
|
|
561
564
|
var tmp_1;
|
|
562
565
|
if (equalityChecker(lhs, rhs)) {
|
|
563
566
|
tmp_1 = new Identity(lhs, rhs);
|
|
@@ -565,13 +568,13 @@
|
|
|
565
568
|
tmp_1 = new Contradiction(lhs, rhs);
|
|
566
569
|
}
|
|
567
570
|
tmp = tmp_1;
|
|
568
|
-
} else if (lhs.
|
|
571
|
+
} else if (lhs.gv() || rhs.gv()) {
|
|
569
572
|
tmp = new Contradiction(lhs, rhs);
|
|
570
|
-
} else if (lhs.
|
|
573
|
+
} else if (lhs.nu() && rhs.nu()) {
|
|
571
574
|
var lhsStruct = lhs.castToStruct();
|
|
572
575
|
var rhsStruct = rhs.castToStruct();
|
|
573
576
|
var tmp_2;
|
|
574
|
-
if (!(lhsStruct.
|
|
577
|
+
if (!(lhsStruct.bu() === rhsStruct.bu()) || !(lhsStruct.hu() === rhsStruct.hu())) {
|
|
575
578
|
tmp_2 = new Contradiction(lhsStruct, rhsStruct);
|
|
576
579
|
} else {
|
|
577
580
|
tmp_2 = new Comparison(lhsStruct, rhsStruct);
|
|
@@ -590,10 +593,10 @@
|
|
|
590
593
|
tmp = equalityChecker;
|
|
591
594
|
}
|
|
592
595
|
equalityChecker = tmp;
|
|
593
|
-
return $super === VOID ? this.
|
|
596
|
+
return $super === VOID ? this.t1h(lhs, rhs, equalityChecker) : $super.t1h.call(this, lhs, rhs, equalityChecker);
|
|
594
597
|
};
|
|
595
|
-
protoOf(Companion).
|
|
596
|
-
return this.
|
|
598
|
+
protoOf(Companion).o1i = function (pair, equalityChecker) {
|
|
599
|
+
return this.t1h(pair.fc_1, pair.gc_1, equalityChecker);
|
|
597
600
|
};
|
|
598
601
|
protoOf(Companion).ofPair = function (pair, equalityChecker, $super) {
|
|
599
602
|
var tmp;
|
|
@@ -603,9 +606,9 @@
|
|
|
603
606
|
tmp = equalityChecker;
|
|
604
607
|
}
|
|
605
608
|
equalityChecker = tmp;
|
|
606
|
-
return $super === VOID ? this.
|
|
609
|
+
return $super === VOID ? this.o1i(pair, equalityChecker) : $super.o1i.call(this, pair, equalityChecker);
|
|
607
610
|
};
|
|
608
|
-
protoOf(Companion).
|
|
611
|
+
protoOf(Companion).p1i = function (pairs, equalityChecker) {
|
|
609
612
|
return flatMap(pairs, Equation$Companion$from$lambda(equalityChecker));
|
|
610
613
|
};
|
|
611
614
|
protoOf(Companion).fromSequence = function (pairs, equalityChecker, $super) {
|
|
@@ -616,10 +619,10 @@
|
|
|
616
619
|
tmp = equalityChecker;
|
|
617
620
|
}
|
|
618
621
|
equalityChecker = tmp;
|
|
619
|
-
return $super === VOID ? this.
|
|
622
|
+
return $super === VOID ? this.p1i(pairs, equalityChecker) : $super.p1i.call(this, pairs, equalityChecker);
|
|
620
623
|
};
|
|
621
|
-
protoOf(Companion).
|
|
622
|
-
return this.
|
|
624
|
+
protoOf(Companion).q1i = function (pairs, equalityChecker) {
|
|
625
|
+
return this.p1i(asSequence_0(pairs), equalityChecker);
|
|
623
626
|
};
|
|
624
627
|
protoOf(Companion).fromIterable = function (pairs, equalityChecker, $super) {
|
|
625
628
|
var tmp;
|
|
@@ -629,10 +632,10 @@
|
|
|
629
632
|
tmp = equalityChecker;
|
|
630
633
|
}
|
|
631
634
|
equalityChecker = tmp;
|
|
632
|
-
return $super === VOID ? this.
|
|
635
|
+
return $super === VOID ? this.q1i(pairs, equalityChecker) : $super.q1i.call(this, pairs, equalityChecker);
|
|
633
636
|
};
|
|
634
|
-
protoOf(Companion).
|
|
635
|
-
return this.
|
|
637
|
+
protoOf(Companion).r1i = function (pairs, equalityChecker) {
|
|
638
|
+
return this.p1i(sequenceOf_0(pairs.slice()), equalityChecker);
|
|
636
639
|
};
|
|
637
640
|
protoOf(Companion).from = function (pairs, equalityChecker, $super) {
|
|
638
641
|
var tmp;
|
|
@@ -642,10 +645,10 @@
|
|
|
642
645
|
tmp = equalityChecker;
|
|
643
646
|
}
|
|
644
647
|
equalityChecker = tmp;
|
|
645
|
-
return $super === VOID ? this.
|
|
648
|
+
return $super === VOID ? this.r1i(pairs, equalityChecker) : $super.r1i.call(this, pairs, equalityChecker);
|
|
646
649
|
};
|
|
647
|
-
protoOf(Companion).
|
|
648
|
-
return this.
|
|
650
|
+
protoOf(Companion).y1h = function (pair, equalityChecker) {
|
|
651
|
+
return this.f1h(pair.fc_1, pair.gc_1, equalityChecker);
|
|
649
652
|
};
|
|
650
653
|
protoOf(Companion).allOfPair = function (pair, equalityChecker, $super) {
|
|
651
654
|
var tmp;
|
|
@@ -655,29 +658,29 @@
|
|
|
655
658
|
tmp = equalityChecker;
|
|
656
659
|
}
|
|
657
660
|
equalityChecker = tmp;
|
|
658
|
-
return $super === VOID ? this.
|
|
661
|
+
return $super === VOID ? this.y1h(pair, equalityChecker) : $super.y1h.call(this, pair, equalityChecker);
|
|
659
662
|
};
|
|
660
|
-
protoOf(Companion).
|
|
663
|
+
protoOf(Companion).f1h = function (lhs, rhs, equalityChecker) {
|
|
661
664
|
var tmp;
|
|
662
|
-
if (lhs.
|
|
663
|
-
tmp = sequenceOf(
|
|
664
|
-
} else if (lhs.
|
|
665
|
+
if (lhs.cu() && rhs.cu()) {
|
|
666
|
+
tmp = sequenceOf(this.t1h(lhs, rhs, equalityChecker));
|
|
667
|
+
} else if (lhs.tu() && rhs.tu()) {
|
|
665
668
|
tmp = allOfLists(this, lhs.castToList(), rhs.castToList(), equalityChecker);
|
|
666
|
-
} else if (lhs.
|
|
669
|
+
} else if (lhs.su() && rhs.su()) {
|
|
667
670
|
tmp = allOfTuples(this, lhs.castToTuple(), rhs.castToTuple(), equalityChecker);
|
|
668
|
-
} else if (lhs.
|
|
671
|
+
} else if (lhs.nu() && rhs.nu()) {
|
|
669
672
|
var lhsStruct = lhs.castToStruct();
|
|
670
673
|
var rhsStruct = rhs.castToStruct();
|
|
671
674
|
var tmp_0;
|
|
672
|
-
if (lhsStruct.
|
|
673
|
-
var tmp_1 = zip(lhsStruct.
|
|
675
|
+
if (lhsStruct.bu() === rhsStruct.bu() && lhsStruct.hu() === rhsStruct.hu()) {
|
|
676
|
+
var tmp_1 = zip(lhsStruct.av(), rhsStruct.av());
|
|
674
677
|
tmp_0 = flatMap(tmp_1, Equation$Companion$allOf$lambda(equalityChecker));
|
|
675
678
|
} else {
|
|
676
|
-
tmp_0 = sequenceOf(
|
|
679
|
+
tmp_0 = sequenceOf(this.t1h(lhs, rhs, equalityChecker));
|
|
677
680
|
}
|
|
678
681
|
tmp = tmp_0;
|
|
679
682
|
} else {
|
|
680
|
-
tmp = sequenceOf(
|
|
683
|
+
tmp = sequenceOf(this.t1h(lhs, rhs, equalityChecker));
|
|
681
684
|
}
|
|
682
685
|
return tmp;
|
|
683
686
|
};
|
|
@@ -689,7 +692,7 @@
|
|
|
689
692
|
tmp = equalityChecker;
|
|
690
693
|
}
|
|
691
694
|
equalityChecker = tmp;
|
|
692
|
-
return $super === VOID ? this.
|
|
695
|
+
return $super === VOID ? this.f1h(lhs, rhs, equalityChecker) : $super.f1h.call(this, lhs, rhs, equalityChecker);
|
|
693
696
|
};
|
|
694
697
|
var Companion_instance_0;
|
|
695
698
|
function Companion_getInstance_1() {
|
|
@@ -703,54 +706,54 @@
|
|
|
703
706
|
return l;
|
|
704
707
|
}
|
|
705
708
|
function Equation(lhs, rhs) {
|
|
706
|
-
this.
|
|
707
|
-
this.
|
|
709
|
+
this.g1h_1 = lhs;
|
|
710
|
+
this.h1h_1 = rhs;
|
|
708
711
|
}
|
|
709
|
-
protoOf(Equation).
|
|
710
|
-
return this.
|
|
712
|
+
protoOf(Equation).i1h = function () {
|
|
713
|
+
return this.g1h_1;
|
|
711
714
|
};
|
|
712
|
-
protoOf(Equation).
|
|
713
|
-
return this.
|
|
715
|
+
protoOf(Equation).j1h = function () {
|
|
716
|
+
return this.h1h_1;
|
|
714
717
|
};
|
|
715
|
-
protoOf(Equation).
|
|
718
|
+
protoOf(Equation).l1h = function () {
|
|
716
719
|
return false;
|
|
717
720
|
};
|
|
718
|
-
protoOf(Equation).
|
|
721
|
+
protoOf(Equation).s1h = function () {
|
|
719
722
|
return false;
|
|
720
723
|
};
|
|
721
|
-
protoOf(Equation).
|
|
724
|
+
protoOf(Equation).d1i = function () {
|
|
722
725
|
return null;
|
|
723
726
|
};
|
|
724
|
-
protoOf(Equation).
|
|
725
|
-
var tmp0_elvis_lhs = this.
|
|
727
|
+
protoOf(Equation).n1h = function () {
|
|
728
|
+
var tmp0_elvis_lhs = this.d1i();
|
|
726
729
|
var tmp;
|
|
727
730
|
if (tmp0_elvis_lhs == null) {
|
|
728
|
-
throw ClassCastException_init_$Create$('Cannot cast ' + this + ' to ' + getKClass(Assignment).
|
|
731
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(Assignment).b9());
|
|
729
732
|
} else {
|
|
730
733
|
tmp = tmp0_elvis_lhs;
|
|
731
734
|
}
|
|
732
735
|
return tmp;
|
|
733
736
|
};
|
|
734
|
-
protoOf(Equation).
|
|
737
|
+
protoOf(Equation).m1h = function () {
|
|
735
738
|
return false;
|
|
736
739
|
};
|
|
737
|
-
protoOf(Equation).
|
|
740
|
+
protoOf(Equation).k1h = function () {
|
|
738
741
|
return false;
|
|
739
742
|
};
|
|
740
|
-
protoOf(Equation).
|
|
741
|
-
return Companion_getInstance_0().of('=', [this.
|
|
743
|
+
protoOf(Equation).l1g = function () {
|
|
744
|
+
return Companion_getInstance_0().of('=', [this.i1h(), this.j1h()]);
|
|
742
745
|
};
|
|
743
746
|
protoOf(Equation).toTerm = function () {
|
|
744
|
-
return this.
|
|
747
|
+
return this.l1g();
|
|
745
748
|
};
|
|
746
749
|
protoOf(Equation).toPair = function () {
|
|
747
|
-
return new Pair(this.
|
|
750
|
+
return new Pair(this.i1h(), this.j1h());
|
|
748
751
|
};
|
|
749
752
|
protoOf(Equation).swap = function () {
|
|
750
|
-
return Companion_instance_0.of(this.
|
|
753
|
+
return Companion_instance_0.of(this.j1h(), this.i1h());
|
|
751
754
|
};
|
|
752
|
-
protoOf(Equation).
|
|
753
|
-
return Companion_instance_0.
|
|
755
|
+
protoOf(Equation).e1i = function (substitution, equalityChecker) {
|
|
756
|
+
return Companion_instance_0.t1h(this.i1h().getSubstituted(substitution, []), this.j1h().getSubstituted(substitution, []), equalityChecker);
|
|
754
757
|
};
|
|
755
758
|
protoOf(Equation).apply = function (substitution, equalityChecker, $super) {
|
|
756
759
|
var tmp;
|
|
@@ -760,23 +763,22 @@
|
|
|
760
763
|
tmp = equalityChecker;
|
|
761
764
|
}
|
|
762
765
|
equalityChecker = tmp;
|
|
763
|
-
return $super === VOID ? this.
|
|
766
|
+
return $super === VOID ? this.e1i(substitution, equalityChecker) : $super.e1i.call(this, substitution, equalityChecker);
|
|
764
767
|
};
|
|
765
768
|
function toEquations(_this__u8e3s4) {
|
|
766
769
|
// Inline function 'kotlin.collections.map' call
|
|
767
|
-
var this_0 = _this__u8e3s4.
|
|
770
|
+
var this_0 = _this__u8e3s4.e1();
|
|
768
771
|
// Inline function 'kotlin.collections.mapTo' call
|
|
769
772
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
770
|
-
var
|
|
771
|
-
while (
|
|
772
|
-
var item =
|
|
773
|
-
// Inline function 'it.unibo.tuprolog.unify.toEquations.<anonymous>' call
|
|
773
|
+
var _iterator__ex2g4s = this_0.p();
|
|
774
|
+
while (_iterator__ex2g4s.s()) {
|
|
775
|
+
var item = _iterator__ex2g4s.t();
|
|
774
776
|
// Inline function 'kotlin.collections.component1' call
|
|
775
|
-
var variable = item.
|
|
777
|
+
var variable = item.d2();
|
|
776
778
|
// Inline function 'kotlin.collections.component2' call
|
|
777
|
-
var term = item.
|
|
779
|
+
var term = item.e2();
|
|
778
780
|
var tmp$ret$2 = new Assignment(variable, term);
|
|
779
|
-
destination.
|
|
781
|
+
destination.m(tmp$ret$2);
|
|
780
782
|
}
|
|
781
783
|
return destination;
|
|
782
784
|
}
|
|
@@ -787,14 +789,14 @@
|
|
|
787
789
|
}
|
|
788
790
|
function toAssignmentPair(_this__u8e3s4) {
|
|
789
791
|
var tmp;
|
|
790
|
-
if (_this__u8e3s4.
|
|
791
|
-
tmp = _this__u8e3s4.
|
|
792
|
-
} else if (_this__u8e3s4.
|
|
793
|
-
tmp = to(_this__u8e3s4.
|
|
794
|
-
} else if (_this__u8e3s4.
|
|
795
|
-
tmp = to(_this__u8e3s4.
|
|
792
|
+
if (_this__u8e3s4.s1h()) {
|
|
793
|
+
tmp = _this__u8e3s4.n1h().f1i();
|
|
794
|
+
} else if (_this__u8e3s4.i1h().dv()) {
|
|
795
|
+
tmp = to(_this__u8e3s4.i1h().castToVar(), _this__u8e3s4.j1h());
|
|
796
|
+
} else if (_this__u8e3s4.j1h().dv()) {
|
|
797
|
+
tmp = to(_this__u8e3s4.j1h().castToVar(), _this__u8e3s4.i1h());
|
|
796
798
|
} else {
|
|
797
|
-
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + _this__u8e3s4);
|
|
799
|
+
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + toString(_this__u8e3s4));
|
|
798
800
|
}
|
|
799
801
|
return tmp;
|
|
800
802
|
}
|
|
@@ -804,49 +806,61 @@
|
|
|
804
806
|
function Unificator$Companion$default$delegate$lambda() {
|
|
805
807
|
return Companion_getInstance_2().strict();
|
|
806
808
|
}
|
|
809
|
+
function Unificator$Companion$_get_default_$ref_8i2tx3() {
|
|
810
|
+
return function (p0) {
|
|
811
|
+
return p0.u1i();
|
|
812
|
+
};
|
|
813
|
+
}
|
|
807
814
|
function Unificator$Companion$naive$1($context) {
|
|
808
815
|
AbstractUnificator.call(this, $context);
|
|
809
816
|
}
|
|
810
|
-
protoOf(Unificator$Companion$naive$1).
|
|
817
|
+
protoOf(Unificator$Companion$naive$1).e1h = function (first, second) {
|
|
811
818
|
var tmp;
|
|
812
|
-
if (first.
|
|
813
|
-
tmp = first.castToInteger().
|
|
814
|
-
} else if (first.
|
|
815
|
-
tmp = first.castToNumeric().
|
|
819
|
+
if (first.iv() && second.iv()) {
|
|
820
|
+
tmp = first.castToInteger().e2().dj(second.castToInteger().e2()) === 0;
|
|
821
|
+
} else if (first.hv() && second.hv()) {
|
|
822
|
+
tmp = first.castToNumeric().xy().ui(second.castToNumeric().xy()) === 0;
|
|
816
823
|
} else {
|
|
817
824
|
tmp = first.equals(second);
|
|
818
825
|
}
|
|
819
826
|
return tmp;
|
|
820
827
|
};
|
|
828
|
+
protoOf(Unificator$Companion$naive$1).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
829
|
+
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof Unificator$Companion$naive$1) ? $super : THROW_CCE());
|
|
830
|
+
};
|
|
821
831
|
function Unificator$Companion$strict$1($context) {
|
|
822
832
|
AbstractUnificator.call(this, $context);
|
|
823
833
|
}
|
|
824
|
-
protoOf(Unificator$Companion$strict$1).
|
|
834
|
+
protoOf(Unificator$Companion$strict$1).e1h = function (first, second) {
|
|
825
835
|
return first.equals(second);
|
|
826
836
|
};
|
|
837
|
+
protoOf(Unificator$Companion$strict$1).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
838
|
+
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof Unificator$Companion$strict$1) ? $super : THROW_CCE());
|
|
839
|
+
};
|
|
827
840
|
function Companion_0() {
|
|
828
841
|
Companion_instance_1 = this;
|
|
829
842
|
var tmp = this;
|
|
830
|
-
tmp.
|
|
831
|
-
this.
|
|
843
|
+
tmp.s1i_1 = lazy(Unificator$Companion$default$delegate$lambda);
|
|
844
|
+
this.t1i_1 = 32;
|
|
832
845
|
}
|
|
833
|
-
protoOf(Companion_0).
|
|
846
|
+
protoOf(Companion_0).u1i = function () {
|
|
847
|
+
var tmp0 = this.s1i_1;
|
|
848
|
+
var tmp = KProperty1;
|
|
834
849
|
// Inline function 'kotlin.getValue' call
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
return this_0.r2();
|
|
850
|
+
getPropertyCallableRef('default', 1, tmp, Unificator$Companion$_get_default_$ref_8i2tx3(), null);
|
|
851
|
+
return tmp0.e2();
|
|
838
852
|
};
|
|
839
853
|
protoOf(Companion_0).mguWith = function (_this__u8e3s4, other) {
|
|
840
|
-
return this.
|
|
854
|
+
return this.u1i().mgu(_this__u8e3s4, other);
|
|
841
855
|
};
|
|
842
856
|
protoOf(Companion_0).matches = function (_this__u8e3s4, other) {
|
|
843
|
-
return this.
|
|
857
|
+
return this.u1i().match(_this__u8e3s4, other);
|
|
844
858
|
};
|
|
845
859
|
protoOf(Companion_0).unifyWith = function (_this__u8e3s4, other) {
|
|
846
|
-
return this.
|
|
860
|
+
return this.u1i().unify(_this__u8e3s4, other);
|
|
847
861
|
};
|
|
848
862
|
protoOf(Companion_0).mergeWith = function (_this__u8e3s4, other) {
|
|
849
|
-
return this.
|
|
863
|
+
return this.u1i().merge(_this__u8e3s4, other);
|
|
850
864
|
};
|
|
851
865
|
protoOf(Companion_0).naiveWithContext = function (context) {
|
|
852
866
|
return new Unificator$Companion$naive$1(context);
|
|
@@ -860,10 +874,10 @@
|
|
|
860
874
|
protoOf(Companion_0).strict = function () {
|
|
861
875
|
return this.strictWithContext(Companion_getInstance().empty());
|
|
862
876
|
};
|
|
863
|
-
protoOf(Companion_0).
|
|
877
|
+
protoOf(Companion_0).z1i = function (other, capacity) {
|
|
864
878
|
var tmp;
|
|
865
879
|
if (other instanceof CachedUnificator) {
|
|
866
|
-
tmp = new CachedUnificator(other.
|
|
880
|
+
tmp = new CachedUnificator(other.w1h_1, capacity);
|
|
867
881
|
} else {
|
|
868
882
|
tmp = new CachedUnificator(other, capacity);
|
|
869
883
|
}
|
|
@@ -871,7 +885,7 @@
|
|
|
871
885
|
};
|
|
872
886
|
protoOf(Companion_0).cached = function (other, capacity, $super) {
|
|
873
887
|
capacity = capacity === VOID ? 32 : capacity;
|
|
874
|
-
return $super === VOID ? this.
|
|
888
|
+
return $super === VOID ? this.z1i(other, capacity) : $super.z1i.call(this, other, capacity);
|
|
875
889
|
};
|
|
876
890
|
var Companion_instance_1;
|
|
877
891
|
function Companion_getInstance_2() {
|
|
@@ -881,32 +895,29 @@
|
|
|
881
895
|
}
|
|
882
896
|
function Unificator() {
|
|
883
897
|
}
|
|
884
|
-
function default$factory() {
|
|
885
|
-
return getPropertyCallableRef('default', 1, KProperty1, function (receiver) {
|
|
886
|
-
return receiver.e1l();
|
|
887
|
-
}, null);
|
|
888
|
-
}
|
|
889
898
|
//region block: post-declaration
|
|
899
|
+
protoOf(AbstractUnificator).mguWithOccurCheck = mguWithOccurCheck;
|
|
890
900
|
protoOf(AbstractUnificator).mgu = mgu;
|
|
891
901
|
protoOf(AbstractUnificator).matchWithOccurCheck = matchWithOccurCheck;
|
|
892
902
|
protoOf(AbstractUnificator).match = match;
|
|
893
903
|
protoOf(AbstractUnificator).unifyWithOccurCheck = unifyWithOccurCheck;
|
|
894
904
|
protoOf(AbstractUnificator).unify = unify;
|
|
895
905
|
protoOf(AbstractUnificator).merge = merge;
|
|
906
|
+
protoOf(CachedUnificator).mguWithOccurCheck = mguWithOccurCheck;
|
|
896
907
|
protoOf(CachedUnificator).mgu = mgu;
|
|
897
908
|
protoOf(CachedUnificator).matchWithOccurCheck = matchWithOccurCheck;
|
|
898
909
|
protoOf(CachedUnificator).match = match;
|
|
899
910
|
protoOf(CachedUnificator).unifyWithOccurCheck = unifyWithOccurCheck;
|
|
900
911
|
protoOf(CachedUnificator).unify = unify;
|
|
901
912
|
protoOf(CachedUnificator).merge = merge;
|
|
902
|
-
protoOf(Equation).
|
|
913
|
+
protoOf(Equation).gp = castTo;
|
|
903
914
|
defineProp(protoOf(Equation), 'lhs', function () {
|
|
904
|
-
return this.
|
|
915
|
+
return this.i1h();
|
|
905
916
|
});
|
|
906
917
|
defineProp(protoOf(Equation), 'rhs', function () {
|
|
907
|
-
return this.
|
|
918
|
+
return this.j1h();
|
|
908
919
|
});
|
|
909
|
-
defineProp(protoOf(Companion_0), 'default', protoOf(Companion_0).
|
|
920
|
+
defineProp(protoOf(Companion_0), 'default', protoOf(Companion_0).u1i);
|
|
910
921
|
//endregion
|
|
911
922
|
//region block: init
|
|
912
923
|
Companion_instance_0 = new Companion();
|