@tuprolog/arg2p 0.10.2 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,105 +1,105 @@
1
- (function (root, factory) {
1
+ (function (factory) {
2
2
  if (typeof define === 'function' && define.amd)
3
3
  define(['exports', './kotlin-kotlin-stdlib.js', './2p-core.js', './2p-unify.js', './2p-parser-core.js', './arg2p-core.js', './2p-theory.js', './2p-solve.js', './2p-parser-theory.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-unify.js'), require('./2p-parser-core.js'), require('./arg2p-core.js'), require('./2p-theory.js'), require('./2p-solve.js'), require('./2p-parser-theory.js'));
6
6
  else {
7
- if (typeof this['kotlin-kotlin-stdlib'] === 'undefined') {
7
+ if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
8
8
  throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'arg2p-causality-solver'.");
9
9
  }
10
- if (typeof this['2p-core'] === 'undefined') {
10
+ if (typeof globalThis['2p-core'] === 'undefined') {
11
11
  throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency '2p-core' was not found. Please, check whether '2p-core' is loaded prior to 'arg2p-causality-solver'.");
12
12
  }
13
- if (typeof this['2p-unify'] === 'undefined') {
13
+ if (typeof globalThis['2p-unify'] === 'undefined') {
14
14
  throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency '2p-unify' was not found. Please, check whether '2p-unify' is loaded prior to 'arg2p-causality-solver'.");
15
15
  }
16
- if (typeof this['2p-parser-core'] === 'undefined') {
16
+ if (typeof globalThis['2p-parser-core'] === 'undefined') {
17
17
  throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency '2p-parser-core' was not found. Please, check whether '2p-parser-core' is loaded prior to 'arg2p-causality-solver'.");
18
18
  }
19
- if (typeof this['arg2p-core'] === 'undefined') {
19
+ if (typeof globalThis['arg2p-core'] === 'undefined') {
20
20
  throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency 'arg2p-core' was not found. Please, check whether 'arg2p-core' is loaded prior to 'arg2p-causality-solver'.");
21
21
  }
22
- if (typeof this['2p-theory'] === 'undefined') {
22
+ if (typeof globalThis['2p-theory'] === 'undefined') {
23
23
  throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency '2p-theory' was not found. Please, check whether '2p-theory' is loaded prior to 'arg2p-causality-solver'.");
24
24
  }
25
- if (typeof this['2p-solve'] === 'undefined') {
25
+ if (typeof globalThis['2p-solve'] === 'undefined') {
26
26
  throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency '2p-solve' was not found. Please, check whether '2p-solve' is loaded prior to 'arg2p-causality-solver'.");
27
27
  }
28
- if (typeof this['2p-parser-theory'] === 'undefined') {
28
+ if (typeof globalThis['2p-parser-theory'] === 'undefined') {
29
29
  throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency '2p-parser-theory' was not found. Please, check whether '2p-parser-theory' is loaded prior to 'arg2p-causality-solver'.");
30
30
  }
31
- root['arg2p-causality-solver'] = factory(typeof this['arg2p-causality-solver'] === 'undefined' ? {} : this['arg2p-causality-solver'], this['kotlin-kotlin-stdlib'], this['2p-core'], this['2p-unify'], this['2p-parser-core'], this['arg2p-core'], this['2p-theory'], this['2p-solve'], this['2p-parser-theory']);
31
+ globalThis['arg2p-causality-solver'] = factory(typeof globalThis['arg2p-causality-solver'] === 'undefined' ? {} : globalThis['arg2p-causality-solver'], globalThis['kotlin-kotlin-stdlib'], globalThis['2p-core'], globalThis['2p-unify'], globalThis['2p-parser-core'], globalThis['arg2p-core'], globalThis['2p-theory'], globalThis['2p-solve'], globalThis['2p-parser-theory']);
32
32
  }
33
- }(this, function (_, kotlin_kotlin, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_unify, kotlin_it_unibo_tuprolog_parser_core, kotlin_it_unibo_tuprolog_argumentation_core, kotlin_it_unibo_tuprolog_theory, kotlin_it_unibo_tuprolog_solve, kotlin_it_unibo_tuprolog_parser_theory) {
33
+ }(function (_, kotlin_kotlin, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_unify, kotlin_it_unibo_tuprolog_parser_core, kotlin_it_unibo_tuprolog_argumentation_core, kotlin_it_unibo_tuprolog_theory, kotlin_it_unibo_tuprolog_solve, kotlin_it_unibo_tuprolog_parser_theory) {
34
34
  'use strict';
35
35
  //region block: imports
36
- var ensureNotNull = kotlin_kotlin.$_$.ca;
36
+ var ensureNotNull = kotlin_kotlin.$_$.pa;
37
37
  var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.v;
38
- var filter = kotlin_kotlin.$_$.j7;
39
- var map = kotlin_kotlin.$_$.v7;
40
- var firstOrNull = kotlin_kotlin.$_$.k7;
38
+ var filter = kotlin_kotlin.$_$.t7;
39
+ var map = kotlin_kotlin.$_$.f8;
40
+ var firstOrNull = kotlin_kotlin.$_$.u7;
41
41
  var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_unify.$_$.b;
42
42
  var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.w;
43
43
  var parseTerm = kotlin_it_unibo_tuprolog_parser_core.$_$.e;
44
- var ArrayList_init_$Create$ = kotlin_kotlin.$_$.f;
45
- var Unit_instance = kotlin_kotlin.$_$.s1;
46
- var collectionSizeOrDefault = kotlin_kotlin.$_$.j2;
47
- var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.e;
48
- var addAll = kotlin_kotlin.$_$.z1;
49
- var plus = kotlin_kotlin.$_$.d4;
44
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.d;
45
+ var Unit_instance = kotlin_kotlin.$_$.k1;
46
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.b2;
47
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.c;
48
+ var addAll = kotlin_kotlin.$_$.r1;
49
+ var plus = kotlin_kotlin.$_$.v3;
50
50
  var Arg2pSolverFactory_instance = kotlin_it_unibo_tuprolog_argumentation_core.$_$.d;
51
- var emptyList = kotlin_kotlin.$_$.t2;
52
- var VOID = kotlin_kotlin.$_$.d;
51
+ var emptyList = kotlin_kotlin.$_$.l2;
52
+ var VOID = kotlin_kotlin.$_$.b;
53
53
  var FlagsBuilder = kotlin_it_unibo_tuprolog_argumentation_core.$_$.f;
54
54
  var Graph = kotlin_it_unibo_tuprolog_argumentation_core.$_$.k;
55
- var asSequence = kotlin_kotlin.$_$.h2;
56
- var flatMap = kotlin_kotlin.$_$.n7;
57
- var toList = kotlin_kotlin.$_$.j8;
55
+ var asSequence = kotlin_kotlin.$_$.z1;
56
+ var flatMap = kotlin_kotlin.$_$.x7;
57
+ var toList = kotlin_kotlin.$_$.u8;
58
58
  var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.l;
59
59
  var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.u;
60
- var Default_getInstance = kotlin_kotlin.$_$.o1;
61
- var nextUInt = kotlin_kotlin.$_$.n6;
62
- var UInt = kotlin_kotlin.$_$.ba;
60
+ var Default_getInstance = kotlin_kotlin.$_$.i1;
61
+ var nextUInt = kotlin_kotlin.$_$.v6;
62
+ var UInt = kotlin_kotlin.$_$.oa;
63
63
  var parseStruct = kotlin_it_unibo_tuprolog_parser_core.$_$.d;
64
64
  var Companion_instance_0 = kotlin_it_unibo_tuprolog_theory.$_$.b;
65
- var Collection = kotlin_kotlin.$_$.t1;
66
- var isInterface = kotlin_kotlin.$_$.r5;
65
+ var Collection = kotlin_kotlin.$_$.l1;
66
+ var isInterface = kotlin_kotlin.$_$.e6;
67
67
  var arg2pScope = kotlin_it_unibo_tuprolog_argumentation_core.$_$.e;
68
- var Signature = kotlin_it_unibo_tuprolog_solve.$_$.t2;
69
- var protoOf = kotlin_kotlin.$_$.b6;
70
- var sequenceOf = kotlin_kotlin.$_$.b8;
71
- var classMeta = kotlin_kotlin.$_$.f5;
72
- var setMetadataFor = kotlin_kotlin.$_$.c6;
68
+ var Signature = kotlin_it_unibo_tuprolog_solve.$_$.u2;
69
+ var protoOf = kotlin_kotlin.$_$.m6;
70
+ var sequenceOf = kotlin_kotlin.$_$.m8;
71
+ var Primitive = kotlin_it_unibo_tuprolog_solve.$_$.w1;
72
+ var initMetadataForClass = kotlin_kotlin.$_$.x5;
73
73
  var Companion_instance_1 = kotlin_it_unibo_tuprolog_solve.$_$.b1;
74
74
  var Expected_VARIABLE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.c;
75
75
  var Var = kotlin_it_unibo_tuprolog_core.$_$.t2;
76
- var toList_0 = kotlin_kotlin.$_$.l4;
77
- var toString = kotlin_kotlin.$_$.g6;
76
+ var toList_0 = kotlin_kotlin.$_$.d4;
77
+ var toString = kotlin_kotlin.$_$.p6;
78
78
  var Companion_instance_2 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.a;
79
79
  var Companion_instance_3 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.b;
80
80
  var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.i;
81
- var replace = kotlin_kotlin.$_$.z8;
82
- var listOf = kotlin_kotlin.$_$.k3;
81
+ var replace = kotlin_kotlin.$_$.k9;
82
+ var listOf = kotlin_kotlin.$_$.c3;
83
83
  var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_solve.$_$.h1;
84
- var mapCapacity = kotlin_kotlin.$_$.l3;
85
- var coerceAtLeast = kotlin_kotlin.$_$.s6;
86
- var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.g;
84
+ var mapCapacity = kotlin_kotlin.$_$.d3;
85
+ var coerceAtLeast = kotlin_kotlin.$_$.a7;
86
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.e;
87
87
  var parseTheoryWithOperators = kotlin_it_unibo_tuprolog_parser_theory.$_$.b;
88
88
  var content = kotlin_it_unibo_tuprolog_argumentation_core.$_$.g;
89
89
  var ArgLibrary = kotlin_it_unibo_tuprolog_argumentation_core.$_$.h;
90
90
  var Loadable = kotlin_it_unibo_tuprolog_argumentation_core.$_$.i;
91
91
  //endregion
92
92
  //region block: pre-declaration
93
- setMetadataFor(CausalityCheckIntervention, 'CausalityCheckIntervention', classMeta);
94
- setMetadataFor(CausalityCheckCause, 'CausalityCheckCause', classMeta);
95
- setMetadataFor(CausalitySolver, 'CausalitySolver', classMeta, VOID, [ArgLibrary, Loadable], CausalitySolver);
93
+ initMetadataForClass(CausalityCheckIntervention, 'CausalityCheckIntervention', VOID, VOID, [Primitive]);
94
+ initMetadataForClass(CausalityCheckCause, 'CausalityCheckCause', VOID, VOID, [Primitive]);
95
+ initMetadataForClass(CausalitySolver, 'CausalitySolver', CausalitySolver, VOID, [ArgLibrary, Loadable]);
96
96
  //endregion
97
97
  function CausalitySolver$CausalityCheckCause$solve$lambda$lambda(it) {
98
- return it.u1w();
98
+ return it.d1u();
99
99
  }
100
100
  function CausalitySolver$CausalityCheckCause$solve$lambda$lambda_0($this_arg2pScope) {
101
101
  return function (it) {
102
- return ensureNotNull(it.m1v().x2($this_arg2pScope.c1h())).castToList();
102
+ return ensureNotNull(it.v1s().h2($this_arg2pScope.d1g())).castToList();
103
103
  };
104
104
  }
105
105
  function CausalitySolver$CausalityCheckCause$solve$lambda$lambda_1(this$0, $request, $effect) {
@@ -114,7 +114,7 @@
114
114
  }
115
115
  function CausalitySolver$CausalityCheckCause$solve$lambda($request, $rules, $cause, this$0, $effect, $intervention) {
116
116
  return function ($this$arg2pScope) {
117
- var tmp = $request.solve($this$arg2pScope.stringInvoke('generate_interventions', $rules, [$cause, $this$arg2pScope.c1h()]));
117
+ var tmp = $request.solve($this$arg2pScope.stringInvoke('generate_interventions', $rules, [$cause, $this$arg2pScope.d1g()]));
118
118
  var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCause$solve$lambda$lambda);
119
119
  var tmp_1 = map(tmp_0, CausalitySolver$CausalityCheckCause$solve$lambda$lambda_0($this$arg2pScope));
120
120
  var tmp_2 = filter(tmp_1, CausalitySolver$CausalityCheckCause$solve$lambda$lambda_1(this$0, $request, $effect));
@@ -123,38 +123,35 @@
123
123
  };
124
124
  }
125
125
  function equalTerms($this, a, b) {
126
- return Companion_getInstance_0().e1l().match(parseTerm(Companion_instance, a), parseTerm(Companion_instance, b));
126
+ return Companion_getInstance_0().u1i().match(parseTerm(Companion_instance, a), parseTerm(Companion_instance, b));
127
127
  }
128
128
  function attackers($this, x, graph) {
129
- // Inline function 'kotlin.collections.map' call
130
129
  // Inline function 'kotlin.collections.filter' call
130
+ var tmp0 = graph.l3k_1;
131
131
  // Inline function 'kotlin.collections.filterTo' call
132
- var this_0 = graph.z3l_1;
133
132
  var destination = ArrayList_init_$Create$();
134
- var tmp0_iterator = this_0.r();
135
- while (tmp0_iterator.s()) {
136
- var element = tmp0_iterator.u();
137
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.attackers.<anonymous>' call
138
- if (element.t3l_1.l3l_1 === x.l3l_1) {
139
- destination.o(element);
133
+ var _iterator__ex2g4s = tmp0.p();
134
+ while (_iterator__ex2g4s.s()) {
135
+ var element = _iterator__ex2g4s.t();
136
+ if (element.f3k_1.y3j_1 === x.y3j_1) {
137
+ destination.m(element);
140
138
  }
141
139
  }
140
+ // Inline function 'kotlin.collections.map' call
142
141
  // Inline function 'kotlin.collections.mapTo' call
143
142
  var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
144
- var tmp0_iterator_0 = destination.r();
145
- while (tmp0_iterator_0.s()) {
146
- var item = tmp0_iterator_0.u();
147
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.attackers.<anonymous>' call
143
+ var _iterator__ex2g4s_0 = destination.p();
144
+ while (_iterator__ex2g4s_0.s()) {
145
+ var item = _iterator__ex2g4s_0.t();
148
146
  // Inline function 'kotlin.collections.find' call
149
- var this_1 = graph.b3m_1;
147
+ var tmp0_0 = graph.n3k_1;
150
148
  var tmp$ret$4;
151
149
  $l$block: {
152
150
  // Inline function 'kotlin.collections.firstOrNull' call
153
- var tmp0_iterator_1 = this_1.r();
154
- while (tmp0_iterator_1.s()) {
155
- var element_0 = tmp0_iterator_1.u();
156
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.attackers.<anonymous>.<anonymous>' call
157
- if (item.s3l_1.l3l_1 === element_0.w3l_1.l3l_1) {
151
+ var _iterator__ex2g4s_1 = tmp0_0.p();
152
+ while (_iterator__ex2g4s_1.s()) {
153
+ var element_0 = _iterator__ex2g4s_1.t();
154
+ if (item.e3k_1.y3j_1 === element_0.i3k_1.y3j_1) {
158
155
  tmp$ret$4 = element_0;
159
156
  break $l$block;
160
157
  }
@@ -163,52 +160,48 @@
163
160
  }
164
161
  var tmp$ret$5 = tmp$ret$4;
165
162
  var tmp$ret$6 = ensureNotNull(tmp$ret$5);
166
- destination_0.o(tmp$ret$6);
163
+ destination_0.m(tmp$ret$6);
167
164
  }
168
165
  return destination_0;
169
166
  }
170
167
  function supporters($this, x, graph) {
171
168
  // Inline function 'kotlin.collections.filter' call
169
+ var tmp0 = graph.n3k_1;
172
170
  // Inline function 'kotlin.collections.filterTo' call
173
- var this_0 = graph.b3m_1;
174
171
  var destination = ArrayList_init_$Create$();
175
- var tmp0_iterator = this_0.r();
176
- while (tmp0_iterator.s()) {
177
- var element = tmp0_iterator.u();
178
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.supporters.<anonymous>' call
179
- if (x.l3l_1 === element.w3l_1.l3l_1) {
180
- destination.o(element);
172
+ var _iterator__ex2g4s = tmp0.p();
173
+ while (_iterator__ex2g4s.s()) {
174
+ var element = _iterator__ex2g4s.t();
175
+ if (x.y3j_1 === element.i3k_1.y3j_1) {
176
+ destination.m(element);
181
177
  }
182
178
  }
183
179
  var tmp = destination;
184
180
  // Inline function 'kotlin.collections.flatMap' call
181
+ var tmp0_0 = attackers($this, x, graph);
185
182
  // Inline function 'kotlin.collections.flatMapTo' call
186
- var this_1 = attackers($this, x, graph);
187
183
  var destination_0 = ArrayList_init_$Create$();
188
- var tmp0_iterator_0 = this_1.r();
189
- while (tmp0_iterator_0.s()) {
190
- var element_0 = tmp0_iterator_0.u();
191
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.supporters.<anonymous>' call
192
- // Inline function 'kotlin.collections.flatMap' call
184
+ var _iterator__ex2g4s_0 = tmp0_0.p();
185
+ while (_iterator__ex2g4s_0.s()) {
186
+ var element_0 = _iterator__ex2g4s_0.t();
193
187
  // Inline function 'kotlin.collections.filter' call
188
+ var tmp0_1 = attackers($this, element_0.i3k_1, graph);
194
189
  // Inline function 'kotlin.collections.filterTo' call
195
- var this_2 = attackers($this, element_0.w3l_1, graph);
196
190
  var destination_1 = ArrayList_init_$Create$();
197
- var tmp0_iterator_1 = this_2.r();
198
- while (tmp0_iterator_1.s()) {
199
- var element_1 = tmp0_iterator_1.u();
200
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.supporters.<anonymous>.<anonymous>' call
201
- if (!(element_1.w3l_1.l3l_1 === x.l3l_1)) {
202
- destination_1.o(element_1);
191
+ var _iterator__ex2g4s_1 = tmp0_1.p();
192
+ while (_iterator__ex2g4s_1.s()) {
193
+ var element_1 = _iterator__ex2g4s_1.t();
194
+ if (!(element_1.i3k_1.y3j_1 === x.y3j_1)) {
195
+ destination_1.m(element_1);
203
196
  }
204
197
  }
198
+ // Inline function 'kotlin.collections.flatMap' call
205
199
  // Inline function 'kotlin.collections.flatMapTo' call
206
200
  var destination_2 = ArrayList_init_$Create$();
207
- var tmp0_iterator_2 = destination_1.r();
208
- while (tmp0_iterator_2.s()) {
209
- var element_2 = tmp0_iterator_2.u();
210
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.supporters.<anonymous>.<anonymous>' call
211
- var list = supporters($this, element_2.w3l_1, graph);
201
+ var _iterator__ex2g4s_2 = destination_1.p();
202
+ while (_iterator__ex2g4s_2.s()) {
203
+ var element_2 = _iterator__ex2g4s_2.t();
204
+ var list = supporters($this, element_2.i3k_1, graph);
212
205
  addAll(destination_2, list);
213
206
  }
214
207
  var list_0 = destination_2;
@@ -217,11 +210,11 @@
217
210
  return plus(tmp, destination_0);
218
211
  }
219
212
  function solveFresh($this, kb) {
220
- var tmp0_elvis_lhs = firstOrNull(Arg2pSolverFactory_instance.l3b(kb.toStringAsProlog(true), new FlagsBuilder(VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, emptyList())));
213
+ var tmp0_elvis_lhs = firstOrNull(Arg2pSolverFactory_instance.x39(kb.toStringAsProlog(true), new FlagsBuilder(VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, emptyList())));
221
214
  return tmp0_elvis_lhs == null ? new Graph(emptyList(), emptyList(), emptyList()) : tmp0_elvis_lhs;
222
215
  }
223
216
  function getSupports($this, graph, effect) {
224
- var tmp = asSequence(graph.b3m_1);
217
+ var tmp = asSequence(graph.n3k_1);
225
218
  var tmp_0 = filter(tmp, CausalitySolver$getSupports$lambda($this, effect));
226
219
  var tmp_1 = flatMap(tmp_0, CausalitySolver$getSupports$lambda_0($this, graph));
227
220
  var tmp_2 = filter(tmp_1, CausalitySolver$getSupports$lambda_1);
@@ -229,59 +222,49 @@
229
222
  }
230
223
  function checkBaseTheory($this, request, effect) {
231
224
  // Inline function 'kotlin.let' call
232
- // Inline function 'kotlin.contracts.contract' call
233
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.checkBaseTheory.<anonymous>' call
234
- var it = solveFresh($this, request.context.s1v());
225
+ var it = solveFresh($this, request.context.b1t());
235
226
  var tmp = getSupports($this, it, effect);
236
227
  return toList(map(tmp, CausalitySolver$checkBaseTheory$lambda));
237
228
  }
238
229
  function checkIntervention($this, request, intervention, support) {
239
- // Inline function 'kotlin.let' call
240
230
  // Inline function 'kotlin.collections.map' call
241
231
  var this_0 = intervention.toList();
242
232
  // Inline function 'kotlin.collections.mapTo' call
243
233
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
244
- var tmp0_iterator = this_0.r();
245
- while (tmp0_iterator.s()) {
246
- var item = tmp0_iterator.u();
247
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.checkIntervention.<anonymous>' call
248
- var tmp$ret$0 = Companion_getInstance_1().of(parseStruct(Companion_getInstance_2(), ':->(fk' + new UInt(nextUInt(Default_getInstance())) + ', ' + item + ')'), []);
249
- destination.o(tmp$ret$0);
234
+ var _iterator__ex2g4s = this_0.p();
235
+ while (_iterator__ex2g4s.s()) {
236
+ var item = _iterator__ex2g4s.t();
237
+ var tmp$ret$0 = Companion_getInstance_1().of(parseStruct(Companion_getInstance_2(), ':->(fk' + new UInt(nextUInt(Default_getInstance())) + ', ' + item.toString() + ')'), []);
238
+ destination.m(tmp$ret$0);
250
239
  }
251
- // Inline function 'kotlin.contracts.contract' call
252
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.checkIntervention.<anonymous>' call
253
240
  // Inline function 'kotlin.let' call
254
- // Inline function 'kotlin.contracts.contract' call
255
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.checkIntervention.<anonymous>.<anonymous>' call
256
- var naf = solveFresh($this, request.context.s1v().plusTheory(Companion_instance_0.ofIterableWithDefaultUnificator(destination)));
241
+ // Inline function 'kotlin.let' call
242
+ // Inline function 'kotlin.collections.filter' call
243
+ var tmp0 = solveFresh($this, request.context.b1t().plusTheory(Companion_instance_0.ofIterableWithDefaultUnificator(destination))).n3k_1;
244
+ // Inline function 'kotlin.collections.filterTo' call
245
+ var destination_0 = ArrayList_init_$Create$();
246
+ var _iterator__ex2g4s_0 = tmp0.p();
247
+ while (_iterator__ex2g4s_0.s()) {
248
+ var element = _iterator__ex2g4s_0.t();
249
+ if (element.j3k_1 === 'out' || element.j3k_1 === 'und') {
250
+ destination_0.m(element);
251
+ }
252
+ }
253
+ // Inline function 'kotlin.collections.map' call
254
+ // Inline function 'kotlin.collections.mapTo' call
255
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_0, 10));
256
+ var _iterator__ex2g4s_1 = destination_0.p();
257
+ while (_iterator__ex2g4s_1.s()) {
258
+ var item_0 = _iterator__ex2g4s_1.t();
259
+ var tmp$ret$6 = item_0.i3k_1.a3k();
260
+ destination_1.m(tmp$ret$6);
261
+ }
257
262
  var tmp$ret$9;
258
263
  $l$block_2: {
259
264
  // Inline function 'kotlin.collections.any' call
260
- // Inline function 'kotlin.collections.map' call
261
- // Inline function 'kotlin.collections.filter' call
262
- // Inline function 'kotlin.collections.filterTo' call
263
- var this_1 = naf.b3m_1;
264
- var destination_0 = ArrayList_init_$Create$();
265
- var tmp0_iterator_0 = this_1.r();
266
- while (tmp0_iterator_0.s()) {
267
- var element = tmp0_iterator_0.u();
268
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.checkIntervention.<anonymous>.<anonymous>.<anonymous>' call
269
- if (element.x3l_1 === 'out' ? true : element.x3l_1 === 'und') {
270
- destination_0.o(element);
271
- }
272
- }
273
- // Inline function 'kotlin.collections.mapTo' call
274
- var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_0, 10));
275
- var tmp0_iterator_1 = destination_0.r();
276
- while (tmp0_iterator_1.s()) {
277
- var item_0 = tmp0_iterator_1.u();
278
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.checkIntervention.<anonymous>.<anonymous>.<anonymous>' call
279
- var tmp$ret$6 = item_0.w3l_1.n3l();
280
- destination_1.o(tmp$ret$6);
281
- }
282
265
  var tmp;
283
266
  if (isInterface(destination_1, Collection)) {
284
- tmp = destination_1.z();
267
+ tmp = destination_1.j();
285
268
  } else {
286
269
  tmp = false;
287
270
  }
@@ -289,16 +272,15 @@
289
272
  tmp$ret$9 = false;
290
273
  break $l$block_2;
291
274
  }
292
- var tmp0_iterator_2 = destination_1.r();
293
- while (tmp0_iterator_2.s()) {
294
- var element_0 = tmp0_iterator_2.u();
295
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.checkIntervention.<anonymous>.<anonymous>.<anonymous>' call
275
+ var _iterator__ex2g4s_2 = destination_1.p();
276
+ while (_iterator__ex2g4s_2.s()) {
277
+ var element_0 = _iterator__ex2g4s_2.t();
296
278
  var tmp$ret$10;
297
279
  $l$block_1: {
298
280
  // Inline function 'kotlin.collections.any' call
299
281
  var tmp_0;
300
282
  if (isInterface(support, Collection)) {
301
- tmp_0 = support.z();
283
+ tmp_0 = support.j();
302
284
  } else {
303
285
  tmp_0 = false;
304
286
  }
@@ -306,11 +288,10 @@
306
288
  tmp$ret$10 = false;
307
289
  break $l$block_1;
308
290
  }
309
- var tmp0_iterator_3 = support.r();
310
- while (tmp0_iterator_3.s()) {
311
- var element_1 = tmp0_iterator_3.u();
312
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.checkIntervention.<anonymous>.<anonymous>.<anonymous>.<anonymous>' call
313
- if (Companion_getInstance_0().e1l().match(element_0, element_1)) {
291
+ var _iterator__ex2g4s_3 = support.p();
292
+ while (_iterator__ex2g4s_3.s()) {
293
+ var element_1 = _iterator__ex2g4s_3.t();
294
+ if (Companion_getInstance_0().u1i().match(element_0, element_1)) {
314
295
  tmp$ret$10 = true;
315
296
  break $l$block_1;
316
297
  }
@@ -331,21 +312,21 @@
331
312
  }
332
313
  function checkCausality($this, request, intervention, effect) {
333
314
  var supports = checkBaseTheory($this, request, effect);
334
- if (supports.z())
315
+ if (supports.j())
335
316
  return false;
336
317
  var tmp;
337
318
  if (checkIntervention($this, request, intervention, supports)) {
338
319
  var tmp_0;
339
- if (intervention.ey() <= 1) {
320
+ if (intervention.gx() <= 1) {
340
321
  tmp_0 = true;
341
322
  } else {
323
+ var tmp0 = getSubsets($this, request, intervention);
342
324
  var tmp$ret$0;
343
325
  $l$block_0: {
344
326
  // Inline function 'kotlin.collections.all' call
345
- var this_0 = getSubsets($this, request, intervention);
346
327
  var tmp_1;
347
- if (isInterface(this_0, Collection)) {
348
- tmp_1 = this_0.z();
328
+ if (isInterface(tmp0, Collection)) {
329
+ tmp_1 = tmp0.j();
349
330
  } else {
350
331
  tmp_1 = false;
351
332
  }
@@ -353,10 +334,9 @@
353
334
  tmp$ret$0 = true;
354
335
  break $l$block_0;
355
336
  }
356
- var tmp0_iterator = this_0.r();
357
- while (tmp0_iterator.s()) {
358
- var element = tmp0_iterator.u();
359
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.checkCausality.<anonymous>' call
337
+ var _iterator__ex2g4s = tmp0.p();
338
+ while (_iterator__ex2g4s.s()) {
339
+ var element = _iterator__ex2g4s.t();
360
340
  if (!!checkIntervention($this, request, element, supports)) {
361
341
  tmp$ret$0 = false;
362
342
  break $l$block_0;
@@ -373,134 +353,129 @@
373
353
  return tmp;
374
354
  }
375
355
  function CausalityCheckIntervention($outer) {
376
- this.j3p_1 = $outer;
377
- this.i3p_1 = new Signature('evaluate_intervention', 2);
356
+ this.v3n_1 = $outer;
357
+ this.u3n_1 = new Signature('evaluate_intervention', 2);
378
358
  }
379
- protoOf(CausalityCheckIntervention).d1v = function () {
380
- return this.i3p_1;
359
+ protoOf(CausalityCheckIntervention).m1s = function () {
360
+ return this.u3n_1;
381
361
  };
382
- protoOf(CausalityCheckIntervention).b2h = function (request) {
383
- var intervention = request.arguments.d1(0).castToList();
384
- var effect = this.j3p_1.m3p(request.arguments.d1(1).toString());
385
- return sequenceOf([request.replyWithCondition(checkCausality(this.j3p_1, request, intervention, effect), VOID, [])]);
362
+ protoOf(CausalityCheckIntervention).g2e = function (request) {
363
+ var intervention = request.arguments.w(0).castToList();
364
+ var effect = this.v3n_1.y3n(request.arguments.w(1).toString());
365
+ return sequenceOf(request.replyWithCondition(checkCausality(this.v3n_1, request, intervention, effect), VOID, []));
386
366
  };
387
367
  protoOf(CausalityCheckIntervention).solve = function (request) {
388
- return this.b2h(request);
368
+ return this.g2e(request);
389
369
  };
390
370
  function CausalityCheckCause($outer) {
391
- this.o3p_1 = $outer;
392
- this.n3p_1 = new Signature('evaluate', 3);
371
+ this.a3o_1 = $outer;
372
+ this.z3n_1 = new Signature('evaluate', 3);
393
373
  }
394
- protoOf(CausalityCheckCause).d1v = function () {
395
- return this.n3p_1;
374
+ protoOf(CausalityCheckCause).m1s = function () {
375
+ return this.z3n_1;
396
376
  };
397
- protoOf(CausalityCheckCause).b2h = function (request) {
398
- var intervention = request.arguments.d1(0);
399
- var cause = request.arguments.d1(1);
400
- var effect = this.o3p_1.m3p(request.arguments.d1(2).toString());
377
+ protoOf(CausalityCheckCause).g2e = function (request) {
378
+ var intervention = request.arguments.w(0);
379
+ var cause = request.arguments.w(1);
380
+ var effect = this.a3o_1.y3n(request.arguments.w(2).toString());
401
381
  if (!isInterface(intervention, Var)) {
402
382
  throw Companion_instance_1.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
403
383
  }
404
384
  var tmp = Companion_instance;
405
- // Inline function 'kotlin.collections.filter' call
406
385
  // Inline function 'kotlin.collections.map' call
407
- var this_0 = solveFresh(this.o3p_1, request.context.s1v()).y3l_1;
386
+ var this_0 = solveFresh(this.a3o_1, request.context.b1t()).k3k_1;
408
387
  // Inline function 'kotlin.collections.mapTo' call
409
388
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
410
- var tmp0_iterator = this_0.r();
411
- while (tmp0_iterator.s()) {
412
- var item = tmp0_iterator.u();
413
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalityCheckCause.solve.<anonymous>' call
414
- var tmp$ret$0 = item.e3l_1;
415
- destination.o(tmp$ret$0);
389
+ var _iterator__ex2g4s = this_0.p();
390
+ while (_iterator__ex2g4s.s()) {
391
+ var item = _iterator__ex2g4s.t();
392
+ var tmp$ret$0 = item.r3j_1;
393
+ destination.m(tmp$ret$0);
416
394
  }
395
+ // Inline function 'kotlin.collections.filter' call
417
396
  // Inline function 'kotlin.collections.filterTo' call
418
397
  var destination_0 = ArrayList_init_$Create$();
419
- var tmp0_iterator_0 = destination.r();
420
- while (tmp0_iterator_0.s()) {
421
- var element = tmp0_iterator_0.u();
422
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalityCheckCause.solve.<anonymous>' call
398
+ var _iterator__ex2g4s_0 = destination.p();
399
+ while (_iterator__ex2g4s_0.s()) {
400
+ var element = _iterator__ex2g4s_0.t();
423
401
  if (!(element === 'none')) {
424
- destination_0.o(element);
402
+ destination_0.m(element);
425
403
  }
426
404
  }
427
405
  var rules = parseTerm(tmp, toString(toList_0(destination_0)));
428
- return sequenceOf([request.replyWith(arg2pScope(CausalitySolver$CausalityCheckCause$solve$lambda(request, rules, cause, this.o3p_1, effect, intervention)), VOID, [])]);
406
+ return sequenceOf(request.replyWith(arg2pScope(CausalitySolver$CausalityCheckCause$solve$lambda(request, rules, cause, this.a3o_1, effect, intervention)), VOID, []));
429
407
  };
430
408
  protoOf(CausalityCheckCause).solve = function (request) {
431
- return this.b2h(request);
409
+ return this.g2e(request);
432
410
  };
433
411
  function CausalitySolver$getSupports$lambda(this$0, $effect) {
434
412
  return function (it) {
435
- return it.x3l_1 === 'in' ? equalTerms(this$0, it.w3l_1.f3l_1, $effect) : false;
413
+ return it.j3k_1 === 'in' && equalTerms(this$0, it.i3k_1.s3j_1, $effect);
436
414
  };
437
415
  }
438
416
  function CausalitySolver$getSupports$lambda_0(this$0, $graph) {
439
417
  return function (it) {
440
- return supporters(this$0, it.w3l_1, $graph);
418
+ return supporters(this$0, it.i3k_1, $graph);
441
419
  };
442
420
  }
443
421
  function CausalitySolver$getSupports$lambda_1(it) {
444
- return it.x3l_1 === 'in';
422
+ return it.j3k_1 === 'in';
445
423
  }
446
424
  function CausalitySolver$getSupports$lambda_2(it) {
447
- return it.w3l_1;
425
+ return it.i3k_1;
448
426
  }
449
427
  function CausalitySolver$checkBaseTheory$lambda(a) {
450
- return a.n3l();
428
+ return a.a3k();
451
429
  }
452
430
  function CausalitySolver$getSubsets$lambda$lambda(it) {
453
- return it.u1w();
431
+ return it.d1u();
454
432
  }
455
433
  function CausalitySolver$getSubsets$lambda$lambda_0($this_arg2pScope) {
456
434
  return function (it) {
457
- return ensureNotNull(it.m1v().x2($this_arg2pScope.c1h())).castToList();
435
+ return ensureNotNull(it.v1s().h2($this_arg2pScope.d1g())).castToList();
458
436
  };
459
437
  }
460
438
  function CausalitySolver$getSubsets$lambda($request, $intervention) {
461
439
  return function ($this$arg2pScope) {
462
- var tmp = $request.solve($this$arg2pScope.stringInvoke('proper_subsets', $intervention, [$this$arg2pScope.c1h()]));
440
+ var tmp = $request.solve($this$arg2pScope.stringInvoke('proper_subsets', $intervention, [$this$arg2pScope.d1g()]));
463
441
  var tmp_0 = filter(tmp, CausalitySolver$getSubsets$lambda$lambda);
464
442
  return toList(map(tmp_0, CausalitySolver$getSubsets$lambda$lambda_0($this$arg2pScope)));
465
443
  };
466
444
  }
467
445
  function CausalitySolver() {
468
- this.k3p_1 = 'prolog.argumentation.causality.solver';
469
- this.l3p_1 = Companion_instance_2.r3a().plusOperatorSet(Companion_instance_3.r3a()).plusOperatorSet(Companion_getInstance_3().DEFAULT);
446
+ this.w3n_1 = 'prolog.argumentation.causality.solver';
447
+ this.x3n_1 = Companion_instance_2.d39().plusOperatorSet(Companion_instance_3.d39()).plusOperatorSet(Companion_getInstance_3().DEFAULT);
470
448
  }
471
- protoOf(CausalitySolver).m3p = function (string) {
449
+ protoOf(CausalitySolver).y3n = function (string) {
472
450
  return replace(replace(string, ' ', ''), "'", '');
473
451
  };
474
- protoOf(CausalitySolver).t2e = function () {
475
- return this.k3p_1;
452
+ protoOf(CausalitySolver).y2b = function () {
453
+ return this.w3n_1;
476
454
  };
477
- protoOf(CausalitySolver).n3b = function () {
455
+ protoOf(CausalitySolver).z39 = function () {
478
456
  // Inline function 'kotlin.let' call
479
- // Inline function 'kotlin.contracts.contract' call
480
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.<get-baseContent>.<anonymous>' call
481
457
  var primitives = listOf([new CausalityCheckIntervention(this), new CausalityCheckCause(this)]);
482
458
  var tmp = Companion_getInstance_4();
483
459
  // Inline function 'kotlin.collections.associateBy' call
484
460
  var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(primitives, 10)), 16);
485
461
  // Inline function 'kotlin.collections.associateByTo' call
486
462
  var destination = LinkedHashMap_init_$Create$(capacity);
487
- var tmp0_iterator = primitives.r();
488
- while (tmp0_iterator.s()) {
489
- var element = tmp0_iterator.u();
490
- // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.<get-baseContent>.<anonymous>.<anonymous>' call
491
- var tmp$ret$0 = element.d1v();
492
- destination.o2(tmp$ret$0, element);
463
+ var _iterator__ex2g4s = primitives.p();
464
+ while (_iterator__ex2g4s.s()) {
465
+ var element = _iterator__ex2g4s.t();
466
+ var tmp$ret$0 = element.m1s();
467
+ destination.k4(tmp$ret$0, element);
493
468
  }
494
- return tmp.of(this.k3p_1, destination, parseTheoryWithOperators(Companion_instance_0, 'subsets([], []).\nsubsets([H|T], [H|NT]) :- subsets(T, NT).\nsubsets([_|T], NT) :- subsets(T, NT).\n\nproper_subsets(L, S) :-\n subsets(L, S),\n S \\= [],\n S \\= L.\n\ngenerate_interventions(_, S, [CS]) :-\n compl(S, CS).\ngenerate_interventions(_, S, [undercut(S)]) :-\n S \\= -_.\ngenerate_interventions(R, S, SUP) :-\n parser:::convertAllRules(_),\n compl(S, CS),\n unused_premises(R, UP), !,\n subsets(UP, SUP),\n member(CS, SUP),\n SUP \\= [].\n\ncompl(-X, X) :- !.\ncompl(X, -X).\n\nunused_premises(R, UP) :-\n findall(P, (parser::rule(Id, P, _), \\+ member(Id, R)), RR),\n utils::appendLists(RR, UP).\n', this.l3p_1));
469
+ return tmp.of(this.w3n_1, destination, parseTheoryWithOperators(Companion_instance_0, 'subsets([], []).\nsubsets([H|T], [H|NT]) :- subsets(T, NT).\nsubsets([_|T], NT) :- subsets(T, NT).\n\nproper_subsets(L, S) :-\n subsets(L, S),\n S \\= [],\n S \\= L.\n\ngenerate_interventions(_, S, [CS]) :-\n compl(S, CS).\ngenerate_interventions(_, S, [undercut(S)]) :-\n S \\= -_.\ngenerate_interventions(R, S, SUP) :-\n parser:::convertAllRules(_),\n compl(S, CS),\n unused_premises(R, UP), !,\n subsets(UP, SUP),\n member(CS, SUP),\n SUP \\= [].\n\ncompl(-X, X) :- !.\ncompl(X, -X).\n\nunused_premises(R, UP) :-\n findall(P, (parser::rule(Id, P, _), \\+ member(Id, R)), RR),\n utils::appendLists(RR, UP).\n', this.x3n_1));
495
470
  };
496
- protoOf(CausalitySolver).o3b = function () {
471
+ protoOf(CausalitySolver).a3a = function () {
497
472
  return 'causality';
498
473
  };
499
- protoOf(CausalitySolver).w3a = function () {
500
- return this.l3p_1;
474
+ protoOf(CausalitySolver).i39 = function () {
475
+ return this.x3n_1;
501
476
  };
502
477
  //region block: post-declaration
503
- protoOf(CausalitySolver).v3a = content;
478
+ protoOf(CausalitySolver).h39 = content;
504
479
  //endregion
505
480
  //region block: exports
506
481
  _.$_$ = _.$_$ || {};