@tuprolog/2p-full 3.0.6 → 3.0.8

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-unify.js CHANGED
@@ -19,46 +19,46 @@
19
19
  'use strict';
20
20
  //region block: imports
21
21
  var imul = Math.imul;
22
- var protoOf = kotlin_kotlin.$_$.s8;
23
- var getBooleanHashCode = kotlin_kotlin.$_$.w7;
24
- var initMetadataForClass = kotlin_kotlin.$_$.b8;
25
- var toString = kotlin_kotlin.$_$.v8;
26
- var hashCode = kotlin_kotlin.$_$.a8;
27
- var equals = kotlin_kotlin.$_$.t7;
28
- var KProperty1 = kotlin_kotlin.$_$.t9;
29
- var getPropertyCallableRef = kotlin_kotlin.$_$.y7;
22
+ var protoOf = kotlin_kotlin.$_$.u8;
23
+ var getBooleanHashCode = kotlin_kotlin.$_$.y7;
24
+ var initMetadataForClass = kotlin_kotlin.$_$.d8;
25
+ var toString = kotlin_kotlin.$_$.x8;
26
+ var hashCode = kotlin_kotlin.$_$.c8;
27
+ var equals = kotlin_kotlin.$_$.v7;
28
+ var KProperty1 = kotlin_kotlin.$_$.v9;
29
+ var getPropertyCallableRef = kotlin_kotlin.$_$.a8;
30
30
  var asSequence = kotlin_kotlin.$_$.q2;
31
- var plus = kotlin_kotlin.$_$.ya;
32
- var map = kotlin_kotlin.$_$.ta;
31
+ var plus = kotlin_kotlin.$_$.bb;
32
+ var map = kotlin_kotlin.$_$.wa;
33
33
  var Unit_instance = kotlin_kotlin.$_$.r;
34
34
  var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.y;
35
- var ArrayList_init_$Create$ = kotlin_kotlin.$_$.u;
36
- var toCollection = kotlin_kotlin.$_$.fb;
37
- var constructCallableReference = kotlin_kotlin.$_$.r7;
38
- var Pair = kotlin_kotlin.$_$.de;
39
- var lazy = kotlin_kotlin.$_$.pe;
35
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.v;
36
+ var toCollection = kotlin_kotlin.$_$.ib;
37
+ var constructCallableReference = kotlin_kotlin.$_$.t7;
38
+ var Pair = kotlin_kotlin.$_$.fe;
39
+ var lazy = kotlin_kotlin.$_$.re;
40
40
  var asSequence_0 = kotlin_kotlin.$_$.r2;
41
- var THROW_CCE = kotlin_kotlin.$_$.fe;
41
+ var THROW_CCE = kotlin_kotlin.$_$.he;
42
42
  var VOID = kotlin_kotlin.$_$.b;
43
43
  var Companion_instance = kotlin_it_unibo_tuprolog_utils.$_$.a;
44
- var Triple = kotlin_kotlin.$_$.he;
44
+ var Triple = kotlin_kotlin.$_$.je;
45
45
  var Some = kotlin_it_unibo_tuprolog_utils.$_$.m;
46
- var zip = kotlin_kotlin.$_$.mb;
47
- var flatMap = kotlin_kotlin.$_$.ja;
48
- var sequenceOf = kotlin_kotlin.$_$.ab;
49
- var defineProp = kotlin_kotlin.$_$.s7;
50
- var sequenceOf_0 = kotlin_kotlin.$_$.za;
51
- var initMetadataForCompanion = kotlin_kotlin.$_$.c8;
52
- var getKClass = kotlin_kotlin.$_$.q9;
46
+ var zip = kotlin_kotlin.$_$.pb;
47
+ var flatMap = kotlin_kotlin.$_$.la;
48
+ var sequenceOf = kotlin_kotlin.$_$.db;
49
+ var defineProp = kotlin_kotlin.$_$.u7;
50
+ var sequenceOf_0 = kotlin_kotlin.$_$.cb;
51
+ var initMetadataForCompanion = kotlin_kotlin.$_$.e8;
52
+ var getKClass = kotlin_kotlin.$_$.s9;
53
53
  var ClassCastException_init_$Create$ = kotlin_kotlin.$_$.f1;
54
54
  var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.j1;
