@tuprolog/2p-full 3.0.6 → 3.0.7
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-bdd.js +159 -159
- package/2p-core.js +2210 -2140
- package/2p-core.js.map +1 -1
- package/2p-io-lib.js +765 -766
- package/2p-io-lib.js.map +1 -1
- package/2p-oop-lib.js +890 -892
- package/2p-oop-lib.js.map +1 -1
- package/2p-parser-core.js +105 -115
- package/2p-parser-core.js.map +1 -1
- package/2p-parser-impl.js +1421 -1418
- package/2p-parser-impl.js.map +1 -1
- package/2p-parser-theory.js +56 -56
- package/2p-repl.js +149 -142
- package/2p-repl.js.map +1 -1
- package/2p-solve-plp.js +2 -2
- package/2p-solve-problog.js +1024 -964
- package/2p-solve-problog.js.map +1 -1
- package/2p-solve-prolog.js +821 -831
- package/2p-solve-prolog.js.map +1 -1
- package/2p-solve.js +3932 -3597
- package/2p-solve.js.map +1 -1
- package/2p-theory.js +199 -199
- package/2p-unify.js +75 -75
- package/2p-utils.js +352 -330
- package/2p-utils.js.map +1 -1
- package/clikt-clikt-mordant.js +90 -90
- package/clikt-clikt.js +1524 -1481
- package/clikt-clikt.js.map +1 -1
- package/colormath-root-colormath.js +472 -472
- package/kotlin-kotlin-stdlib.js +1377 -1365
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kt-math.js +1485 -1484
- package/kt-math.js.map +1 -1
- package/mordant-mordant.js +1442 -1442
- package/okio-parent-okio-nodefilesystem.js +46 -46
- package/okio-parent-okio.js +647 -647
- package/package.json +1 -1
- package/2p-test-dsl.js +0 -15
- package/2p-test-dsl.js.map +0 -1
- package/kotlin-kotlin-test.js +0 -15
- package/kotlin-kotlin-test.js.map +0 -1
package/2p-solve-problog.js
CHANGED
|
@@ -37,10 +37,12 @@
|
|
|
37
37
|
'use strict';
|
|
38
38
|
//region block: imports
|
|
39
39
|
var imul = Math.imul;
|
|
40
|
-
var
|
|
41
|
-
var
|
|
40
|
+
var toList = kotlin_kotlin.$_$.v5;
|
|
41
|
+
var protoOf = kotlin_kotlin.$_$.u8;
|
|
42
|
+
var asReversed = kotlin_kotlin.$_$.o2;
|
|
43
|
+
var Unit_instance = kotlin_kotlin.$_$.r;
|
|
42
44
|
var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.p;
|
|
43
|
-
var
|
|
45
|
+
var first = kotlin_kotlin.$_$.q3;
|
|
44
46
|
var loadStaticClauses = kotlin_it_unibo_tuprolog_solve.$_$.h4;
|
|
45
47
|
var loadStaticClausesIterable = kotlin_it_unibo_tuprolog_solve.$_$.i4;
|
|
46
48
|
var loadStaticClausesSequence = kotlin_it_unibo_tuprolog_solve.$_$.j4;
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
var loadDynamicClausesIterable = kotlin_it_unibo_tuprolog_solve.$_$.e4;
|
|
49
51
|
var loadDynamicClausesSequence = kotlin_it_unibo_tuprolog_solve.$_$.f4;
|
|
50
52
|
var MutableSolver = kotlin_it_unibo_tuprolog_solve.$_$.k4;
|
|
51
|
-
var initMetadataForClass = kotlin_kotlin.$_$.
|
|
53
|
+
var initMetadataForClass = kotlin_kotlin.$_$.d8;
|
|
52
54
|
var VOID = kotlin_kotlin.$_$.b;
|
|
53
55
|
var Specifier_XFY_getInstance = kotlin_it_unibo_tuprolog_core.$_$.c;
|
|
54
56
|
var Operator = kotlin_it_unibo_tuprolog_core.$_$.n1;
|
|
@@ -57,23 +59,23 @@
|
|
|
57
59
|
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.c1;
|
|
58
60
|
var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.b1;
|
|
59
61
|
var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.x;
|
|
60
|
-
var map = kotlin_kotlin.$_$.
|
|
62
|
+
var map = kotlin_kotlin.$_$.wa;
|
|
61
63
|
var Companion_instance_1 = kotlin_it_unibo_tuprolog_solve.$_$.s1;
|
|
62
64
|
var Halt = kotlin_it_unibo_tuprolog_solve.$_$.m4;
|
|
63
|
-
var isInterface = kotlin_kotlin.$_$.
|
|
65
|
+
var isInterface = kotlin_kotlin.$_$.m8;
|
|
64
66
|
var Yes = kotlin_it_unibo_tuprolog_solve.$_$.o4;
|
|
65
|
-
var Unit_instance = kotlin_kotlin.$_$.r;
|
|
66
67
|
var setProbability = kotlin_it_unibo_tuprolog_solve_plp.$_$.d;
|
|
67
68
|
var Numeric = kotlin_it_unibo_tuprolog_core.$_$.w1;
|
|
68
69
|
var setBinaryDecisionDiagram = kotlin_it_unibo_tuprolog_solve_plp.$_$.b;
|
|
69
70
|
var get_isProbabilistic = kotlin_it_unibo_tuprolog_solve_plp.$_$.a;
|
|
70
71
|
var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_solve.$_$.u1;
|
|
71
|
-
var
|
|
72
|
-
var first_0 = kotlin_kotlin.$_$.
|
|
73
|
-
var copy = kotlin_it_unibo_tuprolog_solve.$_$.z1;
|
|
72
|
+
var toList_0 = kotlin_kotlin.$_$.kb;
|
|
73
|
+
var first_0 = kotlin_kotlin.$_$.ka;
|
|
74
|
+
var copy$default = kotlin_it_unibo_tuprolog_solve.$_$.z1;
|
|
74
75
|
var Solver = kotlin_it_unibo_tuprolog_solve.$_$.c5;
|
|
75
76
|
var TrackVariables_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.j1;
|
|
76
77
|
var invoke = kotlin_it_unibo_tuprolog_solve.$_$.u2;
|
|
78
|
+
var THROW_CCE = kotlin_kotlin.$_$.he;
|
|
77
79
|
var KtMap = kotlin_kotlin.$_$.f2;
|
|
78
80
|
var get_defaultFlags = kotlin_it_unibo_tuprolog_solve.$_$.r4;
|
|
79
81
|
var PrologSolverFactory_instance = kotlin_it_unibo_tuprolog_solve_prolog.$_$.c;
|
|
@@ -95,55 +97,54 @@
|
|
|
95
97
|
var mutableSolverWithDefaultBuiltins = kotlin_it_unibo_tuprolog_solve.$_$.y4;
|
|
96
98
|
var mutableSolverWithDefaultBuiltinsAnd = kotlin_it_unibo_tuprolog_solve.$_$.c2;
|
|
97
99
|
var SolverFactory = kotlin_it_unibo_tuprolog_solve.$_$.b5;
|
|
98
|
-
var initMetadataForObject = kotlin_kotlin.$_$.
|
|
99
|
-
var defineProp = kotlin_kotlin.$_$.
|
|
100
|
+
var initMetadataForObject = kotlin_kotlin.$_$.i8;
|
|
101
|
+
var defineProp = kotlin_kotlin.$_$.u7;
|
|
100
102
|
var ExtensionLibrary = kotlin_it_unibo_tuprolog_solve.$_$.x2;
|
|
101
103
|
var DefaultBuiltins_getInstance = kotlin_it_unibo_tuprolog_solve_prolog.$_$.b;
|
|
102
104
|
var EnsureExecutable_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.p1;
|
|
103
|
-
var listOf = kotlin_kotlin.$_$.
|
|
105
|
+
var listOf = kotlin_kotlin.$_$.h4;
|
|
104
106
|
var Call_getInstance = kotlin_it_unibo_tuprolog_solve_prolog.$_$.a;
|
|
105
107
|
var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_solve.$_$.l1;
|
|
106
|
-
var listOf_0 = kotlin_kotlin.$_$.
|
|
108
|
+
var listOf_0 = kotlin_kotlin.$_$.i4;
|
|
107
109
|
var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.l1;
|
|
108
110
|
var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.f1;
|
|
109
|
-
var captureStack = kotlin_kotlin.$_$.
|
|
110
|
-
var emptyList = kotlin_kotlin.$_$.
|
|
111
|
+
var captureStack = kotlin_kotlin.$_$.l7;
|
|
112
|
+
var emptyList = kotlin_kotlin.$_$.l3;
|
|
111
113
|
var asIterable = kotlin_kotlin.$_$.l2;
|
|
112
|
-
var asIterable_0 = kotlin_kotlin.$_$.
|
|
113
|
-
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.
|
|
114
|
+
var asIterable_0 = kotlin_kotlin.$_$.z9;
|
|
115
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.u;
|
|
114
116
|
var Companion_instance_2 = kotlin_it_unibo_tuprolog_core.$_$.w;
|
|
115
|
-
var initMetadataForCompanion = kotlin_kotlin.$_$.
|
|
117
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.e8;
|
|
116
118
|
var bddTerminalOf = kotlin_it_unibo_tuprolog_bdd.$_$.d;
|
|
117
119
|
var bddOf = kotlin_it_unibo_tuprolog_bdd.$_$.c;
|
|
118
|
-
var initMetadataForInterface = kotlin_kotlin.$_$.
|
|
120
|
+
var initMetadataForInterface = kotlin_kotlin.$_$.g8;
|
|
119
121
|
var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_core.$_$.m;
|
|
120
122
|
var Companion_getInstance_5 = kotlin_it_unibo_tuprolog_core.$_$.y;
|
|
121
123
|
var Term = kotlin_it_unibo_tuprolog_core.$_$.y2;
|
|
122
124
|
var Atom = kotlin_it_unibo_tuprolog_core.$_$.o1;
|
|
123
|
-
var KProperty1 = kotlin_kotlin.$_$.
|
|
124
|
-
var getPropertyCallableRef = kotlin_kotlin.$_$.
|
|
125
|
+
var KProperty1 = kotlin_kotlin.$_$.v9;
|
|
126
|
+
var getPropertyCallableRef = kotlin_kotlin.$_$.a8;
|
|
125
127
|
var Collection = kotlin_kotlin.$_$.b2;
|
|
126
|
-
var constructCallableReference = kotlin_kotlin.$_$.
|
|
127
|
-
var getBigIntHashCode = kotlin_kotlin.$_$.
|
|
128
|
-
var getNumberHashCode = kotlin_kotlin.$_$.
|
|
129
|
-
var hashCode = kotlin_kotlin.$_$.
|
|
130
|
-
var emptySet = kotlin_kotlin.$_$.
|
|
128
|
+
var constructCallableReference = kotlin_kotlin.$_$.t7;
|
|
129
|
+
var getBigIntHashCode = kotlin_kotlin.$_$.x7;
|
|
130
|
+
var getNumberHashCode = kotlin_kotlin.$_$.z7;
|
|
131
|
+
var hashCode = kotlin_kotlin.$_$.c8;
|
|
132
|
+
var emptySet = kotlin_kotlin.$_$.n3;
|
|
131
133
|
var Companion_getInstance_6 = kotlin_it_unibo_tuprolog_core.$_$.t;
|
|
132
|
-
var lazy = kotlin_kotlin.$_$.
|
|
134
|
+
var lazy = kotlin_kotlin.$_$.re;
|
|
133
135
|
var collectionSizeOrDefault = kotlin_kotlin.$_$.w2;
|
|
134
|
-
var toSet = kotlin_kotlin.$_$.
|
|
135
|
-
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.
|
|
136
|
+
var toSet = kotlin_kotlin.$_$.d6;
|
|
137
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.v;
|
|
136
138
|
var compareTo = kotlin_it_unibo_tuprolog_core.$_$.b2;
|
|
137
|
-
var compareTo_0 = kotlin_kotlin.$_$.
|
|
138
|
-
var equals = kotlin_kotlin.$_$.
|
|
139
|
-
var round = kotlin_kotlin.$_$.
|
|
139
|
+
var compareTo_0 = kotlin_kotlin.$_$.s7;
|
|
140
|
+
var equals = kotlin_kotlin.$_$.v7;
|
|
141
|
+
var round = kotlin_kotlin.$_$.c9;
|
|
140
142
|
var MutableTheory = kotlin_it_unibo_tuprolog_theory.$_$.c;
|
|
141
143
|
var Theory = kotlin_it_unibo_tuprolog_theory.$_$.f;
|
|
142
144
|
var Struct = kotlin_it_unibo_tuprolog_core.$_$.z1;
|
|
143
145
|
var TuPrologException_init_$Create$ = kotlin_it_unibo_tuprolog_core.$_$.h1;
|
|
144
146
|
var Rule = kotlin_it_unibo_tuprolog_core.$_$.y1;
|
|
145
147
|
var Companion_instance_3 = kotlin_it_unibo_tuprolog_core.$_$.v;
|
|
146
|
-
var toList_0 = kotlin_kotlin.$_$.t5;
|
|
147
148
|
var UnsupportedOperationException_init_$Create$ = kotlin_kotlin.$_$.z1;
|
|
148
149
|
var notThenExpansion = kotlin_it_unibo_tuprolog_bdd.$_$.g;
|
|
149
150
|
var expansion = kotlin_it_unibo_tuprolog_bdd.$_$.e;
|
|
@@ -151,21 +152,22 @@
|
|
|
151
152
|
var andThenExpansion = kotlin_it_unibo_tuprolog_bdd.$_$.a;
|
|
152
153
|
var orThenExpansion = kotlin_it_unibo_tuprolog_bdd.$_$.h;
|
|
153
154
|
var map_0 = kotlin_it_unibo_tuprolog_bdd.$_$.f;
|
|
154
|
-
var get_ONE = kotlin_kotlin.$_$.
|
|
155
|
-
var add = kotlin_kotlin.$_$.
|
|
155
|
+
var get_ONE = kotlin_kotlin.$_$.s6;
|
|
156
|
+
var add = kotlin_kotlin.$_$.t6;
|
|
156
157
|
var NoSuchElementException_init_$Create$ = kotlin_kotlin.$_$.s1;
|
|
157
158
|
var Companion_instance_4 = kotlin_it_unibo_tuprolog_core.$_$.q;
|
|
158
|
-
var plus = kotlin_kotlin.$_$.
|
|
159
|
+
var plus = kotlin_kotlin.$_$.c5;
|
|
159
160
|
var setTag = kotlin_it_unibo_tuprolog_utils.$_$.l1;
|
|
160
|
-
var
|
|
161
|
-
var
|
|
162
|
-
var
|
|
163
|
-
var plus_0 = kotlin_kotlin.$_$.y4;
|
|
161
|
+
var getValue = kotlin_kotlin.$_$.t3;
|
|
162
|
+
var toSet_0 = kotlin_kotlin.$_$.mb;
|
|
163
|
+
var plus_0 = kotlin_kotlin.$_$.z4;
|
|
164
164
|
var checkIndexOverflow = kotlin_kotlin.$_$.v2;
|
|
165
|
-
var Pair = kotlin_kotlin.$_$.
|
|
165
|
+
var Pair = kotlin_kotlin.$_$.fe;
|
|
166
166
|
var Fact = kotlin_it_unibo_tuprolog_core.$_$.s1;
|
|
167
|
-
var subtract = kotlin_kotlin.$_$.
|
|
168
|
-
var setOf = kotlin_kotlin.$_$.
|
|
167
|
+
var subtract = kotlin_kotlin.$_$.p5;
|
|
168
|
+
var setOf = kotlin_kotlin.$_$.h5;
|
|
169
|
+
var to = kotlin_kotlin.$_$.ye;
|
|
170
|
+
var mapOf = kotlin_kotlin.$_$.l4;
|
|
169
171
|
var Directive = kotlin_it_unibo_tuprolog_core.$_$.r1;
|
|
170
172
|
var Indicator = kotlin_it_unibo_tuprolog_core.$_$.t1;
|
|
171
173
|
var Companion_instance_5 = kotlin_it_unibo_tuprolog_core.$_$.o;
|
|
@@ -179,30 +181,30 @@
|
|
|
179
181
|
var Success = kotlin_it_unibo_tuprolog_theory.$_$.e;
|
|
180
182
|
var NonBacktrackable = kotlin_it_unibo_tuprolog_solve.$_$.j3;
|
|
181
183
|
var Companion_getInstance_9 = kotlin_it_unibo_tuprolog_solve.$_$.n1;
|
|
182
|
-
var Var = kotlin_it_unibo_tuprolog_core.$_$.
|
|
184
|
+
var Var = kotlin_it_unibo_tuprolog_core.$_$.a3;
|
|
183
185
|
var ResolutionException_init_$Create$ = kotlin_it_unibo_tuprolog_solve.$_$.i2;
|
|
184
|
-
var CoroutineImpl = kotlin_kotlin.$_$.
|
|
185
|
-
var SequenceScope = kotlin_kotlin.$_$.
|
|
186
|
-
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.
|
|
186
|
+
var CoroutineImpl = kotlin_kotlin.$_$.l6;
|
|
187
|
+
var SequenceScope = kotlin_kotlin.$_$.w9;
|
|
188
|
+
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.k6;
|
|
187
189
|
var extractSignature = kotlin_it_unibo_tuprolog_solve.$_$.e5;
|
|
188
|
-
var ensureNotNull = kotlin_kotlin.$_$.
|
|
190
|
+
var ensureNotNull = kotlin_kotlin.$_$.ne;
|
|
189
191
|
var Clause = kotlin_it_unibo_tuprolog_core.$_$.p1;
|
|
190
192
|
var copyToArray = kotlin_kotlin.$_$.g3;
|
|
191
|
-
var initMetadataForLambda = kotlin_kotlin.$_$.
|
|
193
|
+
var initMetadataForLambda = kotlin_kotlin.$_$.h8;
|
|
192
194
|
var WithoutSideEffects = kotlin_it_unibo_tuprolog_solve.$_$.l3;
|
|
193
|
-
var sequence = kotlin_kotlin.$_$.
|
|
195
|
+
var sequence = kotlin_kotlin.$_$.eb;
|
|
194
196
|
var NonBacktrackable_0 = kotlin_it_unibo_tuprolog_solve.$_$.b3;
|
|
195
197
|
var setProbabilistic = kotlin_it_unibo_tuprolog_solve_plp.$_$.c;
|
|
196
|
-
var firstOrNull = kotlin_kotlin.$_$.
|
|
198
|
+
var firstOrNull = kotlin_kotlin.$_$.ja;
|
|
197
199
|
var WithoutSideEffects_0 = kotlin_it_unibo_tuprolog_solve.$_$.g3;
|
|
198
200
|
var NonBacktrackable_1 = kotlin_it_unibo_tuprolog_solve.$_$.o3;
|
|
199
201
|
var SetFlags_init_$Create$ = kotlin_it_unibo_tuprolog_solve.$_$.l2;
|
|
200
202
|
var WithoutSideEffects_1 = kotlin_it_unibo_tuprolog_solve.$_$.c3;
|
|
201
203
|
var asSequence = kotlin_kotlin.$_$.r2;
|
|
202
|
-
var filter = kotlin_kotlin.$_$.
|
|
203
|
-
var Sequence = kotlin_kotlin.$_$.
|
|
204
|
-
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.
|
|
205
|
-
var sequenceOf = kotlin_kotlin.$_$.
|
|
204
|
+
var filter = kotlin_kotlin.$_$.ia;
|
|
205
|
+
var Sequence = kotlin_kotlin.$_$.x9;
|
|
206
|
+
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.x;
|
|
207
|
+
var sequenceOf = kotlin_kotlin.$_$.db;
|
|
206
208
|
var RuleWrapper = kotlin_it_unibo_tuprolog_solve.$_$.r3;
|
|
207
209
|
var RuleWrapper_init_$Init$ = kotlin_it_unibo_tuprolog_solve.$_$.k2;
|
|
208
210
|
//endregion
|
|
@@ -219,7 +221,7 @@
|
|
|
219
221
|
function get_probabilityOrNull() {
|
|
220
222
|
var tmp;
|
|
221
223
|
try {
|
|
222
|
-
tmp = this.
|
|
224
|
+
tmp = this.s3n();
|
|
223
225
|
} catch ($p) {
|
|
224
226
|
var tmp_0;
|
|
225
227
|
if ($p instanceof Error) {
|
|
@@ -263,162 +265,176 @@
|
|
|
263
265
|
initMetadataForObject(ProbSolveWithEvidence, 'ProbSolveWithEvidence', VOID, WithoutSideEffects);
|
|
264
266
|
initMetadataForObject(Prob, 'Prob', VOID, RuleWrapper);
|
|
265
267
|
//endregion
|
|
268
|
+
function mapped($this, clause) {
|
|
269
|
+
return toList(Companion_instance_10.of($this.n3l_1.v1n(), [clause]).f1o());
|
|
270
|
+
}
|
|
266
271
|
function MutableProblogSolver(solver) {
|
|
267
272
|
ProblogSolver.call(this, solver);
|
|
268
|
-
this.
|
|
273
|
+
this.n3l_1 = solver;
|
|
269
274
|
}
|
|
270
|
-
protoOf(MutableProblogSolver).
|
|
271
|
-
this.
|
|
275
|
+
protoOf(MutableProblogSolver).g3e = function (library) {
|
|
276
|
+
this.n3l_1.loadLibrary(library);
|
|
272
277
|
};
|
|
273
278
|
protoOf(MutableProblogSolver).loadLibrary = function (library) {
|
|
274
|
-
return this.
|
|
279
|
+
return this.g3e(library);
|
|
275
280
|
};
|
|
276
|
-
protoOf(MutableProblogSolver).
|
|
277
|
-
this.
|
|
281
|
+
protoOf(MutableProblogSolver).h3e = function (library) {
|
|
282
|
+
this.n3l_1.unloadLibrary(library);
|
|
278
283
|
};
|
|
279
284
|
protoOf(MutableProblogSolver).unloadLibrary = function (library) {
|
|
280
|
-
return this.
|
|
285
|
+
return this.h3e(library);
|
|
281
286
|
};
|
|
282
|
-
protoOf(MutableProblogSolver).
|
|
283
|
-
this.
|
|
287
|
+
protoOf(MutableProblogSolver).i3e = function (libraries) {
|
|
288
|
+
this.n3l_1.setLibraries(libraries);
|
|
284
289
|
};
|
|
285
290
|
protoOf(MutableProblogSolver).setLibraries = function (libraries) {
|
|
286
|
-
return this.
|
|
291
|
+
return this.i3e(libraries);
|
|
287
292
|
};
|
|
288
|
-
protoOf(MutableProblogSolver).
|
|
289
|
-
this.
|
|
293
|
+
protoOf(MutableProblogSolver).j3e = function (theory) {
|
|
294
|
+
this.n3l_1.loadStaticKb(Companion_instance_10.ofIterable(this.n3l_1.v1n(), theory));
|
|
290
295
|
};
|
|
291
296
|
protoOf(MutableProblogSolver).loadStaticKb = function (theory) {
|
|
292
|
-
return this.
|
|
297
|
+
return this.j3e(theory);
|
|
293
298
|
};
|
|
294
|
-
protoOf(MutableProblogSolver).
|
|
295
|
-
this.
|
|
299
|
+
protoOf(MutableProblogSolver).k3e = function (theory) {
|
|
300
|
+
this.n3l_1.appendStaticKb(Companion_instance_10.ofIterable(this.n3l_1.v1n(), theory));
|
|
296
301
|
};
|
|
297
302
|
protoOf(MutableProblogSolver).appendStaticKb = function (theory) {
|
|
298
|
-
return this.
|
|
303
|
+
return this.k3e(theory);
|
|
299
304
|
};
|
|
300
|
-
protoOf(MutableProblogSolver).
|
|
301
|
-
this.
|
|
305
|
+
protoOf(MutableProblogSolver).l3e = function () {
|
|
306
|
+
this.n3l_1.resetStaticKb();
|
|
302
307
|
};
|
|
303
308
|
protoOf(MutableProblogSolver).resetStaticKb = function () {
|
|
304
|
-
return this.
|
|
309
|
+
return this.l3e();
|
|
305
310
|
};
|
|
306
|
-
protoOf(MutableProblogSolver).
|
|
307
|
-
this.
|
|
311
|
+
protoOf(MutableProblogSolver).m3e = function (theory) {
|
|
312
|
+
this.n3l_1.loadDynamicKb(Companion_instance_10.ofIterable(this.n3l_1.v1n(), theory));
|
|
308
313
|
};
|
|
309
314
|
protoOf(MutableProblogSolver).loadDynamicKb = function (theory) {
|
|
310
|
-
return this.
|
|
315
|
+
return this.m3e(theory);
|
|
311
316
|
};
|
|
312
|
-
protoOf(MutableProblogSolver).
|
|
313
|
-
this.
|
|
317
|
+
protoOf(MutableProblogSolver).n3e = function (theory) {
|
|
318
|
+
this.n3l_1.appendDynamicKb(Companion_instance_10.ofIterable(this.n3l_1.v1n(), theory));
|
|
314
319
|
};
|
|
315
320
|
protoOf(MutableProblogSolver).appendDynamicKb = function (theory) {
|
|
316
|
-
return this.
|
|
321
|
+
return this.n3e(theory);
|
|
317
322
|
};
|
|
318
|
-
protoOf(MutableProblogSolver).
|
|
319
|
-
this.
|
|
323
|
+
protoOf(MutableProblogSolver).o3e = function () {
|
|
324
|
+
this.n3l_1.resetDynamicKb();
|
|
320
325
|
};
|
|
321
326
|
protoOf(MutableProblogSolver).resetDynamicKb = function () {
|
|
322
|
-
return this.
|
|
327
|
+
return this.o3e();
|
|
323
328
|
};
|
|
324
329
|
protoOf(MutableProblogSolver).h1p = function (clause) {
|
|
325
|
-
|
|
330
|
+
var tmp0 = asReversed(mapped(this, clause));
|
|
331
|
+
var tmp2_forEach_this = this.n3l_1;
|
|
332
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
333
|
+
var _iterator__ex2g4s = tmp0.n();
|
|
334
|
+
while (_iterator__ex2g4s.q()) {
|
|
335
|
+
var element = _iterator__ex2g4s.r();
|
|
336
|
+
tmp2_forEach_this.assertA(element);
|
|
337
|
+
}
|
|
326
338
|
};
|
|
327
339
|
protoOf(MutableProblogSolver).assertA = function (clause) {
|
|
328
340
|
return this.h1p(clause);
|
|
329
341
|
};
|
|
330
|
-
protoOf(MutableProblogSolver).
|
|
331
|
-
this.
|
|
342
|
+
protoOf(MutableProblogSolver).p3e = function (fact) {
|
|
343
|
+
this.h1p(Companion_instance.of(fact));
|
|
332
344
|
};
|
|
333
345
|
protoOf(MutableProblogSolver).assertAFact = function (fact) {
|
|
334
|
-
return this.
|
|
346
|
+
return this.p3e(fact);
|
|
335
347
|
};
|
|
336
348
|
protoOf(MutableProblogSolver).i1o = function (clause) {
|
|
337
|
-
|
|
349
|
+
var tmp0 = mapped(this, clause);
|
|
350
|
+
var tmp2_forEach_this = this.n3l_1;
|
|
351
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
352
|
+
var _iterator__ex2g4s = tmp0.n();
|
|
353
|
+
while (_iterator__ex2g4s.q()) {
|
|
354
|
+
var element = _iterator__ex2g4s.r();
|
|
355
|
+
tmp2_forEach_this.assertZ(element);
|
|
356
|
+
}
|
|
338
357
|
};
|
|
339
358
|
protoOf(MutableProblogSolver).assertZ = function (clause) {
|
|
340
359
|
return this.i1o(clause);
|
|
341
360
|
};
|
|
342
|
-
protoOf(MutableProblogSolver).
|
|
343
|
-
this.
|
|
361
|
+
protoOf(MutableProblogSolver).q3e = function (fact) {
|
|
362
|
+
this.i1o(Companion_instance.of(fact));
|
|
344
363
|
};
|
|
345
364
|
protoOf(MutableProblogSolver).assertZFact = function (fact) {
|
|
346
|
-
return this.
|
|
365
|
+
return this.q3e(fact);
|
|
347
366
|
};
|
|
348
367
|
protoOf(MutableProblogSolver).b1w = function (clause) {
|
|
349
|
-
return this.
|
|
368
|
+
return this.n3l_1.retract(first(Companion_instance_10.of(this.n3l_1.v1n(), [clause]).f1o()));
|
|
350
369
|
};
|
|
351
370
|
protoOf(MutableProblogSolver).retract = function (clause) {
|
|
352
371
|
return this.b1w(clause);
|
|
353
372
|
};
|
|
354
373
|
protoOf(MutableProblogSolver).c1w = function (fact) {
|
|
355
|
-
return this.
|
|
374
|
+
return this.n3l_1.retract(first(Companion_instance_10.of(this.n3l_1.v1n(), [Companion_instance.of(fact)]).f1o()));
|
|
356
375
|
};
|
|
357
376
|
protoOf(MutableProblogSolver).retractByHead = function (fact) {
|
|
358
377
|
return this.c1w(fact);
|
|
359
378
|
};
|
|
360
379
|
protoOf(MutableProblogSolver).n1o = function (clause) {
|
|
361
|
-
return this.
|
|
380
|
+
return this.n3l_1.retractAll(first(Companion_instance_10.of(this.n3l_1.v1n(), [clause]).f1o()));
|
|
362
381
|
};
|
|
363
382
|
protoOf(MutableProblogSolver).retractAll = function (clause) {
|
|
364
383
|
return this.n1o(clause);
|
|
365
384
|
};
|
|
366
|
-
protoOf(MutableProblogSolver).
|
|
367
|
-
return this.
|
|
385
|
+
protoOf(MutableProblogSolver).r3e = function (fact) {
|
|
386
|
+
return this.n3l_1.retractAll(first(Companion_instance_10.of(this.n3l_1.v1n(), [Companion_instance.of(fact)]).f1o()));
|
|
368
387
|
};
|
|
369
388
|
protoOf(MutableProblogSolver).retractAllBeHead = function (fact) {
|
|
370
|
-
return this.
|
|
389
|
+
return this.r3e(fact);
|
|
371
390
|
};
|
|
372
|
-
protoOf(MutableProblogSolver).
|
|
373
|
-
this.
|
|
391
|
+
protoOf(MutableProblogSolver).s3e = function (name, value) {
|
|
392
|
+
this.n3l_1.setFlag(name, value);
|
|
374
393
|
};
|
|
375
394
|
protoOf(MutableProblogSolver).setFlag = function (name, value) {
|
|
376
|
-
return this.
|
|
395
|
+
return this.s3e(name, value);
|
|
377
396
|
};
|
|
378
|
-
protoOf(MutableProblogSolver).
|
|
379
|
-
this.
|
|
397
|
+
protoOf(MutableProblogSolver).t3e = function (flag) {
|
|
398
|
+
this.n3l_1.setFlagPair(flag);
|
|
380
399
|
};
|
|
381
400
|
protoOf(MutableProblogSolver).setFlagPair = function (flag) {
|
|
382
|
-
return this.
|
|
401
|
+
return this.t3e(flag);
|
|
383
402
|
};
|
|
384
|
-
protoOf(MutableProblogSolver).
|
|
385
|
-
this.
|
|
403
|
+
protoOf(MutableProblogSolver).u3e = function (flag) {
|
|
404
|
+
this.n3l_1.setFlagNotable(flag);
|
|
386
405
|
};
|
|
387
406
|
protoOf(MutableProblogSolver).setFlagNotable = function (flag) {
|
|
388
|
-
return this.
|
|
407
|
+
return this.u3e(flag);
|
|
389
408
|
};
|
|
390
|
-
protoOf(MutableProblogSolver).
|
|
391
|
-
this.
|
|
409
|
+
protoOf(MutableProblogSolver).v3e = function (stdIn) {
|
|
410
|
+
this.n3l_1.setStandardInput(stdIn);
|
|
392
411
|
};
|
|
393
412
|
protoOf(MutableProblogSolver).setStandardInput = function (stdIn) {
|
|
394
|
-
return this.
|
|
413
|
+
return this.v3e(stdIn);
|
|
395
414
|
};
|
|
396
|
-
protoOf(MutableProblogSolver).
|
|
397
|
-
this.
|
|
415
|
+
protoOf(MutableProblogSolver).w3e = function (stdErr) {
|
|
416
|
+
this.n3l_1.setStandardError(stdErr);
|
|
398
417
|
};
|
|
399
418
|
protoOf(MutableProblogSolver).setStandardError = function (stdErr) {
|
|
400
|
-
return this.
|
|
419
|
+
return this.w3e(stdErr);
|
|
401
420
|
};
|
|
402
|
-
protoOf(MutableProblogSolver).
|
|
403
|
-
this.
|
|
421
|
+
protoOf(MutableProblogSolver).x3e = function (stdOut) {
|
|
422
|
+
this.n3l_1.setStandardOutput(stdOut);
|
|
404
423
|
};
|
|
405
424
|
protoOf(MutableProblogSolver).setStandardOutput = function (stdOut) {
|
|
406
|
-
return this.
|
|
425
|
+
return this.x3e(stdOut);
|
|
407
426
|
};
|
|
408
|
-
protoOf(MutableProblogSolver).
|
|
409
|
-
this.
|
|
427
|
+
protoOf(MutableProblogSolver).y3e = function (warnings) {
|
|
428
|
+
this.n3l_1.setWarnings(warnings);
|
|
410
429
|
};
|
|
411
430
|
protoOf(MutableProblogSolver).setWarnings = function (warnings) {
|
|
412
|
-
return this.
|
|
431
|
+
return this.y3e(warnings);
|
|
413
432
|
};
|
|
414
433
|
protoOf(MutableProblogSolver).a1z = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
415
|
-
return new MutableProblogSolver(this.
|
|
416
|
-
};
|
|
417
|
-
protoOf(MutableProblogSolver).copy = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, $super) {
|
|
418
|
-
return this.copy(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, ($super == null ? true : $super instanceof MutableProblogSolver) ? $super : THROW_CCE());
|
|
434
|
+
return new MutableProblogSolver(this.n3l_1.a1z(unificator, libraries, flags, Companion_instance_10.ofIterable(unificator, staticKb), Companion_instance_10.ofIterable(unificator, dynamicKb), stdIn, stdOut, stdErr, warnings));
|
|
419
435
|
};
|
|
420
436
|
protoOf(MutableProblogSolver).k1v = function () {
|
|
421
|
-
return new MutableProblogSolver(this.
|
|
437
|
+
return new MutableProblogSolver(this.n3l_1.k1v());
|
|
422
438
|
};
|
|
423
439
|
protoOf(MutableProblogSolver).clone = function () {
|
|
424
440
|
return this.k1v();
|
|
@@ -449,11 +465,11 @@
|
|
|
449
465
|
var tmp_0 = Companion_getInstance_1();
|
|
450
466
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
451
467
|
var tmp$ret$0 = ProbSetConfig_getInstance().signature.name;
|
|
452
|
-
var tmp_1 = tmp_0.of(tmp$ret$0, [ProbSetConfig_getInstance().
|
|
468
|
+
var tmp_1 = tmp_0.of(tmp$ret$0, [ProbSetConfig_getInstance().b3m(options)]);
|
|
453
469
|
var tmp_2 = Companion_getInstance_1();
|
|
454
470
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
455
471
|
var tmp$ret$1 = Prob_getInstance().signature.name;
|
|
456
|
-
var tmp_3 = $this.
|
|
472
|
+
var tmp_3 = $this.o3l_1.solveWithOptions(tmp.of(tmp_1, tmp_2.of(tmp$ret$1, [anonVar, goal])), options);
|
|
457
473
|
return map(tmp_3, ProblogSolver$solveNonProbabilistically$lambda(goal, anonVar));
|
|
458
474
|
}
|
|
459
475
|
function solveProbabilistically($this, goal, options) {
|
|
@@ -462,7 +478,7 @@
|
|
|
462
478
|
var tmp = Companion_getInstance_1();
|
|
463
479
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
464
480
|
var tmp$ret$0 = ProbQuery_getInstance().signature.name;
|
|
465
|
-
var tmp_0 = $this.
|
|
481
|
+
var tmp_0 = $this.o3l_1.solveWithOptions(tmp.of(tmp$ret$0, [probabilityVar, goal, ProbSetConfig_getInstance().b3m(options), bddVar]), options);
|
|
466
482
|
return map(tmp_0, ProblogSolver$solveProbabilistically$lambda(probabilityVar, bddVar, goal, options));
|
|
467
483
|
}
|
|
468
484
|
function ProblogSolver$solveNonProbabilistically$lambda$lambda($anonVar) {
|
|
@@ -476,10 +492,10 @@
|
|
|
476
492
|
if (isInterface(it, Yes)) {
|
|
477
493
|
var tmp_0 = Companion_instance_1;
|
|
478
494
|
var tmp_1 = it.p1x();
|
|
479
|
-
tmp = tmp_0.
|
|
495
|
+
tmp = tmp_0.u1z($goal, tmp_1.w12(ProblogSolver$solveNonProbabilistically$lambda$lambda($anonVar)));
|
|
480
496
|
} else {
|
|
481
497
|
if (isInterface(it, Halt)) {
|
|
482
|
-
tmp = Companion_instance_1.halt($goal, it.
|
|
498
|
+
tmp = Companion_instance_1.halt($goal, it.m1z());
|
|
483
499
|
} else {
|
|
484
500
|
tmp = Companion_instance_1.no($goal);
|
|
485
501
|
}
|
|
@@ -500,10 +516,10 @@
|
|
|
500
516
|
if (isInterface(it, Yes)) {
|
|
501
517
|
var tmp_0 = Companion_instance_1;
|
|
502
518
|
var tmp_1 = it.p1x();
|
|
503
|
-
tmp = tmp_0.
|
|
519
|
+
tmp = tmp_0.u1z($goal, tmp_1.w12(ProblogSolver$solveProbabilistically$lambda$lambda($probabilityVar, $bddVar)));
|
|
504
520
|
} else {
|
|
505
521
|
if (isInterface(it, Halt)) {
|
|
506
|
-
tmp = Companion_instance_1.halt($goal, it.
|
|
522
|
+
tmp = Companion_instance_1.halt($goal, it.m1z());
|
|
507
523
|
} else {
|
|
508
524
|
tmp = Companion_instance_1.no($goal);
|
|
509
525
|
}
|
|
@@ -515,7 +531,7 @@
|
|
|
515
531
|
} else {
|
|
516
532
|
var tmp_3;
|
|
517
533
|
if (!(probabilityTerm == null) ? isInterface(probabilityTerm, Numeric) : false) {
|
|
518
|
-
tmp_3 = setProbability(newSolution, probabilityTerm.
|
|
534
|
+
tmp_3 = setProbability(newSolution, probabilityTerm.n11().toDouble());
|
|
519
535
|
} else {
|
|
520
536
|
tmp_3 = setProbability(newSolution, NaN);
|
|
521
537
|
}
|
|
@@ -527,9 +543,9 @@
|
|
|
527
543
|
tmp_4 = false;
|
|
528
544
|
}
|
|
529
545
|
if (tmp_4) {
|
|
530
|
-
var explanation = bddTerm.
|
|
546
|
+
var explanation = bddTerm.d3m_1;
|
|
531
547
|
if (explanation instanceof BinaryDecisionDiagramExplanation) {
|
|
532
|
-
newSolution = setBinaryDecisionDiagram(newSolution, explanation.
|
|
548
|
+
newSolution = setBinaryDecisionDiagram(newSolution, explanation.e3m_1);
|
|
533
549
|
}
|
|
534
550
|
}
|
|
535
551
|
tmp_2 = newSolution;
|
|
@@ -538,9 +554,9 @@
|
|
|
538
554
|
};
|
|
539
555
|
}
|
|
540
556
|
function ProblogSolver(solver) {
|
|
541
|
-
this.
|
|
557
|
+
this.o3l_1 = solver;
|
|
542
558
|
}
|
|
543
|
-
protoOf(ProblogSolver).
|
|
559
|
+
protoOf(ProblogSolver).e2g = function (goal, options) {
|
|
544
560
|
var tmp;
|
|
545
561
|
if (!get_isProbabilistic(options)) {
|
|
546
562
|
tmp = solveNonProbabilistically(this, goal, options);
|
|
@@ -550,103 +566,100 @@
|
|
|
550
566
|
return tmp;
|
|
551
567
|
};
|
|
552
568
|
protoOf(ProblogSolver).solveWithOptions = function (goal, options) {
|
|
553
|
-
return this.
|
|
569
|
+
return this.e2g(goal, options);
|
|
554
570
|
};
|
|
555
|
-
protoOf(ProblogSolver).
|
|
556
|
-
return this.
|
|
571
|
+
protoOf(ProblogSolver).p3l = function (goal, timeout) {
|
|
572
|
+
return this.e2g(goal, Companion_getInstance_2().allLazilyWithTimeout(timeout));
|
|
557
573
|
};
|
|
558
574
|
protoOf(ProblogSolver).solveWithTimeout = function (goal, timeout) {
|
|
559
|
-
return this.
|
|
575
|
+
return this.p3l(goal, timeout);
|
|
560
576
|
};
|
|
561
|
-
protoOf(ProblogSolver).
|
|
562
|
-
return this.
|
|
577
|
+
protoOf(ProblogSolver).q3l = function (goal) {
|
|
578
|
+
return this.e2g(goal, Companion_getInstance_2().DEFAULT);
|
|
563
579
|
};
|
|
564
580
|
protoOf(ProblogSolver).solve = function (goal) {
|
|
565
|
-
return this.
|
|
581
|
+
return this.q3l(goal);
|
|
566
582
|
};
|
|
567
|
-
protoOf(ProblogSolver).
|
|
568
|
-
return
|
|
583
|
+
protoOf(ProblogSolver).r3l = function (goal, timeout) {
|
|
584
|
+
return toList_0(this.p3l(goal, timeout));
|
|
569
585
|
};
|
|
570
586
|
protoOf(ProblogSolver).solveListWithTimeout = function (goal, timeout) {
|
|
571
|
-
return this.
|
|
587
|
+
return this.r3l(goal, timeout);
|
|
572
588
|
};
|
|
573
|
-
protoOf(ProblogSolver).
|
|
574
|
-
return
|
|
589
|
+
protoOf(ProblogSolver).s3l = function (goal) {
|
|
590
|
+
return toList_0(this.q3l(goal));
|
|
575
591
|
};
|
|
576
592
|
protoOf(ProblogSolver).solveList = function (goal) {
|
|
577
|
-
return this.
|
|
593
|
+
return this.s3l(goal);
|
|
578
594
|
};
|
|
579
|
-
protoOf(ProblogSolver).
|
|
580
|
-
return
|
|
595
|
+
protoOf(ProblogSolver).t3l = function (goal, options) {
|
|
596
|
+
return toList_0(this.e2g(goal, options));
|
|
581
597
|
};
|
|
582
598
|
protoOf(ProblogSolver).solveListWithOptions = function (goal, options) {
|
|
583
|
-
return this.
|
|
599
|
+
return this.t3l(goal, options);
|
|
584
600
|
};
|
|
585
|
-
protoOf(ProblogSolver).
|
|
586
|
-
return first_0(this.
|
|
601
|
+
protoOf(ProblogSolver).u3l = function (goal, timeout) {
|
|
602
|
+
return first_0(this.e2g(goal, Companion_getInstance_2().someLazilyWithTimeout(1, timeout)));
|
|
587
603
|
};
|
|
588
604
|
protoOf(ProblogSolver).solveOnceWithTimeout = function (goal, timeout) {
|
|
589
|
-
return this.
|
|
605
|
+
return this.u3l(goal, timeout);
|
|
590
606
|
};
|
|
591
|
-
protoOf(ProblogSolver).
|
|
592
|
-
return first_0(this.
|
|
607
|
+
protoOf(ProblogSolver).v3l = function (goal) {
|
|
608
|
+
return first_0(this.e2g(goal, Companion_getInstance_2().someLazily(1)));
|
|
593
609
|
};
|
|
594
610
|
protoOf(ProblogSolver).solveOnce = function (goal) {
|
|
595
|
-
return this.
|
|
611
|
+
return this.v3l(goal);
|
|
596
612
|
};
|
|
597
|
-
protoOf(ProblogSolver).
|
|
598
|
-
return first_0(this.
|
|
613
|
+
protoOf(ProblogSolver).w3l = function (goal, options) {
|
|
614
|
+
return first_0(this.e2g(goal, options.setLimit(1)));
|
|
599
615
|
};
|
|
600
616
|
protoOf(ProblogSolver).solveOnceWithOptions = function (goal, options) {
|
|
601
|
-
return this.
|
|
617
|
+
return this.w3l(goal, options);
|
|
602
618
|
};
|
|
603
619
|
protoOf(ProblogSolver).a1z = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
604
|
-
return new ProblogSolver(this.
|
|
605
|
-
};
|
|
606
|
-
protoOf(ProblogSolver).copy = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, $super) {
|
|
607
|
-
return this.copy(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, ($super == null ? true : $super instanceof ProblogSolver) ? $super : THROW_CCE());
|
|
620
|
+
return new ProblogSolver(this.o3l_1.a1z(unificator, libraries, flags, Companion_instance_10.ofIterable(unificator, staticKb), Companion_instance_10.ofIterable(unificator, dynamicKb), stdIn, stdOut, stdErr, warnings));
|
|
608
621
|
};
|
|
609
622
|
protoOf(ProblogSolver).k1v = function () {
|
|
610
|
-
return new ProblogSolver(this.
|
|
623
|
+
return new ProblogSolver(this.o3l_1.clone());
|
|
611
624
|
};
|
|
612
625
|
protoOf(ProblogSolver).clone = function () {
|
|
613
626
|
return this.k1v();
|
|
614
627
|
};
|
|
615
628
|
protoOf(ProblogSolver).t1x = function () {
|
|
616
|
-
return this.
|
|
629
|
+
return this.o3l_1.t1x();
|
|
617
630
|
};
|
|
618
631
|
protoOf(ProblogSolver).u1x = function () {
|
|
619
|
-
return this.
|
|
632
|
+
return this.o3l_1.u1x();
|
|
620
633
|
};
|
|
621
634
|
protoOf(ProblogSolver).v1x = function () {
|
|
622
|
-
return this.
|
|
635
|
+
return this.o3l_1.v1x();
|
|
623
636
|
};
|
|
624
637
|
protoOf(ProblogSolver).w1x = function () {
|
|
625
|
-
return this.
|
|
638
|
+
return this.o3l_1.w1x();
|
|
626
639
|
};
|
|
627
640
|
protoOf(ProblogSolver).c1y = function () {
|
|
628
|
-
return this.
|
|
641
|
+
return this.o3l_1.c1y();
|
|
629
642
|
};
|
|
630
643
|
protoOf(ProblogSolver).x1x = function () {
|
|
631
|
-
return this.
|
|
644
|
+
return this.o3l_1.x1x();
|
|
632
645
|
};
|
|
633
646
|
protoOf(ProblogSolver).y1x = function () {
|
|
634
|
-
return this.
|
|
647
|
+
return this.o3l_1.y1x();
|
|
635
648
|
};
|
|
636
649
|
protoOf(ProblogSolver).d1y = function () {
|
|
637
|
-
return this.
|
|
650
|
+
return this.o3l_1.d1y();
|
|
638
651
|
};
|
|
639
652
|
protoOf(ProblogSolver).e1y = function () {
|
|
640
|
-
return this.
|
|
653
|
+
return this.o3l_1.e1y();
|
|
641
654
|
};
|
|
642
655
|
protoOf(ProblogSolver).f1y = function () {
|
|
643
|
-
return this.
|
|
656
|
+
return this.o3l_1.f1y();
|
|
644
657
|
};
|
|
645
658
|
protoOf(ProblogSolver).g1y = function () {
|
|
646
|
-
return this.
|
|
659
|
+
return this.o3l_1.g1y();
|
|
647
660
|
};
|
|
648
661
|
protoOf(ProblogSolver).v1n = function () {
|
|
649
|
-
return this.
|
|
662
|
+
return this.o3l_1.v1n();
|
|
650
663
|
};
|
|
651
664
|
function ensureVariablesTracking($this, flags) {
|
|
652
665
|
var tmp = TrackVariables_getInstance();
|
|
@@ -656,7 +669,7 @@
|
|
|
656
669
|
var tmp;
|
|
657
670
|
// Inline function 'kotlin.collections.contains' call
|
|
658
671
|
// Inline function 'kotlin.collections.containsKey' call
|
|
659
|
-
var key = ProblogLib_getInstance().
|
|
672
|
+
var key = ProblogLib_getInstance().e2j();
|
|
660
673
|
if (!(isInterface(libraries, KtMap) ? libraries : THROW_CCE()).h2(key)) {
|
|
661
674
|
tmp = libraries.plusLibrary(MinimalBuiltins_getInstance());
|
|
662
675
|
} else {
|
|
@@ -665,36 +678,36 @@
|
|
|
665
678
|
return tmp;
|
|
666
679
|
}
|
|
667
680
|
function ProblogSolverFactory$ensureVariablesTracking$lambda($this$TrackVariables) {
|
|
668
|
-
return $this$TrackVariables.
|
|
681
|
+
return $this$TrackVariables.n2d_1;
|
|
669
682
|
}
|
|
670
683
|
function ProblogSolverFactory() {
|
|
671
684
|
}
|
|
672
|
-
protoOf(ProblogSolverFactory).
|
|
685
|
+
protoOf(ProblogSolverFactory).c21 = function () {
|
|
673
686
|
return DefaultBuiltins_getInstance_0();
|
|
674
687
|
};
|
|
675
|
-
protoOf(ProblogSolverFactory).
|
|
688
|
+
protoOf(ProblogSolverFactory).e21 = function () {
|
|
676
689
|
return ensureVariablesTracking(this, get_defaultFlags.call(this));
|
|
677
690
|
};
|
|
678
|
-
protoOf(ProblogSolverFactory).
|
|
679
|
-
return new ProblogSolver(PrologSolverFactory_instance.
|
|
691
|
+
protoOf(ProblogSolverFactory).n21 = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs) {
|
|
692
|
+
return new ProblogSolver(PrologSolverFactory_instance.n21(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_instance_10.ofIterable(unificator, staticKb), Companion_instance_10.ofIterable(unificator, dynamicKb), inputs, outputs));
|
|
680
693
|
};
|
|
681
694
|
protoOf(ProblogSolverFactory).rawSolverOf = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs, $super) {
|
|
682
695
|
return this.rawSolverOf(unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs, ($super == null ? true : $super instanceof ProblogSolverFactory) ? $super : THROW_CCE());
|
|
683
696
|
};
|
|
684
|
-
protoOf(ProblogSolverFactory).
|
|
685
|
-
return new ProblogSolver(PrologSolverFactory_instance.
|
|
697
|
+
protoOf(ProblogSolverFactory).t21 = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
698
|
+
return new ProblogSolver(PrologSolverFactory_instance.t21(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_instance_10.ofIterable(unificator, staticKb), Companion_instance_10.ofIterable(unificator, dynamicKb), stdIn, stdOut, stdErr, warnings));
|
|
686
699
|
};
|
|
687
700
|
protoOf(ProblogSolverFactory).solverOf = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, $super) {
|
|
688
701
|
return this.solverOf(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, ($super == null ? true : $super instanceof ProblogSolverFactory) ? $super : THROW_CCE());
|
|
689
702
|
};
|
|
690
|
-
protoOf(ProblogSolverFactory).
|
|
691
|
-
return new MutableProblogSolver(PrologSolverFactory_instance.
|
|
703
|
+
protoOf(ProblogSolverFactory).v21 = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
704
|
+
return new MutableProblogSolver(PrologSolverFactory_instance.v21(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_instance_10.ofIterable(unificator, staticKb), Companion_instance_10.ofIterable(unificator, dynamicKb), stdIn, stdOut, stdErr, warnings));
|
|
692
705
|
};
|
|
693
706
|
protoOf(ProblogSolverFactory).mutableSolverOf = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, $super) {
|
|
694
707
|
return this.mutableSolverOf(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, ($super == null ? true : $super instanceof ProblogSolverFactory) ? $super : THROW_CCE());
|
|
695
708
|
};
|
|
696
|
-
protoOf(ProblogSolverFactory).
|
|
697
|
-
return new MutableProblogSolver(PrologSolverFactory_instance.
|
|
709
|
+
protoOf(ProblogSolverFactory).x21 = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs) {
|
|
710
|
+
return new MutableProblogSolver(PrologSolverFactory_instance.x21(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_instance_10.ofIterable(unificator, staticKb), Companion_instance_10.ofIterable(unificator, dynamicKb), inputs, outputs));
|
|
698
711
|
};
|
|
699
712
|
protoOf(ProblogSolverFactory).rawMutableSolverOf = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs, $super) {
|
|
700
713
|
return this.rawMutableSolverOf(unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs, ($super == null ? true : $super instanceof ProblogSolverFactory) ? $super : THROW_CCE());
|
|
@@ -707,17 +720,17 @@
|
|
|
707
720
|
DefaultBuiltins_instance = this;
|
|
708
721
|
ExtensionLibrary.call(this, DefaultBuiltins_getInstance());
|
|
709
722
|
}
|
|
710
|
-
protoOf(DefaultBuiltins).
|
|
711
|
-
return ProblogLib_getInstance().
|
|
723
|
+
protoOf(DefaultBuiltins).e2j = function () {
|
|
724
|
+
return ProblogLib_getInstance().e2j();
|
|
712
725
|
};
|
|
713
|
-
protoOf(DefaultBuiltins).
|
|
714
|
-
return ProblogLib_getInstance().
|
|
726
|
+
protoOf(DefaultBuiltins).p2j = function () {
|
|
727
|
+
return ProblogLib_getInstance().p2j();
|
|
715
728
|
};
|
|
716
|
-
protoOf(DefaultBuiltins).
|
|
717
|
-
return ProblogLib_getInstance().
|
|
729
|
+
protoOf(DefaultBuiltins).r2j = function () {
|
|
730
|
+
return ProblogLib_getInstance().r2j();
|
|
718
731
|
};
|
|
719
|
-
protoOf(DefaultBuiltins).
|
|
720
|
-
return ProblogLib_getInstance().
|
|
732
|
+
protoOf(DefaultBuiltins).q2j = function () {
|
|
733
|
+
return ProblogLib_getInstance().q2j();
|
|
721
734
|
};
|
|
722
735
|
var DefaultBuiltins_instance;
|
|
723
736
|
function DefaultBuiltins_getInstance_0() {
|
|
@@ -729,10 +742,10 @@
|
|
|
729
742
|
MinimalBuiltins_instance = this;
|
|
730
743
|
ExtensionLibrary.call(this, ProblogLib_getInstance());
|
|
731
744
|
}
|
|
732
|
-
protoOf(MinimalBuiltins).
|
|
745
|
+
protoOf(MinimalBuiltins).r2j = function () {
|
|
733
746
|
return listOf(EnsureExecutable_getInstance());
|
|
734
747
|
};
|
|
735
|
-
protoOf(MinimalBuiltins).
|
|
748
|
+
protoOf(MinimalBuiltins).q2j = function () {
|
|
736
749
|
return listOf(Call_getInstance());
|
|
737
750
|
};
|
|
738
751
|
var MinimalBuiltins_instance;
|
|
@@ -744,17 +757,17 @@
|
|
|
744
757
|
function ProblogLib() {
|
|
745
758
|
ProblogLib_instance = this;
|
|
746
759
|
ExtensionLibrary.call(this, Companion_getInstance_3().of('problog.lang'));
|
|
747
|
-
this.
|
|
748
|
-
this.
|
|
749
|
-
this.
|
|
760
|
+
this.v3m_1 = 'EXPL';
|
|
761
|
+
this.w3m_1 = 'evidence';
|
|
762
|
+
this.x3m_1 = 'prob';
|
|
750
763
|
}
|
|
751
|
-
protoOf(ProblogLib).
|
|
764
|
+
protoOf(ProblogLib).p2j = function () {
|
|
752
765
|
return get_PROBLOG_SPECIFIC_OPERATORS();
|
|
753
766
|
};
|
|
754
|
-
protoOf(ProblogLib).
|
|
767
|
+
protoOf(ProblogLib).q2j = function () {
|
|
755
768
|
return listOf(Prob_getInstance());
|
|
756
769
|
};
|
|
757
|
-
protoOf(ProblogLib).
|
|
770
|
+
protoOf(ProblogLib).r2j = function () {
|
|
758
771
|
return listOf_0([ProbHelper_getInstance(), ProbSolve_getInstance(), ProbExplAnd_getInstance(), ProbQuery_getInstance(), ProbSolveEvidence_getInstance(), ProbSolveWithEvidence_getInstance(), ProbNegationAsFailure_getInstance(), ProbSetConfig_getInstance()]);
|
|
759
772
|
};
|
|
760
773
|
var ProblogLib_instance;
|
|
@@ -767,11 +780,11 @@
|
|
|
767
780
|
cause = cause === VOID ? null : cause;
|
|
768
781
|
TuPrologException_init_$Init$(cause, this);
|
|
769
782
|
captureStack(this, ClauseMappingException);
|
|
770
|
-
this.
|
|
783
|
+
this.e3n_1 = message;
|
|
771
784
|
delete this.message;
|
|
772
785
|
}
|
|
773
786
|
protoOf(ClauseMappingException).p1 = function () {
|
|
774
|
-
return this.
|
|
787
|
+
return this.e3n_1;
|
|
775
788
|
};
|
|
776
789
|
function Companion() {
|
|
777
790
|
}
|
|
@@ -807,11 +820,11 @@
|
|
|
807
820
|
}
|
|
808
821
|
function Companion_0() {
|
|
809
822
|
Companion_instance_9 = this;
|
|
810
|
-
this.
|
|
811
|
-
this.
|
|
823
|
+
this.f3n_1 = new BinaryDecisionDiagramExplanation(bddTerminalOf(false), Companion_getInstance_13().i3n_1);
|
|
824
|
+
this.g3n_1 = new BinaryDecisionDiagramExplanation(bddTerminalOf(true), Companion_getInstance_13().j3n_1);
|
|
812
825
|
}
|
|
813
|
-
protoOf(Companion_0).
|
|
814
|
-
return new BinaryDecisionDiagramExplanation(bddOf(term), new ComputedValue(term.
|
|
826
|
+
protoOf(Companion_0).k3n = function (term) {
|
|
827
|
+
return new BinaryDecisionDiagramExplanation(bddOf(term), new ComputedValue(term.n3n_1));
|
|
815
828
|
};
|
|
816
829
|
var Companion_instance_9;
|
|
817
830
|
function Companion_getInstance_11() {
|
|
@@ -822,348 +835,348 @@
|
|
|
822
835
|
function ProbExplanation() {
|
|
823
836
|
}
|
|
824
837
|
function ProbExplanationTerm$freshCopy$lambda(it) {
|
|
825
|
-
return it.
|
|
838
|
+
return it.ax();
|
|
826
839
|
}
|
|
827
840
|
function ProbExplanationTerm$freshCopy$lambda_0($scope) {
|
|
828
841
|
return function (it) {
|
|
829
|
-
return it.
|
|
842
|
+
return it.bx($scope);
|
|
830
843
|
};
|
|
831
844
|
}
|
|
832
845
|
function ProbExplanationTerm$apply$lambda($substitution) {
|
|
833
846
|
return function (it) {
|
|
834
|
-
return it.
|
|
847
|
+
return it.q17($substitution);
|
|
835
848
|
};
|
|
836
849
|
}
|
|
837
850
|
function ProbExplanationTerm(explanation) {
|
|
838
|
-
this.
|
|
839
|
-
this.
|
|
851
|
+
this.c3m_1 = Companion_getInstance_4().of('<expl:' + explanation.toString() + '>');
|
|
852
|
+
this.d3m_1 = explanation;
|
|
840
853
|
}
|
|
841
|
-
protoOf(ProbExplanationTerm).
|
|
854
|
+
protoOf(ProbExplanationTerm).wx = function () {
|
|
842
855
|
return false;
|
|
843
856
|
};
|
|
844
|
-
protoOf(ProbExplanationTerm).
|
|
857
|
+
protoOf(ProbExplanationTerm).ay = function () {
|
|
845
858
|
return this;
|
|
846
859
|
};
|
|
847
860
|
protoOf(ProbExplanationTerm).asConstant = function () {
|
|
848
|
-
return this.
|
|
861
|
+
return this.ay();
|
|
849
862
|
};
|
|
850
|
-
protoOf(ProbExplanationTerm).
|
|
851
|
-
return new ProbExplanationTerm(this.
|
|
863
|
+
protoOf(ProbExplanationTerm).ax = function () {
|
|
864
|
+
return new ProbExplanationTerm(this.d3m_1.applyTransformation(ProbExplanationTerm$freshCopy$lambda));
|
|
852
865
|
};
|
|
853
866
|
protoOf(ProbExplanationTerm).freshCopy = function () {
|
|
854
|
-
return this.
|
|
867
|
+
return this.ax();
|
|
855
868
|
};
|
|
856
|
-
protoOf(ProbExplanationTerm).
|
|
857
|
-
return new ProbExplanationTerm(this.
|
|
869
|
+
protoOf(ProbExplanationTerm).bx = function (scope) {
|
|
870
|
+
return new ProbExplanationTerm(this.d3m_1.applyTransformation(ProbExplanationTerm$freshCopy$lambda_0(scope)));
|
|
858
871
|
};
|
|
859
872
|
protoOf(ProbExplanationTerm).freshCopyFromScope = function (scope) {
|
|
860
|
-
return this.
|
|
873
|
+
return this.bx(scope);
|
|
861
874
|
};
|
|
862
|
-
protoOf(ProbExplanationTerm).
|
|
863
|
-
return this.
|
|
875
|
+
protoOf(ProbExplanationTerm).p2u = function (substitution, substitutions) {
|
|
876
|
+
return this.q2u(substitution, substitutions.slice());
|
|
864
877
|
};
|
|
865
878
|
protoOf(ProbExplanationTerm).getSubstituted = function (substitution, substitutions) {
|
|
866
|
-
return this.
|
|
879
|
+
return this.p2u(substitution, substitutions);
|
|
867
880
|
};
|
|
868
|
-
protoOf(ProbExplanationTerm).
|
|
869
|
-
return this.
|
|
881
|
+
protoOf(ProbExplanationTerm).q2u = function (substitution, substitutions) {
|
|
882
|
+
return this.q17(Companion_getInstance_5().ofSubstitution(substitution, substitutions.slice()));
|
|
870
883
|
};
|
|
871
884
|
protoOf(ProbExplanationTerm).apply = function (substitution, substitutions) {
|
|
872
|
-
return this.
|
|
885
|
+
return this.q2u(substitution, substitutions);
|
|
873
886
|
};
|
|
874
|
-
protoOf(ProbExplanationTerm).
|
|
887
|
+
protoOf(ProbExplanationTerm).q17 = function (substitution) {
|
|
875
888
|
var tmp;
|
|
876
|
-
if (substitution.i() || this.
|
|
889
|
+
if (substitution.i() || this.by()) {
|
|
877
890
|
tmp = this;
|
|
878
891
|
} else {
|
|
879
|
-
tmp = new ProbExplanationTerm(this.
|
|
892
|
+
tmp = new ProbExplanationTerm(this.d3m_1.applyTransformation(ProbExplanationTerm$apply$lambda(substitution)));
|
|
880
893
|
}
|
|
881
894
|
return tmp;
|
|
882
895
|
};
|
|
883
896
|
protoOf(ProbExplanationTerm).applySubstitution = function (substitution) {
|
|
884
|
-
return this.
|
|
897
|
+
return this.q17(substitution);
|
|
885
898
|
};
|
|
886
|
-
protoOf(ProbExplanationTerm).
|
|
887
|
-
return !this.
|
|
899
|
+
protoOf(ProbExplanationTerm).by = function () {
|
|
900
|
+
return !this.d3m_1.u3n();
|
|
888
901
|
};
|
|
889
|
-
protoOf(ProbExplanationTerm).
|
|
890
|
-
return this.
|
|
902
|
+
protoOf(ProbExplanationTerm).cx = function () {
|
|
903
|
+
return this.c3m_1.cx();
|
|
891
904
|
};
|
|
892
905
|
protoOf(ProbExplanationTerm).asAtom = function () {
|
|
893
|
-
return this.
|
|
906
|
+
return this.cx();
|
|
907
|
+
};
|
|
908
|
+
protoOf(ProbExplanationTerm).rw = function () {
|
|
909
|
+
return this.c3m_1.rw();
|
|
894
910
|
};
|
|
895
911
|
protoOf(ProbExplanationTerm).sw = function () {
|
|
896
|
-
return this.
|
|
912
|
+
return this.c3m_1.sw();
|
|
897
913
|
};
|
|
898
914
|
protoOf(ProbExplanationTerm).tw = function () {
|
|
899
|
-
return this.
|
|
915
|
+
return this.c3m_1.tw();
|
|
900
916
|
};
|
|
901
917
|
protoOf(ProbExplanationTerm).uw = function () {
|
|
902
|
-
return this.
|
|
918
|
+
return this.c3m_1.uw();
|
|
903
919
|
};
|
|
904
920
|
protoOf(ProbExplanationTerm).vw = function () {
|
|
905
|
-
return this.
|
|
906
|
-
};
|
|
907
|
-
protoOf(ProbExplanationTerm).ww = function () {
|
|
908
|
-
return this.v3l_1.ww();
|
|
921
|
+
return this.c3m_1.vw();
|
|
909
922
|
};
|
|
910
923
|
protoOf(ProbExplanationTerm).f1 = function () {
|
|
911
|
-
return this.
|
|
924
|
+
return this.c3m_1.f1();
|
|
912
925
|
};
|
|
913
|
-
protoOf(ProbExplanationTerm).
|
|
914
|
-
return this.
|
|
926
|
+
protoOf(ProbExplanationTerm).yw = function () {
|
|
927
|
+
return this.c3m_1.yw();
|
|
915
928
|
};
|
|
916
|
-
protoOf(ProbExplanationTerm).
|
|
917
|
-
return this.
|
|
929
|
+
protoOf(ProbExplanationTerm).zw = function () {
|
|
930
|
+
return this.c3m_1.zw();
|
|
918
931
|
};
|
|
919
|
-
protoOf(ProbExplanationTerm).
|
|
920
|
-
return this.
|
|
932
|
+
protoOf(ProbExplanationTerm).nx = function () {
|
|
933
|
+
return this.c3m_1.nx();
|
|
921
934
|
};
|
|
922
935
|
protoOf(ProbExplanationTerm).asStruct = function () {
|
|
923
|
-
return this.
|
|
936
|
+
return this.nx();
|
|
924
937
|
};
|
|
925
938
|
protoOf(ProbExplanationTerm).append = function (argument) {
|
|
926
|
-
return this.
|
|
939
|
+
return this.c3m_1.append(argument);
|
|
927
940
|
};
|
|
928
941
|
protoOf(ProbExplanationTerm).addLast = function (argument) {
|
|
929
|
-
return this.
|
|
942
|
+
return this.c3m_1.addLast(argument);
|
|
930
943
|
};
|
|
931
944
|
protoOf(ProbExplanationTerm).addFirst = function (argument) {
|
|
932
|
-
return this.
|
|
945
|
+
return this.c3m_1.addFirst(argument);
|
|
933
946
|
};
|
|
934
947
|
protoOf(ProbExplanationTerm).insertAt = function (index, argument) {
|
|
935
|
-
return this.
|
|
948
|
+
return this.c3m_1.insertAt(index, argument);
|
|
936
949
|
};
|
|
937
950
|
protoOf(ProbExplanationTerm).setFunctor = function (functor) {
|
|
938
|
-
return this.
|
|
951
|
+
return this.c3m_1.setFunctor(functor);
|
|
939
952
|
};
|
|
940
953
|
protoOf(ProbExplanationTerm).getArgAt = function (index) {
|
|
941
|
-
return this.
|
|
954
|
+
return this.c3m_1.getArgAt(index);
|
|
942
955
|
};
|
|
943
956
|
protoOf(ProbExplanationTerm).setArgs = function (args) {
|
|
944
|
-
return this.
|
|
957
|
+
return this.c3m_1.setArgs(args);
|
|
945
958
|
};
|
|
946
959
|
protoOf(ProbExplanationTerm).setArgsIterable = function (args) {
|
|
947
|
-
return this.
|
|
960
|
+
return this.c3m_1.setArgsIterable(args);
|
|
948
961
|
};
|
|
949
962
|
protoOf(ProbExplanationTerm).setArgsSequence = function (args) {
|
|
950
|
-
return this.
|
|
963
|
+
return this.c3m_1.setArgsSequence(args);
|
|
951
964
|
};
|
|
952
965
|
protoOf(ProbExplanationTerm).get = function (index) {
|
|
953
|
-
return this.
|
|
966
|
+
return this.c3m_1.get(index);
|
|
967
|
+
};
|
|
968
|
+
protoOf(ProbExplanationTerm).dx = function () {
|
|
969
|
+
return this.c3m_1.dx();
|
|
954
970
|
};
|
|
955
971
|
protoOf(ProbExplanationTerm).ex = function () {
|
|
956
|
-
return this.
|
|
972
|
+
return this.c3m_1.ex();
|
|
957
973
|
};
|
|
958
974
|
protoOf(ProbExplanationTerm).fx = function () {
|
|
959
|
-
return this.
|
|
975
|
+
return this.c3m_1.fx();
|
|
960
976
|
};
|
|
961
|
-
protoOf(ProbExplanationTerm).
|
|
962
|
-
return this.
|
|
977
|
+
protoOf(ProbExplanationTerm).ix = function () {
|
|
978
|
+
return this.c3m_1.ix();
|
|
963
979
|
};
|
|
964
980
|
protoOf(ProbExplanationTerm).jx = function () {
|
|
965
|
-
return this.
|
|
981
|
+
return this.c3m_1.jx();
|
|
966
982
|
};
|
|
967
983
|
protoOf(ProbExplanationTerm).kx = function () {
|
|
968
|
-
return this.
|
|
984
|
+
return this.c3m_1.kx();
|
|
969
985
|
};
|
|
970
|
-
protoOf(ProbExplanationTerm).
|
|
971
|
-
return this.
|
|
986
|
+
protoOf(ProbExplanationTerm).mx = function () {
|
|
987
|
+
return this.c3m_1.mx();
|
|
972
988
|
};
|
|
973
|
-
protoOf(ProbExplanationTerm).
|
|
974
|
-
return this.
|
|
989
|
+
protoOf(ProbExplanationTerm).xw = function () {
|
|
990
|
+
return this.c3m_1.xw();
|
|
975
991
|
};
|
|
976
|
-
protoOf(ProbExplanationTerm).
|
|
977
|
-
return this.
|
|
992
|
+
protoOf(ProbExplanationTerm).ox = function () {
|
|
993
|
+
return this.c3m_1.ox();
|
|
978
994
|
};
|
|
979
995
|
protoOf(ProbExplanationTerm).px = function () {
|
|
980
|
-
return this.
|
|
996
|
+
return this.c3m_1.px();
|
|
981
997
|
};
|
|
982
998
|
protoOf(ProbExplanationTerm).qx = function () {
|
|
983
|
-
return this.
|
|
999
|
+
return this.c3m_1.qx();
|
|
984
1000
|
};
|
|
985
1001
|
protoOf(ProbExplanationTerm).rx = function () {
|
|
986
|
-
return this.
|
|
1002
|
+
return this.c3m_1.rx();
|
|
987
1003
|
};
|
|
988
|
-
protoOf(ProbExplanationTerm).
|
|
989
|
-
return this.
|
|
1004
|
+
protoOf(ProbExplanationTerm).mr = function () {
|
|
1005
|
+
return this.rx();
|
|
990
1006
|
};
|
|
991
|
-
protoOf(ProbExplanationTerm).
|
|
992
|
-
return this.sx();
|
|
993
|
-
};
|
|
994
|
-
protoOf(ProbExplanationTerm).tx = function (other) {
|
|
995
|
-
return this.v3l_1.tx(other);
|
|
1007
|
+
protoOf(ProbExplanationTerm).sx = function (other) {
|
|
1008
|
+
return this.c3m_1.sx(other);
|
|
996
1009
|
};
|
|
997
1010
|
protoOf(ProbExplanationTerm).d = function (other) {
|
|
998
|
-
return this.
|
|
1011
|
+
return this.sx((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
|
|
999
1012
|
};
|
|
1000
1013
|
protoOf(ProbExplanationTerm).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
1001
|
-
return this.
|
|
1014
|
+
return this.c3m_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
1002
1015
|
};
|
|
1003
1016
|
protoOf(ProbExplanationTerm).equals = function (other) {
|
|
1004
|
-
return this.
|
|
1017
|
+
return this.c3m_1.equals(other);
|
|
1005
1018
|
};
|
|
1006
1019
|
protoOf(ProbExplanationTerm).structurallyEquals = function (other) {
|
|
1007
|
-
return this.
|
|
1020
|
+
return this.c3m_1.structurallyEquals(other);
|
|
1008
1021
|
};
|
|
1009
1022
|
protoOf(ProbExplanationTerm).accept = function (visitor) {
|
|
1010
|
-
return this.
|
|
1023
|
+
return this.c3m_1.accept(visitor);
|
|
1011
1024
|
};
|
|
1012
1025
|
protoOf(ProbExplanationTerm).castToAtom = function () {
|
|
1013
|
-
return this.
|
|
1026
|
+
return this.c3m_1.castToAtom();
|
|
1014
1027
|
};
|
|
1015
1028
|
protoOf(ProbExplanationTerm).castToClause = function () {
|
|
1016
|
-
return this.
|
|
1029
|
+
return this.c3m_1.castToClause();
|
|
1017
1030
|
};
|
|
1018
1031
|
protoOf(ProbExplanationTerm).castToCons = function () {
|
|
1019
|
-
return this.
|
|
1032
|
+
return this.c3m_1.castToCons();
|
|
1020
1033
|
};
|
|
1021
1034
|
protoOf(ProbExplanationTerm).castToConstant = function () {
|
|
1022
|
-
return this.
|
|
1035
|
+
return this.c3m_1.castToConstant();
|
|
1023
1036
|
};
|
|
1024
1037
|
protoOf(ProbExplanationTerm).castToDirective = function () {
|
|
1025
|
-
return this.
|
|
1038
|
+
return this.c3m_1.castToDirective();
|
|
1026
1039
|
};
|
|
1027
1040
|
protoOf(ProbExplanationTerm).castToEmptyList = function () {
|
|
1028
|
-
return this.
|
|
1041
|
+
return this.c3m_1.castToEmptyList();
|
|
1029
1042
|
};
|
|
1030
1043
|
protoOf(ProbExplanationTerm).castToEmptyBlock = function () {
|
|
1031
|
-
return this.
|
|
1044
|
+
return this.c3m_1.castToEmptyBlock();
|
|
1032
1045
|
};
|
|
1033
1046
|
protoOf(ProbExplanationTerm).castToFact = function () {
|
|
1034
|
-
return this.
|
|
1047
|
+
return this.c3m_1.castToFact();
|
|
1035
1048
|
};
|
|
1036
1049
|
protoOf(ProbExplanationTerm).castToIndicator = function () {
|
|
1037
|
-
return this.
|
|
1050
|
+
return this.c3m_1.castToIndicator();
|
|
1038
1051
|
};
|
|
1039
1052
|
protoOf(ProbExplanationTerm).castToInteger = function () {
|
|
1040
|
-
return this.
|
|
1053
|
+
return this.c3m_1.castToInteger();
|
|
1041
1054
|
};
|
|
1042
1055
|
protoOf(ProbExplanationTerm).castToList = function () {
|
|
1043
|
-
return this.
|
|
1056
|
+
return this.c3m_1.castToList();
|
|
1044
1057
|
};
|
|
1045
1058
|
protoOf(ProbExplanationTerm).castToNumeric = function () {
|
|
1046
|
-
return this.
|
|
1059
|
+
return this.c3m_1.castToNumeric();
|
|
1047
1060
|
};
|
|
1048
1061
|
protoOf(ProbExplanationTerm).castToReal = function () {
|
|
1049
|
-
return this.
|
|
1062
|
+
return this.c3m_1.castToReal();
|
|
1050
1063
|
};
|
|
1051
1064
|
protoOf(ProbExplanationTerm).castToRule = function () {
|
|
1052
|
-
return this.
|
|
1065
|
+
return this.c3m_1.castToRule();
|
|
1053
1066
|
};
|
|
1054
1067
|
protoOf(ProbExplanationTerm).castToBlock = function () {
|
|
1055
|
-
return this.
|
|
1068
|
+
return this.c3m_1.castToBlock();
|
|
1056
1069
|
};
|
|
1057
1070
|
protoOf(ProbExplanationTerm).castToStruct = function () {
|
|
1058
|
-
return this.
|
|
1071
|
+
return this.c3m_1.castToStruct();
|
|
1059
1072
|
};
|
|
1060
1073
|
protoOf(ProbExplanationTerm).castToRecursive = function () {
|
|
1061
|
-
return this.
|
|
1074
|
+
return this.c3m_1.castToRecursive();
|
|
1062
1075
|
};
|
|
1063
1076
|
protoOf(ProbExplanationTerm).castToTerm = function () {
|
|
1064
|
-
return this.
|
|
1077
|
+
return this.c3m_1.castToTerm();
|
|
1065
1078
|
};
|
|
1066
1079
|
protoOf(ProbExplanationTerm).castToTruth = function () {
|
|
1067
|
-
return this.
|
|
1080
|
+
return this.c3m_1.castToTruth();
|
|
1068
1081
|
};
|
|
1069
1082
|
protoOf(ProbExplanationTerm).castToTuple = function () {
|
|
1070
|
-
return this.
|
|
1083
|
+
return this.c3m_1.castToTuple();
|
|
1071
1084
|
};
|
|
1072
1085
|
protoOf(ProbExplanationTerm).castToVar = function () {
|
|
1073
|
-
return this.
|
|
1086
|
+
return this.c3m_1.castToVar();
|
|
1074
1087
|
};
|
|
1075
1088
|
protoOf(ProbExplanationTerm).asClause = function () {
|
|
1076
|
-
return this.
|
|
1089
|
+
return this.c3m_1.asClause();
|
|
1077
1090
|
};
|
|
1078
1091
|
protoOf(ProbExplanationTerm).asCons = function () {
|
|
1079
|
-
return this.
|
|
1092
|
+
return this.c3m_1.asCons();
|
|
1080
1093
|
};
|
|
1081
1094
|
protoOf(ProbExplanationTerm).asDirective = function () {
|
|
1082
|
-
return this.
|
|
1095
|
+
return this.c3m_1.asDirective();
|
|
1083
1096
|
};
|
|
1084
1097
|
protoOf(ProbExplanationTerm).asEmptyList = function () {
|
|
1085
|
-
return this.
|
|
1098
|
+
return this.c3m_1.asEmptyList();
|
|
1086
1099
|
};
|
|
1087
1100
|
protoOf(ProbExplanationTerm).asEmptyBlock = function () {
|
|
1088
|
-
return this.
|
|
1101
|
+
return this.c3m_1.asEmptyBlock();
|
|
1089
1102
|
};
|
|
1090
1103
|
protoOf(ProbExplanationTerm).asFact = function () {
|
|
1091
|
-
return this.
|
|
1104
|
+
return this.c3m_1.asFact();
|
|
1092
1105
|
};
|
|
1093
1106
|
protoOf(ProbExplanationTerm).asIndicator = function () {
|
|
1094
|
-
return this.
|
|
1107
|
+
return this.c3m_1.asIndicator();
|
|
1095
1108
|
};
|
|
1096
1109
|
protoOf(ProbExplanationTerm).asInteger = function () {
|
|
1097
|
-
return this.
|
|
1110
|
+
return this.c3m_1.asInteger();
|
|
1098
1111
|
};
|
|
1099
1112
|
protoOf(ProbExplanationTerm).asList = function () {
|
|
1100
|
-
return this.
|
|
1113
|
+
return this.c3m_1.asList();
|
|
1101
1114
|
};
|
|
1102
1115
|
protoOf(ProbExplanationTerm).asNumeric = function () {
|
|
1103
|
-
return this.
|
|
1116
|
+
return this.c3m_1.asNumeric();
|
|
1104
1117
|
};
|
|
1105
1118
|
protoOf(ProbExplanationTerm).asReal = function () {
|
|
1106
|
-
return this.
|
|
1119
|
+
return this.c3m_1.asReal();
|
|
1107
1120
|
};
|
|
1108
1121
|
protoOf(ProbExplanationTerm).asRule = function () {
|
|
1109
|
-
return this.
|
|
1122
|
+
return this.c3m_1.asRule();
|
|
1110
1123
|
};
|
|
1111
1124
|
protoOf(ProbExplanationTerm).asBlock = function () {
|
|
1112
|
-
return this.
|
|
1125
|
+
return this.c3m_1.asBlock();
|
|
1113
1126
|
};
|
|
1114
1127
|
protoOf(ProbExplanationTerm).asRecursive = function () {
|
|
1115
|
-
return this.
|
|
1128
|
+
return this.c3m_1.asRecursive();
|
|
1116
1129
|
};
|
|
1117
1130
|
protoOf(ProbExplanationTerm).asTerm = function () {
|
|
1118
|
-
return this.
|
|
1131
|
+
return this.c3m_1.asTerm();
|
|
1119
1132
|
};
|
|
1120
1133
|
protoOf(ProbExplanationTerm).asTruth = function () {
|
|
1121
|
-
return this.
|
|
1134
|
+
return this.c3m_1.asTruth();
|
|
1122
1135
|
};
|
|
1123
1136
|
protoOf(ProbExplanationTerm).asTuple = function () {
|
|
1124
|
-
return this.
|
|
1137
|
+
return this.c3m_1.asTuple();
|
|
1125
1138
|
};
|
|
1126
1139
|
protoOf(ProbExplanationTerm).asVar = function () {
|
|
1127
|
-
return this.
|
|
1140
|
+
return this.c3m_1.asVar();
|
|
1128
1141
|
};
|
|
1129
1142
|
protoOf(ProbExplanationTerm).hashCode = function () {
|
|
1130
|
-
return this.
|
|
1143
|
+
return this.c3m_1.hashCode();
|
|
1131
1144
|
};
|
|
1132
1145
|
protoOf(ProbExplanationTerm).toString = function () {
|
|
1133
|
-
return this.
|
|
1146
|
+
return this.c3m_1.toString();
|
|
1147
|
+
};
|
|
1148
|
+
protoOf(ProbExplanationTerm).tx = function () {
|
|
1149
|
+
return this.c3m_1.tx();
|
|
1134
1150
|
};
|
|
1135
1151
|
protoOf(ProbExplanationTerm).ux = function () {
|
|
1136
|
-
return this.
|
|
1152
|
+
return this.c3m_1.ux();
|
|
1137
1153
|
};
|
|
1138
1154
|
protoOf(ProbExplanationTerm).vx = function () {
|
|
1139
|
-
return this.
|
|
1155
|
+
return this.c3m_1.vx();
|
|
1140
1156
|
};
|
|
1141
|
-
protoOf(ProbExplanationTerm).
|
|
1142
|
-
return this.
|
|
1157
|
+
protoOf(ProbExplanationTerm).xx = function () {
|
|
1158
|
+
return this.c3m_1.xx();
|
|
1143
1159
|
};
|
|
1144
1160
|
protoOf(ProbExplanationTerm).yx = function () {
|
|
1145
|
-
return this.
|
|
1161
|
+
return this.c3m_1.yx();
|
|
1146
1162
|
};
|
|
1147
1163
|
protoOf(ProbExplanationTerm).zx = function () {
|
|
1148
|
-
return this.
|
|
1149
|
-
};
|
|
1150
|
-
protoOf(ProbExplanationTerm).ay = function () {
|
|
1151
|
-
return this.v3l_1.ay();
|
|
1164
|
+
return this.c3m_1.zx();
|
|
1152
1165
|
};
|
|
1153
1166
|
protoOf(ProbExplanationTerm).getTag = function (name) {
|
|
1154
|
-
return this.
|
|
1167
|
+
return this.c3m_1.getTag(name);
|
|
1155
1168
|
};
|
|
1156
1169
|
protoOf(ProbExplanationTerm).resetTags = function (tags) {
|
|
1157
|
-
return this.
|
|
1170
|
+
return this.c3m_1.resetTags(tags);
|
|
1158
1171
|
};
|
|
1159
1172
|
protoOf(ProbExplanationTerm).containsTag = function (name) {
|
|
1160
|
-
return this.
|
|
1173
|
+
return this.c3m_1.containsTag(name);
|
|
1161
1174
|
};
|
|
1162
|
-
protoOf(ProbExplanationTerm).
|
|
1163
|
-
return this.
|
|
1175
|
+
protoOf(ProbExplanationTerm).cu = function () {
|
|
1176
|
+
return this.c3m_1.cu();
|
|
1164
1177
|
};
|
|
1165
1178
|
function _get_cachedHashCode__d7x0zy($this) {
|
|
1166
|
-
var tmp0 = $this.
|
|
1179
|
+
var tmp0 = $this.r3n_1;
|
|
1167
1180
|
var tmp = KProperty1;
|
|
1168
1181
|
// Inline function 'kotlin.getValue' call
|
|
1169
1182
|
getPropertyCallableRef('cachedHashCode', 1, tmp, ProbTerm$_get_cachedHashCode_$ref_1qdqtc(), null);
|
|
@@ -1172,8 +1185,8 @@
|
|
|
1172
1185
|
function ProbTerm$isGround$delegate$lambda(this$0) {
|
|
1173
1186
|
return function () {
|
|
1174
1187
|
var tmp;
|
|
1175
|
-
if (this$0.
|
|
1176
|
-
var tmp0 = this$0.
|
|
1188
|
+
if (this$0.o3n_1.by()) {
|
|
1189
|
+
var tmp0 = this$0.p3n_1;
|
|
1177
1190
|
var tmp$ret$0;
|
|
1178
1191
|
$l$block_0: {
|
|
1179
1192
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -1190,7 +1203,7 @@
|
|
|
1190
1203
|
var _iterator__ex2g4s = tmp0.n();
|
|
1191
1204
|
while (_iterator__ex2g4s.q()) {
|
|
1192
1205
|
var element = _iterator__ex2g4s.r();
|
|
1193
|
-
if (element.
|
|
1206
|
+
if (element.tx()) {
|
|
1194
1207
|
tmp$ret$0 = true;
|
|
1195
1208
|
break $l$block_0;
|
|
1196
1209
|
}
|
|
@@ -1206,39 +1219,39 @@
|
|
|
1206
1219
|
}
|
|
1207
1220
|
function ProbTerm$_get_isGround_$ref_ue0rck() {
|
|
1208
1221
|
return constructCallableReference(function (p0) {
|
|
1209
|
-
return p0.
|
|
1210
|
-
}, 1, 0,
|
|
1222
|
+
return p0.by();
|
|
1223
|
+
}, 1, 0, 93);
|
|
1211
1224
|
}
|
|
1212
1225
|
function ProbTerm$cachedHashCode$delegate$lambda(this$0) {
|
|
1213
1226
|
return function () {
|
|
1214
|
-
var result = getBigIntHashCode(this$0.
|
|
1215
|
-
result = imul(31, result) + getNumberHashCode(this$0.
|
|
1216
|
-
result = imul(31, result) + this$0.
|
|
1217
|
-
result = imul(31, result) + hashCode(this$0.
|
|
1227
|
+
var result = getBigIntHashCode(this$0.m3n_1);
|
|
1228
|
+
result = imul(31, result) + getNumberHashCode(this$0.n3n_1) | 0;
|
|
1229
|
+
result = imul(31, result) + this$0.o3n_1.hashCode() | 0;
|
|
1230
|
+
result = imul(31, result) + hashCode(this$0.p3n_1) | 0;
|
|
1218
1231
|
return result;
|
|
1219
1232
|
};
|
|
1220
1233
|
}
|
|
1221
1234
|
function ProbTerm$_get_cachedHashCode_$ref_1qdqtc() {
|
|
1222
1235
|
return constructCallableReference(function (p0) {
|
|
1223
1236
|
return _get_cachedHashCode__d7x0zy(p0);
|
|
1224
|
-
}, 1, 0,
|
|
1237
|
+
}, 1, 0, 94);
|
|
1225
1238
|
}
|
|
1226
1239
|
function ProbTerm(id, probability, term, extraVariables) {
|
|
1227
1240
|
extraVariables = extraVariables === VOID ? emptySet() : extraVariables;
|
|
1228
|
-
this.
|
|
1229
|
-
this.
|
|
1230
|
-
this.
|
|
1231
|
-
this.
|
|
1232
|
-
this.
|
|
1241
|
+
this.l3n_1 = Companion_getInstance_1().of('::', [Companion_getInstance_6().ofDouble(probability), term]);
|
|
1242
|
+
this.m3n_1 = id;
|
|
1243
|
+
this.n3n_1 = probability;
|
|
1244
|
+
this.o3n_1 = term;
|
|
1245
|
+
this.p3n_1 = extraVariables;
|
|
1233
1246
|
var tmp = this;
|
|
1234
|
-
tmp.
|
|
1247
|
+
tmp.q3n_1 = lazy(ProbTerm$isGround$delegate$lambda(this));
|
|
1235
1248
|
var tmp_0 = this;
|
|
1236
|
-
tmp_0.
|
|
1249
|
+
tmp_0.r3n_1 = lazy(ProbTerm$cachedHashCode$delegate$lambda(this));
|
|
1237
1250
|
}
|
|
1238
|
-
protoOf(ProbTerm).
|
|
1239
|
-
var termCopy = this.
|
|
1251
|
+
protoOf(ProbTerm).ax = function () {
|
|
1252
|
+
var termCopy = this.o3n_1.freshCopy();
|
|
1240
1253
|
// Inline function 'kotlin.collections.map' call
|
|
1241
|
-
var this_0 = this.
|
|
1254
|
+
var this_0 = this.p3n_1;
|
|
1242
1255
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1243
1256
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1244
1257
|
var _iterator__ex2g4s = this_0.n();
|
|
@@ -1247,15 +1260,15 @@
|
|
|
1247
1260
|
var tmp$ret$2 = item.freshCopy();
|
|
1248
1261
|
destination.l(tmp$ret$2);
|
|
1249
1262
|
}
|
|
1250
|
-
return new ProbTerm(this.
|
|
1263
|
+
return new ProbTerm(this.m3n_1, this.n3n_1, termCopy, toSet(destination));
|
|
1251
1264
|
};
|
|
1252
1265
|
protoOf(ProbTerm).freshCopy = function () {
|
|
1253
|
-
return this.
|
|
1266
|
+
return this.ax();
|
|
1254
1267
|
};
|
|
1255
|
-
protoOf(ProbTerm).
|
|
1256
|
-
var termCopy = this.
|
|
1268
|
+
protoOf(ProbTerm).bx = function (scope) {
|
|
1269
|
+
var termCopy = this.o3n_1.freshCopyFromScope(scope);
|
|
1257
1270
|
// Inline function 'kotlin.collections.map' call
|
|
1258
|
-
var this_0 = this.
|
|
1271
|
+
var this_0 = this.p3n_1;
|
|
1259
1272
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1260
1273
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1261
1274
|
var _iterator__ex2g4s = this_0.n();
|
|
@@ -1264,30 +1277,30 @@
|
|
|
1264
1277
|
var tmp$ret$2 = item.freshCopyFromScope(scope);
|
|
1265
1278
|
destination.l(tmp$ret$2);
|
|
1266
1279
|
}
|
|
1267
|
-
return new ProbTerm(this.
|
|
1280
|
+
return new ProbTerm(this.m3n_1, this.n3n_1, termCopy, toSet(destination));
|
|
1268
1281
|
};
|
|
1269
1282
|
protoOf(ProbTerm).freshCopyFromScope = function (scope) {
|
|
1270
|
-
return this.
|
|
1283
|
+
return this.bx(scope);
|
|
1271
1284
|
};
|
|
1272
|
-
protoOf(ProbTerm).
|
|
1273
|
-
return this.
|
|
1285
|
+
protoOf(ProbTerm).p2u = function (substitution, substitutions) {
|
|
1286
|
+
return this.q2u(substitution, substitutions.slice());
|
|
1274
1287
|
};
|
|
1275
1288
|
protoOf(ProbTerm).getSubstituted = function (substitution, substitutions) {
|
|
1276
|
-
return this.
|
|
1289
|
+
return this.p2u(substitution, substitutions);
|
|
1277
1290
|
};
|
|
1278
|
-
protoOf(ProbTerm).
|
|
1279
|
-
return this.
|
|
1291
|
+
protoOf(ProbTerm).q2u = function (substitution, substitutions) {
|
|
1292
|
+
return this.q17(Companion_getInstance_5().ofSubstitution(substitution, substitutions.slice()));
|
|
1280
1293
|
};
|
|
1281
1294
|
protoOf(ProbTerm).apply = function (substitution, substitutions) {
|
|
1282
|
-
return this.
|
|
1295
|
+
return this.q2u(substitution, substitutions);
|
|
1283
1296
|
};
|
|
1284
|
-
protoOf(ProbTerm).
|
|
1297
|
+
protoOf(ProbTerm).q17 = function (substitution) {
|
|
1285
1298
|
var tmp;
|
|
1286
|
-
if (substitution.i() || this.
|
|
1299
|
+
if (substitution.i() || this.by()) {
|
|
1287
1300
|
tmp = this;
|
|
1288
1301
|
} else {
|
|
1289
1302
|
var tmp_0;
|
|
1290
|
-
var tmp0 = this.
|
|
1303
|
+
var tmp0 = this.p3n_1;
|
|
1291
1304
|
var tmp$ret$0;
|
|
1292
1305
|
$l$block_0: {
|
|
1293
1306
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -1304,7 +1317,7 @@
|
|
|
1304
1317
|
var _iterator__ex2g4s = tmp0.n();
|
|
1305
1318
|
while (_iterator__ex2g4s.q()) {
|
|
1306
1319
|
var element = _iterator__ex2g4s.r();
|
|
1307
|
-
if (element.
|
|
1320
|
+
if (element.tx()) {
|
|
1308
1321
|
tmp$ret$0 = true;
|
|
1309
1322
|
break $l$block_0;
|
|
1310
1323
|
}
|
|
@@ -1312,10 +1325,10 @@
|
|
|
1312
1325
|
tmp$ret$0 = false;
|
|
1313
1326
|
}
|
|
1314
1327
|
if (!tmp$ret$0) {
|
|
1315
|
-
tmp_0 = this.
|
|
1328
|
+
tmp_0 = this.p3n_1;
|
|
1316
1329
|
} else {
|
|
1317
1330
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
1318
|
-
var tmp0_0 = this.
|
|
1331
|
+
var tmp0_0 = this.p3n_1;
|
|
1319
1332
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
1320
1333
|
var destination = ArrayList_init_$Create$_0();
|
|
1321
1334
|
// Inline function 'kotlin.collections.forEach' call
|
|
@@ -1333,43 +1346,43 @@
|
|
|
1333
1346
|
tmp_0 = toSet(destination);
|
|
1334
1347
|
}
|
|
1335
1348
|
var newExtraVars = tmp_0;
|
|
1336
|
-
tmp = new ProbTerm(this.
|
|
1349
|
+
tmp = new ProbTerm(this.m3n_1, this.n3n_1, this.o3n_1.applySubstitution(substitution), newExtraVars);
|
|
1337
1350
|
}
|
|
1338
1351
|
return tmp;
|
|
1339
1352
|
};
|
|
1340
1353
|
protoOf(ProbTerm).applySubstitution = function (substitution) {
|
|
1341
|
-
return this.
|
|
1354
|
+
return this.q17(substitution);
|
|
1342
1355
|
};
|
|
1343
|
-
protoOf(ProbTerm).
|
|
1344
|
-
var tmp0 = this.
|
|
1356
|
+
protoOf(ProbTerm).by = function () {
|
|
1357
|
+
var tmp0 = this.q3n_1;
|
|
1345
1358
|
var tmp = KProperty1;
|
|
1346
1359
|
// Inline function 'kotlin.getValue' call
|
|
1347
1360
|
getPropertyCallableRef('isGround', 1, tmp, ProbTerm$_get_isGround_$ref_ue0rck(), null);
|
|
1348
1361
|
return tmp0.f1();
|
|
1349
1362
|
};
|
|
1350
|
-
protoOf(ProbTerm).
|
|
1363
|
+
protoOf(ProbTerm).sx = function (other) {
|
|
1351
1364
|
if (!(other instanceof ProbTerm)) {
|
|
1352
1365
|
return compareTo.call(this, other);
|
|
1353
1366
|
}
|
|
1354
|
-
var res = compareTo_0(this.
|
|
1367
|
+
var res = compareTo_0(this.m3n_1, other.m3n_1);
|
|
1355
1368
|
if (!(res === 0))
|
|
1356
1369
|
return res;
|
|
1357
|
-
res = this.
|
|
1370
|
+
res = this.o3n_1.sx(other.o3n_1);
|
|
1358
1371
|
if (!(res === 0))
|
|
1359
1372
|
return res;
|
|
1360
|
-
res = equals(this.
|
|
1373
|
+
res = equals(this.p3n_1, other.p3n_1) ? 0 : -1;
|
|
1361
1374
|
if (!(res === 0))
|
|
1362
1375
|
return res;
|
|
1363
|
-
res = compareTo_0(this.
|
|
1376
|
+
res = compareTo_0(this.n3n_1, other.n3n_1);
|
|
1364
1377
|
return res;
|
|
1365
1378
|
};
|
|
1366
1379
|
protoOf(ProbTerm).d = function (other) {
|
|
1367
|
-
return this.
|
|
1380
|
+
return this.sx((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
|
|
1368
1381
|
};
|
|
1369
1382
|
protoOf(ProbTerm).equals = function (other) {
|
|
1370
1383
|
var tmp;
|
|
1371
1384
|
if (other instanceof ProbTerm) {
|
|
1372
|
-
tmp = this.
|
|
1385
|
+
tmp = this.sx(other) === 0;
|
|
1373
1386
|
} else {
|
|
1374
1387
|
tmp = false;
|
|
1375
1388
|
}
|
|
@@ -1379,214 +1392,214 @@
|
|
|
1379
1392
|
return _get_cachedHashCode__d7x0zy(this);
|
|
1380
1393
|
};
|
|
1381
1394
|
protoOf(ProbTerm).toString = function () {
|
|
1382
|
-
return '' + round(this.
|
|
1395
|
+
return '' + round(this.n3n_1 * 100) / 100.0 + '::' + this.o3n_1.toString();
|
|
1383
1396
|
};
|
|
1384
|
-
protoOf(ProbTerm).
|
|
1385
|
-
return this.
|
|
1397
|
+
protoOf(ProbTerm).rx = function () {
|
|
1398
|
+
return this.l3n_1.rx();
|
|
1386
1399
|
};
|
|
1387
|
-
protoOf(ProbTerm).
|
|
1388
|
-
return this.
|
|
1400
|
+
protoOf(ProbTerm).mr = function () {
|
|
1401
|
+
return this.rx();
|
|
1389
1402
|
};
|
|
1390
1403
|
protoOf(ProbTerm).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
1391
|
-
return this.
|
|
1404
|
+
return this.l3n_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
1392
1405
|
};
|
|
1393
1406
|
protoOf(ProbTerm).structurallyEquals = function (other) {
|
|
1394
|
-
return this.
|
|
1407
|
+
return this.l3n_1.structurallyEquals(other);
|
|
1395
1408
|
};
|
|
1396
1409
|
protoOf(ProbTerm).accept = function (visitor) {
|
|
1397
|
-
return this.
|
|
1410
|
+
return this.l3n_1.accept(visitor);
|
|
1398
1411
|
};
|
|
1399
1412
|
protoOf(ProbTerm).castToAtom = function () {
|
|
1400
|
-
return this.
|
|
1413
|
+
return this.l3n_1.castToAtom();
|
|
1401
1414
|
};
|
|
1402
1415
|
protoOf(ProbTerm).castToClause = function () {
|
|
1403
|
-
return this.
|
|
1416
|
+
return this.l3n_1.castToClause();
|
|
1404
1417
|
};
|
|
1405
1418
|
protoOf(ProbTerm).castToCons = function () {
|
|
1406
|
-
return this.
|
|
1419
|
+
return this.l3n_1.castToCons();
|
|
1407
1420
|
};
|
|
1408
1421
|
protoOf(ProbTerm).castToConstant = function () {
|
|
1409
|
-
return this.
|
|
1422
|
+
return this.l3n_1.castToConstant();
|
|
1410
1423
|
};
|
|
1411
1424
|
protoOf(ProbTerm).castToDirective = function () {
|
|
1412
|
-
return this.
|
|
1425
|
+
return this.l3n_1.castToDirective();
|
|
1413
1426
|
};
|
|
1414
1427
|
protoOf(ProbTerm).castToEmptyList = function () {
|
|
1415
|
-
return this.
|
|
1428
|
+
return this.l3n_1.castToEmptyList();
|
|
1416
1429
|
};
|
|
1417
1430
|
protoOf(ProbTerm).castToEmptyBlock = function () {
|
|
1418
|
-
return this.
|
|
1431
|
+
return this.l3n_1.castToEmptyBlock();
|
|
1419
1432
|
};
|
|
1420
1433
|
protoOf(ProbTerm).castToFact = function () {
|
|
1421
|
-
return this.
|
|
1434
|
+
return this.l3n_1.castToFact();
|
|
1422
1435
|
};
|
|
1423
1436
|
protoOf(ProbTerm).castToIndicator = function () {
|
|
1424
|
-
return this.
|
|
1437
|
+
return this.l3n_1.castToIndicator();
|
|
1425
1438
|
};
|
|
1426
1439
|
protoOf(ProbTerm).castToInteger = function () {
|
|
1427
|
-
return this.
|
|
1440
|
+
return this.l3n_1.castToInteger();
|
|
1428
1441
|
};
|
|
1429
1442
|
protoOf(ProbTerm).castToList = function () {
|
|
1430
|
-
return this.
|
|
1443
|
+
return this.l3n_1.castToList();
|
|
1431
1444
|
};
|
|
1432
1445
|
protoOf(ProbTerm).castToNumeric = function () {
|
|
1433
|
-
return this.
|
|
1446
|
+
return this.l3n_1.castToNumeric();
|
|
1434
1447
|
};
|
|
1435
1448
|
protoOf(ProbTerm).castToReal = function () {
|
|
1436
|
-
return this.
|
|
1449
|
+
return this.l3n_1.castToReal();
|
|
1437
1450
|
};
|
|
1438
1451
|
protoOf(ProbTerm).castToRule = function () {
|
|
1439
|
-
return this.
|
|
1452
|
+
return this.l3n_1.castToRule();
|
|
1440
1453
|
};
|
|
1441
1454
|
protoOf(ProbTerm).castToBlock = function () {
|
|
1442
|
-
return this.
|
|
1455
|
+
return this.l3n_1.castToBlock();
|
|
1443
1456
|
};
|
|
1444
1457
|
protoOf(ProbTerm).castToStruct = function () {
|
|
1445
|
-
return this.
|
|
1458
|
+
return this.l3n_1.castToStruct();
|
|
1446
1459
|
};
|
|
1447
1460
|
protoOf(ProbTerm).castToRecursive = function () {
|
|
1448
|
-
return this.
|
|
1461
|
+
return this.l3n_1.castToRecursive();
|
|
1449
1462
|
};
|
|
1450
1463
|
protoOf(ProbTerm).castToTerm = function () {
|
|
1451
|
-
return this.
|
|
1464
|
+
return this.l3n_1.castToTerm();
|
|
1452
1465
|
};
|
|
1453
1466
|
protoOf(ProbTerm).castToTruth = function () {
|
|
1454
|
-
return this.
|
|
1467
|
+
return this.l3n_1.castToTruth();
|
|
1455
1468
|
};
|
|
1456
1469
|
protoOf(ProbTerm).castToTuple = function () {
|
|
1457
|
-
return this.
|
|
1470
|
+
return this.l3n_1.castToTuple();
|
|
1458
1471
|
};
|
|
1459
1472
|
protoOf(ProbTerm).castToVar = function () {
|
|
1460
|
-
return this.
|
|
1473
|
+
return this.l3n_1.castToVar();
|
|
1461
1474
|
};
|
|
1462
1475
|
protoOf(ProbTerm).asAtom = function () {
|
|
1463
|
-
return this.
|
|
1476
|
+
return this.l3n_1.asAtom();
|
|
1464
1477
|
};
|
|
1465
1478
|
protoOf(ProbTerm).asClause = function () {
|
|
1466
|
-
return this.
|
|
1479
|
+
return this.l3n_1.asClause();
|
|
1467
1480
|
};
|
|
1468
1481
|
protoOf(ProbTerm).asCons = function () {
|
|
1469
|
-
return this.
|
|
1482
|
+
return this.l3n_1.asCons();
|
|
1470
1483
|
};
|
|
1471
1484
|
protoOf(ProbTerm).asConstant = function () {
|
|
1472
|
-
return this.
|
|
1485
|
+
return this.l3n_1.asConstant();
|
|
1473
1486
|
};
|
|
1474
1487
|
protoOf(ProbTerm).asDirective = function () {
|
|
1475
|
-
return this.
|
|
1488
|
+
return this.l3n_1.asDirective();
|
|
1476
1489
|
};
|
|
1477
1490
|
protoOf(ProbTerm).asEmptyList = function () {
|
|
1478
|
-
return this.
|
|
1491
|
+
return this.l3n_1.asEmptyList();
|
|
1479
1492
|
};
|
|
1480
1493
|
protoOf(ProbTerm).asEmptyBlock = function () {
|
|
1481
|
-
return this.
|
|
1494
|
+
return this.l3n_1.asEmptyBlock();
|
|
1482
1495
|
};
|
|
1483
1496
|
protoOf(ProbTerm).asFact = function () {
|
|
1484
|
-
return this.
|
|
1497
|
+
return this.l3n_1.asFact();
|
|
1485
1498
|
};
|
|
1486
1499
|
protoOf(ProbTerm).asIndicator = function () {
|
|
1487
|
-
return this.
|
|
1500
|
+
return this.l3n_1.asIndicator();
|
|
1488
1501
|
};
|
|
1489
1502
|
protoOf(ProbTerm).asInteger = function () {
|
|
1490
|
-
return this.
|
|
1503
|
+
return this.l3n_1.asInteger();
|
|
1491
1504
|
};
|
|
1492
1505
|
protoOf(ProbTerm).asList = function () {
|
|
1493
|
-
return this.
|
|
1506
|
+
return this.l3n_1.asList();
|
|
1494
1507
|
};
|
|
1495
1508
|
protoOf(ProbTerm).asNumeric = function () {
|
|
1496
|
-
return this.
|
|
1509
|
+
return this.l3n_1.asNumeric();
|
|
1497
1510
|
};
|
|
1498
1511
|
protoOf(ProbTerm).asReal = function () {
|
|
1499
|
-
return this.
|
|
1512
|
+
return this.l3n_1.asReal();
|
|
1500
1513
|
};
|
|
1501
1514
|
protoOf(ProbTerm).asRule = function () {
|
|
1502
|
-
return this.
|
|
1515
|
+
return this.l3n_1.asRule();
|
|
1503
1516
|
};
|
|
1504
1517
|
protoOf(ProbTerm).asBlock = function () {
|
|
1505
|
-
return this.
|
|
1518
|
+
return this.l3n_1.asBlock();
|
|
1506
1519
|
};
|
|
1507
1520
|
protoOf(ProbTerm).asStruct = function () {
|
|
1508
|
-
return this.
|
|
1521
|
+
return this.l3n_1.nx();
|
|
1509
1522
|
};
|
|
1510
1523
|
protoOf(ProbTerm).asRecursive = function () {
|
|
1511
|
-
return this.
|
|
1524
|
+
return this.l3n_1.asRecursive();
|
|
1512
1525
|
};
|
|
1513
1526
|
protoOf(ProbTerm).asTerm = function () {
|
|
1514
|
-
return this.
|
|
1527
|
+
return this.l3n_1.asTerm();
|
|
1515
1528
|
};
|
|
1516
1529
|
protoOf(ProbTerm).asTruth = function () {
|
|
1517
|
-
return this.
|
|
1530
|
+
return this.l3n_1.asTruth();
|
|
1518
1531
|
};
|
|
1519
1532
|
protoOf(ProbTerm).asTuple = function () {
|
|
1520
|
-
return this.
|
|
1533
|
+
return this.l3n_1.asTuple();
|
|
1521
1534
|
};
|
|
1522
1535
|
protoOf(ProbTerm).asVar = function () {
|
|
1523
|
-
return this.
|
|
1536
|
+
return this.l3n_1.asVar();
|
|
1524
1537
|
};
|
|
1525
|
-
protoOf(ProbTerm).
|
|
1526
|
-
return this.
|
|
1538
|
+
protoOf(ProbTerm).tx = function () {
|
|
1539
|
+
return this.l3n_1.tx();
|
|
1527
1540
|
};
|
|
1528
|
-
protoOf(ProbTerm).
|
|
1529
|
-
return this.
|
|
1541
|
+
protoOf(ProbTerm).dx = function () {
|
|
1542
|
+
return this.l3n_1.dx();
|
|
1543
|
+
};
|
|
1544
|
+
protoOf(ProbTerm).ux = function () {
|
|
1545
|
+
return this.l3n_1.ux();
|
|
1530
1546
|
};
|
|
1531
1547
|
protoOf(ProbTerm).vx = function () {
|
|
1532
|
-
return this.
|
|
1548
|
+
return this.l3n_1.vx();
|
|
1533
1549
|
};
|
|
1534
|
-
protoOf(ProbTerm).
|
|
1535
|
-
return this.
|
|
1550
|
+
protoOf(ProbTerm).sw = function () {
|
|
1551
|
+
return this.l3n_1.sw();
|
|
1536
1552
|
};
|
|
1537
|
-
protoOf(ProbTerm).
|
|
1538
|
-
return this.
|
|
1553
|
+
protoOf(ProbTerm).wx = function () {
|
|
1554
|
+
return this.l3n_1.wx();
|
|
1539
1555
|
};
|
|
1540
1556
|
protoOf(ProbTerm).xx = function () {
|
|
1541
|
-
return this.
|
|
1557
|
+
return this.l3n_1.xx();
|
|
1542
1558
|
};
|
|
1543
1559
|
protoOf(ProbTerm).yx = function () {
|
|
1544
|
-
return this.
|
|
1560
|
+
return this.l3n_1.yx();
|
|
1545
1561
|
};
|
|
1546
1562
|
protoOf(ProbTerm).zx = function () {
|
|
1547
|
-
return this.
|
|
1563
|
+
return this.l3n_1.zx();
|
|
1548
1564
|
};
|
|
1549
|
-
protoOf(ProbTerm).
|
|
1550
|
-
return this.
|
|
1565
|
+
protoOf(ProbTerm).jx = function () {
|
|
1566
|
+
return this.l3n_1.jx();
|
|
1551
1567
|
};
|
|
1552
|
-
protoOf(ProbTerm).
|
|
1553
|
-
return this.
|
|
1568
|
+
protoOf(ProbTerm).ix = function () {
|
|
1569
|
+
return this.l3n_1.ix();
|
|
1554
1570
|
};
|
|
1555
|
-
protoOf(ProbTerm).
|
|
1556
|
-
return this.
|
|
1571
|
+
protoOf(ProbTerm).tw = function () {
|
|
1572
|
+
return this.l3n_1.tw();
|
|
1557
1573
|
};
|
|
1558
|
-
protoOf(ProbTerm).
|
|
1559
|
-
return this.
|
|
1574
|
+
protoOf(ProbTerm).ex = function () {
|
|
1575
|
+
return this.l3n_1.ex();
|
|
1560
1576
|
};
|
|
1561
|
-
protoOf(ProbTerm).
|
|
1562
|
-
return this.
|
|
1577
|
+
protoOf(ProbTerm).kx = function () {
|
|
1578
|
+
return this.l3n_1.kx();
|
|
1563
1579
|
};
|
|
1564
|
-
protoOf(ProbTerm).
|
|
1565
|
-
return this.
|
|
1580
|
+
protoOf(ProbTerm).uw = function () {
|
|
1581
|
+
return this.l3n_1.uw();
|
|
1566
1582
|
};
|
|
1567
1583
|
protoOf(ProbTerm).vw = function () {
|
|
1568
|
-
return this.
|
|
1569
|
-
};
|
|
1570
|
-
protoOf(ProbTerm).ww = function () {
|
|
1571
|
-
return this.e3n_1.ww();
|
|
1584
|
+
return this.l3n_1.vw();
|
|
1572
1585
|
};
|
|
1573
|
-
protoOf(ProbTerm).
|
|
1574
|
-
return this.
|
|
1586
|
+
protoOf(ProbTerm).mx = function () {
|
|
1587
|
+
return this.l3n_1.mx();
|
|
1575
1588
|
};
|
|
1576
1589
|
protoOf(ProbTerm).getTag = function (name) {
|
|
1577
|
-
return this.
|
|
1590
|
+
return this.l3n_1.getTag(name);
|
|
1578
1591
|
};
|
|
1579
1592
|
protoOf(ProbTerm).resetTags = function (tags) {
|
|
1580
|
-
return this.
|
|
1593
|
+
return this.l3n_1.resetTags(tags);
|
|
1581
1594
|
};
|
|
1582
1595
|
protoOf(ProbTerm).containsTag = function (name) {
|
|
1583
|
-
return this.
|
|
1596
|
+
return this.l3n_1.containsTag(name);
|
|
1584
1597
|
};
|
|
1585
|
-
protoOf(ProbTerm).
|
|
1586
|
-
return this.
|
|
1598
|
+
protoOf(ProbTerm).cu = function () {
|
|
1599
|
+
return this.l3n_1.cu();
|
|
1587
1600
|
};
|
|
1588
|
-
protoOf(ProbTerm).
|
|
1589
|
-
return this.
|
|
1601
|
+
protoOf(ProbTerm).zw = function () {
|
|
1602
|
+
return this.l3n_1.zw();
|
|
1590
1603
|
};
|
|
1591
1604
|
function Companion_1() {
|
|
1592
1605
|
}
|
|
@@ -1631,25 +1644,25 @@
|
|
|
1631
1644
|
function collectAllHeads($this, head, accumulator) {
|
|
1632
1645
|
var tmp;
|
|
1633
1646
|
if (isInterface(head, Struct)) {
|
|
1634
|
-
tmp = head.
|
|
1647
|
+
tmp = head.rw() === 2;
|
|
1635
1648
|
} else {
|
|
1636
1649
|
tmp = false;
|
|
1637
1650
|
}
|
|
1638
1651
|
if (tmp) {
|
|
1639
|
-
if (!(head.
|
|
1652
|
+
if (!(head.xw() === ';') && !(head.xw() === '::')) {
|
|
1640
1653
|
throw TuPrologException_init_$Create$('Badly formatted disjoint annotation: ' + head.toString());
|
|
1641
1654
|
}
|
|
1642
|
-
if (head.
|
|
1655
|
+
if (head.xw() === ';') {
|
|
1643
1656
|
collectAllHeads($this, head.get(1), accumulator);
|
|
1644
1657
|
}
|
|
1645
1658
|
}
|
|
1646
1659
|
var curHeadProb = 1.0;
|
|
1647
1660
|
var curHead = head;
|
|
1648
1661
|
if (isInterface(head, Struct)) {
|
|
1649
|
-
curHead = head.
|
|
1662
|
+
curHead = head.xw() === ';' ? head.get(0) : head;
|
|
1650
1663
|
var tmp_0;
|
|
1651
1664
|
if (isInterface(curHead, Struct)) {
|
|
1652
|
-
tmp_0 = curHead.
|
|
1665
|
+
tmp_0 = curHead.xw() === '::';
|
|
1653
1666
|
} else {
|
|
1654
1667
|
tmp_0 = false;
|
|
1655
1668
|
}
|
|
@@ -1657,7 +1670,7 @@
|
|
|
1657
1670
|
var curHeadProbTerm = curHead.get(0);
|
|
1658
1671
|
var tmp_1;
|
|
1659
1672
|
if (isInterface(curHeadProbTerm, Numeric)) {
|
|
1660
|
-
tmp_1 = curHeadProbTerm.
|
|
1673
|
+
tmp_1 = curHeadProbTerm.n11().toDouble();
|
|
1661
1674
|
} else {
|
|
1662
1675
|
tmp_1 = solveArithmeticExpression(curHeadProbTerm);
|
|
1663
1676
|
}
|
|
@@ -1669,23 +1682,23 @@
|
|
|
1669
1682
|
}
|
|
1670
1683
|
function AnnotatedDisjunctionClauseMapper() {
|
|
1671
1684
|
}
|
|
1672
|
-
protoOf(AnnotatedDisjunctionClauseMapper).
|
|
1685
|
+
protoOf(AnnotatedDisjunctionClauseMapper).v3n = function (clause) {
|
|
1673
1686
|
var tmp;
|
|
1674
1687
|
if (isInterface(clause, Rule)) {
|
|
1675
|
-
tmp = clause.
|
|
1688
|
+
tmp = clause.dz().xw() === ';';
|
|
1676
1689
|
} else {
|
|
1677
1690
|
tmp = false;
|
|
1678
1691
|
}
|
|
1679
1692
|
return tmp;
|
|
1680
1693
|
};
|
|
1681
|
-
protoOf(AnnotatedDisjunctionClauseMapper).
|
|
1694
|
+
protoOf(AnnotatedDisjunctionClauseMapper).w3n = function (clause) {
|
|
1682
1695
|
if (!isInterface(clause, Rule)) {
|
|
1683
1696
|
throw new ClauseMappingException('Clause is not an instance of Rule: ' + clause.toString());
|
|
1684
1697
|
}
|
|
1685
|
-
var body = clause.
|
|
1698
|
+
var body = clause.ez();
|
|
1686
1699
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
1687
1700
|
var disjointHeads = ArrayList_init_$Create$_0();
|
|
1688
|
-
collectAllHeads(this, clause.
|
|
1701
|
+
collectAllHeads(this, clause.dz(), disjointHeads);
|
|
1689
1702
|
var probSum = 0.0;
|
|
1690
1703
|
// Inline function 'kotlin.collections.map' call
|
|
1691
1704
|
// Inline function 'kotlin.collections.mapTo' call
|
|
@@ -1694,7 +1707,7 @@
|
|
|
1694
1707
|
while (_iterator__ex2g4s.q()) {
|
|
1695
1708
|
var item = _iterator__ex2g4s.r();
|
|
1696
1709
|
var tmp = item.get(0);
|
|
1697
|
-
var curProb = (isInterface(tmp, Numeric) ? tmp : THROW_CCE()).
|
|
1710
|
+
var curProb = (isInterface(tmp, Numeric) ? tmp : THROW_CCE()).n11().toDouble();
|
|
1698
1711
|
var tmp_0;
|
|
1699
1712
|
var tmp_1 = item.get(1);
|
|
1700
1713
|
if (isInterface(tmp_1, Struct)) {
|
|
@@ -1705,21 +1718,21 @@
|
|
|
1705
1718
|
}
|
|
1706
1719
|
var curRuleHead = tmp_0;
|
|
1707
1720
|
probSum = probSum + curProb;
|
|
1708
|
-
var tmp$ret$3 = ProbabilisticClauseMapper_instance.
|
|
1721
|
+
var tmp$ret$3 = ProbabilisticClauseMapper_instance.x3n(Companion_instance_3.of(Companion_getInstance_1().of('::', [Companion_getInstance_6().ofDouble(curProb / (1.0 - (probSum - curProb))), curRuleHead]), [body]));
|
|
1709
1722
|
destination.l(tmp$ret$3);
|
|
1710
1723
|
}
|
|
1711
|
-
var mappedRules =
|
|
1712
|
-
var explanation = Companion_getInstance_11().
|
|
1724
|
+
var mappedRules = toList(destination);
|
|
1725
|
+
var explanation = Companion_getInstance_11().g3n_1;
|
|
1713
1726
|
// Inline function 'kotlin.collections.map' call
|
|
1714
1727
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1715
1728
|
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(mappedRules, 10));
|
|
1716
1729
|
var _iterator__ex2g4s_0 = mappedRules.n();
|
|
1717
1730
|
while (_iterator__ex2g4s_0.q()) {
|
|
1718
1731
|
var item_0 = _iterator__ex2g4s_0.r();
|
|
1719
|
-
var thisExplanation = Companion_getInstance_11().
|
|
1732
|
+
var thisExplanation = Companion_getInstance_11().k3n(item_0.second);
|
|
1720
1733
|
var resultExplanation = thisExplanation.and(explanation);
|
|
1721
1734
|
explanation = explanation.and(thisExplanation.not());
|
|
1722
|
-
var tmp$ret$6 = ProbabilisticClauseMapper_instance.
|
|
1735
|
+
var tmp$ret$6 = ProbabilisticClauseMapper_instance.y3n(item_0.first, resultExplanation);
|
|
1723
1736
|
destination_0.l(tmp$ret$6);
|
|
1724
1737
|
}
|
|
1725
1738
|
return destination_0;
|
|
@@ -1729,28 +1742,28 @@
|
|
|
1729
1742
|
return AnnotatedDisjunctionClauseMapper_instance;
|
|
1730
1743
|
}
|
|
1731
1744
|
function ComputedValue(probability) {
|
|
1732
|
-
this.
|
|
1745
|
+
this.z3n_1 = probability;
|
|
1733
1746
|
}
|
|
1734
1747
|
protoOf(ComputedValue).toString = function () {
|
|
1735
|
-
return 'ComputedValue(probability=' + this.
|
|
1748
|
+
return 'ComputedValue(probability=' + this.z3n_1 + ')';
|
|
1736
1749
|
};
|
|
1737
1750
|
protoOf(ComputedValue).hashCode = function () {
|
|
1738
|
-
return this.
|
|
1751
|
+
return this.z3n_1 == null ? 0 : getNumberHashCode(this.z3n_1);
|
|
1739
1752
|
};
|
|
1740
1753
|
protoOf(ComputedValue).equals = function (other) {
|
|
1741
1754
|
if (this === other)
|
|
1742
1755
|
return true;
|
|
1743
1756
|
if (!(other instanceof ComputedValue))
|
|
1744
1757
|
return false;
|
|
1745
|
-
if (!equals(this.
|
|
1758
|
+
if (!equals(this.z3n_1, other.z3n_1))
|
|
1746
1759
|
return false;
|
|
1747
1760
|
return true;
|
|
1748
1761
|
};
|
|
1749
1762
|
function Companion_2() {
|
|
1750
1763
|
Companion_instance_11 = this;
|
|
1751
|
-
this.
|
|
1752
|
-
this.
|
|
1753
|
-
this.
|
|
1764
|
+
this.h3n_1 = new ComputedValue(null);
|
|
1765
|
+
this.i3n_1 = new ComputedValue(0.0);
|
|
1766
|
+
this.j3n_1 = new ComputedValue(1.0);
|
|
1754
1767
|
}
|
|
1755
1768
|
var Companion_instance_11;
|
|
1756
1769
|
function Companion_getInstance_13() {
|
|
@@ -1766,15 +1779,15 @@
|
|
|
1766
1779
|
}
|
|
1767
1780
|
function computeExpansion($this, value, low, high) {
|
|
1768
1781
|
var tmp;
|
|
1769
|
-
if (!(low.
|
|
1770
|
-
tmp = value.
|
|
1782
|
+
if (!(low.z3n_1 == null) && !(high.z3n_1 == null)) {
|
|
1783
|
+
tmp = value.n3n_1 * high.z3n_1 + (1.0 - value.n3n_1) * low.z3n_1;
|
|
1771
1784
|
} else {
|
|
1772
1785
|
tmp = null;
|
|
1773
1786
|
}
|
|
1774
1787
|
return new ComputedValue(tmp);
|
|
1775
1788
|
}
|
|
1776
1789
|
function _get_cachedNot__l38068($this) {
|
|
1777
|
-
var tmp0 = $this.
|
|
1790
|
+
var tmp0 = $this.g3m_1;
|
|
1778
1791
|
var tmp = KProperty1;
|
|
1779
1792
|
// Inline function 'kotlin.getValue' call
|
|
1780
1793
|
getPropertyCallableRef('cachedNot', 1, tmp, BinaryDecisionDiagramExplanation$_get_cachedNot_$ref_q3r5qq(), null);
|
|
@@ -1787,16 +1800,16 @@
|
|
|
1787
1800
|
}
|
|
1788
1801
|
function BinaryDecisionDiagramExplanation$cachedNot$delegate$lambda(this$0) {
|
|
1789
1802
|
return function () {
|
|
1790
|
-
var tmp = Companion_getInstance_13().
|
|
1791
|
-
var tmp_0 = Companion_getInstance_13().
|
|
1792
|
-
var result = notThenExpansion(this$0.
|
|
1803
|
+
var tmp = Companion_getInstance_13().i3n_1;
|
|
1804
|
+
var tmp_0 = Companion_getInstance_13().j3n_1;
|
|
1805
|
+
var result = notThenExpansion(this$0.e3m_1, tmp, tmp_0, BinaryDecisionDiagramExplanation$cachedNot$delegate$lambda$lambda(this$0));
|
|
1793
1806
|
return new BinaryDecisionDiagramExplanation(result.first, result.second);
|
|
1794
1807
|
};
|
|
1795
1808
|
}
|
|
1796
1809
|
function BinaryDecisionDiagramExplanation$_get_cachedNot_$ref_q3r5qq() {
|
|
1797
1810
|
return constructCallableReference(function (p0) {
|
|
1798
1811
|
return _get_cachedNot__l38068(p0);
|
|
1799
|
-
}, 1, 0,
|
|
1812
|
+
}, 1, 0, 95);
|
|
1800
1813
|
}
|
|
1801
1814
|
function BinaryDecisionDiagramExplanation$and$lambda(this$0) {
|
|
1802
1815
|
return function (node, low, high) {
|
|
@@ -1809,14 +1822,14 @@
|
|
|
1809
1822
|
};
|
|
1810
1823
|
}
|
|
1811
1824
|
function BinaryDecisionDiagramExplanation$probability$delegate$lambda$lambda(node, low, high) {
|
|
1812
|
-
return node.
|
|
1825
|
+
return node.n3n_1 * high + (1.0 - node.n3n_1) * low;
|
|
1813
1826
|
}
|
|
1814
1827
|
function BinaryDecisionDiagramExplanation$probability$delegate$lambda(this$0) {
|
|
1815
1828
|
return function () {
|
|
1816
|
-
var tmp0_elvis_lhs = this$0.
|
|
1829
|
+
var tmp0_elvis_lhs = this$0.f3m_1.z3n_1;
|
|
1817
1830
|
var tmp;
|
|
1818
1831
|
if (tmp0_elvis_lhs == null) {
|
|
1819
|
-
tmp = expansion(this$0.
|
|
1832
|
+
tmp = expansion(this$0.e3m_1, 0.0, 1.0, BinaryDecisionDiagramExplanation$probability$delegate$lambda$lambda);
|
|
1820
1833
|
} else {
|
|
1821
1834
|
tmp = tmp0_elvis_lhs;
|
|
1822
1835
|
}
|
|
@@ -1825,21 +1838,21 @@
|
|
|
1825
1838
|
}
|
|
1826
1839
|
function BinaryDecisionDiagramExplanation$_get_probability_$ref_gzzr62() {
|
|
1827
1840
|
return constructCallableReference(function (p0) {
|
|
1828
|
-
return p0.
|
|
1829
|
-
}, 1, 0,
|
|
1841
|
+
return p0.s3n();
|
|
1842
|
+
}, 1, 0, 96);
|
|
1830
1843
|
}
|
|
1831
1844
|
function BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda$lambda(it) {
|
|
1832
|
-
return !it.
|
|
1845
|
+
return !it.by();
|
|
1833
1846
|
}
|
|
1834
1847
|
function BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda(this$0) {
|
|
1835
1848
|
return function () {
|
|
1836
|
-
return anyWhere(this$0.
|
|
1849
|
+
return anyWhere(this$0.e3m_1, BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda$lambda);
|
|
1837
1850
|
};
|
|
1838
1851
|
}
|
|
1839
1852
|
function BinaryDecisionDiagramExplanation$_get_containsAnyNotGroundTerm_$ref_82xwv2() {
|
|
1840
1853
|
return constructCallableReference(function (p0) {
|
|
1841
|
-
return p0.
|
|
1842
|
-
}, 1, 0,
|
|
1854
|
+
return p0.u3n();
|
|
1855
|
+
}, 1, 0, 97);
|
|
1843
1856
|
}
|
|
1844
1857
|
function BinaryDecisionDiagramExplanation$apply$lambda($transformation) {
|
|
1845
1858
|
return function (it) {
|
|
@@ -1848,93 +1861,98 @@
|
|
|
1848
1861
|
}
|
|
1849
1862
|
function BinaryDecisionDiagramExplanation(diagram, computedValue) {
|
|
1850
1863
|
Companion_getInstance_13();
|
|
1851
|
-
computedValue = computedValue === VOID ? Companion_getInstance_13().
|
|
1852
|
-
this.
|
|
1853
|
-
this.
|
|
1864
|
+
computedValue = computedValue === VOID ? Companion_getInstance_13().h3n_1 : computedValue;
|
|
1865
|
+
this.e3m_1 = diagram;
|
|
1866
|
+
this.f3m_1 = computedValue;
|
|
1854
1867
|
var tmp = this;
|
|
1855
|
-
tmp.
|
|
1868
|
+
tmp.g3m_1 = lazy(BinaryDecisionDiagramExplanation$cachedNot$delegate$lambda(this));
|
|
1856
1869
|
var tmp_0 = this;
|
|
1857
|
-
tmp_0.
|
|
1870
|
+
tmp_0.h3m_1 = lazy(BinaryDecisionDiagramExplanation$probability$delegate$lambda(this));
|
|
1858
1871
|
var tmp_1 = this;
|
|
1859
|
-
tmp_1.
|
|
1872
|
+
tmp_1.i3m_1 = lazy(BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda(this));
|
|
1860
1873
|
}
|
|
1861
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
1874
|
+
protoOf(BinaryDecisionDiagramExplanation).a3o = function () {
|
|
1862
1875
|
return _get_cachedNot__l38068(this);
|
|
1863
1876
|
};
|
|
1864
1877
|
protoOf(BinaryDecisionDiagramExplanation).not = function () {
|
|
1865
|
-
return this.
|
|
1878
|
+
return this.a3o();
|
|
1866
1879
|
};
|
|
1867
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
1868
|
-
var tmp = getAsInternal(this, that).
|
|
1869
|
-
var tmp_0 = Companion_getInstance_13().
|
|
1870
|
-
var tmp_1 = Companion_getInstance_13().
|
|
1871
|
-
var result = andThenExpansion(this.
|
|
1880
|
+
protoOf(BinaryDecisionDiagramExplanation).b3o = function (that) {
|
|
1881
|
+
var tmp = getAsInternal(this, that).e3m_1;
|
|
1882
|
+
var tmp_0 = Companion_getInstance_13().i3n_1;
|
|
1883
|
+
var tmp_1 = Companion_getInstance_13().j3n_1;
|
|
1884
|
+
var result = andThenExpansion(this.e3m_1, tmp, tmp_0, tmp_1, BinaryDecisionDiagramExplanation$and$lambda(this));
|
|
1872
1885
|
return new BinaryDecisionDiagramExplanation(result.first, result.second);
|
|
1873
1886
|
};
|
|
1874
1887
|
protoOf(BinaryDecisionDiagramExplanation).and = function (that) {
|
|
1875
|
-
return this.
|
|
1888
|
+
return this.b3o(that);
|
|
1876
1889
|
};
|
|
1877
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
1878
|
-
var tmp = getAsInternal(this, that).
|
|
1879
|
-
var tmp_0 = Companion_getInstance_13().
|
|
1880
|
-
var tmp_1 = Companion_getInstance_13().
|
|
1881
|
-
var result = orThenExpansion(this.
|
|
1890
|
+
protoOf(BinaryDecisionDiagramExplanation).c3o = function (that) {
|
|
1891
|
+
var tmp = getAsInternal(this, that).e3m_1;
|
|
1892
|
+
var tmp_0 = Companion_getInstance_13().i3n_1;
|
|
1893
|
+
var tmp_1 = Companion_getInstance_13().j3n_1;
|
|
1894
|
+
var result = orThenExpansion(this.e3m_1, tmp, tmp_0, tmp_1, BinaryDecisionDiagramExplanation$or$lambda(this));
|
|
1882
1895
|
return new BinaryDecisionDiagramExplanation(result.first, result.second);
|
|
1883
1896
|
};
|
|
1884
1897
|
protoOf(BinaryDecisionDiagramExplanation).or = function (that) {
|
|
1885
|
-
return this.
|
|
1898
|
+
return this.c3o(that);
|
|
1886
1899
|
};
|
|
1887
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
1888
|
-
var tmp0 = this.
|
|
1900
|
+
protoOf(BinaryDecisionDiagramExplanation).s3n = function () {
|
|
1901
|
+
var tmp0 = this.h3m_1;
|
|
1889
1902
|
var tmp = KProperty1;
|
|
1890
1903
|
// Inline function 'kotlin.getValue' call
|
|
1891
1904
|
getPropertyCallableRef('probability', 1, tmp, BinaryDecisionDiagramExplanation$_get_probability_$ref_gzzr62(), null);
|
|
1892
1905
|
return tmp0.f1();
|
|
1893
1906
|
};
|
|
1894
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
1895
|
-
var tmp0 = this.
|
|
1907
|
+
protoOf(BinaryDecisionDiagramExplanation).u3n = function () {
|
|
1908
|
+
var tmp0 = this.i3m_1;
|
|
1896
1909
|
var tmp = KProperty1;
|
|
1897
1910
|
// Inline function 'kotlin.getValue' call
|
|
1898
1911
|
getPropertyCallableRef('containsAnyNotGroundTerm', 1, tmp, BinaryDecisionDiagramExplanation$_get_containsAnyNotGroundTerm_$ref_82xwv2(), null);
|
|
1899
1912
|
return tmp0.f1();
|
|
1900
1913
|
};
|
|
1901
1914
|
protoOf(BinaryDecisionDiagramExplanation).toString = function () {
|
|
1902
|
-
return 'bdd:' + hashCode(this.
|
|
1915
|
+
return 'bdd:' + hashCode(this.e3m_1);
|
|
1903
1916
|
};
|
|
1904
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
1905
|
-
return new BinaryDecisionDiagramExplanation(map_0(this.
|
|
1917
|
+
protoOf(BinaryDecisionDiagramExplanation).d3o = function (transformation) {
|
|
1918
|
+
return new BinaryDecisionDiagramExplanation(map_0(this.e3m_1, BinaryDecisionDiagramExplanation$apply$lambda(transformation)));
|
|
1906
1919
|
};
|
|
1907
1920
|
protoOf(BinaryDecisionDiagramExplanation).applyTransformation = function (transformation) {
|
|
1908
|
-
return this.
|
|
1921
|
+
return this.d3o(transformation);
|
|
1909
1922
|
};
|
|
1910
1923
|
function get_nonWrappableFunctors() {
|
|
1911
1924
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
1912
1925
|
return nonWrappableFunctors;
|
|
1913
1926
|
}
|
|
1914
1927
|
var nonWrappableFunctors;
|
|
1928
|
+
function get_arithmeticOperators() {
|
|
1929
|
+
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
1930
|
+
return arithmeticOperators;
|
|
1931
|
+
}
|
|
1932
|
+
var arithmeticOperators;
|
|
1915
1933
|
function ClauseMappingUtils() {
|
|
1916
1934
|
ClauseMappingUtils_instance = this;
|
|
1917
|
-
this.
|
|
1918
|
-
this.
|
|
1935
|
+
this.e3o_1 = 1n;
|
|
1936
|
+
this.f3o_1 = listOf_0([DirectiveClauseMapper_instance, AnnotatedDisjunctionClauseMapper_instance, ProbabilisticClauseMapper_instance, EvidenceClauseMapper_instance, PrologClauseMapper_instance, NothingClauseMapper_instance]);
|
|
1919
1937
|
}
|
|
1920
|
-
protoOf(ClauseMappingUtils).
|
|
1921
|
-
var _unary__edvuaz = this.
|
|
1922
|
-
this.
|
|
1938
|
+
protoOf(ClauseMappingUtils).g3o = function () {
|
|
1939
|
+
var _unary__edvuaz = this.e3o_1;
|
|
1940
|
+
this.e3o_1 = add(_unary__edvuaz, get_ONE());
|
|
1923
1941
|
return _unary__edvuaz;
|
|
1924
1942
|
};
|
|
1925
|
-
protoOf(ClauseMappingUtils).
|
|
1943
|
+
protoOf(ClauseMappingUtils).h3o = function (clause) {
|
|
1926
1944
|
var tmp;
|
|
1927
1945
|
if (get_isMappedAsProblog(clause)) {
|
|
1928
1946
|
tmp = listOf(clause);
|
|
1929
1947
|
} else {
|
|
1930
|
-
var tmp0 = this.
|
|
1948
|
+
var tmp0 = this.f3o_1;
|
|
1931
1949
|
var tmp$ret$0;
|
|
1932
1950
|
$l$block: {
|
|
1933
1951
|
// Inline function 'kotlin.collections.first' call
|
|
1934
1952
|
var _iterator__ex2g4s = tmp0.n();
|
|
1935
1953
|
while (_iterator__ex2g4s.q()) {
|
|
1936
1954
|
var element = _iterator__ex2g4s.r();
|
|
1937
|
-
if (element.
|
|
1955
|
+
if (element.v3n(clause)) {
|
|
1938
1956
|
tmp$ret$0 = element;
|
|
1939
1957
|
break $l$block;
|
|
1940
1958
|
}
|
|
@@ -1942,7 +1960,7 @@
|
|
|
1942
1960
|
throw NoSuchElementException_init_$Create$('Collection contains no element matching the predicate.');
|
|
1943
1961
|
}
|
|
1944
1962
|
// Inline function 'kotlin.collections.map' call
|
|
1945
|
-
var this_0 = tmp$ret$0.
|
|
1963
|
+
var this_0 = tmp$ret$0.w3n(clause);
|
|
1946
1964
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1947
1965
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1948
1966
|
var _iterator__ex2g4s_0 = this_0.n();
|
|
@@ -1955,13 +1973,13 @@
|
|
|
1955
1973
|
}
|
|
1956
1974
|
return tmp;
|
|
1957
1975
|
};
|
|
1958
|
-
protoOf(ClauseMappingUtils).
|
|
1959
|
-
var arityTerm = indicator.
|
|
1976
|
+
protoOf(ClauseMappingUtils).i3o = function (indicator) {
|
|
1977
|
+
var arityTerm = indicator.e11();
|
|
1960
1978
|
var tmp = Companion_instance_4;
|
|
1961
|
-
var tmp_0 = indicator.
|
|
1979
|
+
var tmp_0 = indicator.d11();
|
|
1962
1980
|
var tmp_1;
|
|
1963
1981
|
if (isInterface(arityTerm, Numeric)) {
|
|
1964
|
-
tmp_1 = Companion_getInstance_6().ofInteger(arityTerm.
|
|
1982
|
+
tmp_1 = Companion_getInstance_6().ofInteger(arityTerm.f11().toInt() + 1 | 0);
|
|
1965
1983
|
} else {
|
|
1966
1984
|
tmp_1 = arityTerm;
|
|
1967
1985
|
}
|
|
@@ -1973,6 +1991,10 @@
|
|
|
1973
1991
|
new ClauseMappingUtils();
|
|
1974
1992
|
return ClauseMappingUtils_instance;
|
|
1975
1993
|
}
|
|
1994
|
+
function anyMappedClause(_this__u8e3s4) {
|
|
1995
|
+
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
1996
|
+
return setMappedAsProblog(Companion_instance_3.of(withExplanation(_this__u8e3s4, Companion_getInstance_0().anonymous()), [Companion_getInstance_0().anonymous()]), true);
|
|
1997
|
+
}
|
|
1976
1998
|
function toTerm(_this__u8e3s4) {
|
|
1977
1999
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
1978
2000
|
return new ProbExplanationTerm(_this__u8e3s4);
|
|
@@ -2001,7 +2023,7 @@
|
|
|
2001
2023
|
} else {
|
|
2002
2024
|
var tmp_0;
|
|
2003
2025
|
if (isInterface(_this__u8e3s4, Struct)) {
|
|
2004
|
-
tmp_0 = Companion_getInstance_1().ofList(_this__u8e3s4.
|
|
2026
|
+
tmp_0 = Companion_getInstance_1().ofList(_this__u8e3s4.xw(), plus(_this__u8e3s4.yw(), explanation));
|
|
2005
2027
|
} else {
|
|
2006
2028
|
tmp_0 = Companion_getInstance_1().of(_this__u8e3s4.toString(), [explanation]);
|
|
2007
2029
|
}
|
|
@@ -2024,7 +2046,7 @@
|
|
|
2024
2046
|
var tmp;
|
|
2025
2047
|
if (isInterface(_this__u8e3s4, Struct)) {
|
|
2026
2048
|
var tmp_0;
|
|
2027
|
-
switch (_this__u8e3s4.
|
|
2049
|
+
switch (_this__u8e3s4.xw()) {
|
|
2028
2050
|
case ',':
|
|
2029
2051
|
var leftVar = Companion_getInstance_0().of('EXPL_A_' + depth);
|
|
2030
2052
|
var rightVar = Companion_getInstance_0().of('EXPL_B_' + depth);
|
|
@@ -2055,11 +2077,11 @@
|
|
|
2055
2077
|
}
|
|
2056
2078
|
function get_isWrappableWithExplanation(_this__u8e3s4) {
|
|
2057
2079
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2058
|
-
return !get_nonWrappableFunctors().y(safeToStruct(_this__u8e3s4).
|
|
2080
|
+
return !get_nonWrappableFunctors().y(safeToStruct(_this__u8e3s4).xw());
|
|
2059
2081
|
}
|
|
2060
2082
|
function withExplanationNonWrappable(_this__u8e3s4, explanation) {
|
|
2061
2083
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2062
|
-
return Companion_instance_0.of(_this__u8e3s4, Companion_getInstance_1().of('=', [explanation, toTerm(Companion_getInstance_11().
|
|
2084
|
+
return Companion_instance_0.of(_this__u8e3s4, Companion_getInstance_1().of('=', [explanation, toTerm(Companion_getInstance_11().g3n_1)]));
|
|
2063
2085
|
}
|
|
2064
2086
|
function wrapInPredicate(_this__u8e3s4, functor, explanation) {
|
|
2065
2087
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
@@ -2073,41 +2095,59 @@
|
|
|
2073
2095
|
}
|
|
2074
2096
|
function solveArithmeticExpression(_this__u8e3s4) {
|
|
2075
2097
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2076
|
-
var tmp0 = _this__u8e3s4.toString();
|
|
2077
|
-
// Inline function 'kotlin.text.toRegex' call
|
|
2078
|
-
// Inline function 'kotlin.text.replace' call
|
|
2079
|
-
var termStr = Regex_init_$Create$('\\s').ub(tmp0, '');
|
|
2080
|
-
var tmp0_elvis_lhs = Regex_init_$Create$('([0-9.]+)(/)([0-9.]+).*').pb(termStr);
|
|
2081
2098
|
var tmp;
|
|
2082
|
-
if (
|
|
2083
|
-
|
|
2099
|
+
if (isInterface(_this__u8e3s4, Numeric)) {
|
|
2100
|
+
tmp = _this__u8e3s4.n11().toDouble();
|
|
2084
2101
|
} else {
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2102
|
+
var tmp_0;
|
|
2103
|
+
var tmp_1;
|
|
2104
|
+
if (isInterface(_this__u8e3s4, Struct)) {
|
|
2105
|
+
tmp_1 = _this__u8e3s4.rw() === 2;
|
|
2106
|
+
} else {
|
|
2107
|
+
tmp_1 = false;
|
|
2108
|
+
}
|
|
2109
|
+
if (tmp_1) {
|
|
2110
|
+
var tmp0 = get_arithmeticOperators();
|
|
2111
|
+
// Inline function 'kotlin.collections.contains' call
|
|
2112
|
+
// Inline function 'kotlin.collections.containsKey' call
|
|
2113
|
+
var key = _this__u8e3s4.xw();
|
|
2114
|
+
tmp_0 = (isInterface(tmp0, KtMap) ? tmp0 : THROW_CCE()).h2(key);
|
|
2115
|
+
} else {
|
|
2116
|
+
tmp_0 = false;
|
|
2117
|
+
}
|
|
2118
|
+
if (tmp_0) {
|
|
2119
|
+
// Inline function 'kotlin.collections.map' call
|
|
2120
|
+
var this_0 = _this__u8e3s4.yw();
|
|
2121
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2122
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2123
|
+
var _iterator__ex2g4s = this_0.n();
|
|
2124
|
+
while (_iterator__ex2g4s.q()) {
|
|
2125
|
+
var item = _iterator__ex2g4s.r();
|
|
2126
|
+
var tmp$ret$4 = solveArithmeticExpression(item);
|
|
2127
|
+
destination.l(tmp$ret$4);
|
|
2128
|
+
}
|
|
2129
|
+
// Inline function 'kotlin.collections.component1' call
|
|
2130
|
+
var left = destination.t(0);
|
|
2131
|
+
// Inline function 'kotlin.collections.component2' call
|
|
2132
|
+
var right = destination.t(1);
|
|
2133
|
+
tmp = getValue(get_arithmeticOperators(), _this__u8e3s4.xw())(left, right);
|
|
2134
|
+
} else {
|
|
2135
|
+
throw TuPrologException_init_$Create$('Unsupported probability notation: ' + _this__u8e3s4.toString());
|
|
2136
|
+
}
|
|
2097
2137
|
}
|
|
2098
|
-
return
|
|
2138
|
+
return tmp;
|
|
2099
2139
|
}
|
|
2100
2140
|
function withoutAnonymousVars(_this__u8e3s4) {
|
|
2101
2141
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2102
2142
|
var tmp = Companion_getInstance_5();
|
|
2103
2143
|
// Inline function 'kotlin.collections.filter' call
|
|
2104
|
-
var tmp0 = plus_0(toSet_0(_this__u8e3s4.
|
|
2144
|
+
var tmp0 = plus_0(toSet_0(_this__u8e3s4.dz().zw()), toSet_0(_this__u8e3s4.ez().zw()));
|
|
2105
2145
|
// Inline function 'kotlin.collections.filterTo' call
|
|
2106
2146
|
var destination = ArrayList_init_$Create$_0();
|
|
2107
2147
|
var _iterator__ex2g4s = tmp0.n();
|
|
2108
2148
|
while (_iterator__ex2g4s.q()) {
|
|
2109
2149
|
var element = _iterator__ex2g4s.r();
|
|
2110
|
-
if (element.
|
|
2150
|
+
if (element.u15()) {
|
|
2111
2151
|
destination.l(element);
|
|
2112
2152
|
}
|
|
2113
2153
|
}
|
|
@@ -2127,44 +2167,64 @@
|
|
|
2127
2167
|
var anonVarSubstitution = tmp.ofIterable(destination_0);
|
|
2128
2168
|
var tmp_0;
|
|
2129
2169
|
if (isInterface(_this__u8e3s4, Fact)) {
|
|
2130
|
-
tmp_0 = Companion_instance.of(safeToStruct(_this__u8e3s4.
|
|
2170
|
+
tmp_0 = Companion_instance.of(safeToStruct(_this__u8e3s4.dz().applySubstitution(anonVarSubstitution)));
|
|
2131
2171
|
} else {
|
|
2132
|
-
tmp_0 = Companion_instance_3.of(safeToStruct(_this__u8e3s4.
|
|
2172
|
+
tmp_0 = Companion_instance_3.of(safeToStruct(_this__u8e3s4.dz().applySubstitution(anonVarSubstitution)), [safeToStruct(_this__u8e3s4.ez().applySubstitution(anonVarSubstitution))]);
|
|
2133
2173
|
}
|
|
2134
2174
|
return tmp_0;
|
|
2135
2175
|
}
|
|
2136
2176
|
function get_extraVariables(_this__u8e3s4) {
|
|
2137
2177
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2138
2178
|
var tmp;
|
|
2139
|
-
if (!_this__u8e3s4.
|
|
2140
|
-
var headVars = toSet_0(_this__u8e3s4.
|
|
2141
|
-
var bodyVars = toSet_0(_this__u8e3s4.
|
|
2179
|
+
if (!_this__u8e3s4.by()) {
|
|
2180
|
+
var headVars = toSet_0(_this__u8e3s4.dz().zw());
|
|
2181
|
+
var bodyVars = toSet_0(_this__u8e3s4.ez().zw());
|
|
2142
2182
|
tmp = subtract(bodyVars, headVars);
|
|
2143
2183
|
} else {
|
|
2144
2184
|
tmp = emptySet();
|
|
2145
2185
|
}
|
|
2146
2186
|
return tmp;
|
|
2147
2187
|
}
|
|
2188
|
+
function arithmeticOperators$lambda(a, b) {
|
|
2189
|
+
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2190
|
+
return a + b;
|
|
2191
|
+
}
|
|
2192
|
+
function arithmeticOperators$lambda_0(a, b) {
|
|
2193
|
+
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2194
|
+
return a - b;
|
|
2195
|
+
}
|
|
2196
|
+
function arithmeticOperators$lambda_1(a, b) {
|
|
2197
|
+
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2198
|
+
return a * b;
|
|
2199
|
+
}
|
|
2200
|
+
function arithmeticOperators$lambda_2(a, b) {
|
|
2201
|
+
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2202
|
+
return a / b;
|
|
2203
|
+
}
|
|
2148
2204
|
var properties_initialized_ClauseMappingUtils_kt_tzf6ek;
|
|
2149
2205
|
function _init_properties_ClauseMappingUtils_kt__go80e() {
|
|
2150
2206
|
if (!properties_initialized_ClauseMappingUtils_kt_tzf6ek) {
|
|
2151
2207
|
properties_initialized_ClauseMappingUtils_kt_tzf6ek = true;
|
|
2152
2208
|
nonWrappableFunctors = setOf(['!', 'true', 'false']);
|
|
2209
|
+
var tmp = to('+', arithmeticOperators$lambda);
|
|
2210
|
+
var tmp_0 = to('-', arithmeticOperators$lambda_0);
|
|
2211
|
+
var tmp_1 = to('*', arithmeticOperators$lambda_1);
|
|
2212
|
+
arithmeticOperators = mapOf([tmp, tmp_0, tmp_1, to('/', arithmeticOperators$lambda_2)]);
|
|
2153
2213
|
}
|
|
2154
2214
|
}
|
|
2155
2215
|
function DirectiveClauseMapper() {
|
|
2156
2216
|
}
|
|
2157
|
-
protoOf(DirectiveClauseMapper).
|
|
2158
|
-
return clause.
|
|
2217
|
+
protoOf(DirectiveClauseMapper).v3n = function (clause) {
|
|
2218
|
+
return clause.gx();
|
|
2159
2219
|
};
|
|
2160
|
-
protoOf(DirectiveClauseMapper).
|
|
2161
|
-
var body = clause.
|
|
2220
|
+
protoOf(DirectiveClauseMapper).w3n = function (clause) {
|
|
2221
|
+
var body = clause.ez();
|
|
2162
2222
|
if (!isInterface(clause, Directive)) {
|
|
2163
2223
|
throw new ClauseMappingException('Clause is not an instance of Directive: ' + clause.toString());
|
|
2164
2224
|
}
|
|
2165
2225
|
var tmp;
|
|
2166
2226
|
if (isInterface(body, Struct)) {
|
|
2167
|
-
tmp = body.
|
|
2227
|
+
tmp = body.xw() === 'static' || body.xw() === 'dynamic';
|
|
2168
2228
|
} else {
|
|
2169
2229
|
tmp = false;
|
|
2170
2230
|
}
|
|
@@ -2173,21 +2233,21 @@
|
|
|
2173
2233
|
if (!isInterface(indicatorTerm, Indicator)) {
|
|
2174
2234
|
throw new ClauseMappingException('Malformed directive: ' + clause.toString());
|
|
2175
2235
|
}
|
|
2176
|
-
var name = indicatorTerm.
|
|
2177
|
-
var arity = indicatorTerm.
|
|
2236
|
+
var name = indicatorTerm.d11();
|
|
2237
|
+
var arity = indicatorTerm.e11();
|
|
2178
2238
|
if (!isInterface(arity, Numeric)) {
|
|
2179
2239
|
throw new ClauseMappingException('Malformed directive: ' + clause.toString());
|
|
2180
2240
|
}
|
|
2181
|
-
return listOf(Companion_instance_5.of(Companion_getInstance_1().of(body.
|
|
2241
|
+
return listOf(Companion_instance_5.of(Companion_getInstance_1().of(body.xw(), [Companion_instance_4.of(name, Companion_getInstance_6().ofInteger(arity.n11().toInt() + 1 | 0))]), []));
|
|
2182
2242
|
}
|
|
2183
2243
|
var tmp_0;
|
|
2184
2244
|
if (isInterface(body, Struct)) {
|
|
2185
|
-
tmp_0 = body.
|
|
2245
|
+
tmp_0 = body.xw() === 'initialization' || body.xw() === 'solve';
|
|
2186
2246
|
} else {
|
|
2187
2247
|
tmp_0 = false;
|
|
2188
2248
|
}
|
|
2189
2249
|
if (tmp_0) {
|
|
2190
|
-
return listOf(Companion_instance_5.of(Companion_getInstance_1().of(body.
|
|
2250
|
+
return listOf(Companion_instance_5.of(Companion_getInstance_1().of(body.xw(), [withBodyExplanation(body.get(0), Companion_getInstance_0().anonymous())]), []));
|
|
2191
2251
|
}
|
|
2192
2252
|
return listOf(clause);
|
|
2193
2253
|
};
|
|
@@ -2197,42 +2257,42 @@
|
|
|
2197
2257
|
}
|
|
2198
2258
|
function EvidenceClauseMapper() {
|
|
2199
2259
|
}
|
|
2200
|
-
protoOf(EvidenceClauseMapper).
|
|
2260
|
+
protoOf(EvidenceClauseMapper).v3n = function (clause) {
|
|
2201
2261
|
var tmp;
|
|
2202
2262
|
if (isInterface(clause, Rule)) {
|
|
2203
|
-
tmp = clause.
|
|
2263
|
+
tmp = clause.dz().xw() === 'evidence';
|
|
2204
2264
|
} else {
|
|
2205
2265
|
tmp = false;
|
|
2206
2266
|
}
|
|
2207
2267
|
return tmp;
|
|
2208
2268
|
};
|
|
2209
|
-
protoOf(EvidenceClauseMapper).
|
|
2269
|
+
protoOf(EvidenceClauseMapper).w3n = function (clause) {
|
|
2210
2270
|
if (!isInterface(clause, Rule)) {
|
|
2211
2271
|
throw new ClauseMappingException('Clause is not an instance of Rule: ' + clause.toString());
|
|
2212
2272
|
}
|
|
2213
|
-
if (clause.
|
|
2214
|
-
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.
|
|
2273
|
+
if (clause.dz().rw() > 2) {
|
|
2274
|
+
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.dz().toString());
|
|
2215
2275
|
} else {
|
|
2216
2276
|
var tmp;
|
|
2217
|
-
if (clause.
|
|
2218
|
-
var tmp_0 = clause.
|
|
2277
|
+
if (clause.dz().rw() === 2) {
|
|
2278
|
+
var tmp_0 = clause.dz().get(1);
|
|
2219
2279
|
tmp = !isInterface(tmp_0, Truth);
|
|
2220
2280
|
} else {
|
|
2221
2281
|
tmp = false;
|
|
2222
2282
|
}
|
|
2223
2283
|
if (tmp) {
|
|
2224
|
-
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.
|
|
2284
|
+
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.dz().toString());
|
|
2225
2285
|
}
|
|
2226
2286
|
}
|
|
2227
|
-
var headTerm = clause.
|
|
2228
|
-
if (headTerm.
|
|
2229
|
-
headTerm = Companion_getInstance_1().of(headTerm.
|
|
2287
|
+
var headTerm = clause.dz();
|
|
2288
|
+
if (headTerm.rw() === 1) {
|
|
2289
|
+
headTerm = Companion_getInstance_1().of(headTerm.xw(), [headTerm.get(0), Companion_getInstance_7().ow_1]);
|
|
2230
2290
|
}
|
|
2231
2291
|
var tmp_1;
|
|
2232
2292
|
if (isInterface(clause, Fact)) {
|
|
2233
2293
|
tmp_1 = Companion_instance.of(headTerm);
|
|
2234
2294
|
} else {
|
|
2235
|
-
tmp_1 = Companion_instance_3.of(headTerm, [withBodyExplanation(clause.
|
|
2295
|
+
tmp_1 = Companion_instance_3.of(headTerm, [withBodyExplanation(clause.ez(), Companion_getInstance_0().anonymous())]);
|
|
2236
2296
|
}
|
|
2237
2297
|
return listOf(tmp_1);
|
|
2238
2298
|
};
|
|
@@ -2255,7 +2315,7 @@
|
|
|
2255
2315
|
var _iterator__ex2g4s = clauses.n();
|
|
2256
2316
|
while (_iterator__ex2g4s.q()) {
|
|
2257
2317
|
var element = _iterator__ex2g4s.r();
|
|
2258
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2318
|
+
var list = ClauseMappingUtils_getInstance().h3o(element);
|
|
2259
2319
|
addAll(destination, list);
|
|
2260
2320
|
}
|
|
2261
2321
|
tmp_1 = destination;
|
|
@@ -2266,10 +2326,10 @@
|
|
|
2266
2326
|
tmp = theory;
|
|
2267
2327
|
}
|
|
2268
2328
|
theory = tmp;
|
|
2269
|
-
this.
|
|
2329
|
+
this.j3o_1 = theory;
|
|
2270
2330
|
}
|
|
2271
2331
|
protoOf(MappedMutableProblogTheory).l1v = function () {
|
|
2272
|
-
return
|
|
2332
|
+
return true;
|
|
2273
2333
|
};
|
|
2274
2334
|
protoOf(MappedMutableProblogTheory).y1v = function () {
|
|
2275
2335
|
return Companion_instance_8.ofIterable(this.v1n(), this);
|
|
@@ -2278,20 +2338,20 @@
|
|
|
2278
2338
|
return this.y1v();
|
|
2279
2339
|
};
|
|
2280
2340
|
protoOf(MappedMutableProblogTheory).l1u = function () {
|
|
2281
|
-
return this;
|
|
2341
|
+
return new MappedProblogTheory(null, this.v1n(), this.j3o_1.toImmutableTheory());
|
|
2282
2342
|
};
|
|
2283
2343
|
protoOf(MappedMutableProblogTheory).toImmutableTheory = function () {
|
|
2284
2344
|
return this.l1u();
|
|
2285
2345
|
};
|
|
2286
|
-
protoOf(MappedMutableProblogTheory).
|
|
2287
|
-
return new MappedMutableProblogTheory(null, this.v1n(), this.
|
|
2346
|
+
protoOf(MappedMutableProblogTheory).k3o = function (theory) {
|
|
2347
|
+
return new MappedMutableProblogTheory(null, this.v1n(), this.j3o_1.y1u(theory));
|
|
2288
2348
|
};
|
|
2289
2349
|
protoOf(MappedMutableProblogTheory).y1u = function (theory) {
|
|
2290
2350
|
var tmp;
|
|
2291
2351
|
if (isInterface(theory, ProblogTheory)) {
|
|
2292
|
-
tmp = this.
|
|
2352
|
+
tmp = this.k3o(theory);
|
|
2293
2353
|
} else {
|
|
2294
|
-
tmp = this.
|
|
2354
|
+
tmp = this.k3o(new MappedMutableProblogTheory(theory, this.v1n()));
|
|
2295
2355
|
}
|
|
2296
2356
|
return tmp;
|
|
2297
2357
|
};
|
|
@@ -2299,8 +2359,8 @@
|
|
|
2299
2359
|
return this.y1u(theory);
|
|
2300
2360
|
};
|
|
2301
2361
|
protoOf(MappedMutableProblogTheory).m1u = function (clause) {
|
|
2302
|
-
var mapped = ClauseMappingUtils_getInstance().
|
|
2303
|
-
return new MappedMutableProblogTheory(null, this.v1n(), this.
|
|
2362
|
+
var mapped = ClauseMappingUtils_getInstance().h3o(clause);
|
|
2363
|
+
return new MappedMutableProblogTheory(null, this.v1n(), this.j3o_1.y1u(Companion_instance_7.indexedOfIterable(this.v1n(), mapped)));
|
|
2304
2364
|
};
|
|
2305
2365
|
protoOf(MappedMutableProblogTheory).plus = function (clause) {
|
|
2306
2366
|
return this.m1u(clause);
|
|
@@ -2312,11 +2372,11 @@
|
|
|
2312
2372
|
var _iterator__ex2g4s = clauses.n();
|
|
2313
2373
|
while (_iterator__ex2g4s.q()) {
|
|
2314
2374
|
var element = _iterator__ex2g4s.r();
|
|
2315
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2375
|
+
var list = ClauseMappingUtils_getInstance().h3o(element);
|
|
2316
2376
|
addAll(destination, list);
|
|
2317
2377
|
}
|
|
2318
2378
|
var mapped = destination;
|
|
2319
|
-
return new MappedMutableProblogTheory(null, this.v1n(), this.
|
|
2379
|
+
return new MappedMutableProblogTheory(null, this.v1n(), this.j3o_1.c1v(mapped));
|
|
2320
2380
|
};
|
|
2321
2381
|
protoOf(MappedMutableProblogTheory).assertAIterable = function (clauses) {
|
|
2322
2382
|
return this.c1v(clauses);
|
|
@@ -2328,11 +2388,11 @@
|
|
|
2328
2388
|
var _iterator__ex2g4s = clauses.n();
|
|
2329
2389
|
while (_iterator__ex2g4s.q()) {
|
|
2330
2390
|
var element = _iterator__ex2g4s.r();
|
|
2331
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2391
|
+
var list = ClauseMappingUtils_getInstance().h3o(element);
|
|
2332
2392
|
addAll(destination, list);
|
|
2333
2393
|
}
|
|
2334
2394
|
var mapped = destination;
|
|
2335
|
-
return new MappedMutableProblogTheory(null, this.v1n(), this.
|
|
2395
|
+
return new MappedMutableProblogTheory(null, this.v1n(), this.j3o_1.f1v(mapped));
|
|
2336
2396
|
};
|
|
2337
2397
|
protoOf(MappedMutableProblogTheory).assertZIterable = function (clauses) {
|
|
2338
2398
|
return this.f1v(clauses);
|
|
@@ -2344,11 +2404,11 @@
|
|
|
2344
2404
|
var _iterator__ex2g4s = clauses.n();
|
|
2345
2405
|
while (_iterator__ex2g4s.q()) {
|
|
2346
2406
|
var element = _iterator__ex2g4s.r();
|
|
2347
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2407
|
+
var list = ClauseMappingUtils_getInstance().h3o(element);
|
|
2348
2408
|
addAll(destination, list);
|
|
2349
2409
|
}
|
|
2350
2410
|
var mapped = destination;
|
|
2351
|
-
var result = this.
|
|
2411
|
+
var result = this.j3o_1.j1v(mapped);
|
|
2352
2412
|
var tmp;
|
|
2353
2413
|
if (result instanceof Success) {
|
|
2354
2414
|
tmp = new Success(new MappedMutableProblogTheory(null, this.v1n(), result.e1w_1), result.f1w_1);
|
|
@@ -2361,7 +2421,7 @@
|
|
|
2361
2421
|
return this.j1v(clauses);
|
|
2362
2422
|
};
|
|
2363
2423
|
protoOf(MappedMutableProblogTheory).n1o = function (clause) {
|
|
2364
|
-
var mappedClauses = ClauseMappingUtils_getInstance().
|
|
2424
|
+
var mappedClauses = ClauseMappingUtils_getInstance().h3o(clause);
|
|
2365
2425
|
var result = null;
|
|
2366
2426
|
var _iterator__ex2g4s = mappedClauses.n();
|
|
2367
2427
|
while (_iterator__ex2g4s.q()) {
|
|
@@ -2373,7 +2433,7 @@
|
|
|
2373
2433
|
tmp = !(result instanceof Failure);
|
|
2374
2434
|
}
|
|
2375
2435
|
if (tmp) {
|
|
2376
|
-
result = this.
|
|
2436
|
+
result = this.j3o_1.n1o(c);
|
|
2377
2437
|
}
|
|
2378
2438
|
}
|
|
2379
2439
|
var tmp0_subject = result;
|
|
@@ -2393,7 +2453,7 @@
|
|
|
2393
2453
|
return this.n1o(clause);
|
|
2394
2454
|
};
|
|
2395
2455
|
protoOf(MappedMutableProblogTheory).r1u = function (indicator) {
|
|
2396
|
-
return new MappedMutableProblogTheory(null, this.v1n(), this.
|
|
2456
|
+
return new MappedMutableProblogTheory(null, this.v1n(), this.j3o_1.r1u(ClauseMappingUtils_getInstance().i3o(indicator)));
|
|
2397
2457
|
};
|
|
2398
2458
|
protoOf(MappedMutableProblogTheory).abolish = function (indicator) {
|
|
2399
2459
|
return this.r1u(indicator);
|
|
@@ -2435,7 +2495,7 @@
|
|
|
2435
2495
|
return this.g1v(clauses);
|
|
2436
2496
|
};
|
|
2437
2497
|
protoOf(MappedMutableProblogTheory).c1w = function (head) {
|
|
2438
|
-
return this.b1w(
|
|
2498
|
+
return this.b1w(anyMappedClause(head));
|
|
2439
2499
|
};
|
|
2440
2500
|
protoOf(MappedMutableProblogTheory).retractByHead = function (head) {
|
|
2441
2501
|
return this.c1w(head);
|
|
@@ -2453,82 +2513,82 @@
|
|
|
2453
2513
|
return this.i1v(clauses);
|
|
2454
2514
|
};
|
|
2455
2515
|
protoOf(MappedMutableProblogTheory).d1w = function (head) {
|
|
2456
|
-
return this.n1o(
|
|
2516
|
+
return this.n1o(anyMappedClause(head));
|
|
2457
2517
|
};
|
|
2458
2518
|
protoOf(MappedMutableProblogTheory).retractAllByHead = function (head) {
|
|
2459
2519
|
return this.d1w(head);
|
|
2460
2520
|
};
|
|
2461
2521
|
protoOf(MappedMutableProblogTheory).w1u = function (unificator) {
|
|
2462
|
-
return this.
|
|
2522
|
+
return this.j3o_1.w1u(unificator);
|
|
2463
2523
|
};
|
|
2464
2524
|
protoOf(MappedMutableProblogTheory).setUnificator = function (unificator) {
|
|
2465
2525
|
return this.w1u(unificator);
|
|
2466
2526
|
};
|
|
2467
|
-
protoOf(MappedMutableProblogTheory).
|
|
2468
|
-
return this.
|
|
2527
|
+
protoOf(MappedMutableProblogTheory).z12 = function (tags) {
|
|
2528
|
+
return this.j3o_1.z12(tags);
|
|
2469
2529
|
};
|
|
2470
2530
|
protoOf(MappedMutableProblogTheory).resetTags = function (tags) {
|
|
2471
|
-
return this.
|
|
2531
|
+
return this.z12(tags);
|
|
2472
2532
|
};
|
|
2473
2533
|
protoOf(MappedMutableProblogTheory).k1v = function () {
|
|
2474
|
-
return this.
|
|
2534
|
+
return this.j3o_1.k1v();
|
|
2475
2535
|
};
|
|
2476
2536
|
protoOf(MappedMutableProblogTheory).clone = function () {
|
|
2477
2537
|
return this.k1v();
|
|
2478
2538
|
};
|
|
2479
2539
|
protoOf(MappedMutableProblogTheory).contains = function (clause) {
|
|
2480
|
-
return this.
|
|
2540
|
+
return this.j3o_1.contains(clause);
|
|
2481
2541
|
};
|
|
2482
2542
|
protoOf(MappedMutableProblogTheory).containsHead = function (head) {
|
|
2483
|
-
return this.
|
|
2543
|
+
return this.j3o_1.containsHead(head);
|
|
2484
2544
|
};
|
|
2485
2545
|
protoOf(MappedMutableProblogTheory).containsIndicator = function (indicator) {
|
|
2486
|
-
return this.
|
|
2546
|
+
return this.j3o_1.containsIndicator(indicator);
|
|
2487
2547
|
};
|
|
2488
2548
|
protoOf(MappedMutableProblogTheory).get = function (clause) {
|
|
2489
|
-
return this.
|
|
2549
|
+
return this.j3o_1.get(clause);
|
|
2490
2550
|
};
|
|
2491
2551
|
protoOf(MappedMutableProblogTheory).getByHead = function (head) {
|
|
2492
|
-
return this.
|
|
2552
|
+
return this.j3o_1.getByHead(head);
|
|
2493
2553
|
};
|
|
2494
2554
|
protoOf(MappedMutableProblogTheory).getByIndicator = function (indicator) {
|
|
2495
|
-
return this.
|
|
2555
|
+
return this.j3o_1.getByIndicator(indicator);
|
|
2496
2556
|
};
|
|
2497
2557
|
protoOf(MappedMutableProblogTheory).toStringAsProlog = function (asPrologText) {
|
|
2498
|
-
return this.
|
|
2558
|
+
return this.j3o_1.toStringAsProlog(asPrologText);
|
|
2499
2559
|
};
|
|
2500
2560
|
protoOf(MappedMutableProblogTheory).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
2501
|
-
return this.
|
|
2561
|
+
return this.j3o_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
2502
2562
|
};
|
|
2503
2563
|
protoOf(MappedMutableProblogTheory).f1o = function () {
|
|
2504
|
-
return this.
|
|
2564
|
+
return this.j3o_1.f1o();
|
|
2505
2565
|
};
|
|
2506
2566
|
protoOf(MappedMutableProblogTheory).y1n = function () {
|
|
2507
|
-
return this.
|
|
2567
|
+
return this.j3o_1.y1n();
|
|
2508
2568
|
};
|
|
2509
2569
|
protoOf(MappedMutableProblogTheory).s = function () {
|
|
2510
|
-
return this.
|
|
2570
|
+
return this.j3o_1.s();
|
|
2511
2571
|
};
|
|
2512
2572
|
protoOf(MappedMutableProblogTheory).a1o = function () {
|
|
2513
|
-
return this.
|
|
2573
|
+
return this.j3o_1.a1o();
|
|
2514
2574
|
};
|
|
2515
2575
|
protoOf(MappedMutableProblogTheory).v1u = function () {
|
|
2516
|
-
return this.
|
|
2576
|
+
return this.j3o_1.v1u();
|
|
2517
2577
|
};
|
|
2518
2578
|
protoOf(MappedMutableProblogTheory).n = function () {
|
|
2519
|
-
return this.
|
|
2579
|
+
return this.j3o_1.n();
|
|
2520
2580
|
};
|
|
2521
2581
|
protoOf(MappedMutableProblogTheory).getTag = function (name) {
|
|
2522
|
-
return this.
|
|
2582
|
+
return this.j3o_1.getTag(name);
|
|
2523
2583
|
};
|
|
2524
2584
|
protoOf(MappedMutableProblogTheory).containsTag = function (name) {
|
|
2525
|
-
return this.
|
|
2585
|
+
return this.j3o_1.containsTag(name);
|
|
2526
2586
|
};
|
|
2527
|
-
protoOf(MappedMutableProblogTheory).
|
|
2528
|
-
return this.
|
|
2587
|
+
protoOf(MappedMutableProblogTheory).cu = function () {
|
|
2588
|
+
return this.j3o_1.cu();
|
|
2529
2589
|
};
|
|
2530
2590
|
protoOf(MappedMutableProblogTheory).v1n = function () {
|
|
2531
|
-
return this.
|
|
2591
|
+
return this.j3o_1.v1n();
|
|
2532
2592
|
};
|
|
2533
2593
|
function MappedProblogTheory(clauses, unificator, theory) {
|
|
2534
2594
|
unificator = unificator === VOID ? Companion_getInstance_8().o1n() : unificator;
|
|
@@ -2545,7 +2605,7 @@
|
|
|
2545
2605
|
var _iterator__ex2g4s = clauses.n();
|
|
2546
2606
|
while (_iterator__ex2g4s.q()) {
|
|
2547
2607
|
var element = _iterator__ex2g4s.r();
|
|
2548
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2608
|
+
var list = ClauseMappingUtils_getInstance().h3o(element);
|
|
2549
2609
|
addAll(destination, list);
|
|
2550
2610
|
}
|
|
2551
2611
|
tmp_1 = destination;
|
|
@@ -2556,7 +2616,7 @@
|
|
|
2556
2616
|
tmp = theory;
|
|
2557
2617
|
}
|
|
2558
2618
|
theory = tmp;
|
|
2559
|
-
this.
|
|
2619
|
+
this.l3o_1 = theory;
|
|
2560
2620
|
}
|
|
2561
2621
|
protoOf(MappedProblogTheory).l1v = function () {
|
|
2562
2622
|
return false;
|
|
@@ -2573,15 +2633,15 @@
|
|
|
2573
2633
|
protoOf(MappedProblogTheory).toImmutableTheory = function () {
|
|
2574
2634
|
return this.l1u();
|
|
2575
2635
|
};
|
|
2576
|
-
protoOf(MappedProblogTheory).
|
|
2577
|
-
return new MappedProblogTheory(null, this.v1n(), this.
|
|
2636
|
+
protoOf(MappedProblogTheory).k3o = function (theory) {
|
|
2637
|
+
return new MappedProblogTheory(null, this.v1n(), this.l3o_1.plusTheory(theory));
|
|
2578
2638
|
};
|
|
2579
2639
|
protoOf(MappedProblogTheory).y1u = function (theory) {
|
|
2580
2640
|
var tmp;
|
|
2581
2641
|
if (isInterface(theory, ProblogTheory)) {
|
|
2582
|
-
tmp = this.
|
|
2642
|
+
tmp = this.k3o(theory);
|
|
2583
2643
|
} else {
|
|
2584
|
-
tmp = this.
|
|
2644
|
+
tmp = this.k3o(new MappedProblogTheory(theory, this.v1n()));
|
|
2585
2645
|
}
|
|
2586
2646
|
return tmp;
|
|
2587
2647
|
};
|
|
@@ -2589,8 +2649,8 @@
|
|
|
2589
2649
|
return this.y1u(theory);
|
|
2590
2650
|
};
|
|
2591
2651
|
protoOf(MappedProblogTheory).m1u = function (clause) {
|
|
2592
|
-
var mapped = ClauseMappingUtils_getInstance().
|
|
2593
|
-
return new MappedProblogTheory(null, this.v1n(), this.
|
|
2652
|
+
var mapped = ClauseMappingUtils_getInstance().h3o(clause);
|
|
2653
|
+
return new MappedProblogTheory(null, this.v1n(), this.l3o_1.plusTheory(Companion_instance_7.indexedOfIterable(this.v1n(), mapped)));
|
|
2594
2654
|
};
|
|
2595
2655
|
protoOf(MappedProblogTheory).plus = function (clause) {
|
|
2596
2656
|
return this.m1u(clause);
|
|
@@ -2602,11 +2662,11 @@
|
|
|
2602
2662
|
var _iterator__ex2g4s = clauses.n();
|
|
2603
2663
|
while (_iterator__ex2g4s.q()) {
|
|
2604
2664
|
var element = _iterator__ex2g4s.r();
|
|
2605
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2665
|
+
var list = ClauseMappingUtils_getInstance().h3o(element);
|
|
2606
2666
|
addAll(destination, list);
|
|
2607
2667
|
}
|
|
2608
2668
|
var mapped = destination;
|
|
2609
|
-
return new MappedProblogTheory(null, this.v1n(), this.
|
|
2669
|
+
return new MappedProblogTheory(null, this.v1n(), this.l3o_1.assertAIterable(mapped));
|
|
2610
2670
|
};
|
|
2611
2671
|
protoOf(MappedProblogTheory).assertAIterable = function (clauses) {
|
|
2612
2672
|
return this.c1v(clauses);
|
|
@@ -2618,11 +2678,11 @@
|
|
|
2618
2678
|
var _iterator__ex2g4s = clauses.n();
|
|
2619
2679
|
while (_iterator__ex2g4s.q()) {
|
|
2620
2680
|
var element = _iterator__ex2g4s.r();
|
|
2621
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2681
|
+
var list = ClauseMappingUtils_getInstance().h3o(element);
|
|
2622
2682
|
addAll(destination, list);
|
|
2623
2683
|
}
|
|
2624
2684
|
var mapped = destination;
|
|
2625
|
-
return new MappedProblogTheory(null, this.v1n(), this.
|
|
2685
|
+
return new MappedProblogTheory(null, this.v1n(), this.l3o_1.assertZIterable(mapped));
|
|
2626
2686
|
};
|
|
2627
2687
|
protoOf(MappedProblogTheory).assertZIterable = function (clauses) {
|
|
2628
2688
|
return this.f1v(clauses);
|
|
@@ -2634,11 +2694,11 @@
|
|
|
2634
2694
|
var _iterator__ex2g4s = clauses.n();
|
|
2635
2695
|
while (_iterator__ex2g4s.q()) {
|
|
2636
2696
|
var element = _iterator__ex2g4s.r();
|
|
2637
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2697
|
+
var list = ClauseMappingUtils_getInstance().h3o(element);
|
|
2638
2698
|
addAll(destination, list);
|
|
2639
2699
|
}
|
|
2640
2700
|
var mapped = destination;
|
|
2641
|
-
var result = this.
|
|
2701
|
+
var result = this.l3o_1.retractIterable(mapped);
|
|
2642
2702
|
var tmp;
|
|
2643
2703
|
if (result instanceof Success) {
|
|
2644
2704
|
tmp = new Success(new MappedProblogTheory(null, this.v1n(), result.e1w_1), result.f1w_1);
|
|
@@ -2651,7 +2711,7 @@
|
|
|
2651
2711
|
return this.j1v(clauses);
|
|
2652
2712
|
};
|
|
2653
2713
|
protoOf(MappedProblogTheory).n1o = function (clause) {
|
|
2654
|
-
var mappedClauses = ClauseMappingUtils_getInstance().
|
|
2714
|
+
var mappedClauses = ClauseMappingUtils_getInstance().h3o(clause);
|
|
2655
2715
|
var result = null;
|
|
2656
2716
|
var _iterator__ex2g4s = mappedClauses.n();
|
|
2657
2717
|
while (_iterator__ex2g4s.q()) {
|
|
@@ -2663,7 +2723,7 @@
|
|
|
2663
2723
|
tmp = !(result instanceof Failure);
|
|
2664
2724
|
}
|
|
2665
2725
|
if (tmp) {
|
|
2666
|
-
result = this.
|
|
2726
|
+
result = this.l3o_1.retractAll(c);
|
|
2667
2727
|
}
|
|
2668
2728
|
}
|
|
2669
2729
|
var tmp_0;
|
|
@@ -2678,7 +2738,7 @@
|
|
|
2678
2738
|
return this.n1o(clause);
|
|
2679
2739
|
};
|
|
2680
2740
|
protoOf(MappedProblogTheory).r1u = function (indicator) {
|
|
2681
|
-
return new MappedProblogTheory(null, this.v1n(), this.
|
|
2741
|
+
return new MappedProblogTheory(null, this.v1n(), this.l3o_1.abolish(ClauseMappingUtils_getInstance().i3o(indicator)));
|
|
2682
2742
|
};
|
|
2683
2743
|
protoOf(MappedProblogTheory).abolish = function (indicator) {
|
|
2684
2744
|
return this.r1u(indicator);
|
|
@@ -2720,7 +2780,7 @@
|
|
|
2720
2780
|
return this.g1v(clauses);
|
|
2721
2781
|
};
|
|
2722
2782
|
protoOf(MappedProblogTheory).c1w = function (head) {
|
|
2723
|
-
return this.b1w(
|
|
2783
|
+
return this.b1w(anyMappedClause(head));
|
|
2724
2784
|
};
|
|
2725
2785
|
protoOf(MappedProblogTheory).retractByHead = function (head) {
|
|
2726
2786
|
return this.c1w(head);
|
|
@@ -2738,80 +2798,80 @@
|
|
|
2738
2798
|
return this.i1v(clauses);
|
|
2739
2799
|
};
|
|
2740
2800
|
protoOf(MappedProblogTheory).d1w = function (head) {
|
|
2741
|
-
return this.n1o(
|
|
2801
|
+
return this.n1o(anyMappedClause(head));
|
|
2742
2802
|
};
|
|
2743
2803
|
protoOf(MappedProblogTheory).retractAllByHead = function (head) {
|
|
2744
2804
|
return this.d1w(head);
|
|
2745
2805
|
};
|
|
2746
2806
|
protoOf(MappedProblogTheory).setUnificator = function (unificator) {
|
|
2747
|
-
return this.
|
|
2807
|
+
return this.l3o_1.setUnificator(unificator);
|
|
2748
2808
|
};
|
|
2749
2809
|
protoOf(MappedProblogTheory).contains = function (clause) {
|
|
2750
|
-
return this.
|
|
2810
|
+
return this.l3o_1.contains(clause);
|
|
2751
2811
|
};
|
|
2752
2812
|
protoOf(MappedProblogTheory).containsHead = function (head) {
|
|
2753
|
-
return this.
|
|
2813
|
+
return this.l3o_1.containsHead(head);
|
|
2754
2814
|
};
|
|
2755
2815
|
protoOf(MappedProblogTheory).containsIndicator = function (indicator) {
|
|
2756
|
-
return this.
|
|
2816
|
+
return this.l3o_1.containsIndicator(indicator);
|
|
2757
2817
|
};
|
|
2758
2818
|
protoOf(MappedProblogTheory).get = function (clause) {
|
|
2759
|
-
return this.
|
|
2819
|
+
return this.l3o_1.get(clause);
|
|
2760
2820
|
};
|
|
2761
2821
|
protoOf(MappedProblogTheory).getByHead = function (head) {
|
|
2762
|
-
return this.
|
|
2822
|
+
return this.l3o_1.getByHead(head);
|
|
2763
2823
|
};
|
|
2764
2824
|
protoOf(MappedProblogTheory).getByIndicator = function (indicator) {
|
|
2765
|
-
return this.
|
|
2825
|
+
return this.l3o_1.getByIndicator(indicator);
|
|
2766
2826
|
};
|
|
2767
2827
|
protoOf(MappedProblogTheory).toStringAsProlog = function (asPrologText) {
|
|
2768
|
-
return this.
|
|
2828
|
+
return this.l3o_1.toStringAsProlog(asPrologText);
|
|
2769
2829
|
};
|
|
2770
2830
|
protoOf(MappedProblogTheory).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
2771
|
-
return this.
|
|
2831
|
+
return this.l3o_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
2772
2832
|
};
|
|
2773
2833
|
protoOf(MappedProblogTheory).clone = function () {
|
|
2774
|
-
return this.
|
|
2834
|
+
return this.l3o_1.clone();
|
|
2775
2835
|
};
|
|
2776
2836
|
protoOf(MappedProblogTheory).f1o = function () {
|
|
2777
|
-
return this.
|
|
2837
|
+
return this.l3o_1.f1o();
|
|
2778
2838
|
};
|
|
2779
2839
|
protoOf(MappedProblogTheory).y1n = function () {
|
|
2780
|
-
return this.
|
|
2840
|
+
return this.l3o_1.y1n();
|
|
2781
2841
|
};
|
|
2782
2842
|
protoOf(MappedProblogTheory).s = function () {
|
|
2783
|
-
return this.
|
|
2843
|
+
return this.l3o_1.s();
|
|
2784
2844
|
};
|
|
2785
2845
|
protoOf(MappedProblogTheory).a1o = function () {
|
|
2786
|
-
return this.
|
|
2846
|
+
return this.l3o_1.a1o();
|
|
2787
2847
|
};
|
|
2788
2848
|
protoOf(MappedProblogTheory).v1u = function () {
|
|
2789
|
-
return this.
|
|
2849
|
+
return this.l3o_1.v1u();
|
|
2790
2850
|
};
|
|
2791
2851
|
protoOf(MappedProblogTheory).n = function () {
|
|
2792
|
-
return this.
|
|
2852
|
+
return this.l3o_1.n();
|
|
2793
2853
|
};
|
|
2794
2854
|
protoOf(MappedProblogTheory).getTag = function (name) {
|
|
2795
|
-
return this.
|
|
2855
|
+
return this.l3o_1.getTag(name);
|
|
2796
2856
|
};
|
|
2797
2857
|
protoOf(MappedProblogTheory).resetTags = function (tags) {
|
|
2798
|
-
return this.
|
|
2858
|
+
return this.l3o_1.resetTags(tags);
|
|
2799
2859
|
};
|
|
2800
2860
|
protoOf(MappedProblogTheory).containsTag = function (name) {
|
|
2801
|
-
return this.
|
|
2861
|
+
return this.l3o_1.containsTag(name);
|
|
2802
2862
|
};
|
|
2803
|
-
protoOf(MappedProblogTheory).
|
|
2804
|
-
return this.
|
|
2863
|
+
protoOf(MappedProblogTheory).cu = function () {
|
|
2864
|
+
return this.l3o_1.cu();
|
|
2805
2865
|
};
|
|
2806
2866
|
protoOf(MappedProblogTheory).v1n = function () {
|
|
2807
|
-
return this.
|
|
2867
|
+
return this.l3o_1.v1n();
|
|
2808
2868
|
};
|
|
2809
2869
|
function NothingClauseMapper() {
|
|
2810
2870
|
}
|
|
2811
|
-
protoOf(NothingClauseMapper).
|
|
2871
|
+
protoOf(NothingClauseMapper).v3n = function (clause) {
|
|
2812
2872
|
return true;
|
|
2813
2873
|
};
|
|
2814
|
-
protoOf(NothingClauseMapper).
|
|
2874
|
+
protoOf(NothingClauseMapper).w3n = function (clause) {
|
|
2815
2875
|
return listOf(clause);
|
|
2816
2876
|
};
|
|
2817
2877
|
var NothingClauseMapper_instance;
|
|
@@ -2820,63 +2880,63 @@
|
|
|
2820
2880
|
}
|
|
2821
2881
|
function ProbabilisticClauseMapper() {
|
|
2822
2882
|
}
|
|
2823
|
-
protoOf(ProbabilisticClauseMapper).
|
|
2883
|
+
protoOf(ProbabilisticClauseMapper).v3n = function (clause) {
|
|
2824
2884
|
var tmp;
|
|
2825
2885
|
if (isInterface(clause, Rule)) {
|
|
2826
|
-
tmp = clause.
|
|
2886
|
+
tmp = clause.dz().xw() === '::';
|
|
2827
2887
|
} else {
|
|
2828
2888
|
tmp = false;
|
|
2829
2889
|
}
|
|
2830
2890
|
return tmp;
|
|
2831
2891
|
};
|
|
2832
|
-
protoOf(ProbabilisticClauseMapper).
|
|
2892
|
+
protoOf(ProbabilisticClauseMapper).w3n = function (clause) {
|
|
2833
2893
|
if (!isInterface(clause, Rule)) {
|
|
2834
2894
|
throw new ClauseMappingException('Clause is not an instance of Rule: ' + clause.toString());
|
|
2835
2895
|
}
|
|
2836
|
-
var mapped = this.
|
|
2837
|
-
return listOf(this.
|
|
2896
|
+
var mapped = this.x3n(clause);
|
|
2897
|
+
return listOf(this.y3n(mapped.first, Companion_getInstance_11().k3n(mapped.second)));
|
|
2838
2898
|
};
|
|
2839
|
-
protoOf(ProbabilisticClauseMapper).
|
|
2840
|
-
if (!(rule.
|
|
2841
|
-
throw TuPrologException_init_$Create$('Invalid probabilistic rule: ' + rule.
|
|
2899
|
+
protoOf(ProbabilisticClauseMapper).x3n = function (rule) {
|
|
2900
|
+
if (!(rule.dz().rw() === 2)) {
|
|
2901
|
+
throw TuPrologException_init_$Create$('Invalid probabilistic rule: ' + rule.dz().toString());
|
|
2842
2902
|
}
|
|
2843
|
-
var probTerm = rule.
|
|
2903
|
+
var probTerm = rule.dz().get(0);
|
|
2844
2904
|
var tmp;
|
|
2845
2905
|
if (isInterface(probTerm, Numeric)) {
|
|
2846
|
-
tmp = probTerm.
|
|
2906
|
+
tmp = probTerm.n11().toDouble();
|
|
2847
2907
|
} else {
|
|
2848
2908
|
tmp = solveArithmeticExpression(probTerm);
|
|
2849
2909
|
}
|
|
2850
2910
|
var probability = tmp;
|
|
2851
|
-
var headTerm = safeToStruct(rule.
|
|
2852
|
-
if (headTerm.
|
|
2853
|
-
throw TuPrologException_init_$Create$("Probability notation can't be expressed on evidence: " + rule.
|
|
2911
|
+
var headTerm = safeToStruct(rule.dz().get(1));
|
|
2912
|
+
if (headTerm.xw() === 'evidence') {
|
|
2913
|
+
throw TuPrologException_init_$Create$("Probability notation can't be expressed on evidence: " + rule.dz().toString());
|
|
2854
2914
|
}
|
|
2855
|
-
var bodyTerm = rule.
|
|
2856
|
-
var tmp_0 = rule.
|
|
2915
|
+
var bodyTerm = rule.ez();
|
|
2916
|
+
var tmp_0 = rule.ez();
|
|
2857
2917
|
if (isInterface(tmp_0, Truth)) {
|
|
2858
|
-
if (!rule.
|
|
2918
|
+
if (!rule.ez().vw() && probability < 1.0) {
|
|
2859
2919
|
probability = 1.0 - probability;
|
|
2860
2920
|
bodyTerm = Companion_getInstance_7().of(true);
|
|
2861
2921
|
}
|
|
2862
2922
|
}
|
|
2863
2923
|
var anonVariablesFix = withoutAnonymousVars(Companion_instance_3.of(headTerm, [bodyTerm]));
|
|
2864
|
-
headTerm = anonVariablesFix.
|
|
2865
|
-
bodyTerm = anonVariablesFix.
|
|
2924
|
+
headTerm = anonVariablesFix.dz();
|
|
2925
|
+
bodyTerm = anonVariablesFix.ez();
|
|
2866
2926
|
var extraVariables = get_extraVariables(Companion_instance_3.of(headTerm, [bodyTerm]));
|
|
2867
|
-
var probTerm_0 = new ProbTerm(ClauseMappingUtils_getInstance().
|
|
2927
|
+
var probTerm_0 = new ProbTerm(ClauseMappingUtils_getInstance().g3o(), probability, headTerm, extraVariables);
|
|
2868
2928
|
return new Pair(Companion_instance_3.of(headTerm, [bodyTerm]), probTerm_0);
|
|
2869
2929
|
};
|
|
2870
|
-
protoOf(ProbabilisticClauseMapper).
|
|
2871
|
-
var tmp = rule.
|
|
2930
|
+
protoOf(ProbabilisticClauseMapper).y3n = function (rule, explanation) {
|
|
2931
|
+
var tmp = rule.ez();
|
|
2872
2932
|
if (isInterface(tmp, Truth)) {
|
|
2873
|
-
return Companion_instance_3.of(withExplanation(rule.
|
|
2933
|
+
return Companion_instance_3.of(withExplanation(rule.dz(), toTerm(explanation)), [rule.ez()]);
|
|
2874
2934
|
}
|
|
2875
2935
|
var explanationVar = Companion_getInstance_0().of('EXPL_Res');
|
|
2876
2936
|
var explanationBodyVar = Companion_getInstance_0().of('EXPL_Body');
|
|
2877
|
-
var newBody = withBodyExplanation(rule.
|
|
2937
|
+
var newBody = withBodyExplanation(rule.ez(), explanationBodyVar);
|
|
2878
2938
|
var tmp_0 = Companion_instance_3;
|
|
2879
|
-
var tmp_1 = withExplanation(rule.
|
|
2939
|
+
var tmp_1 = withExplanation(rule.dz(), explanationVar);
|
|
2880
2940
|
var tmp_2 = Companion_getInstance_1();
|
|
2881
2941
|
var tmp_3 = Companion_getInstance_1();
|
|
2882
2942
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
@@ -2889,36 +2949,36 @@
|
|
|
2889
2949
|
}
|
|
2890
2950
|
function PrologClauseMapper() {
|
|
2891
2951
|
}
|
|
2892
|
-
protoOf(PrologClauseMapper).
|
|
2952
|
+
protoOf(PrologClauseMapper).v3n = function (clause) {
|
|
2893
2953
|
return isInterface(clause, Rule);
|
|
2894
2954
|
};
|
|
2895
|
-
protoOf(PrologClauseMapper).
|
|
2955
|
+
protoOf(PrologClauseMapper).w3n = function (clause) {
|
|
2896
2956
|
if (!isInterface(clause, Rule)) {
|
|
2897
2957
|
throw new ClauseMappingException('Clause is not an instance of Rule: ' + clause.toString());
|
|
2898
2958
|
}
|
|
2899
|
-
var tmp = clause.
|
|
2959
|
+
var tmp = clause.ez();
|
|
2900
2960
|
if (isInterface(tmp, Truth)) {
|
|
2901
|
-
return listOf(Companion_instance_3.of(withExplanation(clause.
|
|
2961
|
+
return listOf(Companion_instance_3.of(withExplanation(clause.dz(), toTerm(Companion_getInstance_11().g3n_1)), [clause.ez()]));
|
|
2902
2962
|
}
|
|
2903
2963
|
var explanationVar = Companion_getInstance_0().of('EXPL_Res');
|
|
2904
|
-
return listOf(Companion_instance_3.of(withExplanation(clause.
|
|
2964
|
+
return listOf(Companion_instance_3.of(withExplanation(clause.dz(), explanationVar), [withBodyExplanation(clause.ez(), explanationVar)]));
|
|
2905
2965
|
};
|
|
2906
2966
|
var PrologClauseMapper_instance;
|
|
2907
2967
|
function PrologClauseMapper_getInstance() {
|
|
2908
2968
|
return PrologClauseMapper_instance;
|
|
2909
2969
|
}
|
|
2910
2970
|
function _get_prob__dc6m52($this, $receiver) {
|
|
2911
|
-
return $receiver.
|
|
2971
|
+
return $receiver.d3m_1.s3n();
|
|
2912
2972
|
}
|
|
2913
2973
|
function ProbExplAnd() {
|
|
2914
2974
|
ProbExplAnd_instance = this;
|
|
2915
2975
|
NonBacktrackable.call(this, 'prob_expl_and');
|
|
2916
2976
|
}
|
|
2917
|
-
protoOf(ProbExplAnd).
|
|
2918
|
-
Companion_getInstance_9().
|
|
2919
|
-
Companion_getInstance_9().
|
|
2920
|
-
if (ProbSetConfig_getInstance().
|
|
2921
|
-
return _this__u8e3s4.replyWith(Companion_getInstance_9().
|
|
2977
|
+
protoOf(ProbExplAnd).c30 = function (_this__u8e3s4, first, second, third) {
|
|
2978
|
+
Companion_getInstance_9().w2l(_this__u8e3s4, 1);
|
|
2979
|
+
Companion_getInstance_9().c2m(_this__u8e3s4, 1);
|
|
2980
|
+
if (ProbSetConfig_getInstance().n3o(_this__u8e3s4.context)) {
|
|
2981
|
+
return _this__u8e3s4.replyWith(Companion_getInstance_9().q2l(_this__u8e3s4, first, toTerm(Companion_getInstance_11().g3n_1)), VOID, []);
|
|
2922
2982
|
}
|
|
2923
2983
|
var tmp;
|
|
2924
2984
|
var tmp_0;
|
|
@@ -2934,12 +2994,12 @@
|
|
|
2934
2994
|
tmp_0 = false;
|
|
2935
2995
|
}
|
|
2936
2996
|
if (tmp_0) {
|
|
2937
|
-
var explanation = _get_prob__dc6m52(this, second) === 0.0 || _get_prob__dc6m52(this, third) === 0.0 ? Companion_getInstance_11().
|
|
2997
|
+
var explanation = _get_prob__dc6m52(this, second) === 0.0 || _get_prob__dc6m52(this, third) === 0.0 ? Companion_getInstance_11().f3n_1 : _get_prob__dc6m52(this, second) === 1.0 && _get_prob__dc6m52(this, third) === 1.0 ? Companion_getInstance_11().g3n_1 : _get_prob__dc6m52(this, second) === 1.0 ? third.d3m_1 : _get_prob__dc6m52(this, third) === 1.0 ? second.d3m_1 : second.d3m_1.and(third.d3m_1);
|
|
2938
2998
|
var tmp_2;
|
|
2939
|
-
if (explanation.
|
|
2999
|
+
if (explanation.s3n() === 0.0) {
|
|
2940
3000
|
tmp_2 = _this__u8e3s4.replyWithCondition(false, VOID, []);
|
|
2941
3001
|
} else {
|
|
2942
|
-
tmp_2 = _this__u8e3s4.replyWith(Companion_getInstance_9().
|
|
3002
|
+
tmp_2 = _this__u8e3s4.replyWith(Companion_getInstance_9().q2l(_this__u8e3s4, first, new ProbExplanationTerm(explanation)), VOID, []);
|
|
2943
3003
|
}
|
|
2944
3004
|
tmp = tmp_2;
|
|
2945
3005
|
} else {
|
|
@@ -2949,8 +3009,8 @@
|
|
|
2949
3009
|
}
|
|
2950
3010
|
return tmp;
|
|
2951
3011
|
};
|
|
2952
|
-
protoOf(ProbExplAnd).
|
|
2953
|
-
return this.
|
|
3012
|
+
protoOf(ProbExplAnd).z2n = function (_this__u8e3s4, first, second, third) {
|
|
3013
|
+
return this.c30(_this__u8e3s4, first, second, third);
|
|
2954
3014
|
};
|
|
2955
3015
|
var ProbExplAnd_instance;
|
|
2956
3016
|
function ProbExplAnd_getInstance() {
|
|
@@ -2959,22 +3019,22 @@
|
|
|
2959
3019
|
return ProbExplAnd_instance;
|
|
2960
3020
|
}
|
|
2961
3021
|
function ProbHelper$computeAllSubstitutions$slambda($goal, $this_computeAllSubstitutions, $third, $first, $second, $goalSignature, resultContinuation) {
|
|
2962
|
-
this.
|
|
2963
|
-
this.
|
|
2964
|
-
this.
|
|
2965
|
-
this.
|
|
2966
|
-
this.
|
|
2967
|
-
this.
|
|
3022
|
+
this.w3o_1 = $goal;
|
|
3023
|
+
this.x3o_1 = $this_computeAllSubstitutions;
|
|
3024
|
+
this.y3o_1 = $third;
|
|
3025
|
+
this.z3o_1 = $first;
|
|
3026
|
+
this.a3p_1 = $second;
|
|
3027
|
+
this.b3p_1 = $goalSignature;
|
|
2968
3028
|
CoroutineImpl.call(this, resultContinuation);
|
|
2969
3029
|
}
|
|
2970
|
-
protoOf(ProbHelper$computeAllSubstitutions$slambda).
|
|
2971
|
-
var tmp = this.
|
|
3030
|
+
protoOf(ProbHelper$computeAllSubstitutions$slambda).a32 = function ($this$sequence, $completion) {
|
|
3031
|
+
var tmp = this.b32($this$sequence, $completion);
|
|
2972
3032
|
tmp.r8_1 = Unit_instance;
|
|
2973
3033
|
tmp.s8_1 = null;
|
|
2974
3034
|
return tmp.x8();
|
|
2975
3035
|
};
|
|
2976
3036
|
protoOf(ProbHelper$computeAllSubstitutions$slambda).o9 = function (p1, $completion) {
|
|
2977
|
-
return this.
|
|
3037
|
+
return this.a32(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
|
|
2978
3038
|
};
|
|
2979
3039
|
protoOf(ProbHelper$computeAllSubstitutions$slambda).x8 = function () {
|
|
2980
3040
|
var suspendResult = this.r8_1;
|
|
@@ -2984,27 +3044,27 @@
|
|
|
2984
3044
|
switch (tmp) {
|
|
2985
3045
|
case 0:
|
|
2986
3046
|
this.q8_1 = 18;
|
|
2987
|
-
var tmp0_subject = this.
|
|
3047
|
+
var tmp0_subject = this.w3o_1.xw();
|
|
2988
3048
|
switch (tmp0_subject) {
|
|
2989
3049
|
case '\\+':
|
|
2990
3050
|
case 'not':
|
|
2991
3051
|
this.p8_1 = 16;
|
|
2992
3052
|
var tmp_0;
|
|
2993
|
-
if (ProbSetConfig_getInstance().
|
|
3053
|
+
if (ProbSetConfig_getInstance().n3o(this.x3o_1.context)) {
|
|
2994
3054
|
var tmp_1 = Companion_getInstance_9();
|
|
2995
3055
|
var tmp_2 = Companion_getInstance_1();
|
|
2996
|
-
var tmp_3 = this.
|
|
3056
|
+
var tmp_3 = this.w3o_1.xw();
|
|
2997
3057
|
var tmp_4 = Companion_getInstance_1();
|
|
2998
3058
|
var this_0 = Prob_getInstance();
|
|
2999
|
-
tmp_0 = tmp_1.
|
|
3059
|
+
tmp_0 = tmp_1.q2l(this.x3o_1, this.y3o_1, tmp_2.of(tmp_3, [tmp_4.of(this_0.signature.name, [Companion_getInstance_0().anonymous(), this.w3o_1.get(0)])])).plus(Companion_getInstance_9().q2l(this.x3o_1, this.z3o_1, toTerm(Companion_getInstance_11().g3n_1)));
|
|
3000
3060
|
} else {
|
|
3001
3061
|
var tmp_5 = Companion_getInstance_9();
|
|
3002
3062
|
var tmp_6 = Companion_getInstance_1();
|
|
3003
3063
|
var this_1 = ProbNegationAsFailure_getInstance();
|
|
3004
|
-
tmp_0 = tmp_5.
|
|
3064
|
+
tmp_0 = tmp_5.q2l(this.x3o_1, this.y3o_1, tmp_6.of(this_1.signature.name, [this.z3o_1, this.w3o_1.get(0)]));
|
|
3005
3065
|
}
|
|
3006
3066
|
|
|
3007
|
-
suspendResult = this.
|
|
3067
|
+
suspendResult = this.c3p_1.se(tmp_0, this);
|
|
3008
3068
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3009
3069
|
return suspendResult;
|
|
3010
3070
|
}
|
|
@@ -3017,13 +3077,13 @@
|
|
|
3017
3077
|
case '->':
|
|
3018
3078
|
this.p8_1 = 15;
|
|
3019
3079
|
var tmp_7;
|
|
3020
|
-
if (ProbSetConfig_getInstance().
|
|
3021
|
-
tmp_7 = Companion_getInstance_9().
|
|
3080
|
+
if (ProbSetConfig_getInstance().n3o(this.x3o_1.context)) {
|
|
3081
|
+
tmp_7 = Companion_getInstance_9().q2l(this.x3o_1, this.y3o_1, withBodyExplanation(this.w3o_1, Companion_getInstance_0().anonymous())).plus(Companion_getInstance_9().q2l(this.x3o_1, this.z3o_1, toTerm(Companion_getInstance_11().g3n_1)));
|
|
3022
3082
|
} else {
|
|
3023
|
-
tmp_7 = Companion_getInstance_9().
|
|
3083
|
+
tmp_7 = Companion_getInstance_9().q2l(this.x3o_1, this.y3o_1, withBodyExplanation(this.w3o_1, this.z3o_1));
|
|
3024
3084
|
}
|
|
3025
3085
|
|
|
3026
|
-
suspendResult = this.
|
|
3086
|
+
suspendResult = this.c3p_1.se(tmp_7, this);
|
|
3027
3087
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3028
3088
|
return suspendResult;
|
|
3029
3089
|
}
|
|
@@ -3031,9 +3091,9 @@
|
|
|
3031
3091
|
continue $sm;
|
|
3032
3092
|
default:
|
|
3033
3093
|
if (tmp0_subject === 'call') {
|
|
3034
|
-
var newGoal = this.
|
|
3094
|
+
var newGoal = this.w3o_1.get(0);
|
|
3035
3095
|
this.p8_1 = 14;
|
|
3036
|
-
suspendResult = this.
|
|
3096
|
+
suspendResult = this.c3p_1.se(Companion_getInstance_9().q2l(this.x3o_1, this.y3o_1, Companion_instance_0.of(Companion_getInstance_1().of('ensure_executable', [newGoal]), Companion_getInstance_1().of(this.w3o_1.xw(), [withBodyExplanation(newGoal, this.z3o_1)]))), this);
|
|
3037
3097
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3038
3098
|
return suspendResult;
|
|
3039
3099
|
}
|
|
@@ -3041,18 +3101,18 @@
|
|
|
3041
3101
|
} else {
|
|
3042
3102
|
if (tmp0_subject === 'catch') {
|
|
3043
3103
|
this.p8_1 = 13;
|
|
3044
|
-
suspendResult = this.
|
|
3104
|
+
suspendResult = this.c3p_1.se(Companion_getInstance_9().q2l(this.x3o_1, this.y3o_1, Companion_getInstance_1().of(this.w3o_1.xw(), [withBodyExplanation(this.w3o_1.get(0), this.z3o_1), this.w3o_1.get(1), withBodyExplanation(this.w3o_1.get(2), this.z3o_1)])), this);
|
|
3045
3105
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3046
3106
|
return suspendResult;
|
|
3047
3107
|
}
|
|
3048
3108
|
continue $sm;
|
|
3049
3109
|
} else {
|
|
3050
3110
|
if (tmp0_subject === 'findall') {
|
|
3051
|
-
var this_2 = this.
|
|
3111
|
+
var this_2 = this.w3o_1.yw();
|
|
3052
3112
|
var goalArgs = copyToArray(this_2);
|
|
3053
3113
|
goalArgs[1] = withBodyExplanation(goalArgs[1], Companion_getInstance_0().anonymous());
|
|
3054
3114
|
this.p8_1 = 12;
|
|
3055
|
-
suspendResult = this.
|
|
3115
|
+
suspendResult = this.c3p_1.se(Companion_getInstance_9().q2l(this.x3o_1, this.y3o_1, Companion_getInstance_1().of(this.w3o_1.xw(), goalArgs.slice())).plus(Companion_getInstance_9().q2l(this.x3o_1, this.z3o_1, toTerm(Companion_getInstance_11().g3n_1))), this);
|
|
3056
3116
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3057
3117
|
return suspendResult;
|
|
3058
3118
|
}
|
|
@@ -3062,22 +3122,22 @@
|
|
|
3062
3122
|
case 'assert':
|
|
3063
3123
|
case 'asserta':
|
|
3064
3124
|
case 'assertz':
|
|
3065
|
-
var subGoal = this.
|
|
3125
|
+
var subGoal = this.w3o_1.get(0);
|
|
3066
3126
|
var tmp_8;
|
|
3067
3127
|
if (isInterface(subGoal, Clause)) {
|
|
3068
|
-
tmp_8 = extractSignature(ensureNotNull(subGoal.
|
|
3128
|
+
tmp_8 = extractSignature(ensureNotNull(subGoal.dz()));
|
|
3069
3129
|
} else {
|
|
3070
3130
|
tmp_8 = extractSignature(safeToStruct(subGoal));
|
|
3071
3131
|
}
|
|
3072
3132
|
|
|
3073
3133
|
var subGoalSignature = tmp_8;
|
|
3074
3134
|
var tmp_9;
|
|
3075
|
-
if (this.
|
|
3135
|
+
if (this.x3o_1.context.t1x().containsSignature(subGoalSignature)) {
|
|
3076
3136
|
tmp_9 = true;
|
|
3077
3137
|
} else {
|
|
3078
3138
|
var tmp_10;
|
|
3079
3139
|
if (isInterface(subGoal, Clause)) {
|
|
3080
|
-
tmp_10 = !subGoal.
|
|
3140
|
+
tmp_10 = !subGoal.nz();
|
|
3081
3141
|
} else {
|
|
3082
3142
|
tmp_10 = false;
|
|
3083
3143
|
}
|
|
@@ -3086,7 +3146,7 @@
|
|
|
3086
3146
|
|
|
3087
3147
|
if (tmp_9) {
|
|
3088
3148
|
this.p8_1 = 10;
|
|
3089
|
-
suspendResult = this.
|
|
3149
|
+
suspendResult = this.c3p_1.se(Companion_getInstance_9().q2l(this.x3o_1, this.y3o_1, this.w3o_1).plus(Companion_getInstance_9().q2l(this.x3o_1, this.z3o_1, toTerm(Companion_getInstance_11().g3n_1))), this);
|
|
3090
3150
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3091
3151
|
return suspendResult;
|
|
3092
3152
|
}
|
|
@@ -3094,15 +3154,15 @@
|
|
|
3094
3154
|
} else {
|
|
3095
3155
|
var tmp_11;
|
|
3096
3156
|
if (isInterface(subGoal, Clause)) {
|
|
3097
|
-
tmp_11 = ClauseMappingUtils_getInstance().
|
|
3157
|
+
tmp_11 = ClauseMappingUtils_getInstance().h3o(subGoal);
|
|
3098
3158
|
} else {
|
|
3099
3159
|
if (isInterface(subGoal, Struct)) {
|
|
3100
|
-
var this_3 = ClauseMappingUtils_getInstance().
|
|
3160
|
+
var this_3 = ClauseMappingUtils_getInstance().h3o(Companion_instance.of(subGoal));
|
|
3101
3161
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_3, 10));
|
|
3102
3162
|
var _iterator__ex2g4s = this_3.n();
|
|
3103
3163
|
while (_iterator__ex2g4s.q()) {
|
|
3104
3164
|
var item = _iterator__ex2g4s.r();
|
|
3105
|
-
destination.l(ensureNotNull(item.
|
|
3165
|
+
destination.l(ensureNotNull(item.dz()));
|
|
3106
3166
|
}
|
|
3107
3167
|
tmp_11 = destination;
|
|
3108
3168
|
} else {
|
|
@@ -3115,9 +3175,9 @@
|
|
|
3115
3175
|
var _iterator__ex2g4s_0 = newGoals.n();
|
|
3116
3176
|
while (_iterator__ex2g4s_0.q()) {
|
|
3117
3177
|
var item_0 = _iterator__ex2g4s_0.r();
|
|
3118
|
-
destination_0.l(Companion_getInstance_9().
|
|
3178
|
+
destination_0.l(Companion_getInstance_9().q2l(this.x3o_1, this.y3o_1, Companion_getInstance_1().of(this.w3o_1.xw(), [item_0])).plus(Companion_getInstance_9().q2l(this.x3o_1, this.z3o_1, toTerm(Companion_getInstance_11().g3n_1))));
|
|
3119
3179
|
}
|
|
3120
|
-
suspendResult = this.
|
|
3180
|
+
suspendResult = this.c3p_1.ue(destination_0, this);
|
|
3121
3181
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3122
3182
|
return suspendResult;
|
|
3123
3183
|
}
|
|
@@ -3128,20 +3188,20 @@
|
|
|
3128
3188
|
switch (tmp0_subject) {
|
|
3129
3189
|
case 'retract':
|
|
3130
3190
|
case 'retractall':
|
|
3131
|
-
var goalArg = this.
|
|
3191
|
+
var goalArg = this.w3o_1.get(0);
|
|
3132
3192
|
this.p8_1 = 8;
|
|
3133
3193
|
var tmp_12 = Companion_getInstance_9();
|
|
3134
3194
|
var tmp_13 = Companion_getInstance_1();
|
|
3135
|
-
var tmp_14 = this.
|
|
3195
|
+
var tmp_14 = this.w3o_1.xw();
|
|
3136
3196
|
var tmp_15;
|
|
3137
3197
|
var tmp_16;
|
|
3138
3198
|
var tmp_17;
|
|
3139
|
-
if (goalArg.
|
|
3199
|
+
if (goalArg.ex()) {
|
|
3140
3200
|
tmp_17 = true;
|
|
3141
3201
|
} else {
|
|
3142
3202
|
var tmp_18;
|
|
3143
3203
|
if (isInterface(goalArg, Struct)) {
|
|
3144
|
-
tmp_18 = goalArg.
|
|
3204
|
+
tmp_18 = goalArg.xw() === ':-';
|
|
3145
3205
|
} else {
|
|
3146
3206
|
tmp_18 = false;
|
|
3147
3207
|
}
|
|
@@ -3151,16 +3211,16 @@
|
|
|
3151
3211
|
if (tmp_17) {
|
|
3152
3212
|
tmp_16 = true;
|
|
3153
3213
|
} else {
|
|
3154
|
-
tmp_16 = this.
|
|
3214
|
+
tmp_16 = this.x3o_1.context.t1x().containsSignature(extractSignature(safeToStruct(goalArg)));
|
|
3155
3215
|
}
|
|
3156
3216
|
|
|
3157
3217
|
if (tmp_16) {
|
|
3158
3218
|
tmp_15 = goalArg;
|
|
3159
3219
|
} else {
|
|
3160
|
-
tmp_15 = withExplanation(goalArg, this.
|
|
3220
|
+
tmp_15 = withExplanation(goalArg, this.z3o_1);
|
|
3161
3221
|
}
|
|
3162
3222
|
|
|
3163
|
-
suspendResult = this.
|
|
3223
|
+
suspendResult = this.c3p_1.se(tmp_12.q2l(this.x3o_1, this.y3o_1, tmp_13.of(tmp_14, [tmp_15])), this);
|
|
3164
3224
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3165
3225
|
return suspendResult;
|
|
3166
3226
|
}
|
|
@@ -3168,23 +3228,23 @@
|
|
|
3168
3228
|
continue $sm;
|
|
3169
3229
|
default:
|
|
3170
3230
|
if (tmp0_subject === 'clause') {
|
|
3171
|
-
var subGoal_0 = this.
|
|
3231
|
+
var subGoal_0 = this.w3o_1.get(0);
|
|
3172
3232
|
var tmp_19;
|
|
3173
3233
|
if (!isInterface(subGoal_0, Struct)) {
|
|
3174
3234
|
tmp_19 = true;
|
|
3175
3235
|
} else {
|
|
3176
|
-
tmp_19 = this.
|
|
3236
|
+
tmp_19 = this.x3o_1.context.t1x().hasProtected(extractSignature(subGoal_0));
|
|
3177
3237
|
}
|
|
3178
3238
|
if (tmp_19) {
|
|
3179
3239
|
this.p8_1 = 6;
|
|
3180
|
-
suspendResult = this.
|
|
3240
|
+
suspendResult = this.c3p_1.se(Companion_getInstance_9().q2l(this.x3o_1, this.y3o_1, this.w3o_1).plus(Companion_getInstance_9().q2l(this.x3o_1, this.z3o_1, toTerm(Companion_getInstance_11().g3n_1))), this);
|
|
3181
3241
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3182
3242
|
return suspendResult;
|
|
3183
3243
|
}
|
|
3184
3244
|
continue $sm;
|
|
3185
3245
|
} else {
|
|
3186
3246
|
this.p8_1 = 5;
|
|
3187
|
-
suspendResult = this.
|
|
3247
|
+
suspendResult = this.c3p_1.se(Companion_getInstance_9().q2l(this.x3o_1, this.y3o_1, Companion_getInstance_1().of(this.w3o_1.xw(), [withExplanation(this.w3o_1.get(0), this.z3o_1), this.w3o_1.get(1)])), this);
|
|
3188
3248
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3189
3249
|
return suspendResult;
|
|
3190
3250
|
}
|
|
@@ -3193,16 +3253,16 @@
|
|
|
3193
3253
|
} else {
|
|
3194
3254
|
var tmp_20 = this;
|
|
3195
3255
|
var tmp_21;
|
|
3196
|
-
var tmp_22 = this.
|
|
3256
|
+
var tmp_22 = this.a3p_1;
|
|
3197
3257
|
if (isInterface(tmp_22, Truth)) {
|
|
3198
3258
|
tmp_21 = true;
|
|
3199
3259
|
} else {
|
|
3200
|
-
tmp_21 = this.
|
|
3260
|
+
tmp_21 = this.x3o_1.context.t1x().containsSignature(this.b3p_1);
|
|
3201
3261
|
}
|
|
3202
|
-
tmp_20.
|
|
3203
|
-
if (this.
|
|
3262
|
+
tmp_20.d3p_1 = tmp_21;
|
|
3263
|
+
if (this.d3p_1 || this.x3o_1.context.v1x().containsIndicator(this.b3p_1.toIndicator()) || this.x3o_1.context.w1x().containsIndicator(this.b3p_1.toIndicator())) {
|
|
3204
3264
|
this.p8_1 = 1;
|
|
3205
|
-
suspendResult = this.
|
|
3265
|
+
suspendResult = this.c3p_1.se(Companion_getInstance_9().q2l(this.x3o_1, this.y3o_1, this.w3o_1).plus(Companion_getInstance_9().q2l(this.x3o_1, this.z3o_1, toTerm(Companion_getInstance_11().g3n_1))), this);
|
|
3206
3266
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3207
3267
|
return suspendResult;
|
|
3208
3268
|
}
|
|
@@ -3232,9 +3292,9 @@
|
|
|
3232
3292
|
this.p8_1 = 2;
|
|
3233
3293
|
continue $sm;
|
|
3234
3294
|
case 2:
|
|
3235
|
-
if (!this.
|
|
3295
|
+
if (!this.d3p_1) {
|
|
3236
3296
|
this.p8_1 = 3;
|
|
3237
|
-
suspendResult = this.
|
|
3297
|
+
suspendResult = this.c3p_1.se(Companion_getInstance_9().q2l(this.x3o_1, this.y3o_1, withExplanation(this.w3o_1, this.z3o_1)), this);
|
|
3238
3298
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3239
3299
|
return suspendResult;
|
|
3240
3300
|
}
|
|
@@ -3302,30 +3362,30 @@
|
|
|
3302
3362
|
}
|
|
3303
3363
|
while (true);
|
|
3304
3364
|
};
|
|
3305
|
-
protoOf(ProbHelper$computeAllSubstitutions$slambda).
|
|
3306
|
-
var i = new ProbHelper$computeAllSubstitutions$slambda(this.
|
|
3307
|
-
i.
|
|
3365
|
+
protoOf(ProbHelper$computeAllSubstitutions$slambda).b32 = function ($this$sequence, completion) {
|
|
3366
|
+
var i = new ProbHelper$computeAllSubstitutions$slambda(this.w3o_1, this.x3o_1, this.y3o_1, this.z3o_1, this.a3p_1, this.b3p_1, completion);
|
|
3367
|
+
i.c3p_1 = $this$sequence;
|
|
3308
3368
|
return i;
|
|
3309
3369
|
};
|
|
3310
3370
|
function ProbHelper$computeAllSubstitutions$slambda_0($goal, $this_computeAllSubstitutions, $third, $first, $second, $goalSignature, resultContinuation) {
|
|
3311
3371
|
var i = new ProbHelper$computeAllSubstitutions$slambda($goal, $this_computeAllSubstitutions, $third, $first, $second, $goalSignature, resultContinuation);
|
|
3312
3372
|
return constructCallableReference(function ($this$sequence, $completion) {
|
|
3313
|
-
return i.
|
|
3373
|
+
return i.a32($this$sequence, $completion);
|
|
3314
3374
|
}, 1);
|
|
3315
3375
|
}
|
|
3316
3376
|
function ProbHelper() {
|
|
3317
3377
|
ProbHelper_instance = this;
|
|
3318
3378
|
WithoutSideEffects.call(this, 'prob_helper');
|
|
3319
3379
|
}
|
|
3320
|
-
protoOf(ProbHelper).
|
|
3321
|
-
Companion_getInstance_9().
|
|
3322
|
-
Companion_getInstance_9().
|
|
3380
|
+
protoOf(ProbHelper).d2v = function (_this__u8e3s4, first, second, third) {
|
|
3381
|
+
Companion_getInstance_9().w2l(_this__u8e3s4, 1);
|
|
3382
|
+
Companion_getInstance_9().c2m(_this__u8e3s4, 1);
|
|
3323
3383
|
var goal = safeToStruct(second);
|
|
3324
3384
|
var goalSignature = extractSignature(goal);
|
|
3325
3385
|
return sequence(ProbHelper$computeAllSubstitutions$slambda_0(goal, _this__u8e3s4, third, first, second, goalSignature, null));
|
|
3326
3386
|
};
|
|
3327
|
-
protoOf(ProbHelper).
|
|
3328
|
-
return this.
|
|
3387
|
+
protoOf(ProbHelper).v2n = function (_this__u8e3s4, first, second, third) {
|
|
3388
|
+
return this.d2v(_this__u8e3s4, first, second, third);
|
|
3329
3389
|
};
|
|
3330
3390
|
var ProbHelper_instance;
|
|
3331
3391
|
function ProbHelper_getInstance() {
|
|
@@ -3337,11 +3397,11 @@
|
|
|
3337
3397
|
ProbNegationAsFailure_instance = this;
|
|
3338
3398
|
NonBacktrackable_0.call(this, 'prob_negation_as_failure');
|
|
3339
3399
|
}
|
|
3340
|
-
protoOf(ProbNegationAsFailure).
|
|
3341
|
-
Companion_getInstance_9().
|
|
3342
|
-
Companion_getInstance_9().
|
|
3400
|
+
protoOf(ProbNegationAsFailure).j2v = function (_this__u8e3s4, first, second) {
|
|
3401
|
+
Companion_getInstance_9().w2l(_this__u8e3s4, 1);
|
|
3402
|
+
Companion_getInstance_9().c2m(_this__u8e3s4, 1);
|
|
3343
3403
|
var tmp;
|
|
3344
|
-
if (!second.
|
|
3404
|
+
if (!second.by()) {
|
|
3345
3405
|
tmp = _this__u8e3s4.replyException(ResolutionException_init_$Create$('Probabilistic negation does not support non-ground goals: ' + second.toString(), VOID, _this__u8e3s4.context, []), VOID, []);
|
|
3346
3406
|
} else {
|
|
3347
3407
|
var explanationTermVar = Companion_getInstance_0().of('Explanation');
|
|
@@ -3365,7 +3425,7 @@
|
|
|
3365
3425
|
if (tmp_4) {
|
|
3366
3426
|
tmp_3 = _this__u8e3s4.replyException(ResolutionException_init_$Create$('No valid explanation has been solved for goal: ' + second.toString(), VOID, _this__u8e3s4.context, []), VOID, []);
|
|
3367
3427
|
} else {
|
|
3368
|
-
tmp_3 = _this__u8e3s4.replyWith(Companion_getInstance_5().ofSubstitution(Companion_getInstance_9().
|
|
3428
|
+
tmp_3 = _this__u8e3s4.replyWith(Companion_getInstance_5().ofSubstitution(Companion_getInstance_9().q2l(_this__u8e3s4, first, new ProbExplanationTerm(explanationTerm.d3m_1.not())), []), VOID, []);
|
|
3369
3429
|
}
|
|
3370
3430
|
tmp_2 = tmp_3;
|
|
3371
3431
|
}
|
|
@@ -3373,8 +3433,8 @@
|
|
|
3373
3433
|
}
|
|
3374
3434
|
return tmp;
|
|
3375
3435
|
};
|
|
3376
|
-
protoOf(ProbNegationAsFailure).
|
|
3377
|
-
return this.
|
|
3436
|
+
protoOf(ProbNegationAsFailure).v2k = function (_this__u8e3s4, first, second) {
|
|
3437
|
+
return this.j2v(_this__u8e3s4, first, second);
|
|
3378
3438
|
};
|
|
3379
3439
|
var ProbNegationAsFailure_instance;
|
|
3380
3440
|
function ProbNegationAsFailure_getInstance() {
|
|
@@ -3388,22 +3448,22 @@
|
|
|
3388
3448
|
};
|
|
3389
3449
|
}
|
|
3390
3450
|
function ProbQuery$computeAllSubstitutions$slambda($solutions, $queryWithEvidenceExplanation, $evidenceExplanation, $this_computeAllSubstitutions, $first, $fourth, resultContinuation) {
|
|
3391
|
-
this.
|
|
3392
|
-
this.
|
|
3393
|
-
this.
|
|
3394
|
-
this.
|
|
3395
|
-
this.
|
|
3396
|
-
this.
|
|
3451
|
+
this.o3p_1 = $solutions;
|
|
3452
|
+
this.p3p_1 = $queryWithEvidenceExplanation;
|
|
3453
|
+
this.q3p_1 = $evidenceExplanation;
|
|
3454
|
+
this.r3p_1 = $this_computeAllSubstitutions;
|
|
3455
|
+
this.s3p_1 = $first;
|
|
3456
|
+
this.t3p_1 = $fourth;
|
|
3397
3457
|
CoroutineImpl.call(this, resultContinuation);
|
|
3398
3458
|
}
|
|
3399
|
-
protoOf(ProbQuery$computeAllSubstitutions$slambda).
|
|
3400
|
-
var tmp = this.
|
|
3459
|
+
protoOf(ProbQuery$computeAllSubstitutions$slambda).a32 = function ($this$sequence, $completion) {
|
|
3460
|
+
var tmp = this.b32($this$sequence, $completion);
|
|
3401
3461
|
tmp.r8_1 = Unit_instance;
|
|
3402
3462
|
tmp.s8_1 = null;
|
|
3403
3463
|
return tmp.x8();
|
|
3404
3464
|
};
|
|
3405
3465
|
protoOf(ProbQuery$computeAllSubstitutions$slambda).o9 = function (p1, $completion) {
|
|
3406
|
-
return this.
|
|
3466
|
+
return this.a32(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
|
|
3407
3467
|
};
|
|
3408
3468
|
protoOf(ProbQuery$computeAllSubstitutions$slambda).x8 = function () {
|
|
3409
3469
|
var suspendResult = this.r8_1;
|
|
@@ -3413,20 +3473,20 @@
|
|
|
3413
3473
|
switch (tmp) {
|
|
3414
3474
|
case 0:
|
|
3415
3475
|
this.q8_1 = 8;
|
|
3416
|
-
this.
|
|
3476
|
+
this.v3p_1 = this.o3p_1.n();
|
|
3417
3477
|
this.p8_1 = 1;
|
|
3418
3478
|
continue $sm;
|
|
3419
3479
|
case 1:
|
|
3420
|
-
if (!this.
|
|
3480
|
+
if (!this.v3p_1.q()) {
|
|
3421
3481
|
this.p8_1 = 7;
|
|
3422
3482
|
continue $sm;
|
|
3423
3483
|
}
|
|
3424
3484
|
|
|
3425
|
-
var solution = this.
|
|
3426
|
-
if (solution.
|
|
3427
|
-
throw ensureNotNull(solution.
|
|
3428
|
-
var queryWithEvidenceExplanationTerm = solution.p1x().j2(this.
|
|
3429
|
-
var evidenceExplanationTerm = solution.p1x().j2(this.
|
|
3485
|
+
var solution = this.v3p_1.r();
|
|
3486
|
+
if (solution.o1z())
|
|
3487
|
+
throw ensureNotNull(solution.m1z());
|
|
3488
|
+
var queryWithEvidenceExplanationTerm = solution.p1x().j2(this.p3p_1);
|
|
3489
|
+
var evidenceExplanationTerm = solution.p1x().j2(this.q3p_1);
|
|
3430
3490
|
var tmp_0;
|
|
3431
3491
|
var tmp_1;
|
|
3432
3492
|
var tmp_2;
|
|
@@ -3450,27 +3510,27 @@
|
|
|
3450
3510
|
|
|
3451
3511
|
if (tmp_0) {
|
|
3452
3512
|
this.p8_1 = 5;
|
|
3453
|
-
suspendResult = this.
|
|
3513
|
+
suspendResult = this.u3p_1.se(Companion_getInstance_5().failed(), this);
|
|
3454
3514
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3455
3515
|
return suspendResult;
|
|
3456
3516
|
}
|
|
3457
3517
|
continue $sm;
|
|
3458
3518
|
} else {
|
|
3459
|
-
var queryWithEvidenceProbability = queryWithEvidenceExplanationTerm.
|
|
3460
|
-
var evidenceProbability = evidenceExplanationTerm.
|
|
3519
|
+
var queryWithEvidenceProbability = queryWithEvidenceExplanationTerm.d3m_1.t3n();
|
|
3520
|
+
var evidenceProbability = evidenceExplanationTerm.d3m_1.t3n();
|
|
3461
3521
|
if (queryWithEvidenceProbability == null || evidenceProbability == null) {
|
|
3462
3522
|
this.p8_1 = 3;
|
|
3463
|
-
suspendResult = this.
|
|
3523
|
+
suspendResult = this.u3p_1.se(Companion_getInstance_5().failed(), this);
|
|
3464
3524
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3465
3525
|
return suspendResult;
|
|
3466
3526
|
}
|
|
3467
3527
|
continue $sm;
|
|
3468
3528
|
} else {
|
|
3469
3529
|
var tmp_3 = solution.p1x();
|
|
3470
|
-
var solutionSubstitution = tmp_3.filter(ProbQuery$computeAllSubstitutions$slambda$lambda(this.
|
|
3530
|
+
var solutionSubstitution = tmp_3.filter(ProbQuery$computeAllSubstitutions$slambda$lambda(this.q3p_1, this.p3p_1));
|
|
3471
3531
|
var probabilityTerm = Companion_getInstance_6().ofDouble(queryWithEvidenceProbability / evidenceProbability);
|
|
3472
3532
|
this.p8_1 = 2;
|
|
3473
|
-
suspendResult = this.
|
|
3533
|
+
suspendResult = this.u3p_1.se(Companion_getInstance_5().ofSubstitution(solutionSubstitution, [Companion_getInstance_9().q2l(this.r3p_1, this.s3p_1, probabilityTerm), Companion_getInstance_9().q2l(this.r3p_1, this.t3p_1, queryWithEvidenceExplanationTerm)]), this);
|
|
3474
3534
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3475
3535
|
return suspendResult;
|
|
3476
3536
|
}
|
|
@@ -3509,26 +3569,26 @@
|
|
|
3509
3569
|
}
|
|
3510
3570
|
while (true);
|
|
3511
3571
|
};
|
|
3512
|
-
protoOf(ProbQuery$computeAllSubstitutions$slambda).
|
|
3513
|
-
var i = new ProbQuery$computeAllSubstitutions$slambda(this.
|
|
3514
|
-
i.
|
|
3572
|
+
protoOf(ProbQuery$computeAllSubstitutions$slambda).b32 = function ($this$sequence, completion) {
|
|
3573
|
+
var i = new ProbQuery$computeAllSubstitutions$slambda(this.o3p_1, this.p3p_1, this.q3p_1, this.r3p_1, this.s3p_1, this.t3p_1, completion);
|
|
3574
|
+
i.u3p_1 = $this$sequence;
|
|
3515
3575
|
return i;
|
|
3516
3576
|
};
|
|
3517
3577
|
function ProbQuery$computeAllSubstitutions$slambda_0($solutions, $queryWithEvidenceExplanation, $evidenceExplanation, $this_computeAllSubstitutions, $first, $fourth, resultContinuation) {
|
|
3518
3578
|
var i = new ProbQuery$computeAllSubstitutions$slambda($solutions, $queryWithEvidenceExplanation, $evidenceExplanation, $this_computeAllSubstitutions, $first, $fourth, resultContinuation);
|
|
3519
3579
|
return constructCallableReference(function ($this$sequence, $completion) {
|
|
3520
|
-
return i.
|
|
3580
|
+
return i.a32($this$sequence, $completion);
|
|
3521
3581
|
}, 1);
|
|
3522
3582
|
}
|
|
3523
3583
|
function ProbQuery() {
|
|
3524
3584
|
ProbQuery_instance = this;
|
|
3525
3585
|
WithoutSideEffects_0.call(this, 'prob_query');
|
|
3526
3586
|
}
|
|
3527
|
-
protoOf(ProbQuery).
|
|
3528
|
-
Companion_getInstance_9().
|
|
3529
|
-
Companion_getInstance_9().
|
|
3530
|
-
Companion_getInstance_9().
|
|
3531
|
-
Companion_getInstance_9().
|
|
3587
|
+
protoOf(ProbQuery).x3p = function (_this__u8e3s4, first, second, third, fourth) {
|
|
3588
|
+
Companion_getInstance_9().w2l(_this__u8e3s4, 1);
|
|
3589
|
+
Companion_getInstance_9().c2m(_this__u8e3s4, 1);
|
|
3590
|
+
Companion_getInstance_9().a2m(_this__u8e3s4, 1);
|
|
3591
|
+
Companion_getInstance_9().w2l(_this__u8e3s4, 2);
|
|
3532
3592
|
var queryWithEvidenceExplanation = Companion_getInstance_0().of('QueryWithEvidenceExplanation');
|
|
3533
3593
|
var evidenceExplanation = Companion_getInstance_0().of('EvidenceExplanation');
|
|
3534
3594
|
var tmp = _this__u8e3s4.subSolver();
|
|
@@ -3540,11 +3600,11 @@
|
|
|
3540
3600
|
var tmp_3 = Companion_getInstance_1();
|
|
3541
3601
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3542
3602
|
var tmp$ret$1 = ProbSolveWithEvidence_getInstance().signature.name;
|
|
3543
|
-
var solutions = tmp.solveWithOptions(tmp_0.of(tmp_2, tmp_3.of(tmp$ret$1, [queryWithEvidenceExplanation, evidenceExplanation, second])), ProbSetConfig_getInstance().
|
|
3603
|
+
var solutions = tmp.solveWithOptions(tmp_0.of(tmp_2, tmp_3.of(tmp$ret$1, [queryWithEvidenceExplanation, evidenceExplanation, second])), ProbSetConfig_getInstance().y3p(third));
|
|
3544
3604
|
return sequence(ProbQuery$computeAllSubstitutions$slambda_0(solutions, queryWithEvidenceExplanation, evidenceExplanation, _this__u8e3s4, first, fourth, null));
|
|
3545
3605
|
};
|
|
3546
|
-
protoOf(ProbQuery).
|
|
3547
|
-
return this.
|
|
3606
|
+
protoOf(ProbQuery).u2m = function (_this__u8e3s4, first, second, third, fourth) {
|
|
3607
|
+
return this.x3p(_this__u8e3s4, first, second, third, fourth);
|
|
3548
3608
|
};
|
|
3549
3609
|
var ProbQuery_instance;
|
|
3550
3610
|
function ProbQuery_getInstance() {
|
|
@@ -3557,40 +3617,40 @@
|
|
|
3557
3617
|
NonBacktrackable_1.call(this, 'prob_set_config');
|
|
3558
3618
|
var tmp = this;
|
|
3559
3619
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3560
|
-
tmp.
|
|
3620
|
+
tmp.y3l_1 = this.signature.name + '_flag';
|
|
3561
3621
|
var tmp_0 = this;
|
|
3562
3622
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3563
|
-
tmp_0.
|
|
3623
|
+
tmp_0.z3l_1 = this.signature.name + '_term';
|
|
3564
3624
|
var tmp_1 = this;
|
|
3565
3625
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3566
|
-
tmp_1.
|
|
3626
|
+
tmp_1.a3m_1 = 'it.unibo.tuprolog.solve.probability' + this.signature.name + '_tag';
|
|
3567
3627
|
}
|
|
3568
|
-
protoOf(ProbSetConfig).
|
|
3569
|
-
Companion_getInstance_9().
|
|
3570
|
-
Companion_getInstance_9().
|
|
3628
|
+
protoOf(ProbSetConfig).v2u = function (_this__u8e3s4, first) {
|
|
3629
|
+
Companion_getInstance_9().w2l(_this__u8e3s4, 0);
|
|
3630
|
+
Companion_getInstance_9().f2m(_this__u8e3s4, 0);
|
|
3571
3631
|
// Inline function 'kotlin.arrayOf' call
|
|
3572
3632
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
3573
3633
|
// Inline function 'kotlin.js.asDynamic' call
|
|
3574
|
-
var tmp$ret$0 = [SetFlags_init_$Create$([new Pair(this.
|
|
3634
|
+
var tmp$ret$0 = [SetFlags_init_$Create$([new Pair(this.y3l_1, first)])];
|
|
3575
3635
|
return _this__u8e3s4.replySuccess(VOID, VOID, tmp$ret$0.slice());
|
|
3576
3636
|
};
|
|
3577
|
-
protoOf(ProbSetConfig).
|
|
3578
|
-
return this.
|
|
3637
|
+
protoOf(ProbSetConfig).i2o = function (_this__u8e3s4, first) {
|
|
3638
|
+
return this.v2u(_this__u8e3s4, first);
|
|
3579
3639
|
};
|
|
3580
|
-
protoOf(ProbSetConfig).
|
|
3581
|
-
var tmp0_elvis_lhs = _this__u8e3s4.getTag(this.
|
|
3640
|
+
protoOf(ProbSetConfig).y3p = function (_this__u8e3s4) {
|
|
3641
|
+
var tmp0_elvis_lhs = _this__u8e3s4.getTag(this.a3m_1);
|
|
3582
3642
|
return tmp0_elvis_lhs == null ? Companion_getInstance_2().DEFAULT : tmp0_elvis_lhs;
|
|
3583
3643
|
};
|
|
3584
|
-
protoOf(ProbSetConfig).
|
|
3585
|
-
return setTag(Companion_getInstance_4().of(this.
|
|
3644
|
+
protoOf(ProbSetConfig).b3m = function (_this__u8e3s4) {
|
|
3645
|
+
return setTag(Companion_getInstance_4().of(this.z3l_1), this.a3m_1, _this__u8e3s4);
|
|
3586
3646
|
};
|
|
3587
|
-
protoOf(ProbSetConfig).
|
|
3588
|
-
var tmp0_safe_receiver = _this__u8e3s4.u1x().zb(this.
|
|
3589
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
3647
|
+
protoOf(ProbSetConfig).z3p = function (_this__u8e3s4) {
|
|
3648
|
+
var tmp0_safe_receiver = _this__u8e3s4.u1x().zb(this.y3l_1);
|
|
3649
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.y3p(tmp0_safe_receiver);
|
|
3590
3650
|
return tmp1_elvis_lhs == null ? Companion_getInstance_2().DEFAULT : tmp1_elvis_lhs;
|
|
3591
3651
|
};
|
|
3592
|
-
protoOf(ProbSetConfig).
|
|
3593
|
-
return !get_isProbabilistic(this.
|
|
3652
|
+
protoOf(ProbSetConfig).n3o = function (_this__u8e3s4) {
|
|
3653
|
+
return !get_isProbabilistic(this.z3p(_this__u8e3s4));
|
|
3594
3654
|
};
|
|
3595
3655
|
var ProbSetConfig_instance;
|
|
3596
3656
|
function ProbSetConfig_getInstance() {
|
|
@@ -3599,8 +3659,8 @@
|
|
|
3599
3659
|
return ProbSetConfig_instance;
|
|
3600
3660
|
}
|
|
3601
3661
|
function ProbSolve$computeAllSubstitutions$lambda(it) {
|
|
3602
|
-
if (it.
|
|
3603
|
-
throw ensureNotNull(it.
|
|
3662
|
+
if (it.o1z())
|
|
3663
|
+
throw ensureNotNull(it.m1z());
|
|
3604
3664
|
return it.p1x();
|
|
3605
3665
|
}
|
|
3606
3666
|
function ProbSolve$computeAllSubstitutions$lambda_0(it) {
|
|
@@ -3612,20 +3672,20 @@
|
|
|
3612
3672
|
};
|
|
3613
3673
|
}
|
|
3614
3674
|
function ProbSolve$computeAllSubstitutions$slambda($solutionGroups, $explanationVar, $this_computeAllSubstitutions, $first, resultContinuation) {
|
|
3615
|
-
this.
|
|
3616
|
-
this.
|
|
3617
|
-
this.
|
|
3618
|
-
this.
|
|
3675
|
+
this.i3q_1 = $solutionGroups;
|
|
3676
|
+
this.j3q_1 = $explanationVar;
|
|
3677
|
+
this.k3q_1 = $this_computeAllSubstitutions;
|
|
3678
|
+
this.l3q_1 = $first;
|
|
3619
3679
|
CoroutineImpl.call(this, resultContinuation);
|
|
3620
3680
|
}
|
|
3621
|
-
protoOf(ProbSolve$computeAllSubstitutions$slambda).
|
|
3622
|
-
var tmp = this.
|
|
3681
|
+
protoOf(ProbSolve$computeAllSubstitutions$slambda).a32 = function ($this$sequence, $completion) {
|
|
3682
|
+
var tmp = this.b32($this$sequence, $completion);
|
|
3623
3683
|
tmp.r8_1 = Unit_instance;
|
|
3624
3684
|
tmp.s8_1 = null;
|
|
3625
3685
|
return tmp.x8();
|
|
3626
3686
|
};
|
|
3627
3687
|
protoOf(ProbSolve$computeAllSubstitutions$slambda).o9 = function (p1, $completion) {
|
|
3628
|
-
return this.
|
|
3688
|
+
return this.a32(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
|
|
3629
3689
|
};
|
|
3630
3690
|
protoOf(ProbSolve$computeAllSubstitutions$slambda).x8 = function () {
|
|
3631
3691
|
var suspendResult = this.r8_1;
|
|
@@ -3636,22 +3696,22 @@
|
|
|
3636
3696
|
case 0:
|
|
3637
3697
|
this.q8_1 = 4;
|
|
3638
3698
|
var tmp_0 = this;
|
|
3639
|
-
tmp_0.
|
|
3699
|
+
tmp_0.n3q_1 = this.i3q_1.d1().n();
|
|
3640
3700
|
this.p8_1 = 1;
|
|
3641
3701
|
continue $sm;
|
|
3642
3702
|
case 1:
|
|
3643
|
-
if (!this.
|
|
3703
|
+
if (!this.n3q_1.q()) {
|
|
3644
3704
|
this.p8_1 = 3;
|
|
3645
3705
|
continue $sm;
|
|
3646
3706
|
}
|
|
3647
3707
|
|
|
3648
|
-
var solutionGroup = this.
|
|
3708
|
+
var solutionGroup = this.n3q_1.r();
|
|
3649
3709
|
var this_0 = solutionGroup.f1();
|
|
3650
3710
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
3651
3711
|
var _iterator__ex2g4s = this_0.n();
|
|
3652
3712
|
while (_iterator__ex2g4s.q()) {
|
|
3653
3713
|
var item = _iterator__ex2g4s.r();
|
|
3654
|
-
destination.l(item.p1x().j2(this.
|
|
3714
|
+
destination.l(item.p1x().j2(this.j3q_1));
|
|
3655
3715
|
}
|
|
3656
3716
|
|
|
3657
3717
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
@@ -3667,7 +3727,7 @@
|
|
|
3667
3727
|
var _iterator__ex2g4s_1 = destination_0.n();
|
|
3668
3728
|
while (_iterator__ex2g4s_1.q()) {
|
|
3669
3729
|
var item_0 = _iterator__ex2g4s_1.r();
|
|
3670
|
-
destination_1.l(item_0.
|
|
3730
|
+
destination_1.l(item_0.d3m_1);
|
|
3671
3731
|
}
|
|
3672
3732
|
|
|
3673
3733
|
var iterator = destination_1.n();
|
|
@@ -3677,13 +3737,13 @@
|
|
|
3677
3737
|
while (iterator.q()) {
|
|
3678
3738
|
var tmp0 = accumulator;
|
|
3679
3739
|
var expl = iterator.r();
|
|
3680
|
-
accumulator = expl.
|
|
3740
|
+
accumulator = expl.s3n() === 1.0 ? tmp0 : tmp0.s3n() === 1.0 ? expl : tmp0.or(expl);
|
|
3681
3741
|
}
|
|
3682
3742
|
|
|
3683
3743
|
var explanation = accumulator;
|
|
3684
|
-
var substitution = Companion_getInstance_5().ofSubstitution(solutionGroup.e1(), [Companion_getInstance_9().
|
|
3744
|
+
var substitution = Companion_getInstance_5().ofSubstitution(solutionGroup.e1(), [Companion_getInstance_9().q2l(this.k3q_1, this.l3q_1, new ProbExplanationTerm(explanation))]);
|
|
3685
3745
|
this.p8_1 = 2;
|
|
3686
|
-
suspendResult = this.
|
|
3746
|
+
suspendResult = this.m3q_1.se(substitution, this);
|
|
3687
3747
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3688
3748
|
return suspendResult;
|
|
3689
3749
|
}
|
|
@@ -3708,30 +3768,30 @@
|
|
|
3708
3768
|
}
|
|
3709
3769
|
while (true);
|
|
3710
3770
|
};
|
|
3711
|
-
protoOf(ProbSolve$computeAllSubstitutions$slambda).
|
|
3712
|
-
var i = new ProbSolve$computeAllSubstitutions$slambda(this.
|
|
3713
|
-
i.
|
|
3771
|
+
protoOf(ProbSolve$computeAllSubstitutions$slambda).b32 = function ($this$sequence, completion) {
|
|
3772
|
+
var i = new ProbSolve$computeAllSubstitutions$slambda(this.i3q_1, this.j3q_1, this.k3q_1, this.l3q_1, completion);
|
|
3773
|
+
i.m3q_1 = $this$sequence;
|
|
3714
3774
|
return i;
|
|
3715
3775
|
};
|
|
3716
3776
|
function ProbSolve$computeAllSubstitutions$slambda_0($solutionGroups, $explanationVar, $this_computeAllSubstitutions, $first, resultContinuation) {
|
|
3717
3777
|
var i = new ProbSolve$computeAllSubstitutions$slambda($solutionGroups, $explanationVar, $this_computeAllSubstitutions, $first, resultContinuation);
|
|
3718
3778
|
return constructCallableReference(function ($this$sequence, $completion) {
|
|
3719
|
-
return i.
|
|
3779
|
+
return i.a32($this$sequence, $completion);
|
|
3720
3780
|
}, 1);
|
|
3721
3781
|
}
|
|
3722
3782
|
function ProbSolve() {
|
|
3723
3783
|
ProbSolve_instance = this;
|
|
3724
3784
|
WithoutSideEffects_1.call(this, 'prob_solve');
|
|
3725
3785
|
}
|
|
3726
|
-
protoOf(ProbSolve).
|
|
3727
|
-
Companion_getInstance_9().
|
|
3728
|
-
Companion_getInstance_9().
|
|
3729
|
-
if (ProbSetConfig_getInstance().
|
|
3786
|
+
protoOf(ProbSolve).i2x = function (_this__u8e3s4, first, second) {
|
|
3787
|
+
Companion_getInstance_9().w2l(_this__u8e3s4, 1);
|
|
3788
|
+
Companion_getInstance_9().c2m(_this__u8e3s4, 1);
|
|
3789
|
+
if (ProbSetConfig_getInstance().n3o(_this__u8e3s4.context)) {
|
|
3730
3790
|
var tmp = _this__u8e3s4.subSolver();
|
|
3731
3791
|
var tmp_0 = Companion_getInstance_1();
|
|
3732
3792
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3733
3793
|
var tmp$ret$0 = Prob_getInstance().signature.name;
|
|
3734
|
-
var tmp_1 = tmp.solveWithOptions(tmp_0.of(tmp$ret$0, [first, second]), ProbSetConfig_getInstance().
|
|
3794
|
+
var tmp_1 = tmp.solveWithOptions(tmp_0.of(tmp$ret$0, [first, second]), ProbSetConfig_getInstance().z3p(_this__u8e3s4.context));
|
|
3735
3795
|
return map(tmp_1, ProbSolve$computeAllSubstitutions$lambda);
|
|
3736
3796
|
}
|
|
3737
3797
|
var explanationVar = Companion_getInstance_0().of('EXPL');
|
|
@@ -3739,14 +3799,14 @@
|
|
|
3739
3799
|
var tmp_3 = Companion_getInstance_1();
|
|
3740
3800
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3741
3801
|
var tmp$ret$1 = Prob_getInstance().signature.name;
|
|
3742
|
-
var solutions =
|
|
3802
|
+
var solutions = toList_0(tmp_2.solveWithOptions(tmp_3.of(tmp$ret$1, [explanationVar, second]), ProbSetConfig_getInstance().z3p(_this__u8e3s4.context)));
|
|
3743
3803
|
// Inline function 'kotlin.sequences.filterIsInstance' call
|
|
3744
3804
|
var this_0 = asSequence(solutions);
|
|
3745
3805
|
var tmp_4 = filter(this_0, ProbSolve$computeAllSubstitutions$lambda_0);
|
|
3746
3806
|
var tmp$ret$2 = isInterface(tmp_4, Sequence) ? tmp_4 : THROW_CCE();
|
|
3747
3807
|
var error = firstOrNull(tmp$ret$2);
|
|
3748
3808
|
if (!(error == null))
|
|
3749
|
-
throw error.
|
|
3809
|
+
throw error.m1z();
|
|
3750
3810
|
var tmp_5;
|
|
3751
3811
|
var tmp$ret$3;
|
|
3752
3812
|
$l$block_0: {
|
|
@@ -3772,7 +3832,7 @@
|
|
|
3772
3832
|
tmp$ret$3 = false;
|
|
3773
3833
|
}
|
|
3774
3834
|
if (!tmp$ret$3) {
|
|
3775
|
-
tmp_5 = sequenceOf(Companion_getInstance_5().ofSubstitution(Companion_getInstance_9().
|
|
3835
|
+
tmp_5 = sequenceOf(Companion_getInstance_5().ofSubstitution(Companion_getInstance_9().q2l(_this__u8e3s4, first, new ProbExplanationTerm(Companion_getInstance_11().f3n_1)), []));
|
|
3776
3836
|
} else {
|
|
3777
3837
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
3778
3838
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
@@ -3791,7 +3851,7 @@
|
|
|
3791
3851
|
while (_iterator__ex2g4s_1.q()) {
|
|
3792
3852
|
var element_1 = _iterator__ex2g4s_1.r();
|
|
3793
3853
|
var tmp_7 = element_1.p1x();
|
|
3794
|
-
var key = tmp_7.
|
|
3854
|
+
var key = tmp_7.w12(ProbSolve$computeAllSubstitutions$lambda_1(explanationVar));
|
|
3795
3855
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
3796
3856
|
var value = destination_0.j2(key);
|
|
3797
3857
|
var tmp_8;
|
|
@@ -3810,8 +3870,8 @@
|
|
|
3810
3870
|
}
|
|
3811
3871
|
return tmp_5;
|
|
3812
3872
|
};
|
|
3813
|
-
protoOf(ProbSolve).
|
|
3814
|
-
return this.
|
|
3873
|
+
protoOf(ProbSolve).c2l = function (_this__u8e3s4, first, second) {
|
|
3874
|
+
return this.i2x(_this__u8e3s4, first, second);
|
|
3815
3875
|
};
|
|
3816
3876
|
var ProbSolve_instance;
|
|
3817
3877
|
function ProbSolve_getInstance() {
|
|
@@ -3831,27 +3891,27 @@
|
|
|
3831
3891
|
return it instanceof ProbExplanationTerm;
|
|
3832
3892
|
}
|
|
3833
3893
|
function ProbSolveEvidence$computeOne$lambda_2(t) {
|
|
3834
|
-
return t.
|
|
3894
|
+
return t.d3m_1;
|
|
3835
3895
|
}
|
|
3836
3896
|
function ProbSolveEvidence() {
|
|
3837
3897
|
ProbSolveEvidence_instance = this;
|
|
3838
3898
|
NonBacktrackable_1.call(this, 'prob_solve_evidence');
|
|
3839
3899
|
}
|
|
3840
|
-
protoOf(ProbSolveEvidence).
|
|
3900
|
+
protoOf(ProbSolveEvidence).v2u = function (_this__u8e3s4, first) {
|
|
3841
3901
|
var evidenceIndicator = Companion_instance_4.ofString('evidence', 2);
|
|
3842
3902
|
if (!_this__u8e3s4.context.v1x().containsIndicator(evidenceIndicator) && !_this__u8e3s4.context.w1x().containsIndicator(evidenceIndicator)) {
|
|
3843
|
-
return _this__u8e3s4.replyWith(Companion_getInstance_9().
|
|
3903
|
+
return _this__u8e3s4.replyWith(Companion_getInstance_9().q2l(_this__u8e3s4, first, new ProbExplanationTerm(Companion_getInstance_11().g3n_1)), VOID, []);
|
|
3844
3904
|
}
|
|
3845
3905
|
var evidenceTermVar = Companion_getInstance_0().of('TermVar');
|
|
3846
3906
|
var evidenceTruthVar = Companion_getInstance_0().of('TruthVar');
|
|
3847
3907
|
var subQuery = Companion_getInstance_1().of('evidence', [evidenceTermVar, evidenceTruthVar]);
|
|
3848
|
-
var subOptions = ProbSetConfig_getInstance().
|
|
3908
|
+
var subOptions = ProbSetConfig_getInstance().z3p(_this__u8e3s4.context).setLimit(-1).setLazy(false);
|
|
3849
3909
|
// Inline function 'kotlin.sequences.filterIsInstance' call
|
|
3850
3910
|
var this_0 = _this__u8e3s4.subSolver().solveWithOptions(subQuery, subOptions);
|
|
3851
3911
|
var tmp = filter(this_0, ProbSolveEvidence$computeOne$lambda);
|
|
3852
3912
|
var tmp$ret$0 = isInterface(tmp, Sequence) ? tmp : THROW_CCE();
|
|
3853
3913
|
// Inline function 'kotlin.collections.map' call
|
|
3854
|
-
var this_1 =
|
|
3914
|
+
var this_1 = toList_0(tmp$ret$0);
|
|
3855
3915
|
// Inline function 'kotlin.collections.mapTo' call
|
|
3856
3916
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
3857
3917
|
var _iterator__ex2g4s = this_1.n();
|
|
@@ -3861,13 +3921,13 @@
|
|
|
3861
3921
|
var term = item.p1x().j2(evidenceTermVar);
|
|
3862
3922
|
var tmp_0;
|
|
3863
3923
|
var tmp_1;
|
|
3864
|
-
if (term == null || term.
|
|
3924
|
+
if (term == null || term.tx() || truth == null) {
|
|
3865
3925
|
tmp_1 = true;
|
|
3866
3926
|
} else {
|
|
3867
3927
|
tmp_1 = !isInterface(truth, Truth);
|
|
3868
3928
|
}
|
|
3869
3929
|
if (tmp_1) {
|
|
3870
|
-
tmp_0 = Companion_getInstance_11().
|
|
3930
|
+
tmp_0 = Companion_getInstance_11().f3n_1;
|
|
3871
3931
|
} else {
|
|
3872
3932
|
var explanationVar = Companion_getInstance_0().of('EXPL');
|
|
3873
3933
|
var tmp_2 = Companion_getInstance_1();
|
|
@@ -3886,10 +3946,10 @@
|
|
|
3886
3946
|
while (iterator.q()) {
|
|
3887
3947
|
var tmp0 = accumulator;
|
|
3888
3948
|
var t = iterator.r();
|
|
3889
|
-
accumulator = t.
|
|
3949
|
+
accumulator = t.s3n() === 1.0 ? tmp0 : tmp0.s3n() === 1.0 ? t : t.or(tmp0);
|
|
3890
3950
|
}
|
|
3891
3951
|
var totalExplanation = accumulator;
|
|
3892
|
-
tmp_0 = truth.
|
|
3952
|
+
tmp_0 = truth.vw() ? totalExplanation : totalExplanation.not();
|
|
3893
3953
|
}
|
|
3894
3954
|
var tmp$ret$3 = tmp_0;
|
|
3895
3955
|
destination.l(tmp$ret$3);
|
|
@@ -3900,14 +3960,14 @@
|
|
|
3900
3960
|
var _iterator__ex2g4s_0 = destination.n();
|
|
3901
3961
|
while (_iterator__ex2g4s_0.q()) {
|
|
3902
3962
|
var element = _iterator__ex2g4s_0.r();
|
|
3903
|
-
if (!equals(element, Companion_getInstance_11().
|
|
3963
|
+
if (!equals(element, Companion_getInstance_11().f3n_1)) {
|
|
3904
3964
|
destination_0.l(element);
|
|
3905
3965
|
}
|
|
3906
3966
|
}
|
|
3907
3967
|
var result = destination_0;
|
|
3908
3968
|
var tmp_6;
|
|
3909
3969
|
if (result.i()) {
|
|
3910
|
-
tmp_6 = Companion_getInstance_11().
|
|
3970
|
+
tmp_6 = Companion_getInstance_11().g3n_1;
|
|
3911
3971
|
} else {
|
|
3912
3972
|
// Inline function 'kotlin.collections.reduce' call
|
|
3913
3973
|
var iterator_0 = result.n();
|
|
@@ -3921,10 +3981,10 @@
|
|
|
3921
3981
|
tmp_6 = accumulator_0;
|
|
3922
3982
|
}
|
|
3923
3983
|
var resultExplanation = tmp_6;
|
|
3924
|
-
return _this__u8e3s4.replyWith(Companion_getInstance_9().
|
|
3984
|
+
return _this__u8e3s4.replyWith(Companion_getInstance_9().q2l(_this__u8e3s4, first, new ProbExplanationTerm(resultExplanation)), VOID, []);
|
|
3925
3985
|
};
|
|
3926
|
-
protoOf(ProbSolveEvidence).
|
|
3927
|
-
return this.
|
|
3986
|
+
protoOf(ProbSolveEvidence).i2o = function (_this__u8e3s4, first) {
|
|
3987
|
+
return this.v2u(_this__u8e3s4, first);
|
|
3928
3988
|
};
|
|
3929
3989
|
var ProbSolveEvidence_instance;
|
|
3930
3990
|
function ProbSolveEvidence_getInstance() {
|
|
@@ -3938,22 +3998,22 @@
|
|
|
3938
3998
|
};
|
|
3939
3999
|
}
|
|
3940
4000
|
function ProbSolveWithEvidence$computeAllSubstitutions$slambda($solutions, $goalExplanationVar, $evidenceExplanationTerm, $this_computeAllSubstitutions, $first, $second, resultContinuation) {
|
|
3941
|
-
this.
|
|
3942
|
-
this.
|
|
3943
|
-
this.
|
|
3944
|
-
this.
|
|
3945
|
-
this.
|
|
3946
|
-
this.
|
|
4001
|
+
this.y3q_1 = $solutions;
|
|
4002
|
+
this.z3q_1 = $goalExplanationVar;
|
|
4003
|
+
this.a3r_1 = $evidenceExplanationTerm;
|
|
4004
|
+
this.b3r_1 = $this_computeAllSubstitutions;
|
|
4005
|
+
this.c3r_1 = $first;
|
|
4006
|
+
this.d3r_1 = $second;
|
|
3947
4007
|
CoroutineImpl.call(this, resultContinuation);
|
|
3948
4008
|
}
|
|
3949
|
-
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).
|
|
3950
|
-
var tmp = this.
|
|
4009
|
+
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).a32 = function ($this$sequence, $completion) {
|
|
4010
|
+
var tmp = this.b32($this$sequence, $completion);
|
|
3951
4011
|
tmp.r8_1 = Unit_instance;
|
|
3952
4012
|
tmp.s8_1 = null;
|
|
3953
4013
|
return tmp.x8();
|
|
3954
4014
|
};
|
|
3955
4015
|
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).o9 = function (p1, $completion) {
|
|
3956
|
-
return this.
|
|
4016
|
+
return this.a32(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
|
|
3957
4017
|
};
|
|
3958
4018
|
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).x8 = function () {
|
|
3959
4019
|
var suspendResult = this.r8_1;
|
|
@@ -3963,26 +4023,26 @@
|
|
|
3963
4023
|
switch (tmp) {
|
|
3964
4024
|
case 0:
|
|
3965
4025
|
this.q8_1 = 6;
|
|
3966
|
-
this.
|
|
4026
|
+
this.f3r_1 = this.y3q_1.n();
|
|
3967
4027
|
this.p8_1 = 1;
|
|
3968
4028
|
continue $sm;
|
|
3969
4029
|
case 1:
|
|
3970
|
-
if (!this.
|
|
4030
|
+
if (!this.f3r_1.q()) {
|
|
3971
4031
|
this.p8_1 = 5;
|
|
3972
4032
|
continue $sm;
|
|
3973
4033
|
}
|
|
3974
4034
|
|
|
3975
|
-
var solution = this.
|
|
3976
|
-
if (solution.
|
|
3977
|
-
throw ensureNotNull(solution.
|
|
3978
|
-
var goalExplanationTerm = solution.p1x().j2(this.
|
|
4035
|
+
var solution = this.f3r_1.r();
|
|
4036
|
+
if (solution.o1z())
|
|
4037
|
+
throw ensureNotNull(solution.m1z());
|
|
4038
|
+
var goalExplanationTerm = solution.p1x().j2(this.z3q_1);
|
|
3979
4039
|
var tmp_0;
|
|
3980
4040
|
var tmp_1;
|
|
3981
4041
|
var tmp_2;
|
|
3982
|
-
if (this.
|
|
4042
|
+
if (this.a3r_1 == null) {
|
|
3983
4043
|
tmp_2 = true;
|
|
3984
4044
|
} else {
|
|
3985
|
-
var tmp_3 = this.
|
|
4045
|
+
var tmp_3 = this.a3r_1;
|
|
3986
4046
|
tmp_2 = !(tmp_3 instanceof ProbExplanationTerm);
|
|
3987
4047
|
}
|
|
3988
4048
|
|
|
@@ -4000,19 +4060,19 @@
|
|
|
4000
4060
|
|
|
4001
4061
|
if (tmp_0) {
|
|
4002
4062
|
this.p8_1 = 3;
|
|
4003
|
-
suspendResult = this.
|
|
4063
|
+
suspendResult = this.e3r_1.se(Companion_getInstance_5().failed(), this);
|
|
4004
4064
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
4005
4065
|
return suspendResult;
|
|
4006
4066
|
}
|
|
4007
4067
|
continue $sm;
|
|
4008
4068
|
} else {
|
|
4009
|
-
var explanationWithEvidenceTerm = new ProbExplanationTerm(goalExplanationTerm.
|
|
4069
|
+
var explanationWithEvidenceTerm = new ProbExplanationTerm(goalExplanationTerm.d3m_1.and(this.a3r_1.d3m_1));
|
|
4010
4070
|
this.p8_1 = 2;
|
|
4011
4071
|
var tmp_4 = Companion_getInstance_5();
|
|
4012
|
-
var tmp_5 = Companion_getInstance_9().
|
|
4013
|
-
var tmp_6 = Companion_getInstance_9().
|
|
4072
|
+
var tmp_5 = Companion_getInstance_9().q2l(this.b3r_1, this.c3r_1, explanationWithEvidenceTerm);
|
|
4073
|
+
var tmp_6 = Companion_getInstance_9().q2l(this.b3r_1, this.d3r_1, this.a3r_1);
|
|
4014
4074
|
var tmp_7 = solution.p1x();
|
|
4015
|
-
suspendResult = this.
|
|
4075
|
+
suspendResult = this.e3r_1.se(tmp_4.ofSubstitution(tmp_5, [tmp_6, tmp_7.filter(ProbSolveWithEvidence$computeAllSubstitutions$slambda$lambda(this.z3q_1))]), this);
|
|
4016
4076
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
4017
4077
|
return suspendResult;
|
|
4018
4078
|
}
|
|
@@ -4044,34 +4104,34 @@
|
|
|
4044
4104
|
}
|
|
4045
4105
|
while (true);
|
|
4046
4106
|
};
|
|
4047
|
-
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).
|
|
4048
|
-
var i = new ProbSolveWithEvidence$computeAllSubstitutions$slambda(this.
|
|
4049
|
-
i.
|
|
4107
|
+
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).b32 = function ($this$sequence, completion) {
|
|
4108
|
+
var i = new ProbSolveWithEvidence$computeAllSubstitutions$slambda(this.y3q_1, this.z3q_1, this.a3r_1, this.b3r_1, this.c3r_1, this.d3r_1, completion);
|
|
4109
|
+
i.e3r_1 = $this$sequence;
|
|
4050
4110
|
return i;
|
|
4051
4111
|
};
|
|
4052
4112
|
function ProbSolveWithEvidence$computeAllSubstitutions$slambda_0($solutions, $goalExplanationVar, $evidenceExplanationTerm, $this_computeAllSubstitutions, $first, $second, resultContinuation) {
|
|
4053
4113
|
var i = new ProbSolveWithEvidence$computeAllSubstitutions$slambda($solutions, $goalExplanationVar, $evidenceExplanationTerm, $this_computeAllSubstitutions, $first, $second, resultContinuation);
|
|
4054
4114
|
return constructCallableReference(function ($this$sequence, $completion) {
|
|
4055
|
-
return i.
|
|
4115
|
+
return i.a32($this$sequence, $completion);
|
|
4056
4116
|
}, 1);
|
|
4057
4117
|
}
|
|
4058
4118
|
function ProbSolveWithEvidence() {
|
|
4059
4119
|
ProbSolveWithEvidence_instance = this;
|
|
4060
4120
|
WithoutSideEffects.call(this, 'prob_solve_with_evidence');
|
|
4061
4121
|
}
|
|
4062
|
-
protoOf(ProbSolveWithEvidence).
|
|
4063
|
-
Companion_getInstance_9().
|
|
4064
|
-
Companion_getInstance_9().
|
|
4122
|
+
protoOf(ProbSolveWithEvidence).d2v = function (_this__u8e3s4, first, second, third) {
|
|
4123
|
+
Companion_getInstance_9().w2l(_this__u8e3s4, 2);
|
|
4124
|
+
Companion_getInstance_9().c2m(_this__u8e3s4, 2);
|
|
4065
4125
|
var evidenceExplanationVar = Companion_getInstance_0().of('EvidenceExplanation');
|
|
4066
4126
|
var tmp;
|
|
4067
|
-
if (ProbSetConfig_getInstance().
|
|
4068
|
-
tmp = toTerm(Companion_getInstance_11().
|
|
4127
|
+
if (ProbSetConfig_getInstance().n3o(_this__u8e3s4.context)) {
|
|
4128
|
+
tmp = toTerm(Companion_getInstance_11().g3n_1);
|
|
4069
4129
|
} else {
|
|
4070
4130
|
var tmp_0 = Companion_getInstance_1();
|
|
4071
4131
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
4072
4132
|
var tmp$ret$0 = ProbSolveEvidence_getInstance().signature.name;
|
|
4073
4133
|
var subQuery = tmp_0.of(tmp$ret$0, [evidenceExplanationVar]);
|
|
4074
|
-
var solution = _this__u8e3s4.subSolver().solveOnceWithOptions(subQuery, ProbSetConfig_getInstance().
|
|
4134
|
+
var solution = _this__u8e3s4.subSolver().solveOnceWithOptions(subQuery, ProbSetConfig_getInstance().z3p(_this__u8e3s4.context));
|
|
4075
4135
|
tmp = solution.p1x().j2(evidenceExplanationVar);
|
|
4076
4136
|
}
|
|
4077
4137
|
var evidenceExplanationTerm = tmp;
|
|
@@ -4080,11 +4140,11 @@
|
|
|
4080
4140
|
var tmp_2 = Companion_getInstance_1();
|
|
4081
4141
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
4082
4142
|
var tmp$ret$1 = ProbSolve_getInstance().signature.name;
|
|
4083
|
-
var solutions = tmp_1.solveWithOptions(tmp_2.of(tmp$ret$1, [goalExplanationVar, third]), ProbSetConfig_getInstance().
|
|
4143
|
+
var solutions = tmp_1.solveWithOptions(tmp_2.of(tmp$ret$1, [goalExplanationVar, third]), ProbSetConfig_getInstance().z3p(_this__u8e3s4.context));
|
|
4084
4144
|
return sequence(ProbSolveWithEvidence$computeAllSubstitutions$slambda_0(solutions, goalExplanationVar, evidenceExplanationTerm, _this__u8e3s4, first, second, null));
|
|
4085
4145
|
};
|
|
4086
|
-
protoOf(ProbSolveWithEvidence).
|
|
4087
|
-
return this.
|
|
4146
|
+
protoOf(ProbSolveWithEvidence).v2n = function (_this__u8e3s4, first, second, third) {
|
|
4147
|
+
return this.d2v(_this__u8e3s4, first, second, third);
|
|
4088
4148
|
};
|
|
4089
4149
|
var ProbSolveWithEvidence_instance;
|
|
4090
4150
|
function ProbSolveWithEvidence_getInstance() {
|
|
@@ -4096,10 +4156,10 @@
|
|
|
4096
4156
|
Prob_instance = this;
|
|
4097
4157
|
RuleWrapper_init_$Init$('prob', 2, VOID, this);
|
|
4098
4158
|
}
|
|
4099
|
-
protoOf(Prob).
|
|
4159
|
+
protoOf(Prob).o2o = function (_this__u8e3s4) {
|
|
4100
4160
|
return listOf_0([_this__u8e3s4.varOf('EXPL'), _this__u8e3s4.varOf('GOAL')]);
|
|
4101
4161
|
};
|
|
4102
|
-
protoOf(Prob).
|
|
4162
|
+
protoOf(Prob).p2o = function (_this__u8e3s4) {
|
|
4103
4163
|
var expl = _this__u8e3s4.varOf('EXPL');
|
|
4104
4164
|
var goal = _this__u8e3s4.varOf('GOAL');
|
|
4105
4165
|
var newGoal = _this__u8e3s4.varOf('NEW_GOAL');
|
|
@@ -4116,7 +4176,7 @@
|
|
|
4116
4176
|
return Prob_instance;
|
|
4117
4177
|
}
|
|
4118
4178
|
//region block: post-declaration
|
|
4119
|
-
protoOf(ProblogSolver).
|
|
4179
|
+
protoOf(ProblogSolver).b1z = copy$default;
|
|
4120
4180
|
protoOf(MutableProblogSolver).loadStaticClauses = loadStaticClauses;
|
|
4121
4181
|
protoOf(MutableProblogSolver).loadStaticClausesIterable = loadStaticClausesIterable;
|
|
4122
4182
|
protoOf(MutableProblogSolver).loadStaticClausesSequence = loadStaticClausesSequence;
|
|
@@ -4128,22 +4188,22 @@
|
|
|
4128
4188
|
protoOf(ProblogSolverFactory).mutableSolverOf = mutableSolverOf;
|
|
4129
4189
|
protoOf(ProblogSolverFactory).rawMutableSolverOf = rawMutableSolverOf;
|
|
4130
4190
|
protoOf(ProblogSolverFactory).newBuilder = newBuilder;
|
|
4131
|
-
protoOf(ProblogSolverFactory).
|
|
4132
|
-
protoOf(ProblogSolverFactory).
|
|
4133
|
-
protoOf(ProblogSolverFactory).
|
|
4134
|
-
protoOf(ProblogSolverFactory).
|
|
4135
|
-
protoOf(ProblogSolverFactory).
|
|
4136
|
-
protoOf(ProblogSolverFactory).
|
|
4137
|
-
protoOf(ProblogSolverFactory).
|
|
4138
|
-
protoOf(ProblogSolverFactory).
|
|
4139
|
-
protoOf(ProblogSolverFactory).
|
|
4191
|
+
protoOf(ProblogSolverFactory).b21 = get_defaultRuntime;
|
|
4192
|
+
protoOf(ProblogSolverFactory).d21 = get_defaultUnificator;
|
|
4193
|
+
protoOf(ProblogSolverFactory).h21 = get_defaultStaticKb;
|
|
4194
|
+
protoOf(ProblogSolverFactory).i21 = get_defaultDynamicKb;
|
|
4195
|
+
protoOf(ProblogSolverFactory).j21 = get_defaultInputChannel;
|
|
4196
|
+
protoOf(ProblogSolverFactory).k21 = get_defaultOutputChannel;
|
|
4197
|
+
protoOf(ProblogSolverFactory).l21 = get_defaultErrorChannel;
|
|
4198
|
+
protoOf(ProblogSolverFactory).m21 = get_defaultWarningsChannel;
|
|
4199
|
+
protoOf(ProblogSolverFactory).u21 = solverWithDefaultBuiltins;
|
|
4140
4200
|
protoOf(ProblogSolverFactory).solverWithDefaultBuiltinsAnd = solverWithDefaultBuiltinsAnd;
|
|
4141
|
-
protoOf(ProblogSolverFactory).
|
|
4201
|
+
protoOf(ProblogSolverFactory).w21 = mutableSolverWithDefaultBuiltins;
|
|
4142
4202
|
protoOf(ProblogSolverFactory).mutableSolverWithDefaultBuiltinsAnd = mutableSolverWithDefaultBuiltinsAnd;
|
|
4143
4203
|
defineProp(protoOf(ClauseMappingException), 'message', function () {
|
|
4144
4204
|
return this.p1();
|
|
4145
4205
|
});
|
|
4146
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
4206
|
+
protoOf(BinaryDecisionDiagramExplanation).t3n = get_probabilityOrNull;
|
|
4147
4207
|
//endregion
|
|
4148
4208
|
//region block: init
|
|
4149
4209
|
ProblogSolverFactory_instance = new ProblogSolverFactory();
|