@tuprolog/arg2p 0.17.4 → 0.18.1

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,14 +1,20 @@
1
1
  (function (factory) {
2
2
  if (typeof define === 'function' && define.amd)
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);
3
+ define(['exports', './kotlin-kotlin-stdlib.js', './arg2p-core.js', './2p-core.js', './2p-solve.js', './2p-unify.js', './2p-parser-core.js', './2p-theory.js'], factory);
4
4
  else if (typeof exports === 'object')
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'));
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./arg2p-core.js'), require('./2p-core.js'), require('./2p-solve.js'), require('./2p-unify.js'), require('./2p-parser-core.js'), require('./2p-theory.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
+ if (typeof globalThis['arg2p-core'] === 'undefined') {
11
+ 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'.");
12
+ }
7
13
  if (typeof globalThis['2p-core'] === 'undefined') {
8
14
  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'.");
9
15
  }
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'.");
16
+ if (typeof globalThis['2p-solve'] === 'undefined') {
17
+ 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'.");
12
18
  }
13
19
  if (typeof globalThis['2p-unify'] === 'undefined') {
14
20
  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'.");
@@ -19,146 +25,328 @@
19
25
  if (typeof globalThis['2p-theory'] === 'undefined') {
20
26
  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'.");
21
27
  }
22
- if (typeof globalThis['2p-parser-theory'] === 'undefined') {
23
- 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'.");
24
- }
25
- if (typeof globalThis['arg2p-core'] === 'undefined') {
26
- 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'.");
27
- }
28
- if (typeof globalThis['2p-solve'] === 'undefined') {
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
- }
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']);
28
+ globalThis['arg2p-causality-solver'] = factory(typeof globalThis['arg2p-causality-solver'] === 'undefined' ? {} : globalThis['arg2p-causality-solver'], globalThis['kotlin-kotlin-stdlib'], globalThis['arg2p-core'], globalThis['2p-core'], globalThis['2p-solve'], globalThis['2p-unify'], globalThis['2p-parser-core'], globalThis['2p-theory']);
32
29
  }
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) {
30
+ }(function (_, kotlin_kotlin, kotlin_it_unibo_tuprolog_argumentation_core, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_solve, kotlin_it_unibo_tuprolog_unify, kotlin_it_unibo_tuprolog_parser_core, kotlin_it_unibo_tuprolog_theory) {
34
31
  'use strict';
35
32
  //region block: imports
33
+ var protoOf = kotlin_kotlin.$_$.e8;
34
+ var initMetadataForObject = kotlin_kotlin.$_$.v7;
35
+ var defineProp = kotlin_kotlin.$_$.j7;
36
+ var VOID = kotlin_kotlin.$_$.b;
37
+ var PrologModule = kotlin_it_unibo_tuprolog_argumentation_core.$_$.i;
38
+ var listOf = kotlin_kotlin.$_$.f4;
39
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.x2;
40
+ var mapCapacity = kotlin_kotlin.$_$.g4;
41
+ var coerceAtLeast = kotlin_kotlin.$_$.r8;
42
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.z;
43
+ var Unit_instance = kotlin_kotlin.$_$.r;
44
+ var ParserModule_getInstance = kotlin_it_unibo_tuprolog_argumentation_core.$_$.b;
45
+ var initMetadataForClass = kotlin_kotlin.$_$.r7;
36
46
  var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.p;
37
- var ensureNotNull = kotlin_kotlin.$_$.qc;
38
- var filter = kotlin_kotlin.$_$.d9;
39
- var map = kotlin_kotlin.$_$.q9;
40
- var firstOrNull = kotlin_kotlin.$_$.e9;
47
+ var ensureNotNull = kotlin_kotlin.$_$.uc;
48
+ var filter = kotlin_kotlin.$_$.k9;
49
+ var map = kotlin_kotlin.$_$.x9;
50
+ var firstOrNull = kotlin_kotlin.$_$.l9;
51
+ var Signature = kotlin_it_unibo_tuprolog_solve.$_$.y3;
52
+ var arg2pScope = kotlin_it_unibo_tuprolog_argumentation_core.$_$.g;
53
+ var sequenceOf = kotlin_kotlin.$_$.ea;
54
+ var get_help = kotlin_it_unibo_tuprolog_solve.$_$.p3;
55
+ var Helpable = kotlin_it_unibo_tuprolog_solve.$_$.q3;
56
+ var Companion_instance_0 = kotlin_it_unibo_tuprolog_solve.$_$.e1;
57
+ var Expected_VARIABLE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.r;
58
+ var Var = kotlin_it_unibo_tuprolog_core.$_$.d3;
59
+ var isInterface = kotlin_kotlin.$_$.y7;
41
60
  var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.v;
42
- var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_unify.$_$.a;
43
- var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.w;
44
- var parseTerm = kotlin_it_unibo_tuprolog_parser_core.$_$.e;
45
- var ArrayList_init_$Create$ = kotlin_kotlin.$_$.t;
46
- var Unit_instance = kotlin_kotlin.$_$.q;
47
- var collectionSizeOrDefault = kotlin_kotlin.$_$.s2;
48
- var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.s;
49
- var plus = kotlin_kotlin.$_$.u4;
50
- var addAll = kotlin_kotlin.$_$.g2;
51
- var plus_0 = kotlin_kotlin.$_$.t4;
52
- var emptyList = kotlin_kotlin.$_$.g3;
53
- var to = kotlin_kotlin.$_$.yc;
54
- var Companion_instance_1 = kotlin_it_unibo_tuprolog_theory.$_$.b;
55
- var parseTheoryWithOperators = kotlin_it_unibo_tuprolog_parser_theory.$_$.c;
56
- var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.u;
57
- var parseStruct = kotlin_it_unibo_tuprolog_parser_core.$_$.d;
58
- var Graph = kotlin_it_unibo_tuprolog_argumentation_core.$_$.m;
59
- var asSequence = kotlin_kotlin.$_$.p2;
60
- var flatMap = kotlin_kotlin.$_$.h9;
61
- var toList = kotlin_kotlin.$_$.fa;
61
+ var joinToString = kotlin_kotlin.$_$.w3;
62
+ var to = kotlin_kotlin.$_$.dd;
63
+ var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.u;
64
+ var first = kotlin_kotlin.$_$.m9;
65
+ var Halt = kotlin_it_unibo_tuprolog_solve.$_$.z3;
66
+ var mineActiveGraph = kotlin_it_unibo_tuprolog_argumentation_core.$_$.h;
67
+ var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_unify.$_$.a;
68
+ var Companion_instance_1 = kotlin_it_unibo_tuprolog_core.$_$.w;
69
+ var parseTermWithOperators = kotlin_it_unibo_tuprolog_parser_core.$_$.c;
70
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.u;
71
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.t;
72
+ var NoSuchElementException_init_$Create$ = kotlin_kotlin.$_$.v1;
73
+ var plus = kotlin_kotlin.$_$.a5;
74
+ var addAll = kotlin_kotlin.$_$.j2;
75
+ var plus_0 = kotlin_kotlin.$_$.z4;
76
+ var emptyList = kotlin_kotlin.$_$.l3;
77
+ var asSequence = kotlin_kotlin.$_$.t2;
78
+ var flatMap = kotlin_kotlin.$_$.o9;
79
+ var Companion_instance_2 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.c;
80
+ var ArgumentLabellingMode_instance = kotlin_it_unibo_tuprolog_argumentation_core.$_$.a;
81
+ var setOf = kotlin_kotlin.$_$.e5;
82
+ var Companion_instance_3 = kotlin_it_unibo_tuprolog_theory.$_$.b;
62
83
  var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.l;
63
- var Collection = kotlin_kotlin.$_$.z1;
64
- var isInterface = kotlin_kotlin.$_$.p7;
65
- var distinct = kotlin_kotlin.$_$.e3;
66
- var arg2pScope = kotlin_it_unibo_tuprolog_argumentation_core.$_$.f;
67
- var toList_0 = kotlin_kotlin.$_$.h5;
68
- var toString = kotlin_kotlin.$_$.y7;
69
- var Default_getInstance = kotlin_kotlin.$_$.l;
70
- var nextUInt = kotlin_kotlin.$_$.e8;
71
- var UInt = kotlin_kotlin.$_$.nc;
72
- var Signature = kotlin_it_unibo_tuprolog_solve.$_$.w3;
73
- var protoOf = kotlin_kotlin.$_$.v7;
74
- var VOID = kotlin_kotlin.$_$.b;
75
- var sequenceOf = kotlin_kotlin.$_$.x9;
76
- var get_help = kotlin_it_unibo_tuprolog_solve.$_$.n3;
77
- var Helpable = kotlin_it_unibo_tuprolog_solve.$_$.o3;
78
- var initMetadataForClass = kotlin_kotlin.$_$.i7;
79
- var Companion_instance_2 = kotlin_it_unibo_tuprolog_solve.$_$.c1;
80
- var Expected_VARIABLE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.o;
81
- var Var = kotlin_it_unibo_tuprolog_core.$_$.d3;
82
- var mineActiveGraph = kotlin_it_unibo_tuprolog_argumentation_core.$_$.l;
83
- var Arg2pSolverFactory_instance = kotlin_it_unibo_tuprolog_argumentation_core.$_$.e;
84
- var FlagsBuilder = kotlin_it_unibo_tuprolog_argumentation_core.$_$.g;
85
- var Companion_instance_3 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.d;
86
- var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.x;
87
- var Companion_instance_4 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.b;
88
- var Companion_instance_5 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.c;
89
- var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.i;
90
- var replace = kotlin_kotlin.$_$.db;
91
- var listOf = kotlin_kotlin.$_$.z3;
92
- var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_solve.$_$.i1;
93
- var mapCapacity = kotlin_kotlin.$_$.a4;
94
- var coerceAtLeast = kotlin_kotlin.$_$.j8;
95
- var LinkedHashMap_init_$Create$_0 = kotlin_kotlin.$_$.w;
96
- var content = kotlin_it_unibo_tuprolog_argumentation_core.$_$.h;
97
- var ArgLibrary = kotlin_it_unibo_tuprolog_argumentation_core.$_$.i;
98
- var Loadable = kotlin_it_unibo_tuprolog_argumentation_core.$_$.j;
84
+ var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.k;
85
+ var toList = kotlin_kotlin.$_$.la;
86
+ var Collection = kotlin_kotlin.$_$.c2;
87
+ var distinct = kotlin_kotlin.$_$.j3;
88
+ var RuleAnnotations_getInstance = kotlin_it_unibo_tuprolog_argumentation_core.$_$.d;
89
+ var Arg2pSolverFactory_instance = kotlin_it_unibo_tuprolog_argumentation_core.$_$.f;
90
+ var FlagsBuilder = kotlin_it_unibo_tuprolog_argumentation_core.$_$.j;
91
+ var Companion_instance_4 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.e;
92
+ var LinkedHashMap_init_$Create$_0 = kotlin_kotlin.$_$.a1;
99
93
  //endregion
100
94
  //region block: pre-declaration
101
- initMetadataForClass(CausalityCheckCauseButFor, 'CausalityCheckCauseButFor', VOID, VOID, [Helpable]);
102
- initMetadataForClass(CausalityCheckInterventionICAIL24, 'CausalityCheckInterventionICAIL24', VOID, VOID, [Helpable]);
103
- initMetadataForClass(CausalityCheckCauseICAIL24, 'CausalityCheckCauseICAIL24', VOID, VOID, [Helpable]);
104
- initMetadataForClass(CausalityCheckInterventionICAIL25, 'CausalityCheckInterventionICAIL25', VOID, VOID, [Helpable]);
105
- initMetadataForClass(CausalityCheckCauseICAIL25, 'CausalityCheckCauseICAIL25', VOID, VOID, [Helpable]);
106
- initMetadataForClass(CausalitySolver, 'CausalitySolver', CausalitySolver, VOID, [ArgLibrary, Loadable]);
95
+ initMetadataForObject(JsCausality, 'JsCausality');
96
+ initMetadataForClass(CausalityModule, 'CausalityModule', CausalityModule, PrologModule);
97
+ initMetadataForClass(ButFor, 'ButFor', VOID, VOID, [Helpable]);
98
+ initMetadataForClass(Ness, 'Ness', VOID, VOID, [Helpable]);
99
+ initMetadataForClass(NessIntervention, 'NessIntervention', VOID, VOID, [Helpable]);
100
+ initMetadataForClass(NessOriginal, 'NessOriginal', VOID, VOID, [Helpable]);
101
+ initMetadataForClass(NessOriginalIntervention, 'NessOriginalIntervention', VOID, VOID, [Helpable]);
102
+ initMetadataForClass(CausalityAnalysis, 'CausalityAnalysis', CausalityAnalysis);
107
103
  //endregion
108
- function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda(it) {
109
- return it.e1z();
104
+ function JsCausality() {
110
105
  }
111
- function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_0($this_arg2pScope) {
112
- return function (it) {
113
- return Companion_instance.of([ensureNotNull(it.u1x().l2($this_arg2pScope.p1j()))]);
114
- };
106
+ protoOf(JsCausality).module = function () {
107
+ return new CausalityModule();
108
+ };
109
+ var JsCausality_instance;
110
+ function JsCausality_getInstance() {
111
+ return JsCausality_instance;
112
+ }
113
+ function CausalityModule() {
114
+ PrologModule.call(this, 'prolog.argumentation.causality.solver', 'causality');
115
+ this.a57_1 = new CausalityAnalysis();
116
+ this.b57_1 = '%! subsets(?List, ?Subset)\n% Subset is each subset of List, its elements in their order.\nsubsets([], []).\nsubsets([H|T], [H|NT]) :- subsets(T, NT).\nsubsets([_|T], NT) :- subsets(T, NT).\n\n%! properSubsets(+List, -Subset)\n% Subset is each subset of List other than the empty one and List itself.\nproperSubsets(L, S) :-\n subsets(L, S),\n S \\= [],\n S \\= L.\n\n%! generateInterventions(+Rules, +Cause, -Intervention)\n% Intervention is each change of the theory removing Cause: its complement, the undercut of Cause (a rule,\n% unless it is negated), or the complement with a set of the premises of the rules not among Rules (the top\n% rules of the graph of the effect).\ngenerateInterventions(_, S, [CS]) :-\n compl(S, CS).\ngenerateInterventions(_, S, [undercut(S)]) :-\n S \\= -_.\ngenerateInterventions(R, S, SUP) :-\n parser:::convertAllRules(_),\n compl(S, CS),\n unusedPremises(R, UP), !,\n subsets(UP, SUP),\n member(CS, SUP),\n SUP \\= [].\n\n%! compl(?Statement, ?Complement)\n% Complement is the complement of Statement (-X for X, X for -X).\ncompl(-X, X) :- !.\ncompl(X, -X).\n\n%! unusedPremises(+Rules, -Premises)\n% Premises are those of the rules of the theory not among Rules.\nunusedPremises(R, UP) :-\n findall(P, (parser::rule(Id, P, _), \\+ member(Id, R), ground(Id)), RR),\n utils::appendLists(RR, UP).';
117
+ }
118
+ protoOf(CausalityModule).u2i = function () {
119
+ // Inline function 'kotlin.collections.associateBy' call
120
+ var this_0 = listOf([new Ness(this.a57_1), new NessIntervention(this.a57_1), new NessOriginal(this.a57_1), new NessOriginalIntervention(this.a57_1), new ButFor(this.a57_1)]);
121
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
122
+ // Inline function 'kotlin.collections.associateByTo' call
123
+ var destination = LinkedHashMap_init_$Create$(capacity);
124
+ var _iterator__ex2g4s = this_0.n();
125
+ while (_iterator__ex2g4s.q()) {
126
+ var element = _iterator__ex2g4s.r();
127
+ var tmp$ret$2 = element.t1x();
128
+ destination.t4(tmp$ret$2, element);
129
+ }
130
+ return destination;
131
+ };
132
+ protoOf(CausalityModule).w44 = function () {
133
+ return protoOf(PrologModule).w44.call(this).plusOperatorSet(ParserModule_getInstance().i44());
134
+ };
135
+ protoOf(CausalityModule).d4k = function () {
136
+ return this.b57_1;
137
+ };
138
+ function ButFor$solve$lambda$lambda(it) {
139
+ return it.n1z();
115
140
  }
116
- function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_1(this$0, $request, $effect) {
141
+ function ButFor$solve$lambda$lambda_0(this$0, $request, $this_arg2pScope, $effect) {
117
142
  return function (it) {
118
- return checkButFor(this$0, $request, it, $effect);
143
+ return this$0.c57_1.h57($request, Companion_instance.of([ensureNotNull(it.d1y().k2($this_arg2pScope.x1j()))]), $effect);
119
144
  };
120
145
  }
121
- function CausalitySolver$CausalityCheckCauseButFor$solve$lambda($request, $cause, this$0, $effect) {
146
+ function ButFor$solve$lambda($request, $cause, this$0, $effect) {
122
147
  return function ($this$arg2pScope) {
123
- var tmp = $request.solve($this$arg2pScope.stringInvoke('compl', $cause, [$this$arg2pScope.p1j()]));
124
- var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda);
125
- var tmp_1 = map(tmp_0, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_0($this$arg2pScope));
126
- var tmp0_elvis_lhs = firstOrNull(map(tmp_1, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_1(this$0, $request, $effect)));
148
+ var tmp = $request.solve($this$arg2pScope.stringInvoke('compl', $cause, [$this$arg2pScope.x1j()]));
149
+ var tmp_0 = filter(tmp, ButFor$solve$lambda$lambda);
150
+ var tmp0_elvis_lhs = firstOrNull(map(tmp_0, ButFor$solve$lambda$lambda_0(this$0, $request, $this$arg2pScope, $effect)));
127
151
  return tmp0_elvis_lhs == null ? false : tmp0_elvis_lhs;
128
152
  };
129
153
  }
130
- function CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda(this$0, $request, $effect) {
131
- return function (it) {
132
- return checkCausalityICAIL24(this$0, $request, it, $effect);
133
- };
154
+ function ButFor(analysis) {
155
+ this.c57_1 = analysis;
156
+ this.d57_1 = new Signature('but_for', 2);
134
157
  }
135
- function CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda_0($intervention) {
136
- return function (it) {
137
- return Companion_getInstance().of($intervention, it);
138
- };
158
+ protoOf(ButFor).t1x = function () {
159
+ return this.d57_1;
160
+ };
161
+ protoOf(ButFor).o2m = function (request) {
162
+ var _destruct__k2r9zo = request.arguments;
163
+ // Inline function 'kotlin.collections.component1' call
164
+ var cause = _destruct__k2r9zo.x(0);
165
+ // Inline function 'kotlin.collections.component2' call
166
+ var effect = _destruct__k2r9zo.x(1);
167
+ var tmp;
168
+ if (this.c57_1.i57(request, cause)) {
169
+ tmp = arg2pScope(ButFor$solve$lambda(request, cause, this, effect));
170
+ } else {
171
+ tmp = false;
172
+ }
173
+ var holds = tmp;
174
+ return sequenceOf(request.replyWithCondition(holds, VOID, []));
175
+ };
176
+ protoOf(ButFor).solve = function (request) {
177
+ return this.o2m(request);
178
+ };
179
+ function Ness(analysis) {
180
+ this.j57_1 = analysis;
181
+ this.k57_1 = new Signature('ness', 3);
139
182
  }
140
- function CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda(this$0, $request, $effect) {
141
- return function (it) {
142
- return checkCausalityICAIL25(this$0, $request, it, $effect);
143
- };
183
+ protoOf(Ness).t1x = function () {
184
+ return this.k57_1;
185
+ };
186
+ protoOf(Ness).o2m = function (request) {
187
+ var _destruct__k2r9zo = request.arguments;
188
+ // Inline function 'kotlin.collections.component1' call
189
+ var intervention = _destruct__k2r9zo.x(0);
190
+ // Inline function 'kotlin.collections.component2' call
191
+ var cause = _destruct__k2r9zo.x(1);
192
+ // Inline function 'kotlin.collections.component3' call
193
+ var effect = _destruct__k2r9zo.x(2);
194
+ if (!isInterface(intervention, Var)) {
195
+ throw Companion_instance_0.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
196
+ }
197
+ var tmp;
198
+ if (this.j57_1.i57(request, cause)) {
199
+ var tmp0 = this.j57_1.l57(request, cause, effect);
200
+ var tmp$ret$3;
201
+ $l$block: {
202
+ // Inline function 'kotlin.sequences.firstOrNull' call
203
+ var _iterator__ex2g4s = tmp0.n();
204
+ while (_iterator__ex2g4s.q()) {
205
+ var element = _iterator__ex2g4s.r();
206
+ if (this.j57_1.m57(request, element, effect)) {
207
+ tmp$ret$3 = element;
208
+ break $l$block;
209
+ }
210
+ }
211
+ tmp$ret$3 = null;
212
+ }
213
+ tmp = tmp$ret$3;
214
+ } else {
215
+ tmp = null;
216
+ }
217
+ var found = tmp;
218
+ var tmp_0;
219
+ if (found == null) {
220
+ tmp_0 = null;
221
+ } else {
222
+ // Inline function 'kotlin.let' call
223
+ tmp_0 = Companion_getInstance().of(intervention, found);
224
+ }
225
+ var tmp1_elvis_lhs = tmp_0;
226
+ return sequenceOf(request.replyWith(tmp1_elvis_lhs == null ? Companion_getInstance().failed() : tmp1_elvis_lhs, VOID, []));
227
+ };
228
+ protoOf(Ness).solve = function (request) {
229
+ return this.o2m(request);
230
+ };
231
+ function NessIntervention(analysis) {
232
+ this.n57_1 = analysis;
233
+ this.o57_1 = new Signature('ness_intervention', 2);
144
234
  }
145
- function CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda_0($intervention) {
146
- return function (it) {
147
- return Companion_getInstance().of($intervention, it);
148
- };
235
+ protoOf(NessIntervention).t1x = function () {
236
+ return this.o57_1;
237
+ };
238
+ protoOf(NessIntervention).o2m = function (request) {
239
+ var _destruct__k2r9zo = request.arguments;
240
+ // Inline function 'kotlin.collections.component1' call
241
+ var intervention = _destruct__k2r9zo.x(0);
242
+ // Inline function 'kotlin.collections.component2' call
243
+ var effect = _destruct__k2r9zo.x(1);
244
+ return sequenceOf(request.replyWithCondition(this.n57_1.m57(request, intervention.castToList(), effect), VOID, []));
245
+ };
246
+ protoOf(NessIntervention).solve = function (request) {
247
+ return this.o2m(request);
248
+ };
249
+ function NessOriginal(analysis) {
250
+ this.p57_1 = analysis;
251
+ this.q57_1 = new Signature('ness_original', 3);
252
+ }
253
+ protoOf(NessOriginal).t1x = function () {
254
+ return this.q57_1;
255
+ };
256
+ protoOf(NessOriginal).o2m = function (request) {
257
+ var _destruct__k2r9zo = request.arguments;
258
+ // Inline function 'kotlin.collections.component1' call
259
+ var intervention = _destruct__k2r9zo.x(0);
260
+ // Inline function 'kotlin.collections.component2' call
261
+ var cause = _destruct__k2r9zo.x(1);
262
+ // Inline function 'kotlin.collections.component3' call
263
+ var effect = _destruct__k2r9zo.x(2);
264
+ if (!isInterface(intervention, Var)) {
265
+ throw Companion_instance_0.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
266
+ }
267
+ var tmp0 = this.p57_1.l57(request, cause, effect);
268
+ var tmp$ret$3;
269
+ $l$block: {
270
+ // Inline function 'kotlin.sequences.firstOrNull' call
271
+ var _iterator__ex2g4s = tmp0.n();
272
+ while (_iterator__ex2g4s.q()) {
273
+ var element = _iterator__ex2g4s.r();
274
+ if (this.p57_1.r57(request, element, effect)) {
275
+ tmp$ret$3 = element;
276
+ break $l$block;
277
+ }
278
+ }
279
+ tmp$ret$3 = null;
280
+ }
281
+ var found = tmp$ret$3;
282
+ var tmp;
283
+ if (found == null) {
284
+ tmp = null;
285
+ } else {
286
+ // Inline function 'kotlin.let' call
287
+ tmp = Companion_getInstance().of(intervention, found);
288
+ }
289
+ var tmp1_elvis_lhs = tmp;
290
+ return sequenceOf(request.replyWith(tmp1_elvis_lhs == null ? Companion_getInstance().failed() : tmp1_elvis_lhs, VOID, []));
291
+ };
292
+ protoOf(NessOriginal).solve = function (request) {
293
+ return this.o2m(request);
294
+ };
295
+ function NessOriginalIntervention(analysis) {
296
+ this.s57_1 = analysis;
297
+ this.t57_1 = new Signature('ness_original_intervention', 2);
298
+ }
299
+ protoOf(NessOriginalIntervention).t1x = function () {
300
+ return this.t57_1;
301
+ };
302
+ protoOf(NessOriginalIntervention).o2m = function (request) {
303
+ var _destruct__k2r9zo = request.arguments;
304
+ // Inline function 'kotlin.collections.component1' call
305
+ var intervention = _destruct__k2r9zo.x(0);
306
+ // Inline function 'kotlin.collections.component2' call
307
+ var effect = _destruct__k2r9zo.x(1);
308
+ return sequenceOf(request.replyWithCondition(this.s57_1.r57(request, intervention.castToList(), effect), VOID, []));
309
+ };
310
+ protoOf(NessOriginalIntervention).solve = function (request) {
311
+ return this.o2m(request);
312
+ };
313
+ function graphOf($this, theory, query) {
314
+ var tmp = theory.toStringAsProlog(true);
315
+ var text = tmp + joinToString(theory, ',', VOID, VOID, VOID, VOID, CausalityAnalysis$graphOf$lambda);
316
+ var key = to(text, query.toString());
317
+ var tmp0_safe_receiver = $this.g57_1.k2(key);
318
+ if (tmp0_safe_receiver == null)
319
+ null;
320
+ else {
321
+ // Inline function 'kotlin.let' call
322
+ return tmp0_safe_receiver;
323
+ }
324
+ if ($this.g57_1.s() >= 256) {
325
+ $this.g57_1.n3();
326
+ }
327
+ $this.e57_1.resetStaticKb();
328
+ $this.e57_1.loadStaticKb(theory);
329
+ var solution = first($this.e57_1.solve(Companion_getInstance_0().of('answerQuery', [query])));
330
+ if (isInterface(solution, Halt))
331
+ throw solution.z1z();
332
+ // Inline function 'kotlin.also' call
333
+ var this_0 = mineActiveGraph($this.e57_1);
334
+ // Inline function 'kotlin.collections.set' call
335
+ $this.g57_1.t4(key, this_0);
336
+ return this_0;
149
337
  }
150
- function equalTerms($this, a, b) {
151
- return Companion_getInstance_0().s1n().match(parseTerm(Companion_instance_0, a), parseTerm(Companion_instance_0, b));
338
+ function concludes($this, argument, statement) {
339
+ return Companion_getInstance_1().b1o().match(parseTermWithOperators(Companion_instance_1, argument.r4h_1, $this.f57_1), statement);
152
340
  }
153
- function attackers($this, x, graph) {
341
+ function attackers($this, argument, graph) {
154
342
  // Inline function 'kotlin.collections.filter' call
155
- var tmp0 = graph.e4s_1;
343
+ var tmp0 = graph.m4h_1;
156
344
  // Inline function 'kotlin.collections.filterTo' call
157
345
  var destination = ArrayList_init_$Create$();
158
346
  var _iterator__ex2g4s = tmp0.n();
159
347
  while (_iterator__ex2g4s.q()) {
160
348
  var element = _iterator__ex2g4s.r();
161
- if (element.y4r_1.n4r_1 === x.n4r_1) {
349
+ if (element.d4i_1.x4h_1 === argument.x4h_1) {
162
350
  destination.l(element);
163
351
  }
164
352
  }
@@ -168,59 +356,57 @@
168
356
  var _iterator__ex2g4s_0 = destination.n();
169
357
  while (_iterator__ex2g4s_0.q()) {
170
358
  var item = _iterator__ex2g4s_0.r();
171
- // Inline function 'kotlin.collections.find' call
172
- var tmp0_0 = graph.g4s_1;
173
- var tmp$ret$7;
359
+ var tmp0_0 = graph.o4h_1;
360
+ var tmp$ret$6;
174
361
  $l$block: {
175
- // Inline function 'kotlin.collections.firstOrNull' call
362
+ // Inline function 'kotlin.collections.first' call
176
363
  var _iterator__ex2g4s_1 = tmp0_0.n();
177
364
  while (_iterator__ex2g4s_1.q()) {
178
365
  var element_0 = _iterator__ex2g4s_1.r();
179
- if (item.x4r_1.n4r_1 === element_0.b4s_1.n4r_1) {
180
- tmp$ret$7 = element_0;
366
+ if (item.c4i_1.x4h_1 === element_0.z4h_1.x4h_1) {
367
+ tmp$ret$6 = element_0;
181
368
  break $l$block;
182
369
  }
183
370
  }
184
- tmp$ret$7 = null;
371
+ throw NoSuchElementException_init_$Create$('Collection contains no element matching the predicate.');
185
372
  }
186
- var tmp$ret$6 = tmp$ret$7;
187
- var tmp$ret$5 = ensureNotNull(tmp$ret$6);
373
+ var tmp$ret$5 = tmp$ret$6;
188
374
  destination_0.l(tmp$ret$5);
189
375
  }
190
376
  return destination_0;
191
377
  }
192
- function supporters($this, x, graph, chain) {
378
+ function supporters($this, argument, graph, chain) {
193
379
  var tmp;
194
- if (chain.s(x.n4r_1)) {
380
+ if (chain.z(argument.x4h_1)) {
195
381
  tmp = emptyList();
196
382
  } else {
197
383
  // Inline function 'kotlin.collections.filter' call
198
- var tmp0 = graph.g4s_1;
384
+ var tmp0 = graph.o4h_1;
199
385
  // Inline function 'kotlin.collections.filterTo' call
200
386
  var destination = ArrayList_init_$Create$();
201
387
  var _iterator__ex2g4s = tmp0.n();
202
388
  while (_iterator__ex2g4s.q()) {
203
389
  var element = _iterator__ex2g4s.r();
204
- if (x.n4r_1 === element.b4s_1.n4r_1 && element.c4s_1 === 'in') {
390
+ if (argument.x4h_1 === element.z4h_1.x4h_1 && element.a4i_1 === 'in') {
205
391
  destination.l(element);
206
392
  }
207
393
  }
208
394
  var tmp_0 = destination;
209
395
  // Inline function 'kotlin.collections.flatMap' call
210
- var tmp0_0 = attackers($this, x, graph);
396
+ var tmp0_0 = attackers($this, argument, graph);
211
397
  // Inline function 'kotlin.collections.flatMapTo' call
212
398
  var destination_0 = ArrayList_init_$Create$();
213
399
  var _iterator__ex2g4s_0 = tmp0_0.n();
214
400
  while (_iterator__ex2g4s_0.q()) {
215
401
  var element_0 = _iterator__ex2g4s_0.r();
216
402
  // Inline function 'kotlin.collections.filter' call
217
- var tmp0_1 = attackers($this, element_0.b4s_1, graph);
403
+ var tmp0_1 = attackers($this, element_0.z4h_1, graph);
218
404
  // Inline function 'kotlin.collections.filterTo' call
219
405
  var destination_1 = ArrayList_init_$Create$();
220
406
  var _iterator__ex2g4s_1 = tmp0_1.n();
221
407
  while (_iterator__ex2g4s_1.q()) {
222
408
  var element_1 = _iterator__ex2g4s_1.r();
223
- if (!(element_1.b4s_1.n4r_1 === x.n4r_1)) {
409
+ if (!(element_1.z4h_1.x4h_1 === argument.x4h_1)) {
224
410
  destination_1.l(element_1);
225
411
  }
226
412
  }
@@ -230,7 +416,7 @@
230
416
  var _iterator__ex2g4s_2 = destination_1.n();
231
417
  while (_iterator__ex2g4s_2.q()) {
232
418
  var element_2 = _iterator__ex2g4s_2.r();
233
- var list = supporters($this, element_2.b4s_1, graph, plus(chain, x.n4r_1));
419
+ var list = supporters($this, element_2.z4h_1, graph, plus(chain, argument.x4h_1));
234
420
  addAll(destination_2, list);
235
421
  }
236
422
  var list_0 = destination_2;
@@ -240,43 +426,41 @@
240
426
  }
241
427
  return tmp;
242
428
  }
243
- function solveFresh($this, effect, kb) {
244
- var theory = kb.toStringAsProlog(true);
245
- var tmp0_safe_receiver = $this.p4v_1.l2(to(theory, effect));
246
- if (tmp0_safe_receiver == null)
247
- null;
248
- else {
249
- // Inline function 'kotlin.let' call
250
- return tmp0_safe_receiver;
429
+ function supports($this, graph, effect) {
430
+ var tmp = asSequence(graph.o4h_1);
431
+ var tmp_0 = filter(tmp, CausalityAnalysis$supports$lambda($this, effect));
432
+ var tmp_1 = flatMap(tmp_0, CausalityAnalysis$supports$lambda_0($this, graph));
433
+ return map(tmp_1, CausalityAnalysis$supports$lambda_1);
434
+ }
435
+ function theory($this, request) {
436
+ var theory = request.context.j1y();
437
+ var tmp0_elvis_lhs = Companion_instance_2.u4x(request.context);
438
+ var tmp;
439
+ if (tmp0_elvis_lhs == null) {
440
+ return theory;
441
+ } else {
442
+ tmp = tmp0_elvis_lhs;
251
443
  }
252
- if ($this.p4v_1.t() >= 256) {
253
- $this.p4v_1.n3();
444
+ var settings = tmp;
445
+ var except = setOf(ArgumentLabellingMode_instance.d4h());
446
+ var tmp_0 = Companion_instance_3;
447
+ var tmp_1 = theory.i1o();
448
+ // Inline function 'kotlin.collections.filterNot' call
449
+ var tmp0 = theory.s1o();
450
+ // Inline function 'kotlin.collections.filterNotTo' call
451
+ var destination = ArrayList_init_$Create$();
452
+ var _iterator__ex2g4s = tmp0.n();
453
+ while (_iterator__ex2g4s.q()) {
454
+ var element = _iterator__ex2g4s.r();
455
+ if (!settings.u56(element)) {
456
+ destination.l(element);
457
+ }
254
458
  }
255
- $this.n4v_1.resetStaticKb();
256
- $this.n4v_1.loadStaticKb(parseTheoryWithOperators(Companion_instance_1, theory, $this.o4v_1));
257
- var tmp = $this.n4v_1.solve(parseStruct(Companion_getInstance_1(), 'answerQuery(' + effect + ')'));
258
- var tmp1_elvis_lhs = firstOrNull(map(tmp, CausalitySolver$solveFresh$lambda($this)));
259
- // Inline function 'kotlin.also' call
260
- var this_0 = tmp1_elvis_lhs == null ? new Graph(emptyList(), emptyList(), emptyList()) : tmp1_elvis_lhs;
261
- var tmp0 = $this.p4v_1;
262
- // Inline function 'kotlin.collections.set' call
263
- var key = to(theory, effect);
264
- tmp0.t4(key, this_0);
265
- return this_0;
266
- }
267
- function getSupports($this, graph, effect) {
268
- var tmp = asSequence(graph.g4s_1);
269
- var tmp_0 = filter(tmp, CausalitySolver$getSupports$lambda($this, effect));
270
- var tmp_1 = flatMap(tmp_0, CausalitySolver$getSupports$lambda_0($this, graph));
271
- return map(tmp_1, CausalitySolver$getSupports$lambda_1);
459
+ return tmp_0.ofIterable(tmp_1, plus_0(destination, settings.t56(request.context, except)));
272
460
  }
273
- function checkBaseTheory($this, request, effect) {
274
- // Inline function 'kotlin.let' call
275
- var it = solveFresh($this, effect, request.context.a1y());
276
- var tmp = getSupports($this, it, effect);
277
- return toList(map(tmp, CausalitySolver$checkBaseTheory$lambda));
278
- }
279
- function checkIntervention($this, request, intervention, support, effect) {
461
+ function intervened($this, request, intervention) {
462
+ var tmp = theory($this, request);
463
+ var tmp_0 = Companion_instance_3;
280
464
  // Inline function 'kotlin.collections.map' call
281
465
  var this_0 = intervention.toList();
282
466
  // Inline function 'kotlin.collections.mapTo' call
@@ -284,100 +468,194 @@
284
468
  var _iterator__ex2g4s = this_0.n();
285
469
  while (_iterator__ex2g4s.q()) {
286
470
  var item = _iterator__ex2g4s.r();
287
- var tmp$ret$2 = Companion_getInstance_2().of(parseStruct(Companion_getInstance_1(), ':->(fk' + (item.hashCode() & 2147483647) + ', ' + item.toString() + ')'), []);
471
+ var tmp$ret$2 = Companion_getInstance_2().of(Companion_getInstance_0().of(':->', [Companion_getInstance_3().of('fk' + (item.hashCode() & 2147483647)), item]), []);
288
472
  destination.l(tmp$ret$2);
289
473
  }
474
+ return tmp.plusTheory(tmp_0.ofIterableWithDefaultUnificator(destination));
475
+ }
476
+ function baseSupports($this, request, effect) {
477
+ var tmp = supports($this, graphOf($this, theory($this, request), effect), effect);
478
+ return toList(map(tmp, CausalityAnalysis$baseSupports$lambda));
479
+ }
480
+ function interventionAttackers($this, request, intervention, supports, effect) {
290
481
  // Inline function 'kotlin.let' call
291
- // Inline function 'kotlin.let' call
292
- var naf = solveFresh($this, effect, request.context.a1y().plusTheory(Companion_instance_1.ofIterableWithDefaultUnificator(destination)));
482
+ var graph = graphOf($this, intervened($this, request, intervention), effect);
293
483
  // Inline function 'kotlin.collections.filter' call
294
- var tmp0 = naf.g4s_1;
484
+ var tmp0 = graph.o4h_1;
295
485
  // Inline function 'kotlin.collections.filterTo' call
296
- var destination_0 = ArrayList_init_$Create$();
297
- var _iterator__ex2g4s_0 = tmp0.n();
298
- while (_iterator__ex2g4s_0.q()) {
299
- var element = _iterator__ex2g4s_0.r();
300
- if (element.c4s_1 === 'out' || element.c4s_1 === 'und') {
301
- destination_0.l(element);
486
+ var destination = ArrayList_init_$Create$();
487
+ var _iterator__ex2g4s = tmp0.n();
488
+ while (_iterator__ex2g4s.q()) {
489
+ var element = _iterator__ex2g4s.r();
490
+ if (element.a4i_1 === 'out' || element.a4i_1 === 'und') {
491
+ destination.l(element);
302
492
  }
303
493
  }
304
494
  // Inline function 'kotlin.collections.filter' call
305
495
  // Inline function 'kotlin.collections.filterTo' call
306
- var destination_1 = ArrayList_init_$Create$();
307
- var _iterator__ex2g4s_1 = destination_0.n();
308
- while (_iterator__ex2g4s_1.q()) {
309
- var element_0 = _iterator__ex2g4s_1.r();
310
- var tmp$ret$13;
496
+ var destination_0 = ArrayList_init_$Create$();
497
+ var _iterator__ex2g4s_0 = destination.n();
498
+ while (_iterator__ex2g4s_0.q()) {
499
+ var element_0 = _iterator__ex2g4s_0.r();
500
+ var tmp$ret$8;
311
501
  $l$block_0: {
312
502
  // Inline function 'kotlin.collections.any' call
313
503
  var tmp;
314
- if (isInterface(support, Collection)) {
315
- tmp = support.i();
504
+ if (isInterface(supports, Collection)) {
505
+ tmp = supports.i();
316
506
  } else {
317
507
  tmp = false;
318
508
  }
319
509
  if (tmp) {
320
- tmp$ret$13 = false;
510
+ tmp$ret$8 = false;
321
511
  break $l$block_0;
322
512
  }
323
- var _iterator__ex2g4s_2 = support.n();
324
- while (_iterator__ex2g4s_2.q()) {
325
- var element_1 = _iterator__ex2g4s_2.r();
326
- if (Companion_getInstance_0().s1n().match(element_0.b4s_1.p4r(), element_1)) {
327
- tmp$ret$13 = true;
513
+ var _iterator__ex2g4s_1 = supports.n();
514
+ while (_iterator__ex2g4s_1.q()) {
515
+ var element_1 = _iterator__ex2g4s_1.r();
516
+ if (Companion_getInstance_1().b1o().match(element_0.z4h_1.h4j(), element_1)) {
517
+ tmp$ret$8 = true;
328
518
  break $l$block_0;
329
519
  }
330
520
  }
331
- tmp$ret$13 = false;
521
+ tmp$ret$8 = false;
332
522
  }
333
- if (tmp$ret$13) {
334
- destination_1.l(element_0);
523
+ if (tmp$ret$8) {
524
+ destination_0.l(element_0);
335
525
  }
336
526
  }
337
527
  // Inline function 'kotlin.collections.flatMap' call
338
528
  // Inline function 'kotlin.collections.flatMapTo' call
339
- var destination_2 = ArrayList_init_$Create$();
340
- var _iterator__ex2g4s_3 = destination_1.n();
341
- while (_iterator__ex2g4s_3.q()) {
342
- var element_2 = _iterator__ex2g4s_3.r();
529
+ var destination_1 = ArrayList_init_$Create$();
530
+ var _iterator__ex2g4s_2 = destination_0.n();
531
+ while (_iterator__ex2g4s_2.q()) {
532
+ var element_2 = _iterator__ex2g4s_2.r();
343
533
  // Inline function 'kotlin.collections.filter' call
344
- var tmp0_0 = attackers($this, element_2.b4s_1, naf);
534
+ var tmp0_0 = attackers($this, element_2.z4h_1, graph);
345
535
  // Inline function 'kotlin.collections.filterTo' call
346
- var destination_3 = ArrayList_init_$Create$();
347
- var _iterator__ex2g4s_4 = tmp0_0.n();
348
- while (_iterator__ex2g4s_4.q()) {
349
- var element_3 = _iterator__ex2g4s_4.r();
350
- if (element_3.c4s_1 === 'in') {
351
- destination_3.l(element_3);
536
+ var destination_2 = ArrayList_init_$Create$();
537
+ var _iterator__ex2g4s_3 = tmp0_0.n();
538
+ while (_iterator__ex2g4s_3.q()) {
539
+ var element_3 = _iterator__ex2g4s_3.r();
540
+ if (element_3.a4i_1 === 'in') {
541
+ destination_2.l(element_3);
352
542
  }
353
543
  }
354
- var list = destination_3;
355
- addAll(destination_2, list);
544
+ var list = destination_2;
545
+ addAll(destination_1, list);
356
546
  }
357
547
  // Inline function 'kotlin.collections.map' call
358
548
  // Inline function 'kotlin.collections.mapTo' call
359
- var destination_4 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_2, 10));
360
- var _iterator__ex2g4s_5 = destination_2.n();
361
- while (_iterator__ex2g4s_5.q()) {
362
- var item_0 = _iterator__ex2g4s_5.r();
363
- var tmp$ret$23 = item_0.b4s_1;
364
- destination_4.l(tmp$ret$23);
549
+ var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_1, 10));
550
+ var _iterator__ex2g4s_4 = destination_1.n();
551
+ while (_iterator__ex2g4s_4.q()) {
552
+ var item = _iterator__ex2g4s_4.r();
553
+ var tmp$ret$18 = item.z4h_1;
554
+ destination_3.l(tmp$ret$18);
365
555
  }
366
- return distinct(destination_4);
556
+ return distinct(destination_3);
557
+ }
558
+ function properSubsets($this, request, intervention) {
559
+ return arg2pScope(CausalityAnalysis$properSubsets$lambda(request, intervention));
560
+ }
561
+ function CausalityAnalysis$graphOf$lambda(it) {
562
+ // Inline function 'kotlin.text.orEmpty' call
563
+ var tmp0_elvis_lhs = RuleAnnotations_getInstance().k4z(it);
564
+ return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
565
+ }
566
+ function CausalityAnalysis$supports$lambda(this$0, $effect) {
567
+ return function (it) {
568
+ return concludes(this$0, it.z4h_1, $effect);
569
+ };
570
+ }
571
+ function CausalityAnalysis$supports$lambda_0(this$0, $graph) {
572
+ return function (it) {
573
+ return supporters(this$0, it.z4h_1, $graph, emptyList());
574
+ };
575
+ }
576
+ function CausalityAnalysis$supports$lambda_1(it) {
577
+ return it.z4h_1;
578
+ }
579
+ function CausalityAnalysis$baseSupports$lambda(it) {
580
+ return it.h4j();
581
+ }
582
+ function CausalityAnalysis$properSubsets$lambda$lambda(it) {
583
+ return it.n1z();
584
+ }
585
+ function CausalityAnalysis$properSubsets$lambda$lambda_0($this_arg2pScope) {
586
+ return function (it) {
587
+ return ensureNotNull(it.d1y().k2($this_arg2pScope.x1j())).castToList();
588
+ };
589
+ }
590
+ function CausalityAnalysis$properSubsets$lambda($request, $intervention) {
591
+ return function ($this$arg2pScope) {
592
+ var tmp = $request.solve($this$arg2pScope.stringInvoke('properSubsets', $intervention, [$this$arg2pScope.x1j()]));
593
+ var tmp_0 = filter(tmp, CausalityAnalysis$properSubsets$lambda$lambda);
594
+ return toList(map(tmp_0, CausalityAnalysis$properSubsets$lambda$lambda_0($this$arg2pScope)));
595
+ };
596
+ }
597
+ function CausalityAnalysis$interventions$lambda$lambda(it) {
598
+ return it.n1z();
599
+ }
600
+ function CausalityAnalysis$interventions$lambda$lambda_0($this_arg2pScope) {
601
+ return function (it) {
602
+ return ensureNotNull(it.d1y().k2($this_arg2pScope.x1j())).castToList();
603
+ };
367
604
  }
368
- function getSubsets($this, request, intervention) {
369
- return arg2pScope(CausalitySolver$getSubsets$lambda(request, intervention));
605
+ function CausalityAnalysis$interventions$lambda($request, $rules, $cause) {
606
+ return function ($this$arg2pScope) {
607
+ var tmp = $request.solve($this$arg2pScope.stringInvoke('generateInterventions', $rules, [$cause, $this$arg2pScope.x1j()]));
608
+ var tmp_0 = filter(tmp, CausalityAnalysis$interventions$lambda$lambda);
609
+ return map(tmp_0, CausalityAnalysis$interventions$lambda$lambda_0($this$arg2pScope));
610
+ };
370
611
  }
371
- function getInterventions($this, request, cause, effect) {
372
- var tmp = Companion_instance_0;
612
+ function CausalityAnalysis() {
613
+ var tmp = this;
614
+ var tmp_0 = Arg2pSolverFactory_instance;
615
+ var tmp0_graphExtensions = emptyList();
616
+ tmp.e57_1 = tmp_0.z44(VOID, (new FlagsBuilder(VOID, VOID, VOID, VOID, VOID, 'grounded', VOID, VOID, VOID, VOID, tmp0_graphExtensions)).n45());
617
+ this.f57_1 = Companion_instance_4.u44().i44();
618
+ var tmp_1 = this;
619
+ // Inline function 'kotlin.collections.mutableMapOf' call
620
+ tmp_1.g57_1 = LinkedHashMap_init_$Create$_0();
621
+ }
622
+ protoOf(CausalityAnalysis).i57 = function (request, statement) {
623
+ var tmp0 = graphOf(this, theory(this, request), statement).o4h_1;
624
+ var tmp$ret$0;
625
+ $l$block_0: {
626
+ // Inline function 'kotlin.collections.any' call
627
+ var tmp;
628
+ if (isInterface(tmp0, Collection)) {
629
+ tmp = tmp0.i();
630
+ } else {
631
+ tmp = false;
632
+ }
633
+ if (tmp) {
634
+ tmp$ret$0 = false;
635
+ break $l$block_0;
636
+ }
637
+ var _iterator__ex2g4s = tmp0.n();
638
+ while (_iterator__ex2g4s.q()) {
639
+ var element = _iterator__ex2g4s.r();
640
+ if (element.a4i_1 === 'in' && concludes(this, element.z4h_1, statement)) {
641
+ tmp$ret$0 = true;
642
+ break $l$block_0;
643
+ }
644
+ }
645
+ tmp$ret$0 = false;
646
+ }
647
+ return tmp$ret$0;
648
+ };
649
+ protoOf(CausalityAnalysis).l57 = function (request, cause, effect) {
650
+ var tmp = Companion_instance;
373
651
  // Inline function 'kotlin.collections.map' call
374
- var this_0 = solveFresh($this, effect, request.context.a1y()).d4s_1;
652
+ var this_0 = graphOf(this, theory(this, request), effect).l4h_1;
375
653
  // Inline function 'kotlin.collections.mapTo' call
376
654
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
377
655
  var _iterator__ex2g4s = this_0.n();
378
656
  while (_iterator__ex2g4s.q()) {
379
657
  var item = _iterator__ex2g4s.r();
380
- var tmp$ret$2 = item.g4r_1;
658
+ var tmp$ret$2 = item.q4h_1;
381
659
  destination.l(tmp$ret$2);
382
660
  }
383
661
  // Inline function 'kotlin.collections.filter' call
@@ -390,22 +668,31 @@
390
668
  destination_0.l(element);
391
669
  }
392
670
  }
393
- var rules = parseTerm(tmp, toString(toList_0(destination_0)));
394
- return arg2pScope(CausalitySolver$getInterventions$lambda(request, rules, cause));
395
- }
396
- function checkCausalityICAIL24($this, request, intervention, effect) {
397
- var supports = checkBaseTheory($this, request, effect);
671
+ // Inline function 'kotlin.collections.map' call
672
+ // Inline function 'kotlin.collections.mapTo' call
673
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_0, 10));
674
+ var _iterator__ex2g4s_1 = destination_0.n();
675
+ while (_iterator__ex2g4s_1.q()) {
676
+ var item_0 = _iterator__ex2g4s_1.r();
677
+ var tmp$ret$8 = parseTermWithOperators(Companion_instance_1, item_0, this.f57_1);
678
+ destination_1.l(tmp$ret$8);
679
+ }
680
+ var rules = tmp.ofList(destination_1);
681
+ return arg2pScope(CausalityAnalysis$interventions$lambda(request, rules, cause));
682
+ };
683
+ protoOf(CausalityAnalysis).r57 = function (request, intervention, effect) {
684
+ var supports = baseSupports(this, request, effect);
398
685
  if (supports.i())
399
686
  return false;
400
- var attackers = checkIntervention($this, request, intervention, supports, effect);
687
+ var attackers = interventionAttackers(this, request, intervention, supports, effect);
401
688
  var tmp;
402
689
  // Inline function 'kotlin.collections.isNotEmpty' call
403
690
  if (!attackers.i()) {
404
691
  var tmp_0;
405
- if (intervention.wz() <= 1) {
692
+ if (intervention.d10() <= 1) {
406
693
  tmp_0 = true;
407
694
  } else {
408
- var tmp0 = getSubsets($this, request, intervention);
695
+ var tmp0 = properSubsets(this, request, intervention);
409
696
  var tmp$ret$1;
410
697
  $l$block_0: {
411
698
  // Inline function 'kotlin.collections.none' call
@@ -423,7 +710,7 @@
423
710
  while (_iterator__ex2g4s.q()) {
424
711
  var element = _iterator__ex2g4s.r();
425
712
  // Inline function 'kotlin.collections.isNotEmpty' call
426
- if (!checkIntervention($this, request, element, supports, effect).i()) {
713
+ if (!interventionAttackers(this, request, element, supports, effect).i()) {
427
714
  tmp$ret$1 = false;
428
715
  break $l$block_0;
429
716
  }
@@ -437,19 +724,19 @@
437
724
  tmp = false;
438
725
  }
439
726
  return tmp;
440
- }
441
- function checkCausalityICAIL25($this, request, intervention, effect) {
442
- var supports = checkBaseTheory($this, request, effect);
727
+ };
728
+ protoOf(CausalityAnalysis).m57 = function (request, intervention, effect) {
729
+ var supports = baseSupports(this, request, effect);
443
730
  if (supports.i())
444
731
  return false;
445
732
  // Inline function 'kotlin.collections.map' call
446
- var this_0 = checkIntervention($this, request, intervention, supports, effect);
733
+ var this_0 = interventionAttackers(this, request, intervention, supports, effect);
447
734
  // Inline function 'kotlin.collections.mapTo' call
448
735
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
449
736
  var _iterator__ex2g4s = this_0.n();
450
737
  while (_iterator__ex2g4s.q()) {
451
738
  var item = _iterator__ex2g4s.r();
452
- var tmp$ret$2 = item.p4r();
739
+ var tmp$ret$2 = item.h4j();
453
740
  destination.l(tmp$ret$2);
454
741
  }
455
742
  var attackers = destination;
@@ -457,10 +744,10 @@
457
744
  // Inline function 'kotlin.collections.isNotEmpty' call
458
745
  if (!attackers.i()) {
459
746
  var tmp_0;
460
- if (intervention.wz() <= 1) {
747
+ if (intervention.d10() <= 1) {
461
748
  tmp_0 = true;
462
749
  } else {
463
- var tmp0 = getSubsets($this, request, intervention);
750
+ var tmp0 = properSubsets(this, request, intervention);
464
751
  var tmp$ret$4;
465
752
  $l$block_4: {
466
753
  // Inline function 'kotlin.collections.none' call
@@ -478,16 +765,16 @@
478
765
  while (_iterator__ex2g4s_0.q()) {
479
766
  var element = _iterator__ex2g4s_0.r();
480
767
  // Inline function 'kotlin.collections.map' call
481
- var this_1 = checkIntervention($this, request, element, supports, effect);
768
+ var this_1 = interventionAttackers(this, request, element, supports, effect);
482
769
  // Inline function 'kotlin.collections.mapTo' call
483
770
  var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
484
771
  var _iterator__ex2g4s_1 = this_1.n();
485
772
  while (_iterator__ex2g4s_1.q()) {
486
773
  var item_0 = _iterator__ex2g4s_1.r();
487
- var tmp$ret$8 = item_0.p4r();
774
+ var tmp$ret$8 = item_0.h4j();
488
775
  destination_0.l(tmp$ret$8);
489
776
  }
490
- var n = destination_0;
777
+ var others = destination_0;
491
778
  var tmp$ret$9;
492
779
  $l$block_3: {
493
780
  // Inline function 'kotlin.collections.all' call
@@ -508,8 +795,8 @@
508
795
  $l$block_2: {
509
796
  // Inline function 'kotlin.collections.any' call
510
797
  var tmp_3;
511
- if (isInterface(n, Collection)) {
512
- tmp_3 = n.i();
798
+ if (isInterface(others, Collection)) {
799
+ tmp_3 = others.i();
513
800
  } else {
514
801
  tmp_3 = false;
515
802
  }
@@ -517,10 +804,10 @@
517
804
  tmp$ret$11 = false;
518
805
  break $l$block_2;
519
806
  }
520
- var _iterator__ex2g4s_3 = n.n();
807
+ var _iterator__ex2g4s_3 = others.n();
521
808
  while (_iterator__ex2g4s_3.q()) {
522
809
  var element_1 = _iterator__ex2g4s_3.r();
523
- if (Companion_getInstance_0().s1n().match(element_0, element_1)) {
810
+ if (Companion_getInstance_1().b1o().match(element_0, element_1)) {
524
811
  tmp$ret$11 = true;
525
812
  break $l$block_2;
526
813
  }
@@ -548,268 +835,64 @@
548
835
  tmp = false;
549
836
  }
550
837
  return tmp;
551
- }
552
- function checkButFor($this, request, intervention, effect) {
838
+ };
839
+ protoOf(CausalityAnalysis).h57 = function (request, intervention, effect) {
553
840
  var tmp;
554
- // Inline function 'kotlin.let' call
555
- var tmp0 = solveFresh($this, effect, request.context.a1y()).g4s_1;
556
- var tmp$ret$2;
557
- $l$block_0: {
558
- // Inline function 'kotlin.collections.any' call
559
- var tmp_0;
560
- if (isInterface(tmp0, Collection)) {
561
- tmp_0 = tmp0.i();
562
- } else {
563
- tmp_0 = false;
564
- }
565
- if (tmp_0) {
566
- tmp$ret$2 = false;
567
- break $l$block_0;
568
- }
569
- var _iterator__ex2g4s = tmp0.n();
570
- while (_iterator__ex2g4s.q()) {
571
- var element = _iterator__ex2g4s.r();
572
- if (element.c4s_1 === 'in' && equalTerms($this, element.b4s_1.h4r_1, effect)) {
573
- tmp$ret$2 = true;
574
- break $l$block_0;
575
- }
576
- }
577
- tmp$ret$2 = false;
578
- }
579
- if (tmp$ret$2) {
580
- // Inline function 'kotlin.collections.map' call
581
- var this_0 = intervention.toList();
582
- // Inline function 'kotlin.collections.mapTo' call
583
- var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
584
- var _iterator__ex2g4s_0 = this_0.n();
585
- while (_iterator__ex2g4s_0.q()) {
586
- var item = _iterator__ex2g4s_0.r();
587
- var tmp$ret$6 = Companion_getInstance_2().of(parseStruct(Companion_getInstance_1(), ':->(fk' + new UInt(nextUInt(Default_getInstance())) + ', ' + item.toString() + ')'), []);
588
- destination.l(tmp$ret$6);
589
- }
590
- // Inline function 'kotlin.let' call
591
- // Inline function 'kotlin.let' call
592
- var tmp0_0 = solveFresh($this, effect, request.context.a1y().plusTheory(Companion_instance_1.ofIterableWithDefaultUnificator(destination))).g4s_1;
593
- var tmp$ret$11;
594
- $l$block_2: {
841
+ if (this.i57(request, effect)) {
842
+ var tmp0 = graphOf(this, intervened(this, request, intervention), effect).o4h_1;
843
+ var tmp$ret$0;
844
+ $l$block_0: {
595
845
  // Inline function 'kotlin.collections.none' call
596
- var tmp_1;
597
- if (isInterface(tmp0_0, Collection)) {
598
- tmp_1 = tmp0_0.i();
846
+ var tmp_0;
847
+ if (isInterface(tmp0, Collection)) {
848
+ tmp_0 = tmp0.i();
599
849
  } else {
600
- tmp_1 = false;
850
+ tmp_0 = false;
601
851
  }
602
- if (tmp_1) {
603
- tmp$ret$11 = true;
604
- break $l$block_2;
852
+ if (tmp_0) {
853
+ tmp$ret$0 = true;
854
+ break $l$block_0;
605
855
  }
606
- var _iterator__ex2g4s_1 = tmp0_0.n();
607
- while (_iterator__ex2g4s_1.q()) {
608
- var element_0 = _iterator__ex2g4s_1.r();
609
- if (element_0.c4s_1 === 'in' && equalTerms($this, element_0.b4s_1.h4r_1, effect)) {
610
- tmp$ret$11 = false;
611
- break $l$block_2;
856
+ var _iterator__ex2g4s = tmp0.n();
857
+ while (_iterator__ex2g4s.q()) {
858
+ var element = _iterator__ex2g4s.r();
859
+ if (element.a4i_1 === 'in' && concludes(this, element.z4h_1, effect)) {
860
+ tmp$ret$0 = false;
861
+ break $l$block_0;
612
862
  }
613
863
  }
614
- tmp$ret$11 = true;
864
+ tmp$ret$0 = true;
615
865
  }
616
- tmp = tmp$ret$11;
866
+ tmp = tmp$ret$0;
617
867
  } else {
618
868
  tmp = false;
619
869
  }
620
870
  return tmp;
621
- }
622
- function CausalityCheckCauseButFor($outer) {
623
- this.t4v_1 = $outer;
624
- this.s4v_1 = new Signature('but_for', 2);
625
- }
626
- protoOf(CausalityCheckCauseButFor).k1x = function () {
627
- return this.s4v_1;
628
- };
629
- protoOf(CausalityCheckCauseButFor).l2m = function (request) {
630
- var cause = request.arguments.u(0);
631
- var effect = this.t4v_1.u4v(request.arguments.u(1).toString());
632
- return sequenceOf(request.replyWithCondition(arg2pScope(CausalitySolver$CausalityCheckCauseButFor$solve$lambda(request, cause, this.t4v_1, effect)), VOID, []));
633
- };
634
- protoOf(CausalityCheckCauseButFor).solve = function (request) {
635
- return this.l2m(request);
636
- };
637
- function CausalityCheckInterventionICAIL24($outer) {
638
- this.w4v_1 = $outer;
639
- this.v4v_1 = new Signature('ness_original_intervention', 2);
640
- }
641
- protoOf(CausalityCheckInterventionICAIL24).k1x = function () {
642
- return this.v4v_1;
643
- };
644
- protoOf(CausalityCheckInterventionICAIL24).l2m = function (request) {
645
- var intervention = request.arguments.u(0).castToList();
646
- var effect = this.w4v_1.u4v(request.arguments.u(1).toString());
647
- return sequenceOf(request.replyWithCondition(checkCausalityICAIL24(this.w4v_1, request, intervention, effect), VOID, []));
648
- };
649
- protoOf(CausalityCheckInterventionICAIL24).solve = function (request) {
650
- return this.l2m(request);
651
- };
652
- function CausalityCheckCauseICAIL24($outer) {
653
- this.y4v_1 = $outer;
654
- this.x4v_1 = new Signature('ness_original', 3);
655
- }
656
- protoOf(CausalityCheckCauseICAIL24).k1x = function () {
657
- return this.x4v_1;
658
- };
659
- protoOf(CausalityCheckCauseICAIL24).l2m = function (request) {
660
- var intervention = request.arguments.u(0);
661
- var cause = request.arguments.u(1);
662
- var effect = this.y4v_1.u4v(request.arguments.u(2).toString());
663
- if (!isInterface(intervention, Var)) {
664
- throw Companion_instance_2.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
665
- }
666
- var tmp = getInterventions(this.y4v_1, request, cause, effect);
667
- var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda(this.y4v_1, request, effect));
668
- var tmp0_elvis_lhs = firstOrNull(map(tmp_0, CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda_0(intervention)));
669
- return sequenceOf(request.replyWith(tmp0_elvis_lhs == null ? Companion_getInstance().failed() : tmp0_elvis_lhs, VOID, []));
670
- };
671
- protoOf(CausalityCheckCauseICAIL24).solve = function (request) {
672
- return this.l2m(request);
673
- };
674
- function CausalityCheckInterventionICAIL25($outer) {
675
- this.a4w_1 = $outer;
676
- this.z4v_1 = new Signature('ness_intervention', 2);
677
- }
678
- protoOf(CausalityCheckInterventionICAIL25).k1x = function () {
679
- return this.z4v_1;
680
- };
681
- protoOf(CausalityCheckInterventionICAIL25).l2m = function (request) {
682
- var intervention = request.arguments.u(0).castToList();
683
- var effect = this.a4w_1.u4v(request.arguments.u(1).toString());
684
- return sequenceOf(request.replyWithCondition(checkCausalityICAIL25(this.a4w_1, request, intervention, effect), VOID, []));
685
- };
686
- protoOf(CausalityCheckInterventionICAIL25).solve = function (request) {
687
- return this.l2m(request);
688
- };
689
- function CausalityCheckCauseICAIL25($outer) {
690
- this.c4w_1 = $outer;
691
- this.b4w_1 = new Signature('ness', 3);
692
- }
693
- protoOf(CausalityCheckCauseICAIL25).k1x = function () {
694
- return this.b4w_1;
695
- };
696
- protoOf(CausalityCheckCauseICAIL25).l2m = function (request) {
697
- var intervention = request.arguments.u(0);
698
- var cause = request.arguments.u(1);
699
- var effect = this.c4w_1.u4v(request.arguments.u(2).toString());
700
- if (!isInterface(intervention, Var)) {
701
- throw Companion_instance_2.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
702
- }
703
- var tmp = getInterventions(this.c4w_1, request, cause, effect);
704
- var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda(this.c4w_1, request, effect));
705
- var tmp0_elvis_lhs = firstOrNull(map(tmp_0, CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda_0(intervention)));
706
- return sequenceOf(request.replyWith(tmp0_elvis_lhs == null ? Companion_getInstance().failed() : tmp0_elvis_lhs, VOID, []));
707
- };
708
- protoOf(CausalityCheckCauseICAIL25).solve = function (request) {
709
- return this.l2m(request);
710
- };
711
- function CausalitySolver$solveFresh$lambda(this$0) {
712
- return function (it) {
713
- return mineActiveGraph(this$0.n4v_1);
714
- };
715
- }
716
- function CausalitySolver$getSupports$lambda(this$0, $effect) {
717
- return function (it) {
718
- return equalTerms(this$0, it.b4s_1.h4r_1, $effect);
719
- };
720
- }
721
- function CausalitySolver$getSupports$lambda_0(this$0, $graph) {
722
- return function (it) {
723
- return supporters(this$0, it.b4s_1, $graph, emptyList());
724
- };
725
- }
726
- function CausalitySolver$getSupports$lambda_1(it) {
727
- return it.b4s_1;
728
- }
729
- function CausalitySolver$checkBaseTheory$lambda(a) {
730
- return a.p4r();
731
- }
732
- function CausalitySolver$getSubsets$lambda$lambda(it) {
733
- return it.e1z();
734
- }
735
- function CausalitySolver$getSubsets$lambda$lambda_0($this_arg2pScope) {
736
- return function (it) {
737
- return ensureNotNull(it.u1x().l2($this_arg2pScope.p1j())).castToList();
738
- };
739
- }
740
- function CausalitySolver$getSubsets$lambda($request, $intervention) {
741
- return function ($this$arg2pScope) {
742
- var tmp = $request.solve($this$arg2pScope.stringInvoke('proper_subsets', $intervention, [$this$arg2pScope.p1j()]));
743
- var tmp_0 = filter(tmp, CausalitySolver$getSubsets$lambda$lambda);
744
- return toList(map(tmp_0, CausalitySolver$getSubsets$lambda$lambda_0($this$arg2pScope)));
745
- };
746
- }
747
- function CausalitySolver$getInterventions$lambda$lambda(it) {
748
- return it.e1z();
749
- }
750
- function CausalitySolver$getInterventions$lambda$lambda_0($this_arg2pScope) {
751
- return function (it) {
752
- return ensureNotNull(it.u1x().l2($this_arg2pScope.p1j())).castToList();
753
- };
754
- }
755
- function CausalitySolver$getInterventions$lambda($request, $rules, $cause) {
756
- return function ($this$arg2pScope) {
757
- var tmp = $request.solve($this$arg2pScope.stringInvoke('generate_interventions', $rules, [$cause, $this$arg2pScope.p1j()]));
758
- var tmp_0 = filter(tmp, CausalitySolver$getInterventions$lambda$lambda);
759
- return map(tmp_0, CausalitySolver$getInterventions$lambda$lambda_0($this$arg2pScope));
760
- };
761
- }
762
- function CausalitySolver() {
763
- var tmp = this;
764
- var tmp_0 = Arg2pSolverFactory_instance;
765
- var tmp0_graphExtensions = emptyList();
766
- tmp.n4v_1 = tmp_0.p4d(VOID, (new FlagsBuilder(VOID, VOID, VOID, VOID, VOID, 'grounded', VOID, VOID, VOID, VOID, tmp0_graphExtensions)).b4e());
767
- this.o4v_1 = Companion_instance_3.l4d().i4d();
768
- var tmp_1 = this;
769
- // Inline function 'kotlin.collections.mutableMapOf' call
770
- tmp_1.p4v_1 = LinkedHashMap_init_$Create$();
771
- this.q4v_1 = 'prolog.argumentation.causality.solver';
772
- this.r4v_1 = Companion_instance_4.i4d().plusOperatorSet(Companion_instance_5.i4d()).plusOperatorSet(Companion_getInstance_3().DEFAULT);
773
- }
774
- protoOf(CausalitySolver).u4v = function (string) {
775
- return replace(replace(string, ' ', ''), "'", '');
776
- };
777
- protoOf(CausalitySolver).w2i = function () {
778
- return this.q4v_1;
779
- };
780
- protoOf(CausalitySolver).d4e = function () {
781
- // Inline function 'kotlin.let' call
782
- var primitives = listOf([new CausalityCheckInterventionICAIL24(this), new CausalityCheckCauseICAIL24(this), new CausalityCheckInterventionICAIL25(this), new CausalityCheckCauseICAIL25(this), new CausalityCheckCauseButFor(this)]);
783
- var tmp = Companion_getInstance_4();
784
- // Inline function 'kotlin.collections.associateBy' call
785
- var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(primitives, 10)), 16);
786
- // Inline function 'kotlin.collections.associateByTo' call
787
- var destination = LinkedHashMap_init_$Create$_0(capacity);
788
- var _iterator__ex2g4s = primitives.n();
789
- while (_iterator__ex2g4s.q()) {
790
- var element = _iterator__ex2g4s.r();
791
- var tmp$ret$4 = element.k1x();
792
- destination.t4(tmp$ret$4, element);
793
- }
794
- return tmp.of(this.q4v_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.r4v_1));
795
- };
796
- protoOf(CausalitySolver).e4e = function () {
797
- return 'causality';
798
- };
799
- protoOf(CausalitySolver).n4d = function () {
800
- return this.r4v_1;
801
871
  };
802
872
  //region block: post-declaration
803
- protoOf(CausalityCheckCauseButFor).n1x = get_help;
804
- protoOf(CausalityCheckInterventionICAIL24).n1x = get_help;
805
- protoOf(CausalityCheckCauseICAIL24).n1x = get_help;
806
- protoOf(CausalityCheckInterventionICAIL25).n1x = get_help;
807
- protoOf(CausalityCheckCauseICAIL25).n1x = get_help;
808
- protoOf(CausalitySolver).m4d = content;
873
+ protoOf(ButFor).w1x = get_help;
874
+ protoOf(Ness).w1x = get_help;
875
+ protoOf(NessIntervention).w1x = get_help;
876
+ protoOf(NessOriginal).w1x = get_help;
877
+ protoOf(NessOriginalIntervention).w1x = get_help;
878
+ //endregion
879
+ //region block: init
880
+ JsCausality_instance = new JsCausality();
809
881
  //endregion
810
882
  //region block: exports
883
+ function $jsExportAll$(_) {
884
+ var it = _.it || (_.it = {});
885
+ var unibo = it.unibo || (it.unibo = {});
886
+ var tuprolog = unibo.tuprolog || (unibo.tuprolog = {});
887
+ var argumentation = tuprolog.argumentation || (tuprolog.argumentation = {});
888
+ var causality = argumentation.causality || (argumentation.causality = {});
889
+ var js = causality.js || (causality.js = {});
890
+ defineProp(js, 'JsCausality', JsCausality_getInstance, VOID, true);
891
+ }
892
+ $jsExportAll$(_);
893
+ _.$jsExportAll$ = $jsExportAll$;
811
894
  _.$_$ = _.$_$ || {};
812
- _.$_$.a = CausalitySolver;
895
+ _.$_$.a = CausalityModule;
813
896
  //endregion
814
897
  return _;
815
898
  }));