@tuprolog/arg2p 0.15.0 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2p-core.js +3265 -3058
- package/2p-core.js.map +1 -1
- package/2p-dsl-core.js +526 -620
- package/2p-dsl-core.js.map +1 -1
- package/2p-dsl-solve.js +259 -259
- package/2p-dsl-solve.js.map +1 -1
- package/2p-dsl-theory.js +173 -172
- package/2p-dsl-theory.js.map +1 -1
- package/2p-dsl-unify.js +6 -6
- package/2p-dsl-unify.js.map +1 -1
- package/2p-parser-core.js +266 -875
- package/2p-parser-core.js.map +1 -1
- package/2p-parser-impl.js +5554 -0
- package/2p-parser-impl.js.map +1 -0
- package/2p-parser-theory.js +199 -45
- package/2p-parser-theory.js.map +1 -1
- package/2p-solve-classic.js +1075 -1081
- package/2p-solve-classic.js.map +1 -1
- package/2p-solve.js +4008 -4039
- package/2p-solve.js.map +1 -1
- package/2p-theory.js +1814 -1834
- package/2p-theory.js.map +1 -1
- package/2p-unify.js +648 -367
- package/2p-unify.js.map +1 -1
- package/2p-utils.js +475 -479
- package/2p-utils.js.map +1 -1
- package/arg2p-causality-solver.js +316 -294
- package/arg2p-causality-solver.js.map +1 -1
- package/arg2p-core.js +2199 -2029
- package/arg2p-core.js.map +1 -1
- package/arg2p.js +125 -125
- package/arg2p.js.map +1 -1
- package/kotlin-kotlin-stdlib.js +2952 -2707
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kt-math.js +1598 -1598
- package/kt-math.js.map +1 -1
- package/package.json +2 -5
- package/2p-parser-js.js +0 -39
- package/2p-parser-js.js.map +0 -1
|
@@ -33,63 +33,65 @@
|
|
|
33
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 Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.
|
|
37
|
-
var ensureNotNull = kotlin_kotlin.$_$.
|
|
38
|
-
var filter = kotlin_kotlin.$_$.
|
|
39
|
-
var map = kotlin_kotlin.$_$.
|
|
40
|
-
var firstOrNull = kotlin_kotlin.$_$.
|
|
41
|
-
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.
|
|
42
|
-
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_unify.$_$.
|
|
43
|
-
var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.
|
|
36
|
+
var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.i;
|
|
37
|
+
var ensureNotNull = kotlin_kotlin.$_$.sb;
|
|
38
|
+
var filter = kotlin_kotlin.$_$.n8;
|
|
39
|
+
var map = kotlin_kotlin.$_$.z8;
|
|
40
|
+
var firstOrNull = kotlin_kotlin.$_$.o8;
|
|
41
|
+
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.o;
|
|
42
|
+
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_unify.$_$.a;
|
|
43
|
+
var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.p;
|
|
44
44
|
var parseTerm = kotlin_it_unibo_tuprolog_parser_core.$_$.e;
|
|
45
|
-
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.
|
|
46
|
-
var Unit_instance = kotlin_kotlin.$_$.
|
|
47
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.
|
|
48
|
-
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.
|
|
49
|
-
var plus = kotlin_kotlin.$_$.
|
|
50
|
-
var addAll = kotlin_kotlin.$_$.
|
|
51
|
-
var plus_0 = kotlin_kotlin.$_$.
|
|
52
|
-
var emptyList = kotlin_kotlin.$_$.
|
|
45
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.q;
|
|
46
|
+
var Unit_instance = kotlin_kotlin.$_$.o;
|
|
47
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.j2;
|
|
48
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.p;
|
|
49
|
+
var plus = kotlin_kotlin.$_$.i4;
|
|
50
|
+
var addAll = kotlin_kotlin.$_$.x1;
|
|
51
|
+
var plus_0 = kotlin_kotlin.$_$.h4;
|
|
52
|
+
var emptyList = kotlin_kotlin.$_$.u2;
|
|
53
|
+
var to = kotlin_kotlin.$_$.zb;
|
|
53
54
|
var Companion_instance_1 = kotlin_it_unibo_tuprolog_theory.$_$.b;
|
|
54
55
|
var parseTheoryWithOperators = kotlin_it_unibo_tuprolog_parser_theory.$_$.b;
|
|
55
|
-
var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.
|
|
56
|
+
var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.n;
|
|
56
57
|
var parseStruct = kotlin_it_unibo_tuprolog_parser_core.$_$.d;
|
|
57
58
|
var Graph = kotlin_it_unibo_tuprolog_argumentation_core.$_$.l;
|
|
58
|
-
var asSequence = kotlin_kotlin.$_$.
|
|
59
|
-
var flatMap = kotlin_kotlin.$_$.
|
|
60
|
-
var toList = kotlin_kotlin.$_$.
|
|
61
|
-
var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.
|
|
62
|
-
var Collection = kotlin_kotlin.$_$.
|
|
63
|
-
var isInterface = kotlin_kotlin.$_$.
|
|
64
|
-
var distinct = kotlin_kotlin.$_$.
|
|
59
|
+
var asSequence = kotlin_kotlin.$_$.g2;
|
|
60
|
+
var flatMap = kotlin_kotlin.$_$.r8;
|
|
61
|
+
var toList = kotlin_kotlin.$_$.o9;
|
|
62
|
+
var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.e;
|
|
63
|
+
var Collection = kotlin_kotlin.$_$.r1;
|
|
64
|
+
var isInterface = kotlin_kotlin.$_$.z6;
|
|
65
|
+
var distinct = kotlin_kotlin.$_$.s2;
|
|
65
66
|
var arg2pScope = kotlin_it_unibo_tuprolog_argumentation_core.$_$.e;
|
|
66
|
-
var toList_0 = kotlin_kotlin.$_$.
|
|
67
|
-
var toString = kotlin_kotlin.$_$.
|
|
68
|
-
var Default_getInstance = kotlin_kotlin.$_$.
|
|
69
|
-
var nextUInt = kotlin_kotlin.$_$.
|
|
70
|
-
var UInt = kotlin_kotlin.$_$.
|
|
67
|
+
var toList_0 = kotlin_kotlin.$_$.s4;
|
|
68
|
+
var toString = kotlin_kotlin.$_$.i7;
|
|
69
|
+
var Default_getInstance = kotlin_kotlin.$_$.k;
|
|
70
|
+
var nextUInt = kotlin_kotlin.$_$.o7;
|
|
71
|
+
var UInt = kotlin_kotlin.$_$.qb;
|
|
71
72
|
var Signature = kotlin_it_unibo_tuprolog_solve.$_$.u2;
|
|
72
|
-
var protoOf = kotlin_kotlin.$_$.
|
|
73
|
+
var protoOf = kotlin_kotlin.$_$.f7;
|
|
73
74
|
var VOID = kotlin_kotlin.$_$.b;
|
|
74
|
-
var sequenceOf = kotlin_kotlin.$_$.
|
|
75
|
+
var sequenceOf = kotlin_kotlin.$_$.g9;
|
|
75
76
|
var Primitive = kotlin_it_unibo_tuprolog_solve.$_$.w1;
|
|
76
|
-
var initMetadataForClass = kotlin_kotlin.$_$.
|
|
77
|
-
var Companion_instance_2 = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
78
|
-
var Expected_VARIABLE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
79
|
-
var Var = kotlin_it_unibo_tuprolog_core.$_$.
|
|
77
|
+
var initMetadataForClass = kotlin_kotlin.$_$.s6;
|
|
78
|
+
var Companion_instance_2 = kotlin_it_unibo_tuprolog_solve.$_$.l;
|
|
79
|
+
var Expected_VARIABLE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.c1;
|
|
80
|
+
var Var = kotlin_it_unibo_tuprolog_core.$_$.u2;
|
|
80
81
|
var mineActiveGraph = kotlin_it_unibo_tuprolog_argumentation_core.$_$.k;
|
|
81
82
|
var Arg2pSolverFactory_instance = kotlin_it_unibo_tuprolog_argumentation_core.$_$.d;
|
|
82
83
|
var FlagsBuilder = kotlin_it_unibo_tuprolog_argumentation_core.$_$.f;
|
|
83
84
|
var Companion_instance_3 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.c;
|
|
85
|
+
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.s;
|
|
84
86
|
var Companion_instance_4 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.a;
|
|
85
87
|
var Companion_instance_5 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.b;
|
|
86
|
-
var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.
|
|
87
|
-
var replace = kotlin_kotlin.$_$.
|
|
88
|
-
var listOf = kotlin_kotlin.$_$.
|
|
89
|
-
var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
90
|
-
var mapCapacity = kotlin_kotlin.$_$.
|
|
91
|
-
var coerceAtLeast = kotlin_kotlin.$_$.
|
|
92
|
-
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.
|
|
88
|
+
var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.b;
|
|
89
|
+
var replace = kotlin_kotlin.$_$.ka;
|
|
90
|
+
var listOf = kotlin_kotlin.$_$.n3;
|
|
91
|
+
var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_solve.$_$.r;
|
|
92
|
+
var mapCapacity = kotlin_kotlin.$_$.o3;
|
|
93
|
+
var coerceAtLeast = kotlin_kotlin.$_$.t7;
|
|
94
|
+
var LinkedHashMap_init_$Create$_0 = kotlin_kotlin.$_$.r;
|
|
93
95
|
var content = kotlin_it_unibo_tuprolog_argumentation_core.$_$.g;
|
|
94
96
|
var ArgLibrary = kotlin_it_unibo_tuprolog_argumentation_core.$_$.h;
|
|
95
97
|
var Loadable = kotlin_it_unibo_tuprolog_argumentation_core.$_$.i;
|
|
@@ -103,11 +105,11 @@
|
|
|
103
105
|
initMetadataForClass(CausalitySolver, 'CausalitySolver', CausalitySolver, VOID, [ArgLibrary, Loadable]);
|
|
104
106
|
//endregion
|
|
105
107
|
function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda(it) {
|
|
106
|
-
return it.
|
|
108
|
+
return it.p1x();
|
|
107
109
|
}
|
|
108
110
|
function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_0($this_arg2pScope) {
|
|
109
111
|
return function (it) {
|
|
110
|
-
return Companion_instance.of([ensureNotNull(it.
|
|
112
|
+
return Companion_instance.of([ensureNotNull(it.h1w().i2($this_arg2pScope.d1i()))]);
|
|
111
113
|
};
|
|
112
114
|
}
|
|
113
115
|
function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_1(this$0, $request, $effect) {
|
|
@@ -117,7 +119,7 @@
|
|
|
117
119
|
}
|
|
118
120
|
function CausalitySolver$CausalityCheckCauseButFor$solve$lambda($request, $cause, this$0, $effect) {
|
|
119
121
|
return function ($this$arg2pScope) {
|
|
120
|
-
var tmp = $request.solve($this$arg2pScope.stringInvoke('compl', $cause, [$this$arg2pScope.
|
|
122
|
+
var tmp = $request.solve($this$arg2pScope.stringInvoke('compl', $cause, [$this$arg2pScope.d1i()]));
|
|
121
123
|
var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda);
|
|
122
124
|
var tmp_1 = map(tmp_0, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_0($this$arg2pScope));
|
|
123
125
|
var tmp0_elvis_lhs = firstOrNull(map(tmp_1, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_1(this$0, $request, $effect)));
|
|
@@ -145,61 +147,61 @@
|
|
|
145
147
|
};
|
|
146
148
|
}
|
|
147
149
|
function equalTerms($this, a, b) {
|
|
148
|
-
return Companion_getInstance_0().
|
|
150
|
+
return Companion_getInstance_0().g1m().match(parseTerm(Companion_instance_0, a), parseTerm(Companion_instance_0, b));
|
|
149
151
|
}
|
|
150
152
|
function attackers($this, x, graph) {
|
|
151
153
|
// Inline function 'kotlin.collections.filter' call
|
|
152
|
-
var tmp0 = graph.
|
|
154
|
+
var tmp0 = graph.r43_1;
|
|
153
155
|
// Inline function 'kotlin.collections.filterTo' call
|
|
154
156
|
var destination = ArrayList_init_$Create$();
|
|
155
|
-
var _iterator__ex2g4s = tmp0.
|
|
156
|
-
while (_iterator__ex2g4s.
|
|
157
|
-
var element = _iterator__ex2g4s.
|
|
158
|
-
if (element.
|
|
159
|
-
destination.
|
|
157
|
+
var _iterator__ex2g4s = tmp0.n();
|
|
158
|
+
while (_iterator__ex2g4s.q()) {
|
|
159
|
+
var element = _iterator__ex2g4s.r();
|
|
160
|
+
if (element.l43_1.a43_1 === x.a43_1) {
|
|
161
|
+
destination.k(element);
|
|
160
162
|
}
|
|
161
163
|
}
|
|
162
164
|
// Inline function 'kotlin.collections.map' call
|
|
163
165
|
// Inline function 'kotlin.collections.mapTo' call
|
|
164
166
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
|
|
165
|
-
var _iterator__ex2g4s_0 = destination.
|
|
166
|
-
while (_iterator__ex2g4s_0.
|
|
167
|
-
var item = _iterator__ex2g4s_0.
|
|
167
|
+
var _iterator__ex2g4s_0 = destination.n();
|
|
168
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
169
|
+
var item = _iterator__ex2g4s_0.r();
|
|
168
170
|
// Inline function 'kotlin.collections.find' call
|
|
169
|
-
var tmp0_0 = graph.
|
|
170
|
-
var tmp$ret$
|
|
171
|
+
var tmp0_0 = graph.t43_1;
|
|
172
|
+
var tmp$ret$7;
|
|
171
173
|
$l$block: {
|
|
172
174
|
// Inline function 'kotlin.collections.firstOrNull' call
|
|
173
|
-
var _iterator__ex2g4s_1 = tmp0_0.
|
|
174
|
-
while (_iterator__ex2g4s_1.
|
|
175
|
-
var element_0 = _iterator__ex2g4s_1.
|
|
176
|
-
if (item.
|
|
177
|
-
tmp$ret$
|
|
175
|
+
var _iterator__ex2g4s_1 = tmp0_0.n();
|
|
176
|
+
while (_iterator__ex2g4s_1.q()) {
|
|
177
|
+
var element_0 = _iterator__ex2g4s_1.r();
|
|
178
|
+
if (item.k43_1.a43_1 === element_0.o43_1.a43_1) {
|
|
179
|
+
tmp$ret$7 = element_0;
|
|
178
180
|
break $l$block;
|
|
179
181
|
}
|
|
180
182
|
}
|
|
181
|
-
tmp$ret$
|
|
183
|
+
tmp$ret$7 = null;
|
|
182
184
|
}
|
|
183
|
-
var tmp$ret$
|
|
184
|
-
var tmp$ret$
|
|
185
|
-
destination_0.
|
|
185
|
+
var tmp$ret$6 = tmp$ret$7;
|
|
186
|
+
var tmp$ret$5 = ensureNotNull(tmp$ret$6);
|
|
187
|
+
destination_0.k(tmp$ret$5);
|
|
186
188
|
}
|
|
187
189
|
return destination_0;
|
|
188
190
|
}
|
|
189
191
|
function supporters($this, x, graph, chain) {
|
|
190
192
|
var tmp;
|
|
191
|
-
if (chain.
|
|
193
|
+
if (chain.s(x.a43_1)) {
|
|
192
194
|
tmp = emptyList();
|
|
193
195
|
} else {
|
|
194
196
|
// Inline function 'kotlin.collections.filter' call
|
|
195
|
-
var tmp0 = graph.
|
|
197
|
+
var tmp0 = graph.t43_1;
|
|
196
198
|
// Inline function 'kotlin.collections.filterTo' call
|
|
197
199
|
var destination = ArrayList_init_$Create$();
|
|
198
|
-
var _iterator__ex2g4s = tmp0.
|
|
199
|
-
while (_iterator__ex2g4s.
|
|
200
|
-
var element = _iterator__ex2g4s.
|
|
201
|
-
if (x.
|
|
202
|
-
destination.
|
|
200
|
+
var _iterator__ex2g4s = tmp0.n();
|
|
201
|
+
while (_iterator__ex2g4s.q()) {
|
|
202
|
+
var element = _iterator__ex2g4s.r();
|
|
203
|
+
if (x.a43_1 === element.o43_1.a43_1 && element.p43_1 === 'in') {
|
|
204
|
+
destination.k(element);
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
var tmp_0 = destination;
|
|
@@ -207,27 +209,27 @@
|
|
|
207
209
|
var tmp0_0 = attackers($this, x, graph);
|
|
208
210
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
209
211
|
var destination_0 = ArrayList_init_$Create$();
|
|
210
|
-
var _iterator__ex2g4s_0 = tmp0_0.
|
|
211
|
-
while (_iterator__ex2g4s_0.
|
|
212
|
-
var element_0 = _iterator__ex2g4s_0.
|
|
212
|
+
var _iterator__ex2g4s_0 = tmp0_0.n();
|
|
213
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
214
|
+
var element_0 = _iterator__ex2g4s_0.r();
|
|
213
215
|
// Inline function 'kotlin.collections.filter' call
|
|
214
|
-
var tmp0_1 = attackers($this, element_0.
|
|
216
|
+
var tmp0_1 = attackers($this, element_0.o43_1, graph);
|
|
215
217
|
// Inline function 'kotlin.collections.filterTo' call
|
|
216
218
|
var destination_1 = ArrayList_init_$Create$();
|
|
217
|
-
var _iterator__ex2g4s_1 = tmp0_1.
|
|
218
|
-
while (_iterator__ex2g4s_1.
|
|
219
|
-
var element_1 = _iterator__ex2g4s_1.
|
|
220
|
-
if (!(element_1.
|
|
221
|
-
destination_1.
|
|
219
|
+
var _iterator__ex2g4s_1 = tmp0_1.n();
|
|
220
|
+
while (_iterator__ex2g4s_1.q()) {
|
|
221
|
+
var element_1 = _iterator__ex2g4s_1.r();
|
|
222
|
+
if (!(element_1.o43_1.a43_1 === x.a43_1)) {
|
|
223
|
+
destination_1.k(element_1);
|
|
222
224
|
}
|
|
223
225
|
}
|
|
224
226
|
// Inline function 'kotlin.collections.flatMap' call
|
|
225
227
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
226
228
|
var destination_2 = ArrayList_init_$Create$();
|
|
227
|
-
var _iterator__ex2g4s_2 = destination_1.
|
|
228
|
-
while (_iterator__ex2g4s_2.
|
|
229
|
-
var element_2 = _iterator__ex2g4s_2.
|
|
230
|
-
var list = supporters($this, element_2.
|
|
229
|
+
var _iterator__ex2g4s_2 = destination_1.n();
|
|
230
|
+
while (_iterator__ex2g4s_2.q()) {
|
|
231
|
+
var element_2 = _iterator__ex2g4s_2.r();
|
|
232
|
+
var list = supporters($this, element_2.o43_1, graph, plus(chain, x.a43_1));
|
|
231
233
|
addAll(destination_2, list);
|
|
232
234
|
}
|
|
233
235
|
var list_0 = destination_2;
|
|
@@ -238,21 +240,38 @@
|
|
|
238
240
|
return tmp;
|
|
239
241
|
}
|
|
240
242
|
function solveFresh($this, effect, kb) {
|
|
241
|
-
|
|
242
|
-
$this.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
var theory = kb.toStringAsProlog(true);
|
|
244
|
+
var tmp0_safe_receiver = $this.c47_1.i2(to(theory, effect));
|
|
245
|
+
if (tmp0_safe_receiver == null)
|
|
246
|
+
null;
|
|
247
|
+
else {
|
|
248
|
+
// Inline function 'kotlin.let' call
|
|
249
|
+
return tmp0_safe_receiver;
|
|
250
|
+
}
|
|
251
|
+
if ($this.c47_1.t() >= 256) {
|
|
252
|
+
$this.c47_1.e3();
|
|
253
|
+
}
|
|
254
|
+
$this.a47_1.resetStaticKb();
|
|
255
|
+
$this.a47_1.loadStaticKb(parseTheoryWithOperators(Companion_instance_1, theory, $this.b47_1));
|
|
256
|
+
var tmp = $this.a47_1.solve(parseStruct(Companion_getInstance_1(), 'answerQuery(' + effect + ')'));
|
|
257
|
+
var tmp1_elvis_lhs = firstOrNull(map(tmp, CausalitySolver$solveFresh$lambda($this)));
|
|
258
|
+
// Inline function 'kotlin.also' call
|
|
259
|
+
var this_0 = tmp1_elvis_lhs == null ? new Graph(emptyList(), emptyList(), emptyList()) : tmp1_elvis_lhs;
|
|
260
|
+
var tmp0 = $this.c47_1;
|
|
261
|
+
// Inline function 'kotlin.collections.set' call
|
|
262
|
+
var key = to(theory, effect);
|
|
263
|
+
tmp0.l4(key, this_0);
|
|
264
|
+
return this_0;
|
|
246
265
|
}
|
|
247
266
|
function getSupports($this, graph, effect) {
|
|
248
|
-
var tmp = asSequence(graph.
|
|
267
|
+
var tmp = asSequence(graph.t43_1);
|
|
249
268
|
var tmp_0 = filter(tmp, CausalitySolver$getSupports$lambda($this, effect));
|
|
250
269
|
var tmp_1 = flatMap(tmp_0, CausalitySolver$getSupports$lambda_0($this, graph));
|
|
251
270
|
return map(tmp_1, CausalitySolver$getSupports$lambda_1);
|
|
252
271
|
}
|
|
253
272
|
function checkBaseTheory($this, request, effect) {
|
|
254
273
|
// Inline function 'kotlin.let' call
|
|
255
|
-
var it = solveFresh($this, effect, request.context.
|
|
274
|
+
var it = solveFresh($this, effect, request.context.n1w());
|
|
256
275
|
var tmp = getSupports($this, it, effect);
|
|
257
276
|
return toList(map(tmp, CausalitySolver$checkBaseTheory$lambda));
|
|
258
277
|
}
|
|
@@ -261,74 +280,74 @@
|
|
|
261
280
|
var this_0 = intervention.toList();
|
|
262
281
|
// Inline function 'kotlin.collections.mapTo' call
|
|
263
282
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
264
|
-
var _iterator__ex2g4s = this_0.
|
|
265
|
-
while (_iterator__ex2g4s.
|
|
266
|
-
var item = _iterator__ex2g4s.
|
|
267
|
-
var tmp$ret$
|
|
268
|
-
destination.
|
|
283
|
+
var _iterator__ex2g4s = this_0.n();
|
|
284
|
+
while (_iterator__ex2g4s.q()) {
|
|
285
|
+
var item = _iterator__ex2g4s.r();
|
|
286
|
+
var tmp$ret$2 = Companion_getInstance_2().of(parseStruct(Companion_getInstance_1(), ':->(fk' + (item.hashCode() & 2147483647) + ', ' + item.toString() + ')'), []);
|
|
287
|
+
destination.k(tmp$ret$2);
|
|
269
288
|
}
|
|
270
289
|
// Inline function 'kotlin.let' call
|
|
271
290
|
// Inline function 'kotlin.let' call
|
|
272
|
-
var naf = solveFresh($this, effect, request.context.
|
|
291
|
+
var naf = solveFresh($this, effect, request.context.n1w().plusTheory(Companion_instance_1.ofIterableWithDefaultUnificator(destination)));
|
|
273
292
|
// Inline function 'kotlin.collections.filter' call
|
|
274
|
-
var tmp0 = naf.
|
|
293
|
+
var tmp0 = naf.t43_1;
|
|
275
294
|
// Inline function 'kotlin.collections.filterTo' call
|
|
276
295
|
var destination_0 = ArrayList_init_$Create$();
|
|
277
|
-
var _iterator__ex2g4s_0 = tmp0.
|
|
278
|
-
while (_iterator__ex2g4s_0.
|
|
279
|
-
var element = _iterator__ex2g4s_0.
|
|
280
|
-
if (element.
|
|
281
|
-
destination_0.
|
|
296
|
+
var _iterator__ex2g4s_0 = tmp0.n();
|
|
297
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
298
|
+
var element = _iterator__ex2g4s_0.r();
|
|
299
|
+
if (element.p43_1 === 'out' || element.p43_1 === 'und') {
|
|
300
|
+
destination_0.k(element);
|
|
282
301
|
}
|
|
283
302
|
}
|
|
284
303
|
// Inline function 'kotlin.collections.filter' call
|
|
285
304
|
// Inline function 'kotlin.collections.filterTo' call
|
|
286
305
|
var destination_1 = ArrayList_init_$Create$();
|
|
287
|
-
var _iterator__ex2g4s_1 = destination_0.
|
|
288
|
-
while (_iterator__ex2g4s_1.
|
|
289
|
-
var element_0 = _iterator__ex2g4s_1.
|
|
290
|
-
var tmp$ret$
|
|
306
|
+
var _iterator__ex2g4s_1 = destination_0.n();
|
|
307
|
+
while (_iterator__ex2g4s_1.q()) {
|
|
308
|
+
var element_0 = _iterator__ex2g4s_1.r();
|
|
309
|
+
var tmp$ret$13;
|
|
291
310
|
$l$block_0: {
|
|
292
311
|
// Inline function 'kotlin.collections.any' call
|
|
293
312
|
var tmp;
|
|
294
313
|
if (isInterface(support, Collection)) {
|
|
295
|
-
tmp = support.
|
|
314
|
+
tmp = support.h();
|
|
296
315
|
} else {
|
|
297
316
|
tmp = false;
|
|
298
317
|
}
|
|
299
318
|
if (tmp) {
|
|
300
|
-
tmp$ret$
|
|
319
|
+
tmp$ret$13 = false;
|
|
301
320
|
break $l$block_0;
|
|
302
321
|
}
|
|
303
|
-
var _iterator__ex2g4s_2 = support.
|
|
304
|
-
while (_iterator__ex2g4s_2.
|
|
305
|
-
var element_1 = _iterator__ex2g4s_2.
|
|
306
|
-
if (Companion_getInstance_0().
|
|
307
|
-
tmp$ret$
|
|
322
|
+
var _iterator__ex2g4s_2 = support.n();
|
|
323
|
+
while (_iterator__ex2g4s_2.q()) {
|
|
324
|
+
var element_1 = _iterator__ex2g4s_2.r();
|
|
325
|
+
if (Companion_getInstance_0().g1m().match(element_0.o43_1.c43(), element_1)) {
|
|
326
|
+
tmp$ret$13 = true;
|
|
308
327
|
break $l$block_0;
|
|
309
328
|
}
|
|
310
329
|
}
|
|
311
|
-
tmp$ret$
|
|
330
|
+
tmp$ret$13 = false;
|
|
312
331
|
}
|
|
313
|
-
if (tmp$ret$
|
|
314
|
-
destination_1.
|
|
332
|
+
if (tmp$ret$13) {
|
|
333
|
+
destination_1.k(element_0);
|
|
315
334
|
}
|
|
316
335
|
}
|
|
317
336
|
// Inline function 'kotlin.collections.flatMap' call
|
|
318
337
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
319
338
|
var destination_2 = ArrayList_init_$Create$();
|
|
320
|
-
var _iterator__ex2g4s_3 = destination_1.
|
|
321
|
-
while (_iterator__ex2g4s_3.
|
|
322
|
-
var element_2 = _iterator__ex2g4s_3.
|
|
339
|
+
var _iterator__ex2g4s_3 = destination_1.n();
|
|
340
|
+
while (_iterator__ex2g4s_3.q()) {
|
|
341
|
+
var element_2 = _iterator__ex2g4s_3.r();
|
|
323
342
|
// Inline function 'kotlin.collections.filter' call
|
|
324
|
-
var tmp0_0 = attackers($this, element_2.
|
|
343
|
+
var tmp0_0 = attackers($this, element_2.o43_1, naf);
|
|
325
344
|
// Inline function 'kotlin.collections.filterTo' call
|
|
326
345
|
var destination_3 = ArrayList_init_$Create$();
|
|
327
|
-
var _iterator__ex2g4s_4 = tmp0_0.
|
|
328
|
-
while (_iterator__ex2g4s_4.
|
|
329
|
-
var element_3 = _iterator__ex2g4s_4.
|
|
330
|
-
if (element_3.
|
|
331
|
-
destination_3.
|
|
346
|
+
var _iterator__ex2g4s_4 = tmp0_0.n();
|
|
347
|
+
while (_iterator__ex2g4s_4.q()) {
|
|
348
|
+
var element_3 = _iterator__ex2g4s_4.r();
|
|
349
|
+
if (element_3.p43_1 === 'in') {
|
|
350
|
+
destination_3.k(element_3);
|
|
332
351
|
}
|
|
333
352
|
}
|
|
334
353
|
var list = destination_3;
|
|
@@ -337,11 +356,11 @@
|
|
|
337
356
|
// Inline function 'kotlin.collections.map' call
|
|
338
357
|
// Inline function 'kotlin.collections.mapTo' call
|
|
339
358
|
var destination_4 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_2, 10));
|
|
340
|
-
var _iterator__ex2g4s_5 = destination_2.
|
|
341
|
-
while (_iterator__ex2g4s_5.
|
|
342
|
-
var item_0 = _iterator__ex2g4s_5.
|
|
343
|
-
var tmp$ret$
|
|
344
|
-
destination_4.
|
|
359
|
+
var _iterator__ex2g4s_5 = destination_2.n();
|
|
360
|
+
while (_iterator__ex2g4s_5.q()) {
|
|
361
|
+
var item_0 = _iterator__ex2g4s_5.r();
|
|
362
|
+
var tmp$ret$23 = item_0.o43_1;
|
|
363
|
+
destination_4.k(tmp$ret$23);
|
|
345
364
|
}
|
|
346
365
|
return distinct(destination_4);
|
|
347
366
|
}
|
|
@@ -351,23 +370,23 @@
|
|
|
351
370
|
function getInterventions($this, request, cause, effect) {
|
|
352
371
|
var tmp = Companion_instance_0;
|
|
353
372
|
// Inline function 'kotlin.collections.map' call
|
|
354
|
-
var this_0 = solveFresh($this, effect, request.context.
|
|
373
|
+
var this_0 = solveFresh($this, effect, request.context.n1w()).q43_1;
|
|
355
374
|
// Inline function 'kotlin.collections.mapTo' call
|
|
356
375
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
357
|
-
var _iterator__ex2g4s = this_0.
|
|
358
|
-
while (_iterator__ex2g4s.
|
|
359
|
-
var item = _iterator__ex2g4s.
|
|
360
|
-
var tmp$ret$
|
|
361
|
-
destination.
|
|
376
|
+
var _iterator__ex2g4s = this_0.n();
|
|
377
|
+
while (_iterator__ex2g4s.q()) {
|
|
378
|
+
var item = _iterator__ex2g4s.r();
|
|
379
|
+
var tmp$ret$2 = item.t42_1;
|
|
380
|
+
destination.k(tmp$ret$2);
|
|
362
381
|
}
|
|
363
382
|
// Inline function 'kotlin.collections.filter' call
|
|
364
383
|
// Inline function 'kotlin.collections.filterTo' call
|
|
365
384
|
var destination_0 = ArrayList_init_$Create$();
|
|
366
|
-
var _iterator__ex2g4s_0 = destination.
|
|
367
|
-
while (_iterator__ex2g4s_0.
|
|
368
|
-
var element = _iterator__ex2g4s_0.
|
|
385
|
+
var _iterator__ex2g4s_0 = destination.n();
|
|
386
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
387
|
+
var element = _iterator__ex2g4s_0.r();
|
|
369
388
|
if (!(element === 'none')) {
|
|
370
|
-
destination_0.
|
|
389
|
+
destination_0.k(element);
|
|
371
390
|
}
|
|
372
391
|
}
|
|
373
392
|
var rules = parseTerm(tmp, toString(toList_0(destination_0)));
|
|
@@ -375,14 +394,14 @@
|
|
|
375
394
|
}
|
|
376
395
|
function checkCausalityICAIL24($this, request, intervention, effect) {
|
|
377
396
|
var supports = checkBaseTheory($this, request, effect);
|
|
378
|
-
if (supports.
|
|
397
|
+
if (supports.h())
|
|
379
398
|
return false;
|
|
380
399
|
var attackers = checkIntervention($this, request, intervention, supports, effect);
|
|
381
400
|
var tmp;
|
|
382
401
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
383
|
-
if (!attackers.
|
|
402
|
+
if (!attackers.h()) {
|
|
384
403
|
var tmp_0;
|
|
385
|
-
if (intervention.
|
|
404
|
+
if (intervention.ny() <= 1) {
|
|
386
405
|
tmp_0 = true;
|
|
387
406
|
} else {
|
|
388
407
|
var tmp0 = getSubsets($this, request, intervention);
|
|
@@ -391,7 +410,7 @@
|
|
|
391
410
|
// Inline function 'kotlin.collections.none' call
|
|
392
411
|
var tmp_1;
|
|
393
412
|
if (isInterface(tmp0, Collection)) {
|
|
394
|
-
tmp_1 = tmp0.
|
|
413
|
+
tmp_1 = tmp0.h();
|
|
395
414
|
} else {
|
|
396
415
|
tmp_1 = false;
|
|
397
416
|
}
|
|
@@ -399,11 +418,11 @@
|
|
|
399
418
|
tmp$ret$1 = true;
|
|
400
419
|
break $l$block_0;
|
|
401
420
|
}
|
|
402
|
-
var _iterator__ex2g4s = tmp0.
|
|
403
|
-
while (_iterator__ex2g4s.
|
|
404
|
-
var element = _iterator__ex2g4s.
|
|
421
|
+
var _iterator__ex2g4s = tmp0.n();
|
|
422
|
+
while (_iterator__ex2g4s.q()) {
|
|
423
|
+
var element = _iterator__ex2g4s.r();
|
|
405
424
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
406
|
-
if (!checkIntervention($this, request, element, supports, effect).
|
|
425
|
+
if (!checkIntervention($this, request, element, supports, effect).h()) {
|
|
407
426
|
tmp$ret$1 = false;
|
|
408
427
|
break $l$block_0;
|
|
409
428
|
}
|
|
@@ -420,24 +439,24 @@
|
|
|
420
439
|
}
|
|
421
440
|
function checkCausalityICAIL25($this, request, intervention, effect) {
|
|
422
441
|
var supports = checkBaseTheory($this, request, effect);
|
|
423
|
-
if (supports.
|
|
442
|
+
if (supports.h())
|
|
424
443
|
return false;
|
|
425
444
|
// Inline function 'kotlin.collections.map' call
|
|
426
445
|
var this_0 = checkIntervention($this, request, intervention, supports, effect);
|
|
427
446
|
// Inline function 'kotlin.collections.mapTo' call
|
|
428
447
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
429
|
-
var _iterator__ex2g4s = this_0.
|
|
430
|
-
while (_iterator__ex2g4s.
|
|
431
|
-
var item = _iterator__ex2g4s.
|
|
432
|
-
var tmp$ret$
|
|
433
|
-
destination.
|
|
448
|
+
var _iterator__ex2g4s = this_0.n();
|
|
449
|
+
while (_iterator__ex2g4s.q()) {
|
|
450
|
+
var item = _iterator__ex2g4s.r();
|
|
451
|
+
var tmp$ret$2 = item.c43();
|
|
452
|
+
destination.k(tmp$ret$2);
|
|
434
453
|
}
|
|
435
454
|
var attackers = destination;
|
|
436
455
|
var tmp;
|
|
437
456
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
438
|
-
if (!attackers.
|
|
457
|
+
if (!attackers.h()) {
|
|
439
458
|
var tmp_0;
|
|
440
|
-
if (intervention.
|
|
459
|
+
if (intervention.ny() <= 1) {
|
|
441
460
|
tmp_0 = true;
|
|
442
461
|
} else {
|
|
443
462
|
var tmp0 = getSubsets($this, request, intervention);
|
|
@@ -446,7 +465,7 @@
|
|
|
446
465
|
// Inline function 'kotlin.collections.none' call
|
|
447
466
|
var tmp_1;
|
|
448
467
|
if (isInterface(tmp0, Collection)) {
|
|
449
|
-
tmp_1 = tmp0.
|
|
468
|
+
tmp_1 = tmp0.h();
|
|
450
469
|
} else {
|
|
451
470
|
tmp_1 = false;
|
|
452
471
|
}
|
|
@@ -454,67 +473,67 @@
|
|
|
454
473
|
tmp$ret$4 = true;
|
|
455
474
|
break $l$block_4;
|
|
456
475
|
}
|
|
457
|
-
var _iterator__ex2g4s_0 = tmp0.
|
|
458
|
-
while (_iterator__ex2g4s_0.
|
|
459
|
-
var element = _iterator__ex2g4s_0.
|
|
476
|
+
var _iterator__ex2g4s_0 = tmp0.n();
|
|
477
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
478
|
+
var element = _iterator__ex2g4s_0.r();
|
|
460
479
|
// Inline function 'kotlin.collections.map' call
|
|
461
480
|
var this_1 = checkIntervention($this, request, element, supports, effect);
|
|
462
481
|
// Inline function 'kotlin.collections.mapTo' call
|
|
463
482
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
464
|
-
var _iterator__ex2g4s_1 = this_1.
|
|
465
|
-
while (_iterator__ex2g4s_1.
|
|
466
|
-
var item_0 = _iterator__ex2g4s_1.
|
|
467
|
-
var tmp$ret$
|
|
468
|
-
destination_0.
|
|
483
|
+
var _iterator__ex2g4s_1 = this_1.n();
|
|
484
|
+
while (_iterator__ex2g4s_1.q()) {
|
|
485
|
+
var item_0 = _iterator__ex2g4s_1.r();
|
|
486
|
+
var tmp$ret$8 = item_0.c43();
|
|
487
|
+
destination_0.k(tmp$ret$8);
|
|
469
488
|
}
|
|
470
489
|
var n = destination_0;
|
|
471
|
-
var tmp$ret$
|
|
490
|
+
var tmp$ret$9;
|
|
472
491
|
$l$block_3: {
|
|
473
492
|
// Inline function 'kotlin.collections.all' call
|
|
474
493
|
var tmp_2;
|
|
475
494
|
if (isInterface(attackers, Collection)) {
|
|
476
|
-
tmp_2 = attackers.
|
|
495
|
+
tmp_2 = attackers.h();
|
|
477
496
|
} else {
|
|
478
497
|
tmp_2 = false;
|
|
479
498
|
}
|
|
480
499
|
if (tmp_2) {
|
|
481
|
-
tmp$ret$
|
|
500
|
+
tmp$ret$9 = true;
|
|
482
501
|
break $l$block_3;
|
|
483
502
|
}
|
|
484
|
-
var _iterator__ex2g4s_2 = attackers.
|
|
485
|
-
while (_iterator__ex2g4s_2.
|
|
486
|
-
var element_0 = _iterator__ex2g4s_2.
|
|
487
|
-
var tmp$ret$
|
|
503
|
+
var _iterator__ex2g4s_2 = attackers.n();
|
|
504
|
+
while (_iterator__ex2g4s_2.q()) {
|
|
505
|
+
var element_0 = _iterator__ex2g4s_2.r();
|
|
506
|
+
var tmp$ret$11;
|
|
488
507
|
$l$block_2: {
|
|
489
508
|
// Inline function 'kotlin.collections.any' call
|
|
490
509
|
var tmp_3;
|
|
491
510
|
if (isInterface(n, Collection)) {
|
|
492
|
-
tmp_3 = n.
|
|
511
|
+
tmp_3 = n.h();
|
|
493
512
|
} else {
|
|
494
513
|
tmp_3 = false;
|
|
495
514
|
}
|
|
496
515
|
if (tmp_3) {
|
|
497
|
-
tmp$ret$
|
|
516
|
+
tmp$ret$11 = false;
|
|
498
517
|
break $l$block_2;
|
|
499
518
|
}
|
|
500
|
-
var _iterator__ex2g4s_3 = n.
|
|
501
|
-
while (_iterator__ex2g4s_3.
|
|
502
|
-
var element_1 = _iterator__ex2g4s_3.
|
|
503
|
-
if (Companion_getInstance_0().
|
|
504
|
-
tmp$ret$
|
|
519
|
+
var _iterator__ex2g4s_3 = n.n();
|
|
520
|
+
while (_iterator__ex2g4s_3.q()) {
|
|
521
|
+
var element_1 = _iterator__ex2g4s_3.r();
|
|
522
|
+
if (Companion_getInstance_0().g1m().match(element_0, element_1)) {
|
|
523
|
+
tmp$ret$11 = true;
|
|
505
524
|
break $l$block_2;
|
|
506
525
|
}
|
|
507
526
|
}
|
|
508
|
-
tmp$ret$
|
|
527
|
+
tmp$ret$11 = false;
|
|
509
528
|
}
|
|
510
|
-
if (!tmp$ret$
|
|
511
|
-
tmp$ret$
|
|
529
|
+
if (!tmp$ret$11) {
|
|
530
|
+
tmp$ret$9 = false;
|
|
512
531
|
break $l$block_3;
|
|
513
532
|
}
|
|
514
533
|
}
|
|
515
|
-
tmp$ret$
|
|
534
|
+
tmp$ret$9 = true;
|
|
516
535
|
}
|
|
517
|
-
if (tmp$ret$
|
|
536
|
+
if (tmp$ret$9) {
|
|
518
537
|
tmp$ret$4 = false;
|
|
519
538
|
break $l$block_4;
|
|
520
539
|
}
|
|
@@ -532,209 +551,209 @@
|
|
|
532
551
|
function checkButFor($this, request, intervention, effect) {
|
|
533
552
|
var tmp;
|
|
534
553
|
// Inline function 'kotlin.let' call
|
|
535
|
-
var tmp0 = solveFresh($this, effect, request.context.
|
|
536
|
-
var tmp$ret$
|
|
554
|
+
var tmp0 = solveFresh($this, effect, request.context.n1w()).t43_1;
|
|
555
|
+
var tmp$ret$2;
|
|
537
556
|
$l$block_0: {
|
|
538
557
|
// Inline function 'kotlin.collections.any' call
|
|
539
558
|
var tmp_0;
|
|
540
559
|
if (isInterface(tmp0, Collection)) {
|
|
541
|
-
tmp_0 = tmp0.
|
|
560
|
+
tmp_0 = tmp0.h();
|
|
542
561
|
} else {
|
|
543
562
|
tmp_0 = false;
|
|
544
563
|
}
|
|
545
564
|
if (tmp_0) {
|
|
546
|
-
tmp$ret$
|
|
565
|
+
tmp$ret$2 = false;
|
|
547
566
|
break $l$block_0;
|
|
548
567
|
}
|
|
549
|
-
var _iterator__ex2g4s = tmp0.
|
|
550
|
-
while (_iterator__ex2g4s.
|
|
551
|
-
var element = _iterator__ex2g4s.
|
|
552
|
-
if (element.
|
|
553
|
-
tmp$ret$
|
|
568
|
+
var _iterator__ex2g4s = tmp0.n();
|
|
569
|
+
while (_iterator__ex2g4s.q()) {
|
|
570
|
+
var element = _iterator__ex2g4s.r();
|
|
571
|
+
if (element.p43_1 === 'in' && equalTerms($this, element.o43_1.u42_1, effect)) {
|
|
572
|
+
tmp$ret$2 = true;
|
|
554
573
|
break $l$block_0;
|
|
555
574
|
}
|
|
556
575
|
}
|
|
557
|
-
tmp$ret$
|
|
576
|
+
tmp$ret$2 = false;
|
|
558
577
|
}
|
|
559
|
-
if (tmp$ret$
|
|
578
|
+
if (tmp$ret$2) {
|
|
560
579
|
// Inline function 'kotlin.collections.map' call
|
|
561
580
|
var this_0 = intervention.toList();
|
|
562
581
|
// Inline function 'kotlin.collections.mapTo' call
|
|
563
582
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
564
|
-
var _iterator__ex2g4s_0 = this_0.
|
|
565
|
-
while (_iterator__ex2g4s_0.
|
|
566
|
-
var item = _iterator__ex2g4s_0.
|
|
567
|
-
var tmp$ret$
|
|
568
|
-
destination.
|
|
583
|
+
var _iterator__ex2g4s_0 = this_0.n();
|
|
584
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
585
|
+
var item = _iterator__ex2g4s_0.r();
|
|
586
|
+
var tmp$ret$6 = Companion_getInstance_2().of(parseStruct(Companion_getInstance_1(), ':->(fk' + new UInt(nextUInt(Default_getInstance())) + ', ' + item.toString() + ')'), []);
|
|
587
|
+
destination.k(tmp$ret$6);
|
|
569
588
|
}
|
|
570
589
|
// Inline function 'kotlin.let' call
|
|
571
590
|
// Inline function 'kotlin.let' call
|
|
572
|
-
var tmp0_0 = solveFresh($this, effect, request.context.
|
|
573
|
-
var tmp$ret$
|
|
591
|
+
var tmp0_0 = solveFresh($this, effect, request.context.n1w().plusTheory(Companion_instance_1.ofIterableWithDefaultUnificator(destination))).t43_1;
|
|
592
|
+
var tmp$ret$11;
|
|
574
593
|
$l$block_2: {
|
|
575
594
|
// Inline function 'kotlin.collections.none' call
|
|
576
595
|
var tmp_1;
|
|
577
596
|
if (isInterface(tmp0_0, Collection)) {
|
|
578
|
-
tmp_1 = tmp0_0.
|
|
597
|
+
tmp_1 = tmp0_0.h();
|
|
579
598
|
} else {
|
|
580
599
|
tmp_1 = false;
|
|
581
600
|
}
|
|
582
601
|
if (tmp_1) {
|
|
583
|
-
tmp$ret$
|
|
602
|
+
tmp$ret$11 = true;
|
|
584
603
|
break $l$block_2;
|
|
585
604
|
}
|
|
586
|
-
var _iterator__ex2g4s_1 = tmp0_0.
|
|
587
|
-
while (_iterator__ex2g4s_1.
|
|
588
|
-
var element_0 = _iterator__ex2g4s_1.
|
|
589
|
-
if (element_0.
|
|
590
|
-
tmp$ret$
|
|
605
|
+
var _iterator__ex2g4s_1 = tmp0_0.n();
|
|
606
|
+
while (_iterator__ex2g4s_1.q()) {
|
|
607
|
+
var element_0 = _iterator__ex2g4s_1.r();
|
|
608
|
+
if (element_0.p43_1 === 'in' && equalTerms($this, element_0.o43_1.u42_1, effect)) {
|
|
609
|
+
tmp$ret$11 = false;
|
|
591
610
|
break $l$block_2;
|
|
592
611
|
}
|
|
593
612
|
}
|
|
594
|
-
tmp$ret$
|
|
613
|
+
tmp$ret$11 = true;
|
|
595
614
|
}
|
|
596
|
-
tmp = tmp$ret$
|
|
615
|
+
tmp = tmp$ret$11;
|
|
597
616
|
} else {
|
|
598
617
|
tmp = false;
|
|
599
618
|
}
|
|
600
619
|
return tmp;
|
|
601
620
|
}
|
|
602
621
|
function CausalityCheckCauseButFor($outer) {
|
|
603
|
-
this.
|
|
604
|
-
this.
|
|
622
|
+
this.g47_1 = $outer;
|
|
623
|
+
this.f47_1 = new Signature('but_for', 2);
|
|
605
624
|
}
|
|
606
|
-
protoOf(CausalityCheckCauseButFor).
|
|
607
|
-
return this.
|
|
625
|
+
protoOf(CausalityCheckCauseButFor).y1v = function () {
|
|
626
|
+
return this.f47_1;
|
|
608
627
|
};
|
|
609
|
-
protoOf(CausalityCheckCauseButFor).
|
|
610
|
-
var cause = request.arguments.
|
|
611
|
-
var effect = this.
|
|
612
|
-
return sequenceOf(request.replyWithCondition(arg2pScope(CausalitySolver$CausalityCheckCauseButFor$solve$lambda(request, cause, this.
|
|
628
|
+
protoOf(CausalityCheckCauseButFor).s2h = function (request) {
|
|
629
|
+
var cause = request.arguments.u(0);
|
|
630
|
+
var effect = this.g47_1.h47(request.arguments.u(1).toString());
|
|
631
|
+
return sequenceOf(request.replyWithCondition(arg2pScope(CausalitySolver$CausalityCheckCauseButFor$solve$lambda(request, cause, this.g47_1, effect)), VOID, []));
|
|
613
632
|
};
|
|
614
633
|
protoOf(CausalityCheckCauseButFor).solve = function (request) {
|
|
615
|
-
return this.
|
|
634
|
+
return this.s2h(request);
|
|
616
635
|
};
|
|
617
636
|
function CausalityCheckInterventionICAIL24($outer) {
|
|
618
|
-
this.
|
|
619
|
-
this.
|
|
637
|
+
this.j47_1 = $outer;
|
|
638
|
+
this.i47_1 = new Signature('ness_original_intervention', 2);
|
|
620
639
|
}
|
|
621
|
-
protoOf(CausalityCheckInterventionICAIL24).
|
|
622
|
-
return this.
|
|
640
|
+
protoOf(CausalityCheckInterventionICAIL24).y1v = function () {
|
|
641
|
+
return this.i47_1;
|
|
623
642
|
};
|
|
624
|
-
protoOf(CausalityCheckInterventionICAIL24).
|
|
625
|
-
var intervention = request.arguments.
|
|
626
|
-
var effect = this.
|
|
627
|
-
return sequenceOf(request.replyWithCondition(checkCausalityICAIL24(this.
|
|
643
|
+
protoOf(CausalityCheckInterventionICAIL24).s2h = function (request) {
|
|
644
|
+
var intervention = request.arguments.u(0).castToList();
|
|
645
|
+
var effect = this.j47_1.h47(request.arguments.u(1).toString());
|
|
646
|
+
return sequenceOf(request.replyWithCondition(checkCausalityICAIL24(this.j47_1, request, intervention, effect), VOID, []));
|
|
628
647
|
};
|
|
629
648
|
protoOf(CausalityCheckInterventionICAIL24).solve = function (request) {
|
|
630
|
-
return this.
|
|
649
|
+
return this.s2h(request);
|
|
631
650
|
};
|
|
632
651
|
function CausalityCheckCauseICAIL24($outer) {
|
|
633
|
-
this.
|
|
634
|
-
this.
|
|
652
|
+
this.l47_1 = $outer;
|
|
653
|
+
this.k47_1 = new Signature('ness_original', 3);
|
|
635
654
|
}
|
|
636
|
-
protoOf(CausalityCheckCauseICAIL24).
|
|
637
|
-
return this.
|
|
655
|
+
protoOf(CausalityCheckCauseICAIL24).y1v = function () {
|
|
656
|
+
return this.k47_1;
|
|
638
657
|
};
|
|
639
|
-
protoOf(CausalityCheckCauseICAIL24).
|
|
640
|
-
var intervention = request.arguments.
|
|
641
|
-
var cause = request.arguments.
|
|
642
|
-
var effect = this.
|
|
658
|
+
protoOf(CausalityCheckCauseICAIL24).s2h = function (request) {
|
|
659
|
+
var intervention = request.arguments.u(0);
|
|
660
|
+
var cause = request.arguments.u(1);
|
|
661
|
+
var effect = this.l47_1.h47(request.arguments.u(2).toString());
|
|
643
662
|
if (!isInterface(intervention, Var)) {
|
|
644
663
|
throw Companion_instance_2.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
|
|
645
664
|
}
|
|
646
|
-
var tmp = getInterventions(this.
|
|
647
|
-
var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda(this.
|
|
665
|
+
var tmp = getInterventions(this.l47_1, request, cause, effect);
|
|
666
|
+
var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda(this.l47_1, request, effect));
|
|
648
667
|
var tmp0_elvis_lhs = firstOrNull(map(tmp_0, CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda_0(intervention)));
|
|
649
668
|
return sequenceOf(request.replyWith(tmp0_elvis_lhs == null ? Companion_getInstance().failed() : tmp0_elvis_lhs, VOID, []));
|
|
650
669
|
};
|
|
651
670
|
protoOf(CausalityCheckCauseICAIL24).solve = function (request) {
|
|
652
|
-
return this.
|
|
671
|
+
return this.s2h(request);
|
|
653
672
|
};
|
|
654
673
|
function CausalityCheckInterventionICAIL25($outer) {
|
|
655
|
-
this.
|
|
656
|
-
this.
|
|
674
|
+
this.n47_1 = $outer;
|
|
675
|
+
this.m47_1 = new Signature('ness_intervention', 2);
|
|
657
676
|
}
|
|
658
|
-
protoOf(CausalityCheckInterventionICAIL25).
|
|
659
|
-
return this.
|
|
677
|
+
protoOf(CausalityCheckInterventionICAIL25).y1v = function () {
|
|
678
|
+
return this.m47_1;
|
|
660
679
|
};
|
|
661
|
-
protoOf(CausalityCheckInterventionICAIL25).
|
|
662
|
-
var intervention = request.arguments.
|
|
663
|
-
var effect = this.
|
|
664
|
-
return sequenceOf(request.replyWithCondition(checkCausalityICAIL25(this.
|
|
680
|
+
protoOf(CausalityCheckInterventionICAIL25).s2h = function (request) {
|
|
681
|
+
var intervention = request.arguments.u(0).castToList();
|
|
682
|
+
var effect = this.n47_1.h47(request.arguments.u(1).toString());
|
|
683
|
+
return sequenceOf(request.replyWithCondition(checkCausalityICAIL25(this.n47_1, request, intervention, effect), VOID, []));
|
|
665
684
|
};
|
|
666
685
|
protoOf(CausalityCheckInterventionICAIL25).solve = function (request) {
|
|
667
|
-
return this.
|
|
686
|
+
return this.s2h(request);
|
|
668
687
|
};
|
|
669
688
|
function CausalityCheckCauseICAIL25($outer) {
|
|
670
|
-
this.
|
|
671
|
-
this.
|
|
689
|
+
this.p47_1 = $outer;
|
|
690
|
+
this.o47_1 = new Signature('ness', 3);
|
|
672
691
|
}
|
|
673
|
-
protoOf(CausalityCheckCauseICAIL25).
|
|
674
|
-
return this.
|
|
692
|
+
protoOf(CausalityCheckCauseICAIL25).y1v = function () {
|
|
693
|
+
return this.o47_1;
|
|
675
694
|
};
|
|
676
|
-
protoOf(CausalityCheckCauseICAIL25).
|
|
677
|
-
var intervention = request.arguments.
|
|
678
|
-
var cause = request.arguments.
|
|
679
|
-
var effect = this.
|
|
695
|
+
protoOf(CausalityCheckCauseICAIL25).s2h = function (request) {
|
|
696
|
+
var intervention = request.arguments.u(0);
|
|
697
|
+
var cause = request.arguments.u(1);
|
|
698
|
+
var effect = this.p47_1.h47(request.arguments.u(2).toString());
|
|
680
699
|
if (!isInterface(intervention, Var)) {
|
|
681
700
|
throw Companion_instance_2.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
|
|
682
701
|
}
|
|
683
|
-
var tmp = getInterventions(this.
|
|
684
|
-
var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda(this.
|
|
702
|
+
var tmp = getInterventions(this.p47_1, request, cause, effect);
|
|
703
|
+
var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda(this.p47_1, request, effect));
|
|
685
704
|
var tmp0_elvis_lhs = firstOrNull(map(tmp_0, CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda_0(intervention)));
|
|
686
705
|
return sequenceOf(request.replyWith(tmp0_elvis_lhs == null ? Companion_getInstance().failed() : tmp0_elvis_lhs, VOID, []));
|
|
687
706
|
};
|
|
688
707
|
protoOf(CausalityCheckCauseICAIL25).solve = function (request) {
|
|
689
|
-
return this.
|
|
708
|
+
return this.s2h(request);
|
|
690
709
|
};
|
|
691
710
|
function CausalitySolver$solveFresh$lambda(this$0) {
|
|
692
711
|
return function (it) {
|
|
693
|
-
return mineActiveGraph(this$0.
|
|
712
|
+
return mineActiveGraph(this$0.a47_1);
|
|
694
713
|
};
|
|
695
714
|
}
|
|
696
715
|
function CausalitySolver$getSupports$lambda(this$0, $effect) {
|
|
697
716
|
return function (it) {
|
|
698
|
-
return equalTerms(this$0, it.
|
|
717
|
+
return equalTerms(this$0, it.o43_1.u42_1, $effect);
|
|
699
718
|
};
|
|
700
719
|
}
|
|
701
720
|
function CausalitySolver$getSupports$lambda_0(this$0, $graph) {
|
|
702
721
|
return function (it) {
|
|
703
|
-
return supporters(this$0, it.
|
|
722
|
+
return supporters(this$0, it.o43_1, $graph, emptyList());
|
|
704
723
|
};
|
|
705
724
|
}
|
|
706
725
|
function CausalitySolver$getSupports$lambda_1(it) {
|
|
707
|
-
return it.
|
|
726
|
+
return it.o43_1;
|
|
708
727
|
}
|
|
709
728
|
function CausalitySolver$checkBaseTheory$lambda(a) {
|
|
710
|
-
return a.
|
|
729
|
+
return a.c43();
|
|
711
730
|
}
|
|
712
731
|
function CausalitySolver$getSubsets$lambda$lambda(it) {
|
|
713
|
-
return it.
|
|
732
|
+
return it.p1x();
|
|
714
733
|
}
|
|
715
734
|
function CausalitySolver$getSubsets$lambda$lambda_0($this_arg2pScope) {
|
|
716
735
|
return function (it) {
|
|
717
|
-
return ensureNotNull(it.
|
|
736
|
+
return ensureNotNull(it.h1w().i2($this_arg2pScope.d1i())).castToList();
|
|
718
737
|
};
|
|
719
738
|
}
|
|
720
739
|
function CausalitySolver$getSubsets$lambda($request, $intervention) {
|
|
721
740
|
return function ($this$arg2pScope) {
|
|
722
|
-
var tmp = $request.solve($this$arg2pScope.stringInvoke('proper_subsets', $intervention, [$this$arg2pScope.
|
|
741
|
+
var tmp = $request.solve($this$arg2pScope.stringInvoke('proper_subsets', $intervention, [$this$arg2pScope.d1i()]));
|
|
723
742
|
var tmp_0 = filter(tmp, CausalitySolver$getSubsets$lambda$lambda);
|
|
724
743
|
return toList(map(tmp_0, CausalitySolver$getSubsets$lambda$lambda_0($this$arg2pScope)));
|
|
725
744
|
};
|
|
726
745
|
}
|
|
727
746
|
function CausalitySolver$getInterventions$lambda$lambda(it) {
|
|
728
|
-
return it.
|
|
747
|
+
return it.p1x();
|
|
729
748
|
}
|
|
730
749
|
function CausalitySolver$getInterventions$lambda$lambda_0($this_arg2pScope) {
|
|
731
750
|
return function (it) {
|
|
732
|
-
return ensureNotNull(it.
|
|
751
|
+
return ensureNotNull(it.h1w().i2($this_arg2pScope.d1i())).castToList();
|
|
733
752
|
};
|
|
734
753
|
}
|
|
735
754
|
function CausalitySolver$getInterventions$lambda($request, $rules, $cause) {
|
|
736
755
|
return function ($this$arg2pScope) {
|
|
737
|
-
var tmp = $request.solve($this$arg2pScope.stringInvoke('generate_interventions', $rules, [$cause, $this$arg2pScope.
|
|
756
|
+
var tmp = $request.solve($this$arg2pScope.stringInvoke('generate_interventions', $rules, [$cause, $this$arg2pScope.d1i()]));
|
|
738
757
|
var tmp_0 = filter(tmp, CausalitySolver$getInterventions$lambda$lambda);
|
|
739
758
|
return map(tmp_0, CausalitySolver$getInterventions$lambda$lambda_0($this$arg2pScope));
|
|
740
759
|
};
|
|
@@ -743,41 +762,44 @@
|
|
|
743
762
|
var tmp = this;
|
|
744
763
|
var tmp_0 = Arg2pSolverFactory_instance;
|
|
745
764
|
var tmp0_graphExtensions = emptyList();
|
|
746
|
-
tmp.
|
|
747
|
-
this.
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
765
|
+
tmp.a47_1 = tmp_0.c3q(VOID, (new FlagsBuilder(VOID, VOID, VOID, VOID, VOID, 'grounded', VOID, VOID, VOID, VOID, tmp0_graphExtensions)).o3q());
|
|
766
|
+
this.b47_1 = Companion_instance_3.y3p().v3p();
|
|
767
|
+
var tmp_1 = this;
|
|
768
|
+
// Inline function 'kotlin.collections.mutableMapOf' call
|
|
769
|
+
tmp_1.c47_1 = LinkedHashMap_init_$Create$();
|
|
770
|
+
this.d47_1 = 'prolog.argumentation.causality.solver';
|
|
771
|
+
this.e47_1 = Companion_instance_4.v3p().plusOperatorSet(Companion_instance_5.v3p()).plusOperatorSet(Companion_getInstance_3().DEFAULT);
|
|
772
|
+
}
|
|
773
|
+
protoOf(CausalitySolver).h47 = function (string) {
|
|
752
774
|
return replace(replace(string, ' ', ''), "'", '');
|
|
753
775
|
};
|
|
754
|
-
protoOf(CausalitySolver).
|
|
755
|
-
return this.
|
|
776
|
+
protoOf(CausalitySolver).k2f = function () {
|
|
777
|
+
return this.d47_1;
|
|
756
778
|
};
|
|
757
|
-
protoOf(CausalitySolver).
|
|
779
|
+
protoOf(CausalitySolver).q3q = function () {
|
|
758
780
|
// Inline function 'kotlin.let' call
|
|
759
781
|
var primitives = listOf([new CausalityCheckInterventionICAIL24(this), new CausalityCheckCauseICAIL24(this), new CausalityCheckInterventionICAIL25(this), new CausalityCheckCauseICAIL25(this), new CausalityCheckCauseButFor(this)]);
|
|
760
782
|
var tmp = Companion_getInstance_4();
|
|
761
783
|
// Inline function 'kotlin.collections.associateBy' call
|
|
762
784
|
var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(primitives, 10)), 16);
|
|
763
785
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
764
|
-
var destination = LinkedHashMap_init_$Create$(capacity);
|
|
765
|
-
var _iterator__ex2g4s = primitives.
|
|
766
|
-
while (_iterator__ex2g4s.
|
|
767
|
-
var element = _iterator__ex2g4s.
|
|
768
|
-
var tmp$ret$
|
|
769
|
-
destination.
|
|
786
|
+
var destination = LinkedHashMap_init_$Create$_0(capacity);
|
|
787
|
+
var _iterator__ex2g4s = primitives.n();
|
|
788
|
+
while (_iterator__ex2g4s.q()) {
|
|
789
|
+
var element = _iterator__ex2g4s.r();
|
|
790
|
+
var tmp$ret$4 = element.y1v();
|
|
791
|
+
destination.l4(tmp$ret$4, element);
|
|
770
792
|
}
|
|
771
|
-
return tmp.of(this.
|
|
793
|
+
return tmp.of(this.d47_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.e47_1));
|
|
772
794
|
};
|
|
773
|
-
protoOf(CausalitySolver).
|
|
795
|
+
protoOf(CausalitySolver).r3q = function () {
|
|
774
796
|
return 'causality';
|
|
775
797
|
};
|
|
776
|
-
protoOf(CausalitySolver).
|
|
777
|
-
return this.
|
|
798
|
+
protoOf(CausalitySolver).a3q = function () {
|
|
799
|
+
return this.e47_1;
|
|
778
800
|
};
|
|
779
801
|
//region block: post-declaration
|
|
780
|
-
protoOf(CausalitySolver).
|
|
802
|
+
protoOf(CausalitySolver).z3p = content;
|
|
781
803
|
//endregion
|
|
782
804
|
//region block: exports
|
|
783
805
|
_.$_$ = _.$_$ || {};
|