@tuprolog/arg2p 0.14.2 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
1
  (function (factory) {
2
2
  if (typeof define === 'function' && define.amd)
3
- define(['exports', './kotlin-kotlin-stdlib.js', './2p-core.js', './2p-unify.js', './2p-parser-core.js', './2p-theory.js', './2p-parser-theory.js', './arg2p-core.js', './2p-solve.js'], factory);
3
+ define(['exports', './2p-core.js', './kotlin-kotlin-stdlib.js', './2p-unify.js', './2p-parser-core.js', './2p-theory.js', './2p-parser-theory.js', './arg2p-core.js', './2p-solve.js'], factory);
4
4
  else if (typeof exports === 'object')
5
- factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./2p-core.js'), require('./2p-unify.js'), require('./2p-parser-core.js'), require('./2p-theory.js'), require('./2p-parser-theory.js'), require('./arg2p-core.js'), require('./2p-solve.js'));
5
+ factory(module.exports, require('./2p-core.js'), require('./kotlin-kotlin-stdlib.js'), require('./2p-unify.js'), require('./2p-parser-core.js'), require('./2p-theory.js'), require('./2p-parser-theory.js'), require('./arg2p-core.js'), require('./2p-solve.js'));
6
6
  else {
7
- if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
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
- }
10
7
  if (typeof globalThis['2p-core'] === 'undefined') {
11
8
  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
9
  }
10
+ if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
11
+ 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'.");
12
+ }
13
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
  }
@@ -28,105 +28,124 @@
28
28
  if (typeof globalThis['2p-solve'] === 'undefined') {
29
29
  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'.");
30
30
  }
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['2p-theory'], globalThis['2p-parser-theory'], globalThis['arg2p-core'], globalThis['2p-solve']);
31
+ globalThis['arg2p-causality-solver'] = factory(typeof globalThis['arg2p-causality-solver'] === 'undefined' ? {} : globalThis['arg2p-causality-solver'], globalThis['2p-core'], globalThis['kotlin-kotlin-stdlib'], globalThis['2p-unify'], globalThis['2p-parser-core'], globalThis['2p-theory'], globalThis['2p-parser-theory'], globalThis['arg2p-core'], globalThis['2p-solve']);
32
32
  }