55
- var to = kotlin_kotlin.$_$.we;
55
+ var to = kotlin_kotlin.$_$.ye;
56
56
  var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.x;
57
57
  var castTo = kotlin_it_unibo_tuprolog_utils.$_$.f;
58
58
  var Castable = kotlin_it_unibo_tuprolog_utils.$_$.g;
59
59
  var collectionSizeOrDefault = kotlin_kotlin.$_$.w2;
60
- var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.t;
61
- var initMetadataForInterface = kotlin_kotlin.$_$.e8;
60
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.u;
61
+ var initMetadataForInterface = kotlin_kotlin.$_$.g8;
62
62
  //endregion
63
63
  //region block: pre-declaration
64
64
  initMetadataForClass(Mgu, 'Mgu');
@@ -78,7 +78,7 @@
78
78
  }
79
79
  function unifyWithOccurCheck(term1, term2, occurCheckEnabled) {
80
80
  var substitution = this.m1l(term1, term2, occurCheckEnabled);
81
- return substitution.d13() ? null : term1.getSubstituted(substitution, []);
81
+ return substitution.c13() ? null : term1.getSubstituted(substitution, []);
82
82
  }
83
83
  function unify(term1, term2) {
84
84
  return this.unifyWithOccurCheck(term1, term2, true);
@@ -164,10 +164,10 @@
164
164
  }
165
165
  function occurrenceCheck($this, variable, term) {
166
166
  var tmp;
167
- if (term.ux()) {
167
+ if (term.tx()) {
168
168
  tmp = $this.s1k(variable, term);
169
- } else if (term.ex()) {
170
- var tmp0 = term.ax();
169
+ } else if (term.dx()) {
170
+ var tmp0 = term.zw();
171
171
  var tmp$ret$0;
172
172
  $l$block: {
173
173
  // Inline function 'kotlin.sequences.any' call
@@ -279,24 +279,24 @@
279
279
  function AbstractUnificator$_get_contextEquations_$ref_7ajcte() {
280
280
  return constructCallableReference(function (p0) {
281
281
  return _get_contextEquations__x0dd77(p0);
282
- }, 1, 0, 27);
282
+ }, 1, 0, 28);
283
283
  }
284
284
  function AbstractUnificator$checkTermsEquality$ref(p0) {
285
285
  return constructCallableReference(function (p0_0, p1) {
286
286
  return p0.s1k(p0_0, p1);
287
- }, 2, 0, 28, 'checkTermsEquality', [p0]);
287
+ }, 2, 0, 29, 'checkTermsEquality', [p0]);
288
288
  }
289
289
  function AbstractUnificator$equationsFor$lambda(it) {
290
290
  // Inline function 'kotlin.collections.toPair' call
291
291
  return new Pair(it.e1(), it.f1());
292
292
  }
