@tuprolog/arg2p-core 0.14.2 → 0.16.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 +3200 -2994
- package/2p-core.js.map +1 -1
- package/{2p-parser-js.js → 2p-parser-impl.js} +2 -2
- package/2p-solve-classic.js +1071 -1077
- package/2p-solve-classic.js.map +1 -1
- package/2p-solve.js +3818 -3850
- package/2p-solve.js.map +1 -1
- package/2p-theory.js +1807 -1827
- package/2p-theory.js.map +1 -1
- package/2p-unify.js +645 -364
- package/2p-unify.js.map +1 -1
- package/2p-utils.js +447 -452
- package/2p-utils.js.map +1 -1
- package/kotlin-kotlin-stdlib.js +2348 -2312
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kt-math.js +1593 -1593
- package/kt-math.js.map +1 -1
- package/package.json +2 -5
- /package/{2p-parser-js.js.map → 2p-parser-impl.js.map} +0 -0
package/2p-unify.js
CHANGED
|
@@ -19,60 +19,66 @@
|
|
|
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
|
|
22
|
+
var protoOf = kotlin_kotlin.$_$.g6;
|
|
23
|
+
var getBooleanHashCode = kotlin_kotlin.$_$.p5;
|
|
24
|
+
var initMetadataForClass = kotlin_kotlin.$_$.t5;
|
|
25
|
+
var toString = kotlin_kotlin.$_$.j6;
|
|
26
|
+
var hashCode = kotlin_kotlin.$_$.s5;
|
|
27
|
+
var equals = kotlin_kotlin.$_$.n5;
|
|
28
|
+
var KProperty1 = kotlin_kotlin.$_$.x6;
|
|
29
|
+
var getPropertyCallableRef = kotlin_kotlin.$_$.q5;
|
|
30
|
+
var asSequence = kotlin_kotlin.$_$.y1;
|
|
31
|
+
var plus = kotlin_kotlin.$_$.z7;
|
|
32
|
+
var map = kotlin_kotlin.$_$.v7;
|
|
33
|
+
var Unit_instance = kotlin_kotlin.$_$.m;
|
|
34
|
+
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.o;
|
|
35
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.o;
|
|
36
|
+
var toCollection = kotlin_kotlin.$_$.g8;
|
|
37
|
+
var constructCallableReference = kotlin_kotlin.$_$.l5;
|
|
38
|
+
var Pair = kotlin_kotlin.$_$.x9;
|
|
39
|
+
var lazy = kotlin_kotlin.$_$.fa;
|
|
40
|
+
var asSequence_0 = kotlin_kotlin.$_$.z1;
|
|
41
|
+
var THROW_CCE = kotlin_kotlin.$_$.z9;
|
|
32
42
|
var VOID = kotlin_kotlin.$_$.b;
|
|
33
|
-
var lazy = kotlin_kotlin.$_$.y9;
|
|
34
|
-
var protoOf = kotlin_kotlin.$_$.a6;
|
|
35
|
-
var asSequence_0 = kotlin_kotlin.$_$.v1;
|
|
36
|
-
var THROW_CCE = kotlin_kotlin.$_$.t9;
|
|
37
|
-
var initMetadataForClass = kotlin_kotlin.$_$.n5;
|
|
38
43
|
var Companion_instance = kotlin_it_unibo_tuprolog_utils.$_$.a;
|
|
39
|
-
var Triple = kotlin_kotlin.$_$.
|
|
44
|
+
var Triple = kotlin_kotlin.$_$.ba;
|
|
40
45
|
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 sequenceOf_0 = kotlin_kotlin.$_$.
|
|
46
|
-
var initMetadataForCompanion = kotlin_kotlin.$_$.
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
46
|
+
var zip = kotlin_kotlin.$_$.n8;
|
|
47
|
+
var flatMap = kotlin_kotlin.$_$.n7;
|
|
48
|
+
var sequenceOf = kotlin_kotlin.$_$.b8;
|
|
49
|
+
var defineProp = kotlin_kotlin.$_$.m5;
|
|
50
|
+
var sequenceOf_0 = kotlin_kotlin.$_$.a8;
|
|
51
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.u5;
|
|
52
|
+
var getKClass = kotlin_kotlin.$_$.w6;
|
|
53
|
+
var ClassCastException_init_$Create$ = kotlin_kotlin.$_$.z;
|
|
54
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.b1;
|
|
55
|
+
var to = kotlin_kotlin.$_$.ka;
|
|
56
|
+
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.n;
|
|
51
57
|
var castTo = kotlin_it_unibo_tuprolog_utils.$_$.e;
|
|
52
|
-
var defineProp = kotlin_kotlin.$_$.g5;
|
|
53
58
|
var Castable = kotlin_it_unibo_tuprolog_utils.$_$.f;
|
|
54
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.
|
|
55
|
-
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.
|
|
56
|
-
var
|
|
57
|
-
var initMetadataForInterface = kotlin_kotlin.$_$.p5;
|
|
59
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.b2;
|
|
60
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.n;
|
|
61
|
+
var initMetadataForInterface = kotlin_kotlin.$_$.v5;
|
|
58
62
|
//endregion
|
|
59
63
|
//region block: pre-declaration
|
|
64
|
+
initMetadataForClass(Mgu, 'Mgu');
|
|
65
|
+
initMetadataForClass(Merge, 'Merge');
|
|
60
66
|
function mguWithOccurCheck(term1, term2, occurCheckEnabled, $super) {
|
|
61
67
|
occurCheckEnabled = occurCheckEnabled === VOID ? true : occurCheckEnabled;
|
|
62
|
-
return $super === VOID ? this.
|
|
68
|
+
return $super === VOID ? this.p1h(term1, term2, occurCheckEnabled) : $super.p1h.call(this, term1, term2, occurCheckEnabled);
|
|
63
69
|
}
|
|
64
70
|
function mgu(term1, term2) {
|
|
65
|
-
return this.
|
|
71
|
+
return this.p1h(term1, term2, true);
|
|
66
72
|
}
|
|
67
73
|
function matchWithOccurCheck(term1, term2, occurCheckEnabled) {
|
|
68
|
-
return !(this.
|
|
74
|
+
return !(this.p1h(term1, term2, occurCheckEnabled) === Companion_getInstance().failed());
|
|
69
75
|
}
|
|
70
76
|
function match(term1, term2) {
|
|
71
77
|
return this.matchWithOccurCheck(term1, term2, true);
|
|
72
78
|
}
|
|
73
79
|
function unifyWithOccurCheck(term1, term2, occurCheckEnabled) {
|
|
74
|
-
var substitution = this.
|
|
75
|
-
return substitution.
|
|
80
|
+
var substitution = this.p1h(term1, term2, occurCheckEnabled);
|
|
81
|
+
return substitution.iz() ? null : term1.getSubstituted(substitution, []);
|
|
76
82
|
}
|
|
77
83
|
function unify(term1, term2) {
|
|
78
84
|
return this.unifyWithOccurCheck(term1, term2, true);
|
|
@@ -86,6 +92,8 @@
|
|
|
86
92
|
initMetadataForClass(Equation, 'Equation', VOID, VOID, [Castable]);
|
|
87
93
|
initMetadataForClass(Identity, 'Identity', VOID, Equation);
|
|
88
94
|
initMetadataForClass(Assignment, 'Assignment', VOID, Equation);
|
|
95
|
+
initMetadataForClass(LeftAssignment, 'LeftAssignment', VOID, Assignment);
|
|
96
|
+
initMetadataForClass(RightAssignment, 'RightAssignment', VOID, Assignment);
|
|
89
97
|
initMetadataForClass(Comparison, 'Comparison', VOID, Equation);
|
|
90
98
|
initMetadataForClass(Contradiction, 'Contradiction', VOID, Equation);
|
|
91
99
|
initMetadataForCompanion(Companion);
|
|
@@ -93,33 +101,87 @@
|
|
|
93
101
|
initMetadataForClass(Unificator$Companion$strict$1, VOID, VOID, AbstractUnificator);
|
|
94
102
|
initMetadataForCompanion(Companion_0);
|
|
95
103
|
//endregion
|
|
104
|
+
function Mgu(term1, term2, occurCheckEnabled) {
|
|
105
|
+
this.n1g_1 = term1;
|
|
106
|
+
this.o1g_1 = term2;
|
|
107
|
+
this.p1g_1 = occurCheckEnabled;
|
|
108
|
+
}
|
|
109
|
+
protoOf(Mgu).toString = function () {
|
|
110
|
+
return 'Mgu(term1=' + this.n1g_1.toString() + ', term2=' + this.o1g_1.toString() + ', occurCheckEnabled=' + this.p1g_1 + ')';
|
|
111
|
+
};
|
|
112
|
+
protoOf(Mgu).hashCode = function () {
|
|
113
|
+
var result = this.n1g_1.hashCode();
|
|
114
|
+
result = imul(result, 31) + this.o1g_1.hashCode() | 0;
|
|
115
|
+
result = imul(result, 31) + getBooleanHashCode(this.p1g_1) | 0;
|
|
116
|
+
return result;
|
|
117
|
+
};
|
|
118
|
+
protoOf(Mgu).equals = function (other) {
|
|
119
|
+
if (this === other)
|
|
120
|
+
return true;
|
|
121
|
+
if (!(other instanceof Mgu))
|
|
122
|
+
return false;
|
|
123
|
+
if (!this.n1g_1.equals(other.n1g_1))
|
|
124
|
+
return false;
|
|
125
|
+
if (!this.o1g_1.equals(other.o1g_1))
|
|
126
|
+
return false;
|
|
127
|
+
if (!(this.p1g_1 === other.p1g_1))
|
|
128
|
+
return false;
|
|
129
|
+
return true;
|
|
130
|
+
};
|
|
131
|
+
function Merge(substitution1, substitution2, occurCheckEnabled) {
|
|
132
|
+
this.q1g_1 = substitution1;
|
|
133
|
+
this.r1g_1 = substitution2;
|
|
134
|
+
this.s1g_1 = occurCheckEnabled;
|
|
135
|
+
}
|
|
136
|
+
protoOf(Merge).toString = function () {
|
|
137
|
+
return 'Merge(substitution1=' + toString(this.q1g_1) + ', substitution2=' + toString(this.r1g_1) + ', occurCheckEnabled=' + this.s1g_1 + ')';
|
|
138
|
+
};
|
|
139
|
+
protoOf(Merge).hashCode = function () {
|
|
140
|
+
var result = hashCode(this.q1g_1);
|
|
141
|
+
result = imul(result, 31) + hashCode(this.r1g_1) | 0;
|
|
142
|
+
result = imul(result, 31) + getBooleanHashCode(this.s1g_1) | 0;
|
|
143
|
+
return result;
|
|
144
|
+
};
|
|
145
|
+
protoOf(Merge).equals = function (other) {
|
|
146
|
+
if (this === other)
|
|
147
|
+
return true;
|
|
148
|
+
if (!(other instanceof Merge))
|
|
149
|
+
return false;
|
|
150
|
+
if (!equals(this.q1g_1, other.q1g_1))
|
|
151
|
+
return false;
|
|
152
|
+
if (!equals(this.r1g_1, other.r1g_1))
|
|
153
|
+
return false;
|
|
154
|
+
if (!(this.s1g_1 === other.s1g_1))
|
|
155
|
+
return false;
|
|
156
|
+
return true;
|
|
157
|
+
};
|
|
96
158
|
function _get_contextEquations__x0dd77($this) {
|
|
97
|
-
var tmp0 = $this.
|
|
159
|
+
var tmp0 = $this.u1g_1;
|
|
98
160
|
var tmp = KProperty1;
|
|
99
161
|
// Inline function 'kotlin.getValue' call
|
|
100
|
-
|
|
101
|
-
return tmp0.
|
|
162
|
+
/* dead property reference removed */
|
|
163
|
+
return tmp0.d2();
|
|
102
164
|
}
|
|
103
165
|
function occurrenceCheck($this, variable, term) {
|
|
104
166
|
var tmp;
|
|
105
|
-
if (term.
|
|
106
|
-
tmp = $this.
|
|
107
|
-
} else if (term.
|
|
108
|
-
var tmp0 = term.
|
|
109
|
-
var tmp$ret$
|
|
167
|
+
if (term.zt()) {
|
|
168
|
+
tmp = $this.v1g(variable, term);
|
|
169
|
+
} else if (term.jt()) {
|
|
170
|
+
var tmp0 = term.ft();
|
|
171
|
+
var tmp$ret$0;
|
|
110
172
|
$l$block: {
|
|
111
173
|
// Inline function 'kotlin.sequences.any' call
|
|
112
|
-
var _iterator__ex2g4s = tmp0.
|
|
113
|
-
while (_iterator__ex2g4s.
|
|
114
|
-
var element = _iterator__ex2g4s.
|
|
174
|
+
var _iterator__ex2g4s = tmp0.m();
|
|
175
|
+
while (_iterator__ex2g4s.p()) {
|
|
176
|
+
var element = _iterator__ex2g4s.q();
|
|
115
177
|
if (occurrenceCheck($this, variable, element)) {
|
|
116
|
-
tmp$ret$
|
|
178
|
+
tmp$ret$0 = true;
|
|
117
179
|
break $l$block;
|
|
118
180
|
}
|
|
119
181
|
}
|
|
120
|
-
tmp$ret$
|
|
182
|
+
tmp$ret$0 = false;
|
|
121
183
|
}
|
|
122
|
-
tmp = tmp$ret$
|
|
184
|
+
tmp = tmp$ret$0;
|
|
123
185
|
} else {
|
|
124
186
|
tmp = false;
|
|
125
187
|
}
|
|
@@ -127,7 +189,7 @@
|
|
|
127
189
|
}
|
|
128
190
|
function equationsFor($this, term1, term2) {
|
|
129
191
|
var tmp = Companion_instance_0;
|
|
130
|
-
return tmp.
|
|
192
|
+
return tmp.w1g(term1, term2, AbstractUnificator$checkTermsEquality$ref($this));
|
|
131
193
|
}
|
|
132
194
|
function equationsFor_0($this, substitution1, substitution2) {
|
|
133
195
|
var tmp = Companion_instance_0;
|
|
@@ -145,7 +207,7 @@
|
|
|
145
207
|
}
|
|
146
208
|
while (inductionVariable < exceptIndex);
|
|
147
209
|
var inductionVariable_0 = exceptIndex + 1 | 0;
|
|
148
|
-
var last = equations.
|
|
210
|
+
var last = equations.s();
|
|
149
211
|
if (inductionVariable_0 < last)
|
|
150
212
|
do {
|
|
151
213
|
var i_0 = inductionVariable_0;
|
|
@@ -155,36 +217,37 @@
|
|
|
155
217
|
while (inductionVariable_0 < last);
|
|
156
218
|
return changed._v;
|
|
157
219
|
}
|
|
158
|
-
function mgu_0($this, equations, occurCheckEnabled) {
|
|
220
|
+
function mgu_0($this, request, equations, occurCheckEnabled) {
|
|
159
221
|
var changed = true;
|
|
160
222
|
while (changed) {
|
|
161
223
|
changed = false;
|
|
162
|
-
var eqIterator = equations.
|
|
163
|
-
while (eqIterator.
|
|
164
|
-
var eq = eqIterator.
|
|
165
|
-
if (eq.
|
|
224
|
+
var eqIterator = equations.a4();
|
|
225
|
+
while (eqIterator.p()) {
|
|
226
|
+
var eq = $this.x1g(request, eqIterator.q());
|
|
227
|
+
if (eq.c1h()) {
|
|
166
228
|
return Companion_getInstance().failed();
|
|
167
|
-
} else if (eq.
|
|
168
|
-
eqIterator.
|
|
229
|
+
} else if (eq.d1h()) {
|
|
230
|
+
eqIterator.a3();
|
|
169
231
|
changed = true;
|
|
170
|
-
} else if (eq.
|
|
171
|
-
var assignment = eq.
|
|
172
|
-
if (occurCheckEnabled && occurrenceCheck($this, assignment.
|
|
232
|
+
} else if (eq.m1h()) {
|
|
233
|
+
var assignment = eq.castToAssignment();
|
|
234
|
+
if (occurCheckEnabled && occurrenceCheck($this, assignment.k1h(), assignment.l1h())) {
|
|
173
235
|
return Companion_getInstance().failed();
|
|
174
236
|
} else {
|
|
175
|
-
changed = changed || applySubstitutionToEquations($this, assignment.
|
|
237
|
+
changed = changed || applySubstitutionToEquations($this, assignment.j1h(), equations, eqIterator.o3());
|
|
176
238
|
}
|
|
177
|
-
} else if (eq.
|
|
178
|
-
eqIterator.
|
|
179
|
-
var _iterator__ex2g4s = equationsFor($this, eq.
|
|
180
|
-
|
|
181
|
-
var it = _iterator__ex2g4s.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
239
|
+
} else if (eq.e1h()) {
|
|
240
|
+
eqIterator.a3();
|
|
241
|
+
var _iterator__ex2g4s = equationsFor($this, eq.a1h(), eq.b1h()).m();
|
|
242
|
+
$l$loop: while (_iterator__ex2g4s.p()) {
|
|
243
|
+
var it = _iterator__ex2g4s.q();
|
|
244
|
+
var subEq = it.c1h() || it.d1h() ? $this.x1g(request, it) : it;
|
|
245
|
+
if (subEq.d1h())
|
|
246
|
+
continue $l$loop;
|
|
247
|
+
else if (subEq.c1h())
|
|
185
248
|
return Companion_getInstance().failed();
|
|
186
249
|
else {
|
|
187
|
-
eqIterator.
|
|
250
|
+
eqIterator.r3(subEq);
|
|
188
251
|
}
|
|
189
252
|
}
|
|
190
253
|
changed = true;
|
|
@@ -194,14 +257,14 @@
|
|
|
194
257
|
// Inline function 'kotlin.collections.filter' call
|
|
195
258
|
// Inline function 'kotlin.collections.filterTo' call
|
|
196
259
|
var destination = ArrayList_init_$Create$();
|
|
197
|
-
var _iterator__ex2g4s_0 = equations.
|
|
198
|
-
while (_iterator__ex2g4s_0.
|
|
199
|
-
var element = _iterator__ex2g4s_0.
|
|
200
|
-
if (element.
|
|
201
|
-
destination.
|
|
260
|
+
var _iterator__ex2g4s_0 = equations.m();
|
|
261
|
+
while (_iterator__ex2g4s_0.p()) {
|
|
262
|
+
var element = _iterator__ex2g4s_0.q();
|
|
263
|
+
if (element.m1h()) {
|
|
264
|
+
destination.j(element);
|
|
202
265
|
}
|
|
203
266
|
}
|
|
204
|
-
return toSubstitution(destination);
|
|
267
|
+
return $this.n1h(request, toSubstitution(destination));
|
|
205
268
|
}
|
|
206
269
|
function newDeque($this, items) {
|
|
207
270
|
// Inline function 'kotlin.collections.arrayListOf' call
|
|
@@ -210,91 +273,87 @@
|
|
|
210
273
|
}
|
|
211
274
|
function AbstractUnificator$contextEquations$delegate$lambda(this$0) {
|
|
212
275
|
return function () {
|
|
213
|
-
return toEquations(this$0.
|
|
276
|
+
return toEquations(this$0.g8());
|
|
214
277
|
};
|
|
215
278
|
}
|
|
216
279
|
function AbstractUnificator$_get_contextEquations_$ref_7ajcte() {
|
|
217
|
-
return function (p0) {
|
|
280
|
+
return constructCallableReference(function (p0) {
|
|
218
281
|
return _get_contextEquations__x0dd77(p0);
|
|
219
|
-
};
|
|
282
|
+
}, 1, 0, 25);
|
|
220
283
|
}
|
|
221
284
|
function AbstractUnificator$checkTermsEquality$ref(p0) {
|
|
222
|
-
|
|
223
|
-
return p0.
|
|
224
|
-
};
|
|
225
|
-
l.callableName = 'checkTermsEquality';
|
|
226
|
-
return l;
|
|
285
|
+
return constructCallableReference(function (p0_0, p1) {
|
|
286
|
+
return p0.v1g(p0_0, p1);
|
|
287
|
+
}, 2, 0, 26, 'checkTermsEquality', [p0]);
|
|
227
288
|
}
|
|
228
289
|
function AbstractUnificator$equationsFor$lambda(it) {
|
|
229
290
|
// Inline function 'kotlin.collections.toPair' call
|
|
230
|
-
return new Pair(it.
|
|
231
|
-
}
|
|
232
|
-
function AbstractUnificator$checkTermsEquality$ref_0(p0) {
|
|
233
|
-
var l = function (_this__u8e3s4, p0_0) {
|
|
234
|
-
return p0.u1f(_this__u8e3s4, p0_0);
|
|
235
|
-
};
|
|
236
|
-
l.callableName = 'checkTermsEquality';
|
|
237
|
-
return l;
|
|
291
|
+
return new Pair(it.c2(), it.d2());
|
|
238
292
|
}
|
|
239
293
|
function applySubstitutionToEquations$handleIndex($equations, $substitution, this$0, changed, i) {
|
|
240
|
-
if ($equations.
|
|
294
|
+
if ($equations.t(i).c1h() || $equations.t(i).d1h())
|
|
241
295
|
return Unit_instance;
|
|
242
|
-
var currentEq = $equations.
|
|
296
|
+
var currentEq = $equations.t(i);
|
|
243
297
|
var _destruct__k2r9zo = currentEq.apply($substitution).toPair();
|
|
244
|
-
var newLhs = _destruct__k2r9zo.
|
|
245
|
-
var newRhs = _destruct__k2r9zo.
|
|
246
|
-
if (!currentEq.
|
|
298
|
+
var newLhs = _destruct__k2r9zo.ub();
|
|
299
|
+
var newRhs = _destruct__k2r9zo.vb();
|
|
300
|
+
if (!currentEq.a1h().equals(newLhs) || !currentEq.b1h().equals(newRhs)) {
|
|
247
301
|
var tmp = Companion_instance_0;
|
|
248
|
-
$equations.
|
|
302
|
+
$equations.x3(i, tmp.o1h(newLhs, newRhs, AbstractUnificator$checkTermsEquality$ref(this$0)));
|
|
249
303
|
changed._v = true;
|
|
250
304
|
}
|
|
251
305
|
}
|
|
252
306
|
function AbstractUnificator(context) {
|
|
253
|
-
|
|
254
|
-
this.s1f_1 = context;
|
|
307
|
+
this.t1g_1 = context;
|
|
255
308
|
var tmp = this;
|
|
256
|
-
tmp.
|
|
309
|
+
tmp.u1g_1 = lazy(AbstractUnificator$contextEquations$delegate$lambda(this));
|
|
257
310
|
}
|
|
258
|
-
protoOf(AbstractUnificator).
|
|
259
|
-
return this.
|
|
311
|
+
protoOf(AbstractUnificator).g8 = function () {
|
|
312
|
+
return this.t1g_1;
|
|
313
|
+
};
|
|
314
|
+
protoOf(AbstractUnificator).n1h = function (request, result) {
|
|
315
|
+
return result;
|
|
316
|
+
};
|
|
317
|
+
protoOf(AbstractUnificator).x1g = function (request, equation) {
|
|
318
|
+
return equation;
|
|
260
319
|
};
|
|
261
|
-
protoOf(AbstractUnificator).
|
|
262
|
-
if (this.
|
|
320
|
+
protoOf(AbstractUnificator).p1h = function (term1, term2, occurCheckEnabled) {
|
|
321
|
+
if (this.g8().iz())
|
|
263
322
|
return Companion_getInstance().failed();
|
|
264
323
|
var equations = newDeque(this, plus(asSequence_0(_get_contextEquations__x0dd77(this)), equationsFor(this, term1, term2)));
|
|
265
|
-
return mgu_0(this, equations, occurCheckEnabled);
|
|
324
|
+
return mgu_0(this, new Mgu(term1, term2, occurCheckEnabled), equations, occurCheckEnabled);
|
|
266
325
|
};
|
|
267
326
|
protoOf(AbstractUnificator).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
268
327
|
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof AbstractUnificator) ? $super : THROW_CCE());
|
|
269
328
|
};
|
|
270
|
-
protoOf(AbstractUnificator).
|
|
271
|
-
if (this.
|
|
329
|
+
protoOf(AbstractUnificator).q1h = function (substitution1, substitution2, occurCheckEnabled) {
|
|
330
|
+
if (this.g8().iz() || substitution1.iz() || substitution2.iz())
|
|
272
331
|
return Companion_getInstance().failed();
|
|
273
332
|
if (!occurCheckEnabled) {
|
|
274
|
-
var quickMerge = this.
|
|
275
|
-
if (quickMerge.
|
|
333
|
+
var quickMerge = this.g8().plus(substitution1).plus(substitution2);
|
|
334
|
+
if (quickMerge.hz()) {
|
|
276
335
|
return quickMerge;
|
|
277
336
|
}
|
|
278
337
|
}
|
|
279
338
|
var equations = newDeque(this, plus(asSequence_0(_get_contextEquations__x0dd77(this)), equationsFor_0(this, substitution1, substitution2)));
|
|
280
|
-
return mgu_0(this, equations, occurCheckEnabled);
|
|
339
|
+
return mgu_0(this, new Merge(substitution1, substitution2, occurCheckEnabled), equations, occurCheckEnabled);
|
|
281
340
|
};
|
|
282
341
|
protoOf(AbstractUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
283
|
-
return this.
|
|
342
|
+
return this.q1h(substitution1, substitution2, occurCheckEnabled);
|
|
284
343
|
};
|
|
285
344
|
function CachedUnificator(decorated, cacheCapacity) {
|
|
286
|
-
this.
|
|
287
|
-
this.
|
|
345
|
+
this.r1h_1 = decorated;
|
|
346
|
+
this.s1h_1 = Companion_instance.ao(cacheCapacity);
|
|
288
347
|
}
|
|
289
|
-
protoOf(CachedUnificator).
|
|
348
|
+
protoOf(CachedUnificator).p1h = function (term1, term2, occurCheckEnabled) {
|
|
290
349
|
var mguRequest = new Triple(term1, term2, occurCheckEnabled);
|
|
291
|
-
var cached = this.
|
|
350
|
+
var cached = this.s1h_1.g2(mguRequest);
|
|
292
351
|
var tmp;
|
|
293
352
|
if (cached instanceof Some) {
|
|
294
|
-
tmp = cached.
|
|
353
|
+
tmp = cached.do_1;
|
|
295
354
|
} else {
|
|
296
|
-
var mguResult = this.
|
|
297
|
-
this.
|
|
355
|
+
var mguResult = this.r1h_1.p1h(term1, term2, occurCheckEnabled);
|
|
356
|
+
this.s1h_1.bo(mguRequest, mguResult);
|
|
298
357
|
tmp = mguResult;
|
|
299
358
|
}
|
|
300
359
|
return tmp;
|
|
@@ -302,123 +361,105 @@
|
|
|
302
361
|
protoOf(CachedUnificator).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
303
362
|
return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof CachedUnificator) ? $super : THROW_CCE());
|
|
304
363
|
};
|
|
305
|
-
protoOf(CachedUnificator).
|
|
364
|
+
protoOf(CachedUnificator).q1h = function (substitution1, substitution2, occurCheckEnabled) {
|
|
306
365
|
var mguRequest = new Triple(substitution1, substitution2, occurCheckEnabled);
|
|
307
|
-
var cached = this.
|
|
366
|
+
var cached = this.s1h_1.g2(mguRequest);
|
|
308
367
|
var tmp;
|
|
309
368
|
if (cached instanceof Some) {
|
|
310
|
-
tmp = cached.
|
|
369
|
+
tmp = cached.do_1;
|
|
311
370
|
} else {
|
|
312
|
-
var mguResult = this.
|
|
313
|
-
this.
|
|
371
|
+
var mguResult = this.r1h_1.mergeWithOccurCheck(substitution1, substitution2, occurCheckEnabled);
|
|
372
|
+
this.s1h_1.bo(mguRequest, mguResult);
|
|
314
373
|
tmp = mguResult;
|
|
315
374
|
}
|
|
316
375
|
return tmp;
|
|
317
376
|
};
|
|
318
377
|
protoOf(CachedUnificator).mergeWithOccurCheck = function (substitution1, substitution2, occurCheckEnabled) {
|
|
319
|
-
return this.
|
|
378
|
+
return this.q1h(substitution1, substitution2, occurCheckEnabled);
|
|
320
379
|
};
|
|
321
380
|
function allOfLists($this, lhs, rhs, equalityChecker) {
|
|
322
|
-
var tmp
|
|
323
|
-
|
|
381
|
+
var tmp;
|
|
382
|
+
if (equalityChecker === VOID) {
|
|
383
|
+
tmp = Term$equals$ref();
|
|
384
|
+
} else {
|
|
385
|
+
tmp = equalityChecker;
|
|
386
|
+
}
|
|
387
|
+
equalityChecker = tmp;
|
|
388
|
+
var tmp_0 = zip(lhs.unfold(), rhs.unfold());
|
|
389
|
+
return flatMap(tmp_0, Equation$Companion$allOfLists$lambda(equalityChecker));
|
|
324
390
|
}
|
|
325
391
|
function allOfTuples($this, lhs, rhs, equalityChecker) {
|
|
326
|
-
var tmp
|
|
327
|
-
|
|
392
|
+
var tmp;
|
|
393
|
+
if (equalityChecker === VOID) {
|
|
394
|
+
tmp = Term$equals$ref();
|
|
395
|
+
} else {
|
|
396
|
+
tmp = equalityChecker;
|
|
397
|
+
}
|
|
398
|
+
equalityChecker = tmp;
|
|
399
|
+
var tmp_0 = zip(lhs.unfold(), rhs.unfold());
|
|
400
|
+
return flatMap(tmp_0, Equation$Companion$allOfTuples$lambda(equalityChecker));
|
|
328
401
|
}
|
|
329
402
|
function Term$equals$ref() {
|
|
330
|
-
|
|
403
|
+
return constructCallableReference(function (p0, p1) {
|
|
331
404
|
return p0.equals(p1);
|
|
332
|
-
};
|
|
333
|
-
l.callableName = 'equals';
|
|
334
|
-
return l;
|
|
335
|
-
}
|
|
336
|
-
function Term$equals$ref_0() {
|
|
337
|
-
var l = function (p0, p1) {
|
|
338
|
-
return p0.equals(p1);
|
|
339
|
-
};
|
|
340
|
-
l.callableName = 'equals';
|
|
341
|
-
return l;
|
|
342
|
-
}
|
|
343
|
-
function Term$equals$ref_1() {
|
|
344
|
-
var l = function (p0, p1) {
|
|
345
|
-
return p0.equals(p1);
|
|
346
|
-
};
|
|
347
|
-
l.callableName = 'equals';
|
|
348
|
-
return l;
|
|
405
|
+
}, 2, 0, 27, 'equals');
|
|
349
406
|
}
|
|
350
407
|
function Equation$Companion$from$lambda($equalityChecker) {
|
|
351
408
|
return function (it) {
|
|
352
|
-
return Companion_instance_0.
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
function Term$equals$ref_2() {
|
|
356
|
-
var l = function (p0, p1) {
|
|
357
|
-
return p0.equals(p1);
|
|
358
|
-
};
|
|
359
|
-
l.callableName = 'equals';
|
|
360
|
-
return l;
|
|
361
|
-
}
|
|
362
|
-
function Term$equals$ref_3() {
|
|
363
|
-
var l = function (p0, p1) {
|
|
364
|
-
return p0.equals(p1);
|
|
365
|
-
};
|
|
366
|
-
l.callableName = 'equals';
|
|
367
|
-
return l;
|
|
368
|
-
}
|
|
369
|
-
function Term$equals$ref_4() {
|
|
370
|
-
var l = function (p0, p1) {
|
|
371
|
-
return p0.equals(p1);
|
|
409
|
+
return Companion_instance_0.t1h(it, $equalityChecker);
|
|
372
410
|
};
|
|
373
|
-
l.callableName = 'equals';
|
|
374
|
-
return l;
|
|
375
411
|
}
|
|
376
412
|
function Equation$Companion$allOfLists$lambda($equalityChecker) {
|
|
377
413
|
return function (_destruct__k2r9zo) {
|
|
378
|
-
var l = _destruct__k2r9zo.
|
|
379
|
-
var r = _destruct__k2r9zo.
|
|
380
|
-
return l.
|
|
414
|
+
var l = _destruct__k2r9zo.ub();
|
|
415
|
+
var r = _destruct__k2r9zo.vb();
|
|
416
|
+
return l.qt() && r.qt() ? sequenceOf(Companion_instance_0.o1h(l.castToCons().jv(), r.castToCons().jv(), $equalityChecker)) : l.pt() && r.pt() ? sequenceOf(Companion_instance_0.o1h(l.castToList(), r.castToList(), $equalityChecker)) : Companion_instance_0.w1g(l, r, $equalityChecker);
|
|
381
417
|
};
|
|
382
418
|
}
|
|
383
419
|
function Equation$Companion$allOfTuples$lambda($equalityChecker) {
|
|
384
420
|
return function (_destruct__k2r9zo) {
|
|
385
|
-
var l = _destruct__k2r9zo.
|
|
386
|
-
var r = _destruct__k2r9zo.
|
|
387
|
-
return l.
|
|
421
|
+
var l = _destruct__k2r9zo.ub();
|
|
422
|
+
var r = _destruct__k2r9zo.vb();
|
|
423
|
+
return l.ot() && r.ot() ? sequenceOf(Companion_instance_0.o1h(l.castToTuple().xu(), r.castToTuple().xu(), $equalityChecker)) : Companion_instance_0.w1g(l, r, $equalityChecker);
|
|
388
424
|
};
|
|
389
425
|
}
|
|
390
|
-
function Term$equals$ref_5() {
|
|
391
|
-
var l = function (p0, p1) {
|
|
392
|
-
return p0.equals(p1);
|
|
393
|
-
};
|
|
394
|
-
l.callableName = 'equals';
|
|
395
|
-
return l;
|
|
396
|
-
}
|
|
397
426
|
function Equation$Companion$allOf$lambda($equalityChecker) {
|
|
398
427
|
return function (it) {
|
|
399
|
-
return Companion_instance_0.
|
|
428
|
+
return Companion_instance_0.t1h(it, $equalityChecker);
|
|
400
429
|
};
|
|
401
430
|
}
|
|
402
431
|
function Identity(lhs, rhs) {
|
|
403
432
|
Equation.call(this, lhs, rhs);
|
|
404
|
-
this.
|
|
405
|
-
this.
|
|
433
|
+
this.w1h_1 = lhs;
|
|
434
|
+
this.x1h_1 = rhs;
|
|
406
435
|
}
|
|
407
|
-
protoOf(Identity).
|
|
408
|
-
return this.
|
|
436
|
+
protoOf(Identity).a1h = function () {
|
|
437
|
+
return this.w1h_1;
|
|
409
438
|
};
|
|
410
|
-
protoOf(Identity).
|
|
411
|
-
return this.
|
|
439
|
+
protoOf(Identity).b1h = function () {
|
|
440
|
+
return this.x1h_1;
|
|
412
441
|
};
|
|
413
|
-
protoOf(Identity).
|
|
442
|
+
protoOf(Identity).d1h = function () {
|
|
414
443
|
return true;
|
|
415
444
|
};
|
|
445
|
+
protoOf(Identity).y1h = function () {
|
|
446
|
+
return this;
|
|
447
|
+
};
|
|
448
|
+
protoOf(Identity).asIdentity = function () {
|
|
449
|
+
return this.y1h();
|
|
450
|
+
};
|
|
451
|
+
protoOf(Identity).z1h = function (lhs, rhs) {
|
|
452
|
+
return this.a1i(lhs, rhs);
|
|
453
|
+
};
|
|
454
|
+
protoOf(Identity).a1i = function (lhs, rhs) {
|
|
455
|
+
return new Identity(lhs, rhs);
|
|
456
|
+
};
|
|
416
457
|
protoOf(Identity).toString = function () {
|
|
417
|
-
return 'Identity(lhs=' + this.
|
|
458
|
+
return 'Identity(lhs=' + this.w1h_1.toString() + ', rhs=' + this.x1h_1.toString() + ')';
|
|
418
459
|
};
|
|
419
460
|
protoOf(Identity).hashCode = function () {
|
|
420
|
-
var result = this.
|
|
421
|
-
result = imul(result, 31) + this.
|
|
461
|
+
var result = this.w1h_1.hashCode();
|
|
462
|
+
result = imul(result, 31) + this.x1h_1.hashCode() | 0;
|
|
422
463
|
return result;
|
|
423
464
|
};
|
|
424
465
|
protoOf(Identity).equals = function (other) {
|
|
@@ -426,77 +467,194 @@
|
|
|
426
467
|
return true;
|
|
427
468
|
if (!(other instanceof Identity))
|
|
428
469
|
return false;
|
|
429
|
-
if (!this.
|
|
470
|
+
if (!this.w1h_1.equals(other.w1h_1))
|
|
430
471
|
return false;
|
|
431
|
-
if (!this.
|
|
472
|
+
if (!this.x1h_1.equals(other.x1h_1))
|
|
432
473
|
return false;
|
|
433
474
|
return true;
|
|
434
475
|
};
|
|
435
476
|
function Assignment(lhs, rhs) {
|
|
436
477
|
Equation.call(this, lhs, rhs);
|
|
437
|
-
this.
|
|
438
|
-
this.
|
|
478
|
+
this.h1h_1 = lhs;
|
|
479
|
+
this.i1h_1 = rhs;
|
|
439
480
|
}
|
|
440
|
-
protoOf(Assignment).
|
|
441
|
-
return this.
|
|
481
|
+
protoOf(Assignment).a1h = function () {
|
|
482
|
+
return this.h1h_1;
|
|
483
|
+
};
|
|
484
|
+
protoOf(Assignment).b1h = function () {
|
|
485
|
+
return this.i1h_1;
|
|
486
|
+
};
|
|
487
|
+
protoOf(Assignment).m1h = function () {
|
|
488
|
+
return true;
|
|
489
|
+
};
|
|
490
|
+
protoOf(Assignment).e1i = function () {
|
|
491
|
+
return this;
|
|
492
|
+
};
|
|
493
|
+
protoOf(Assignment).asAssignment = function () {
|
|
494
|
+
return this.e1i();
|
|
442
495
|
};
|
|
443
|
-
protoOf(Assignment).
|
|
444
|
-
return this.
|
|
496
|
+
protoOf(Assignment).f1i = function () {
|
|
497
|
+
return new Pair(this.k1h(), this.l1h());
|
|
498
|
+
};
|
|
499
|
+
protoOf(Assignment).toAssignmentPair = function () {
|
|
500
|
+
return this.f1i();
|
|
501
|
+
};
|
|
502
|
+
protoOf(Assignment).j1h = function () {
|
|
503
|
+
return Companion_getInstance().unifier(this.k1h(), this.l1h());
|
|
445
504
|
};
|
|
446
505
|
protoOf(Assignment).toSubstitution = function () {
|
|
447
|
-
return
|
|
506
|
+
return this.j1h();
|
|
507
|
+
};
|
|
508
|
+
function LeftAssignment(lhs, rhs) {
|
|
509
|
+
Assignment.call(this, lhs, rhs);
|
|
510
|
+
this.k1i_1 = lhs;
|
|
511
|
+
this.l1i_1 = rhs;
|
|
512
|
+
this.m1i_1 = this.k1i_1;
|
|
513
|
+
this.n1i_1 = this.l1i_1;
|
|
514
|
+
}
|
|
515
|
+
protoOf(LeftAssignment).a1h = function () {
|
|
516
|
+
return this.k1i_1;
|
|
517
|
+
};
|
|
518
|
+
protoOf(LeftAssignment).b1h = function () {
|
|
519
|
+
return this.l1i_1;
|
|
520
|
+
};
|
|
521
|
+
protoOf(LeftAssignment).k1h = function () {
|
|
522
|
+
return this.m1i_1;
|
|
523
|
+
};
|
|
524
|
+
protoOf(LeftAssignment).l1h = function () {
|
|
525
|
+
return this.n1i_1;
|
|
448
526
|
};
|
|
449
|
-
protoOf(
|
|
450
|
-
return
|
|
527
|
+
protoOf(LeftAssignment).b1i = function () {
|
|
528
|
+
return true;
|
|
529
|
+
};
|
|
530
|
+
protoOf(LeftAssignment).o1i = function () {
|
|
531
|
+
return this;
|
|
532
|
+
};
|
|
533
|
+
protoOf(LeftAssignment).asLeftAssignment = function () {
|
|
534
|
+
return this.o1i();
|
|
535
|
+
};
|
|
536
|
+
protoOf(LeftAssignment).z1h = function (lhs, rhs) {
|
|
537
|
+
return this.p1i(lhs.castToVar(), rhs);
|
|
538
|
+
};
|
|
539
|
+
protoOf(LeftAssignment).q1i = function () {
|
|
540
|
+
return new Pair(this.k1i_1, this.l1i_1);
|
|
541
|
+
};
|
|
542
|
+
protoOf(LeftAssignment).toPair = function () {
|
|
543
|
+
return this.q1i();
|
|
451
544
|
};
|
|
452
|
-
protoOf(
|
|
453
|
-
return
|
|
545
|
+
protoOf(LeftAssignment).p1i = function (lhs, rhs) {
|
|
546
|
+
return new LeftAssignment(lhs, rhs);
|
|
454
547
|
};
|
|
455
|
-
protoOf(
|
|
548
|
+
protoOf(LeftAssignment).toString = function () {
|
|
549
|
+
return 'LeftAssignment(lhs=' + this.k1i_1.toString() + ', rhs=' + this.l1i_1.toString() + ')';
|
|
550
|
+
};
|
|
551
|
+
protoOf(LeftAssignment).hashCode = function () {
|
|
552
|
+
var result = this.k1i_1.hashCode();
|
|
553
|
+
result = imul(result, 31) + this.l1i_1.hashCode() | 0;
|
|
554
|
+
return result;
|
|
555
|
+
};
|
|
556
|
+
protoOf(LeftAssignment).equals = function (other) {
|
|
557
|
+
if (this === other)
|
|
558
|
+
return true;
|
|
559
|
+
if (!(other instanceof LeftAssignment))
|
|
560
|
+
return false;
|
|
561
|
+
if (!this.k1i_1.equals(other.k1i_1))
|
|
562
|
+
return false;
|
|
563
|
+
if (!this.l1i_1.equals(other.l1i_1))
|
|
564
|
+
return false;
|
|
456
565
|
return true;
|
|
457
566
|
};
|
|
458
|
-
|
|
567
|
+
function RightAssignment(lhs, rhs) {
|
|
568
|
+
Assignment.call(this, lhs, rhs);
|
|
569
|
+
this.v1i_1 = lhs;
|
|
570
|
+
this.w1i_1 = rhs;
|
|
571
|
+
this.x1i_1 = this.w1i_1;
|
|
572
|
+
this.y1i_1 = this.v1i_1;
|
|
573
|
+
}
|
|
574
|
+
protoOf(RightAssignment).a1h = function () {
|
|
575
|
+
return this.v1i_1;
|
|
576
|
+
};
|
|
577
|
+
protoOf(RightAssignment).b1h = function () {
|
|
578
|
+
return this.w1i_1;
|
|
579
|
+
};
|
|
580
|
+
protoOf(RightAssignment).k1h = function () {
|
|
581
|
+
return this.x1i_1;
|
|
582
|
+
};
|
|
583
|
+
protoOf(RightAssignment).l1h = function () {
|
|
584
|
+
return this.y1i_1;
|
|
585
|
+
};
|
|
586
|
+
protoOf(RightAssignment).c1i = function () {
|
|
587
|
+
return true;
|
|
588
|
+
};
|
|
589
|
+
protoOf(RightAssignment).z1i = function () {
|
|
459
590
|
return this;
|
|
460
591
|
};
|
|
461
|
-
protoOf(
|
|
462
|
-
return
|
|
592
|
+
protoOf(RightAssignment).asRightAssignment = function () {
|
|
593
|
+
return this.z1i();
|
|
594
|
+
};
|
|
595
|
+
protoOf(RightAssignment).z1h = function (lhs, rhs) {
|
|
596
|
+
return this.a1j(lhs, rhs.castToVar());
|
|
597
|
+
};
|
|
598
|
+
protoOf(RightAssignment).q1i = function () {
|
|
599
|
+
return new Pair(this.v1i_1, this.w1i_1);
|
|
600
|
+
};
|
|
601
|
+
protoOf(RightAssignment).toPair = function () {
|
|
602
|
+
return this.q1i();
|
|
603
|
+
};
|
|
604
|
+
protoOf(RightAssignment).a1j = function (lhs, rhs) {
|
|
605
|
+
return new RightAssignment(lhs, rhs);
|
|
606
|
+
};
|
|
607
|
+
protoOf(RightAssignment).toString = function () {
|
|
608
|
+
return 'RightAssignment(lhs=' + this.v1i_1.toString() + ', rhs=' + this.w1i_1.toString() + ')';
|
|
463
609
|
};
|
|
464
|
-
protoOf(
|
|
465
|
-
var result = this.
|
|
466
|
-
result = imul(result, 31) + this.
|
|
610
|
+
protoOf(RightAssignment).hashCode = function () {
|
|
611
|
+
var result = this.v1i_1.hashCode();
|
|
612
|
+
result = imul(result, 31) + this.w1i_1.hashCode() | 0;
|
|
467
613
|
return result;
|
|
468
614
|
};
|
|
469
|
-
protoOf(
|
|
615
|
+
protoOf(RightAssignment).equals = function (other) {
|
|
470
616
|
if (this === other)
|
|
471
617
|
return true;
|
|
472
|
-
if (!(other instanceof
|
|
618
|
+
if (!(other instanceof RightAssignment))
|
|
473
619
|
return false;
|
|
474
|
-
if (!this.
|
|
620
|
+
if (!this.v1i_1.equals(other.v1i_1))
|
|
475
621
|
return false;
|
|
476
|
-
if (!this.
|
|
622
|
+
if (!this.w1i_1.equals(other.w1i_1))
|
|
477
623
|
return false;
|
|
478
624
|
return true;
|
|
479
625
|
};
|
|
480
626
|
function Comparison(lhs, rhs) {
|
|
481
627
|
Equation.call(this, lhs, rhs);
|
|
482
|
-
this.
|
|
483
|
-
this.
|
|
628
|
+
this.d1j_1 = lhs;
|
|
629
|
+
this.e1j_1 = rhs;
|
|
484
630
|
}
|
|
485
|
-
protoOf(Comparison).
|
|
486
|
-
return this.
|
|
631
|
+
protoOf(Comparison).a1h = function () {
|
|
632
|
+
return this.d1j_1;
|
|
487
633
|
};
|
|
488
|
-
protoOf(Comparison).
|
|
489
|
-
return this.
|
|
634
|
+
protoOf(Comparison).b1h = function () {
|
|
635
|
+
return this.e1j_1;
|
|
490
636
|
};
|
|
491
|
-
protoOf(Comparison).
|
|
637
|
+
protoOf(Comparison).e1h = function () {
|
|
492
638
|
return true;
|
|
493
639
|
};
|
|
640
|
+
protoOf(Comparison).f1j = function () {
|
|
641
|
+
return this;
|
|
642
|
+
};
|
|
643
|
+
protoOf(Comparison).asComparison = function () {
|
|
644
|
+
return this.f1j();
|
|
645
|
+
};
|
|
646
|
+
protoOf(Comparison).z1h = function (lhs, rhs) {
|
|
647
|
+
return this.a1i(lhs, rhs);
|
|
648
|
+
};
|
|
649
|
+
protoOf(Comparison).a1i = function (lhs, rhs) {
|
|
650
|
+
return new Comparison(lhs, rhs);
|
|
651
|
+
};
|
|
494
652
|
protoOf(Comparison).toString = function () {
|
|
495
|
-
return 'Comparison(lhs=' + this.
|
|
653
|
+
return 'Comparison(lhs=' + this.d1j_1.toString() + ', rhs=' + this.e1j_1.toString() + ')';
|
|
496
654
|
};
|
|
497
655
|
protoOf(Comparison).hashCode = function () {
|
|
498
|
-
var result = this.
|
|
499
|
-
result = imul(result, 31) + this.
|
|
656
|
+
var result = this.d1j_1.hashCode();
|
|
657
|
+
result = imul(result, 31) + this.e1j_1.hashCode() | 0;
|
|
500
658
|
return result;
|
|
501
659
|
};
|
|
502
660
|
protoOf(Comparison).equals = function (other) {
|
|
@@ -504,32 +662,50 @@
|
|
|
504
662
|
return true;
|
|
505
663
|
if (!(other instanceof Comparison))
|
|
506
664
|
return false;
|
|
507
|
-
if (!this.
|
|
665
|
+
if (!this.d1j_1.equals(other.d1j_1))
|
|
508
666
|
return false;
|
|
509
|
-
if (!this.
|
|
667
|
+
if (!this.e1j_1.equals(other.e1j_1))
|
|
510
668
|
return false;
|
|
511
669
|
return true;
|
|
512
670
|
};
|
|
513
671
|
function Contradiction(lhs, rhs) {
|
|
514
672
|
Equation.call(this, lhs, rhs);
|
|
515
|
-
this.
|
|
516
|
-
this.
|
|
673
|
+
this.i1j_1 = lhs;
|
|
674
|
+
this.j1j_1 = rhs;
|
|
517
675
|
}
|
|
518
|
-
protoOf(Contradiction).
|
|
519
|
-
return this.
|
|
676
|
+
protoOf(Contradiction).a1h = function () {
|
|
677
|
+
return this.i1j_1;
|
|
520
678
|
};
|
|
521
|
-
protoOf(Contradiction).
|
|
522
|
-
return this.
|
|
679
|
+
protoOf(Contradiction).b1h = function () {
|
|
680
|
+
return this.j1j_1;
|
|
523
681
|
};
|
|
524
|
-
protoOf(Contradiction).
|
|
682
|
+
protoOf(Contradiction).c1h = function () {
|
|
525
683
|
return true;
|
|
526
684
|
};
|
|
685
|
+
protoOf(Contradiction).k1j = function () {
|
|
686
|
+
return this;
|
|
687
|
+
};
|
|
688
|
+
protoOf(Contradiction).asContradiction = function () {
|
|
689
|
+
return this.k1j();
|
|
690
|
+
};
|
|
691
|
+
protoOf(Contradiction).z1h = function (lhs, rhs) {
|
|
692
|
+
return this.a1i(lhs, rhs);
|
|
693
|
+
};
|
|
694
|
+
protoOf(Contradiction).j1h = function () {
|
|
695
|
+
return Companion_getInstance().failed();
|
|
696
|
+
};
|
|
697
|
+
protoOf(Contradiction).toSubstitution = function () {
|
|
698
|
+
return this.j1h();
|
|
699
|
+
};
|
|
700
|
+
protoOf(Contradiction).a1i = function (lhs, rhs) {
|
|
701
|
+
return new Contradiction(lhs, rhs);
|
|
702
|
+
};
|
|
527
703
|
protoOf(Contradiction).toString = function () {
|
|
528
|
-
return 'Contradiction(lhs=' + this.
|
|
704
|
+
return 'Contradiction(lhs=' + this.i1j_1.toString() + ', rhs=' + this.j1j_1.toString() + ')';
|
|
529
705
|
};
|
|
530
706
|
protoOf(Contradiction).hashCode = function () {
|
|
531
|
-
var result = this.
|
|
532
|
-
result = imul(result, 31) + this.
|
|
707
|
+
var result = this.i1j_1.hashCode();
|
|
708
|
+
result = imul(result, 31) + this.j1j_1.hashCode() | 0;
|
|
533
709
|
return result;
|
|
534
710
|
};
|
|
535
711
|
protoOf(Contradiction).equals = function (other) {
|
|
@@ -537,29 +713,29 @@
|
|
|
537
713
|
return true;
|
|
538
714
|
if (!(other instanceof Contradiction))
|
|
539
715
|
return false;
|
|
540
|
-
if (!this.
|
|
716
|
+
if (!this.i1j_1.equals(other.i1j_1))
|
|
541
717
|
return false;
|
|
542
|
-
if (!this.
|
|
718
|
+
if (!this.j1j_1.equals(other.j1j_1))
|
|
543
719
|
return false;
|
|
544
720
|
return true;
|
|
545
721
|
};
|
|
546
722
|
function Companion() {
|
|
547
723
|
}
|
|
548
|
-
protoOf(Companion).
|
|
724
|
+
protoOf(Companion).o1h = function (lhs, rhs, equalityChecker) {
|
|
549
725
|
var tmp;
|
|
550
|
-
if (lhs.
|
|
726
|
+
if (lhs.zt() && rhs.zt()) {
|
|
551
727
|
var tmp_0;
|
|
552
728
|
if (equalityChecker(lhs, rhs)) {
|
|
553
729
|
tmp_0 = new Identity(lhs, rhs);
|
|
554
730
|
} else {
|
|
555
|
-
tmp_0 = new
|
|
731
|
+
tmp_0 = new LeftAssignment(lhs.castToVar(), rhs);
|
|
556
732
|
}
|
|
557
733
|
tmp = tmp_0;
|
|
558
|
-
} else if (lhs.
|
|
559
|
-
tmp = new
|
|
560
|
-
} else if (rhs.
|
|
561
|
-
tmp = new
|
|
562
|
-
} else if (lhs.
|
|
734
|
+
} else if (lhs.zt()) {
|
|
735
|
+
tmp = new LeftAssignment(lhs.castToVar(), rhs);
|
|
736
|
+
} else if (rhs.zt()) {
|
|
737
|
+
tmp = new RightAssignment(lhs, rhs.castToVar());
|
|
738
|
+
} else if (lhs.cu() && rhs.cu()) {
|
|
563
739
|
var tmp_1;
|
|
564
740
|
if (equalityChecker(lhs, rhs)) {
|
|
565
741
|
tmp_1 = new Identity(lhs, rhs);
|
|
@@ -567,13 +743,13 @@
|
|
|
567
743
|
tmp_1 = new Contradiction(lhs, rhs);
|
|
568
744
|
}
|
|
569
745
|
tmp = tmp_1;
|
|
570
|
-
} else if (lhs.
|
|
746
|
+
} else if (lhs.cu() || rhs.cu()) {
|
|
571
747
|
tmp = new Contradiction(lhs, rhs);
|
|
572
|
-
} else if (lhs.
|
|
748
|
+
} else if (lhs.jt() && rhs.jt()) {
|
|
573
749
|
var lhsStruct = lhs.castToStruct();
|
|
574
750
|
var rhsStruct = rhs.castToStruct();
|
|
575
751
|
var tmp_2;
|
|
576
|
-
if (!(lhsStruct.
|
|
752
|
+
if (!(lhsStruct.xs() === rhsStruct.xs()) || !(lhsStruct.dt() === rhsStruct.dt())) {
|
|
577
753
|
tmp_2 = new Contradiction(lhsStruct, rhsStruct);
|
|
578
754
|
} else {
|
|
579
755
|
tmp_2 = new Comparison(lhsStruct, rhsStruct);
|
|
@@ -592,192 +768,286 @@
|
|
|
592
768
|
tmp = equalityChecker;
|
|
593
769
|
}
|
|
594
770
|
equalityChecker = tmp;
|
|
595
|
-
return $super === VOID ? this.
|
|
771
|
+
return $super === VOID ? this.o1h(lhs, rhs, equalityChecker) : $super.o1h.call(this, lhs, rhs, equalityChecker);
|
|
596
772
|
};
|
|
597
|
-
protoOf(Companion).
|
|
598
|
-
return this.
|
|
773
|
+
protoOf(Companion).l1j = function (pair, equalityChecker) {
|
|
774
|
+
return this.o1h(pair.first, pair.second, equalityChecker);
|
|
599
775
|
};
|
|
600
776
|
protoOf(Companion).ofPair = function (pair, equalityChecker, $super) {
|
|
601
777
|
var tmp;
|
|
602
778
|
if (equalityChecker === VOID) {
|
|
603
|
-
tmp = Term$equals$
|
|
779
|
+
tmp = Term$equals$ref();
|
|
604
780
|
} else {
|
|
605
781
|
tmp = equalityChecker;
|
|
606
782
|
}
|
|
607
783
|
equalityChecker = tmp;
|
|
608
|
-
return $super === VOID ? this.
|
|
784
|
+
return $super === VOID ? this.l1j(pair, equalityChecker) : $super.l1j.call(this, pair, equalityChecker);
|
|
609
785
|
};
|
|
610
|
-
protoOf(Companion).
|
|
786
|
+
protoOf(Companion).m1j = function (pairs, equalityChecker) {
|
|
611
787
|
return flatMap(pairs, Equation$Companion$from$lambda(equalityChecker));
|
|
612
788
|
};
|
|
613
789
|
protoOf(Companion).fromSequence = function (pairs, equalityChecker, $super) {
|
|
614
790
|
var tmp;
|
|
615
791
|
if (equalityChecker === VOID) {
|
|
616
|
-
tmp = Term$equals$
|
|
792
|
+
tmp = Term$equals$ref();
|
|
617
793
|
} else {
|
|
618
794
|
tmp = equalityChecker;
|
|
619
795
|
}
|
|
620
796
|
equalityChecker = tmp;
|
|
621
|
-
return $super === VOID ? this.
|
|
797
|
+
return $super === VOID ? this.m1j(pairs, equalityChecker) : $super.m1j.call(this, pairs, equalityChecker);
|
|
622
798
|
};
|
|
623
|
-
protoOf(Companion).
|
|
624
|
-
return this.
|
|
799
|
+
protoOf(Companion).n1j = function (pairs, equalityChecker) {
|
|
800
|
+
return this.m1j(asSequence_0(pairs), equalityChecker);
|
|
625
801
|
};
|
|
626
802
|
protoOf(Companion).fromIterable = function (pairs, equalityChecker, $super) {
|
|
627
803
|
var tmp;
|
|
628
804
|
if (equalityChecker === VOID) {
|
|
629
|
-
tmp = Term$equals$
|
|
805
|
+
tmp = Term$equals$ref();
|
|
630
806
|
} else {
|
|
631
807
|
tmp = equalityChecker;
|
|
632
808
|
}
|
|
633
809
|
equalityChecker = tmp;
|
|
634
|
-
return $super === VOID ? this.
|
|
810
|
+
return $super === VOID ? this.n1j(pairs, equalityChecker) : $super.n1j.call(this, pairs, equalityChecker);
|
|
635
811
|
};
|
|
636
|
-
protoOf(Companion).
|
|
637
|
-
return this.
|
|
812
|
+
protoOf(Companion).o1j = function (pairs, equalityChecker) {
|
|
813
|
+
return this.m1j(sequenceOf_0(pairs.slice()), equalityChecker);
|
|
638
814
|
};
|
|
639
815
|
protoOf(Companion).from = function (pairs, equalityChecker, $super) {
|
|
640
816
|
var tmp;
|
|
641
817
|
if (equalityChecker === VOID) {
|
|
642
|
-
tmp = Term$equals$
|
|
818
|
+
tmp = Term$equals$ref();
|
|
643
819
|
} else {
|
|
644
820
|
tmp = equalityChecker;
|
|
645
821
|
}
|
|
646
822
|
equalityChecker = tmp;
|
|
647
|
-
return $super === VOID ? this.
|
|
823
|
+
return $super === VOID ? this.o1j(pairs, equalityChecker) : $super.o1j.call(this, pairs, equalityChecker);
|
|
648
824
|
};
|
|
649
|
-
protoOf(Companion).
|
|
650
|
-
return this.
|
|
825
|
+
protoOf(Companion).t1h = function (pair, equalityChecker) {
|
|
826
|
+
return this.w1g(pair.first, pair.second, equalityChecker);
|
|
651
827
|
};
|
|
652
828
|
protoOf(Companion).allOfPair = function (pair, equalityChecker, $super) {
|
|
653
829
|
var tmp;
|
|
654
830
|
if (equalityChecker === VOID) {
|
|
655
|
-
tmp = Term$equals$
|
|
831
|
+
tmp = Term$equals$ref();
|
|
656
832
|
} else {
|
|
657
833
|
tmp = equalityChecker;
|
|
658
834
|
}
|
|
659
835
|
equalityChecker = tmp;
|
|
660
|
-
return $super === VOID ? this.
|
|
836
|
+
return $super === VOID ? this.t1h(pair, equalityChecker) : $super.t1h.call(this, pair, equalityChecker);
|
|
661
837
|
};
|
|
662
|
-
protoOf(Companion).
|
|
838
|
+
protoOf(Companion).w1g = function (lhs, rhs, equalityChecker) {
|
|
663
839
|
var tmp;
|
|
664
|
-
if (lhs.
|
|
665
|
-
tmp = sequenceOf(this.
|
|
666
|
-
} else if (lhs.
|
|
840
|
+
if (lhs.ys() && rhs.ys()) {
|
|
841
|
+
tmp = sequenceOf(this.o1h(lhs, rhs, equalityChecker));
|
|
842
|
+
} else if (lhs.pt() && rhs.pt()) {
|
|
667
843
|
tmp = allOfLists(this, lhs.castToList(), rhs.castToList(), equalityChecker);
|
|
668
|
-
} else if (lhs.
|
|
844
|
+
} else if (lhs.ot() && rhs.ot()) {
|
|
669
845
|
tmp = allOfTuples(this, lhs.castToTuple(), rhs.castToTuple(), equalityChecker);
|
|
670
|
-
} else if (lhs.
|
|
846
|
+
} else if (lhs.jt() && rhs.jt()) {
|
|
671
847
|
var lhsStruct = lhs.castToStruct();
|
|
672
848
|
var rhsStruct = rhs.castToStruct();
|
|
673
849
|
var tmp_0;
|
|
674
|
-
if (lhsStruct.
|
|
675
|
-
var tmp_1 = zip(lhsStruct.
|
|
850
|
+
if (lhsStruct.xs() === rhsStruct.xs() && lhsStruct.dt() === rhsStruct.dt()) {
|
|
851
|
+
var tmp_1 = zip(lhsStruct.wt(), rhsStruct.wt());
|
|
676
852
|
tmp_0 = flatMap(tmp_1, Equation$Companion$allOf$lambda(equalityChecker));
|
|
677
853
|
} else {
|
|
678
|
-
tmp_0 = sequenceOf(this.
|
|
854
|
+
tmp_0 = sequenceOf(this.o1h(lhs, rhs, equalityChecker));
|
|
679
855
|
}
|
|
680
856
|
tmp = tmp_0;
|
|
681
857
|
} else {
|
|
682
|
-
tmp = sequenceOf(this.
|
|
858
|
+
tmp = sequenceOf(this.o1h(lhs, rhs, equalityChecker));
|
|
683
859
|
}
|
|
684
860
|
return tmp;
|
|
685
861
|
};
|
|
686
862
|
protoOf(Companion).allOf = function (lhs, rhs, equalityChecker, $super) {
|
|
687
863
|
var tmp;
|
|
688
864
|
if (equalityChecker === VOID) {
|
|
689
|
-
tmp = Term$equals$
|
|
865
|
+
tmp = Term$equals$ref();
|
|
690
866
|
} else {
|
|
691
867
|
tmp = equalityChecker;
|
|
692
868
|
}
|
|
693
869
|
equalityChecker = tmp;
|
|
694
|
-
return $super === VOID ? this.
|
|
870
|
+
return $super === VOID ? this.w1g(lhs, rhs, equalityChecker) : $super.w1g.call(this, lhs, rhs, equalityChecker);
|
|
695
871
|
};
|
|
696
872
|
var Companion_instance_0;
|
|
697
873
|
function Companion_getInstance_1() {
|
|
698
874
|
return Companion_instance_0;
|
|
699
875
|
}
|
|
700
|
-
function Term$equals$ref_6() {
|
|
701
|
-
var l = function (p0, p1) {
|
|
702
|
-
return p0.equals(p1);
|
|
703
|
-
};
|
|
704
|
-
l.callableName = 'equals';
|
|
705
|
-
return l;
|
|
706
|
-
}
|
|
707
876
|
function Equation(lhs, rhs) {
|
|
708
|
-
this.
|
|
709
|
-
this.
|
|
877
|
+
this.y1g_1 = lhs;
|
|
878
|
+
this.z1g_1 = rhs;
|
|
710
879
|
}
|
|
711
|
-
protoOf(Equation).
|
|
712
|
-
return this.
|
|
880
|
+
protoOf(Equation).a1h = function () {
|
|
881
|
+
return this.y1g_1;
|
|
713
882
|
};
|
|
714
|
-
protoOf(Equation).
|
|
715
|
-
return this.
|
|
883
|
+
protoOf(Equation).b1h = function () {
|
|
884
|
+
return this.z1g_1;
|
|
716
885
|
};
|
|
717
|
-
protoOf(Equation).
|
|
886
|
+
protoOf(Equation).d1h = function () {
|
|
718
887
|
return false;
|
|
719
888
|
};
|
|
720
|
-
protoOf(Equation).
|
|
889
|
+
protoOf(Equation).asIdentity = function () {
|
|
890
|
+
return null;
|
|
891
|
+
};
|
|
892
|
+
protoOf(Equation).castToIdentity = function () {
|
|
893
|
+
var tmp0_elvis_lhs = this.asIdentity();
|
|
894
|
+
var tmp;
|
|
895
|
+
if (tmp0_elvis_lhs == null) {
|
|
896
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(Identity).a9());
|
|
897
|
+
} else {
|
|
898
|
+
tmp = tmp0_elvis_lhs;
|
|
899
|
+
}
|
|
900
|
+
return tmp;
|
|
901
|
+
};
|
|
902
|
+
protoOf(Equation).m1h = function () {
|
|
721
903
|
return false;
|
|
722
904
|
};
|
|
723
|
-
protoOf(Equation).
|
|
905
|
+
protoOf(Equation).asAssignment = function () {
|
|
724
906
|
return null;
|
|
725
907
|
};
|
|
726
|
-
protoOf(Equation).
|
|
727
|
-
var tmp0_elvis_lhs = this.
|
|
908
|
+
protoOf(Equation).castToAssignment = function () {
|
|
909
|
+
var tmp0_elvis_lhs = this.asAssignment();
|
|
728
910
|
var tmp;
|
|
729
911
|
if (tmp0_elvis_lhs == null) {
|
|
730
|
-
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(Assignment).
|
|
912
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(Assignment).a9());
|
|
731
913
|
} else {
|
|
732
914
|
tmp = tmp0_elvis_lhs;
|
|
733
915
|
}
|
|
734
916
|
return tmp;
|
|
735
917
|
};
|
|
736
|
-
protoOf(Equation).
|
|
918
|
+
protoOf(Equation).b1i = function () {
|
|
737
919
|
return false;
|
|
738
920
|
};
|
|
739
|
-
protoOf(Equation).
|
|
921
|
+
protoOf(Equation).asLeftAssignment = function () {
|
|
922
|
+
return null;
|
|
923
|
+
};
|
|
924
|
+
protoOf(Equation).castToLeftAssignment = function () {
|
|
925
|
+
var tmp0_elvis_lhs = this.asLeftAssignment();
|
|
926
|
+
var tmp;
|
|
927
|
+
if (tmp0_elvis_lhs == null) {
|
|
928
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(LeftAssignment).a9());
|
|
929
|
+
} else {
|
|
930
|
+
tmp = tmp0_elvis_lhs;
|
|
931
|
+
}
|
|
932
|
+
return tmp;
|
|
933
|
+
};
|
|
934
|
+
protoOf(Equation).c1i = function () {
|
|
740
935
|
return false;
|
|
741
936
|
};
|
|
742
|
-
protoOf(Equation).
|
|
743
|
-
return
|
|
937
|
+
protoOf(Equation).asRightAssignment = function () {
|
|
938
|
+
return null;
|
|
939
|
+
};
|
|
940
|
+
protoOf(Equation).castToRightAssignment = function () {
|
|
941
|
+
var tmp0_elvis_lhs = this.asRightAssignment();
|
|
942
|
+
var tmp;
|
|
943
|
+
if (tmp0_elvis_lhs == null) {
|
|
944
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(RightAssignment).a9());
|
|
945
|
+
} else {
|
|
946
|
+
tmp = tmp0_elvis_lhs;
|
|
947
|
+
}
|
|
948
|
+
return tmp;
|
|
949
|
+
};
|
|
950
|
+
protoOf(Equation).e1h = function () {
|
|
951
|
+
return false;
|
|
952
|
+
};
|
|
953
|
+
protoOf(Equation).asComparison = function () {
|
|
954
|
+
return null;
|
|
955
|
+
};
|
|
956
|
+
protoOf(Equation).castToComparison = function () {
|
|
957
|
+
var tmp0_elvis_lhs = this.asComparison();
|
|
958
|
+
var tmp;
|
|
959
|
+
if (tmp0_elvis_lhs == null) {
|
|
960
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(Comparison).a9());
|
|
961
|
+
} else {
|
|
962
|
+
tmp = tmp0_elvis_lhs;
|
|
963
|
+
}
|
|
964
|
+
return tmp;
|
|
965
|
+
};
|
|
966
|
+
protoOf(Equation).c1h = function () {
|
|
967
|
+
return false;
|
|
968
|
+
};
|
|
969
|
+
protoOf(Equation).asContradiction = function () {
|
|
970
|
+
return null;
|
|
971
|
+
};
|
|
972
|
+
protoOf(Equation).castToContradiction = function () {
|
|
973
|
+
var tmp0_elvis_lhs = this.asContradiction();
|
|
974
|
+
var tmp;
|
|
975
|
+
if (tmp0_elvis_lhs == null) {
|
|
976
|
+
throw ClassCastException_init_$Create$('Cannot cast ' + toString(this) + ' to ' + getKClass(Contradiction).a9());
|
|
977
|
+
} else {
|
|
978
|
+
tmp = tmp0_elvis_lhs;
|
|
979
|
+
}
|
|
980
|
+
return tmp;
|
|
981
|
+
};
|
|
982
|
+
protoOf(Equation).clone = function (lhs, rhs, $super) {
|
|
983
|
+
lhs = lhs === VOID ? this.a1h() : lhs;
|
|
984
|
+
rhs = rhs === VOID ? this.b1h() : rhs;
|
|
985
|
+
return $super === VOID ? this.z1h(lhs, rhs) : $super.z1h.call(this, lhs, rhs);
|
|
986
|
+
};
|
|
987
|
+
protoOf(Equation).toContradiction = function () {
|
|
988
|
+
return new Contradiction(this.a1h(), this.b1h());
|
|
989
|
+
};
|
|
990
|
+
protoOf(Equation).toAssignmentPair = function () {
|
|
991
|
+
var tmp;
|
|
992
|
+
if (this.a1h().zt()) {
|
|
993
|
+
tmp = to(this.a1h().castToVar(), this.b1h());
|
|
994
|
+
} else if (this.b1h().zt()) {
|
|
995
|
+
tmp = to(this.b1h().castToVar(), this.a1h());
|
|
996
|
+
} else {
|
|
997
|
+
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + toString(this));
|
|
998
|
+
}
|
|
999
|
+
return tmp;
|
|
1000
|
+
};
|
|
1001
|
+
protoOf(Equation).toSubstitution = function () {
|
|
1002
|
+
var tmp;
|
|
1003
|
+
if (this.a1h().zt()) {
|
|
1004
|
+
tmp = Companion_getInstance().unifier(this.a1h().castToVar(), this.b1h());
|
|
1005
|
+
} else if (this.b1h().zt()) {
|
|
1006
|
+
tmp = Companion_getInstance().unifier(this.b1h().castToVar(), this.a1h());
|
|
1007
|
+
} else {
|
|
1008
|
+
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + toString(this));
|
|
1009
|
+
}
|
|
1010
|
+
return tmp;
|
|
1011
|
+
};
|
|
1012
|
+
protoOf(Equation).w1f = function () {
|
|
1013
|
+
return Companion_getInstance_0().of('=', [this.a1h(), this.b1h()]);
|
|
744
1014
|
};
|
|
745
1015
|
protoOf(Equation).toTerm = function () {
|
|
746
|
-
return this.
|
|
1016
|
+
return this.w1f();
|
|
747
1017
|
};
|
|
748
1018
|
protoOf(Equation).toPair = function () {
|
|
749
|
-
return new Pair(this.
|
|
1019
|
+
return new Pair(this.a1h(), this.b1h());
|
|
750
1020
|
};
|
|
751
1021
|
protoOf(Equation).swap = function () {
|
|
752
|
-
return Companion_instance_0.of(this.
|
|
1022
|
+
return Companion_instance_0.of(this.b1h(), this.a1h());
|
|
753
1023
|
};
|
|
754
|
-
protoOf(Equation).
|
|
755
|
-
return Companion_instance_0.
|
|
1024
|
+
protoOf(Equation).d1i = function (substitution, equalityChecker) {
|
|
1025
|
+
return Companion_instance_0.o1h(this.a1h().getSubstituted(substitution, []), this.b1h().getSubstituted(substitution, []), equalityChecker);
|
|
756
1026
|
};
|
|
757
1027
|
protoOf(Equation).apply = function (substitution, equalityChecker, $super) {
|
|
758
1028
|
var tmp;
|
|
759
1029
|
if (equalityChecker === VOID) {
|
|
760
|
-
tmp = Term$equals$
|
|
1030
|
+
tmp = Term$equals$ref();
|
|
761
1031
|
} else {
|
|
762
1032
|
tmp = equalityChecker;
|
|
763
1033
|
}
|
|
764
1034
|
equalityChecker = tmp;
|
|
765
|
-
return $super === VOID ? this.
|
|
1035
|
+
return $super === VOID ? this.d1i(substitution, equalityChecker) : $super.d1i.call(this, substitution, equalityChecker);
|
|
766
1036
|
};
|
|
767
1037
|
function toEquations(_this__u8e3s4) {
|
|
768
1038
|
// Inline function 'kotlin.collections.map' call
|
|
769
|
-
var this_0 = _this__u8e3s4.
|
|
1039
|
+
var this_0 = _this__u8e3s4.b1();
|
|
770
1040
|
// Inline function 'kotlin.collections.mapTo' call
|
|
771
1041
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
772
|
-
var _iterator__ex2g4s = this_0.
|
|
773
|
-
while (_iterator__ex2g4s.
|
|
774
|
-
var item = _iterator__ex2g4s.
|
|
1042
|
+
var _iterator__ex2g4s = this_0.m();
|
|
1043
|
+
while (_iterator__ex2g4s.p()) {
|
|
1044
|
+
var item = _iterator__ex2g4s.q();
|
|
775
1045
|
// Inline function 'kotlin.collections.component1' call
|
|
776
|
-
var variable = item.
|
|
1046
|
+
var variable = item.c2();
|
|
777
1047
|
// Inline function 'kotlin.collections.component2' call
|
|
778
|
-
var term = item.
|
|
779
|
-
var tmp$ret$2 = new
|
|
780
|
-
destination.
|
|
1048
|
+
var term = item.d2();
|
|
1049
|
+
var tmp$ret$2 = new LeftAssignment(variable, term);
|
|
1050
|
+
destination.j(tmp$ret$2);
|
|
781
1051
|
}
|
|
782
1052
|
return destination;
|
|
783
1053
|
}
|
|
@@ -786,39 +1056,26 @@
|
|
|
786
1056
|
var tmp_0 = asSequence_0(_this__u8e3s4);
|
|
787
1057
|
return tmp.ofSequence(map(tmp_0, toSubstitution$lambda));
|
|
788
1058
|
}
|
|
789
|
-
function toAssignmentPair(_this__u8e3s4) {
|
|
790
|
-
var tmp;
|
|
791
|
-
if (_this__u8e3s4.i1g()) {
|
|
792
|
-
tmp = _this__u8e3s4.d1g().v1g();
|
|
793
|
-
} else if (_this__u8e3s4.y1f().yt()) {
|
|
794
|
-
tmp = to(_this__u8e3s4.y1f().castToVar(), _this__u8e3s4.z1f());
|
|
795
|
-
} else if (_this__u8e3s4.z1f().yt()) {
|
|
796
|
-
tmp = to(_this__u8e3s4.z1f().castToVar(), _this__u8e3s4.y1f());
|
|
797
|
-
} else {
|
|
798
|
-
throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + toString(_this__u8e3s4));
|
|
799
|
-
}
|
|
800
|
-
return tmp;
|
|
801
|
-
}
|
|
802
1059
|
function toSubstitution$lambda(it) {
|
|
803
|
-
return toAssignmentPair(
|
|
1060
|
+
return it.toAssignmentPair();
|
|
804
1061
|
}
|
|
805
1062
|
function Unificator$Companion$default$delegate$lambda() {
|
|
806
1063
|
return Companion_getInstance_2().strict();
|
|
807
1064
|
}
|
|
808
1065
|
function Unificator$Companion$_get_default_$ref_8i2tx3() {
|
|
809
|
-
return function (p0) {
|
|
810
|
-
return p0.
|
|
811
|
-
};
|
|
1066
|
+
return constructCallableReference(function (p0) {
|
|
1067
|
+
return p0.r1j();
|
|
1068
|
+
}, 1, 0, 28);
|
|
812
1069
|
}
|
|
813
1070
|
function Unificator$Companion$naive$1($context) {
|
|
814
1071
|
AbstractUnificator.call(this, $context);
|
|
815
1072
|
}
|
|
816
|
-
protoOf(Unificator$Companion$naive$1).
|
|
1073
|
+
protoOf(Unificator$Companion$naive$1).v1g = function (first, second) {
|
|
817
1074
|
var tmp;
|
|
818
|
-
if (first.
|
|
819
|
-
tmp = first.castToInteger().
|
|
820
|
-
} else if (first.
|
|
821
|
-
tmp = first.castToNumeric().
|
|
1075
|
+
if (first.eu() && second.eu()) {
|
|
1076
|
+
tmp = first.castToInteger().d2().hi(second.castToInteger().d2()) === 0;
|
|
1077
|
+
} else if (first.du() && second.du()) {
|
|
1078
|
+
tmp = first.castToNumeric().tx().yh(second.castToNumeric().tx()) === 0;
|
|
822
1079
|
} else {
|
|
823
1080
|
tmp = first.equals(second);
|
|
824
1081
|
}
|
|
@@ -830,7 +1087,7 @@
|
|
|
830
1087
|
function Unificator$Companion$strict$1($context) {
|
|
831
1088
|
AbstractUnificator.call(this, $context);
|
|
832
1089
|
}
|
|
833
|
-
protoOf(Unificator$Companion$strict$1).
|
|
1090
|
+
protoOf(Unificator$Companion$strict$1).v1g = function (first, second) {
|
|
834
1091
|
return first.equals(second);
|
|
835
1092
|
};
|
|
836
1093
|
protoOf(Unificator$Companion$strict$1).mguWithOccurCheck = function (term1, term2, occurCheckEnabled, $super) {
|
|
@@ -839,27 +1096,27 @@
|
|
|
839
1096
|
function Companion_0() {
|
|
840
1097
|
Companion_instance_1 = this;
|
|
841
1098
|
var tmp = this;
|
|
842
|
-
tmp.
|
|
843
|
-
this.
|
|
1099
|
+
tmp.p1j_1 = lazy(Unificator$Companion$default$delegate$lambda);
|
|
1100
|
+
this.q1j_1 = 32;
|
|
844
1101
|
}
|
|
845
|
-
protoOf(Companion_0).
|
|
846
|
-
var tmp0 = this.
|
|
1102
|
+
protoOf(Companion_0).r1j = function () {
|
|
1103
|
+
var tmp0 = this.p1j_1;
|
|
847
1104
|
var tmp = KProperty1;
|
|
848
1105
|
// Inline function 'kotlin.getValue' call
|
|
849
|
-
|
|
850
|
-
return tmp0.
|
|
1106
|
+
/* dead property reference removed */
|
|
1107
|
+
return tmp0.d2();
|
|
851
1108
|
};
|
|
852
1109
|
protoOf(Companion_0).mguWith = function (_this__u8e3s4, other) {
|
|
853
|
-
return this.
|
|
1110
|
+
return this.r1j().mgu(_this__u8e3s4, other);
|
|
854
1111
|
};
|
|
855
1112
|
protoOf(Companion_0).matches = function (_this__u8e3s4, other) {
|
|
856
|
-
return this.
|
|
1113
|
+
return this.r1j().match(_this__u8e3s4, other);
|
|
857
1114
|
};
|
|
858
1115
|
protoOf(Companion_0).unifyWith = function (_this__u8e3s4, other) {
|
|
859
|
-
return this.
|
|
1116
|
+
return this.r1j().unify(_this__u8e3s4, other);
|
|
860
1117
|
};
|
|
861
1118
|
protoOf(Companion_0).mergeWith = function (_this__u8e3s4, other) {
|
|
862
|
-
return this.
|
|
1119
|
+
return this.r1j().merge(_this__u8e3s4, other);
|
|
863
1120
|
};
|
|
864
1121
|
protoOf(Companion_0).naiveWithContext = function (context) {
|
|
865
1122
|
return new Unificator$Companion$naive$1(context);
|
|
@@ -873,10 +1130,10 @@
|
|
|
873
1130
|
protoOf(Companion_0).strict = function () {
|
|
874
1131
|
return this.strictWithContext(Companion_getInstance().empty());
|
|
875
1132
|
};
|
|
876
|
-
protoOf(Companion_0).
|
|
1133
|
+
protoOf(Companion_0).w1j = function (other, capacity) {
|
|
877
1134
|
var tmp;
|
|
878
1135
|
if (other instanceof CachedUnificator) {
|
|
879
|
-
tmp = new CachedUnificator(other.
|
|
1136
|
+
tmp = new CachedUnificator(other.r1h_1, capacity);
|
|
880
1137
|
} else {
|
|
881
1138
|
tmp = new CachedUnificator(other, capacity);
|
|
882
1139
|
}
|
|
@@ -884,7 +1141,7 @@
|
|
|
884
1141
|
};
|
|
885
1142
|
protoOf(Companion_0).cached = function (other, capacity, $super) {
|
|
886
1143
|
capacity = capacity === VOID ? 32 : capacity;
|
|
887
|
-
return $super === VOID ? this.
|
|
1144
|
+
return $super === VOID ? this.w1j(other, capacity) : $super.w1j.call(this, other, capacity);
|
|
888
1145
|
};
|
|
889
1146
|
var Companion_instance_1;
|
|
890
1147
|
function Companion_getInstance_2() {
|
|
@@ -909,14 +1166,38 @@
|
|
|
909
1166
|
protoOf(CachedUnificator).unifyWithOccurCheck = unifyWithOccurCheck;
|
|
910
1167
|
protoOf(CachedUnificator).unify = unify;
|
|
911
1168
|
protoOf(CachedUnificator).merge = merge;
|
|
912
|
-
protoOf(Equation).
|
|
1169
|
+
protoOf(Equation).ko = castTo;
|
|
913
1170
|
defineProp(protoOf(Equation), 'lhs', function () {
|
|
914
|
-
return this.
|
|
1171
|
+
return this.a1h();
|
|
915
1172
|
});
|
|
916
1173
|
defineProp(protoOf(Equation), 'rhs', function () {
|
|
917
|
-
return this.
|
|
1174
|
+
return this.b1h();
|
|
1175
|
+
});
|
|
1176
|
+
defineProp(protoOf(Equation), 'isIdentity', function () {
|
|
1177
|
+
return this.d1h();
|
|
1178
|
+
});
|
|
1179
|
+
defineProp(protoOf(Equation), 'isAssignment', function () {
|
|
1180
|
+
return this.m1h();
|
|
1181
|
+
});
|
|
1182
|
+
defineProp(protoOf(Equation), 'isLeftAssignment', function () {
|
|
1183
|
+
return this.b1i();
|
|
1184
|
+
});
|
|
1185
|
+
defineProp(protoOf(Equation), 'isRightAssignment', function () {
|
|
1186
|
+
return this.c1i();
|
|
1187
|
+
});
|
|
1188
|
+
defineProp(protoOf(Equation), 'isComparison', function () {
|
|
1189
|
+
return this.e1h();
|
|
1190
|
+
});
|
|
1191
|
+
defineProp(protoOf(Equation), 'isContradiction', function () {
|
|
1192
|
+
return this.c1h();
|
|
1193
|
+
});
|
|
1194
|
+
defineProp(protoOf(Assignment), 'variable', function () {
|
|
1195
|
+
return this.k1h();
|
|
1196
|
+
});
|
|
1197
|
+
defineProp(protoOf(Assignment), 'term', function () {
|
|
1198
|
+
return this.l1h();
|
|
918
1199
|
});
|
|
919
|
-
defineProp(protoOf(Companion_0), 'default', protoOf(Companion_0).
|
|
1200
|
+
defineProp(protoOf(Companion_0), 'default', protoOf(Companion_0).r1j);
|
|
920
1201
|
//endregion
|
|
921
1202
|
//region block: init
|
|
922
1203
|
Companion_instance_0 = new Companion();
|