33
- }(function (_, kotlin_kotlin, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_unify, kotlin_it_unibo_tuprolog_parser_core, kotlin_it_unibo_tuprolog_theory, kotlin_it_unibo_tuprolog_parser_theory, kotlin_it_unibo_tuprolog_argumentation_core, kotlin_it_unibo_tuprolog_solve) {
33
+ }(function (_, kotlin_it_unibo_tuprolog_core, kotlin_kotlin, kotlin_it_unibo_tuprolog_unify, kotlin_it_unibo_tuprolog_parser_core, kotlin_it_unibo_tuprolog_theory, kotlin_it_unibo_tuprolog_parser_theory, kotlin_it_unibo_tuprolog_argumentation_core, kotlin_it_unibo_tuprolog_solve) {
34
34
  'use strict';
35
35
  //region block: imports
36
- var ensureNotNull = kotlin_kotlin.$_$.ua;
36
+ var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.p;
37
+ var ensureNotNull = kotlin_kotlin.$_$.va;
38
+ var filter = kotlin_kotlin.$_$.v7;
39
+ var map = kotlin_kotlin.$_$.h8;
40
+ var firstOrNull = kotlin_kotlin.$_$.w7;
37
41
  var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.v;
38
- var filter = kotlin_kotlin.$_$.u7;
39
- var map = kotlin_kotlin.$_$.g8;
40
- var firstOrNull = kotlin_kotlin.$_$.v7;
41
42
  var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_unify.$_$.b;
42
- var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.w;
43
+ var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.w;
43
44
  var parseTerm = kotlin_it_unibo_tuprolog_parser_core.$_$.e;
44
45
  var ArrayList_init_$Create$ = kotlin_kotlin.$_$.d;
45
46
  var Unit_instance = kotlin_kotlin.$_$.l1;
46
47
  var collectionSizeOrDefault = kotlin_kotlin.$_$.c2;
47
48
  var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.c;
48
- var plus = kotlin_kotlin.$_$.y3;
49
+ var plus = kotlin_kotlin.$_$.z3;
49
50
  var addAll = kotlin_kotlin.$_$.s1;
50
- var plus_0 = kotlin_kotlin.$_$.x3;
51
- var emptyList = kotlin_kotlin.$_$.n2;
52
- var Companion_instance_0 = kotlin_it_unibo_tuprolog_theory.$_$.b;
51
+ var plus_0 = kotlin_kotlin.$_$.y3;
52
+ var emptyList = kotlin_kotlin.$_$.o2;
53
+ var Companion_instance_1 = kotlin_it_unibo_tuprolog_theory.$_$.b;
53
54
  var parseTheoryWithOperators = kotlin_it_unibo_tuprolog_parser_theory.$_$.b;
54
55
  var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.u;
55
56
  var parseStruct = kotlin_it_unibo_tuprolog_parser_core.$_$.d;
56
57
  var Graph = kotlin_it_unibo_tuprolog_argumentation_core.$_$.l;
57
58
  var asSequence = kotlin_kotlin.$_$.a2;
58
- var flatMap = kotlin_kotlin.$_$.y7;
59
- var toList = kotlin_kotlin.$_$.v8;
59
+ var flatMap = kotlin_kotlin.$_$.z7;
60
+ var toList = kotlin_kotlin.$_$.w8;
60
61
  var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.l;
61
- var Default_getInstance = kotlin_kotlin.$_$.i1;
62
- var nextUInt = kotlin_kotlin.$_$.w6;
63
- var UInt = kotlin_kotlin.$_$.ta;
64
62
  var Collection = kotlin_kotlin.$_$.m1;
65
- var isInterface = kotlin_kotlin.$_$.h6;
63
+ var isInterface = kotlin_kotlin.$_$.i6;
64
+ var distinct = kotlin_kotlin.$_$.m2;
66
65
  var arg2pScope = kotlin_it_unibo_tuprolog_argumentation_core.$_$.e;
66
+ var toList_0 = kotlin_kotlin.$_$.g4;
67
+ var toString = kotlin_kotlin.$_$.r6;
68
+ var Default_getInstance = kotlin_kotlin.$_$.i1;
69
+ var nextUInt = kotlin_kotlin.$_$.x6;
70
+ var UInt = kotlin_kotlin.$_$.ua;
67
71
  var Signature = kotlin_it_unibo_tuprolog_solve.$_$.u2;
68
- var protoOf = kotlin_kotlin.$_$.n6;
72
+ var protoOf = kotlin_kotlin.$_$.o6;
69
73
  var VOID = kotlin_kotlin.$_$.b;
70
- var sequenceOf = kotlin_kotlin.$_$.n8;
74
+ var sequenceOf = kotlin_kotlin.$_$.o8;
71
75
  var Primitive = kotlin_it_unibo_tuprolog_solve.$_$.w1;
72
- var initMetadataForClass = kotlin_kotlin.$_$.a6;
73
- var Companion_instance_1 = kotlin_it_unibo_tuprolog_solve.$_$.b1;
76
+ var initMetadataForClass = kotlin_kotlin.$_$.b6;
77
+ var Companion_instance_2 = kotlin_it_unibo_tuprolog_solve.$_$.b1;
74
78
  var Expected_VARIABLE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.c;
75
79
  var Var = kotlin_it_unibo_tuprolog_core.$_$.t2;
76
- var toList_0 = kotlin_kotlin.$_$.f4;
77
- var toString = kotlin_kotlin.$_$.q6;
78
80
  var mineActiveGraph = kotlin_it_unibo_tuprolog_argumentation_core.$_$.k;
79
81
  var Arg2pSolverFactory_instance = kotlin_it_unibo_tuprolog_argumentation_core.$_$.d;
80
82
  var FlagsBuilder = kotlin_it_unibo_tuprolog_argumentation_core.$_$.f;
81
- var Companion_instance_2 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.c;
82
- var Companion_instance_3 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.a;
83
- var Companion_instance_4 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.b;
83
+ var Companion_instance_3 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.c;
84
+ var Companion_instance_4 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.a;
85
+ var Companion_instance_5 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.b;
84
86
  var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.i;
85
- var replace = kotlin_kotlin.$_$.o9;
86
- var listOf = kotlin_kotlin.$_$.e3;
87
+ var replace = kotlin_kotlin.$_$.p9;
88
+ var listOf = kotlin_kotlin.$_$.f3;
87
89
  var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_solve.$_$.h1;
88
- var mapCapacity = kotlin_kotlin.$_$.f3;
89
- var coerceAtLeast = kotlin_kotlin.$_$.b7;
90
+ var mapCapacity = kotlin_kotlin.$_$.g3;
91
+ var coerceAtLeast = kotlin_kotlin.$_$.c7;
90
92
  var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.e;
91
93
  var content = kotlin_it_unibo_tuprolog_argumentation_core.$_$.g;
92
94
  var ArgLibrary = kotlin_it_unibo_tuprolog_argumentation_core.$_$.h;
93
95
  var Loadable = kotlin_it_unibo_tuprolog_argumentation_core.$_$.i;
94
96
  //endregion
95
97
  //region block: pre-declaration
96
- initMetadataForClass(CausalityCheckIntervention, 'CausalityCheckIntervention', VOID, VOID, [Primitive]);
97
- initMetadataForClass(CausalityCheckCause, 'CausalityCheckCause', VOID, VOID, [Primitive]);
98
+ initMetadataForClass(CausalityCheckCauseButFor, 'CausalityCheckCauseButFor', VOID, VOID, [Primitive]);
99
+ initMetadataForClass(CausalityCheckInterventionICAIL24, 'CausalityCheckInterventionICAIL24', VOID, VOID, [Primitive]);
100
+ initMetadataForClass(CausalityCheckCauseICAIL24, 'CausalityCheckCauseICAIL24', VOID, VOID, [Primitive]);
101
+ initMetadataForClass(CausalityCheckInterventionICAIL25, 'CausalityCheckInterventionICAIL25', VOID, VOID, [Primitive]);
102
+ initMetadataForClass(CausalityCheckCauseICAIL25, 'CausalityCheckCauseICAIL25', VOID, VOID, [Primitive]);
98
103
  initMetadataForClass(CausalitySolver, 'CausalitySolver', CausalitySolver, VOID, [ArgLibrary, Loadable]);
99
104
  //endregion
100
- function CausalitySolver$CausalityCheckCause$solve$lambda$lambda(it) {
105
+ function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda(it) {
101
106
  return it.a1v();
102
107
  }
103
- function CausalitySolver$CausalityCheckCause$solve$lambda$lambda_0($this_arg2pScope) {
108
+ function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_0($this_arg2pScope) {
104
109
  return function (it) {
105
- return ensureNotNull(it.s1t().h2($this_arg2pScope.a1h())).castToList();
110
+ return Companion_instance.of([ensureNotNull(it.s1t().h2($this_arg2pScope.a1h()))]);
111
+ };
112
+ }
113
+ function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_1(this$0, $request, $effect) {
114
+ return function (it) {
115
+ return checkButFor(this$0, $request, it, $effect);
106
116
  };
107
117
  }
108
- function CausalitySolver$CausalityCheckCause$solve$lambda$lambda_1(this$0, $request, $effect) {
118
+ function CausalitySolver$CausalityCheckCauseButFor$solve$lambda($request, $cause, this$0, $effect) {
119
+ return function ($this$arg2pScope) {
120
+ var tmp = $request.solve($this$arg2pScope.stringInvoke('compl', $cause, [$this$arg2pScope.a1h()]));
121
+ var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda);
122
+ var tmp_1 = map(tmp_0, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_0($this$arg2pScope));
123
+ var tmp0_elvis_lhs = firstOrNull(map(tmp_1, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_1(this$0, $request, $effect)));
124
+ return tmp0_elvis_lhs == null ? false : tmp0_elvis_lhs;
125
+ };
126
+ }
127
+ function CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda(this$0, $request, $effect) {
109
128
  return function (it) {
110
- return checkCausality(this$0, $request, it, $effect);
129
+ return checkCausalityICAIL24(this$0, $request, it, $effect);
111
130
  };
112
131
  }
113
- function CausalitySolver$CausalityCheckCause$solve$lambda$lambda_2($intervention) {
132
+ function CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda_0($intervention) {
114
133
  return function (it) {
115
134
  return Companion_getInstance().of($intervention, it);
116
135
  };
117
136
  }
118
- function CausalitySolver$CausalityCheckCause$solve$lambda($request, $rules, $cause, this$0, $effect, $intervention) {
119
- return function ($this$arg2pScope) {
120
- var tmp = $request.solve($this$arg2pScope.stringInvoke('generate_interventions', $rules, [$cause, $this$arg2pScope.a1h()]));
121
- var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCause$solve$lambda$lambda);
122
- var tmp_1 = map(tmp_0, CausalitySolver$CausalityCheckCause$solve$lambda$lambda_0($this$arg2pScope));
123
- var tmp_2 = filter(tmp_1, CausalitySolver$CausalityCheckCause$solve$lambda$lambda_1(this$0, $request, $effect));
124
- var tmp0_elvis_lhs = firstOrNull(map(tmp_2, CausalitySolver$CausalityCheckCause$solve$lambda$lambda_2($intervention)));
125
- return tmp0_elvis_lhs == null ? Companion_getInstance().failed() : tmp0_elvis_lhs;
137
+ function CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda(this$0, $request, $effect) {
138
+ return function (it) {
139
+ return checkCausalityICAIL25(this$0, $request, it, $effect);
140
+ };
141
+ }
142
+ function CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda_0($intervention) {
143
+ return function (it) {
144
+ return Companion_getInstance().of($intervention, it);
126
145
  };
127
146
  }
128
147
  function equalTerms($this, a, b) {
129
- return Companion_getInstance_0().r1j().match(parseTerm(Companion_instance, a), parseTerm(Companion_instance, b));
148
+ return Companion_getInstance_0().r1j().match(parseTerm(Companion_instance_0, a), parseTerm(Companion_instance_0, b));
130
149
  }
131
150
  function attackers($this, x, graph) {
132
151
  // Inline function 'kotlin.collections.filter' call
@@ -220,7 +239,7 @@
220
239
  }
221
240
  function solveFresh($this, effect, kb) {
222
241
  $this.a3r_1.resetStaticKb();
223
- $this.a3r_1.loadStaticKb(parseTheoryWithOperators(Companion_instance_0, kb.toStringAsProlog(true), $this.b3r_1));
242
+ $this.a3r_1.loadStaticKb(parseTheoryWithOperators(Companion_instance_1, kb.toStringAsProlog(true), $this.b3r_1));
224
243
  var tmp = $this.a3r_1.solve(parseStruct(Companion_getInstance_1(), 'answerQuery(' + effect + ')'));
225
244
  var tmp0_elvis_lhs = firstOrNull(map(tmp, CausalitySolver$solveFresh$lambda($this)));
226
245
  return tmp0_elvis_lhs == null ? new Graph(emptyList(), emptyList(), emptyList()) : tmp0_elvis_lhs;
@@ -245,13 +264,14 @@
245
264
  var _iterator__ex2g4s = this_0.p();
246
265
  while (_iterator__ex2g4s.s()) {
247
266
  var item = _iterator__ex2g4s.t();
248
- var tmp$ret$0 = Companion_getInstance_2().of(parseStruct(Companion_getInstance_1(), ':->(fk' + new UInt(nextUInt(Default_getInstance())) + ', ' + item.toString() + ')'), []);
267
+ var tmp$ret$0 = Companion_getInstance_2().of(parseStruct(Companion_getInstance_1(), ':->(fk' + (item.hashCode() & 2147483647) + ', ' + item.toString() + ')'), []);
249
268
  destination.m(tmp$ret$0);
250
269
  }
251
270
  // Inline function 'kotlin.let' call
252
271
  // Inline function 'kotlin.let' call
272
+ var naf = solveFresh($this, effect, request.context.y1t().plusTheory(Companion_instance_1.ofIterableWithDefaultUnificator(destination)));
253
273
  // Inline function 'kotlin.collections.filter' call
254
- var tmp0 = solveFresh($this, effect, request.context.y1t().plusTheory(Companion_instance_0.ofIterableWithDefaultUnificator(destination))).t3n_1;
274
+ var tmp0 = naf.t3n_1;
255
275
  // Inline function 'kotlin.collections.filterTo' call
256
276
  var destination_0 = ArrayList_init_$Create$();
257
277
  var _iterator__ex2g4s_0 = tmp0.p();
@@ -261,80 +281,114 @@
261
281
  destination_0.m(element);
262
282
  }
263
283
  }
264
- // Inline function 'kotlin.collections.map' call
265
- // Inline function 'kotlin.collections.mapTo' call
266
- var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_0, 10));
284
+ // Inline function 'kotlin.collections.filter' call
285
+ // Inline function 'kotlin.collections.filterTo' call
286
+ var destination_1 = ArrayList_init_$Create$();
267
287
  var _iterator__ex2g4s_1 = destination_0.p();
268
288
  while (_iterator__ex2g4s_1.s()) {
269
- var item_0 = _iterator__ex2g4s_1.t();
270
- var tmp$ret$6 = item_0.o3n_1.f3n();
271
- destination_1.m(tmp$ret$6);
272
- }
273
- var tmp$ret$9;
274
- $l$block_2: {
275
- // Inline function 'kotlin.collections.any' call
276
- var tmp;
277
- if (isInterface(destination_1, Collection)) {
278
- tmp = destination_1.j();
279
- } else {
280
- tmp = false;
281
- }
282
- if (tmp) {
283
- tmp$ret$9 = false;
284
- break $l$block_2;
285
- }
286
- var _iterator__ex2g4s_2 = destination_1.p();
287
- while (_iterator__ex2g4s_2.s()) {
288
- var element_0 = _iterator__ex2g4s_2.t();
289
- var tmp$ret$10;
290
- $l$block_1: {
291
- // Inline function 'kotlin.collections.any' call
292
- var tmp_0;
293
- if (isInterface(support, Collection)) {
294
- tmp_0 = support.j();
295
- } else {
296
- tmp_0 = false;
297
- }
298
- if (tmp_0) {
299
- tmp$ret$10 = false;
300
- break $l$block_1;
301
- }
302
- var _iterator__ex2g4s_3 = support.p();
303
- while (_iterator__ex2g4s_3.s()) {
304
- var element_1 = _iterator__ex2g4s_3.t();
305
- if (Companion_getInstance_0().r1j().match(element_0, element_1)) {
306
- tmp$ret$10 = true;
307
- break $l$block_1;
308
- }
289
+ var element_0 = _iterator__ex2g4s_1.t();
290
+ var tmp$ret$6;
291
+ $l$block_0: {
292
+ // Inline function 'kotlin.collections.any' call
293
+ var tmp;
294
+ if (isInterface(support, Collection)) {
295
+ tmp = support.j();
296
+ } else {
297
+ tmp = false;
298
+ }
299
+ if (tmp) {
300
+ tmp$ret$6 = false;
301
+ break $l$block_0;
302
+ }
303
+ var _iterator__ex2g4s_2 = support.p();
304
+ while (_iterator__ex2g4s_2.s()) {
305
+ var element_1 = _iterator__ex2g4s_2.t();
306
+ if (Companion_getInstance_0().r1j().match(element_0.o3n_1.f3n(), element_1)) {
307
+ tmp$ret$6 = true;
308
+ break $l$block_0;
309
309
  }
310
- tmp$ret$10 = false;
311
310
  }
312
- if (tmp$ret$10) {
313
- tmp$ret$9 = true;
314
- break $l$block_2;
311
+ tmp$ret$6 = false;
312
+ }
313
+ if (tmp$ret$6) {
314
+ destination_1.m(element_0);
315
+ }
316
+ }
317
+ // Inline function 'kotlin.collections.flatMap' call
318
+ // Inline function 'kotlin.collections.flatMapTo' call
319
+ var destination_2 = ArrayList_init_$Create$();
320
+ var _iterator__ex2g4s_3 = destination_1.p();
321
+ while (_iterator__ex2g4s_3.s()) {
322
+ var element_2 = _iterator__ex2g4s_3.t();
323
+ // Inline function 'kotlin.collections.filter' call
324
+ var tmp0_0 = attackers($this, element_2.o3n_1, naf);
325
+ // Inline function 'kotlin.collections.filterTo' call
326
+ var destination_3 = ArrayList_init_$Create$();
327
+ var _iterator__ex2g4s_4 = tmp0_0.p();
328
+ while (_iterator__ex2g4s_4.s()) {
329
+ var element_3 = _iterator__ex2g4s_4.t();
330
+ if (element_3.p3n_1 === 'in') {
331
+ destination_3.m(element_3);
315
332
  }
316
333
  }
317
- tmp$ret$9 = false;
334
+ var list = destination_3;
335
+ addAll(destination_2, list);
336
+ }
337
+ // Inline function 'kotlin.collections.map' call
338
+ // Inline function 'kotlin.collections.mapTo' call
339
+ var destination_4 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_2, 10));
340
+ var _iterator__ex2g4s_5 = destination_2.p();
341
+ while (_iterator__ex2g4s_5.s()) {
342
+ var item_0 = _iterator__ex2g4s_5.t();
343
+ var tmp$ret$17 = item_0.o3n_1;
344
+ destination_4.m(tmp$ret$17);
318
345
  }
319
- return tmp$ret$9;
346
+ return distinct(destination_4);
320
347
  }
321
348
  function getSubsets($this, request, intervention) {
322
349
  return arg2pScope(CausalitySolver$getSubsets$lambda(request, intervention));
323
350
  }
324
- function checkCausality($this, request, intervention, effect) {
351
+ function getInterventions($this, request, cause, effect) {
352
+ var tmp = Companion_instance_0;
353
+ // Inline function 'kotlin.collections.map' call
354
+ var this_0 = solveFresh($this, effect, request.context.y1t()).q3n_1;
355
+ // Inline function 'kotlin.collections.mapTo' call
356
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
357
+ var _iterator__ex2g4s = this_0.p();
358
+ while (_iterator__ex2g4s.s()) {
359
+ var item = _iterator__ex2g4s.t();
360
+ var tmp$ret$0 = item.w3m_1;
361
+ destination.m(tmp$ret$0);
362
+ }
363
+ // Inline function 'kotlin.collections.filter' call
364
+ // Inline function 'kotlin.collections.filterTo' call
365
+ var destination_0 = ArrayList_init_$Create$();
366
+ var _iterator__ex2g4s_0 = destination.p();
367
+ while (_iterator__ex2g4s_0.s()) {
368
+ var element = _iterator__ex2g4s_0.t();
369
+ if (!(element === 'none')) {
370
+ destination_0.m(element);
371
+ }
372
+ }
373
+ var rules = parseTerm(tmp, toString(toList_0(destination_0)));
374
+ return arg2pScope(CausalitySolver$getInterventions$lambda(request, rules, cause));
375
+ }
376
+ function checkCausalityICAIL24($this, request, intervention, effect) {
325
377
  var supports = checkBaseTheory($this, request, effect);
326
378
  if (supports.j())
327
379
  return false;
380
+ var attackers = checkIntervention($this, request, intervention, supports, effect);
328
381
  var tmp;
329
- if (checkIntervention($this, request, intervention, supports, effect)) {
382
+ // Inline function 'kotlin.collections.isNotEmpty' call
383
+ if (!attackers.j()) {
330
384
  var tmp_0;
331
385
  if (intervention.ey() <= 1) {
332
386
  tmp_0 = true;
333
387
  } else {
334
388
  var tmp0 = getSubsets($this, request, intervention);
335
- var tmp$ret$0;
389
+ var tmp$ret$1;
336
390
  $l$block_0: {
337
- // Inline function 'kotlin.collections.all' call
391
+ // Inline function 'kotlin.collections.none' call
338
392
  var tmp_1;
339
393
  if (isInterface(tmp0, Collection)) {
340
394
  tmp_1 = tmp0.j();
@@ -342,20 +396,21 @@
342
396
  tmp_1 = false;
343
397
  }
344
398
  if (tmp_1) {
345
- tmp$ret$0 = true;
399
+ tmp$ret$1 = true;
346
400
  break $l$block_0;
347
401
  }
348
402
  var _iterator__ex2g4s = tmp0.p();
349
403
  while (_iterator__ex2g4s.s()) {
350
404
  var element = _iterator__ex2g4s.t();
351
- if (!!checkIntervention($this, request, element, supports, effect)) {
352
- tmp$ret$0 = false;
405
+ // Inline function 'kotlin.collections.isNotEmpty' call
406
+ if (!checkIntervention($this, request, element, supports, effect).j()) {
407
+ tmp$ret$1 = false;
353
408
  break $l$block_0;
354
409
  }
355
410
  }
356
- tmp$ret$0 = true;
411
+ tmp$ret$1 = true;
357
412
  }
358
- tmp_0 = tmp$ret$0;
413
+ tmp_0 = tmp$ret$1;
359
414
  }
360
415
  tmp = tmp_0;
361
416
  } else {
@@ -363,60 +418,274 @@
363
418
  }
364
419
  return tmp;
365
420
  }
366
- function CausalityCheckIntervention($outer) {
421
+ function checkCausalityICAIL25($this, request, intervention, effect) {
422
+ var supports = checkBaseTheory($this, request, effect);
423
+ if (supports.j())
424
+ return false;
425
+ // Inline function 'kotlin.collections.map' call
426
+ var this_0 = checkIntervention($this, request, intervention, supports, effect);
427
+ // Inline function 'kotlin.collections.mapTo' call
428
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
429
+ var _iterator__ex2g4s = this_0.p();
430
+ while (_iterator__ex2g4s.s()) {
431
+ var item = _iterator__ex2g4s.t();
432
+ var tmp$ret$0 = item.f3n();
433
+ destination.m(tmp$ret$0);
434
+ }
435
+ var attackers = destination;
436
+ var tmp;
437
+ // Inline function 'kotlin.collections.isNotEmpty' call
438
+ if (!attackers.j()) {
439
+ var tmp_0;
440
+ if (intervention.ey() <= 1) {
441
+ tmp_0 = true;
442
+ } else {
443
+ var tmp0 = getSubsets($this, request, intervention);
444
+ var tmp$ret$4;
445
+ $l$block_4: {
446
+ // Inline function 'kotlin.collections.none' call
447
+ var tmp_1;
448
+ if (isInterface(tmp0, Collection)) {
449
+ tmp_1 = tmp0.j();
450
+ } else {
451
+ tmp_1 = false;
452
+ }
453
+ if (tmp_1) {
454
+ tmp$ret$4 = true;
455
+ break $l$block_4;
456
+ }
457
+ var _iterator__ex2g4s_0 = tmp0.p();
458
+ while (_iterator__ex2g4s_0.s()) {
459
+ var element = _iterator__ex2g4s_0.t();
460
+ // Inline function 'kotlin.collections.map' call
461
+ var this_1 = checkIntervention($this, request, element, supports, effect);
462
+ // Inline function 'kotlin.collections.mapTo' call
463
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
464
+ var _iterator__ex2g4s_1 = this_1.p();
465
+ while (_iterator__ex2g4s_1.s()) {
466
+ var item_0 = _iterator__ex2g4s_1.t();
467
+ var tmp$ret$5 = item_0.f3n();
468
+ destination_0.m(tmp$ret$5);
469
+ }
470
+ var n = destination_0;
471
+ var tmp$ret$8;
472
+ $l$block_3: {
473
+ // Inline function 'kotlin.collections.all' call
474
+ var tmp_2;
475
+ if (isInterface(attackers, Collection)) {
476
+ tmp_2 = attackers.j();
477
+ } else {
478
+ tmp_2 = false;
479
+ }
480
+ if (tmp_2) {
481
+ tmp$ret$8 = true;
482
+ break $l$block_3;
483
+ }
484
+ var _iterator__ex2g4s_2 = attackers.p();
485
+ while (_iterator__ex2g4s_2.s()) {
486
+ var element_0 = _iterator__ex2g4s_2.t();
487
+ var tmp$ret$9;
488
+ $l$block_2: {
489
+ // Inline function 'kotlin.collections.any' call
490
+ var tmp_3;
491
+ if (isInterface(n, Collection)) {
492
+ tmp_3 = n.j();
493
+ } else {
494
+ tmp_3 = false;
495
+ }
496
+ if (tmp_3) {
497
+ tmp$ret$9 = false;
498
+ break $l$block_2;
499
+ }
500
+ var _iterator__ex2g4s_3 = n.p();
501
+ while (_iterator__ex2g4s_3.s()) {
502
+ var element_1 = _iterator__ex2g4s_3.t();
503
+ if (Companion_getInstance_0().r1j().match(element_0, element_1)) {
504
+ tmp$ret$9 = true;
505
+ break $l$block_2;
506
+ }
507
+ }
508
+ tmp$ret$9 = false;
509
+ }
510
+ if (!tmp$ret$9) {
511
+ tmp$ret$8 = false;
512
+ break $l$block_3;
513
+ }
514
+ }
515
+ tmp$ret$8 = true;
516
+ }
517
+ if (tmp$ret$8) {
518
+ tmp$ret$4 = false;
519
+ break $l$block_4;
520
+ }
521
+ }
522
+ tmp$ret$4 = true;
523
+ }
524
+ tmp_0 = tmp$ret$4;
525
+ }
526
+ tmp = tmp_0;
527
+ } else {
528
+ tmp = false;
529
+ }
530
+ return tmp;
531
+ }
532
+ function checkButFor($this, request, intervention, effect) {
533
+ var tmp;
534
+ // Inline function 'kotlin.let' call
535
+ var tmp0 = solveFresh($this, effect, request.context.y1t()).t3n_1;
536
+ var tmp$ret$0;
537
+ $l$block_0: {
538
+ // Inline function 'kotlin.collections.any' call
539
+ var tmp_0;
540
+ if (isInterface(tmp0, Collection)) {
541
+ tmp_0 = tmp0.j();
542
+ } else {
543
+ tmp_0 = false;
544
+ }
545
+ if (tmp_0) {
546
+ tmp$ret$0 = false;
547
+ break $l$block_0;
548
+ }
549
+ var _iterator__ex2g4s = tmp0.p();
550
+ while (_iterator__ex2g4s.s()) {
551
+ var element = _iterator__ex2g4s.t();
552
+ if (element.p3n_1 === 'in' && equalTerms($this, element.o3n_1.x3m_1, effect)) {
553
+ tmp$ret$0 = true;
554
+ break $l$block_0;
555
+ }
556
+ }
557
+ tmp$ret$0 = false;
558
+ }
559
+ if (tmp$ret$0) {
560
+ // Inline function 'kotlin.collections.map' call
561
+ var this_0 = intervention.toList();
562
+ // Inline function 'kotlin.collections.mapTo' call
563
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
564
+ var _iterator__ex2g4s_0 = this_0.p();
565
+ while (_iterator__ex2g4s_0.s()) {
566
+ var item = _iterator__ex2g4s_0.t();
567
+ var tmp$ret$4 = Companion_getInstance_2().of(parseStruct(Companion_getInstance_1(), ':->(fk' + new UInt(nextUInt(Default_getInstance())) + ', ' + item.toString() + ')'), []);
568
+ destination.m(tmp$ret$4);
569
+ }
570
+ // Inline function 'kotlin.let' call
571
+ // Inline function 'kotlin.let' call
572
+ var tmp0_0 = solveFresh($this, effect, request.context.y1t().plusTheory(Companion_instance_1.ofIterableWithDefaultUnificator(destination))).t3n_1;
573
+ var tmp$ret$7;
574
+ $l$block_2: {
575
+ // Inline function 'kotlin.collections.none' call
576
+ var tmp_1;
577
+ if (isInterface(tmp0_0, Collection)) {
578
+ tmp_1 = tmp0_0.j();
579
+ } else {
580
+ tmp_1 = false;
581
+ }
582
+ if (tmp_1) {
583
+ tmp$ret$7 = true;
584
+ break $l$block_2;
585
+ }
586
+ var _iterator__ex2g4s_1 = tmp0_0.p();
587
+ while (_iterator__ex2g4s_1.s()) {
588
+ var element_0 = _iterator__ex2g4s_1.t();
589
+ if (element_0.p3n_1 === 'in' && equalTerms($this, element_0.o3n_1.x3m_1, effect)) {
590
+ tmp$ret$7 = false;
591
+ break $l$block_2;
592
+ }
593
+ }
594
+ tmp$ret$7 = true;
595
+ }
596
+ tmp = tmp$ret$7;
597
+ } else {
598
+ tmp = false;
599
+ }
600
+ return tmp;
601
+ }
602
+ function CausalityCheckCauseButFor($outer) {
367
603
  this.f3r_1 = $outer;
368
- this.e3r_1 = new Signature('evaluate_intervention', 2);
604
+ this.e3r_1 = new Signature('but_for', 2);
369
605
  }
370
- protoOf(CausalityCheckIntervention).j1t = function () {
606
+ protoOf(CausalityCheckCauseButFor).j1t = function () {
371
607
  return this.e3r_1;
372
608
  };
373
- protoOf(CausalityCheckIntervention).d2f = function (request) {
374
- var intervention = request.arguments.w(0).castToList();
609
+ protoOf(CausalityCheckCauseButFor).d2f = function (request) {
610
+ var cause = request.arguments.w(0);
375
611
  var effect = this.f3r_1.g3r(request.arguments.w(1).toString());
376
- return sequenceOf(request.replyWithCondition(checkCausality(this.f3r_1, request, intervention, effect), VOID, []));
612
+ return sequenceOf(request.replyWithCondition(arg2pScope(CausalitySolver$CausalityCheckCauseButFor$solve$lambda(request, cause, this.f3r_1, effect)), VOID, []));
377
613
  };
378
- protoOf(CausalityCheckIntervention).solve = function (request) {
614
+ protoOf(CausalityCheckCauseButFor).solve = function (request) {
379
615
  return this.d2f(request);
380
616
  };
381
- function CausalityCheckCause($outer) {
617
+ function CausalityCheckInterventionICAIL24($outer) {
382
618
  this.i3r_1 = $outer;
383
- this.h3r_1 = new Signature('evaluate', 3);
619
+ this.h3r_1 = new Signature('ness_original_intervention', 2);
384
620
  }
385
- protoOf(CausalityCheckCause).j1t = function () {
621
+ protoOf(CausalityCheckInterventionICAIL24).j1t = function () {
386
622
  return this.h3r_1;
387
623
  };
388
- protoOf(CausalityCheckCause).d2f = function (request) {
624
+ protoOf(CausalityCheckInterventionICAIL24).d2f = function (request) {
625
+ var intervention = request.arguments.w(0).castToList();
626
+ var effect = this.i3r_1.g3r(request.arguments.w(1).toString());
627
+ return sequenceOf(request.replyWithCondition(checkCausalityICAIL24(this.i3r_1, request, intervention, effect), VOID, []));
628
+ };
629
+ protoOf(CausalityCheckInterventionICAIL24).solve = function (request) {
630
+ return this.d2f(request);
631
+ };
632
+ function CausalityCheckCauseICAIL24($outer) {
633
+ this.k3r_1 = $outer;
634
+ this.j3r_1 = new Signature('ness_original', 3);
635
+ }
636
+ protoOf(CausalityCheckCauseICAIL24).j1t = function () {
637
+ return this.j3r_1;
638
+ };
639
+ protoOf(CausalityCheckCauseICAIL24).d2f = function (request) {
389
640
  var intervention = request.arguments.w(0);
390
641
  var cause = request.arguments.w(1);
391
- var effect = this.i3r_1.g3r(request.arguments.w(2).toString());
642
+ var effect = this.k3r_1.g3r(request.arguments.w(2).toString());
392
643
  if (!isInterface(intervention, Var)) {
393
- throw Companion_instance_1.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
394
- }
395
- var tmp = Companion_instance;
396
- // Inline function 'kotlin.collections.map' call
397
- var this_0 = solveFresh(this.i3r_1, effect, request.context.y1t()).q3n_1;
398
- // Inline function 'kotlin.collections.mapTo' call
399
- var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
400
- var _iterator__ex2g4s = this_0.p();
401
- while (_iterator__ex2g4s.s()) {
402
- var item = _iterator__ex2g4s.t();
403
- var tmp$ret$0 = item.w3m_1;
404
- destination.m(tmp$ret$0);
644
+ throw Companion_instance_2.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
405
645
  }
406
- // Inline function 'kotlin.collections.filter' call
407
- // Inline function 'kotlin.collections.filterTo' call
408
- var destination_0 = ArrayList_init_$Create$();
409
- var _iterator__ex2g4s_0 = destination.p();
410
- while (_iterator__ex2g4s_0.s()) {
411
- var element = _iterator__ex2g4s_0.t();
412
- if (!(element === 'none')) {
413
- destination_0.m(element);
414
- }
646
+ var tmp = getInterventions(this.k3r_1, request, cause, effect);
647
+ var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda(this.k3r_1, request, effect));
648
+ var tmp0_elvis_lhs = firstOrNull(map(tmp_0, CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda_0(intervention)));
649
+ return sequenceOf(request.replyWith(tmp0_elvis_lhs == null ? Companion_getInstance().failed() : tmp0_elvis_lhs, VOID, []));
650
+ };
651
+ protoOf(CausalityCheckCauseICAIL24).solve = function (request) {
652
+ return this.d2f(request);
653
+ };
654
+ function CausalityCheckInterventionICAIL25($outer) {
655
+ this.m3r_1 = $outer;
656
+ this.l3r_1 = new Signature('ness_intervention', 2);
657
+ }
658
+ protoOf(CausalityCheckInterventionICAIL25).j1t = function () {
659
+ return this.l3r_1;
660
+ };
661
+ protoOf(CausalityCheckInterventionICAIL25).d2f = function (request) {
662
+ var intervention = request.arguments.w(0).castToList();
663
+ var effect = this.m3r_1.g3r(request.arguments.w(1).toString());
664
+ return sequenceOf(request.replyWithCondition(checkCausalityICAIL25(this.m3r_1, request, intervention, effect), VOID, []));
665
+ };
666
+ protoOf(CausalityCheckInterventionICAIL25).solve = function (request) {
667
+ return this.d2f(request);
668
+ };
669
+ function CausalityCheckCauseICAIL25($outer) {
670
+ this.o3r_1 = $outer;
671
+ this.n3r_1 = new Signature('ness', 3);
672
+ }
673
+ protoOf(CausalityCheckCauseICAIL25).j1t = function () {
674
+ return this.n3r_1;
675
+ };
676
+ protoOf(CausalityCheckCauseICAIL25).d2f = function (request) {
677
+ var intervention = request.arguments.w(0);
678
+ var cause = request.arguments.w(1);
679
+ var effect = this.o3r_1.g3r(request.arguments.w(2).toString());
680
+ if (!isInterface(intervention, Var)) {
681
+ throw Companion_instance_2.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
415
682
  }
416
- var rules = parseTerm(tmp, toString(toList_0(destination_0)));
417
- return sequenceOf(request.replyWith(arg2pScope(CausalitySolver$CausalityCheckCause$solve$lambda(request, rules, cause, this.i3r_1, effect, intervention)), VOID, []));
683
+ var tmp = getInterventions(this.o3r_1, request, cause, effect);
684
+ var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda(this.o3r_1, request, effect));
685
+ var tmp0_elvis_lhs = firstOrNull(map(tmp_0, CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda_0(intervention)));
686
+ return sequenceOf(request.replyWith(tmp0_elvis_lhs == null ? Companion_getInstance().failed() : tmp0_elvis_lhs, VOID, []));
418
687
  };
419
- protoOf(CausalityCheckCause).solve = function (request) {
688
+ protoOf(CausalityCheckCauseICAIL25).solve = function (request) {
420
689
  return this.d2f(request);
421
690
  };
422
691
  function CausalitySolver$solveFresh$lambda(this$0) {
@@ -455,14 +724,29 @@
455
724
  return toList(map(tmp_0, CausalitySolver$getSubsets$lambda$lambda_0($this$arg2pScope)));
456
725
  };
457
726
  }
727
+ function CausalitySolver$getInterventions$lambda$lambda(it) {
728
+ return it.a1v();
729
+ }
730
+ function CausalitySolver$getInterventions$lambda$lambda_0($this_arg2pScope) {
731
+ return function (it) {
732
+ return ensureNotNull(it.s1t().h2($this_arg2pScope.a1h())).castToList();
733
+ };
734
+ }
735
+ function CausalitySolver$getInterventions$lambda($request, $rules, $cause) {
736
+ return function ($this$arg2pScope) {
737
+ var tmp = $request.solve($this$arg2pScope.stringInvoke('generate_interventions', $rules, [$cause, $this$arg2pScope.a1h()]));
738
+ var tmp_0 = filter(tmp, CausalitySolver$getInterventions$lambda$lambda);
739
+ return map(tmp_0, CausalitySolver$getInterventions$lambda$lambda_0($this$arg2pScope));
740
+ };
741
+ }
458
742
  function CausalitySolver() {
459
743
  var tmp = this;
460
744
  var tmp_0 = Arg2pSolverFactory_instance;
461
745
  var tmp0_graphExtensions = emptyList();
462
746
  tmp.a3r_1 = tmp_0.h3a(VOID, (new FlagsBuilder(VOID, VOID, VOID, VOID, VOID, 'grounded', VOID, VOID, VOID, VOID, tmp0_graphExtensions)).t3a());
463
- this.b3r_1 = Companion_instance_2.d3a().a3a();
747
+ this.b3r_1 = Companion_instance_3.d3a().a3a();
464
748
  this.c3r_1 = 'prolog.argumentation.causality.solver';
465
- this.d3r_1 = Companion_instance_3.a3a().plusOperatorSet(Companion_instance_4.a3a()).plusOperatorSet(Companion_getInstance_3().DEFAULT);
749
+ this.d3r_1 = Companion_instance_4.a3a().plusOperatorSet(Companion_instance_5.a3a()).plusOperatorSet(Companion_getInstance_3().DEFAULT);
466
750
  }
467
751
  protoOf(CausalitySolver).g3r = function (string) {
468
752
  return replace(replace(string, ' ', ''), "'", '');
@@ -472,7 +756,7 @@
472
756
  };
473
757
  protoOf(CausalitySolver).v3a = function () {
474
758
  // Inline function 'kotlin.let' call
475
- var primitives = listOf([new CausalityCheckIntervention(this), new CausalityCheckCause(this)]);
759
+ var primitives = listOf([new CausalityCheckInterventionICAIL24(this), new CausalityCheckCauseICAIL24(this), new CausalityCheckInterventionICAIL25(this), new CausalityCheckCauseICAIL25(this), new CausalityCheckCauseButFor(this)]);
476
760
  var tmp = Companion_getInstance_4();
477
761
  // Inline function 'kotlin.collections.associateBy' call
478
762
  var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(primitives, 10)), 16);
@@ -484,7 +768,7 @@
484
768
  var tmp$ret$0 = element.j1t();
485
769
  destination.k4(tmp$ret$0, element);
486
770
  }
487
- return tmp.of(this.c3r_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), ground(Id)), RR),\n utils::appendLists(RR, UP).\n', this.d3r_1));
771
+ return tmp.of(this.c3r_1, destination, parseTheoryWithOperators(Companion_instance_1, '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), ground(Id)), RR),\n utils::appendLists(RR, UP).\n', this.d3r_1));
488
772
  };
489
773
  protoOf(CausalitySolver).w3a = function () {
490
774
  return 'causality';