@tuprolog/arg2p 0.14.2 → 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 +172 -171
- 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 +571 -265
- 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 +2965 -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
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(function (factory) {
|
|
2
2
|
if (typeof define === 'function' && define.amd)
|
|
3
|
-
define(['exports', './
|
|
3
|
+
define(['exports', './2p-core.js', './kotlin-kotlin-stdlib.js', './2p-unify.js', './2p-parser-core.js', './2p-theory.js', './2p-parser-theory.js', './arg2p-core.js', './2p-solve.js'], factory);
|
|
4
4
|
else if (typeof exports === 'object')
|
|
5
|
-
factory(module.exports, require('./
|
|
5
|
+
factory(module.exports, require('./2p-core.js'), require('./kotlin-kotlin-stdlib.js'), require('./2p-unify.js'), require('./2p-parser-core.js'), require('./2p-theory.js'), require('./2p-parser-theory.js'), require('./arg2p-core.js'), require('./2p-solve.js'));
|
|
6
6
|
else {
|
|
7
|
-
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
8
|
-
throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'arg2p-causality-solver'.");
|
|
9
|
-
}
|
|
10
7
|
if (typeof globalThis['2p-core'] === 'undefined') {
|
|
11
8
|
throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency '2p-core' was not found. Please, check whether '2p-core' is loaded prior to 'arg2p-causality-solver'.");
|
|
12
9
|
}
|
|
10
|
+
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
11
|
+
throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'arg2p-causality-solver'.");
|
|
12
|
+
}
|
|
13
13
|
if (typeof globalThis['2p-unify'] === 'undefined') {
|
|
14
14
|
throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency '2p-unify' was not found. Please, check whether '2p-unify' is loaded prior to 'arg2p-causality-solver'.");
|
|
15
15
|
}
|
|
@@ -28,159 +28,180 @@
|
|
|
28
28
|
if (typeof globalThis['2p-solve'] === 'undefined') {
|
|
29
29
|
throw new Error("Error loading module 'arg2p-causality-solver'. Its dependency '2p-solve' was not found. Please, check whether '2p-solve' is loaded prior to 'arg2p-causality-solver'.");
|
|
30
30
|
}
|
|
31
|
-
globalThis['arg2p-causality-solver'] = factory(typeof globalThis['arg2p-causality-solver'] === 'undefined' ? {} : globalThis['arg2p-causality-solver'], globalThis['
|
|
31
|
+
globalThis['arg2p-causality-solver'] = factory(typeof globalThis['arg2p-causality-solver'] === 'undefined' ? {} : globalThis['arg2p-causality-solver'], globalThis['2p-core'], globalThis['kotlin-kotlin-stdlib'], globalThis['2p-unify'], globalThis['2p-parser-core'], globalThis['2p-theory'], globalThis['2p-parser-theory'], globalThis['arg2p-core'], globalThis['2p-solve']);
|
|
32
32
|
}
|
|
33
|
-
}(function (_,
|
|
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
|
|
37
|
-
var
|
|
38
|
-
var filter = kotlin_kotlin.$_$.
|
|
39
|
-
var map = kotlin_kotlin.$_$.
|
|
40
|
-
var firstOrNull = kotlin_kotlin.$_$.
|
|
41
|
-
var
|
|
42
|
-
var
|
|
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;
|
|
43
44
|
var parseTerm = kotlin_it_unibo_tuprolog_parser_core.$_$.e;
|
|
44
|
-
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.
|
|
45
|
-
var Unit_instance = kotlin_kotlin.$_$.
|
|
46
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.
|
|
47
|
-
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.
|
|
48
|
-
var plus = kotlin_kotlin.$_$.
|
|
49
|
-
var addAll = kotlin_kotlin.$_$.
|
|
50
|
-
var plus_0 = kotlin_kotlin.$_$.
|
|
51
|
-
var emptyList = kotlin_kotlin.$_$.
|
|
52
|
-
var
|
|
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;
|
|
54
|
+
var Companion_instance_1 = kotlin_it_unibo_tuprolog_theory.$_$.b;
|
|
53
55
|
var parseTheoryWithOperators = kotlin_it_unibo_tuprolog_parser_theory.$_$.b;
|
|
54
|
-
var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.
|
|
56
|
+
var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.n;
|
|
55
57
|
var parseStruct = kotlin_it_unibo_tuprolog_parser_core.$_$.d;
|
|
56
58
|
var Graph = kotlin_it_unibo_tuprolog_argumentation_core.$_$.l;
|
|
57
|
-
var asSequence = kotlin_kotlin.$_$.
|
|
58
|
-
var flatMap = kotlin_kotlin.$_$.
|
|
59
|
-
var toList = kotlin_kotlin.$_$.
|
|
60
|
-
var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var Collection = kotlin_kotlin.$_$.m1;
|
|
65
|
-
var isInterface = kotlin_kotlin.$_$.h6;
|
|
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;
|
|
66
66
|
var arg2pScope = kotlin_it_unibo_tuprolog_argumentation_core.$_$.e;
|
|
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;
|
|
67
72
|
var Signature = kotlin_it_unibo_tuprolog_solve.$_$.u2;
|
|
68
|
-
var protoOf = kotlin_kotlin.$_$.
|
|
73
|
+
var protoOf = kotlin_kotlin.$_$.f7;
|
|
69
74
|
var VOID = kotlin_kotlin.$_$.b;
|
|
70
|
-
var sequenceOf = kotlin_kotlin.$_$.
|
|
75
|
+
var sequenceOf = kotlin_kotlin.$_$.g9;
|
|
71
76
|
var Primitive = kotlin_it_unibo_tuprolog_solve.$_$.w1;
|
|
72
|
-
var initMetadataForClass = kotlin_kotlin.$_$.
|
|
73
|
-
var
|
|
74
|
-
var Expected_VARIABLE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.
|
|
75
|
-
var Var = kotlin_it_unibo_tuprolog_core.$_$.
|
|
76
|
-
var toList_0 = kotlin_kotlin.$_$.f4;
|
|
77
|
-
var toString = kotlin_kotlin.$_$.q6;
|
|
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;
|
|
78
81
|
var mineActiveGraph = kotlin_it_unibo_tuprolog_argumentation_core.$_$.k;
|
|
79
82
|
var Arg2pSolverFactory_instance = kotlin_it_unibo_tuprolog_argumentation_core.$_$.d;
|
|
80
83
|
var FlagsBuilder = kotlin_it_unibo_tuprolog_argumentation_core.$_$.f;
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
var Companion_instance_4 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
var
|
|
90
|
-
var
|
|
84
|
+
var Companion_instance_3 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.c;
|
|
85
|
+
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.s;
|
|
86
|
+
var Companion_instance_4 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.a;
|
|
87
|
+
var Companion_instance_5 = kotlin_it_unibo_tuprolog_argumentation_core.$_$.b;
|
|
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;
|
|
91
95
|
var content = kotlin_it_unibo_tuprolog_argumentation_core.$_$.g;
|
|
92
96
|
var ArgLibrary = kotlin_it_unibo_tuprolog_argumentation_core.$_$.h;
|
|
93
97
|
var Loadable = kotlin_it_unibo_tuprolog_argumentation_core.$_$.i;
|
|
94
98
|
//endregion
|
|
95
99
|
//region block: pre-declaration
|
|
96
|
-
initMetadataForClass(
|
|
97
|
-
initMetadataForClass(
|
|
100
|
+
initMetadataForClass(CausalityCheckCauseButFor, 'CausalityCheckCauseButFor', VOID, VOID, [Primitive]);
|
|
101
|
+
initMetadataForClass(CausalityCheckInterventionICAIL24, 'CausalityCheckInterventionICAIL24', VOID, VOID, [Primitive]);
|
|
102
|
+
initMetadataForClass(CausalityCheckCauseICAIL24, 'CausalityCheckCauseICAIL24', VOID, VOID, [Primitive]);
|
|
103
|
+
initMetadataForClass(CausalityCheckInterventionICAIL25, 'CausalityCheckInterventionICAIL25', VOID, VOID, [Primitive]);
|
|
104
|
+
initMetadataForClass(CausalityCheckCauseICAIL25, 'CausalityCheckCauseICAIL25', VOID, VOID, [Primitive]);
|
|
98
105
|
initMetadataForClass(CausalitySolver, 'CausalitySolver', CausalitySolver, VOID, [ArgLibrary, Loadable]);
|
|
99
106
|
//endregion
|
|
100
|
-
function CausalitySolver$
|
|
101
|
-
return it.
|
|
107
|
+
function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda(it) {
|
|
108
|
+
return it.p1x();
|
|
109
|
+
}
|
|
110
|
+
function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_0($this_arg2pScope) {
|
|
111
|
+
return function (it) {
|
|
112
|
+
return Companion_instance.of([ensureNotNull(it.h1w().i2($this_arg2pScope.d1i()))]);
|
|
113
|
+
};
|
|
102
114
|
}
|
|
103
|
-
function CausalitySolver$
|
|
115
|
+
function CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_1(this$0, $request, $effect) {
|
|
104
116
|
return function (it) {
|
|
105
|
-
return
|
|
117
|
+
return checkButFor(this$0, $request, it, $effect);
|
|
106
118
|
};
|
|
107
119
|
}
|
|
108
|
-
function CausalitySolver$
|
|
120
|
+
function CausalitySolver$CausalityCheckCauseButFor$solve$lambda($request, $cause, this$0, $effect) {
|
|
121
|
+
return function ($this$arg2pScope) {
|
|
122
|
+
var tmp = $request.solve($this$arg2pScope.stringInvoke('compl', $cause, [$this$arg2pScope.d1i()]));
|
|
123
|
+
var tmp_0 = filter(tmp, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda);
|
|
124
|
+
var tmp_1 = map(tmp_0, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_0($this$arg2pScope));
|
|
125
|
+
var tmp0_elvis_lhs = firstOrNull(map(tmp_1, CausalitySolver$CausalityCheckCauseButFor$solve$lambda$lambda_1(this$0, $request, $effect)));
|
|
126
|
+
return tmp0_elvis_lhs == null ? false : tmp0_elvis_lhs;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda(this$0, $request, $effect) {
|
|
109
130
|
return function (it) {
|
|
110
|
-
return
|
|
131
|
+
return checkCausalityICAIL24(this$0, $request, it, $effect);
|
|
111
132
|
};
|
|
112
133
|
}
|
|
113
|
-
function CausalitySolver$
|
|
134
|
+
function CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda_0($intervention) {
|
|
114
135
|
return function (it) {
|
|
115
136
|
return Companion_getInstance().of($intervention, it);
|
|
116
137
|
};
|
|
117
138
|
}
|
|
118
|
-
function CausalitySolver$
|
|
119
|
-
return function (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return
|
|
139
|
+
function CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda(this$0, $request, $effect) {
|
|
140
|
+
return function (it) {
|
|
141
|
+
return checkCausalityICAIL25(this$0, $request, it, $effect);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda_0($intervention) {
|
|
145
|
+
return function (it) {
|
|
146
|
+
return Companion_getInstance().of($intervention, it);
|
|
126
147
|
};
|
|
127
148
|
}
|
|
128
149
|
function equalTerms($this, a, b) {
|
|
129
|
-
return Companion_getInstance_0().
|
|
150
|
+
return Companion_getInstance_0().g1m().match(parseTerm(Companion_instance_0, a), parseTerm(Companion_instance_0, b));
|
|
130
151
|
}
|
|
131
152
|
function attackers($this, x, graph) {
|
|
132
153
|
// Inline function 'kotlin.collections.filter' call
|
|
133
|
-
var tmp0 = graph.
|
|
154
|
+
var tmp0 = graph.r43_1;
|
|
134
155
|
// Inline function 'kotlin.collections.filterTo' call
|
|
135
156
|
var destination = ArrayList_init_$Create$();
|
|
136
|
-
var _iterator__ex2g4s = tmp0.
|
|
137
|
-
while (_iterator__ex2g4s.
|
|
138
|
-
var element = _iterator__ex2g4s.
|
|
139
|
-
if (element.
|
|
140
|
-
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);
|
|
141
162
|
}
|
|
142
163
|
}
|
|
143
164
|
// Inline function 'kotlin.collections.map' call
|
|
144
165
|
// Inline function 'kotlin.collections.mapTo' call
|
|
145
166
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
|
|
146
|
-
var _iterator__ex2g4s_0 = destination.
|
|
147
|
-
while (_iterator__ex2g4s_0.
|
|
148
|
-
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();
|
|
149
170
|
// Inline function 'kotlin.collections.find' call
|
|
150
|
-
var tmp0_0 = graph.
|
|
151
|
-
var tmp$ret$
|
|
171
|
+
var tmp0_0 = graph.t43_1;
|
|
172
|
+
var tmp$ret$7;
|
|
152
173
|
$l$block: {
|
|
153
174
|
// Inline function 'kotlin.collections.firstOrNull' call
|
|
154
|
-
var _iterator__ex2g4s_1 = tmp0_0.
|
|
155
|
-
while (_iterator__ex2g4s_1.
|
|
156
|
-
var element_0 = _iterator__ex2g4s_1.
|
|
157
|
-
if (item.
|
|
158
|
-
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;
|
|
159
180
|
break $l$block;
|
|
160
181
|
}
|
|
161
182
|
}
|
|
162
|
-
tmp$ret$
|
|
183
|
+
tmp$ret$7 = null;
|
|
163
184
|
}
|
|
164
|
-
var tmp$ret$
|
|
165
|
-
var tmp$ret$
|
|
166
|
-
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);
|
|
167
188
|
}
|
|
168
189
|
return destination_0;
|
|
169
190
|
}
|
|
170
191
|
function supporters($this, x, graph, chain) {
|
|
171
192
|
var tmp;
|
|
172
|
-
if (chain.
|
|
193
|
+
if (chain.s(x.a43_1)) {
|
|
173
194
|
tmp = emptyList();
|
|
174
195
|
} else {
|
|
175
196
|
// Inline function 'kotlin.collections.filter' call
|
|
176
|
-
var tmp0 = graph.
|
|
197
|
+
var tmp0 = graph.t43_1;
|
|
177
198
|
// Inline function 'kotlin.collections.filterTo' call
|
|
178
199
|
var destination = ArrayList_init_$Create$();
|
|
179
|
-
var _iterator__ex2g4s = tmp0.
|
|
180
|
-
while (_iterator__ex2g4s.
|
|
181
|
-
var element = _iterator__ex2g4s.
|
|
182
|
-
if (x.
|
|
183
|
-
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);
|
|
184
205
|
}
|
|
185
206
|
}
|
|
186
207
|
var tmp_0 = destination;
|
|
@@ -188,27 +209,27 @@
|
|
|
188
209
|
var tmp0_0 = attackers($this, x, graph);
|
|
189
210
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
190
211
|
var destination_0 = ArrayList_init_$Create$();
|
|
191
|
-
var _iterator__ex2g4s_0 = tmp0_0.
|
|
192
|
-
while (_iterator__ex2g4s_0.
|
|
193
|
-
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();
|
|
194
215
|
// Inline function 'kotlin.collections.filter' call
|
|
195
|
-
var tmp0_1 = attackers($this, element_0.
|
|
216
|
+
var tmp0_1 = attackers($this, element_0.o43_1, graph);
|
|
196
217
|
// Inline function 'kotlin.collections.filterTo' call
|
|
197
218
|
var destination_1 = ArrayList_init_$Create$();
|
|
198
|
-
var _iterator__ex2g4s_1 = tmp0_1.
|
|
199
|
-
while (_iterator__ex2g4s_1.
|
|
200
|
-
var element_1 = _iterator__ex2g4s_1.
|
|
201
|
-
if (!(element_1.
|
|
202
|
-
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);
|
|
203
224
|
}
|
|
204
225
|
}
|
|
205
226
|
// Inline function 'kotlin.collections.flatMap' call
|
|
206
227
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
207
228
|
var destination_2 = ArrayList_init_$Create$();
|
|
208
|
-
var _iterator__ex2g4s_2 = destination_1.
|
|
209
|
-
while (_iterator__ex2g4s_2.
|
|
210
|
-
var element_2 = _iterator__ex2g4s_2.
|
|
211
|
-
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));
|
|
212
233
|
addAll(destination_2, list);
|
|
213
234
|
}
|
|
214
235
|
var list_0 = destination_2;
|
|
@@ -219,21 +240,38 @@
|
|
|
219
240
|
return tmp;
|
|
220
241
|
}
|
|
221
242
|
function solveFresh($this, effect, kb) {
|
|
222
|
-
|
|
223
|
-
$this.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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;
|
|
227
265
|
}
|
|
228
266
|
function getSupports($this, graph, effect) {
|
|
229
|
-
var tmp = asSequence(graph.
|
|
267
|
+
var tmp = asSequence(graph.t43_1);
|
|
230
268
|
var tmp_0 = filter(tmp, CausalitySolver$getSupports$lambda($this, effect));
|
|
231
269
|
var tmp_1 = flatMap(tmp_0, CausalitySolver$getSupports$lambda_0($this, graph));
|
|
232
270
|
return map(tmp_1, CausalitySolver$getSupports$lambda_1);
|
|
233
271
|
}
|
|
234
272
|
function checkBaseTheory($this, request, effect) {
|
|
235
273
|
// Inline function 'kotlin.let' call
|
|
236
|
-
var it = solveFresh($this, effect, request.context.
|
|
274
|
+
var it = solveFresh($this, effect, request.context.n1w());
|
|
237
275
|
var tmp = getSupports($this, it, effect);
|
|
238
276
|
return toList(map(tmp, CausalitySolver$checkBaseTheory$lambda));
|
|
239
277
|
}
|
|
@@ -242,120 +280,267 @@
|
|
|
242
280
|
var this_0 = intervention.toList();
|
|
243
281
|
// Inline function 'kotlin.collections.mapTo' call
|
|
244
282
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
245
|
-
var _iterator__ex2g4s = this_0.
|
|
246
|
-
while (_iterator__ex2g4s.
|
|
247
|
-
var item = _iterator__ex2g4s.
|
|
248
|
-
var tmp$ret$
|
|
249
|
-
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);
|
|
250
288
|
}
|
|
251
289
|
// Inline function 'kotlin.let' call
|
|
252
290
|
// Inline function 'kotlin.let' call
|
|
291
|
+
var naf = solveFresh($this, effect, request.context.n1w().plusTheory(Companion_instance_1.ofIterableWithDefaultUnificator(destination)));
|
|
253
292
|
// Inline function 'kotlin.collections.filter' call
|
|
254
|
-
var tmp0 =
|
|
293
|
+
var tmp0 = naf.t43_1;
|
|
255
294
|
// Inline function 'kotlin.collections.filterTo' call
|
|
256
295
|
var destination_0 = ArrayList_init_$Create$();
|
|
257
|
-
var _iterator__ex2g4s_0 = tmp0.
|
|
258
|
-
while (_iterator__ex2g4s_0.
|
|
259
|
-
var element = _iterator__ex2g4s_0.
|
|
260
|
-
if (element.
|
|
261
|
-
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);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
// Inline function 'kotlin.collections.filter' call
|
|
304
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
305
|
+
var destination_1 = ArrayList_init_$Create$();
|
|
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;
|
|
310
|
+
$l$block_0: {
|
|
311
|
+
// Inline function 'kotlin.collections.any' call
|
|
312
|
+
var tmp;
|
|
313
|
+
if (isInterface(support, Collection)) {
|
|
314
|
+
tmp = support.h();
|
|
315
|
+
} else {
|
|
316
|
+
tmp = false;
|
|
317
|
+
}
|
|
318
|
+
if (tmp) {
|
|
319
|
+
tmp$ret$13 = false;
|
|
320
|
+
break $l$block_0;
|
|
321
|
+
}
|
|
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;
|
|
327
|
+
break $l$block_0;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
tmp$ret$13 = false;
|
|
331
|
+
}
|
|
332
|
+
if (tmp$ret$13) {
|
|
333
|
+
destination_1.k(element_0);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
// Inline function 'kotlin.collections.flatMap' call
|
|
337
|
+
// Inline function 'kotlin.collections.flatMapTo' call
|
|
338
|
+
var destination_2 = ArrayList_init_$Create$();
|
|
339
|
+
var _iterator__ex2g4s_3 = destination_1.n();
|
|
340
|
+
while (_iterator__ex2g4s_3.q()) {
|
|
341
|
+
var element_2 = _iterator__ex2g4s_3.r();
|
|
342
|
+
// Inline function 'kotlin.collections.filter' call
|
|
343
|
+
var tmp0_0 = attackers($this, element_2.o43_1, naf);
|
|
344
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
345
|
+
var destination_3 = ArrayList_init_$Create$();
|
|
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);
|
|
351
|
+
}
|
|
262
352
|
}
|
|
353
|
+
var list = destination_3;
|
|
354
|
+
addAll(destination_2, list);
|
|
263
355
|
}
|
|
264
356
|
// Inline function 'kotlin.collections.map' call
|
|
265
357
|
// Inline function 'kotlin.collections.mapTo' call
|
|
266
|
-
var
|
|
267
|
-
var
|
|
268
|
-
while (
|
|
269
|
-
var item_0 =
|
|
270
|
-
var tmp$ret$
|
|
271
|
-
|
|
358
|
+
var destination_4 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_2, 10));
|
|
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);
|
|
272
364
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
365
|
+
return distinct(destination_4);
|
|
366
|
+
}
|
|
367
|
+
function getSubsets($this, request, intervention) {
|
|
368
|
+
return arg2pScope(CausalitySolver$getSubsets$lambda(request, intervention));
|
|
369
|
+
}
|
|
370
|
+
function getInterventions($this, request, cause, effect) {
|
|
371
|
+
var tmp = Companion_instance_0;
|
|
372
|
+
// Inline function 'kotlin.collections.map' call
|
|
373
|
+
var this_0 = solveFresh($this, effect, request.context.n1w()).q43_1;
|
|
374
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
375
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
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);
|
|
381
|
+
}
|
|
382
|
+
// Inline function 'kotlin.collections.filter' call
|
|
383
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
384
|
+
var destination_0 = ArrayList_init_$Create$();
|
|
385
|
+
var _iterator__ex2g4s_0 = destination.n();
|
|
386
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
387
|
+
var element = _iterator__ex2g4s_0.r();
|
|
388
|
+
if (!(element === 'none')) {
|
|
389
|
+
destination_0.k(element);
|
|
285
390
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
391
|
+
}
|
|
392
|
+
var rules = parseTerm(tmp, toString(toList_0(destination_0)));
|
|
393
|
+
return arg2pScope(CausalitySolver$getInterventions$lambda(request, rules, cause));
|
|
394
|
+
}
|
|
395
|
+
function checkCausalityICAIL24($this, request, intervention, effect) {
|
|
396
|
+
var supports = checkBaseTheory($this, request, effect);
|
|
397
|
+
if (supports.h())
|
|
398
|
+
return false;
|
|
399
|
+
var attackers = checkIntervention($this, request, intervention, supports, effect);
|
|
400
|
+
var tmp;
|
|
401
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
402
|
+
if (!attackers.h()) {
|
|
403
|
+
var tmp_0;
|
|
404
|
+
if (intervention.ny() <= 1) {
|
|
405
|
+
tmp_0 = true;
|
|
406
|
+
} else {
|
|
407
|
+
var tmp0 = getSubsets($this, request, intervention);
|
|
408
|
+
var tmp$ret$1;
|
|
409
|
+
$l$block_0: {
|
|
410
|
+
// Inline function 'kotlin.collections.none' call
|
|
411
|
+
var tmp_1;
|
|
412
|
+
if (isInterface(tmp0, Collection)) {
|
|
413
|
+
tmp_1 = tmp0.h();
|
|
295
414
|
} else {
|
|
296
|
-
|
|
415
|
+
tmp_1 = false;
|
|
297
416
|
}
|
|
298
|
-
if (
|
|
299
|
-
tmp$ret$
|
|
300
|
-
break $l$
|
|
417
|
+
if (tmp_1) {
|
|
418
|
+
tmp$ret$1 = true;
|
|
419
|
+
break $l$block_0;
|
|
301
420
|
}
|
|
302
|
-
var
|
|
303
|
-
while (
|
|
304
|
-
var
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
421
|
+
var _iterator__ex2g4s = tmp0.n();
|
|
422
|
+
while (_iterator__ex2g4s.q()) {
|
|
423
|
+
var element = _iterator__ex2g4s.r();
|
|
424
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
425
|
+
if (!checkIntervention($this, request, element, supports, effect).h()) {
|
|
426
|
+
tmp$ret$1 = false;
|
|
427
|
+
break $l$block_0;
|
|
308
428
|
}
|
|
309
429
|
}
|
|
310
|
-
tmp$ret$
|
|
311
|
-
}
|
|
312
|
-
if (tmp$ret$10) {
|
|
313
|
-
tmp$ret$9 = true;
|
|
314
|
-
break $l$block_2;
|
|
430
|
+
tmp$ret$1 = true;
|
|
315
431
|
}
|
|
432
|
+
tmp_0 = tmp$ret$1;
|
|
316
433
|
}
|
|
317
|
-
tmp
|
|
434
|
+
tmp = tmp_0;
|
|
435
|
+
} else {
|
|
436
|
+
tmp = false;
|
|
318
437
|
}
|
|
319
|
-
return tmp
|
|
320
|
-
}
|
|
321
|
-
function getSubsets($this, request, intervention) {
|
|
322
|
-
return arg2pScope(CausalitySolver$getSubsets$lambda(request, intervention));
|
|
438
|
+
return tmp;
|
|
323
439
|
}
|
|
324
|
-
function
|
|
440
|
+
function checkCausalityICAIL25($this, request, intervention, effect) {
|
|
325
441
|
var supports = checkBaseTheory($this, request, effect);
|
|
326
|
-
if (supports.
|
|
442
|
+
if (supports.h())
|
|
327
443
|
return false;
|
|
444
|
+
// Inline function 'kotlin.collections.map' call
|
|
445
|
+
var this_0 = checkIntervention($this, request, intervention, supports, effect);
|
|
446
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
447
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
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);
|
|
453
|
+
}
|
|
454
|
+
var attackers = destination;
|
|
328
455
|
var tmp;
|
|
329
|
-
|
|
456
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
457
|
+
if (!attackers.h()) {
|
|
330
458
|
var tmp_0;
|
|
331
|
-
if (intervention.
|
|
459
|
+
if (intervention.ny() <= 1) {
|
|
332
460
|
tmp_0 = true;
|
|
333
461
|
} else {
|
|
334
462
|
var tmp0 = getSubsets($this, request, intervention);
|
|
335
|
-
var tmp$ret$
|
|
336
|
-
$l$
|
|
337
|
-
// Inline function 'kotlin.collections.
|
|
463
|
+
var tmp$ret$4;
|
|
464
|
+
$l$block_4: {
|
|
465
|
+
// Inline function 'kotlin.collections.none' call
|
|
338
466
|
var tmp_1;
|
|
339
467
|
if (isInterface(tmp0, Collection)) {
|
|
340
|
-
tmp_1 = tmp0.
|
|
468
|
+
tmp_1 = tmp0.h();
|
|
341
469
|
} else {
|
|
342
470
|
tmp_1 = false;
|
|
343
471
|
}
|
|
344
472
|
if (tmp_1) {
|
|
345
|
-
tmp$ret$
|
|
346
|
-
break $l$
|
|
473
|
+
tmp$ret$4 = true;
|
|
474
|
+
break $l$block_4;
|
|
347
475
|
}
|
|
348
|
-
var
|
|
349
|
-
while (
|
|
350
|
-
var element =
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
476
|
+
var _iterator__ex2g4s_0 = tmp0.n();
|
|
477
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
478
|
+
var element = _iterator__ex2g4s_0.r();
|
|
479
|
+
// Inline function 'kotlin.collections.map' call
|
|
480
|
+
var this_1 = checkIntervention($this, request, element, supports, effect);
|
|
481
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
482
|
+
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
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);
|
|
488
|
+
}
|
|
489
|
+
var n = destination_0;
|
|
490
|
+
var tmp$ret$9;
|
|
491
|
+
$l$block_3: {
|
|
492
|
+
// Inline function 'kotlin.collections.all' call
|
|
493
|
+
var tmp_2;
|
|
494
|
+
if (isInterface(attackers, Collection)) {
|
|
495
|
+
tmp_2 = attackers.h();
|
|
496
|
+
} else {
|
|
497
|
+
tmp_2 = false;
|
|
498
|
+
}
|
|
499
|
+
if (tmp_2) {
|
|
500
|
+
tmp$ret$9 = true;
|
|
501
|
+
break $l$block_3;
|
|
502
|
+
}
|
|
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;
|
|
507
|
+
$l$block_2: {
|
|
508
|
+
// Inline function 'kotlin.collections.any' call
|
|
509
|
+
var tmp_3;
|
|
510
|
+
if (isInterface(n, Collection)) {
|
|
511
|
+
tmp_3 = n.h();
|
|
512
|
+
} else {
|
|
513
|
+
tmp_3 = false;
|
|
514
|
+
}
|
|
515
|
+
if (tmp_3) {
|
|
516
|
+
tmp$ret$11 = false;
|
|
517
|
+
break $l$block_2;
|
|
518
|
+
}
|
|
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;
|
|
524
|
+
break $l$block_2;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
tmp$ret$11 = false;
|
|
528
|
+
}
|
|
529
|
+
if (!tmp$ret$11) {
|
|
530
|
+
tmp$ret$9 = false;
|
|
531
|
+
break $l$block_3;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
tmp$ret$9 = true;
|
|
535
|
+
}
|
|
536
|
+
if (tmp$ret$9) {
|
|
537
|
+
tmp$ret$4 = false;
|
|
538
|
+
break $l$block_4;
|
|
354
539
|
}
|
|
355
540
|
}
|
|
356
|
-
tmp$ret$
|
|
541
|
+
tmp$ret$4 = true;
|
|
357
542
|
}
|
|
358
|
-
tmp_0 = tmp$ret$
|
|
543
|
+
tmp_0 = tmp$ret$4;
|
|
359
544
|
}
|
|
360
545
|
tmp = tmp_0;
|
|
361
546
|
} else {
|
|
@@ -363,137 +548,258 @@
|
|
|
363
548
|
}
|
|
364
549
|
return tmp;
|
|
365
550
|
}
|
|
366
|
-
function
|
|
367
|
-
|
|
368
|
-
|
|
551
|
+
function checkButFor($this, request, intervention, effect) {
|
|
552
|
+
var tmp;
|
|
553
|
+
// Inline function 'kotlin.let' call
|
|
554
|
+
var tmp0 = solveFresh($this, effect, request.context.n1w()).t43_1;
|
|
555
|
+
var tmp$ret$2;
|
|
556
|
+
$l$block_0: {
|
|
557
|
+
// Inline function 'kotlin.collections.any' call
|
|
558
|
+
var tmp_0;
|
|
559
|
+
if (isInterface(tmp0, Collection)) {
|
|
560
|
+
tmp_0 = tmp0.h();
|
|
561
|
+
} else {
|
|
562
|
+
tmp_0 = false;
|
|
563
|
+
}
|
|
564
|
+
if (tmp_0) {
|
|
565
|
+
tmp$ret$2 = false;
|
|
566
|
+
break $l$block_0;
|
|
567
|
+
}
|
|
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;
|
|
573
|
+
break $l$block_0;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
tmp$ret$2 = false;
|
|
577
|
+
}
|
|
578
|
+
if (tmp$ret$2) {
|
|
579
|
+
// Inline function 'kotlin.collections.map' call
|
|
580
|
+
var this_0 = intervention.toList();
|
|
581
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
582
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
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);
|
|
588
|
+
}
|
|
589
|
+
// Inline function 'kotlin.let' call
|
|
590
|
+
// Inline function 'kotlin.let' call
|
|
591
|
+
var tmp0_0 = solveFresh($this, effect, request.context.n1w().plusTheory(Companion_instance_1.ofIterableWithDefaultUnificator(destination))).t43_1;
|
|
592
|
+
var tmp$ret$11;
|
|
593
|
+
$l$block_2: {
|
|
594
|
+
// Inline function 'kotlin.collections.none' call
|
|
595
|
+
var tmp_1;
|
|
596
|
+
if (isInterface(tmp0_0, Collection)) {
|
|
597
|
+
tmp_1 = tmp0_0.h();
|
|
598
|
+
} else {
|
|
599
|
+
tmp_1 = false;
|
|
600
|
+
}
|
|
601
|
+
if (tmp_1) {
|
|
602
|
+
tmp$ret$11 = true;
|
|
603
|
+
break $l$block_2;
|
|
604
|
+
}
|
|
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;
|
|
610
|
+
break $l$block_2;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
tmp$ret$11 = true;
|
|
614
|
+
}
|
|
615
|
+
tmp = tmp$ret$11;
|
|
616
|
+
} else {
|
|
617
|
+
tmp = false;
|
|
618
|
+
}
|
|
619
|
+
return tmp;
|
|
620
|
+
}
|
|
621
|
+
function CausalityCheckCauseButFor($outer) {
|
|
622
|
+
this.g47_1 = $outer;
|
|
623
|
+
this.f47_1 = new Signature('but_for', 2);
|
|
369
624
|
}
|
|
370
|
-
protoOf(
|
|
371
|
-
return this.
|
|
625
|
+
protoOf(CausalityCheckCauseButFor).y1v = function () {
|
|
626
|
+
return this.f47_1;
|
|
372
627
|
};
|
|
373
|
-
protoOf(
|
|
374
|
-
var
|
|
375
|
-
var effect = this.
|
|
376
|
-
return sequenceOf(request.replyWithCondition(
|
|
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, []));
|
|
377
632
|
};
|
|
378
|
-
protoOf(
|
|
379
|
-
return this.
|
|
633
|
+
protoOf(CausalityCheckCauseButFor).solve = function (request) {
|
|
634
|
+
return this.s2h(request);
|
|
380
635
|
};
|
|
381
|
-
function
|
|
382
|
-
this.
|
|
383
|
-
this.
|
|
636
|
+
function CausalityCheckInterventionICAIL24($outer) {
|
|
637
|
+
this.j47_1 = $outer;
|
|
638
|
+
this.i47_1 = new Signature('ness_original_intervention', 2);
|
|
384
639
|
}
|
|
385
|
-
protoOf(
|
|
386
|
-
return this.
|
|
640
|
+
protoOf(CausalityCheckInterventionICAIL24).y1v = function () {
|
|
641
|
+
return this.i47_1;
|
|
642
|
+
};
|
|
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, []));
|
|
387
647
|
};
|
|
388
|
-
protoOf(
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
648
|
+
protoOf(CausalityCheckInterventionICAIL24).solve = function (request) {
|
|
649
|
+
return this.s2h(request);
|
|
650
|
+
};
|
|
651
|
+
function CausalityCheckCauseICAIL24($outer) {
|
|
652
|
+
this.l47_1 = $outer;
|
|
653
|
+
this.k47_1 = new Signature('ness_original', 3);
|
|
654
|
+
}
|
|
655
|
+
protoOf(CausalityCheckCauseICAIL24).y1v = function () {
|
|
656
|
+
return this.k47_1;
|
|
657
|
+
};
|
|
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());
|
|
392
662
|
if (!isInterface(intervention, Var)) {
|
|
393
|
-
throw
|
|
663
|
+
throw Companion_instance_2.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
|
|
394
664
|
}
|
|
395
|
-
var tmp =
|
|
396
|
-
|
|
397
|
-
var
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
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));
|
|
667
|
+
var tmp0_elvis_lhs = firstOrNull(map(tmp_0, CausalitySolver$CausalityCheckCauseICAIL24$solve$lambda_0(intervention)));
|
|
668
|
+
return sequenceOf(request.replyWith(tmp0_elvis_lhs == null ? Companion_getInstance().failed() : tmp0_elvis_lhs, VOID, []));
|
|
669
|
+
};
|
|
670
|
+
protoOf(CausalityCheckCauseICAIL24).solve = function (request) {
|
|
671
|
+
return this.s2h(request);
|
|
672
|
+
};
|
|
673
|
+
function CausalityCheckInterventionICAIL25($outer) {
|
|
674
|
+
this.n47_1 = $outer;
|
|
675
|
+
this.m47_1 = new Signature('ness_intervention', 2);
|
|
676
|
+
}
|
|
677
|
+
protoOf(CausalityCheckInterventionICAIL25).y1v = function () {
|
|
678
|
+
return this.m47_1;
|
|
679
|
+
};
|
|
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, []));
|
|
684
|
+
};
|
|
685
|
+
protoOf(CausalityCheckInterventionICAIL25).solve = function (request) {
|
|
686
|
+
return this.s2h(request);
|
|
687
|
+
};
|
|
688
|
+
function CausalityCheckCauseICAIL25($outer) {
|
|
689
|
+
this.p47_1 = $outer;
|
|
690
|
+
this.o47_1 = new Signature('ness', 3);
|
|
691
|
+
}
|
|
692
|
+
protoOf(CausalityCheckCauseICAIL25).y1v = function () {
|
|
693
|
+
return this.o47_1;
|
|
694
|
+
};
|
|
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());
|
|
699
|
+
if (!isInterface(intervention, Var)) {
|
|
700
|
+
throw Companion_instance_2.forGoal(request.context, request.signature, Expected_VARIABLE_getInstance(), intervention);
|
|
415
701
|
}
|
|
416
|
-
var
|
|
417
|
-
|
|
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));
|
|
704
|
+
var tmp0_elvis_lhs = firstOrNull(map(tmp_0, CausalitySolver$CausalityCheckCauseICAIL25$solve$lambda_0(intervention)));
|
|
705
|
+
return sequenceOf(request.replyWith(tmp0_elvis_lhs == null ? Companion_getInstance().failed() : tmp0_elvis_lhs, VOID, []));
|
|
418
706
|
};
|
|
419
|
-
protoOf(
|
|
420
|
-
return this.
|
|
707
|
+
protoOf(CausalityCheckCauseICAIL25).solve = function (request) {
|
|
708
|
+
return this.s2h(request);
|
|
421
709
|
};
|
|
422
710
|
function CausalitySolver$solveFresh$lambda(this$0) {
|
|
423
711
|
return function (it) {
|
|
424
|
-
return mineActiveGraph(this$0.
|
|
712
|
+
return mineActiveGraph(this$0.a47_1);
|
|
425
713
|
};
|
|
426
714
|
}
|
|
427
715
|
function CausalitySolver$getSupports$lambda(this$0, $effect) {
|
|
428
716
|
return function (it) {
|
|
429
|
-
return equalTerms(this$0, it.
|
|
717
|
+
return equalTerms(this$0, it.o43_1.u42_1, $effect);
|
|
430
718
|
};
|
|
431
719
|
}
|
|
432
720
|
function CausalitySolver$getSupports$lambda_0(this$0, $graph) {
|
|
433
721
|
return function (it) {
|
|
434
|
-
return supporters(this$0, it.
|
|
722
|
+
return supporters(this$0, it.o43_1, $graph, emptyList());
|
|
435
723
|
};
|
|
436
724
|
}
|
|
437
725
|
function CausalitySolver$getSupports$lambda_1(it) {
|
|
438
|
-
return it.
|
|
726
|
+
return it.o43_1;
|
|
439
727
|
}
|
|
440
728
|
function CausalitySolver$checkBaseTheory$lambda(a) {
|
|
441
|
-
return a.
|
|
729
|
+
return a.c43();
|
|
442
730
|
}
|
|
443
731
|
function CausalitySolver$getSubsets$lambda$lambda(it) {
|
|
444
|
-
return it.
|
|
732
|
+
return it.p1x();
|
|
445
733
|
}
|
|
446
734
|
function CausalitySolver$getSubsets$lambda$lambda_0($this_arg2pScope) {
|
|
447
735
|
return function (it) {
|
|
448
|
-
return ensureNotNull(it.
|
|
736
|
+
return ensureNotNull(it.h1w().i2($this_arg2pScope.d1i())).castToList();
|
|
449
737
|
};
|
|
450
738
|
}
|
|
451
739
|
function CausalitySolver$getSubsets$lambda($request, $intervention) {
|
|
452
740
|
return function ($this$arg2pScope) {
|
|
453
|
-
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()]));
|
|
454
742
|
var tmp_0 = filter(tmp, CausalitySolver$getSubsets$lambda$lambda);
|
|
455
743
|
return toList(map(tmp_0, CausalitySolver$getSubsets$lambda$lambda_0($this$arg2pScope)));
|
|
456
744
|
};
|
|
457
745
|
}
|
|
746
|
+
function CausalitySolver$getInterventions$lambda$lambda(it) {
|
|
747
|
+
return it.p1x();
|
|
748
|
+
}
|
|
749
|
+
function CausalitySolver$getInterventions$lambda$lambda_0($this_arg2pScope) {
|
|
750
|
+
return function (it) {
|
|
751
|
+
return ensureNotNull(it.h1w().i2($this_arg2pScope.d1i())).castToList();
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
function CausalitySolver$getInterventions$lambda($request, $rules, $cause) {
|
|
755
|
+
return function ($this$arg2pScope) {
|
|
756
|
+
var tmp = $request.solve($this$arg2pScope.stringInvoke('generate_interventions', $rules, [$cause, $this$arg2pScope.d1i()]));
|
|
757
|
+
var tmp_0 = filter(tmp, CausalitySolver$getInterventions$lambda$lambda);
|
|
758
|
+
return map(tmp_0, CausalitySolver$getInterventions$lambda$lambda_0($this$arg2pScope));
|
|
759
|
+
};
|
|
760
|
+
}
|
|
458
761
|
function CausalitySolver() {
|
|
459
762
|
var tmp = this;
|
|
460
763
|
var tmp_0 = Arg2pSolverFactory_instance;
|
|
461
764
|
var tmp0_graphExtensions = emptyList();
|
|
462
|
-
tmp.
|
|
463
|
-
this.
|
|
464
|
-
|
|
465
|
-
|
|
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);
|
|
466
772
|
}
|
|
467
|
-
protoOf(CausalitySolver).
|
|
773
|
+
protoOf(CausalitySolver).h47 = function (string) {
|
|
468
774
|
return replace(replace(string, ' ', ''), "'", '');
|
|
469
775
|
};
|
|
470
|
-
protoOf(CausalitySolver).
|
|
471
|
-
return this.
|
|
776
|
+
protoOf(CausalitySolver).k2f = function () {
|
|
777
|
+
return this.d47_1;
|
|
472
778
|
};
|
|
473
|
-
protoOf(CausalitySolver).
|
|
779
|
+
protoOf(CausalitySolver).q3q = function () {
|
|
474
780
|
// Inline function 'kotlin.let' call
|
|
475
|
-
var primitives = listOf([new
|
|
781
|
+
var primitives = listOf([new CausalityCheckInterventionICAIL24(this), new CausalityCheckCauseICAIL24(this), new CausalityCheckInterventionICAIL25(this), new CausalityCheckCauseICAIL25(this), new CausalityCheckCauseButFor(this)]);
|
|
476
782
|
var tmp = Companion_getInstance_4();
|
|
477
783
|
// Inline function 'kotlin.collections.associateBy' call
|
|
478
784
|
var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(primitives, 10)), 16);
|
|
479
785
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
480
|
-
var destination = LinkedHashMap_init_$Create$(capacity);
|
|
481
|
-
var _iterator__ex2g4s = primitives.
|
|
482
|
-
while (_iterator__ex2g4s.
|
|
483
|
-
var element = _iterator__ex2g4s.
|
|
484
|
-
var tmp$ret$
|
|
485
|
-
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);
|
|
486
792
|
}
|
|
487
|
-
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));
|
|
488
794
|
};
|
|
489
|
-
protoOf(CausalitySolver).
|
|
795
|
+
protoOf(CausalitySolver).r3q = function () {
|
|
490
796
|
return 'causality';
|
|
491
797
|
};
|
|
492
|
-
protoOf(CausalitySolver).
|
|
493
|
-
return this.
|
|
798
|
+
protoOf(CausalitySolver).a3q = function () {
|
|
799
|
+
return this.e47_1;
|
|
494
800
|
};
|
|
495
801
|
//region block: post-declaration
|
|
496
|
-
protoOf(CausalitySolver).
|
|
802
|
+
protoOf(CausalitySolver).z3p = content;
|
|
497
803
|
//endregion
|
|
498
804
|
//region block: exports
|
|
499
805
|
_.$_$ = _.$_$ || {};
|