@tuprolog/2p-full 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2p-bdd.js +204 -201
- package/2p-bdd.js.map +1 -1
- package/2p-core.js +3668 -4128
- package/2p-core.js.map +1 -1
- package/2p-datalog.js +3 -3
- package/2p-datalog.js.map +1 -1
- package/2p-dsl-core.js +3 -3
- package/2p-dsl-core.js.map +1 -1
- package/2p-dsl-solve.js +3 -3
- package/2p-dsl-solve.js.map +1 -1
- package/2p-dsl-theory.js +3 -3
- package/2p-dsl-theory.js.map +1 -1
- package/2p-dsl-unify.js +3 -3
- package/2p-dsl-unify.js.map +1 -1
- package/2p-full.js +9 -19
- package/2p-full.js.map +1 -1
- package/2p-io-lib.js +6 -3321
- package/2p-io-lib.js.map +1 -1
- package/2p-oop-lib.js +6 -3435
- package/2p-oop-lib.js.map +1 -1
- package/2p-parser-core.js +6 -1266
- package/2p-parser-core.js.map +1 -1
- package/2p-parser-js.js +6 -30
- package/2p-parser-js.js.map +1 -1
- package/2p-parser-theory.js +6 -126
- package/2p-parser-theory.js.map +1 -1
- package/2p-repl.js +6 -499
- package/2p-repl.js.map +1 -1
- package/2p-serialize-core.js +3 -3
- package/2p-serialize-core.js.map +1 -1
- package/2p-serialize-theory.js +3 -3
- package/2p-serialize-theory.js.map +1 -1
- package/2p-solve-classic.js +1216 -1203
- package/2p-solve-classic.js.map +1 -1
- package/2p-solve-concurrent.js +3 -3
- package/2p-solve-concurrent.js.map +1 -1
- package/2p-solve-plp.js +8 -8
- package/2p-solve-plp.js.map +1 -1
- package/2p-solve-problog.js +2095 -2140
- package/2p-solve-problog.js.map +1 -1
- package/2p-solve-streams.js +1244 -1333
- package/2p-solve-streams.js.map +1 -1
- package/2p-solve.js +5185 -6393
- package/2p-solve.js.map +1 -1
- package/2p-test-dsl.js +3 -3
- package/2p-test-dsl.js.map +1 -1
- package/2p-theory.js +2091 -1992
- package/2p-theory.js.map +1 -1
- package/2p-unify.js +315 -300
- package/2p-unify.js.map +1 -1
- package/2p-utils.js +625 -635
- package/2p-utils.js.map +1 -1
- package/clikt-clikt-mordant.js +15 -0
- package/clikt-clikt-mordant.js.map +1 -0
- package/clikt-clikt.js +15 -0
- package/clikt-clikt.js.map +1 -0
- package/colormath-root-colormath.js +15 -0
- package/colormath-root-colormath.js.map +1 -0
- package/kotlin-kotlin-stdlib.js +6829 -8585
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kotlin-kotlin-test.js +15 -0
- package/kotlin-kotlin-test.js.map +1 -0
- 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/kotlinx-atomicfu.js +15 -0
- package/kotlinx-atomicfu.js.map +1 -0
- package/kotlinx-coroutines-core.js +15 -0
- package/kotlinx-coroutines-core.js.map +1 -0
- package/kt-math.js +3143 -3508
- package/kt-math.js.map +1 -1
- package/mordant-mordant-omnibus.js +15 -0
- package/mordant-mordant-omnibus.js.map +1 -0
- package/mordant-mordant.js +19 -0
- package/mordant-mordant.js.map +1 -0
- package/package.json +2 -3
- package/88b0986a7186d029-atomicfu-js-ir.js +0 -15
- package/88b0986a7186d029-atomicfu-js-ir.js.map +0 -1
- package/clikt-clikt-js-ir.js +0 -6006
- package/clikt-clikt-js-ir.js.map +0 -1
- package/kotlin-kotlin-test-kotlin-test-js-ir.js +0 -15
- package/kotlin-kotlin-test-kotlin-test-js-ir.js.map +0 -1
- package/kotlin-kotlinx-atomicfu-runtime-js-ir.js +0 -15
- package/kotlin-kotlinx-atomicfu-runtime-js-ir.js.map +0 -1
- package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js +0 -15
- package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js.map +0 -1
package/2p-unify.js
CHANGED
|
@@ -1,73 +1,78 @@
|
|
|
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
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
22
|
+
var KProperty1 = kotlin_kotlin.$_$.c7;
|
|
23
|
+
var getPropertyCallableRef = kotlin_kotlin.$_$.q5;
|
|
24
|
+
var asSequence = kotlin_kotlin.$_$.v1;
|
|
25
|
+
var plus = kotlin_kotlin.$_$.g8;
|
|
26
|
+
var map = kotlin_kotlin.$_$.c8;
|
|
27
|
+
var Unit_instance = kotlin_kotlin.$_$.k1;
|
|
28
|
+
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.v;
|
|
29
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.d;
|
|
30
|
+
var toCollection = kotlin_kotlin.$_$.o8;
|
|
31
|
+
var Pair = kotlin_kotlin.$_$.ca;
|
|
32
|
+
var VOID = kotlin_kotlin.$_$.b;
|
|
33
|
+
var lazy = kotlin_kotlin.$_$.ja;
|
|
34
|
+
var protoOf = kotlin_kotlin.$_$.k6;
|
|
35
|
+
var asSequence_0 = kotlin_kotlin.$_$.w1;
|
|
36
|
+
var THROW_CCE = kotlin_kotlin.$_$.ea;
|
|
37
|
+
var initMetadataForClass = kotlin_kotlin.$_$.t5;
|
|
38
38
|
var Companion_instance = kotlin_it_unibo_tuprolog_utils.$_$.a;
|
|
39
|
-
var Triple = kotlin_kotlin.$_$.
|
|
39
|
+
var Triple = kotlin_kotlin.$_$.ga;
|
|
40
40
|
var Some = kotlin_it_unibo_tuprolog_utils.$_$.k;
|
|
41
|
-
var zip = kotlin_kotlin.$_$.
|
|
42
|
-
var flatMap = kotlin_kotlin.$_$.
|
|
43
|
-
var sequenceOf = kotlin_kotlin.$_$.
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
41
|
+
var zip = kotlin_kotlin.$_$.v8;
|
|
42
|
+
var flatMap = kotlin_kotlin.$_$.t7;
|
|
43
|
+
var sequenceOf = kotlin_kotlin.$_$.j8;
|
|
44
|
+
var to = kotlin_kotlin.$_$.pa;
|
|
45
|
+
var sequenceOf_0 = kotlin_kotlin.$_$.i8;
|
|
46
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.u5;
|
|
47
|
+
var toString = kotlin_kotlin.$_$.n6;
|
|
48
|
+
var getKClass = kotlin_kotlin.$_$.b7;
|
|
49
|
+
var ClassCastException_init_$Create$ = kotlin_kotlin.$_$.o;
|
|
50
|
+
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.u;
|
|
51
|
+
var castTo = kotlin_it_unibo_tuprolog_utils.$_$.e;
|
|
52
|
+
var defineProp = kotlin_kotlin.$_$.l5;
|
|
53
|
+
var Castable = kotlin_it_unibo_tuprolog_utils.$_$.f;
|
|
54
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.z1;
|
|
55
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.c;
|
|
56
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.q;
|
|
57
|
+
var initMetadataForInterface = kotlin_kotlin.$_$.w5;
|
|
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.g1h(term1, term2, occurCheckEnabled) : $super.g1h.call(this, term1, term2, occurCheckEnabled);
|
|
63
|
+
}
|
|
59
64
|
function mgu(term1, term2) {
|
|
60
|
-
return this.
|
|
65
|
+
return this.g1h(term1, term2, true);
|
|
61
66
|
}
|
|
62
67
|
function matchWithOccurCheck(term1, term2, occurCheckEnabled) {
|
|
63
|
-
return !(this.
|
|
68
|
+
return !(this.g1h(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.g1h(term1, term2, occurCheckEnabled);
|
|
75
|
+
return substitution.g10() ? null : term1.getSubstituted(substitution, []);
|
|
71
76
|
}
|
|
72
77
|
function unify(term1, term2) {
|
|
73
78
|
return this.unifyWithOccurCheck(term1, term2, true);
|
|
@@ -75,37 +80,38 @@
|
|
|
75
80
|
function merge(substitution1, substitution2) {
|
|
76
81
|
return this.mergeWithOccurCheck(substitution1, substitution2, true);
|
|
77
82
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
initMetadataForInterface(Unificator, 'Unificator');
|
|
84
|
+
initMetadataForClass(AbstractUnificator, 'AbstractUnificator', VOID, VOID, [Unificator]);
|
|
85
|
+
initMetadataForClass(CachedUnificator, 'CachedUnificator', VOID, VOID, [Unificator]);
|
|
86
|
+
initMetadataForClass(Equation, 'Equation', VOID, VOID, [Castable]);
|
|
87
|
+
initMetadataForClass(Identity, 'Identity', VOID, Equation);
|
|
88
|
+
initMetadataForClass(Assignment, 'Assignment', VOID, Equation);
|
|
89
|
+
initMetadataForClass(Comparison, 'Comparison', VOID, Equation);
|
|
90
|
+
initMetadataForClass(Contradiction, 'Contradiction', VOID, Equation);
|
|
91
|
+
initMetadataForCompanion(Companion);
|
|
92
|
+
initMetadataForClass(Unificator$Companion$naive$1, VOID, VOID, AbstractUnificator);
|
|
93
|
+
initMetadataForClass(Unificator$Companion$strict$1, VOID, VOID, AbstractUnificator);
|
|
94
|
+
initMetadataForCompanion(Companion_0);
|
|
90
95
|
//endregion
|
|
91
96
|
function _get_contextEquations__x0dd77($this) {
|
|
97
|
+
var tmp0 = $this.p1g_1;
|
|
98
|
+
var tmp = KProperty1;
|
|
92
99
|
// Inline function 'kotlin.getValue' call
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return this_0.r2();
|
|
100
|
+
getPropertyCallableRef('contextEquations', 1, tmp, AbstractUnificator$_get_contextEquations_$ref_7ajcte(), null);
|
|
101
|
+
return tmp0.e2();
|
|
96
102
|
}
|
|
97
103
|
function occurrenceCheck($this, variable, term) {
|
|
98
104
|
var tmp;
|
|
99
|
-
if (term.
|
|
100
|
-
tmp = $this.
|
|
101
|
-
} else if (term.
|
|
105
|
+
if (term.vu()) {
|
|
106
|
+
tmp = $this.q1g(variable, term);
|
|
107
|
+
} else if (term.fu()) {
|
|
108
|
+
var tmp0 = term.bu();
|
|
102
109
|
var tmp$ret$1;
|
|
103
110
|
$l$block: {
|
|
104
111
|
// Inline function 'kotlin.sequences.any' call
|
|
105
|
-
var
|
|
106
|
-
while (
|
|
107
|
-
var element =
|
|
108
|
-
// Inline function 'it.unibo.tuprolog.unify.AbstractUnificator.occurrenceCheck.<anonymous>' call
|
|
112
|
+
var _iterator__ex2g4s = tmp0.p();
|
|
113
|
+
while (_iterator__ex2g4s.s()) {
|
|
114
|
+
var element = _iterator__ex2g4s.t();
|
|
109
115
|
if (occurrenceCheck($this, variable, element)) {
|
|
110
116
|
tmp$ret$1 = true;
|
|
111
117
|
break $l$block;
|
|
@@ -121,7 +127,7 @@
|
|
|
121
127
|
}
|
|
122
128
|
function equationsFor($this, term1, term2) {
|
|
123
129
|
var tmp = Companion_instance_0;
|
|
124
|
-
return tmp.
|
|
130
|
+
return tmp.r1g(term1, term2, AbstractUnificator$checkTermsEquality$ref($this));
|
|
125
131
|
}
|
|
126
132
|
function equationsFor_0($this, substitution1, substitution2) {
|
|
127
133
|
var tmp = Companion_instance_0;
|
|
@@ -139,7 +145,7 @@
|
|
|
139
145
|
}
|
|
140
146
|
while (inductionVariable < exceptIndex);
|
|
141
147
|
var inductionVariable_0 = exceptIndex + 1 | 0;
|
|
142
|
-
var last = equations.
|
|
148
|
+
var last = equations.u();
|
|
143
149
|
if (inductionVariable_0 < last)
|
|
144
150
|
do {
|
|
145
151
|
var i_0 = inductionVariable_0;
|
|
@@ -153,32 +159,32 @@
|
|
|
153
159
|
var changed = true;
|
|
154
160
|
while (changed) {
|
|
155
161
|
changed = false;
|
|
156
|
-
var eqIterator = equations.
|
|
162
|
+
var eqIterator = equations.b4();
|
|
157
163
|
while (eqIterator.s()) {
|
|
158
|
-
var eq = eqIterator.
|
|
159
|
-
if (eq.
|
|
164
|
+
var eq = eqIterator.t();
|
|
165
|
+
if (eq.w1g()) {
|
|
160
166
|
return Companion_getInstance().failed();
|
|
161
|
-
} else if (eq.
|
|
162
|
-
eqIterator.
|
|
167
|
+
} else if (eq.x1g()) {
|
|
168
|
+
eqIterator.b3();
|
|
163
169
|
changed = true;
|
|
164
|
-
} else if (eq.
|
|
165
|
-
var assignment = eq.
|
|
166
|
-
if (occurCheckEnabled
|
|
170
|
+
} else if (eq.e1h()) {
|
|
171
|
+
var assignment = eq.z1g();
|
|
172
|
+
if (occurCheckEnabled && occurrenceCheck($this, assignment.c1h_1, eq.v1g())) {
|
|
167
173
|
return Companion_getInstance().failed();
|
|
168
174
|
} else {
|
|
169
|
-
changed = changed
|
|
175
|
+
changed = changed || applySubstitutionToEquations($this, assignment.toSubstitution(), equations, eqIterator.p3());
|
|
170
176
|
}
|
|
171
|
-
} else if (eq.
|
|
172
|
-
eqIterator.
|
|
173
|
-
var
|
|
174
|
-
insertion: while (
|
|
175
|
-
var it =
|
|
176
|
-
if (it.
|
|
177
|
+
} else if (eq.y1g()) {
|
|
178
|
+
eqIterator.b3();
|
|
179
|
+
var _iterator__ex2g4s = equationsFor($this, eq.u1g(), eq.v1g()).p();
|
|
180
|
+
insertion: while (_iterator__ex2g4s.s()) {
|
|
181
|
+
var it = _iterator__ex2g4s.t();
|
|
182
|
+
if (it.x1g())
|
|
177
183
|
continue insertion;
|
|
178
|
-
else if (it.
|
|
184
|
+
else if (it.w1g())
|
|
179
185
|
return Companion_getInstance().failed();
|
|
180
186
|
else {
|
|
181
|
-
eqIterator.
|
|
187
|
+
eqIterator.s3(it);
|
|
182
188
|
}
|
|
183
189
|
}
|
|
184
190
|
changed = true;
|
|
@@ -188,12 +194,11 @@
|
|
|
188
194
|
// Inline function 'kotlin.collections.filter' call
|
|
189
195
|
// Inline function 'kotlin.collections.filterTo' call
|
|
190
196
|
var destination = ArrayList_init_$Create$();
|
|
191
|
-
var
|
|
192
|
-
while (
|
|
193
|
-
var element =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
destination.o(element);
|
|
197
|
+
var _iterator__ex2g4s_0 = equations.p();
|
|
198
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
199
|
+
var element = _iterator__ex2g4s_0.t();
|
|
200
|
+
if (element.e1h()) {
|
|
201
|
+
destination.n(element);
|
|
197
202
|
}
|
|
198
203
|
}
|
|
199
204
|
return toSubstitution(destination);
|
|
@@ -204,62 +209,70 @@
|
|
|
204
209
|
return toCollection(items, tmp$ret$0);
|
|
205
210
|
}
|
|
206
211
|
function applySubstitutionToEquations$handleIndex($equations, $substitution, this$0, changed, i) {
|
|
207
|
-
if ($equations.
|
|
212
|
+
if ($equations.z(i).w1g() || $equations.z(i).x1g())
|
|
208
213
|
return Unit_instance;
|
|
209
|
-
var currentEq = $equations.
|
|
210
|
-
var
|
|
211
|
-
var newLhs =
|
|
212
|
-
var newRhs =
|
|
213
|
-
if (!currentEq.
|
|
214
|
+
var currentEq = $equations.z(i);
|
|
215
|
+
var _destruct__k2r9zo = currentEq.apply($substitution).toPair();
|
|
216
|
+
var newLhs = _destruct__k2r9zo.rc();
|
|
217
|
+
var newRhs = _destruct__k2r9zo.sc();
|
|
218
|
+
if (!currentEq.u1g().equals(newLhs) || !currentEq.v1g().equals(newRhs)) {
|
|
214
219
|
var tmp = Companion_instance_0;
|
|
215
|
-
$equations.
|
|
220
|
+
$equations.y3(i, tmp.f1h(newLhs, newRhs, AbstractUnificator$checkTermsEquality$ref_0(this$0)));
|
|
216
221
|
changed._v = true;
|
|
217
222
|
}
|
|
218
223
|
}
|
|
219
224
|
function AbstractUnificator$contextEquations$delegate$lambda(this$0) {
|
|
220
225
|
return function () {
|
|
221
|
-
return toEquations(this$0.
|
|
226
|
+
return toEquations(this$0.h8());
|
|
222
227
|
};
|
|
223
228
|
}
|
|
224
|
-
function AbstractUnificator$
|
|
225
|
-
|
|
226
|
-
return
|
|
229
|
+
function AbstractUnificator$_get_contextEquations_$ref_7ajcte() {
|
|
230
|
+
return function (p0) {
|
|
231
|
+
return _get_contextEquations__x0dd77(p0);
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function AbstractUnificator$checkTermsEquality$ref(p0) {
|
|
235
|
+
var l = function (_this__u8e3s4, p0_0) {
|
|
236
|
+
return p0.q1g(_this__u8e3s4, p0_0);
|
|
227
237
|
};
|
|
228
238
|
l.callableName = 'checkTermsEquality';
|
|
229
239
|
return l;
|
|
230
240
|
}
|
|
231
241
|
function AbstractUnificator$equationsFor$lambda(it) {
|
|
232
242
|
// Inline function 'kotlin.collections.toPair' call
|
|
233
|
-
return new Pair(it.
|
|
243
|
+
return new Pair(it.d2(), it.e2());
|
|
234
244
|
}
|
|
235
|
-
function AbstractUnificator$checkTermsEquality$ref_0(
|
|
236
|
-
var l = function (
|
|
237
|
-
return
|
|
245
|
+
function AbstractUnificator$checkTermsEquality$ref_0(p0) {
|
|
246
|
+
var l = function (_this__u8e3s4, p0_0) {
|
|
247
|
+
return p0.q1g(_this__u8e3s4, p0_0);
|
|
238
248
|
};
|
|
239
249
|
l.callableName = 'checkTermsEquality';
|
|
240
250
|
return l;
|
|
241
251
|
}
|
|
242
252
|
function AbstractUnificator(context) {
|
|
243
253
|
context = context === VOID ? Companion_getInstance().empty() : context;
|
|
244
|
-
this.
|
|
254
|
+
this.o1g_1 = context;
|
|
245
255
|
var tmp = this;
|
|
246
|
-
tmp.
|
|
256
|
+
tmp.p1g_1 = lazy(AbstractUnificator$contextEquations$delegate$lambda(this));
|
|
247
257
|
}
|
|
248
|
-
protoOf(AbstractUnificator).
|
|
249
|
-
return this.
|
|
258
|
+
protoOf(AbstractUnificator).h8 = function () {
|
|
259
|
+
return this.o1g_1;
|
|
250
260
|
};
|
|
251
|
-
protoOf(AbstractUnificator).
|
|
252
|
-
if (this.
|
|
261
|
+
protoOf(AbstractUnificator).g1h = function (term1, term2, occurCheckEnabled) {
|
|
262
|
+
if (this.h8().g10())
|
|
253
263
|
return Companion_getInstance().failed();
|
|
254
264
|
var equations = newDeque(this, plus(asSequence_0(_get_contextEquations__x0dd77(this)), equationsFor(this, term1, term2)));
|
|
255
265
|
return mgu_0(this, equations, occurCheckEnabled);
|
|
256
266
|
};
|
|
257
|
-
protoOf(AbstractUnificator).
|
|
258
|
-
|
|
267
|
+
protoOf(AbstractUnificator).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
268
|
+
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof AbstractUnificator) ? $super : THROW_CCE());
|
|
269
|
+
};
|
|
270
|
+
protoOf(AbstractUnificator).h1h = function (substitution1, substitution2, occurCheckEnabled) {
|
|
271
|
+
if (this.h8().g10() || substitution1.g10() || substitution2.g10())
|
|
259
272
|
return Companion_getInstance().failed();
|
|
260
273
|
if (!occurCheckEnabled) {
|
|
261
|
-
var quickMerge = this.
|
|
262
|
-
if (quickMerge.
|
|
274
|
+
var quickMerge = this.h8().plus(substitution1).plus(substitution2);
|
|
275
|
+
if (quickMerge.f10()) {
|
|
263
276
|
return quickMerge;
|
|
264
277
|
}
|
|
265
278
|
}
|
|
@@ -267,45 +280,43 @@
|
|
|
267
280
|
return mgu_0(this, equations, occurCheckEnabled);
|
|
268
281
|
};
|
|
269
282
|
protoOf(AbstractUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
270
|
-
return this.
|
|
283
|
+
return this.h1h(substitution1, substitution2, occurCheckEnabled);
|
|
271
284
|
};
|
|
272
|
-
function contextEquations$factory() {
|
|
273
|
-
return getPropertyCallableRef('contextEquations', 1, KProperty1, function (receiver) {
|
|
274
|
-
return _get_contextEquations__x0dd77(receiver);
|
|
275
|
-
}, null);
|
|
276
|
-
}
|
|
277
285
|
function CachedUnificator(decorated, cacheCapacity) {
|
|
278
|
-
this.
|
|
279
|
-
this.
|
|
286
|
+
this.i1h_1 = decorated;
|
|
287
|
+
this.j1h_1 = Companion_instance.wo(cacheCapacity);
|
|
280
288
|
}
|
|
281
|
-
protoOf(CachedUnificator).
|
|
289
|
+
protoOf(CachedUnificator).g1h = function (term1, term2, occurCheckEnabled) {
|
|
282
290
|
var mguRequest = new Triple(term1, term2, occurCheckEnabled);
|
|
283
|
-
var cached = this.
|
|
291
|
+
var cached = this.j1h_1.h2(mguRequest);
|
|
284
292
|
var tmp;
|
|
285
293
|
if (cached instanceof Some) {
|
|
286
|
-
tmp = cached.
|
|
294
|
+
tmp = cached.zo_1;
|
|
287
295
|
} else {
|
|
288
|
-
var mguResult = this.
|
|
289
|
-
this.
|
|
296
|
+
var mguResult = this.i1h_1.g1h(term1, term2, occurCheckEnabled);
|
|
297
|
+
this.j1h_1.xo(mguRequest, mguResult);
|
|
290
298
|
tmp = mguResult;
|
|
291
299
|
}
|
|
292
300
|
return tmp;
|
|
293
301
|
};
|
|
294
|
-
protoOf(CachedUnificator).
|
|
302
|
+
protoOf(CachedUnificator).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
303
|
+
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof CachedUnificator) ? $super : THROW_CCE());
|
|
304
|
+
};
|
|
305
|
+
protoOf(CachedUnificator).h1h = function (substitution1, substitution2, occurCheckEnabled) {
|
|
295
306
|
var mguRequest = new Triple(substitution1, substitution2, occurCheckEnabled);
|
|
296
|
-
var cached = this.
|
|
307
|
+
var cached = this.j1h_1.h2(mguRequest);
|
|
297
308
|
var tmp;
|
|
298
309
|
if (cached instanceof Some) {
|
|
299
|
-
tmp = cached.
|
|
310
|
+
tmp = cached.zo_1;
|
|
300
311
|
} else {
|
|
301
|
-
var mguResult = this.
|
|
302
|
-
this.
|
|
312
|
+
var mguResult = this.i1h_1.mergeWithOccurCheck(substitution1, substitution2, occurCheckEnabled);
|
|
313
|
+
this.j1h_1.xo(mguRequest, mguResult);
|
|
303
314
|
tmp = mguResult;
|
|
304
315
|
}
|
|
305
316
|
return tmp;
|
|
306
317
|
};
|
|
307
318
|
protoOf(CachedUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
308
|
-
return this.
|
|
319
|
+
return this.h1h(substitution1, substitution2, occurCheckEnabled);
|
|
309
320
|
};
|
|
310
321
|
function allOfLists($this, lhs, rhs, equalityChecker) {
|
|
311
322
|
var tmp = zip(lhs.unfold(), rhs.unfold());
|
|
@@ -338,7 +349,7 @@
|
|
|
338
349
|
}
|
|
339
350
|
function Equation$Companion$from$lambda($equalityChecker) {
|
|
340
351
|
return function (it) {
|
|
341
|
-
return Companion_instance_0.
|
|
352
|
+
return Companion_instance_0.k1h(it, $equalityChecker);
|
|
342
353
|
};
|
|
343
354
|
}
|
|
344
355
|
function Term$equals$ref_2() {
|
|
@@ -363,17 +374,17 @@
|
|
|
363
374
|
return l;
|
|
364
375
|
}
|
|
365
376
|
function Equation$Companion$allOfLists$lambda($equalityChecker) {
|
|
366
|
-
return function (
|
|
367
|
-
var l =
|
|
368
|
-
var r =
|
|
369
|
-
return
|
|
377
|
+
return function (_destruct__k2r9zo) {
|
|
378
|
+
var l = _destruct__k2r9zo.rc();
|
|
379
|
+
var r = _destruct__k2r9zo.sc();
|
|
380
|
+
return l.mu() && r.mu() ? sequenceOf(Companion_instance_0.f1h(l.castToCons().fw(), r.castToCons().fw(), $equalityChecker)) : l.lu() && r.lu() ? sequenceOf(Companion_instance_0.f1h(l.castToList(), r.castToList(), $equalityChecker)) : Companion_instance_0.r1g(l, r, $equalityChecker);
|
|
370
381
|
};
|
|
371
382
|
}
|
|
372
383
|
function Equation$Companion$allOfTuples$lambda($equalityChecker) {
|
|
373
|
-
return function (
|
|
374
|
-
var l =
|
|
375
|
-
var r =
|
|
376
|
-
return
|
|
384
|
+
return function (_destruct__k2r9zo) {
|
|
385
|
+
var l = _destruct__k2r9zo.rc();
|
|
386
|
+
var r = _destruct__k2r9zo.sc();
|
|
387
|
+
return l.ku() && r.ku() ? sequenceOf(Companion_instance_0.f1h(l.castToTuple().tv(), r.castToTuple().tv(), $equalityChecker)) : Companion_instance_0.r1g(l, r, $equalityChecker);
|
|
377
388
|
};
|
|
378
389
|
}
|
|
379
390
|
function Term$equals$ref_5() {
|
|
@@ -385,29 +396,29 @@
|
|
|
385
396
|
}
|
|
386
397
|
function Equation$Companion$allOf$lambda($equalityChecker) {
|
|
387
398
|
return function (it) {
|
|
388
|
-
return Companion_instance_0.
|
|
399
|
+
return Companion_instance_0.k1h(it, $equalityChecker);
|
|
389
400
|
};
|
|
390
401
|
}
|
|
391
402
|
function Identity(lhs, rhs) {
|
|
392
403
|
Equation.call(this, lhs, rhs);
|
|
393
|
-
this.
|
|
394
|
-
this.
|
|
404
|
+
this.n1h_1 = lhs;
|
|
405
|
+
this.o1h_1 = rhs;
|
|
395
406
|
}
|
|
396
|
-
protoOf(Identity).
|
|
397
|
-
return this.
|
|
407
|
+
protoOf(Identity).u1g = function () {
|
|
408
|
+
return this.n1h_1;
|
|
398
409
|
};
|
|
399
|
-
protoOf(Identity).
|
|
400
|
-
return this.
|
|
410
|
+
protoOf(Identity).v1g = function () {
|
|
411
|
+
return this.o1h_1;
|
|
401
412
|
};
|
|
402
|
-
protoOf(Identity).
|
|
413
|
+
protoOf(Identity).x1g = function () {
|
|
403
414
|
return true;
|
|
404
415
|
};
|
|
405
416
|
protoOf(Identity).toString = function () {
|
|
406
|
-
return 'Identity(lhs=' + this.
|
|
417
|
+
return 'Identity(lhs=' + this.n1h_1.toString() + ', rhs=' + this.o1h_1.toString() + ')';
|
|
407
418
|
};
|
|
408
419
|
protoOf(Identity).hashCode = function () {
|
|
409
|
-
var result = this.
|
|
410
|
-
result = imul(result, 31) + this.
|
|
420
|
+
var result = this.n1h_1.hashCode();
|
|
421
|
+
result = imul(result, 31) + this.o1h_1.hashCode() | 0;
|
|
411
422
|
return result;
|
|
412
423
|
};
|
|
413
424
|
protoOf(Identity).equals = function (other) {
|
|
@@ -415,45 +426,44 @@
|
|
|
415
426
|
return true;
|
|
416
427
|
if (!(other instanceof Identity))
|
|
417
428
|
return false;
|
|
418
|
-
|
|
419
|
-
if (!this.f1k_1.equals(tmp0_other_with_cast.f1k_1))
|
|
429
|
+
if (!this.n1h_1.equals(other.n1h_1))
|
|
420
430
|
return false;
|
|
421
|
-
if (!this.
|
|
431
|
+
if (!this.o1h_1.equals(other.o1h_1))
|
|
422
432
|
return false;
|
|
423
433
|
return true;
|
|
424
434
|
};
|
|
425
435
|
function Assignment(lhs, rhs) {
|
|
426
436
|
Equation.call(this, lhs, rhs);
|
|
427
|
-
this.
|
|
428
|
-
this.
|
|
437
|
+
this.c1h_1 = lhs;
|
|
438
|
+
this.d1h_1 = rhs;
|
|
429
439
|
}
|
|
430
|
-
protoOf(Assignment).
|
|
431
|
-
return this.
|
|
440
|
+
protoOf(Assignment).u1g = function () {
|
|
441
|
+
return this.c1h_1;
|
|
432
442
|
};
|
|
433
|
-
protoOf(Assignment).
|
|
434
|
-
return this.
|
|
443
|
+
protoOf(Assignment).v1g = function () {
|
|
444
|
+
return this.d1h_1;
|
|
435
445
|
};
|
|
436
446
|
protoOf(Assignment).toSubstitution = function () {
|
|
437
|
-
return Companion_getInstance().unifier(this.
|
|
447
|
+
return Companion_getInstance().unifier(this.c1h_1, this.d1h_1);
|
|
438
448
|
};
|
|
439
|
-
protoOf(Assignment).
|
|
440
|
-
return to(this.
|
|
449
|
+
protoOf(Assignment).r1h = function () {
|
|
450
|
+
return to(this.c1h_1, this.d1h_1);
|
|
441
451
|
};
|
|
442
452
|
protoOf(Assignment).toPair = function () {
|
|
443
|
-
return this.
|
|
453
|
+
return this.r1h();
|
|
444
454
|
};
|
|
445
|
-
protoOf(Assignment).
|
|
455
|
+
protoOf(Assignment).e1h = function () {
|
|
446
456
|
return true;
|
|
447
457
|
};
|
|
448
|
-
protoOf(Assignment).
|
|
458
|
+
protoOf(Assignment).p1h = function () {
|
|
449
459
|
return this;
|
|
450
460
|
};
|
|
451
461
|
protoOf(Assignment).toString = function () {
|
|
452
|
-
return 'Assignment(lhs=' + this.
|
|
462
|
+
return 'Assignment(lhs=' + this.c1h_1.toString() + ', rhs=' + this.d1h_1.toString() + ')';
|
|
453
463
|
};
|
|
454
464
|
protoOf(Assignment).hashCode = function () {
|
|
455
|
-
var result = this.
|
|
456
|
-
result = imul(result, 31) + this.
|
|
465
|
+
var result = this.c1h_1.hashCode();
|
|
466
|
+
result = imul(result, 31) + this.d1h_1.hashCode() | 0;
|
|
457
467
|
return result;
|
|
458
468
|
};
|
|
459
469
|
protoOf(Assignment).equals = function (other) {
|
|
@@ -461,33 +471,32 @@
|
|
|
461
471
|
return true;
|
|
462
472
|
if (!(other instanceof Assignment))
|
|
463
473
|
return false;
|
|
464
|
-
|
|
465
|
-
if (!this.u1j_1.equals(tmp0_other_with_cast.u1j_1))
|
|
474
|
+
if (!this.c1h_1.equals(other.c1h_1))
|
|
466
475
|
return false;
|
|
467
|
-
if (!this.
|
|
476
|
+
if (!this.d1h_1.equals(other.d1h_1))
|
|
468
477
|
return false;
|
|
469
478
|
return true;
|
|
470
479
|
};
|
|
471
480
|
function Comparison(lhs, rhs) {
|
|
472
481
|
Equation.call(this, lhs, rhs);
|
|
473
|
-
this.
|
|
474
|
-
this.
|
|
482
|
+
this.u1h_1 = lhs;
|
|
483
|
+
this.v1h_1 = rhs;
|
|
475
484
|
}
|
|
476
|
-
protoOf(Comparison).
|
|
477
|
-
return this.
|
|
485
|
+
protoOf(Comparison).u1g = function () {
|
|
486
|
+
return this.u1h_1;
|
|
478
487
|
};
|
|
479
|
-
protoOf(Comparison).
|
|
480
|
-
return this.
|
|
488
|
+
protoOf(Comparison).v1g = function () {
|
|
489
|
+
return this.v1h_1;
|
|
481
490
|
};
|
|
482
|
-
protoOf(Comparison).
|
|
491
|
+
protoOf(Comparison).y1g = function () {
|
|
483
492
|
return true;
|
|
484
493
|
};
|
|
485
494
|
protoOf(Comparison).toString = function () {
|
|
486
|
-
return 'Comparison(lhs=' + this.
|
|
495
|
+
return 'Comparison(lhs=' + this.u1h_1.toString() + ', rhs=' + this.v1h_1.toString() + ')';
|
|
487
496
|
};
|
|
488
497
|
protoOf(Comparison).hashCode = function () {
|
|
489
|
-
var result = this.
|
|
490
|
-
result = imul(result, 31) + this.
|
|
498
|
+
var result = this.u1h_1.hashCode();
|
|
499
|
+
result = imul(result, 31) + this.v1h_1.hashCode() | 0;
|
|
491
500
|
return result;
|
|
492
501
|
};
|
|
493
502
|
protoOf(Comparison).equals = function (other) {
|
|
@@ -495,33 +504,32 @@
|
|
|
495
504
|
return true;
|
|
496
505
|
if (!(other instanceof Comparison))
|
|
497
506
|
return false;
|
|
498
|
-
|
|
499
|
-
if (!this.m1k_1.equals(tmp0_other_with_cast.m1k_1))
|
|
507
|
+
if (!this.u1h_1.equals(other.u1h_1))
|
|
500
508
|
return false;
|
|
501
|
-
if (!this.
|
|
509
|
+
if (!this.v1h_1.equals(other.v1h_1))
|
|
502
510
|
return false;
|
|
503
511
|
return true;
|
|
504
512
|
};
|
|
505
513
|
function Contradiction(lhs, rhs) {
|
|
506
514
|
Equation.call(this, lhs, rhs);
|
|
507
|
-
this.
|
|
508
|
-
this.
|
|
515
|
+
this.y1h_1 = lhs;
|
|
516
|
+
this.z1h_1 = rhs;
|
|
509
517
|
}
|
|
510
|
-
protoOf(Contradiction).
|
|
511
|
-
return this.
|
|
518
|
+
protoOf(Contradiction).u1g = function () {
|
|
519
|
+
return this.y1h_1;
|
|
512
520
|
};
|
|
513
|
-
protoOf(Contradiction).
|
|
514
|
-
return this.
|
|
521
|
+
protoOf(Contradiction).v1g = function () {
|
|
522
|
+
return this.z1h_1;
|
|
515
523
|
};
|
|
516
|
-
protoOf(Contradiction).
|
|
524
|
+
protoOf(Contradiction).w1g = function () {
|
|
517
525
|
return true;
|
|
518
526
|
};
|
|
519
527
|
protoOf(Contradiction).toString = function () {
|
|
520
|
-
return 'Contradiction(lhs=' + this.
|
|
528
|
+
return 'Contradiction(lhs=' + this.y1h_1.toString() + ', rhs=' + this.z1h_1.toString() + ')';
|
|
521
529
|
};
|
|
522
530
|
protoOf(Contradiction).hashCode = function () {
|
|
523
|
-
var result = this.
|
|
524
|
-
result = imul(result, 31) + this.
|
|
531
|
+
var result = this.y1h_1.hashCode();
|
|
532
|
+
result = imul(result, 31) + this.z1h_1.hashCode() | 0;
|
|
525
533
|
return result;
|
|
526
534
|
};
|
|
527
535
|
protoOf(Contradiction).equals = function (other) {
|
|
@@ -529,18 +537,17 @@
|
|
|
529
537
|
return true;
|
|
530
538
|
if (!(other instanceof Contradiction))
|
|
531
539
|
return false;
|
|
532
|
-
|
|
533
|
-
if (!this.q1k_1.equals(tmp0_other_with_cast.q1k_1))
|
|
540
|
+
if (!this.y1h_1.equals(other.y1h_1))
|
|
534
541
|
return false;
|
|
535
|
-
if (!this.
|
|
542
|
+
if (!this.z1h_1.equals(other.z1h_1))
|
|
536
543
|
return false;
|
|
537
544
|
return true;
|
|
538
545
|
};
|
|
539
546
|
function Companion() {
|
|
540
547
|
}
|
|
541
|
-
protoOf(Companion).
|
|
548
|
+
protoOf(Companion).f1h = function (lhs, rhs, equalityChecker) {
|
|
542
549
|
var tmp;
|
|
543
|
-
if (lhs.
|
|
550
|
+
if (lhs.vu() && rhs.vu()) {
|
|
544
551
|
var tmp_0;
|
|
545
552
|
if (equalityChecker(lhs, rhs)) {
|
|
546
553
|
tmp_0 = new Identity(lhs, rhs);
|
|
@@ -548,11 +555,11 @@
|
|
|
548
555
|
tmp_0 = new Assignment(lhs.castToVar(), rhs);
|
|
549
556
|
}
|
|
550
557
|
tmp = tmp_0;
|
|
551
|
-
} else if (lhs.
|
|
558
|
+
} else if (lhs.vu()) {
|
|
552
559
|
tmp = new Assignment(lhs.castToVar(), rhs);
|
|
553
|
-
} else if (rhs.
|
|
560
|
+
} else if (rhs.vu()) {
|
|
554
561
|
tmp = new Assignment(rhs.castToVar(), lhs);
|
|
555
|
-
} else if (lhs.
|
|
562
|
+
} else if (lhs.yu() && rhs.yu()) {
|
|
556
563
|
var tmp_1;
|
|
557
564
|
if (equalityChecker(lhs, rhs)) {
|
|
558
565
|
tmp_1 = new Identity(lhs, rhs);
|
|
@@ -560,13 +567,13 @@
|
|
|
560
567
|
tmp_1 = new Contradiction(lhs, rhs);
|
|
561
568
|
}
|
|
562
569
|
tmp = tmp_1;
|
|
563
|
-
} else if (lhs.
|
|
570
|
+
} else if (lhs.yu() || rhs.yu()) {
|
|
564
571
|
tmp = new Contradiction(lhs, rhs);
|
|
565
|
-
} else if (lhs.
|
|
572
|
+
} else if (lhs.fu() && rhs.fu()) {
|
|
566
573
|
var lhsStruct = lhs.castToStruct();
|
|
567
574
|
var rhsStruct = rhs.castToStruct();
|
|
568
575
|
var tmp_2;
|
|
569
|
-
if (!(lhsStruct.
|
|
576
|
+
if (!(lhsStruct.tt() === rhsStruct.tt()) || !(lhsStruct.zt() === rhsStruct.zt())) {
|
|
570
577
|
tmp_2 = new Contradiction(lhsStruct, rhsStruct);
|
|
571
578
|
} else {
|
|
572
579
|
tmp_2 = new Comparison(lhsStruct, rhsStruct);
|
|
@@ -585,10 +592,10 @@
|
|
|
585
592
|
tmp = equalityChecker;
|
|
586
593
|
}
|
|
587
594
|
equalityChecker = tmp;
|
|
588
|
-
return $super === VOID ? this.
|
|
595
|
+
return $super === VOID ? this.f1h(lhs, rhs, equalityChecker) : $super.f1h.call(this, lhs, rhs, equalityChecker);
|
|
589
596
|
};
|
|
590
|
-
protoOf(Companion).
|
|
591
|
-
return this.
|
|
597
|
+
protoOf(Companion).a1i = function (pair, equalityChecker) {
|
|
598
|
+
return this.f1h(pair.xc_1, pair.yc_1, equalityChecker);
|
|
592
599
|
};
|
|
593
600
|
protoOf(Companion).ofPair = function (pair, equalityChecker, $super) {
|
|
594
601
|
var tmp;
|
|
@@ -598,9 +605,9 @@
|
|
|
598
605
|
tmp = equalityChecker;
|
|
599
606
|
}
|
|
600
607
|
equalityChecker = tmp;
|
|
601
|
-
return $super === VOID ? this.
|
|
608
|
+
return $super === VOID ? this.a1i(pair, equalityChecker) : $super.a1i.call(this, pair, equalityChecker);
|
|
602
609
|
};
|
|
603
|
-
protoOf(Companion).
|
|
610
|
+
protoOf(Companion).b1i = function (pairs, equalityChecker) {
|
|
604
611
|
return flatMap(pairs, Equation$Companion$from$lambda(equalityChecker));
|
|
605
612
|
};
|
|
606
613
|
protoOf(Companion).fromSequence = function (pairs, equalityChecker, $super) {
|
|
@@ -611,10 +618,10 @@
|
|
|
611
618
|
tmp = equalityChecker;
|
|
612
619
|
}
|
|
613
620
|
equalityChecker = tmp;
|
|
614
|
-
return $super === VOID ? this.
|
|
621
|
+
return $super === VOID ? this.b1i(pairs, equalityChecker) : $super.b1i.call(this, pairs, equalityChecker);
|
|
615
622
|
};
|
|
616
|
-
protoOf(Companion).
|
|
617
|
-
return this.
|
|
623
|
+
protoOf(Companion).c1i = function (pairs, equalityChecker) {
|
|
624
|
+
return this.b1i(asSequence_0(pairs), equalityChecker);
|
|
618
625
|
};
|
|
619
626
|
protoOf(Companion).fromIterable = function (pairs, equalityChecker, $super) {
|
|
620
627
|
var tmp;
|
|
@@ -624,10 +631,10 @@
|
|
|
624
631
|
tmp = equalityChecker;
|
|
625
632
|
}
|
|
626
633
|
equalityChecker = tmp;
|
|
627
|
-
return $super === VOID ? this.
|
|
634
|
+
return $super === VOID ? this.c1i(pairs, equalityChecker) : $super.c1i.call(this, pairs, equalityChecker);
|
|
628
635
|
};
|
|
629
|
-
protoOf(Companion).
|
|
630
|
-
return this.
|
|
636
|
+
protoOf(Companion).d1i = function (pairs, equalityChecker) {
|
|
637
|
+
return this.b1i(sequenceOf_0(pairs.slice()), equalityChecker);
|
|
631
638
|
};
|
|
632
639
|
protoOf(Companion).from = function (pairs, equalityChecker, $super) {
|
|
633
640
|
var tmp;
|
|
@@ -637,10 +644,10 @@
|
|
|
637
644
|
tmp = equalityChecker;
|
|
638
645
|
}
|
|
639
646
|
equalityChecker = tmp;
|
|
640
|
-
return $super === VOID ? this.
|
|
647
|
+
return $super === VOID ? this.d1i(pairs, equalityChecker) : $super.d1i.call(this, pairs, equalityChecker);
|
|
641
648
|
};
|
|
642
|
-
protoOf(Companion).
|
|
643
|
-
return this.
|
|
649
|
+
protoOf(Companion).k1h = function (pair, equalityChecker) {
|
|
650
|
+
return this.r1g(pair.xc_1, pair.yc_1, equalityChecker);
|
|
644
651
|
};
|
|
645
652
|
protoOf(Companion).allOfPair = function (pair, equalityChecker, $super) {
|
|
646
653
|
var tmp;
|
|
@@ -650,29 +657,29 @@
|
|
|
650
657
|
tmp = equalityChecker;
|
|
651
658
|
}
|
|
652
659
|
equalityChecker = tmp;
|
|
653
|
-
return $super === VOID ? this.
|
|
660
|
+
return $super === VOID ? this.k1h(pair, equalityChecker) : $super.k1h.call(this, pair, equalityChecker);
|
|
654
661
|
};
|
|
655
|
-
protoOf(Companion).
|
|
662
|
+
protoOf(Companion).r1g = function (lhs, rhs, equalityChecker) {
|
|
656
663
|
var tmp;
|
|
657
|
-
if (lhs.
|
|
658
|
-
tmp = sequenceOf(
|
|
659
|
-
} else if (lhs.
|
|
664
|
+
if (lhs.ut() && rhs.ut()) {
|
|
665
|
+
tmp = sequenceOf(this.f1h(lhs, rhs, equalityChecker));
|
|
666
|
+
} else if (lhs.lu() && rhs.lu()) {
|
|
660
667
|
tmp = allOfLists(this, lhs.castToList(), rhs.castToList(), equalityChecker);
|
|
661
|
-
} else if (lhs.
|
|
668
|
+
} else if (lhs.ku() && rhs.ku()) {
|
|
662
669
|
tmp = allOfTuples(this, lhs.castToTuple(), rhs.castToTuple(), equalityChecker);
|
|
663
|
-
} else if (lhs.
|
|
670
|
+
} else if (lhs.fu() && rhs.fu()) {
|
|
664
671
|
var lhsStruct = lhs.castToStruct();
|
|
665
672
|
var rhsStruct = rhs.castToStruct();
|
|
666
673
|
var tmp_0;
|
|
667
|
-
if (lhsStruct.
|
|
668
|
-
var tmp_1 = zip(lhsStruct.
|
|
674
|
+
if (lhsStruct.tt() === rhsStruct.tt() && lhsStruct.zt() === rhsStruct.zt()) {
|
|
675
|
+
var tmp_1 = zip(lhsStruct.su(), rhsStruct.su());
|
|
669
676
|
tmp_0 = flatMap(tmp_1, Equation$Companion$allOf$lambda(equalityChecker));
|
|
670
677
|
} else {
|
|
671
|
-
tmp_0 = sequenceOf(
|
|
678
|
+
tmp_0 = sequenceOf(this.f1h(lhs, rhs, equalityChecker));
|
|
672
679
|
}
|
|
673
680
|
tmp = tmp_0;
|
|
674
681
|
} else {
|
|
675
|
-
tmp = sequenceOf(
|
|
682
|
+
tmp = sequenceOf(this.f1h(lhs, rhs, equalityChecker));
|
|
676
683
|
}
|
|
677
684
|
return tmp;
|
|
678
685
|
};
|
|
@@ -684,7 +691,7 @@
|
|
|
684
691
|
tmp = equalityChecker;
|
|
685
692
|
}
|
|
686
693
|
equalityChecker = tmp;
|
|
687
|
-
return $super === VOID ? this.
|
|
694
|
+
return $super === VOID ? this.r1g(lhs, rhs, equalityChecker) : $super.r1g.call(this, lhs, rhs, equalityChecker);
|
|
688
695
|
};
|
|
689
696
|
var Companion_instance_0;
|
|
690
697
|
function Companion_getInstance_1() {
|
|
@@ -698,54 +705,54 @@
|
|
|
698
705
|
return l;
|
|
699
706
|
}
|
|
700
707
|
function Equation(lhs, rhs) {
|
|
701
|
-
this.
|
|
702
|
-
this.
|
|
708
|
+
this.s1g_1 = lhs;
|
|
709
|
+
this.t1g_1 = rhs;
|
|
703
710
|
}
|
|
704
|
-
protoOf(Equation).
|
|
705
|
-
return this.
|
|
711
|
+
protoOf(Equation).u1g = function () {
|
|
712
|
+
return this.s1g_1;
|
|
706
713
|
};
|
|
707
|
-
protoOf(Equation).
|
|
708
|
-
return this.
|
|
714
|
+
protoOf(Equation).v1g = function () {
|
|
715
|
+
return this.t1g_1;
|
|
709
716
|
};
|
|
710
|
-
protoOf(Equation).
|
|
717
|
+
protoOf(Equation).x1g = function () {
|
|
711
718
|
return false;
|
|
712
719
|
};
|
|
713
|
-
protoOf(Equation).
|
|
720
|
+
protoOf(Equation).e1h = function () {
|
|
714
721
|
return false;
|
|
715
722
|
};
|
|
716
|
-
protoOf(Equation).
|
|
723
|
+
protoOf(Equation).p1h = function () {
|
|
717
724
|
return null;
|
|
718
725
|
};
|
|
719
|
-
protoOf(Equation).
|
|
720
|
-
var tmp0_elvis_lhs = this.
|
|
726
|
+
protoOf(Equation).z1g = function () {
|
|
727
|
+
var tmp0_elvis_lhs = this.p1h();
|
|
721
728
|
var tmp;
|
|
722
729
|
if (tmp0_elvis_lhs == null) {
|
|
723
|
-
throw ClassCastException_init_$Create$('Cannot cast ' + this + ' to ' + getKClass(Assignment).
|
|
730
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(Assignment).b9());
|
|
724
731
|
} else {
|
|
725
732
|
tmp = tmp0_elvis_lhs;
|
|
726
733
|
}
|
|
727
734
|
return tmp;
|
|
728
735
|
};
|
|
729
|
-
protoOf(Equation).
|
|
736
|
+
protoOf(Equation).y1g = function () {
|
|
730
737
|
return false;
|
|
731
738
|
};
|
|
732
|
-
protoOf(Equation).
|
|
739
|
+
protoOf(Equation).w1g = function () {
|
|
733
740
|
return false;
|
|
734
741
|
};
|
|
735
|
-
protoOf(Equation).
|
|
736
|
-
return Companion_getInstance_0().of('=', [this.
|
|
742
|
+
protoOf(Equation).x1f = function () {
|
|
743
|
+
return Companion_getInstance_0().of('=', [this.u1g(), this.v1g()]);
|
|
737
744
|
};
|
|
738
745
|
protoOf(Equation).toTerm = function () {
|
|
739
|
-
return this.
|
|
746
|
+
return this.x1f();
|
|
740
747
|
};
|
|
741
748
|
protoOf(Equation).toPair = function () {
|
|
742
|
-
return new Pair(this.
|
|
749
|
+
return new Pair(this.u1g(), this.v1g());
|
|
743
750
|
};
|
|
744
751
|
protoOf(Equation).swap = function () {
|
|
745
|
-
return Companion_instance_0.of(this.
|
|
752
|
+
return Companion_instance_0.of(this.v1g(), this.u1g());
|
|
746
753
|
};
|
|
747
|
-
protoOf(Equation).
|
|
748
|
-
return Companion_instance_0.
|
|
754
|
+
protoOf(Equation).q1h = function (substitution, equalityChecker) {
|
|
755
|
+
return Companion_instance_0.f1h(this.u1g().getSubstituted(substitution, []), this.v1g().getSubstituted(substitution, []), equalityChecker);
|
|
749
756
|
};
|
|
750
757
|
protoOf(Equation).apply = function (substitution, equalityChecker, $super) {
|
|
751
758
|
var tmp;
|
|
@@ -755,23 +762,22 @@
|
|
|
755
762
|
tmp = equalityChecker;
|
|
756
763
|
}
|
|
757
764
|
equalityChecker = tmp;
|
|
758
|
-
return $super === VOID ? this.
|
|
765
|
+
return $super === VOID ? this.q1h(substitution, equalityChecker) : $super.q1h.call(this, substitution, equalityChecker);
|
|
759
766
|
};
|
|
760
767
|
function toEquations(_this__u8e3s4) {
|
|
761
768
|
// Inline function 'kotlin.collections.map' call
|
|
762
|
-
var this_0 = _this__u8e3s4.
|
|
769
|
+
var this_0 = _this__u8e3s4.f1();
|
|
763
770
|
// Inline function 'kotlin.collections.mapTo' call
|
|
764
771
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
765
|
-
var
|
|
766
|
-
while (
|
|
767
|
-
var item =
|
|
768
|
-
// Inline function 'it.unibo.tuprolog.unify.toEquations.<anonymous>' call
|
|
772
|
+
var _iterator__ex2g4s = this_0.p();
|
|
773
|
+
while (_iterator__ex2g4s.s()) {
|
|
774
|
+
var item = _iterator__ex2g4s.t();
|
|
769
775
|
// Inline function 'kotlin.collections.component1' call
|
|
770
|
-
var variable = item.
|
|
776
|
+
var variable = item.d2();
|
|
771
777
|
// Inline function 'kotlin.collections.component2' call
|
|
772
|
-
var term = item.
|
|
778
|
+
var term = item.e2();
|
|
773
779
|
var tmp$ret$2 = new Assignment(variable, term);
|
|
774
|
-
destination.
|
|
780
|
+
destination.n(tmp$ret$2);
|
|
775
781
|
}
|
|
776
782
|
return destination;
|
|
777
783
|
}
|
|
@@ -782,14 +788,14 @@
|
|
|
782
788
|
}
|
|
783
789
|
function toAssignmentPair(_this__u8e3s4) {
|
|
784
790
|
var tmp;
|
|
785
|
-
if (_this__u8e3s4.
|
|
786
|
-
tmp = _this__u8e3s4.
|
|
787
|
-
} else if (_this__u8e3s4.
|
|
788
|
-
tmp = to(_this__u8e3s4.
|
|
789
|
-
} else if (_this__u8e3s4.
|
|
790
|
-
tmp = to(_this__u8e3s4.
|
|
791
|
+
if (_this__u8e3s4.e1h()) {
|
|
792
|
+
tmp = _this__u8e3s4.z1g().r1h();
|
|
793
|
+
} else if (_this__u8e3s4.u1g().vu()) {
|
|
794
|
+
tmp = to(_this__u8e3s4.u1g().castToVar(), _this__u8e3s4.v1g());
|
|
795
|
+
} else if (_this__u8e3s4.v1g().vu()) {
|
|
796
|
+
tmp = to(_this__u8e3s4.v1g().castToVar(), _this__u8e3s4.u1g());
|
|
791
797
|
} else {
|
|
792
|
-
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + _this__u8e3s4);
|
|
798
|
+
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + toString(_this__u8e3s4));
|
|
793
799
|
}
|
|
794
800
|
return tmp;
|
|
795
801
|
}
|
|
@@ -799,49 +805,61 @@
|
|
|
799
805
|
function Unificator$Companion$default$delegate$lambda() {
|
|
800
806
|
return Companion_getInstance_2().strict();
|
|
801
807
|
}
|
|
808
|
+
function Unificator$Companion$_get_default_$ref_8i2tx3() {
|
|
809
|
+
return function (p0) {
|
|
810
|
+
return p0.g1i();
|
|
811
|
+
};
|
|
812
|
+
}
|
|
802
813
|
function Unificator$Companion$naive$1($context) {
|
|
803
814
|
AbstractUnificator.call(this, $context);
|
|
804
815
|
}
|
|
805
|
-
protoOf(Unificator$Companion$naive$1).
|
|
816
|
+
protoOf(Unificator$Companion$naive$1).q1g = function (first, second) {
|
|
806
817
|
var tmp;
|
|
807
|
-
if (first.
|
|
808
|
-
tmp = first.castToInteger().
|
|
809
|
-
} else if (first.
|
|
810
|
-
tmp = first.castToNumeric().
|
|
818
|
+
if (first.av() && second.av()) {
|
|
819
|
+
tmp = first.castToInteger().e2().dj(second.castToInteger().e2()) === 0;
|
|
820
|
+
} else if (first.zu() && second.zu()) {
|
|
821
|
+
tmp = first.castToNumeric().py().ui(second.castToNumeric().py()) === 0;
|
|
811
822
|
} else {
|
|
812
823
|
tmp = first.equals(second);
|
|
813
824
|
}
|
|
814
825
|
return tmp;
|
|
815
826
|
};
|
|
827
|
+
protoOf(Unificator$Companion$naive$1).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
828
|
+
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof Unificator$Companion$naive$1) ? $super : THROW_CCE());
|
|
829
|
+
};
|
|
816
830
|
function Unificator$Companion$strict$1($context) {
|
|
817
831
|
AbstractUnificator.call(this, $context);
|
|
818
832
|
}
|
|
819
|
-
protoOf(Unificator$Companion$strict$1).
|
|
833
|
+
protoOf(Unificator$Companion$strict$1).q1g = function (first, second) {
|
|
820
834
|
return first.equals(second);
|
|
821
835
|
};
|
|
836
|
+
protoOf(Unificator$Companion$strict$1).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
837
|
+
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof Unificator$Companion$strict$1) ? $super : THROW_CCE());
|
|
838
|
+
};
|
|
822
839
|
function Companion_0() {
|
|
823
840
|
Companion_instance_1 = this;
|
|
824
841
|
var tmp = this;
|
|
825
|
-
tmp.
|
|
826
|
-
this.
|
|
842
|
+
tmp.e1i_1 = lazy(Unificator$Companion$default$delegate$lambda);
|
|
843
|
+
this.f1i_1 = 32;
|
|
827
844
|
}
|
|
828
|
-
protoOf(Companion_0).
|
|
845
|
+
protoOf(Companion_0).g1i = function () {
|
|
846
|
+
var tmp0 = this.e1i_1;
|
|
847
|
+
var tmp = KProperty1;
|
|
829
848
|
// Inline function 'kotlin.getValue' call
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
return this_0.r2();
|
|
849
|
+
getPropertyCallableRef('default', 1, tmp, Unificator$Companion$_get_default_$ref_8i2tx3(), null);
|
|
850
|
+
return tmp0.e2();
|
|
833
851
|
};
|
|
834
852
|
protoOf(Companion_0).mguWith = function (_this__u8e3s4, other) {
|
|
835
|
-
return this.
|
|
853
|
+
return this.g1i().mgu(_this__u8e3s4, other);
|
|
836
854
|
};
|
|
837
855
|
protoOf(Companion_0).matches = function (_this__u8e3s4, other) {
|
|
838
|
-
return this.
|
|
856
|
+
return this.g1i().match(_this__u8e3s4, other);
|
|
839
857
|
};
|
|
840
858
|
protoOf(Companion_0).unifyWith = function (_this__u8e3s4, other) {
|
|
841
|
-
return this.
|
|
859
|
+
return this.g1i().unify(_this__u8e3s4, other);
|
|
842
860
|
};
|
|
843
861
|
protoOf(Companion_0).mergeWith = function (_this__u8e3s4, other) {
|
|
844
|
-
return this.
|
|
862
|
+
return this.g1i().merge(_this__u8e3s4, other);
|
|
845
863
|
};
|
|
846
864
|
protoOf(Companion_0).naiveWithContext = function (context) {
|
|
847
865
|
return new Unificator$Companion$naive$1(context);
|
|
@@ -855,10 +873,10 @@
|
|
|
855
873
|
protoOf(Companion_0).strict = function () {
|
|
856
874
|
return this.strictWithContext(Companion_getInstance().empty());
|
|
857
875
|
};
|
|
858
|
-
protoOf(Companion_0).
|
|
876
|
+
protoOf(Companion_0).l1i = function (other, capacity) {
|
|
859
877
|
var tmp;
|
|
860
878
|
if (other instanceof CachedUnificator) {
|
|
861
|
-
tmp = new CachedUnificator(other.
|
|
879
|
+
tmp = new CachedUnificator(other.i1h_1, capacity);
|
|
862
880
|
} else {
|
|
863
881
|
tmp = new CachedUnificator(other, capacity);
|
|
864
882
|
}
|
|
@@ -866,7 +884,7 @@
|
|
|
866
884
|
};
|
|
867
885
|
protoOf(Companion_0).cached = function (other, capacity, $super) {
|
|
868
886
|
capacity = capacity === VOID ? 32 : capacity;
|
|
869
|
-
return $super === VOID ? this.
|
|
887
|
+
return $super === VOID ? this.l1i(other, capacity) : $super.l1i.call(this, other, capacity);
|
|
870
888
|
};
|
|
871
889
|
var Companion_instance_1;
|
|
872
890
|
function Companion_getInstance_2() {
|
|
@@ -876,32 +894,29 @@
|
|
|
876
894
|
}
|
|
877
895
|
function Unificator() {
|
|
878
896
|
}
|
|
879
|
-
function default$factory() {
|
|
880
|
-
return getPropertyCallableRef('default', 1, KProperty1, function (receiver) {
|
|
881
|
-
return receiver.c1l();
|
|
882
|
-
}, null);
|
|
883
|
-
}
|
|
884
897
|
//region block: post-declaration
|
|
898
|
+
protoOf(AbstractUnificator).mguWithOccurCheck = mguWithOccurCheck;
|
|
885
899
|
protoOf(AbstractUnificator).mgu = mgu;
|
|
886
900
|
protoOf(AbstractUnificator).matchWithOccurCheck = matchWithOccurCheck;
|
|
887
901
|
protoOf(AbstractUnificator).match = match;
|
|
888
902
|
protoOf(AbstractUnificator).unifyWithOccurCheck = unifyWithOccurCheck;
|
|
889
903
|
protoOf(AbstractUnificator).unify = unify;
|
|
890
904
|
protoOf(AbstractUnificator).merge = merge;
|
|
905
|
+
protoOf(CachedUnificator).mguWithOccurCheck = mguWithOccurCheck;
|
|
891
906
|
protoOf(CachedUnificator).mgu = mgu;
|
|
892
907
|
protoOf(CachedUnificator).matchWithOccurCheck = matchWithOccurCheck;
|
|
893
908
|
protoOf(CachedUnificator).match = match;
|
|
894
909
|
protoOf(CachedUnificator).unifyWithOccurCheck = unifyWithOccurCheck;
|
|
895
910
|
protoOf(CachedUnificator).unify = unify;
|
|
896
911
|
protoOf(CachedUnificator).merge = merge;
|
|
897
|
-
protoOf(Equation).
|
|
912
|
+
protoOf(Equation).gp = castTo;
|
|
898
913
|
defineProp(protoOf(Equation), 'lhs', function () {
|
|
899
|
-
return this.
|
|
914
|
+
return this.u1g();
|
|
900
915
|
});
|
|
901
916
|
defineProp(protoOf(Equation), 'rhs', function () {
|
|
902
|
-
return this.
|
|
917
|
+
return this.v1g();
|
|
903
918
|
});
|
|
904
|
-
defineProp(protoOf(Companion_0), 'default', protoOf(Companion_0).
|
|
919
|
+
defineProp(protoOf(Companion_0), 'default', protoOf(Companion_0).g1i);
|
|
905
920
|
//endregion
|
|
906
921
|
//region block: init
|
|
907
922
|
Companion_instance_0 = new Companion();
|