293
293
  function applySubstitutionToEquations$handleIndex($equations, $substitution, this$0, changed, i) {
294
- if ($equations.x(i).z1k() || $equations.x(i).a1l())
294
+ if ($equations.t(i).z1k() || $equations.t(i).a1l())
295
295
  return Unit_instance;
296
- var currentEq = $equations.x(i);
296
+ var currentEq = $equations.t(i);
297
297
  var _destruct__k2r9zo = currentEq.apply($substitution).toPair();
298
- var newLhs = _destruct__k2r9zo.ae();
299
- var newRhs = _destruct__k2r9zo.be();
298
+ var newLhs = _destruct__k2r9zo.zd();
299
+ var newRhs = _destruct__k2r9zo.ae();
300
300
  if (!currentEq.x1k().equals(newLhs) || !currentEq.y1k().equals(newRhs)) {
301
301
  var tmp = Companion_instance_0;
302
302
  $equations.i3(i, tmp.l1l(newLhs, newRhs, AbstractUnificator$checkTermsEquality$ref(this$0)));
@@ -318,7 +318,7 @@
318
318
  return equation;
319
319
  };
320
320
  protoOf(AbstractUnificator).m1l = function (term1, term2, occurCheckEnabled) {
321
- if (this.v8().d13())
321
+ if (this.v8().c13())
322
322
  return Companion_getInstance().failed();
323
323
  var equations = newDeque(this, plus(asSequence_0(_get_contextEquations__x0dd77(this)), equationsFor(this, term1, term2)));
324
324
  return mgu_0(this, new Mgu(term1, term2, occurCheckEnabled), equations, occurCheckEnabled);
@@ -327,11 +327,11 @@
327
327
  return this.mguWithOccurCheck(term1, term2, occurCheckEnabled, ($super == null ? true : $super instanceof AbstractUnificator) ? $super : THROW_CCE());
328
328
  };
329
329
  protoOf(AbstractUnificator).n1l = function (substitution1, substitution2, occurCheckEnabled) {
330
- if (this.v8().d13() || substitution1.d13() || substitution2.d13())
330
+ if (this.v8().c13() || substitution1.c13() || substitution2.c13())
331
331
  return Companion_getInstance().failed();
332
332
  if (!occurCheckEnabled) {
333
333
  var quickMerge = this.v8().plus(substitution1).plus(substitution2);
334
- if (quickMerge.c13()) {
334
+ if (quickMerge.b13()) {
335
335
  return quickMerge;
336
336
  }
337
337
  }
@@ -343,17 +343,17 @@
343
343
  };
344
344
  function CachedUnificator(decorated, cacheCapacity) {
345
345
  this.o1l_1 = decorated;
346
- this.p1l_1 = Companion_instance.er(cacheCapacity);
346
+ this.p1l_1 = Companion_instance.cr(cacheCapacity);
347
347
  }
348
348
  protoOf(CachedUnificator).m1l = function (term1, term2, occurCheckEnabled) {
349
349
  var mguRequest = new Triple(term1, term2, occurCheckEnabled);
350
350
  var cached = this.p1l_1.j2(mguRequest);
351
351
  var tmp;
352
352
  if (cached instanceof Some) {
353
- tmp = cached.hr_1;
353
+ tmp = cached.fr_1;
354
354
  } else {
355
355
  var mguResult = this.o1l_1.m1l(term1, term2, occurCheckEnabled);
356
- this.p1l_1.fr(mguRequest, mguResult);
356
+ this.p1l_1.dr(mguRequest, mguResult);
357
357
  tmp = mguResult;
358
358
  }
359
359
  return tmp;
@@ -366,10 +366,10 @@
366
366
  var cached = this.p1l_1.j2(mguRequest);
367
367
  var tmp;
368
368
  if (cached instanceof Some) {
369
- tmp = cached.hr_1;
369
+ tmp = cached.fr_1;
370
370
  } else {
371
371
  var mguResult = this.o1l_1.mergeWithOccurCheck(substitution1, substitution2, occurCheckEnabled);
372
- this.p1l_1.fr(mguRequest, mguResult);
372
+ this.p1l_1.dr(mguRequest, mguResult);
373
373
  tmp = mguResult;
374
374
  }
375
375
  return tmp;
@@ -402,7 +402,7 @@
402
402
  function Term$equals$ref() {
403
403
  return constructCallableReference(function (p0, p1) {
404
404
  return p0.equals(p1);
405
- }, 2, 0, 29, 'equals');
405
+ }, 2, 0, 30, 'equals');
406
406
  }
407
407
  function Equation$Companion$from$lambda($equalityChecker) {
408
408
  return function (it) {
@@ -411,16 +411,16 @@
411
411
  }
412
412
  function Equation$Companion$allOfLists$lambda($equalityChecker) {
413
413
  return function (_destruct__k2r9zo) {
414
- var l = _destruct__k2r9zo.ae();
415
- var r = _destruct__k2r9zo.be();
416
- return l.lx() && r.lx() ? sequenceOf(Companion_instance_0.l1l(l.castToCons().ez(), r.castToCons().ez(), $equalityChecker)) : l.kx() && r.kx() ? sequenceOf(Companion_instance_0.l1l(l.castToList(), r.castToList(), $equalityChecker)) : Companion_instance_0.t1k(l, r, $equalityChecker);
414
+ var l = _destruct__k2r9zo.zd();
415
+ var r = _destruct__k2r9zo.ae();
416
+ return l.kx() && r.kx() ? sequenceOf(Companion_instance_0.l1l(l.castToCons().dz(), r.castToCons().dz(), $equalityChecker)) : l.jx() && r.jx() ? sequenceOf(Companion_instance_0.l1l(l.castToList(), r.castToList(), $equalityChecker)) : Companion_instance_0.t1k(l, r, $equalityChecker);
417
417
  };
418
418
  }
419
419
  function Equation$Companion$allOfTuples$lambda($equalityChecker) {
420
420
  return function (_destruct__k2r9zo) {
421
- var l = _destruct__k2r9zo.ae();
422
- var r = _destruct__k2r9zo.be();
423
- return l.jx() && r.jx() ? sequenceOf(Companion_instance_0.l1l(l.castToTuple().sy(), r.castToTuple().sy(), $equalityChecker)) : Companion_instance_0.t1k(l, r, $equalityChecker);
421
+ var l = _destruct__k2r9zo.zd();
422
+ var r = _destruct__k2r9zo.ae();
423
+ return l.ix() && r.ix() ? sequenceOf(Companion_instance_0.l1l(l.castToTuple().ry(), r.castToTuple().ry(), $equalityChecker)) : Companion_instance_0.t1k(l, r, $equalityChecker);
424
424
  };
425
425
  }
426
426
  function Equation$Companion$allOf$lambda($equalityChecker) {
@@ -723,7 +723,7 @@
723
723
  }
724
724
  protoOf(Companion).l1l = function (lhs, rhs, equalityChecker) {
725
725
  var tmp;
726
- if (lhs.ux() && rhs.ux()) {
726
+ if (lhs.tx() && rhs.tx()) {
727
727
  var tmp_0;
728
728
  if (equalityChecker(lhs, rhs)) {
729
729
  tmp_0 = new Identity(lhs, rhs);
@@ -731,11 +731,11 @@
731
731
  tmp_0 = new LeftAssignment(lhs.castToVar(), rhs);
732
732
  }
733
733
  tmp = tmp_0;
734
- } else if (lhs.ux()) {
734
+ } else if (lhs.tx()) {
735
735
  tmp = new LeftAssignment(lhs.castToVar(), rhs);
736
- } else if (rhs.ux()) {
736
+ } else if (rhs.tx()) {
737
737
  tmp = new RightAssignment(lhs, rhs.castToVar());
738
- } else if (lhs.xx() && rhs.xx()) {
738
+ } else if (lhs.wx() && rhs.wx()) {
739
739
  var tmp_1;
740
740
  if (equalityChecker(lhs, rhs)) {
741
741
  tmp_1 = new Identity(lhs, rhs);
@@ -743,13 +743,13 @@
743
743
  tmp_1 = new Contradiction(lhs, rhs);
744
744
  }
745
745
  tmp = tmp_1;
746
- } else if (lhs.xx() || rhs.xx()) {
746
+ } else if (lhs.wx() || rhs.wx()) {
747
747
  tmp = new Contradiction(lhs, rhs);
748
- } else if (lhs.ex() && rhs.ex()) {
748
+ } else if (lhs.dx() && rhs.dx()) {
749
749
  var lhsStruct = lhs.castToStruct();
750
750
  var rhsStruct = rhs.castToStruct();
751
751
  var tmp_2;
752
- if (!(lhsStruct.sw() === rhsStruct.sw()) || !(lhsStruct.yw() === rhsStruct.yw())) {
752
+ if (!(lhsStruct.rw() === rhsStruct.rw()) || !(lhsStruct.xw() === rhsStruct.xw())) {
753
753
  tmp_2 = new Contradiction(lhsStruct, rhsStruct);
754
754
  } else {
755
755
  tmp_2 = new Comparison(lhsStruct, rhsStruct);
@@ -837,18 +837,18 @@
837
837
  };
838
838
  protoOf(Companion).t1k = function (lhs, rhs, equalityChecker) {
839
839
  var tmp;
840
- if (lhs.tw() && rhs.tw()) {
840
+ if (lhs.sw() && rhs.sw()) {
841
841
  tmp = sequenceOf(this.l1l(lhs, rhs, equalityChecker));
842
- } else if (lhs.kx() && rhs.kx()) {
843
- tmp = allOfLists(this, lhs.castToList(), rhs.castToList(), equalityChecker);
844
842
  } else if (lhs.jx() && rhs.jx()) {
843
+ tmp = allOfLists(this, lhs.castToList(), rhs.castToList(), equalityChecker);
844
+ } else if (lhs.ix() && rhs.ix()) {
845
845
  tmp = allOfTuples(this, lhs.castToTuple(), rhs.castToTuple(), equalityChecker);
846
- } else if (lhs.ex() && rhs.ex()) {
846
+ } else if (lhs.dx() && rhs.dx()) {
847
847
  var lhsStruct = lhs.castToStruct();
848
848
  var rhsStruct = rhs.castToStruct();
849
849
  var tmp_0;
850
- if (lhsStruct.sw() === rhsStruct.sw() && lhsStruct.yw() === rhsStruct.yw()) {
851
- var tmp_1 = zip(lhsStruct.rx(), rhsStruct.rx());
850
+ if (lhsStruct.rw() === rhsStruct.rw() && lhsStruct.xw() === rhsStruct.xw()) {
851
+ var tmp_1 = zip(lhsStruct.qx(), rhsStruct.qx());
852
852
  tmp_0 = flatMap(tmp_1, Equation$Companion$allOf$lambda(equalityChecker));
853
853
  } else {
854
854
  tmp_0 = sequenceOf(this.l1l(lhs, rhs, equalityChecker));
@@ -989,9 +989,9 @@
989
989
  };
990
990
  protoOf(Equation).toAssignmentPair = function () {
991
991
  var tmp;
992
- if (this.x1k().ux()) {
992
+ if (this.x1k().tx()) {
993
993
  tmp = to(this.x1k().castToVar(), this.y1k());
994
- } else if (this.y1k().ux()) {
994
+ } else if (this.y1k().tx()) {
995
995
  tmp = to(this.y1k().castToVar(), this.x1k());
996
996
  } else {
997
997
  throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + toString(this));
@@ -1000,9 +1000,9 @@
1000
1000
  };
1001
1001
  protoOf(Equation).toSubstitution = function () {
1002
1002
  var tmp;
1003
- if (this.x1k().ux()) {
1003
+ if (this.x1k().tx()) {
1004
1004
  tmp = Companion_getInstance().unifier(this.x1k().castToVar(), this.y1k());
1005
- } else if (this.y1k().ux()) {
1005
+ } else if (this.y1k().tx()) {
1006
1006
  tmp = Companion_getInstance().unifier(this.y1k().castToVar(), this.x1k());
1007
1007
  } else {
1008
1008
  throw IllegalArgumentException_init_$Create$('Equation contains no variables: ' + toString(this));
@@ -1065,17 +1065,17 @@
1065
1065
  function Unificator$Companion$_get_default_$ref_8i2tx3() {
1066
1066
  return constructCallableReference(function (p0) {
1067
1067
  return p0.o1n();
1068
- }, 1, 0, 30);
1068
+ }, 1, 0, 31);
1069
1069
  }
1070
1070
  function Unificator$Companion$naive$1($context) {
1071
1071
  AbstractUnificator.call(this, $context);
1072
1072
  }
1073
1073
  protoOf(Unificator$Companion$naive$1).s1k = function (first, second) {
1074
1074
  var tmp;
1075
- if (first.zx() && second.zx()) {
1076
- tmp = first.castToInteger().f1().ll(second.castToInteger().f1()) === 0;
1077
- } else if (first.yx() && second.yx()) {
1078
- tmp = first.castToNumeric().o11().cl(second.castToNumeric().o11()) === 0;
1075
+ if (first.yx() && second.yx()) {
1076
+ tmp = first.castToInteger().f1().jl(second.castToInteger().f1()) === 0;
1077
+ } else if (first.xx() && second.xx()) {
1078
+ tmp = first.castToNumeric().n11().al(second.castToNumeric().n11()) === 0;
1079
1079
  } else {
1080
1080
  tmp = first.equals(second);
1081
1081
  }
@@ -1166,7 +1166,7 @@
1166
1166
  protoOf(CachedUnificator).unifyWithOccurCheck = unifyWithOccurCheck;
1167
1167
  protoOf(CachedUnificator).unify = unify;
1168
1168
  protoOf(CachedUnificator).merge = merge;
1169
- protoOf(Equation).pr = castTo;
1169
+ protoOf(Equation).mr = castTo;
1170
1170
  defineProp(protoOf(Equation), 'lhs', function () {
1171
1171
  return this.x1k();
1172
1172
  });