@tuprolog/2p-full 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2p-bdd.js +152 -152
- package/2p-bdd.js.map +1 -1
- package/2p-core.js +2379 -2379
- package/2p-core.js.map +1 -1
- package/2p-solve-classic.js +853 -853
- package/2p-solve-classic.js.map +1 -1
- package/2p-solve-plp.js +2 -2
- package/2p-solve-plp.js.map +1 -1
- package/2p-solve-problog.js +1166 -1166
- package/2p-solve-problog.js.map +1 -1
- package/2p-solve-streams.js +818 -818
- package/2p-solve-streams.js.map +1 -1
- package/2p-solve.js +3244 -3249
- package/2p-solve.js.map +1 -1
- package/2p-theory.js +1352 -1352
- package/2p-theory.js.map +1 -1
- package/2p-unify.js +321 -321
- package/2p-unify.js.map +1 -1
- package/2p-utils.js +358 -357
- package/2p-utils.js.map +1 -1
- package/README.md +4 -3
- package/kotlin-kotlin-stdlib.js +1289 -1251
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kt-math.js +1460 -1460
- package/okio-parent-okio-nodefilesystem.js +15 -0
- package/okio-parent-okio-nodefilesystem.js.map +1 -0
- package/okio-parent-okio.js +15 -0
- package/okio-parent-okio.js.map +1 -0
- package/package.json +1 -1
package/2p-solve-problog.js
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
var protoOf = kotlin_kotlin.$_$.p6;
|
|
41
41
|
var first = kotlin_kotlin.$_$.q2;
|
|
42
42
|
var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.g;
|
|
43
|
-
var THROW_CCE = kotlin_kotlin.$_$.
|
|
43
|
+
var THROW_CCE = kotlin_kotlin.$_$.oa;
|
|
44
44
|
var loadStaticClauses = kotlin_it_unibo_tuprolog_solve.$_$.v2;
|
|
45
45
|
var loadStaticClausesIterable = kotlin_it_unibo_tuprolog_solve.$_$.w2;
|
|
46
46
|
var loadStaticClausesSequence = kotlin_it_unibo_tuprolog_solve.$_$.x2;
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
var hashCode = kotlin_kotlin.$_$.z5;
|
|
130
130
|
var emptySet = kotlin_kotlin.$_$.n2;
|
|
131
131
|
var Companion_getInstance_6 = kotlin_it_unibo_tuprolog_core.$_$.k;
|
|
132
|
-
var lazy = kotlin_kotlin.$_$.
|
|
132
|
+
var lazy = kotlin_kotlin.$_$.ua;
|
|
133
133
|
var collectionSizeOrDefault = kotlin_kotlin.$_$.d2;
|
|
134
134
|
var toSet = kotlin_kotlin.$_$.m4;
|
|
135
135
|
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.o;
|
|
@@ -158,11 +158,11 @@
|
|
|
158
158
|
var plus = kotlin_kotlin.$_$.u3;
|
|
159
159
|
var setTag = kotlin_it_unibo_tuprolog_utils.$_$.j1;
|
|
160
160
|
var Regex_init_$Create$ = kotlin_kotlin.$_$.t;
|
|
161
|
-
var toDoubleOrNull = kotlin_kotlin.$_$.
|
|
161
|
+
var toDoubleOrNull = kotlin_kotlin.$_$.v9;
|
|
162
162
|
var toSet_0 = kotlin_kotlin.$_$.x8;
|
|
163
163
|
var plus_0 = kotlin_kotlin.$_$.r3;
|
|
164
164
|
var checkIndexOverflow = kotlin_kotlin.$_$.c2;
|
|
165
|
-
var Pair = kotlin_kotlin.$_$.
|
|
165
|
+
var Pair = kotlin_kotlin.$_$.ma;
|
|
166
166
|
var Fact = kotlin_it_unibo_tuprolog_core.$_$.i1;
|
|
167
167
|
var subtract = kotlin_kotlin.$_$.c4;
|
|
168
168
|
var setOf = kotlin_kotlin.$_$.x3;
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
var SequenceScope = kotlin_kotlin.$_$.i7;
|
|
186
186
|
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.o4;
|
|
187
187
|
var extractSignature = kotlin_it_unibo_tuprolog_solve.$_$.b4;
|
|
188
|
-
var ensureNotNull = kotlin_kotlin.$_$.
|
|
188
|
+
var ensureNotNull = kotlin_kotlin.$_$.sa;
|
|
189
189
|
var Clause = kotlin_it_unibo_tuprolog_core.$_$.f1;
|
|
190
190
|
var copyToArray = kotlin_kotlin.$_$.i2;
|
|
191
191
|
var initMetadataForLambda = kotlin_kotlin.$_$.e6;
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
function get_probabilityOrNull() {
|
|
220
220
|
var tmp;
|
|
221
221
|
try {
|
|
222
|
-
tmp = this.
|
|
222
|
+
tmp = this.j39();
|
|
223
223
|
} catch ($p) {
|
|
224
224
|
var tmp_0;
|
|
225
225
|
if ($p instanceof Error) {
|
|
@@ -265,163 +265,163 @@
|
|
|
265
265
|
//endregion
|
|
266
266
|
function MutableProblogSolver(solver) {
|
|
267
267
|
ProblogSolver.call(this, solver);
|
|
268
|
-
this.
|
|
268
|
+
this.e37_1 = solver;
|
|
269
269
|
}
|
|
270
|
-
protoOf(MutableProblogSolver).
|
|
271
|
-
this.
|
|
270
|
+
protoOf(MutableProblogSolver).f31 = function (library) {
|
|
271
|
+
this.e37_1.loadLibrary(library);
|
|
272
272
|
};
|
|
273
273
|
protoOf(MutableProblogSolver).loadLibrary = function (library) {
|
|
274
|
-
return this.
|
|
274
|
+
return this.f31(library);
|
|
275
275
|
};
|
|
276
|
-
protoOf(MutableProblogSolver).
|
|
277
|
-
this.
|
|
276
|
+
protoOf(MutableProblogSolver).g31 = function (library) {
|
|
277
|
+
this.e37_1.unloadLibrary(library);
|
|
278
278
|
};
|
|
279
279
|
protoOf(MutableProblogSolver).unloadLibrary = function (library) {
|
|
280
|
-
return this.
|
|
280
|
+
return this.g31(library);
|
|
281
281
|
};
|
|
282
|
-
protoOf(MutableProblogSolver).
|
|
283
|
-
this.
|
|
282
|
+
protoOf(MutableProblogSolver).h31 = function (libraries) {
|
|
283
|
+
this.e37_1.setLibraries(libraries);
|
|
284
284
|
};
|
|
285
285
|
protoOf(MutableProblogSolver).setLibraries = function (libraries) {
|
|
286
|
-
return this.
|
|
286
|
+
return this.h31(libraries);
|
|
287
287
|
};
|
|
288
|
-
protoOf(MutableProblogSolver).
|
|
289
|
-
this.
|
|
288
|
+
protoOf(MutableProblogSolver).i31 = function (theory) {
|
|
289
|
+
this.e37_1.loadStaticKb(Companion_instance_10.ofIterable(this.e37_1.u1k(), theory));
|
|
290
290
|
};
|
|
291
291
|
protoOf(MutableProblogSolver).loadStaticKb = function (theory) {
|
|
292
|
-
return this.
|
|
292
|
+
return this.i31(theory);
|
|
293
293
|
};
|
|
294
|
-
protoOf(MutableProblogSolver).
|
|
295
|
-
this.
|
|
294
|
+
protoOf(MutableProblogSolver).j31 = function (theory) {
|
|
295
|
+
this.e37_1.appendStaticKb(Companion_instance_10.ofIterable(this.e37_1.u1k(), theory));
|
|
296
296
|
};
|
|
297
297
|
protoOf(MutableProblogSolver).appendStaticKb = function (theory) {
|
|
298
|
-
return this.
|
|
298
|
+
return this.j31(theory);
|
|
299
299
|
};
|
|
300
|
-
protoOf(MutableProblogSolver).
|
|
301
|
-
this.
|
|
300
|
+
protoOf(MutableProblogSolver).k31 = function () {
|
|
301
|
+
this.e37_1.resetStaticKb();
|
|
302
302
|
};
|
|
303
303
|
protoOf(MutableProblogSolver).resetStaticKb = function () {
|
|
304
|
-
return this.
|
|
304
|
+
return this.k31();
|
|
305
305
|
};
|
|
306
|
-
protoOf(MutableProblogSolver).
|
|
307
|
-
this.
|
|
306
|
+
protoOf(MutableProblogSolver).l31 = function (theory) {
|
|
307
|
+
this.e37_1.loadDynamicKb(Companion_instance_10.ofIterable(this.e37_1.u1k(), theory));
|
|
308
308
|
};
|
|
309
309
|
protoOf(MutableProblogSolver).loadDynamicKb = function (theory) {
|
|
310
|
-
return this.
|
|
310
|
+
return this.l31(theory);
|
|
311
311
|
};
|
|
312
|
-
protoOf(MutableProblogSolver).
|
|
313
|
-
this.
|
|
312
|
+
protoOf(MutableProblogSolver).m31 = function (theory) {
|
|
313
|
+
this.e37_1.appendDynamicKb(Companion_instance_10.ofIterable(this.e37_1.u1k(), theory));
|
|
314
314
|
};
|
|
315
315
|
protoOf(MutableProblogSolver).appendDynamicKb = function (theory) {
|
|
316
|
-
return this.
|
|
316
|
+
return this.m31(theory);
|
|
317
317
|
};
|
|
318
|
-
protoOf(MutableProblogSolver).
|
|
319
|
-
this.
|
|
318
|
+
protoOf(MutableProblogSolver).n31 = function () {
|
|
319
|
+
this.e37_1.resetDynamicKb();
|
|
320
320
|
};
|
|
321
321
|
protoOf(MutableProblogSolver).resetDynamicKb = function () {
|
|
322
|
-
return this.
|
|
322
|
+
return this.n31();
|
|
323
323
|
};
|
|
324
|
-
protoOf(MutableProblogSolver).
|
|
325
|
-
this.
|
|
324
|
+
protoOf(MutableProblogSolver).g1m = function (clause) {
|
|
325
|
+
this.e37_1.assertA(first(Companion_instance_10.of(this.e37_1.u1k(), [clause]).e1l()));
|
|
326
326
|
};
|
|
327
327
|
protoOf(MutableProblogSolver).assertA = function (clause) {
|
|
328
|
-
return this.
|
|
328
|
+
return this.g1m(clause);
|
|
329
329
|
};
|
|
330
|
-
protoOf(MutableProblogSolver).
|
|
331
|
-
this.
|
|
330
|
+
protoOf(MutableProblogSolver).o31 = function (fact) {
|
|
331
|
+
this.e37_1.assertA(first(Companion_instance_10.of(this.e37_1.u1k(), [Companion_instance.of(fact)]).e1l()));
|
|
332
332
|
};
|
|
333
333
|
protoOf(MutableProblogSolver).assertAFact = function (fact) {
|
|
334
|
-
return this.
|
|
334
|
+
return this.o31(fact);
|
|
335
335
|
};
|
|
336
|
-
protoOf(MutableProblogSolver).
|
|
337
|
-
this.
|
|
336
|
+
protoOf(MutableProblogSolver).h1l = function (clause) {
|
|
337
|
+
this.e37_1.assertZ(first(Companion_instance_10.of(this.e37_1.u1k(), [clause]).e1l()));
|
|
338
338
|
};
|
|
339
339
|
protoOf(MutableProblogSolver).assertZ = function (clause) {
|
|
340
|
-
return this.
|
|
340
|
+
return this.h1l(clause);
|
|
341
341
|
};
|
|
342
|
-
protoOf(MutableProblogSolver).
|
|
343
|
-
this.
|
|
342
|
+
protoOf(MutableProblogSolver).p31 = function (fact) {
|
|
343
|
+
this.e37_1.assertA(first(Companion_instance_10.of(this.e37_1.u1k(), [Companion_instance.of(fact)]).e1l()));
|
|
344
344
|
};
|
|
345
345
|
protoOf(MutableProblogSolver).assertZFact = function (fact) {
|
|
346
|
-
return this.
|
|
346
|
+
return this.p31(fact);
|
|
347
347
|
};
|
|
348
|
-
protoOf(MutableProblogSolver).
|
|
349
|
-
return this.
|
|
348
|
+
protoOf(MutableProblogSolver).a1t = function (clause) {
|
|
349
|
+
return this.e37_1.retract(first(Companion_instance_10.of(this.e37_1.u1k(), [clause]).e1l()));
|
|
350
350
|
};
|
|
351
351
|
protoOf(MutableProblogSolver).retract = function (clause) {
|
|
352
|
-
return this.
|
|
352
|
+
return this.a1t(clause);
|
|
353
353
|
};
|
|
354
|
-
protoOf(MutableProblogSolver).
|
|
355
|
-
return this.
|
|
354
|
+
protoOf(MutableProblogSolver).b1t = function (fact) {
|
|
355
|
+
return this.e37_1.retract(first(Companion_instance_10.of(this.e37_1.u1k(), [Companion_instance.of(fact)]).e1l()));
|
|
356
356
|
};
|
|
357
357
|
protoOf(MutableProblogSolver).retractByHead = function (fact) {
|
|
358
|
-
return this.
|
|
358
|
+
return this.b1t(fact);
|
|
359
359
|
};
|
|
360
|
-
protoOf(MutableProblogSolver).
|
|
361
|
-
return this.
|
|
360
|
+
protoOf(MutableProblogSolver).m1l = function (clause) {
|
|
361
|
+
return this.e37_1.retractAll(first(Companion_instance_10.of(this.e37_1.u1k(), [clause]).e1l()));
|
|
362
362
|
};
|
|
363
363
|
protoOf(MutableProblogSolver).retractAll = function (clause) {
|
|
364
|
-
return this.
|
|
364
|
+
return this.m1l(clause);
|
|
365
365
|
};
|
|
366
|
-
protoOf(MutableProblogSolver).
|
|
367
|
-
return this.
|
|
366
|
+
protoOf(MutableProblogSolver).q31 = function (fact) {
|
|
367
|
+
return this.e37_1.retractAll(first(Companion_instance_10.of(this.e37_1.u1k(), [Companion_instance.of(fact)]).e1l()));
|
|
368
368
|
};
|
|
369
369
|
protoOf(MutableProblogSolver).retractAllBeHead = function (fact) {
|
|
370
|
-
return this.
|
|
370
|
+
return this.q31(fact);
|
|
371
371
|
};
|
|
372
|
-
protoOf(MutableProblogSolver).
|
|
373
|
-
this.
|
|
372
|
+
protoOf(MutableProblogSolver).r31 = function (name, value) {
|
|
373
|
+
this.e37_1.setFlag(name, value);
|
|
374
374
|
};
|
|
375
375
|
protoOf(MutableProblogSolver).setFlag = function (name, value) {
|
|
376
|
-
return this.
|
|
376
|
+
return this.r31(name, value);
|
|
377
377
|
};
|
|
378
|
-
protoOf(MutableProblogSolver).
|
|
379
|
-
this.
|
|
378
|
+
protoOf(MutableProblogSolver).s31 = function (flag) {
|
|
379
|
+
this.e37_1.setFlagPair(flag);
|
|
380
380
|
};
|
|
381
381
|
protoOf(MutableProblogSolver).setFlagPair = function (flag) {
|
|
382
|
-
return this.
|
|
382
|
+
return this.s31(flag);
|
|
383
383
|
};
|
|
384
|
-
protoOf(MutableProblogSolver).
|
|
385
|
-
this.
|
|
384
|
+
protoOf(MutableProblogSolver).t31 = function (flag) {
|
|
385
|
+
this.e37_1.setFlagNotable(flag);
|
|
386
386
|
};
|
|
387
387
|
protoOf(MutableProblogSolver).setFlagNotable = function (flag) {
|
|
388
|
-
return this.
|
|
388
|
+
return this.t31(flag);
|
|
389
389
|
};
|
|
390
|
-
protoOf(MutableProblogSolver).
|
|
391
|
-
this.
|
|
390
|
+
protoOf(MutableProblogSolver).u31 = function (stdIn) {
|
|
391
|
+
this.e37_1.setStandardInput(stdIn);
|
|
392
392
|
};
|
|
393
393
|
protoOf(MutableProblogSolver).setStandardInput = function (stdIn) {
|
|
394
|
-
return this.
|
|
394
|
+
return this.u31(stdIn);
|
|
395
395
|
};
|
|
396
|
-
protoOf(MutableProblogSolver).
|
|
397
|
-
this.
|
|
396
|
+
protoOf(MutableProblogSolver).v31 = function (stdErr) {
|
|
397
|
+
this.e37_1.setStandardError(stdErr);
|
|
398
398
|
};
|
|
399
399
|
protoOf(MutableProblogSolver).setStandardError = function (stdErr) {
|
|
400
|
-
return this.
|
|
400
|
+
return this.v31(stdErr);
|
|
401
401
|
};
|
|
402
|
-
protoOf(MutableProblogSolver).
|
|
403
|
-
this.
|
|
402
|
+
protoOf(MutableProblogSolver).w31 = function (stdOut) {
|
|
403
|
+
this.e37_1.setStandardOutput(stdOut);
|
|
404
404
|
};
|
|
405
405
|
protoOf(MutableProblogSolver).setStandardOutput = function (stdOut) {
|
|
406
|
-
return this.
|
|
406
|
+
return this.w31(stdOut);
|
|
407
407
|
};
|
|
408
|
-
protoOf(MutableProblogSolver).
|
|
409
|
-
this.
|
|
408
|
+
protoOf(MutableProblogSolver).x31 = function (warnings) {
|
|
409
|
+
this.e37_1.setWarnings(warnings);
|
|
410
410
|
};
|
|
411
411
|
protoOf(MutableProblogSolver).setWarnings = function (warnings) {
|
|
412
|
-
return this.
|
|
412
|
+
return this.x31(warnings);
|
|
413
413
|
};
|
|
414
|
-
protoOf(MutableProblogSolver).
|
|
415
|
-
return new MutableProblogSolver(this.
|
|
414
|
+
protoOf(MutableProblogSolver).i1v = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
415
|
+
return new MutableProblogSolver(this.e37_1.i1v(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings));
|
|
416
416
|
};
|
|
417
417
|
protoOf(MutableProblogSolver).copy = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, $super) {
|
|
418
418
|
return this.copy(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, ($super == null ? true : $super instanceof MutableProblogSolver) ? $super : THROW_CCE());
|
|
419
419
|
};
|
|
420
|
-
protoOf(MutableProblogSolver).
|
|
421
|
-
return new MutableProblogSolver(this.
|
|
420
|
+
protoOf(MutableProblogSolver).j1s = function () {
|
|
421
|
+
return new MutableProblogSolver(this.e37_1.j1s());
|
|
422
422
|
};
|
|
423
423
|
protoOf(MutableProblogSolver).clone = function () {
|
|
424
|
-
return this.
|
|
424
|
+
return this.j1s();
|
|
425
425
|
};
|
|
426
426
|
function get_ANNOTATION_OPERATOR() {
|
|
427
427
|
_init_properties_Operators_kt__ggskrn();
|
|
@@ -449,11 +449,11 @@
|
|
|
449
449
|
var tmp_0 = Companion_getInstance_1();
|
|
450
450
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
451
451
|
var tmp$ret$0 = ProbSetConfig_getInstance().signature.name;
|
|
452
|
-
var tmp_1 = tmp_0.of(tmp$ret$0, [ProbSetConfig_getInstance().
|
|
452
|
+
var tmp_1 = tmp_0.of(tmp$ret$0, [ProbSetConfig_getInstance().s37(options)]);
|
|
453
453
|
var tmp_2 = Companion_getInstance_1();
|
|
454
454
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
455
455
|
var tmp$ret$1 = Prob_getInstance().signature.name;
|
|
456
|
-
var tmp_3 = $this.
|
|
456
|
+
var tmp_3 = $this.f37_1.solveWithOptions(tmp.of(tmp_1, tmp_2.of(tmp$ret$1, [anonVar, goal])), options);
|
|
457
457
|
return map(tmp_3, ProblogSolver$solveNonProbabilistically$lambda(goal, anonVar));
|
|
458
458
|
}
|
|
459
459
|
function solveProbabilistically($this, goal, options) {
|
|
@@ -462,7 +462,7 @@
|
|
|
462
462
|
var tmp = Companion_getInstance_1();
|
|
463
463
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
464
464
|
var tmp$ret$0 = ProbQuery_getInstance().signature.name;
|
|
465
|
-
var tmp_0 = $this.
|
|
465
|
+
var tmp_0 = $this.f37_1.solveWithOptions(tmp.of(tmp$ret$0, [probabilityVar, goal, ProbSetConfig_getInstance().s37(options), bddVar]), options);
|
|
466
466
|
return map(tmp_0, ProblogSolver$solveProbabilistically$lambda(probabilityVar, bddVar, goal, options));
|
|
467
467
|
}
|
|
468
468
|
function ProblogSolver$solveNonProbabilistically$lambda$lambda($anonVar) {
|
|
@@ -475,11 +475,11 @@
|
|
|
475
475
|
var tmp;
|
|
476
476
|
if (isInterface(it, Yes)) {
|
|
477
477
|
var tmp_0 = Companion_instance_1;
|
|
478
|
-
var tmp_1 = it.
|
|
479
|
-
tmp = tmp_0.
|
|
478
|
+
var tmp_1 = it.n1u();
|
|
479
|
+
tmp = tmp_0.d1w($goal, tmp_1.b10(ProblogSolver$solveNonProbabilistically$lambda$lambda($anonVar)));
|
|
480
480
|
} else {
|
|
481
481
|
if (isInterface(it, Halt)) {
|
|
482
|
-
tmp = Companion_instance_1.halt($goal, it.
|
|
482
|
+
tmp = Companion_instance_1.halt($goal, it.t1v());
|
|
483
483
|
} else {
|
|
484
484
|
tmp = Companion_instance_1.no($goal);
|
|
485
485
|
}
|
|
@@ -494,16 +494,16 @@
|
|
|
494
494
|
}
|
|
495
495
|
function ProblogSolver$solveProbabilistically$lambda($probabilityVar, $bddVar, $goal, $options) {
|
|
496
496
|
return function (it) {
|
|
497
|
-
var probabilityTerm = it.
|
|
498
|
-
var bddTerm = it.
|
|
497
|
+
var probabilityTerm = it.n1u().i2($probabilityVar);
|
|
498
|
+
var bddTerm = it.n1u().i2($bddVar);
|
|
499
499
|
var tmp;
|
|
500
500
|
if (isInterface(it, Yes)) {
|
|
501
501
|
var tmp_0 = Companion_instance_1;
|
|
502
|
-
var tmp_1 = it.
|
|
503
|
-
tmp = tmp_0.
|
|
502
|
+
var tmp_1 = it.n1u();
|
|
503
|
+
tmp = tmp_0.d1w($goal, tmp_1.b10(ProblogSolver$solveProbabilistically$lambda$lambda($probabilityVar, $bddVar)));
|
|
504
504
|
} else {
|
|
505
505
|
if (isInterface(it, Halt)) {
|
|
506
|
-
tmp = Companion_instance_1.halt($goal, it.
|
|
506
|
+
tmp = Companion_instance_1.halt($goal, it.t1v());
|
|
507
507
|
} else {
|
|
508
508
|
tmp = Companion_instance_1.no($goal);
|
|
509
509
|
}
|
|
@@ -515,7 +515,7 @@
|
|
|
515
515
|
} else {
|
|
516
516
|
var tmp_3;
|
|
517
517
|
if (!(probabilityTerm == null) ? isInterface(probabilityTerm, Numeric) : false) {
|
|
518
|
-
tmp_3 = setProbability(newSolution, probabilityTerm.
|
|
518
|
+
tmp_3 = setProbability(newSolution, probabilityTerm.qy().toDouble());
|
|
519
519
|
} else {
|
|
520
520
|
tmp_3 = setProbability(newSolution, NaN);
|
|
521
521
|
}
|
|
@@ -527,9 +527,9 @@
|
|
|
527
527
|
tmp_4 = false;
|
|
528
528
|
}
|
|
529
529
|
if (tmp_4) {
|
|
530
|
-
var explanation = bddTerm.
|
|
530
|
+
var explanation = bddTerm.u37_1;
|
|
531
531
|
if (explanation instanceof BinaryDecisionDiagramExplanation) {
|
|
532
|
-
newSolution = setBinaryDecisionDiagram(newSolution, explanation.
|
|
532
|
+
newSolution = setBinaryDecisionDiagram(newSolution, explanation.v37_1);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
tmp_2 = newSolution;
|
|
@@ -538,9 +538,9 @@
|
|
|
538
538
|
};
|
|
539
539
|
}
|
|
540
540
|
function ProblogSolver(solver) {
|
|
541
|
-
this.
|
|
541
|
+
this.f37_1 = solver;
|
|
542
542
|
}
|
|
543
|
-
protoOf(ProblogSolver).
|
|
543
|
+
protoOf(ProblogSolver).o2a = function (goal, options) {
|
|
544
544
|
var tmp;
|
|
545
545
|
if (!get_isProbabilistic(options)) {
|
|
546
546
|
tmp = solveNonProbabilistically(this, goal, options);
|
|
@@ -550,103 +550,103 @@
|
|
|
550
550
|
return tmp;
|
|
551
551
|
};
|
|
552
552
|
protoOf(ProblogSolver).solveWithOptions = function (goal, options) {
|
|
553
|
-
return this.
|
|
553
|
+
return this.o2a(goal, options);
|
|
554
554
|
};
|
|
555
|
-
protoOf(ProblogSolver).
|
|
556
|
-
return this.
|
|
555
|
+
protoOf(ProblogSolver).g37 = function (goal, timeout) {
|
|
556
|
+
return this.o2a(goal, Companion_getInstance_2().allLazilyWithTimeout(timeout));
|
|
557
557
|
};
|
|
558
558
|
protoOf(ProblogSolver).solveWithTimeout = function (goal, timeout) {
|
|
559
|
-
return this.
|
|
559
|
+
return this.g37(goal, timeout);
|
|
560
560
|
};
|
|
561
|
-
protoOf(ProblogSolver).
|
|
562
|
-
return this.
|
|
561
|
+
protoOf(ProblogSolver).h37 = function (goal) {
|
|
562
|
+
return this.o2a(goal, Companion_getInstance_2().DEFAULT);
|
|
563
563
|
};
|
|
564
564
|
protoOf(ProblogSolver).solve = function (goal) {
|
|
565
|
-
return this.
|
|
565
|
+
return this.h37(goal);
|
|
566
566
|
};
|
|
567
|
-
protoOf(ProblogSolver).
|
|
568
|
-
return toList(this.
|
|
567
|
+
protoOf(ProblogSolver).i37 = function (goal, timeout) {
|
|
568
|
+
return toList(this.g37(goal, timeout));
|
|
569
569
|
};
|
|
570
570
|
protoOf(ProblogSolver).solveListWithTimeout = function (goal, timeout) {
|
|
571
|
-
return this.
|
|
571
|
+
return this.i37(goal, timeout);
|
|
572
572
|
};
|
|
573
|
-
protoOf(ProblogSolver).
|
|
574
|
-
return toList(this.
|
|
573
|
+
protoOf(ProblogSolver).j37 = function (goal) {
|
|
574
|
+
return toList(this.h37(goal));
|
|
575
575
|
};
|
|
576
576
|
protoOf(ProblogSolver).solveList = function (goal) {
|
|
577
|
-
return this.
|
|
577
|
+
return this.j37(goal);
|
|
578
578
|
};
|
|
579
|
-
protoOf(ProblogSolver).
|
|
580
|
-
return toList(this.
|
|
579
|
+
protoOf(ProblogSolver).k37 = function (goal, options) {
|
|
580
|
+
return toList(this.o2a(goal, options));
|
|
581
581
|
};
|
|
582
582
|
protoOf(ProblogSolver).solveListWithOptions = function (goal, options) {
|
|
583
|
-
return this.
|
|
583
|
+
return this.k37(goal, options);
|
|
584
584
|
};
|
|
585
|
-
protoOf(ProblogSolver).
|
|
586
|
-
return first_0(this.
|
|
585
|
+
protoOf(ProblogSolver).l37 = function (goal, timeout) {
|
|
586
|
+
return first_0(this.o2a(goal, Companion_getInstance_2().someLazilyWithTimeout(1, timeout)));
|
|
587
587
|
};
|
|
588
588
|
protoOf(ProblogSolver).solveOnceWithTimeout = function (goal, timeout) {
|
|
589
|
-
return this.
|
|
589
|
+
return this.l37(goal, timeout);
|
|
590
590
|
};
|
|
591
|
-
protoOf(ProblogSolver).
|
|
592
|
-
return first_0(this.
|
|
591
|
+
protoOf(ProblogSolver).m37 = function (goal) {
|
|
592
|
+
return first_0(this.o2a(goal, Companion_getInstance_2().someLazily(1)));
|
|
593
593
|
};
|
|
594
594
|
protoOf(ProblogSolver).solveOnce = function (goal) {
|
|
595
|
-
return this.
|
|
595
|
+
return this.m37(goal);
|
|
596
596
|
};
|
|
597
|
-
protoOf(ProblogSolver).
|
|
598
|
-
return first_0(this.
|
|
597
|
+
protoOf(ProblogSolver).n37 = function (goal, options) {
|
|
598
|
+
return first_0(this.o2a(goal, options.setLimit(1)));
|
|
599
599
|
};
|
|
600
600
|
protoOf(ProblogSolver).solveOnceWithOptions = function (goal, options) {
|
|
601
|
-
return this.
|
|
601
|
+
return this.n37(goal, options);
|
|
602
602
|
};
|
|
603
|
-
protoOf(ProblogSolver).
|
|
604
|
-
return new ProblogSolver(this.
|
|
603
|
+
protoOf(ProblogSolver).i1v = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
604
|
+
return new ProblogSolver(this.f37_1.i1v(unificator, libraries, flags, Companion_instance_10.ofIterable(unificator, staticKb), Companion_instance_10.ofIterable(unificator, dynamicKb), stdIn, stdOut, stdErr, warnings));
|
|
605
605
|
};
|
|
606
606
|
protoOf(ProblogSolver).copy = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, $super) {
|
|
607
607
|
return this.copy(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, ($super == null ? true : $super instanceof ProblogSolver) ? $super : THROW_CCE());
|
|
608
608
|
};
|
|
609
|
-
protoOf(ProblogSolver).
|
|
610
|
-
return new ProblogSolver(this.
|
|
609
|
+
protoOf(ProblogSolver).j1s = function () {
|
|
610
|
+
return new ProblogSolver(this.f37_1.clone());
|
|
611
611
|
};
|
|
612
612
|
protoOf(ProblogSolver).clone = function () {
|
|
613
|
-
return this.
|
|
614
|
-
};
|
|
615
|
-
protoOf(ProblogSolver).o1u = function () {
|
|
616
|
-
return this.c37_1.o1u();
|
|
617
|
-
};
|
|
618
|
-
protoOf(ProblogSolver).p1u = function () {
|
|
619
|
-
return this.c37_1.p1u();
|
|
620
|
-
};
|
|
621
|
-
protoOf(ProblogSolver).q1u = function () {
|
|
622
|
-
return this.c37_1.q1u();
|
|
613
|
+
return this.j1s();
|
|
623
614
|
};
|
|
624
615
|
protoOf(ProblogSolver).r1u = function () {
|
|
625
|
-
return this.
|
|
626
|
-
};
|
|
627
|
-
protoOf(ProblogSolver).x1u = function () {
|
|
628
|
-
return this.c37_1.x1u();
|
|
616
|
+
return this.f37_1.r1u();
|
|
629
617
|
};
|
|
630
618
|
protoOf(ProblogSolver).s1u = function () {
|
|
631
|
-
return this.
|
|
619
|
+
return this.f37_1.s1u();
|
|
632
620
|
};
|
|
633
621
|
protoOf(ProblogSolver).t1u = function () {
|
|
634
|
-
return this.
|
|
622
|
+
return this.f37_1.t1u();
|
|
635
623
|
};
|
|
636
|
-
protoOf(ProblogSolver).
|
|
637
|
-
return this.
|
|
638
|
-
};
|
|
639
|
-
protoOf(ProblogSolver).z1u = function () {
|
|
640
|
-
return this.c37_1.z1u();
|
|
624
|
+
protoOf(ProblogSolver).u1u = function () {
|
|
625
|
+
return this.f37_1.u1u();
|
|
641
626
|
};
|
|
642
627
|
protoOf(ProblogSolver).a1v = function () {
|
|
643
|
-
return this.
|
|
628
|
+
return this.f37_1.a1v();
|
|
629
|
+
};
|
|
630
|
+
protoOf(ProblogSolver).v1u = function () {
|
|
631
|
+
return this.f37_1.v1u();
|
|
632
|
+
};
|
|
633
|
+
protoOf(ProblogSolver).w1u = function () {
|
|
634
|
+
return this.f37_1.w1u();
|
|
644
635
|
};
|
|
645
636
|
protoOf(ProblogSolver).b1v = function () {
|
|
646
|
-
return this.
|
|
637
|
+
return this.f37_1.b1v();
|
|
638
|
+
};
|
|
639
|
+
protoOf(ProblogSolver).c1v = function () {
|
|
640
|
+
return this.f37_1.c1v();
|
|
641
|
+
};
|
|
642
|
+
protoOf(ProblogSolver).d1v = function () {
|
|
643
|
+
return this.f37_1.d1v();
|
|
647
644
|
};
|
|
648
|
-
protoOf(ProblogSolver).
|
|
649
|
-
return this.
|
|
645
|
+
protoOf(ProblogSolver).e1v = function () {
|
|
646
|
+
return this.f37_1.e1v();
|
|
647
|
+
};
|
|
648
|
+
protoOf(ProblogSolver).u1k = function () {
|
|
649
|
+
return this.f37_1.u1k();
|
|
650
650
|
};
|
|
651
651
|
function ensureVariablesTracking($this, flags) {
|
|
652
652
|
var tmp = TrackVariables_getInstance();
|
|
@@ -656,8 +656,8 @@
|
|
|
656
656
|
var tmp;
|
|
657
657
|
// Inline function 'kotlin.collections.contains' call
|
|
658
658
|
// Inline function 'kotlin.collections.containsKey' call
|
|
659
|
-
var key = ProblogLib_getInstance().
|
|
660
|
-
if (!(isInterface(libraries, KtMap) ? libraries : THROW_CCE()).
|
|
659
|
+
var key = ProblogLib_getInstance().f2d();
|
|
660
|
+
if (!(isInterface(libraries, KtMap) ? libraries : THROW_CCE()).g2(key)) {
|
|
661
661
|
tmp = libraries.plusLibrary(MinimalBuiltins_getInstance());
|
|
662
662
|
} else {
|
|
663
663
|
tmp = libraries;
|
|
@@ -665,36 +665,36 @@
|
|
|
665
665
|
return tmp;
|
|
666
666
|
}
|
|
667
667
|
function ProblogSolverFactory$ensureVariablesTracking$lambda($this$TrackVariables) {
|
|
668
|
-
return $this$TrackVariables.
|
|
668
|
+
return $this$TrackVariables.g28_1;
|
|
669
669
|
}
|
|
670
670
|
function ProblogSolverFactory() {
|
|
671
671
|
}
|
|
672
|
-
protoOf(ProblogSolverFactory).
|
|
672
|
+
protoOf(ProblogSolverFactory).d1x = function () {
|
|
673
673
|
return DefaultBuiltins_getInstance_0();
|
|
674
674
|
};
|
|
675
|
-
protoOf(ProblogSolverFactory).
|
|
675
|
+
protoOf(ProblogSolverFactory).f1x = function () {
|
|
676
676
|
return ensureVariablesTracking(this, get_defaultFlags.call(this));
|
|
677
677
|
};
|
|
678
|
-
protoOf(ProblogSolverFactory).
|
|
679
|
-
return new ProblogSolver(ClassicSolverFactory_instance.
|
|
678
|
+
protoOf(ProblogSolverFactory).o1x = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs) {
|
|
679
|
+
return new ProblogSolver(ClassicSolverFactory_instance.o1x(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_instance_10.ofIterable(unificator, staticKb), Companion_instance_10.ofIterable(unificator, dynamicKb), inputs, outputs));
|
|
680
680
|
};
|
|
681
681
|
protoOf(ProblogSolverFactory).rawSolverOf = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs, $super) {
|
|
682
682
|
return this.rawSolverOf(unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs, ($super == null ? true : $super instanceof ProblogSolverFactory) ? $super : THROW_CCE());
|
|
683
683
|
};
|
|
684
|
-
protoOf(ProblogSolverFactory).
|
|
685
|
-
return new ProblogSolver(ClassicSolverFactory_instance.
|
|
684
|
+
protoOf(ProblogSolverFactory).u1x = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
685
|
+
return new ProblogSolver(ClassicSolverFactory_instance.u1x(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_instance_10.ofIterable(unificator, staticKb), Companion_instance_10.ofIterable(unificator, dynamicKb), stdIn, stdOut, stdErr, warnings));
|
|
686
686
|
};
|
|
687
687
|
protoOf(ProblogSolverFactory).solverOf = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, $super) {
|
|
688
688
|
return this.solverOf(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, ($super == null ? true : $super instanceof ProblogSolverFactory) ? $super : THROW_CCE());
|
|
689
689
|
};
|
|
690
|
-
protoOf(ProblogSolverFactory).
|
|
691
|
-
return new MutableProblogSolver(ClassicSolverFactory_instance.
|
|
690
|
+
protoOf(ProblogSolverFactory).w1x = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
691
|
+
return new MutableProblogSolver(ClassicSolverFactory_instance.w1x(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_instance_10.ofIterable(unificator, staticKb), Companion_instance_10.ofIterable(unificator, dynamicKb), stdIn, stdOut, stdErr, warnings));
|
|
692
692
|
};
|
|
693
693
|
protoOf(ProblogSolverFactory).mutableSolverOf = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, $super) {
|
|
694
694
|
return this.mutableSolverOf(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, ($super == null ? true : $super instanceof ProblogSolverFactory) ? $super : THROW_CCE());
|
|
695
695
|
};
|
|
696
|
-
protoOf(ProblogSolverFactory).
|
|
697
|
-
return new MutableProblogSolver(ClassicSolverFactory_instance.
|
|
696
|
+
protoOf(ProblogSolverFactory).y1x = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs) {
|
|
697
|
+
return new MutableProblogSolver(ClassicSolverFactory_instance.y1x(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_instance_10.ofIterable(unificator, staticKb), Companion_instance_10.ofIterable(unificator, dynamicKb), inputs, outputs));
|
|
698
698
|
};
|
|
699
699
|
protoOf(ProblogSolverFactory).rawMutableSolverOf = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs, $super) {
|
|
700
700
|
return this.rawMutableSolverOf(unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs, ($super == null ? true : $super instanceof ProblogSolverFactory) ? $super : THROW_CCE());
|
|
@@ -707,17 +707,17 @@
|
|
|
707
707
|
DefaultBuiltins_instance = this;
|
|
708
708
|
ExtensionLibrary.call(this, DefaultBuiltins_getInstance());
|
|
709
709
|
}
|
|
710
|
-
protoOf(DefaultBuiltins).
|
|
711
|
-
return ProblogLib_getInstance().
|
|
710
|
+
protoOf(DefaultBuiltins).f2d = function () {
|
|
711
|
+
return ProblogLib_getInstance().f2d();
|
|
712
712
|
};
|
|
713
|
-
protoOf(DefaultBuiltins).
|
|
714
|
-
return ProblogLib_getInstance().
|
|
713
|
+
protoOf(DefaultBuiltins).q2d = function () {
|
|
714
|
+
return ProblogLib_getInstance().q2d();
|
|
715
715
|
};
|
|
716
|
-
protoOf(DefaultBuiltins).
|
|
717
|
-
return ProblogLib_getInstance().
|
|
716
|
+
protoOf(DefaultBuiltins).s2d = function () {
|
|
717
|
+
return ProblogLib_getInstance().s2d();
|
|
718
718
|
};
|
|
719
|
-
protoOf(DefaultBuiltins).
|
|
720
|
-
return ProblogLib_getInstance().
|
|
719
|
+
protoOf(DefaultBuiltins).r2d = function () {
|
|
720
|
+
return ProblogLib_getInstance().r2d();
|
|
721
721
|
};
|
|
722
722
|
var DefaultBuiltins_instance;
|
|
723
723
|
function DefaultBuiltins_getInstance_0() {
|
|
@@ -729,10 +729,10 @@
|
|
|
729
729
|
MinimalBuiltins_instance = this;
|
|
730
730
|
ExtensionLibrary.call(this, ProblogLib_getInstance());
|
|
731
731
|
}
|
|
732
|
-
protoOf(MinimalBuiltins).
|
|
732
|
+
protoOf(MinimalBuiltins).s2d = function () {
|
|
733
733
|
return listOf(EnsureExecutable_getInstance());
|
|
734
734
|
};
|
|
735
|
-
protoOf(MinimalBuiltins).
|
|
735
|
+
protoOf(MinimalBuiltins).r2d = function () {
|
|
736
736
|
return listOf(Call_getInstance());
|
|
737
737
|
};
|
|
738
738
|
var MinimalBuiltins_instance;
|
|
@@ -744,17 +744,17 @@
|
|
|
744
744
|
function ProblogLib() {
|
|
745
745
|
ProblogLib_instance = this;
|
|
746
746
|
ExtensionLibrary.call(this, Companion_getInstance_3().of('problog.lang'));
|
|
747
|
-
this.
|
|
748
|
-
this.
|
|
749
|
-
this.
|
|
747
|
+
this.m38_1 = 'EXPL';
|
|
748
|
+
this.n38_1 = 'evidence';
|
|
749
|
+
this.o38_1 = 'prob';
|
|
750
750
|
}
|
|
751
|
-
protoOf(ProblogLib).
|
|
751
|
+
protoOf(ProblogLib).q2d = function () {
|
|
752
752
|
return get_PROBLOG_SPECIFIC_OPERATORS();
|
|
753
753
|
};
|
|
754
|
-
protoOf(ProblogLib).
|
|
754
|
+
protoOf(ProblogLib).r2d = function () {
|
|
755
755
|
return listOf(Prob_getInstance());
|
|
756
756
|
};
|
|
757
|
-
protoOf(ProblogLib).
|
|
757
|
+
protoOf(ProblogLib).s2d = function () {
|
|
758
758
|
return listOf_0([ProbHelper_getInstance(), ProbSolve_getInstance(), ProbExplAnd_getInstance(), ProbQuery_getInstance(), ProbSolveEvidence_getInstance(), ProbSolveWithEvidence_getInstance(), ProbNegationAsFailure_getInstance(), ProbSetConfig_getInstance()]);
|
|
759
759
|
};
|
|
760
760
|
var ProblogLib_instance;
|
|
@@ -767,11 +767,11 @@
|
|
|
767
767
|
cause = cause === VOID ? null : cause;
|
|
768
768
|
TuPrologException_init_$Init$(cause, this);
|
|
769
769
|
captureStack(this, ClauseMappingException);
|
|
770
|
-
this.
|
|
770
|
+
this.v38_1 = message;
|
|
771
771
|
delete this.message;
|
|
772
772
|
}
|
|
773
|
-
protoOf(ClauseMappingException).
|
|
774
|
-
return this.
|
|
773
|
+
protoOf(ClauseMappingException).p1 = function () {
|
|
774
|
+
return this.v38_1;
|
|
775
775
|
};
|
|
776
776
|
function Companion() {
|
|
777
777
|
}
|
|
@@ -807,11 +807,11 @@
|
|
|
807
807
|
}
|
|
808
808
|
function Companion_0() {
|
|
809
809
|
Companion_instance_9 = this;
|
|
810
|
-
this.
|
|
811
|
-
this.
|
|
810
|
+
this.w38_1 = new BinaryDecisionDiagramExplanation(bddTerminalOf(false), Companion_getInstance_13().z38_1);
|
|
811
|
+
this.x38_1 = new BinaryDecisionDiagramExplanation(bddTerminalOf(true), Companion_getInstance_13().a39_1);
|
|
812
812
|
}
|
|
813
|
-
protoOf(Companion_0).
|
|
814
|
-
return new BinaryDecisionDiagramExplanation(bddOf(term), new ComputedValue(term.
|
|
813
|
+
protoOf(Companion_0).b39 = function (term) {
|
|
814
|
+
return new BinaryDecisionDiagramExplanation(bddOf(term), new ComputedValue(term.e39_1));
|
|
815
815
|
};
|
|
816
816
|
var Companion_instance_9;
|
|
817
817
|
function Companion_getInstance_11() {
|
|
@@ -822,358 +822,358 @@
|
|
|
822
822
|
function ProbExplanation() {
|
|
823
823
|
}
|
|
824
824
|
function ProbExplanationTerm$freshCopy$lambda(it) {
|
|
825
|
-
return it.
|
|
825
|
+
return it.du();
|
|
826
826
|
}
|
|
827
827
|
function ProbExplanationTerm$freshCopy$lambda_0($scope) {
|
|
828
828
|
return function (it) {
|
|
829
|
-
return it.
|
|
829
|
+
return it.eu($scope);
|
|
830
830
|
};
|
|
831
831
|
}
|
|
832
832
|
function ProbExplanationTerm$apply$lambda($substitution) {
|
|
833
833
|
return function (it) {
|
|
834
|
-
return it.
|
|
834
|
+
return it.s14($substitution);
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
837
|
function ProbExplanationTerm(explanation) {
|
|
838
|
-
this.
|
|
839
|
-
this.
|
|
838
|
+
this.t37_1 = Companion_getInstance_4().of('<expl:' + explanation.toString() + '>');
|
|
839
|
+
this.u37_1 = explanation;
|
|
840
840
|
}
|
|
841
|
-
protoOf(ProbExplanationTerm).
|
|
841
|
+
protoOf(ProbExplanationTerm).zu = function () {
|
|
842
842
|
return false;
|
|
843
843
|
};
|
|
844
|
-
protoOf(ProbExplanationTerm).
|
|
844
|
+
protoOf(ProbExplanationTerm).dv = function () {
|
|
845
845
|
return this;
|
|
846
846
|
};
|
|
847
847
|
protoOf(ProbExplanationTerm).asConstant = function () {
|
|
848
|
-
return this.
|
|
848
|
+
return this.dv();
|
|
849
849
|
};
|
|
850
|
-
protoOf(ProbExplanationTerm).
|
|
851
|
-
return new ProbExplanationTerm(this.
|
|
850
|
+
protoOf(ProbExplanationTerm).du = function () {
|
|
851
|
+
return new ProbExplanationTerm(this.u37_1.applyTransformation(ProbExplanationTerm$freshCopy$lambda));
|
|
852
852
|
};
|
|
853
853
|
protoOf(ProbExplanationTerm).freshCopy = function () {
|
|
854
|
-
return this.
|
|
854
|
+
return this.du();
|
|
855
855
|
};
|
|
856
|
-
protoOf(ProbExplanationTerm).
|
|
857
|
-
return new ProbExplanationTerm(this.
|
|
856
|
+
protoOf(ProbExplanationTerm).eu = function (scope) {
|
|
857
|
+
return new ProbExplanationTerm(this.u37_1.applyTransformation(ProbExplanationTerm$freshCopy$lambda_0(scope)));
|
|
858
858
|
};
|
|
859
859
|
protoOf(ProbExplanationTerm).freshCopyFromScope = function (scope) {
|
|
860
|
-
return this.
|
|
860
|
+
return this.eu(scope);
|
|
861
861
|
};
|
|
862
|
-
protoOf(ProbExplanationTerm).
|
|
863
|
-
return this.
|
|
862
|
+
protoOf(ProbExplanationTerm).q2l = function (substitution, substitutions) {
|
|
863
|
+
return this.r2l(substitution, substitutions.slice());
|
|
864
864
|
};
|
|
865
865
|
protoOf(ProbExplanationTerm).getSubstituted = function (substitution, substitutions) {
|
|
866
|
-
return this.
|
|
866
|
+
return this.q2l(substitution, substitutions);
|
|
867
867
|
};
|
|
868
|
-
protoOf(ProbExplanationTerm).
|
|
869
|
-
return this.
|
|
868
|
+
protoOf(ProbExplanationTerm).r2l = function (substitution, substitutions) {
|
|
869
|
+
return this.s14(Companion_getInstance_5().ofSubstitution(substitution, substitutions.slice()));
|
|
870
870
|
};
|
|
871
871
|
protoOf(ProbExplanationTerm).apply = function (substitution, substitutions) {
|
|
872
|
-
return this.
|
|
872
|
+
return this.r2l(substitution, substitutions);
|
|
873
873
|
};
|
|
874
|
-
protoOf(ProbExplanationTerm).
|
|
874
|
+
protoOf(ProbExplanationTerm).s14 = function (substitution) {
|
|
875
875
|
var tmp;
|
|
876
|
-
if (substitution.h() || this.
|
|
876
|
+
if (substitution.h() || this.ev()) {
|
|
877
877
|
tmp = this;
|
|
878
878
|
} else {
|
|
879
|
-
tmp = new ProbExplanationTerm(this.
|
|
879
|
+
tmp = new ProbExplanationTerm(this.u37_1.applyTransformation(ProbExplanationTerm$apply$lambda(substitution)));
|
|
880
880
|
}
|
|
881
881
|
return tmp;
|
|
882
882
|
};
|
|
883
883
|
protoOf(ProbExplanationTerm).applySubstitution = function (substitution) {
|
|
884
|
-
return this.
|
|
884
|
+
return this.s14(substitution);
|
|
885
885
|
};
|
|
886
|
-
protoOf(ProbExplanationTerm).
|
|
887
|
-
return !this.
|
|
886
|
+
protoOf(ProbExplanationTerm).ev = function () {
|
|
887
|
+
return !this.u37_1.l39();
|
|
888
888
|
};
|
|
889
|
-
protoOf(ProbExplanationTerm).
|
|
890
|
-
return this.
|
|
889
|
+
protoOf(ProbExplanationTerm).fu = function () {
|
|
890
|
+
return this.t37_1.fu();
|
|
891
891
|
};
|
|
892
892
|
protoOf(ProbExplanationTerm).asAtom = function () {
|
|
893
|
-
return this.
|
|
894
|
-
};
|
|
895
|
-
protoOf(ProbExplanationTerm).rt = function () {
|
|
896
|
-
return this.q37_1.rt();
|
|
897
|
-
};
|
|
898
|
-
protoOf(ProbExplanationTerm).st = function () {
|
|
899
|
-
return this.q37_1.st();
|
|
900
|
-
};
|
|
901
|
-
protoOf(ProbExplanationTerm).tt = function () {
|
|
902
|
-
return this.q37_1.tt();
|
|
893
|
+
return this.fu();
|
|
903
894
|
};
|
|
904
895
|
protoOf(ProbExplanationTerm).ut = function () {
|
|
905
|
-
return this.
|
|
896
|
+
return this.t37_1.ut();
|
|
906
897
|
};
|
|
907
898
|
protoOf(ProbExplanationTerm).vt = function () {
|
|
908
|
-
return this.
|
|
899
|
+
return this.t37_1.vt();
|
|
909
900
|
};
|
|
910
|
-
protoOf(ProbExplanationTerm).
|
|
911
|
-
return this.
|
|
901
|
+
protoOf(ProbExplanationTerm).wt = function () {
|
|
902
|
+
return this.t37_1.wt();
|
|
903
|
+
};
|
|
904
|
+
protoOf(ProbExplanationTerm).xt = function () {
|
|
905
|
+
return this.t37_1.xt();
|
|
912
906
|
};
|
|
913
907
|
protoOf(ProbExplanationTerm).yt = function () {
|
|
914
|
-
return this.
|
|
908
|
+
return this.t37_1.yt();
|
|
915
909
|
};
|
|
916
|
-
protoOf(ProbExplanationTerm).
|
|
917
|
-
return this.
|
|
910
|
+
protoOf(ProbExplanationTerm).f2 = function () {
|
|
911
|
+
return this.t37_1.f2();
|
|
918
912
|
};
|
|
919
|
-
protoOf(ProbExplanationTerm).
|
|
920
|
-
return this.
|
|
913
|
+
protoOf(ProbExplanationTerm).bu = function () {
|
|
914
|
+
return this.t37_1.bu();
|
|
915
|
+
};
|
|
916
|
+
protoOf(ProbExplanationTerm).cu = function () {
|
|
917
|
+
return this.t37_1.cu();
|
|
918
|
+
};
|
|
919
|
+
protoOf(ProbExplanationTerm).qu = function () {
|
|
920
|
+
return this.t37_1.qu();
|
|
921
921
|
};
|
|
922
922
|
protoOf(ProbExplanationTerm).asStruct = function () {
|
|
923
|
-
return this.
|
|
923
|
+
return this.qu();
|
|
924
924
|
};
|
|
925
925
|
protoOf(ProbExplanationTerm).append = function (argument) {
|
|
926
|
-
return this.
|
|
926
|
+
return this.t37_1.append(argument);
|
|
927
927
|
};
|
|
928
928
|
protoOf(ProbExplanationTerm).addLast = function (argument) {
|
|
929
|
-
return this.
|
|
929
|
+
return this.t37_1.addLast(argument);
|
|
930
930
|
};
|
|
931
931
|
protoOf(ProbExplanationTerm).addFirst = function (argument) {
|
|
932
|
-
return this.
|
|
932
|
+
return this.t37_1.addFirst(argument);
|
|
933
933
|
};
|
|
934
934
|
protoOf(ProbExplanationTerm).insertAt = function (index, argument) {
|
|
935
|
-
return this.
|
|
935
|
+
return this.t37_1.insertAt(index, argument);
|
|
936
936
|
};
|
|
937
937
|
protoOf(ProbExplanationTerm).setFunctor = function (functor) {
|
|
938
|
-
return this.
|
|
938
|
+
return this.t37_1.setFunctor(functor);
|
|
939
939
|
};
|
|
940
940
|
protoOf(ProbExplanationTerm).getArgAt = function (index) {
|
|
941
|
-
return this.
|
|
941
|
+
return this.t37_1.getArgAt(index);
|
|
942
942
|
};
|
|
943
943
|
protoOf(ProbExplanationTerm).setArgs = function (args) {
|
|
944
|
-
return this.
|
|
944
|
+
return this.t37_1.setArgs(args);
|
|
945
945
|
};
|
|
946
946
|
protoOf(ProbExplanationTerm).setArgsIterable = function (args) {
|
|
947
|
-
return this.
|
|
947
|
+
return this.t37_1.setArgsIterable(args);
|
|
948
948
|
};
|
|
949
949
|
protoOf(ProbExplanationTerm).setArgsSequence = function (args) {
|
|
950
|
-
return this.
|
|
950
|
+
return this.t37_1.setArgsSequence(args);
|
|
951
951
|
};
|
|
952
952
|
protoOf(ProbExplanationTerm).get = function (index) {
|
|
953
|
-
return this.
|
|
953
|
+
return this.t37_1.get(index);
|
|
954
954
|
};
|
|
955
|
-
protoOf(ProbExplanationTerm).
|
|
956
|
-
return this.
|
|
957
|
-
};
|
|
958
|
-
protoOf(ProbExplanationTerm).eu = function () {
|
|
959
|
-
return this.q37_1.eu();
|
|
955
|
+
protoOf(ProbExplanationTerm).gu = function () {
|
|
956
|
+
return this.t37_1.gu();
|
|
960
957
|
};
|
|
961
|
-
protoOf(ProbExplanationTerm).
|
|
962
|
-
return this.
|
|
958
|
+
protoOf(ProbExplanationTerm).hu = function () {
|
|
959
|
+
return this.t37_1.hu();
|
|
963
960
|
};
|
|
964
961
|
protoOf(ProbExplanationTerm).iu = function () {
|
|
965
|
-
return this.
|
|
966
|
-
};
|
|
967
|
-
protoOf(ProbExplanationTerm).ju = function () {
|
|
968
|
-
return this.q37_1.ju();
|
|
962
|
+
return this.t37_1.iu();
|
|
969
963
|
};
|
|
970
|
-
protoOf(ProbExplanationTerm).
|
|
971
|
-
return this.
|
|
964
|
+
protoOf(ProbExplanationTerm).lu = function () {
|
|
965
|
+
return this.t37_1.lu();
|
|
972
966
|
};
|
|
973
967
|
protoOf(ProbExplanationTerm).mu = function () {
|
|
974
|
-
return this.
|
|
968
|
+
return this.t37_1.mu();
|
|
975
969
|
};
|
|
976
|
-
protoOf(ProbExplanationTerm).
|
|
977
|
-
return this.
|
|
978
|
-
};
|
|
979
|
-
protoOf(ProbExplanationTerm).ou = function () {
|
|
980
|
-
return this.q37_1.ou();
|
|
970
|
+
protoOf(ProbExplanationTerm).nu = function () {
|
|
971
|
+
return this.t37_1.nu();
|
|
981
972
|
};
|
|
982
973
|
protoOf(ProbExplanationTerm).pu = function () {
|
|
983
|
-
return this.
|
|
974
|
+
return this.t37_1.pu();
|
|
984
975
|
};
|
|
985
|
-
protoOf(ProbExplanationTerm).
|
|
986
|
-
return this.
|
|
976
|
+
protoOf(ProbExplanationTerm).au = function () {
|
|
977
|
+
return this.t37_1.au();
|
|
987
978
|
};
|
|
988
979
|
protoOf(ProbExplanationTerm).ru = function () {
|
|
989
|
-
return this.
|
|
980
|
+
return this.t37_1.ru();
|
|
981
|
+
};
|
|
982
|
+
protoOf(ProbExplanationTerm).su = function () {
|
|
983
|
+
return this.t37_1.su();
|
|
984
|
+
};
|
|
985
|
+
protoOf(ProbExplanationTerm).tu = function () {
|
|
986
|
+
return this.t37_1.tu();
|
|
987
|
+
};
|
|
988
|
+
protoOf(ProbExplanationTerm).uu = function () {
|
|
989
|
+
return this.t37_1.uu();
|
|
990
990
|
};
|
|
991
|
-
protoOf(ProbExplanationTerm).
|
|
992
|
-
return this.
|
|
991
|
+
protoOf(ProbExplanationTerm).hp = function () {
|
|
992
|
+
return this.uu();
|
|
993
993
|
};
|
|
994
|
-
protoOf(ProbExplanationTerm).
|
|
995
|
-
return this.
|
|
994
|
+
protoOf(ProbExplanationTerm).vu = function (other) {
|
|
995
|
+
return this.t37_1.vu(other);
|
|
996
996
|
};
|
|
997
997
|
protoOf(ProbExplanationTerm).d = function (other) {
|
|
998
|
-
return this.
|
|
998
|
+
return this.vu((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
|
|
999
999
|
};
|
|
1000
1000
|
protoOf(ProbExplanationTerm).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
1001
|
-
return this.
|
|
1001
|
+
return this.t37_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
1002
1002
|
};
|
|
1003
1003
|
protoOf(ProbExplanationTerm).equals = function (other) {
|
|
1004
|
-
return this.
|
|
1004
|
+
return this.t37_1.equals(other);
|
|
1005
1005
|
};
|
|
1006
1006
|
protoOf(ProbExplanationTerm).structurallyEquals = function (other) {
|
|
1007
|
-
return this.
|
|
1007
|
+
return this.t37_1.structurallyEquals(other);
|
|
1008
1008
|
};
|
|
1009
1009
|
protoOf(ProbExplanationTerm).accept = function (visitor) {
|
|
1010
|
-
return this.
|
|
1010
|
+
return this.t37_1.accept(visitor);
|
|
1011
1011
|
};
|
|
1012
1012
|
protoOf(ProbExplanationTerm).castToAtom = function () {
|
|
1013
|
-
return this.
|
|
1013
|
+
return this.t37_1.castToAtom();
|
|
1014
1014
|
};
|
|
1015
1015
|
protoOf(ProbExplanationTerm).castToClause = function () {
|
|
1016
|
-
return this.
|
|
1016
|
+
return this.t37_1.castToClause();
|
|
1017
1017
|
};
|
|
1018
1018
|
protoOf(ProbExplanationTerm).castToCons = function () {
|
|
1019
|
-
return this.
|
|
1019
|
+
return this.t37_1.castToCons();
|
|
1020
1020
|
};
|
|
1021
1021
|
protoOf(ProbExplanationTerm).castToConstant = function () {
|
|
1022
|
-
return this.
|
|
1022
|
+
return this.t37_1.castToConstant();
|
|
1023
1023
|
};
|
|
1024
1024
|
protoOf(ProbExplanationTerm).castToDirective = function () {
|
|
1025
|
-
return this.
|
|
1025
|
+
return this.t37_1.castToDirective();
|
|
1026
1026
|
};
|
|
1027
1027
|
protoOf(ProbExplanationTerm).castToEmptyList = function () {
|
|
1028
|
-
return this.
|
|
1028
|
+
return this.t37_1.castToEmptyList();
|
|
1029
1029
|
};
|
|
1030
1030
|
protoOf(ProbExplanationTerm).castToEmptyBlock = function () {
|
|
1031
|
-
return this.
|
|
1031
|
+
return this.t37_1.castToEmptyBlock();
|
|
1032
1032
|
};
|
|
1033
1033
|
protoOf(ProbExplanationTerm).castToFact = function () {
|
|
1034
|
-
return this.
|
|
1034
|
+
return this.t37_1.castToFact();
|
|
1035
1035
|
};
|
|
1036
1036
|
protoOf(ProbExplanationTerm).castToIndicator = function () {
|
|
1037
|
-
return this.
|
|
1037
|
+
return this.t37_1.castToIndicator();
|
|
1038
1038
|
};
|
|
1039
1039
|
protoOf(ProbExplanationTerm).castToInteger = function () {
|
|
1040
|
-
return this.
|
|
1040
|
+
return this.t37_1.castToInteger();
|
|
1041
1041
|
};
|
|
1042
1042
|
protoOf(ProbExplanationTerm).castToList = function () {
|
|
1043
|
-
return this.
|
|
1043
|
+
return this.t37_1.castToList();
|
|
1044
1044
|
};
|
|
1045
1045
|
protoOf(ProbExplanationTerm).castToNumeric = function () {
|
|
1046
|
-
return this.
|
|
1046
|
+
return this.t37_1.castToNumeric();
|
|
1047
1047
|
};
|
|
1048
1048
|
protoOf(ProbExplanationTerm).castToReal = function () {
|
|
1049
|
-
return this.
|
|
1049
|
+
return this.t37_1.castToReal();
|
|
1050
1050
|
};
|
|
1051
1051
|
protoOf(ProbExplanationTerm).castToRule = function () {
|
|
1052
|
-
return this.
|
|
1052
|
+
return this.t37_1.castToRule();
|
|
1053
1053
|
};
|
|
1054
1054
|
protoOf(ProbExplanationTerm).castToBlock = function () {
|
|
1055
|
-
return this.
|
|
1055
|
+
return this.t37_1.castToBlock();
|
|
1056
1056
|
};
|
|
1057
1057
|
protoOf(ProbExplanationTerm).castToStruct = function () {
|
|
1058
|
-
return this.
|
|
1058
|
+
return this.t37_1.castToStruct();
|
|
1059
1059
|
};
|
|
1060
1060
|
protoOf(ProbExplanationTerm).castToRecursive = function () {
|
|
1061
|
-
return this.
|
|
1061
|
+
return this.t37_1.castToRecursive();
|
|
1062
1062
|
};
|
|
1063
1063
|
protoOf(ProbExplanationTerm).castToTerm = function () {
|
|
1064
|
-
return this.
|
|
1064
|
+
return this.t37_1.castToTerm();
|
|
1065
1065
|
};
|
|
1066
1066
|
protoOf(ProbExplanationTerm).castToTruth = function () {
|
|
1067
|
-
return this.
|
|
1067
|
+
return this.t37_1.castToTruth();
|
|
1068
1068
|
};
|
|
1069
1069
|
protoOf(ProbExplanationTerm).castToTuple = function () {
|
|
1070
|
-
return this.
|
|
1070
|
+
return this.t37_1.castToTuple();
|
|
1071
1071
|
};
|
|
1072
1072
|
protoOf(ProbExplanationTerm).castToVar = function () {
|
|
1073
|
-
return this.
|
|
1073
|
+
return this.t37_1.castToVar();
|
|
1074
1074
|
};
|
|
1075
1075
|
protoOf(ProbExplanationTerm).asClause = function () {
|
|
1076
|
-
return this.
|
|
1076
|
+
return this.t37_1.asClause();
|
|
1077
1077
|
};
|
|
1078
1078
|
protoOf(ProbExplanationTerm).asCons = function () {
|
|
1079
|
-
return this.
|
|
1079
|
+
return this.t37_1.asCons();
|
|
1080
1080
|
};
|
|
1081
1081
|
protoOf(ProbExplanationTerm).asDirective = function () {
|
|
1082
|
-
return this.
|
|
1082
|
+
return this.t37_1.asDirective();
|
|
1083
1083
|
};
|
|
1084
1084
|
protoOf(ProbExplanationTerm).asEmptyList = function () {
|
|
1085
|
-
return this.
|
|
1085
|
+
return this.t37_1.asEmptyList();
|
|
1086
1086
|
};
|
|
1087
1087
|
protoOf(ProbExplanationTerm).asEmptyBlock = function () {
|
|
1088
|
-
return this.
|
|
1088
|
+
return this.t37_1.asEmptyBlock();
|
|
1089
1089
|
};
|
|
1090
1090
|
protoOf(ProbExplanationTerm).asFact = function () {
|
|
1091
|
-
return this.
|
|
1091
|
+
return this.t37_1.asFact();
|
|
1092
1092
|
};
|
|
1093
1093
|
protoOf(ProbExplanationTerm).asIndicator = function () {
|
|
1094
|
-
return this.
|
|
1094
|
+
return this.t37_1.asIndicator();
|
|
1095
1095
|
};
|
|
1096
1096
|
protoOf(ProbExplanationTerm).asInteger = function () {
|
|
1097
|
-
return this.
|
|
1097
|
+
return this.t37_1.asInteger();
|
|
1098
1098
|
};
|
|
1099
1099
|
protoOf(ProbExplanationTerm).asList = function () {
|
|
1100
|
-
return this.
|
|
1100
|
+
return this.t37_1.asList();
|
|
1101
1101
|
};
|
|
1102
1102
|
protoOf(ProbExplanationTerm).asNumeric = function () {
|
|
1103
|
-
return this.
|
|
1103
|
+
return this.t37_1.asNumeric();
|
|
1104
1104
|
};
|
|
1105
1105
|
protoOf(ProbExplanationTerm).asReal = function () {
|
|
1106
|
-
return this.
|
|
1106
|
+
return this.t37_1.asReal();
|
|
1107
1107
|
};
|
|
1108
1108
|
protoOf(ProbExplanationTerm).asRule = function () {
|
|
1109
|
-
return this.
|
|
1109
|
+
return this.t37_1.asRule();
|
|
1110
1110
|
};
|
|
1111
1111
|
protoOf(ProbExplanationTerm).asBlock = function () {
|
|
1112
|
-
return this.
|
|
1112
|
+
return this.t37_1.asBlock();
|
|
1113
1113
|
};
|
|
1114
1114
|
protoOf(ProbExplanationTerm).asRecursive = function () {
|
|
1115
|
-
return this.
|
|
1115
|
+
return this.t37_1.asRecursive();
|
|
1116
1116
|
};
|
|
1117
1117
|
protoOf(ProbExplanationTerm).asTerm = function () {
|
|
1118
|
-
return this.
|
|
1118
|
+
return this.t37_1.asTerm();
|
|
1119
1119
|
};
|
|
1120
1120
|
protoOf(ProbExplanationTerm).asTruth = function () {
|
|
1121
|
-
return this.
|
|
1121
|
+
return this.t37_1.asTruth();
|
|
1122
1122
|
};
|
|
1123
1123
|
protoOf(ProbExplanationTerm).asTuple = function () {
|
|
1124
|
-
return this.
|
|
1124
|
+
return this.t37_1.asTuple();
|
|
1125
1125
|
};
|
|
1126
1126
|
protoOf(ProbExplanationTerm).asVar = function () {
|
|
1127
|
-
return this.
|
|
1127
|
+
return this.t37_1.asVar();
|
|
1128
1128
|
};
|
|
1129
1129
|
protoOf(ProbExplanationTerm).hashCode = function () {
|
|
1130
|
-
return this.
|
|
1130
|
+
return this.t37_1.hashCode();
|
|
1131
1131
|
};
|
|
1132
1132
|
protoOf(ProbExplanationTerm).toString = function () {
|
|
1133
|
-
return this.
|
|
1134
|
-
};
|
|
1135
|
-
protoOf(ProbExplanationTerm).tu = function () {
|
|
1136
|
-
return this.q37_1.tu();
|
|
1137
|
-
};
|
|
1138
|
-
protoOf(ProbExplanationTerm).uu = function () {
|
|
1139
|
-
return this.q37_1.uu();
|
|
1133
|
+
return this.t37_1.toString();
|
|
1140
1134
|
};
|
|
1141
|
-
protoOf(ProbExplanationTerm).
|
|
1142
|
-
return this.
|
|
1135
|
+
protoOf(ProbExplanationTerm).wu = function () {
|
|
1136
|
+
return this.t37_1.wu();
|
|
1143
1137
|
};
|
|
1144
1138
|
protoOf(ProbExplanationTerm).xu = function () {
|
|
1145
|
-
return this.
|
|
1139
|
+
return this.t37_1.xu();
|
|
1146
1140
|
};
|
|
1147
1141
|
protoOf(ProbExplanationTerm).yu = function () {
|
|
1148
|
-
return this.
|
|
1142
|
+
return this.t37_1.yu();
|
|
1149
1143
|
};
|
|
1150
|
-
protoOf(ProbExplanationTerm).
|
|
1151
|
-
return this.
|
|
1144
|
+
protoOf(ProbExplanationTerm).av = function () {
|
|
1145
|
+
return this.t37_1.av();
|
|
1146
|
+
};
|
|
1147
|
+
protoOf(ProbExplanationTerm).bv = function () {
|
|
1148
|
+
return this.t37_1.bv();
|
|
1149
|
+
};
|
|
1150
|
+
protoOf(ProbExplanationTerm).cv = function () {
|
|
1151
|
+
return this.t37_1.cv();
|
|
1152
1152
|
};
|
|
1153
1153
|
protoOf(ProbExplanationTerm).getTag = function (name) {
|
|
1154
|
-
return this.
|
|
1154
|
+
return this.t37_1.getTag(name);
|
|
1155
1155
|
};
|
|
1156
1156
|
protoOf(ProbExplanationTerm).resetTags = function (tags) {
|
|
1157
|
-
return this.
|
|
1157
|
+
return this.t37_1.resetTags(tags);
|
|
1158
1158
|
};
|
|
1159
1159
|
protoOf(ProbExplanationTerm).containsTag = function (name) {
|
|
1160
|
-
return this.
|
|
1160
|
+
return this.t37_1.containsTag(name);
|
|
1161
1161
|
};
|
|
1162
|
-
protoOf(ProbExplanationTerm).
|
|
1163
|
-
return this.
|
|
1162
|
+
protoOf(ProbExplanationTerm).pr = function () {
|
|
1163
|
+
return this.t37_1.pr();
|
|
1164
1164
|
};
|
|
1165
1165
|
function _get_cachedHashCode__d7x0zy($this) {
|
|
1166
|
-
var tmp0 = $this.
|
|
1166
|
+
var tmp0 = $this.i39_1;
|
|
1167
1167
|
var tmp = KProperty1;
|
|
1168
1168
|
// Inline function 'kotlin.getValue' call
|
|
1169
1169
|
getPropertyCallableRef('cachedHashCode', 1, tmp, ProbTerm$_get_cachedHashCode_$ref_1qdqtc(), null);
|
|
1170
|
-
return tmp0.
|
|
1170
|
+
return tmp0.f2();
|
|
1171
1171
|
}
|
|
1172
1172
|
function ProbTerm$isGround$delegate$lambda(this$0) {
|
|
1173
1173
|
return function () {
|
|
1174
1174
|
var tmp;
|
|
1175
|
-
if (this$0.
|
|
1176
|
-
var tmp0 = this$0.
|
|
1175
|
+
if (this$0.f39_1.ev()) {
|
|
1176
|
+
var tmp0 = this$0.g39_1;
|
|
1177
1177
|
var tmp$ret$0;
|
|
1178
1178
|
$l$block_0: {
|
|
1179
1179
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -1190,7 +1190,7 @@
|
|
|
1190
1190
|
var _iterator__ex2g4s = tmp0.n();
|
|
1191
1191
|
while (_iterator__ex2g4s.q()) {
|
|
1192
1192
|
var element = _iterator__ex2g4s.r();
|
|
1193
|
-
if (element.
|
|
1193
|
+
if (element.wu()) {
|
|
1194
1194
|
tmp$ret$0 = true;
|
|
1195
1195
|
break $l$block_0;
|
|
1196
1196
|
}
|
|
@@ -1206,15 +1206,15 @@
|
|
|
1206
1206
|
}
|
|
1207
1207
|
function ProbTerm$_get_isGround_$ref_ue0rck() {
|
|
1208
1208
|
return constructCallableReference(function (p0) {
|
|
1209
|
-
return p0.
|
|
1209
|
+
return p0.ev();
|
|
1210
1210
|
}, 1, 0, 89);
|
|
1211
1211
|
}
|
|
1212
1212
|
function ProbTerm$cachedHashCode$delegate$lambda(this$0) {
|
|
1213
1213
|
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.
|
|
1214
|
+
var result = getBigIntHashCode(this$0.d39_1);
|
|
1215
|
+
result = imul(31, result) + getNumberHashCode(this$0.e39_1) | 0;
|
|
1216
|
+
result = imul(31, result) + this$0.f39_1.hashCode() | 0;
|
|
1217
|
+
result = imul(31, result) + hashCode(this$0.g39_1) | 0;
|
|
1218
1218
|
return result;
|
|
1219
1219
|
};
|
|
1220
1220
|
}
|
|
@@ -1225,20 +1225,20 @@
|
|
|
1225
1225
|
}
|
|
1226
1226
|
function ProbTerm(id, probability, term, extraVariables) {
|
|
1227
1227
|
extraVariables = extraVariables === VOID ? emptySet() : extraVariables;
|
|
1228
|
-
this.
|
|
1229
|
-
this.
|
|
1230
|
-
this.
|
|
1231
|
-
this.
|
|
1232
|
-
this.
|
|
1228
|
+
this.c39_1 = Companion_getInstance_1().of('::', [Companion_getInstance_6().ofDouble(probability), term]);
|
|
1229
|
+
this.d39_1 = id;
|
|
1230
|
+
this.e39_1 = probability;
|
|
1231
|
+
this.f39_1 = term;
|
|
1232
|
+
this.g39_1 = extraVariables;
|
|
1233
1233
|
var tmp = this;
|
|
1234
|
-
tmp.
|
|
1234
|
+
tmp.h39_1 = lazy(ProbTerm$isGround$delegate$lambda(this));
|
|
1235
1235
|
var tmp_0 = this;
|
|
1236
|
-
tmp_0.
|
|
1236
|
+
tmp_0.i39_1 = lazy(ProbTerm$cachedHashCode$delegate$lambda(this));
|
|
1237
1237
|
}
|
|
1238
|
-
protoOf(ProbTerm).
|
|
1239
|
-
var termCopy = this.
|
|
1238
|
+
protoOf(ProbTerm).du = function () {
|
|
1239
|
+
var termCopy = this.f39_1.freshCopy();
|
|
1240
1240
|
// Inline function 'kotlin.collections.map' call
|
|
1241
|
-
var this_0 = this.
|
|
1241
|
+
var this_0 = this.g39_1;
|
|
1242
1242
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1243
1243
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1244
1244
|
var _iterator__ex2g4s = this_0.n();
|
|
@@ -1247,15 +1247,15 @@
|
|
|
1247
1247
|
var tmp$ret$2 = item.freshCopy();
|
|
1248
1248
|
destination.l(tmp$ret$2);
|
|
1249
1249
|
}
|
|
1250
|
-
return new ProbTerm(this.
|
|
1250
|
+
return new ProbTerm(this.d39_1, this.e39_1, termCopy, toSet(destination));
|
|
1251
1251
|
};
|
|
1252
1252
|
protoOf(ProbTerm).freshCopy = function () {
|
|
1253
|
-
return this.
|
|
1253
|
+
return this.du();
|
|
1254
1254
|
};
|
|
1255
|
-
protoOf(ProbTerm).
|
|
1256
|
-
var termCopy = this.
|
|
1255
|
+
protoOf(ProbTerm).eu = function (scope) {
|
|
1256
|
+
var termCopy = this.f39_1.freshCopyFromScope(scope);
|
|
1257
1257
|
// Inline function 'kotlin.collections.map' call
|
|
1258
|
-
var this_0 = this.
|
|
1258
|
+
var this_0 = this.g39_1;
|
|
1259
1259
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1260
1260
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1261
1261
|
var _iterator__ex2g4s = this_0.n();
|
|
@@ -1264,30 +1264,30 @@
|
|
|
1264
1264
|
var tmp$ret$2 = item.freshCopyFromScope(scope);
|
|
1265
1265
|
destination.l(tmp$ret$2);
|
|
1266
1266
|
}
|
|
1267
|
-
return new ProbTerm(this.
|
|
1267
|
+
return new ProbTerm(this.d39_1, this.e39_1, termCopy, toSet(destination));
|
|
1268
1268
|
};
|
|
1269
1269
|
protoOf(ProbTerm).freshCopyFromScope = function (scope) {
|
|
1270
|
-
return this.
|
|
1270
|
+
return this.eu(scope);
|
|
1271
1271
|
};
|
|
1272
|
-
protoOf(ProbTerm).
|
|
1273
|
-
return this.
|
|
1272
|
+
protoOf(ProbTerm).q2l = function (substitution, substitutions) {
|
|
1273
|
+
return this.r2l(substitution, substitutions.slice());
|
|
1274
1274
|
};
|
|
1275
1275
|
protoOf(ProbTerm).getSubstituted = function (substitution, substitutions) {
|
|
1276
|
-
return this.
|
|
1276
|
+
return this.q2l(substitution, substitutions);
|
|
1277
1277
|
};
|
|
1278
|
-
protoOf(ProbTerm).
|
|
1279
|
-
return this.
|
|
1278
|
+
protoOf(ProbTerm).r2l = function (substitution, substitutions) {
|
|
1279
|
+
return this.s14(Companion_getInstance_5().ofSubstitution(substitution, substitutions.slice()));
|
|
1280
1280
|
};
|
|
1281
1281
|
protoOf(ProbTerm).apply = function (substitution, substitutions) {
|
|
1282
|
-
return this.
|
|
1282
|
+
return this.r2l(substitution, substitutions);
|
|
1283
1283
|
};
|
|
1284
|
-
protoOf(ProbTerm).
|
|
1284
|
+
protoOf(ProbTerm).s14 = function (substitution) {
|
|
1285
1285
|
var tmp;
|
|
1286
|
-
if (substitution.h() || this.
|
|
1286
|
+
if (substitution.h() || this.ev()) {
|
|
1287
1287
|
tmp = this;
|
|
1288
1288
|
} else {
|
|
1289
1289
|
var tmp_0;
|
|
1290
|
-
var tmp0 = this.
|
|
1290
|
+
var tmp0 = this.g39_1;
|
|
1291
1291
|
var tmp$ret$0;
|
|
1292
1292
|
$l$block_0: {
|
|
1293
1293
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -1304,7 +1304,7 @@
|
|
|
1304
1304
|
var _iterator__ex2g4s = tmp0.n();
|
|
1305
1305
|
while (_iterator__ex2g4s.q()) {
|
|
1306
1306
|
var element = _iterator__ex2g4s.r();
|
|
1307
|
-
if (element.
|
|
1307
|
+
if (element.wu()) {
|
|
1308
1308
|
tmp$ret$0 = true;
|
|
1309
1309
|
break $l$block_0;
|
|
1310
1310
|
}
|
|
@@ -1312,10 +1312,10 @@
|
|
|
1312
1312
|
tmp$ret$0 = false;
|
|
1313
1313
|
}
|
|
1314
1314
|
if (!tmp$ret$0) {
|
|
1315
|
-
tmp_0 = this.
|
|
1315
|
+
tmp_0 = this.g39_1;
|
|
1316
1316
|
} else {
|
|
1317
1317
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
1318
|
-
var tmp0_0 = this.
|
|
1318
|
+
var tmp0_0 = this.g39_1;
|
|
1319
1319
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
1320
1320
|
var destination = ArrayList_init_$Create$_0();
|
|
1321
1321
|
// Inline function 'kotlin.collections.forEach' call
|
|
@@ -1333,43 +1333,43 @@
|
|
|
1333
1333
|
tmp_0 = toSet(destination);
|
|
1334
1334
|
}
|
|
1335
1335
|
var newExtraVars = tmp_0;
|
|
1336
|
-
tmp = new ProbTerm(this.
|
|
1336
|
+
tmp = new ProbTerm(this.d39_1, this.e39_1, this.f39_1.applySubstitution(substitution), newExtraVars);
|
|
1337
1337
|
}
|
|
1338
1338
|
return tmp;
|
|
1339
1339
|
};
|
|
1340
1340
|
protoOf(ProbTerm).applySubstitution = function (substitution) {
|
|
1341
|
-
return this.
|
|
1341
|
+
return this.s14(substitution);
|
|
1342
1342
|
};
|
|
1343
|
-
protoOf(ProbTerm).
|
|
1344
|
-
var tmp0 = this.
|
|
1343
|
+
protoOf(ProbTerm).ev = function () {
|
|
1344
|
+
var tmp0 = this.h39_1;
|
|
1345
1345
|
var tmp = KProperty1;
|
|
1346
1346
|
// Inline function 'kotlin.getValue' call
|
|
1347
1347
|
getPropertyCallableRef('isGround', 1, tmp, ProbTerm$_get_isGround_$ref_ue0rck(), null);
|
|
1348
|
-
return tmp0.
|
|
1348
|
+
return tmp0.f2();
|
|
1349
1349
|
};
|
|
1350
|
-
protoOf(ProbTerm).
|
|
1350
|
+
protoOf(ProbTerm).vu = function (other) {
|
|
1351
1351
|
if (!(other instanceof ProbTerm)) {
|
|
1352
1352
|
return compareTo.call(this, other);
|
|
1353
1353
|
}
|
|
1354
|
-
var res = compareTo_0(this.
|
|
1354
|
+
var res = compareTo_0(this.d39_1, other.d39_1);
|
|
1355
1355
|
if (!(res === 0))
|
|
1356
1356
|
return res;
|
|
1357
|
-
res = this.
|
|
1357
|
+
res = this.f39_1.vu(other.f39_1);
|
|
1358
1358
|
if (!(res === 0))
|
|
1359
1359
|
return res;
|
|
1360
|
-
res = equals(this.
|
|
1360
|
+
res = equals(this.g39_1, other.g39_1) ? 0 : -1;
|
|
1361
1361
|
if (!(res === 0))
|
|
1362
1362
|
return res;
|
|
1363
|
-
res = compareTo_0(this.
|
|
1363
|
+
res = compareTo_0(this.e39_1, other.e39_1);
|
|
1364
1364
|
return res;
|
|
1365
1365
|
};
|
|
1366
1366
|
protoOf(ProbTerm).d = function (other) {
|
|
1367
|
-
return this.
|
|
1367
|
+
return this.vu((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
|
|
1368
1368
|
};
|
|
1369
1369
|
protoOf(ProbTerm).equals = function (other) {
|
|
1370
1370
|
var tmp;
|
|
1371
1371
|
if (other instanceof ProbTerm) {
|
|
1372
|
-
tmp = this.
|
|
1372
|
+
tmp = this.vu(other) === 0;
|
|
1373
1373
|
} else {
|
|
1374
1374
|
tmp = false;
|
|
1375
1375
|
}
|
|
@@ -1379,214 +1379,214 @@
|
|
|
1379
1379
|
return _get_cachedHashCode__d7x0zy(this);
|
|
1380
1380
|
};
|
|
1381
1381
|
protoOf(ProbTerm).toString = function () {
|
|
1382
|
-
return '' + round(this.
|
|
1382
|
+
return '' + round(this.e39_1 * 100) / 100.0 + '::' + this.f39_1.toString();
|
|
1383
1383
|
};
|
|
1384
|
-
protoOf(ProbTerm).
|
|
1385
|
-
return this.
|
|
1384
|
+
protoOf(ProbTerm).uu = function () {
|
|
1385
|
+
return this.c39_1.uu();
|
|
1386
1386
|
};
|
|
1387
|
-
protoOf(ProbTerm).
|
|
1388
|
-
return this.
|
|
1387
|
+
protoOf(ProbTerm).hp = function () {
|
|
1388
|
+
return this.uu();
|
|
1389
1389
|
};
|
|
1390
1390
|
protoOf(ProbTerm).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
1391
|
-
return this.
|
|
1391
|
+
return this.c39_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
1392
1392
|
};
|
|
1393
1393
|
protoOf(ProbTerm).structurallyEquals = function (other) {
|
|
1394
|
-
return this.
|
|
1394
|
+
return this.c39_1.structurallyEquals(other);
|
|
1395
1395
|
};
|
|
1396
1396
|
protoOf(ProbTerm).accept = function (visitor) {
|
|
1397
|
-
return this.
|
|
1397
|
+
return this.c39_1.accept(visitor);
|
|
1398
1398
|
};
|
|
1399
1399
|
protoOf(ProbTerm).castToAtom = function () {
|
|
1400
|
-
return this.
|
|
1400
|
+
return this.c39_1.castToAtom();
|
|
1401
1401
|
};
|
|
1402
1402
|
protoOf(ProbTerm).castToClause = function () {
|
|
1403
|
-
return this.
|
|
1403
|
+
return this.c39_1.castToClause();
|
|
1404
1404
|
};
|
|
1405
1405
|
protoOf(ProbTerm).castToCons = function () {
|
|
1406
|
-
return this.
|
|
1406
|
+
return this.c39_1.castToCons();
|
|
1407
1407
|
};
|
|
1408
1408
|
protoOf(ProbTerm).castToConstant = function () {
|
|
1409
|
-
return this.
|
|
1409
|
+
return this.c39_1.castToConstant();
|
|
1410
1410
|
};
|
|
1411
1411
|
protoOf(ProbTerm).castToDirective = function () {
|
|
1412
|
-
return this.
|
|
1412
|
+
return this.c39_1.castToDirective();
|
|
1413
1413
|
};
|
|
1414
1414
|
protoOf(ProbTerm).castToEmptyList = function () {
|
|
1415
|
-
return this.
|
|
1415
|
+
return this.c39_1.castToEmptyList();
|
|
1416
1416
|
};
|
|
1417
1417
|
protoOf(ProbTerm).castToEmptyBlock = function () {
|
|
1418
|
-
return this.
|
|
1418
|
+
return this.c39_1.castToEmptyBlock();
|
|
1419
1419
|
};
|
|
1420
1420
|
protoOf(ProbTerm).castToFact = function () {
|
|
1421
|
-
return this.
|
|
1421
|
+
return this.c39_1.castToFact();
|
|
1422
1422
|
};
|
|
1423
1423
|
protoOf(ProbTerm).castToIndicator = function () {
|
|
1424
|
-
return this.
|
|
1424
|
+
return this.c39_1.castToIndicator();
|
|
1425
1425
|
};
|
|
1426
1426
|
protoOf(ProbTerm).castToInteger = function () {
|
|
1427
|
-
return this.
|
|
1427
|
+
return this.c39_1.castToInteger();
|
|
1428
1428
|
};
|
|
1429
1429
|
protoOf(ProbTerm).castToList = function () {
|
|
1430
|
-
return this.
|
|
1430
|
+
return this.c39_1.castToList();
|
|
1431
1431
|
};
|
|
1432
1432
|
protoOf(ProbTerm).castToNumeric = function () {
|
|
1433
|
-
return this.
|
|
1433
|
+
return this.c39_1.castToNumeric();
|
|
1434
1434
|
};
|
|
1435
1435
|
protoOf(ProbTerm).castToReal = function () {
|
|
1436
|
-
return this.
|
|
1436
|
+
return this.c39_1.castToReal();
|
|
1437
1437
|
};
|
|
1438
1438
|
protoOf(ProbTerm).castToRule = function () {
|
|
1439
|
-
return this.
|
|
1439
|
+
return this.c39_1.castToRule();
|
|
1440
1440
|
};
|
|
1441
1441
|
protoOf(ProbTerm).castToBlock = function () {
|
|
1442
|
-
return this.
|
|
1442
|
+
return this.c39_1.castToBlock();
|
|
1443
1443
|
};
|
|
1444
1444
|
protoOf(ProbTerm).castToStruct = function () {
|
|
1445
|
-
return this.
|
|
1445
|
+
return this.c39_1.castToStruct();
|
|
1446
1446
|
};
|
|
1447
1447
|
protoOf(ProbTerm).castToRecursive = function () {
|
|
1448
|
-
return this.
|
|
1448
|
+
return this.c39_1.castToRecursive();
|
|
1449
1449
|
};
|
|
1450
1450
|
protoOf(ProbTerm).castToTerm = function () {
|
|
1451
|
-
return this.
|
|
1451
|
+
return this.c39_1.castToTerm();
|
|
1452
1452
|
};
|
|
1453
1453
|
protoOf(ProbTerm).castToTruth = function () {
|
|
1454
|
-
return this.
|
|
1454
|
+
return this.c39_1.castToTruth();
|
|
1455
1455
|
};
|
|
1456
1456
|
protoOf(ProbTerm).castToTuple = function () {
|
|
1457
|
-
return this.
|
|
1457
|
+
return this.c39_1.castToTuple();
|
|
1458
1458
|
};
|
|
1459
1459
|
protoOf(ProbTerm).castToVar = function () {
|
|
1460
|
-
return this.
|
|
1460
|
+
return this.c39_1.castToVar();
|
|
1461
1461
|
};
|
|
1462
1462
|
protoOf(ProbTerm).asAtom = function () {
|
|
1463
|
-
return this.
|
|
1463
|
+
return this.c39_1.asAtom();
|
|
1464
1464
|
};
|
|
1465
1465
|
protoOf(ProbTerm).asClause = function () {
|
|
1466
|
-
return this.
|
|
1466
|
+
return this.c39_1.asClause();
|
|
1467
1467
|
};
|
|
1468
1468
|
protoOf(ProbTerm).asCons = function () {
|
|
1469
|
-
return this.
|
|
1469
|
+
return this.c39_1.asCons();
|
|
1470
1470
|
};
|
|
1471
1471
|
protoOf(ProbTerm).asConstant = function () {
|
|
1472
|
-
return this.
|
|
1472
|
+
return this.c39_1.asConstant();
|
|
1473
1473
|
};
|
|
1474
1474
|
protoOf(ProbTerm).asDirective = function () {
|
|
1475
|
-
return this.
|
|
1475
|
+
return this.c39_1.asDirective();
|
|
1476
1476
|
};
|
|
1477
1477
|
protoOf(ProbTerm).asEmptyList = function () {
|
|
1478
|
-
return this.
|
|
1478
|
+
return this.c39_1.asEmptyList();
|
|
1479
1479
|
};
|
|
1480
1480
|
protoOf(ProbTerm).asEmptyBlock = function () {
|
|
1481
|
-
return this.
|
|
1481
|
+
return this.c39_1.asEmptyBlock();
|
|
1482
1482
|
};
|
|
1483
1483
|
protoOf(ProbTerm).asFact = function () {
|
|
1484
|
-
return this.
|
|
1484
|
+
return this.c39_1.asFact();
|
|
1485
1485
|
};
|
|
1486
1486
|
protoOf(ProbTerm).asIndicator = function () {
|
|
1487
|
-
return this.
|
|
1487
|
+
return this.c39_1.asIndicator();
|
|
1488
1488
|
};
|
|
1489
1489
|
protoOf(ProbTerm).asInteger = function () {
|
|
1490
|
-
return this.
|
|
1490
|
+
return this.c39_1.asInteger();
|
|
1491
1491
|
};
|
|
1492
1492
|
protoOf(ProbTerm).asList = function () {
|
|
1493
|
-
return this.
|
|
1493
|
+
return this.c39_1.asList();
|
|
1494
1494
|
};
|
|
1495
1495
|
protoOf(ProbTerm).asNumeric = function () {
|
|
1496
|
-
return this.
|
|
1496
|
+
return this.c39_1.asNumeric();
|
|
1497
1497
|
};
|
|
1498
1498
|
protoOf(ProbTerm).asReal = function () {
|
|
1499
|
-
return this.
|
|
1499
|
+
return this.c39_1.asReal();
|
|
1500
1500
|
};
|
|
1501
1501
|
protoOf(ProbTerm).asRule = function () {
|
|
1502
|
-
return this.
|
|
1502
|
+
return this.c39_1.asRule();
|
|
1503
1503
|
};
|
|
1504
1504
|
protoOf(ProbTerm).asBlock = function () {
|
|
1505
|
-
return this.
|
|
1505
|
+
return this.c39_1.asBlock();
|
|
1506
1506
|
};
|
|
1507
1507
|
protoOf(ProbTerm).asStruct = function () {
|
|
1508
|
-
return this.
|
|
1508
|
+
return this.c39_1.qu();
|
|
1509
1509
|
};
|
|
1510
1510
|
protoOf(ProbTerm).asRecursive = function () {
|
|
1511
|
-
return this.
|
|
1511
|
+
return this.c39_1.asRecursive();
|
|
1512
1512
|
};
|
|
1513
1513
|
protoOf(ProbTerm).asTerm = function () {
|
|
1514
|
-
return this.
|
|
1514
|
+
return this.c39_1.asTerm();
|
|
1515
1515
|
};
|
|
1516
1516
|
protoOf(ProbTerm).asTruth = function () {
|
|
1517
|
-
return this.
|
|
1517
|
+
return this.c39_1.asTruth();
|
|
1518
1518
|
};
|
|
1519
1519
|
protoOf(ProbTerm).asTuple = function () {
|
|
1520
|
-
return this.
|
|
1520
|
+
return this.c39_1.asTuple();
|
|
1521
1521
|
};
|
|
1522
1522
|
protoOf(ProbTerm).asVar = function () {
|
|
1523
|
-
return this.
|
|
1523
|
+
return this.c39_1.asVar();
|
|
1524
1524
|
};
|
|
1525
|
-
protoOf(ProbTerm).
|
|
1526
|
-
return this.
|
|
1525
|
+
protoOf(ProbTerm).wu = function () {
|
|
1526
|
+
return this.c39_1.wu();
|
|
1527
1527
|
};
|
|
1528
|
-
protoOf(ProbTerm).
|
|
1529
|
-
return this.
|
|
1528
|
+
protoOf(ProbTerm).gu = function () {
|
|
1529
|
+
return this.c39_1.gu();
|
|
1530
1530
|
};
|
|
1531
|
-
protoOf(ProbTerm).
|
|
1532
|
-
return this.
|
|
1531
|
+
protoOf(ProbTerm).xu = function () {
|
|
1532
|
+
return this.c39_1.xu();
|
|
1533
1533
|
};
|
|
1534
|
-
protoOf(ProbTerm).
|
|
1535
|
-
return this.
|
|
1534
|
+
protoOf(ProbTerm).yu = function () {
|
|
1535
|
+
return this.c39_1.yu();
|
|
1536
1536
|
};
|
|
1537
|
-
protoOf(ProbTerm).
|
|
1538
|
-
return this.
|
|
1537
|
+
protoOf(ProbTerm).vt = function () {
|
|
1538
|
+
return this.c39_1.vt();
|
|
1539
1539
|
};
|
|
1540
|
-
protoOf(ProbTerm).
|
|
1541
|
-
return this.
|
|
1540
|
+
protoOf(ProbTerm).zu = function () {
|
|
1541
|
+
return this.c39_1.zu();
|
|
1542
1542
|
};
|
|
1543
|
-
protoOf(ProbTerm).
|
|
1544
|
-
return this.
|
|
1543
|
+
protoOf(ProbTerm).av = function () {
|
|
1544
|
+
return this.c39_1.av();
|
|
1545
1545
|
};
|
|
1546
|
-
protoOf(ProbTerm).
|
|
1547
|
-
return this.
|
|
1546
|
+
protoOf(ProbTerm).bv = function () {
|
|
1547
|
+
return this.c39_1.bv();
|
|
1548
1548
|
};
|
|
1549
|
-
protoOf(ProbTerm).
|
|
1550
|
-
return this.
|
|
1549
|
+
protoOf(ProbTerm).cv = function () {
|
|
1550
|
+
return this.c39_1.cv();
|
|
1551
1551
|
};
|
|
1552
|
-
protoOf(ProbTerm).
|
|
1553
|
-
return this.
|
|
1552
|
+
protoOf(ProbTerm).mu = function () {
|
|
1553
|
+
return this.c39_1.mu();
|
|
1554
1554
|
};
|
|
1555
|
-
protoOf(ProbTerm).
|
|
1556
|
-
return this.
|
|
1555
|
+
protoOf(ProbTerm).lu = function () {
|
|
1556
|
+
return this.c39_1.lu();
|
|
1557
1557
|
};
|
|
1558
|
-
protoOf(ProbTerm).
|
|
1559
|
-
return this.
|
|
1558
|
+
protoOf(ProbTerm).wt = function () {
|
|
1559
|
+
return this.c39_1.wt();
|
|
1560
1560
|
};
|
|
1561
|
-
protoOf(ProbTerm).
|
|
1562
|
-
return this.
|
|
1561
|
+
protoOf(ProbTerm).hu = function () {
|
|
1562
|
+
return this.c39_1.hu();
|
|
1563
1563
|
};
|
|
1564
|
-
protoOf(ProbTerm).
|
|
1565
|
-
return this.
|
|
1564
|
+
protoOf(ProbTerm).nu = function () {
|
|
1565
|
+
return this.c39_1.nu();
|
|
1566
1566
|
};
|
|
1567
|
-
protoOf(ProbTerm).
|
|
1568
|
-
return this.
|
|
1567
|
+
protoOf(ProbTerm).xt = function () {
|
|
1568
|
+
return this.c39_1.xt();
|
|
1569
1569
|
};
|
|
1570
|
-
protoOf(ProbTerm).
|
|
1571
|
-
return this.
|
|
1570
|
+
protoOf(ProbTerm).yt = function () {
|
|
1571
|
+
return this.c39_1.yt();
|
|
1572
1572
|
};
|
|
1573
|
-
protoOf(ProbTerm).
|
|
1574
|
-
return this.
|
|
1573
|
+
protoOf(ProbTerm).pu = function () {
|
|
1574
|
+
return this.c39_1.pu();
|
|
1575
1575
|
};
|
|
1576
1576
|
protoOf(ProbTerm).getTag = function (name) {
|
|
1577
|
-
return this.
|
|
1577
|
+
return this.c39_1.getTag(name);
|
|
1578
1578
|
};
|
|
1579
1579
|
protoOf(ProbTerm).resetTags = function (tags) {
|
|
1580
|
-
return this.
|
|
1580
|
+
return this.c39_1.resetTags(tags);
|
|
1581
1581
|
};
|
|
1582
1582
|
protoOf(ProbTerm).containsTag = function (name) {
|
|
1583
|
-
return this.
|
|
1583
|
+
return this.c39_1.containsTag(name);
|
|
1584
1584
|
};
|
|
1585
|
-
protoOf(ProbTerm).
|
|
1586
|
-
return this.
|
|
1585
|
+
protoOf(ProbTerm).pr = function () {
|
|
1586
|
+
return this.c39_1.pr();
|
|
1587
1587
|
};
|
|
1588
|
-
protoOf(ProbTerm).
|
|
1589
|
-
return this.
|
|
1588
|
+
protoOf(ProbTerm).cu = function () {
|
|
1589
|
+
return this.c39_1.cu();
|
|
1590
1590
|
};
|
|
1591
1591
|
function Companion_1() {
|
|
1592
1592
|
}
|
|
@@ -1631,25 +1631,25 @@
|
|
|
1631
1631
|
function collectAllHeads($this, head, accumulator) {
|
|
1632
1632
|
var tmp;
|
|
1633
1633
|
if (isInterface(head, Struct)) {
|
|
1634
|
-
tmp = head.
|
|
1634
|
+
tmp = head.ut() === 2;
|
|
1635
1635
|
} else {
|
|
1636
1636
|
tmp = false;
|
|
1637
1637
|
}
|
|
1638
1638
|
if (tmp) {
|
|
1639
|
-
if (!(head.
|
|
1639
|
+
if (!(head.au() === ';') && !(head.au() === '::')) {
|
|
1640
1640
|
throw TuPrologException_init_$Create$('Badly formatted disjoint annotation: ' + head.toString());
|
|
1641
1641
|
}
|
|
1642
|
-
if (head.
|
|
1642
|
+
if (head.au() === ';') {
|
|
1643
1643
|
collectAllHeads($this, head.get(1), accumulator);
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
1646
|
var curHeadProb = 1.0;
|
|
1647
1647
|
var curHead = head;
|
|
1648
1648
|
if (isInterface(head, Struct)) {
|
|
1649
|
-
curHead = head.
|
|
1649
|
+
curHead = head.au() === ';' ? head.get(0) : head;
|
|
1650
1650
|
var tmp_0;
|
|
1651
1651
|
if (isInterface(curHead, Struct)) {
|
|
1652
|
-
tmp_0 = curHead.
|
|
1652
|
+
tmp_0 = curHead.au() === '::';
|
|
1653
1653
|
} else {
|
|
1654
1654
|
tmp_0 = false;
|
|
1655
1655
|
}
|
|
@@ -1657,7 +1657,7 @@
|
|
|
1657
1657
|
var curHeadProbTerm = curHead.get(0);
|
|
1658
1658
|
var tmp_1;
|
|
1659
1659
|
if (isInterface(curHeadProbTerm, Numeric)) {
|
|
1660
|
-
tmp_1 = curHeadProbTerm.
|
|
1660
|
+
tmp_1 = curHeadProbTerm.qy().toDouble();
|
|
1661
1661
|
} else {
|
|
1662
1662
|
tmp_1 = solveArithmeticExpression(curHeadProbTerm);
|
|
1663
1663
|
}
|
|
@@ -1669,23 +1669,23 @@
|
|
|
1669
1669
|
}
|
|
1670
1670
|
function AnnotatedDisjunctionClauseMapper() {
|
|
1671
1671
|
}
|
|
1672
|
-
protoOf(AnnotatedDisjunctionClauseMapper).
|
|
1672
|
+
protoOf(AnnotatedDisjunctionClauseMapper).m39 = function (clause) {
|
|
1673
1673
|
var tmp;
|
|
1674
1674
|
if (isInterface(clause, Rule)) {
|
|
1675
|
-
tmp = clause.
|
|
1675
|
+
tmp = clause.gw().au() === ';';
|
|
1676
1676
|
} else {
|
|
1677
1677
|
tmp = false;
|
|
1678
1678
|
}
|
|
1679
1679
|
return tmp;
|
|
1680
1680
|
};
|
|
1681
|
-
protoOf(AnnotatedDisjunctionClauseMapper).
|
|
1681
|
+
protoOf(AnnotatedDisjunctionClauseMapper).n39 = function (clause) {
|
|
1682
1682
|
if (!isInterface(clause, Rule)) {
|
|
1683
1683
|
throw new ClauseMappingException('Clause is not an instance of Rule: ' + clause.toString());
|
|
1684
1684
|
}
|
|
1685
|
-
var body = clause.
|
|
1685
|
+
var body = clause.hw();
|
|
1686
1686
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
1687
1687
|
var disjointHeads = ArrayList_init_$Create$_0();
|
|
1688
|
-
collectAllHeads(this, clause.
|
|
1688
|
+
collectAllHeads(this, clause.gw(), disjointHeads);
|
|
1689
1689
|
var probSum = 0.0;
|
|
1690
1690
|
// Inline function 'kotlin.collections.map' call
|
|
1691
1691
|
// Inline function 'kotlin.collections.mapTo' call
|
|
@@ -1694,7 +1694,7 @@
|
|
|
1694
1694
|
while (_iterator__ex2g4s.q()) {
|
|
1695
1695
|
var item = _iterator__ex2g4s.r();
|
|
1696
1696
|
var tmp = item.get(0);
|
|
1697
|
-
var curProb = (isInterface(tmp, Numeric) ? tmp : THROW_CCE()).
|
|
1697
|
+
var curProb = (isInterface(tmp, Numeric) ? tmp : THROW_CCE()).qy().toDouble();
|
|
1698
1698
|
var tmp_0;
|
|
1699
1699
|
var tmp_1 = item.get(1);
|
|
1700
1700
|
if (isInterface(tmp_1, Struct)) {
|
|
@@ -1705,21 +1705,21 @@
|
|
|
1705
1705
|
}
|
|
1706
1706
|
var curRuleHead = tmp_0;
|
|
1707
1707
|
probSum = probSum + curProb;
|
|
1708
|
-
var tmp$ret$3 = ProbabilisticClauseMapper_instance.
|
|
1708
|
+
var tmp$ret$3 = ProbabilisticClauseMapper_instance.o39(Companion_instance_3.of(Companion_getInstance_1().of('::', [Companion_getInstance_6().ofDouble(curProb / (1.0 - (probSum - curProb))), curRuleHead]), [body]));
|
|
1709
1709
|
destination.l(tmp$ret$3);
|
|
1710
1710
|
}
|
|
1711
1711
|
var mappedRules = toList_0(destination);
|
|
1712
|
-
var explanation = Companion_getInstance_11().
|
|
1712
|
+
var explanation = Companion_getInstance_11().x38_1;
|
|
1713
1713
|
// Inline function 'kotlin.collections.map' call
|
|
1714
1714
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1715
1715
|
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(mappedRules, 10));
|
|
1716
1716
|
var _iterator__ex2g4s_0 = mappedRules.n();
|
|
1717
1717
|
while (_iterator__ex2g4s_0.q()) {
|
|
1718
1718
|
var item_0 = _iterator__ex2g4s_0.r();
|
|
1719
|
-
var thisExplanation = Companion_getInstance_11().
|
|
1719
|
+
var thisExplanation = Companion_getInstance_11().b39(item_0.second);
|
|
1720
1720
|
var resultExplanation = thisExplanation.and(explanation);
|
|
1721
1721
|
explanation = explanation.and(thisExplanation.not());
|
|
1722
|
-
var tmp$ret$6 = ProbabilisticClauseMapper_instance.
|
|
1722
|
+
var tmp$ret$6 = ProbabilisticClauseMapper_instance.p39(item_0.first, resultExplanation);
|
|
1723
1723
|
destination_0.l(tmp$ret$6);
|
|
1724
1724
|
}
|
|
1725
1725
|
return destination_0;
|
|
@@ -1729,28 +1729,28 @@
|
|
|
1729
1729
|
return AnnotatedDisjunctionClauseMapper_instance;
|
|
1730
1730
|
}
|
|
1731
1731
|
function ComputedValue(probability) {
|
|
1732
|
-
this.
|
|
1732
|
+
this.q39_1 = probability;
|
|
1733
1733
|
}
|
|
1734
1734
|
protoOf(ComputedValue).toString = function () {
|
|
1735
|
-
return 'ComputedValue(probability=' + this.
|
|
1735
|
+
return 'ComputedValue(probability=' + this.q39_1 + ')';
|
|
1736
1736
|
};
|
|
1737
1737
|
protoOf(ComputedValue).hashCode = function () {
|
|
1738
|
-
return this.
|
|
1738
|
+
return this.q39_1 == null ? 0 : getNumberHashCode(this.q39_1);
|
|
1739
1739
|
};
|
|
1740
1740
|
protoOf(ComputedValue).equals = function (other) {
|
|
1741
1741
|
if (this === other)
|
|
1742
1742
|
return true;
|
|
1743
1743
|
if (!(other instanceof ComputedValue))
|
|
1744
1744
|
return false;
|
|
1745
|
-
if (!equals(this.
|
|
1745
|
+
if (!equals(this.q39_1, other.q39_1))
|
|
1746
1746
|
return false;
|
|
1747
1747
|
return true;
|
|
1748
1748
|
};
|
|
1749
1749
|
function Companion_2() {
|
|
1750
1750
|
Companion_instance_11 = this;
|
|
1751
|
-
this.
|
|
1752
|
-
this.
|
|
1753
|
-
this.
|
|
1751
|
+
this.y38_1 = new ComputedValue(null);
|
|
1752
|
+
this.z38_1 = new ComputedValue(0.0);
|
|
1753
|
+
this.a39_1 = new ComputedValue(1.0);
|
|
1754
1754
|
}
|
|
1755
1755
|
var Companion_instance_11;
|
|
1756
1756
|
function Companion_getInstance_13() {
|
|
@@ -1766,19 +1766,19 @@
|
|
|
1766
1766
|
}
|
|
1767
1767
|
function computeExpansion($this, value, low, high) {
|
|
1768
1768
|
var tmp;
|
|
1769
|
-
if (!(low.
|
|
1770
|
-
tmp = value.
|
|
1769
|
+
if (!(low.q39_1 == null) && !(high.q39_1 == null)) {
|
|
1770
|
+
tmp = value.e39_1 * high.q39_1 + (1.0 - value.e39_1) * low.q39_1;
|
|
1771
1771
|
} else {
|
|
1772
1772
|
tmp = null;
|
|
1773
1773
|
}
|
|
1774
1774
|
return new ComputedValue(tmp);
|
|
1775
1775
|
}
|
|
1776
1776
|
function _get_cachedNot__l38068($this) {
|
|
1777
|
-
var tmp0 = $this.
|
|
1777
|
+
var tmp0 = $this.x37_1;
|
|
1778
1778
|
var tmp = KProperty1;
|
|
1779
1779
|
// Inline function 'kotlin.getValue' call
|
|
1780
1780
|
getPropertyCallableRef('cachedNot', 1, tmp, BinaryDecisionDiagramExplanation$_get_cachedNot_$ref_q3r5qq(), null);
|
|
1781
|
-
return tmp0.
|
|
1781
|
+
return tmp0.f2();
|
|
1782
1782
|
}
|
|
1783
1783
|
function BinaryDecisionDiagramExplanation$cachedNot$delegate$lambda$lambda(this$0) {
|
|
1784
1784
|
return function (node, low, high) {
|
|
@@ -1787,9 +1787,9 @@
|
|
|
1787
1787
|
}
|
|
1788
1788
|
function BinaryDecisionDiagramExplanation$cachedNot$delegate$lambda(this$0) {
|
|
1789
1789
|
return function () {
|
|
1790
|
-
var tmp = Companion_getInstance_13().
|
|
1791
|
-
var tmp_0 = Companion_getInstance_13().
|
|
1792
|
-
var result = notThenExpansion(this$0.
|
|
1790
|
+
var tmp = Companion_getInstance_13().z38_1;
|
|
1791
|
+
var tmp_0 = Companion_getInstance_13().a39_1;
|
|
1792
|
+
var result = notThenExpansion(this$0.v37_1, tmp, tmp_0, BinaryDecisionDiagramExplanation$cachedNot$delegate$lambda$lambda(this$0));
|
|
1793
1793
|
return new BinaryDecisionDiagramExplanation(result.first, result.second);
|
|
1794
1794
|
};
|
|
1795
1795
|
}
|
|
@@ -1809,14 +1809,14 @@
|
|
|
1809
1809
|
};
|
|
1810
1810
|
}
|
|
1811
1811
|
function BinaryDecisionDiagramExplanation$probability$delegate$lambda$lambda(node, low, high) {
|
|
1812
|
-
return node.
|
|
1812
|
+
return node.e39_1 * high + (1.0 - node.e39_1) * low;
|
|
1813
1813
|
}
|
|
1814
1814
|
function BinaryDecisionDiagramExplanation$probability$delegate$lambda(this$0) {
|
|
1815
1815
|
return function () {
|
|
1816
|
-
var tmp0_elvis_lhs = this$0.
|
|
1816
|
+
var tmp0_elvis_lhs = this$0.w37_1.q39_1;
|
|
1817
1817
|
var tmp;
|
|
1818
1818
|
if (tmp0_elvis_lhs == null) {
|
|
1819
|
-
tmp = expansion(this$0.
|
|
1819
|
+
tmp = expansion(this$0.v37_1, 0.0, 1.0, BinaryDecisionDiagramExplanation$probability$delegate$lambda$lambda);
|
|
1820
1820
|
} else {
|
|
1821
1821
|
tmp = tmp0_elvis_lhs;
|
|
1822
1822
|
}
|
|
@@ -1825,20 +1825,20 @@
|
|
|
1825
1825
|
}
|
|
1826
1826
|
function BinaryDecisionDiagramExplanation$_get_probability_$ref_gzzr62() {
|
|
1827
1827
|
return constructCallableReference(function (p0) {
|
|
1828
|
-
return p0.
|
|
1828
|
+
return p0.j39();
|
|
1829
1829
|
}, 1, 0, 92);
|
|
1830
1830
|
}
|
|
1831
1831
|
function BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda$lambda(it) {
|
|
1832
|
-
return !it.
|
|
1832
|
+
return !it.ev();
|
|
1833
1833
|
}
|
|
1834
1834
|
function BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda(this$0) {
|
|
1835
1835
|
return function () {
|
|
1836
|
-
return anyWhere(this$0.
|
|
1836
|
+
return anyWhere(this$0.v37_1, BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda$lambda);
|
|
1837
1837
|
};
|
|
1838
1838
|
}
|
|
1839
1839
|
function BinaryDecisionDiagramExplanation$_get_containsAnyNotGroundTerm_$ref_82xwv2() {
|
|
1840
1840
|
return constructCallableReference(function (p0) {
|
|
1841
|
-
return p0.
|
|
1841
|
+
return p0.l39();
|
|
1842
1842
|
}, 1, 0, 93);
|
|
1843
1843
|
}
|
|
1844
1844
|
function BinaryDecisionDiagramExplanation$apply$lambda($transformation) {
|
|
@@ -1848,64 +1848,64 @@
|
|
|
1848
1848
|
}
|
|
1849
1849
|
function BinaryDecisionDiagramExplanation(diagram, computedValue) {
|
|
1850
1850
|
Companion_getInstance_13();
|
|
1851
|
-
computedValue = computedValue === VOID ? Companion_getInstance_13().
|
|
1852
|
-
this.
|
|
1853
|
-
this.
|
|
1851
|
+
computedValue = computedValue === VOID ? Companion_getInstance_13().y38_1 : computedValue;
|
|
1852
|
+
this.v37_1 = diagram;
|
|
1853
|
+
this.w37_1 = computedValue;
|
|
1854
1854
|
var tmp = this;
|
|
1855
|
-
tmp.
|
|
1855
|
+
tmp.x37_1 = lazy(BinaryDecisionDiagramExplanation$cachedNot$delegate$lambda(this));
|
|
1856
1856
|
var tmp_0 = this;
|
|
1857
|
-
tmp_0.
|
|
1857
|
+
tmp_0.y37_1 = lazy(BinaryDecisionDiagramExplanation$probability$delegate$lambda(this));
|
|
1858
1858
|
var tmp_1 = this;
|
|
1859
|
-
tmp_1.
|
|
1859
|
+
tmp_1.z37_1 = lazy(BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda(this));
|
|
1860
1860
|
}
|
|
1861
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
1861
|
+
protoOf(BinaryDecisionDiagramExplanation).r39 = function () {
|
|
1862
1862
|
return _get_cachedNot__l38068(this);
|
|
1863
1863
|
};
|
|
1864
1864
|
protoOf(BinaryDecisionDiagramExplanation).not = function () {
|
|
1865
|
-
return this.
|
|
1865
|
+
return this.r39();
|
|
1866
1866
|
};
|
|
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.
|
|
1867
|
+
protoOf(BinaryDecisionDiagramExplanation).s39 = function (that) {
|
|
1868
|
+
var tmp = getAsInternal(this, that).v37_1;
|
|
1869
|
+
var tmp_0 = Companion_getInstance_13().z38_1;
|
|
1870
|
+
var tmp_1 = Companion_getInstance_13().a39_1;
|
|
1871
|
+
var result = andThenExpansion(this.v37_1, tmp, tmp_0, tmp_1, BinaryDecisionDiagramExplanation$and$lambda(this));
|
|
1872
1872
|
return new BinaryDecisionDiagramExplanation(result.first, result.second);
|
|
1873
1873
|
};
|
|
1874
1874
|
protoOf(BinaryDecisionDiagramExplanation).and = function (that) {
|
|
1875
|
-
return this.
|
|
1875
|
+
return this.s39(that);
|
|
1876
1876
|
};
|
|
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.
|
|
1877
|
+
protoOf(BinaryDecisionDiagramExplanation).t39 = function (that) {
|
|
1878
|
+
var tmp = getAsInternal(this, that).v37_1;
|
|
1879
|
+
var tmp_0 = Companion_getInstance_13().z38_1;
|
|
1880
|
+
var tmp_1 = Companion_getInstance_13().a39_1;
|
|
1881
|
+
var result = orThenExpansion(this.v37_1, tmp, tmp_0, tmp_1, BinaryDecisionDiagramExplanation$or$lambda(this));
|
|
1882
1882
|
return new BinaryDecisionDiagramExplanation(result.first, result.second);
|
|
1883
1883
|
};
|
|
1884
1884
|
protoOf(BinaryDecisionDiagramExplanation).or = function (that) {
|
|
1885
|
-
return this.
|
|
1885
|
+
return this.t39(that);
|
|
1886
1886
|
};
|
|
1887
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
1888
|
-
var tmp0 = this.
|
|
1887
|
+
protoOf(BinaryDecisionDiagramExplanation).j39 = function () {
|
|
1888
|
+
var tmp0 = this.y37_1;
|
|
1889
1889
|
var tmp = KProperty1;
|
|
1890
1890
|
// Inline function 'kotlin.getValue' call
|
|
1891
1891
|
getPropertyCallableRef('probability', 1, tmp, BinaryDecisionDiagramExplanation$_get_probability_$ref_gzzr62(), null);
|
|
1892
|
-
return tmp0.
|
|
1892
|
+
return tmp0.f2();
|
|
1893
1893
|
};
|
|
1894
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
1895
|
-
var tmp0 = this.
|
|
1894
|
+
protoOf(BinaryDecisionDiagramExplanation).l39 = function () {
|
|
1895
|
+
var tmp0 = this.z37_1;
|
|
1896
1896
|
var tmp = KProperty1;
|
|
1897
1897
|
// Inline function 'kotlin.getValue' call
|
|
1898
1898
|
getPropertyCallableRef('containsAnyNotGroundTerm', 1, tmp, BinaryDecisionDiagramExplanation$_get_containsAnyNotGroundTerm_$ref_82xwv2(), null);
|
|
1899
|
-
return tmp0.
|
|
1899
|
+
return tmp0.f2();
|
|
1900
1900
|
};
|
|
1901
1901
|
protoOf(BinaryDecisionDiagramExplanation).toString = function () {
|
|
1902
|
-
return 'bdd:' + hashCode(this.
|
|
1902
|
+
return 'bdd:' + hashCode(this.v37_1);
|
|
1903
1903
|
};
|
|
1904
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
1905
|
-
return new BinaryDecisionDiagramExplanation(map_0(this.
|
|
1904
|
+
protoOf(BinaryDecisionDiagramExplanation).u39 = function (transformation) {
|
|
1905
|
+
return new BinaryDecisionDiagramExplanation(map_0(this.v37_1, BinaryDecisionDiagramExplanation$apply$lambda(transformation)));
|
|
1906
1906
|
};
|
|
1907
1907
|
protoOf(BinaryDecisionDiagramExplanation).applyTransformation = function (transformation) {
|
|
1908
|
-
return this.
|
|
1908
|
+
return this.u39(transformation);
|
|
1909
1909
|
};
|
|
1910
1910
|
function get_nonWrappableFunctors() {
|
|
1911
1911
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
@@ -1914,27 +1914,27 @@
|
|
|
1914
1914
|
var nonWrappableFunctors;
|
|
1915
1915
|
function ClauseMappingUtils() {
|
|
1916
1916
|
ClauseMappingUtils_instance = this;
|
|
1917
|
-
this.
|
|
1918
|
-
this.
|
|
1917
|
+
this.v39_1 = 1n;
|
|
1918
|
+
this.w39_1 = listOf_0([DirectiveClauseMapper_instance, AnnotatedDisjunctionClauseMapper_instance, ProbabilisticClauseMapper_instance, EvidenceClauseMapper_instance, PrologClauseMapper_instance, NothingClauseMapper_instance]);
|
|
1919
1919
|
}
|
|
1920
|
-
protoOf(ClauseMappingUtils).
|
|
1921
|
-
var _unary__edvuaz = this.
|
|
1922
|
-
this.
|
|
1920
|
+
protoOf(ClauseMappingUtils).x39 = function () {
|
|
1921
|
+
var _unary__edvuaz = this.v39_1;
|
|
1922
|
+
this.v39_1 = add(_unary__edvuaz, get_ONE());
|
|
1923
1923
|
return _unary__edvuaz;
|
|
1924
1924
|
};
|
|
1925
|
-
protoOf(ClauseMappingUtils).
|
|
1925
|
+
protoOf(ClauseMappingUtils).y39 = function (clause) {
|
|
1926
1926
|
var tmp;
|
|
1927
1927
|
if (get_isMappedAsProblog(clause)) {
|
|
1928
1928
|
tmp = listOf(clause);
|
|
1929
1929
|
} else {
|
|
1930
|
-
var tmp0 = this.
|
|
1930
|
+
var tmp0 = this.w39_1;
|
|
1931
1931
|
var tmp$ret$0;
|
|
1932
1932
|
$l$block: {
|
|
1933
1933
|
// Inline function 'kotlin.collections.first' call
|
|
1934
1934
|
var _iterator__ex2g4s = tmp0.n();
|
|
1935
1935
|
while (_iterator__ex2g4s.q()) {
|
|
1936
1936
|
var element = _iterator__ex2g4s.r();
|
|
1937
|
-
if (element.
|
|
1937
|
+
if (element.m39(clause)) {
|
|
1938
1938
|
tmp$ret$0 = element;
|
|
1939
1939
|
break $l$block;
|
|
1940
1940
|
}
|
|
@@ -1942,7 +1942,7 @@
|
|
|
1942
1942
|
throw NoSuchElementException_init_$Create$('Collection contains no element matching the predicate.');
|
|
1943
1943
|
}
|
|
1944
1944
|
// Inline function 'kotlin.collections.map' call
|
|
1945
|
-
var this_0 = tmp$ret$0.
|
|
1945
|
+
var this_0 = tmp$ret$0.n39(clause);
|
|
1946
1946
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1947
1947
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1948
1948
|
var _iterator__ex2g4s_0 = this_0.n();
|
|
@@ -1955,13 +1955,13 @@
|
|
|
1955
1955
|
}
|
|
1956
1956
|
return tmp;
|
|
1957
1957
|
};
|
|
1958
|
-
protoOf(ClauseMappingUtils).
|
|
1959
|
-
var arityTerm = indicator.
|
|
1958
|
+
protoOf(ClauseMappingUtils).z39 = function (indicator) {
|
|
1959
|
+
var arityTerm = indicator.hy();
|
|
1960
1960
|
var tmp = Companion_instance_4;
|
|
1961
|
-
var tmp_0 = indicator.
|
|
1961
|
+
var tmp_0 = indicator.gy();
|
|
1962
1962
|
var tmp_1;
|
|
1963
1963
|
if (isInterface(arityTerm, Numeric)) {
|
|
1964
|
-
tmp_1 = Companion_getInstance_6().ofInteger(arityTerm.
|
|
1964
|
+
tmp_1 = Companion_getInstance_6().ofInteger(arityTerm.iy().toInt() + 1 | 0);
|
|
1965
1965
|
} else {
|
|
1966
1966
|
tmp_1 = arityTerm;
|
|
1967
1967
|
}
|
|
@@ -2001,7 +2001,7 @@
|
|
|
2001
2001
|
} else {
|
|
2002
2002
|
var tmp_0;
|
|
2003
2003
|
if (isInterface(_this__u8e3s4, Struct)) {
|
|
2004
|
-
tmp_0 = Companion_getInstance_1().ofList(_this__u8e3s4.
|
|
2004
|
+
tmp_0 = Companion_getInstance_1().ofList(_this__u8e3s4.au(), plus(_this__u8e3s4.bu(), explanation));
|
|
2005
2005
|
} else {
|
|
2006
2006
|
tmp_0 = Companion_getInstance_1().of(_this__u8e3s4.toString(), [explanation]);
|
|
2007
2007
|
}
|
|
@@ -2024,7 +2024,7 @@
|
|
|
2024
2024
|
var tmp;
|
|
2025
2025
|
if (isInterface(_this__u8e3s4, Struct)) {
|
|
2026
2026
|
var tmp_0;
|
|
2027
|
-
switch (_this__u8e3s4.
|
|
2027
|
+
switch (_this__u8e3s4.au()) {
|
|
2028
2028
|
case ',':
|
|
2029
2029
|
var leftVar = Companion_getInstance_0().of('EXPL_A_' + depth);
|
|
2030
2030
|
var rightVar = Companion_getInstance_0().of('EXPL_B_' + depth);
|
|
@@ -2055,11 +2055,11 @@
|
|
|
2055
2055
|
}
|
|
2056
2056
|
function get_isWrappableWithExplanation(_this__u8e3s4) {
|
|
2057
2057
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2058
|
-
return !get_nonWrappableFunctors().y(safeToStruct(_this__u8e3s4).
|
|
2058
|
+
return !get_nonWrappableFunctors().y(safeToStruct(_this__u8e3s4).au());
|
|
2059
2059
|
}
|
|
2060
2060
|
function withExplanationNonWrappable(_this__u8e3s4, explanation) {
|
|
2061
2061
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2062
|
-
return Companion_instance_0.of(_this__u8e3s4, Companion_getInstance_1().of('=', [explanation, toTerm(Companion_getInstance_11().
|
|
2062
|
+
return Companion_instance_0.of(_this__u8e3s4, Companion_getInstance_1().of('=', [explanation, toTerm(Companion_getInstance_11().x38_1)]));
|
|
2063
2063
|
}
|
|
2064
2064
|
function wrapInPredicate(_this__u8e3s4, functor, explanation) {
|
|
2065
2065
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
@@ -2076,8 +2076,8 @@
|
|
|
2076
2076
|
var tmp0 = _this__u8e3s4.toString();
|
|
2077
2077
|
// Inline function 'kotlin.text.toRegex' call
|
|
2078
2078
|
// Inline function 'kotlin.text.replace' call
|
|
2079
|
-
var termStr = Regex_init_$Create$('\\s').
|
|
2080
|
-
var tmp0_elvis_lhs = Regex_init_$Create$('([0-9.]+)(/)([0-9.]+).*').
|
|
2079
|
+
var termStr = Regex_init_$Create$('\\s').ya(tmp0, '');
|
|
2080
|
+
var tmp0_elvis_lhs = Regex_init_$Create$('([0-9.]+)(/)([0-9.]+).*').xa(termStr);
|
|
2081
2081
|
var tmp;
|
|
2082
2082
|
if (tmp0_elvis_lhs == null) {
|
|
2083
2083
|
throw TuPrologException_init_$Create$('Unsupported probability notation in annotated disjunction: ' + termStr);
|
|
@@ -2085,11 +2085,11 @@
|
|
|
2085
2085
|
tmp = tmp0_elvis_lhs;
|
|
2086
2086
|
}
|
|
2087
2087
|
var regexMatch = tmp;
|
|
2088
|
-
var _destruct__k2r9zo = regexMatch.
|
|
2088
|
+
var _destruct__k2r9zo = regexMatch.sb();
|
|
2089
2089
|
// Inline function 'kotlin.text.Destructured.component1' call
|
|
2090
|
-
var dividendStr = _destruct__k2r9zo.
|
|
2090
|
+
var dividendStr = _destruct__k2r9zo.kh_1.rb().x(1);
|
|
2091
2091
|
// Inline function 'kotlin.text.Destructured.component3' call
|
|
2092
|
-
var divisorStr = _destruct__k2r9zo.
|
|
2092
|
+
var divisorStr = _destruct__k2r9zo.kh_1.rb().x(3);
|
|
2093
2093
|
var dividend = toDoubleOrNull(dividendStr);
|
|
2094
2094
|
var divisor = toDoubleOrNull(divisorStr);
|
|
2095
2095
|
if (dividend == null || divisor == null) {
|
|
@@ -2101,13 +2101,13 @@
|
|
|
2101
2101
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2102
2102
|
var tmp = Companion_getInstance_5();
|
|
2103
2103
|
// Inline function 'kotlin.collections.filter' call
|
|
2104
|
-
var tmp0 = plus_0(toSet_0(_this__u8e3s4.
|
|
2104
|
+
var tmp0 = plus_0(toSet_0(_this__u8e3s4.gw().cu()), toSet_0(_this__u8e3s4.hw().cu()));
|
|
2105
2105
|
// Inline function 'kotlin.collections.filterTo' call
|
|
2106
2106
|
var destination = ArrayList_init_$Create$_0();
|
|
2107
2107
|
var _iterator__ex2g4s = tmp0.n();
|
|
2108
2108
|
while (_iterator__ex2g4s.q()) {
|
|
2109
2109
|
var element = _iterator__ex2g4s.r();
|
|
2110
|
-
if (element.
|
|
2110
|
+
if (element.x12()) {
|
|
2111
2111
|
destination.l(element);
|
|
2112
2112
|
}
|
|
2113
2113
|
}
|
|
@@ -2127,18 +2127,18 @@
|
|
|
2127
2127
|
var anonVarSubstitution = tmp.ofIterable(destination_0);
|
|
2128
2128
|
var tmp_0;
|
|
2129
2129
|
if (isInterface(_this__u8e3s4, Fact)) {
|
|
2130
|
-
tmp_0 = Companion_instance.of(safeToStruct(_this__u8e3s4.
|
|
2130
|
+
tmp_0 = Companion_instance.of(safeToStruct(_this__u8e3s4.gw().applySubstitution(anonVarSubstitution)));
|
|
2131
2131
|
} else {
|
|
2132
|
-
tmp_0 = Companion_instance_3.of(safeToStruct(_this__u8e3s4.
|
|
2132
|
+
tmp_0 = Companion_instance_3.of(safeToStruct(_this__u8e3s4.gw().applySubstitution(anonVarSubstitution)), [safeToStruct(_this__u8e3s4.hw().applySubstitution(anonVarSubstitution))]);
|
|
2133
2133
|
}
|
|
2134
2134
|
return tmp_0;
|
|
2135
2135
|
}
|
|
2136
2136
|
function get_extraVariables(_this__u8e3s4) {
|
|
2137
2137
|
_init_properties_ClauseMappingUtils_kt__go80e();
|
|
2138
2138
|
var tmp;
|
|
2139
|
-
if (!_this__u8e3s4.
|
|
2140
|
-
var headVars = toSet_0(_this__u8e3s4.
|
|
2141
|
-
var bodyVars = toSet_0(_this__u8e3s4.
|
|
2139
|
+
if (!_this__u8e3s4.ev()) {
|
|
2140
|
+
var headVars = toSet_0(_this__u8e3s4.gw().cu());
|
|
2141
|
+
var bodyVars = toSet_0(_this__u8e3s4.hw().cu());
|
|
2142
2142
|
tmp = subtract(bodyVars, headVars);
|
|
2143
2143
|
} else {
|
|
2144
2144
|
tmp = emptySet();
|
|
@@ -2154,17 +2154,17 @@
|
|
|
2154
2154
|
}
|
|
2155
2155
|
function DirectiveClauseMapper() {
|
|
2156
2156
|
}
|
|
2157
|
-
protoOf(DirectiveClauseMapper).
|
|
2158
|
-
return clause.
|
|
2157
|
+
protoOf(DirectiveClauseMapper).m39 = function (clause) {
|
|
2158
|
+
return clause.ju();
|
|
2159
2159
|
};
|
|
2160
|
-
protoOf(DirectiveClauseMapper).
|
|
2161
|
-
var body = clause.
|
|
2160
|
+
protoOf(DirectiveClauseMapper).n39 = function (clause) {
|
|
2161
|
+
var body = clause.hw();
|
|
2162
2162
|
if (!isInterface(clause, Directive)) {
|
|
2163
2163
|
throw new ClauseMappingException('Clause is not an instance of Directive: ' + clause.toString());
|
|
2164
2164
|
}
|
|
2165
2165
|
var tmp;
|
|
2166
2166
|
if (isInterface(body, Struct)) {
|
|
2167
|
-
tmp = body.
|
|
2167
|
+
tmp = body.au() === 'static' || body.au() === 'dynamic';
|
|
2168
2168
|
} else {
|
|
2169
2169
|
tmp = false;
|
|
2170
2170
|
}
|
|
@@ -2173,21 +2173,21 @@
|
|
|
2173
2173
|
if (!isInterface(indicatorTerm, Indicator)) {
|
|
2174
2174
|
throw new ClauseMappingException('Malformed directive: ' + clause.toString());
|
|
2175
2175
|
}
|
|
2176
|
-
var name = indicatorTerm.
|
|
2177
|
-
var arity = indicatorTerm.
|
|
2176
|
+
var name = indicatorTerm.gy();
|
|
2177
|
+
var arity = indicatorTerm.hy();
|
|
2178
2178
|
if (!isInterface(arity, Numeric)) {
|
|
2179
2179
|
throw new ClauseMappingException('Malformed directive: ' + clause.toString());
|
|
2180
2180
|
}
|
|
2181
|
-
return listOf(Companion_instance_5.of(Companion_getInstance_1().of(body.
|
|
2181
|
+
return listOf(Companion_instance_5.of(Companion_getInstance_1().of(body.au(), [Companion_instance_4.of(name, Companion_getInstance_6().ofInteger(arity.qy().toInt() + 1 | 0))]), []));
|
|
2182
2182
|
}
|
|
2183
2183
|
var tmp_0;
|
|
2184
2184
|
if (isInterface(body, Struct)) {
|
|
2185
|
-
tmp_0 = body.
|
|
2185
|
+
tmp_0 = body.au() === 'initialization' || body.au() === 'solve';
|
|
2186
2186
|
} else {
|
|
2187
2187
|
tmp_0 = false;
|
|
2188
2188
|
}
|
|
2189
2189
|
if (tmp_0) {
|
|
2190
|
-
return listOf(Companion_instance_5.of(Companion_getInstance_1().of(body.
|
|
2190
|
+
return listOf(Companion_instance_5.of(Companion_getInstance_1().of(body.au(), [withBodyExplanation(body.get(0), Companion_getInstance_0().anonymous())]), []));
|
|
2191
2191
|
}
|
|
2192
2192
|
return listOf(clause);
|
|
2193
2193
|
};
|
|
@@ -2197,42 +2197,42 @@
|
|
|
2197
2197
|
}
|
|
2198
2198
|
function EvidenceClauseMapper() {
|
|
2199
2199
|
}
|
|
2200
|
-
protoOf(EvidenceClauseMapper).
|
|
2200
|
+
protoOf(EvidenceClauseMapper).m39 = function (clause) {
|
|
2201
2201
|
var tmp;
|
|
2202
2202
|
if (isInterface(clause, Rule)) {
|
|
2203
|
-
tmp = clause.
|
|
2203
|
+
tmp = clause.gw().au() === 'evidence';
|
|
2204
2204
|
} else {
|
|
2205
2205
|
tmp = false;
|
|
2206
2206
|
}
|
|
2207
2207
|
return tmp;
|
|
2208
2208
|
};
|
|
2209
|
-
protoOf(EvidenceClauseMapper).
|
|
2209
|
+
protoOf(EvidenceClauseMapper).n39 = function (clause) {
|
|
2210
2210
|
if (!isInterface(clause, Rule)) {
|
|
2211
2211
|
throw new ClauseMappingException('Clause is not an instance of Rule: ' + clause.toString());
|
|
2212
2212
|
}
|
|
2213
|
-
if (clause.
|
|
2214
|
-
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.
|
|
2213
|
+
if (clause.gw().ut() > 2) {
|
|
2214
|
+
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.gw().toString());
|
|
2215
2215
|
} else {
|
|
2216
2216
|
var tmp;
|
|
2217
|
-
if (clause.
|
|
2218
|
-
var tmp_0 = clause.
|
|
2217
|
+
if (clause.gw().ut() === 2) {
|
|
2218
|
+
var tmp_0 = clause.gw().get(1);
|
|
2219
2219
|
tmp = !isInterface(tmp_0, Truth);
|
|
2220
2220
|
} else {
|
|
2221
2221
|
tmp = false;
|
|
2222
2222
|
}
|
|
2223
2223
|
if (tmp) {
|
|
2224
|
-
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.
|
|
2224
|
+
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.gw().toString());
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
|
-
var headTerm = clause.
|
|
2228
|
-
if (headTerm.
|
|
2229
|
-
headTerm = Companion_getInstance_1().of(headTerm.
|
|
2227
|
+
var headTerm = clause.gw();
|
|
2228
|
+
if (headTerm.ut() === 1) {
|
|
2229
|
+
headTerm = Companion_getInstance_1().of(headTerm.au(), [headTerm.get(0), Companion_getInstance_7().rt_1]);
|
|
2230
2230
|
}
|
|
2231
2231
|
var tmp_1;
|
|
2232
2232
|
if (isInterface(clause, Fact)) {
|
|
2233
2233
|
tmp_1 = Companion_instance.of(headTerm);
|
|
2234
2234
|
} else {
|
|
2235
|
-
tmp_1 = Companion_instance_3.of(headTerm, [withBodyExplanation(clause.
|
|
2235
|
+
tmp_1 = Companion_instance_3.of(headTerm, [withBodyExplanation(clause.hw(), Companion_getInstance_0().anonymous())]);
|
|
2236
2236
|
}
|
|
2237
2237
|
return listOf(tmp_1);
|
|
2238
2238
|
};
|
|
@@ -2241,7 +2241,7 @@
|
|
|
2241
2241
|
return EvidenceClauseMapper_instance;
|
|
2242
2242
|
}
|
|
2243
2243
|
function MappedMutableProblogTheory(clauses, unificator, theory) {
|
|
2244
|
-
unificator = unificator === VOID ? Companion_getInstance_8().
|
|
2244
|
+
unificator = unificator === VOID ? Companion_getInstance_8().n1k() : unificator;
|
|
2245
2245
|
var tmp;
|
|
2246
2246
|
if (theory === VOID) {
|
|
2247
2247
|
var tmp_0 = Companion_instance_6;
|
|
@@ -2255,7 +2255,7 @@
|
|
|
2255
2255
|
var _iterator__ex2g4s = clauses.n();
|
|
2256
2256
|
while (_iterator__ex2g4s.q()) {
|
|
2257
2257
|
var element = _iterator__ex2g4s.r();
|
|
2258
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2258
|
+
var list = ClauseMappingUtils_getInstance().y39(element);
|
|
2259
2259
|
addAll(destination, list);
|
|
2260
2260
|
}
|
|
2261
2261
|
tmp_1 = destination;
|
|
@@ -2266,102 +2266,102 @@
|
|
|
2266
2266
|
tmp = theory;
|
|
2267
2267
|
}
|
|
2268
2268
|
theory = tmp;
|
|
2269
|
-
this.
|
|
2269
|
+
this.a3a_1 = theory;
|
|
2270
2270
|
}
|
|
2271
|
-
protoOf(MappedMutableProblogTheory).
|
|
2271
|
+
protoOf(MappedMutableProblogTheory).k1s = function () {
|
|
2272
2272
|
return false;
|
|
2273
2273
|
};
|
|
2274
|
-
protoOf(MappedMutableProblogTheory).
|
|
2275
|
-
return Companion_instance_8.ofIterable(this.
|
|
2274
|
+
protoOf(MappedMutableProblogTheory).x1s = function () {
|
|
2275
|
+
return Companion_instance_8.ofIterable(this.u1k(), this);
|
|
2276
2276
|
};
|
|
2277
2277
|
protoOf(MappedMutableProblogTheory).toMutableTheory = function () {
|
|
2278
|
-
return this.
|
|
2278
|
+
return this.x1s();
|
|
2279
2279
|
};
|
|
2280
|
-
protoOf(MappedMutableProblogTheory).
|
|
2280
|
+
protoOf(MappedMutableProblogTheory).k1r = function () {
|
|
2281
2281
|
return this;
|
|
2282
2282
|
};
|
|
2283
2283
|
protoOf(MappedMutableProblogTheory).toImmutableTheory = function () {
|
|
2284
|
-
return this.
|
|
2284
|
+
return this.k1r();
|
|
2285
2285
|
};
|
|
2286
|
-
protoOf(MappedMutableProblogTheory).
|
|
2287
|
-
return new MappedMutableProblogTheory(null, this.
|
|
2286
|
+
protoOf(MappedMutableProblogTheory).b3a = function (theory) {
|
|
2287
|
+
return new MappedMutableProblogTheory(null, this.u1k(), this.a3a_1.x1r(theory));
|
|
2288
2288
|
};
|
|
2289
|
-
protoOf(MappedMutableProblogTheory).
|
|
2289
|
+
protoOf(MappedMutableProblogTheory).x1r = function (theory) {
|
|
2290
2290
|
var tmp;
|
|
2291
2291
|
if (isInterface(theory, ProblogTheory)) {
|
|
2292
|
-
tmp = this.
|
|
2292
|
+
tmp = this.b3a(theory);
|
|
2293
2293
|
} else {
|
|
2294
|
-
tmp = this.
|
|
2294
|
+
tmp = this.b3a(new MappedMutableProblogTheory(theory, this.u1k()));
|
|
2295
2295
|
}
|
|
2296
2296
|
return tmp;
|
|
2297
2297
|
};
|
|
2298
2298
|
protoOf(MappedMutableProblogTheory).plusTheory = function (theory) {
|
|
2299
|
-
return this.
|
|
2299
|
+
return this.x1r(theory);
|
|
2300
2300
|
};
|
|
2301
|
-
protoOf(MappedMutableProblogTheory).
|
|
2302
|
-
var mapped = ClauseMappingUtils_getInstance().
|
|
2303
|
-
return new MappedMutableProblogTheory(null, this.
|
|
2301
|
+
protoOf(MappedMutableProblogTheory).l1r = function (clause) {
|
|
2302
|
+
var mapped = ClauseMappingUtils_getInstance().y39(clause);
|
|
2303
|
+
return new MappedMutableProblogTheory(null, this.u1k(), this.a3a_1.x1r(Companion_instance_7.indexedOfIterable(this.u1k(), mapped)));
|
|
2304
2304
|
};
|
|
2305
2305
|
protoOf(MappedMutableProblogTheory).plus = function (clause) {
|
|
2306
|
-
return this.
|
|
2306
|
+
return this.l1r(clause);
|
|
2307
2307
|
};
|
|
2308
|
-
protoOf(MappedMutableProblogTheory).
|
|
2308
|
+
protoOf(MappedMutableProblogTheory).b1s = function (clauses) {
|
|
2309
2309
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2310
2310
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
2311
2311
|
var destination = ArrayList_init_$Create$_0();
|
|
2312
2312
|
var _iterator__ex2g4s = clauses.n();
|
|
2313
2313
|
while (_iterator__ex2g4s.q()) {
|
|
2314
2314
|
var element = _iterator__ex2g4s.r();
|
|
2315
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2315
|
+
var list = ClauseMappingUtils_getInstance().y39(element);
|
|
2316
2316
|
addAll(destination, list);
|
|
2317
2317
|
}
|
|
2318
2318
|
var mapped = destination;
|
|
2319
|
-
return new MappedMutableProblogTheory(null, this.
|
|
2319
|
+
return new MappedMutableProblogTheory(null, this.u1k(), this.a3a_1.b1s(mapped));
|
|
2320
2320
|
};
|
|
2321
2321
|
protoOf(MappedMutableProblogTheory).assertAIterable = function (clauses) {
|
|
2322
|
-
return this.
|
|
2322
|
+
return this.b1s(clauses);
|
|
2323
2323
|
};
|
|
2324
|
-
protoOf(MappedMutableProblogTheory).
|
|
2324
|
+
protoOf(MappedMutableProblogTheory).e1s = function (clauses) {
|
|
2325
2325
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2326
2326
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
2327
2327
|
var destination = ArrayList_init_$Create$_0();
|
|
2328
2328
|
var _iterator__ex2g4s = clauses.n();
|
|
2329
2329
|
while (_iterator__ex2g4s.q()) {
|
|
2330
2330
|
var element = _iterator__ex2g4s.r();
|
|
2331
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2331
|
+
var list = ClauseMappingUtils_getInstance().y39(element);
|
|
2332
2332
|
addAll(destination, list);
|
|
2333
2333
|
}
|
|
2334
2334
|
var mapped = destination;
|
|
2335
|
-
return new MappedMutableProblogTheory(null, this.
|
|
2335
|
+
return new MappedMutableProblogTheory(null, this.u1k(), this.a3a_1.e1s(mapped));
|
|
2336
2336
|
};
|
|
2337
2337
|
protoOf(MappedMutableProblogTheory).assertZIterable = function (clauses) {
|
|
2338
|
-
return this.
|
|
2338
|
+
return this.e1s(clauses);
|
|
2339
2339
|
};
|
|
2340
|
-
protoOf(MappedMutableProblogTheory).
|
|
2340
|
+
protoOf(MappedMutableProblogTheory).i1s = function (clauses) {
|
|
2341
2341
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2342
2342
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
2343
2343
|
var destination = ArrayList_init_$Create$_0();
|
|
2344
2344
|
var _iterator__ex2g4s = clauses.n();
|
|
2345
2345
|
while (_iterator__ex2g4s.q()) {
|
|
2346
2346
|
var element = _iterator__ex2g4s.r();
|
|
2347
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2347
|
+
var list = ClauseMappingUtils_getInstance().y39(element);
|
|
2348
2348
|
addAll(destination, list);
|
|
2349
2349
|
}
|
|
2350
2350
|
var mapped = destination;
|
|
2351
|
-
var result = this.
|
|
2351
|
+
var result = this.a3a_1.i1s(mapped);
|
|
2352
2352
|
var tmp;
|
|
2353
2353
|
if (result instanceof Success) {
|
|
2354
|
-
tmp = new Success(new MappedMutableProblogTheory(null, this.
|
|
2354
|
+
tmp = new Success(new MappedMutableProblogTheory(null, this.u1k(), result.d1t_1), result.e1t_1);
|
|
2355
2355
|
} else {
|
|
2356
|
-
tmp = new Failure(new MappedMutableProblogTheory(null, this.
|
|
2356
|
+
tmp = new Failure(new MappedMutableProblogTheory(null, this.u1k(), result.r1r()));
|
|
2357
2357
|
}
|
|
2358
2358
|
return tmp;
|
|
2359
2359
|
};
|
|
2360
2360
|
protoOf(MappedMutableProblogTheory).retractIterable = function (clauses) {
|
|
2361
|
-
return this.
|
|
2361
|
+
return this.i1s(clauses);
|
|
2362
2362
|
};
|
|
2363
|
-
protoOf(MappedMutableProblogTheory).
|
|
2364
|
-
var mappedClauses = ClauseMappingUtils_getInstance().
|
|
2363
|
+
protoOf(MappedMutableProblogTheory).m1l = function (clause) {
|
|
2364
|
+
var mappedClauses = ClauseMappingUtils_getInstance().y39(clause);
|
|
2365
2365
|
var result = null;
|
|
2366
2366
|
var _iterator__ex2g4s = mappedClauses.n();
|
|
2367
2367
|
while (_iterator__ex2g4s.q()) {
|
|
@@ -2373,16 +2373,16 @@
|
|
|
2373
2373
|
tmp = !(result instanceof Failure);
|
|
2374
2374
|
}
|
|
2375
2375
|
if (tmp) {
|
|
2376
|
-
result = this.
|
|
2376
|
+
result = this.a3a_1.m1l(c);
|
|
2377
2377
|
}
|
|
2378
2378
|
}
|
|
2379
2379
|
var tmp0_subject = result;
|
|
2380
2380
|
var tmp_0;
|
|
2381
2381
|
if (tmp0_subject instanceof Success) {
|
|
2382
|
-
tmp_0 = new Success(new MappedMutableProblogTheory(null, this.
|
|
2382
|
+
tmp_0 = new Success(new MappedMutableProblogTheory(null, this.u1k(), result.d1t_1), result.e1t_1);
|
|
2383
2383
|
} else {
|
|
2384
2384
|
if (tmp0_subject instanceof Failure) {
|
|
2385
|
-
tmp_0 = new Failure(new MappedMutableProblogTheory(null, this.
|
|
2385
|
+
tmp_0 = new Failure(new MappedMutableProblogTheory(null, this.u1k(), result.f1t_1));
|
|
2386
2386
|
} else {
|
|
2387
2387
|
tmp_0 = new Failure(this);
|
|
2388
2388
|
}
|
|
@@ -2390,145 +2390,145 @@
|
|
|
2390
2390
|
return tmp_0;
|
|
2391
2391
|
};
|
|
2392
2392
|
protoOf(MappedMutableProblogTheory).retractAll = function (clause) {
|
|
2393
|
-
return this.
|
|
2393
|
+
return this.m1l(clause);
|
|
2394
2394
|
};
|
|
2395
|
-
protoOf(MappedMutableProblogTheory).
|
|
2396
|
-
return new MappedMutableProblogTheory(null, this.
|
|
2395
|
+
protoOf(MappedMutableProblogTheory).q1r = function (indicator) {
|
|
2396
|
+
return new MappedMutableProblogTheory(null, this.u1k(), this.a3a_1.q1r(ClauseMappingUtils_getInstance().z39(indicator)));
|
|
2397
2397
|
};
|
|
2398
2398
|
protoOf(MappedMutableProblogTheory).abolish = function (indicator) {
|
|
2399
|
-
return this.
|
|
2399
|
+
return this.q1r(indicator);
|
|
2400
2400
|
};
|
|
2401
|
-
protoOf(MappedMutableProblogTheory).
|
|
2402
|
-
return this.
|
|
2401
|
+
protoOf(MappedMutableProblogTheory).y1s = function (struct) {
|
|
2402
|
+
return this.z1r(Companion_instance.of(struct));
|
|
2403
2403
|
};
|
|
2404
2404
|
protoOf(MappedMutableProblogTheory).assertAFact = function (struct) {
|
|
2405
|
-
return this.
|
|
2405
|
+
return this.y1s(struct);
|
|
2406
2406
|
};
|
|
2407
|
-
protoOf(MappedMutableProblogTheory).
|
|
2408
|
-
return this.
|
|
2407
|
+
protoOf(MappedMutableProblogTheory).z1s = function (struct) {
|
|
2408
|
+
return this.d1s(Companion_instance.of(struct));
|
|
2409
2409
|
};
|
|
2410
2410
|
protoOf(MappedMutableProblogTheory).assertZFact = function (struct) {
|
|
2411
|
-
return this.
|
|
2411
|
+
return this.z1s(struct);
|
|
2412
2412
|
};
|
|
2413
|
-
protoOf(MappedMutableProblogTheory).
|
|
2414
|
-
return this.
|
|
2413
|
+
protoOf(MappedMutableProblogTheory).z1r = function (clause) {
|
|
2414
|
+
return this.b1s(listOf(clause));
|
|
2415
2415
|
};
|
|
2416
2416
|
protoOf(MappedMutableProblogTheory).assertA = function (clause) {
|
|
2417
|
-
return this.
|
|
2417
|
+
return this.z1r(clause);
|
|
2418
2418
|
};
|
|
2419
|
-
protoOf(MappedMutableProblogTheory).
|
|
2420
|
-
return this.
|
|
2419
|
+
protoOf(MappedMutableProblogTheory).c1s = function (clauses) {
|
|
2420
|
+
return this.b1s(asIterable_0(clauses));
|
|
2421
2421
|
};
|
|
2422
2422
|
protoOf(MappedMutableProblogTheory).assertASequence = function (clauses) {
|
|
2423
|
-
return this.
|
|
2423
|
+
return this.c1s(clauses);
|
|
2424
2424
|
};
|
|
2425
|
-
protoOf(MappedMutableProblogTheory).
|
|
2426
|
-
return this.
|
|
2425
|
+
protoOf(MappedMutableProblogTheory).d1s = function (clause) {
|
|
2426
|
+
return this.e1s(listOf(clause));
|
|
2427
2427
|
};
|
|
2428
2428
|
protoOf(MappedMutableProblogTheory).assertZ = function (clause) {
|
|
2429
|
-
return this.
|
|
2429
|
+
return this.d1s(clause);
|
|
2430
2430
|
};
|
|
2431
|
-
protoOf(MappedMutableProblogTheory).
|
|
2432
|
-
return this.
|
|
2431
|
+
protoOf(MappedMutableProblogTheory).f1s = function (clauses) {
|
|
2432
|
+
return this.e1s(asIterable_0(clauses));
|
|
2433
2433
|
};
|
|
2434
2434
|
protoOf(MappedMutableProblogTheory).assertZSequence = function (clauses) {
|
|
2435
|
-
return this.
|
|
2435
|
+
return this.f1s(clauses);
|
|
2436
2436
|
};
|
|
2437
|
-
protoOf(MappedMutableProblogTheory).
|
|
2438
|
-
return this.
|
|
2437
|
+
protoOf(MappedMutableProblogTheory).b1t = function (head) {
|
|
2438
|
+
return this.a1t(Companion_instance_3.of(head, [Companion_getInstance_0().anonymous()]));
|
|
2439
2439
|
};
|
|
2440
2440
|
protoOf(MappedMutableProblogTheory).retractByHead = function (head) {
|
|
2441
|
-
return this.
|
|
2441
|
+
return this.b1t(head);
|
|
2442
2442
|
};
|
|
2443
|
-
protoOf(MappedMutableProblogTheory).
|
|
2444
|
-
return this.
|
|
2443
|
+
protoOf(MappedMutableProblogTheory).a1t = function (clause) {
|
|
2444
|
+
return this.i1s(listOf(clause));
|
|
2445
2445
|
};
|
|
2446
2446
|
protoOf(MappedMutableProblogTheory).retract = function (clause) {
|
|
2447
|
-
return this.
|
|
2447
|
+
return this.a1t(clause);
|
|
2448
2448
|
};
|
|
2449
|
-
protoOf(MappedMutableProblogTheory).
|
|
2450
|
-
return this.
|
|
2449
|
+
protoOf(MappedMutableProblogTheory).h1s = function (clauses) {
|
|
2450
|
+
return this.i1s(asIterable_0(clauses));
|
|
2451
2451
|
};
|
|
2452
2452
|
protoOf(MappedMutableProblogTheory).retractSequence = function (clauses) {
|
|
2453
|
-
return this.
|
|
2453
|
+
return this.h1s(clauses);
|
|
2454
2454
|
};
|
|
2455
|
-
protoOf(MappedMutableProblogTheory).
|
|
2456
|
-
return this.
|
|
2455
|
+
protoOf(MappedMutableProblogTheory).c1t = function (head) {
|
|
2456
|
+
return this.m1l(Companion_instance_3.of(head, [Companion_getInstance_0().anonymous()]));
|
|
2457
2457
|
};
|
|
2458
2458
|
protoOf(MappedMutableProblogTheory).retractAllByHead = function (head) {
|
|
2459
|
-
return this.
|
|
2459
|
+
return this.c1t(head);
|
|
2460
2460
|
};
|
|
2461
|
-
protoOf(MappedMutableProblogTheory).
|
|
2462
|
-
return this.
|
|
2461
|
+
protoOf(MappedMutableProblogTheory).v1r = function (unificator) {
|
|
2462
|
+
return this.a3a_1.v1r(unificator);
|
|
2463
2463
|
};
|
|
2464
2464
|
protoOf(MappedMutableProblogTheory).setUnificator = function (unificator) {
|
|
2465
|
-
return this.
|
|
2465
|
+
return this.v1r(unificator);
|
|
2466
2466
|
};
|
|
2467
|
-
protoOf(MappedMutableProblogTheory).
|
|
2468
|
-
return this.
|
|
2467
|
+
protoOf(MappedMutableProblogTheory).e10 = function (tags) {
|
|
2468
|
+
return this.a3a_1.e10(tags);
|
|
2469
2469
|
};
|
|
2470
2470
|
protoOf(MappedMutableProblogTheory).resetTags = function (tags) {
|
|
2471
|
-
return this.
|
|
2471
|
+
return this.e10(tags);
|
|
2472
2472
|
};
|
|
2473
|
-
protoOf(MappedMutableProblogTheory).
|
|
2474
|
-
return this.
|
|
2473
|
+
protoOf(MappedMutableProblogTheory).j1s = function () {
|
|
2474
|
+
return this.a3a_1.j1s();
|
|
2475
2475
|
};
|
|
2476
2476
|
protoOf(MappedMutableProblogTheory).clone = function () {
|
|
2477
|
-
return this.
|
|
2477
|
+
return this.j1s();
|
|
2478
2478
|
};
|
|
2479
2479
|
protoOf(MappedMutableProblogTheory).contains = function (clause) {
|
|
2480
|
-
return this.
|
|
2480
|
+
return this.a3a_1.contains(clause);
|
|
2481
2481
|
};
|
|
2482
2482
|
protoOf(MappedMutableProblogTheory).containsHead = function (head) {
|
|
2483
|
-
return this.
|
|
2483
|
+
return this.a3a_1.containsHead(head);
|
|
2484
2484
|
};
|
|
2485
2485
|
protoOf(MappedMutableProblogTheory).containsIndicator = function (indicator) {
|
|
2486
|
-
return this.
|
|
2486
|
+
return this.a3a_1.containsIndicator(indicator);
|
|
2487
2487
|
};
|
|
2488
2488
|
protoOf(MappedMutableProblogTheory).get = function (clause) {
|
|
2489
|
-
return this.
|
|
2489
|
+
return this.a3a_1.get(clause);
|
|
2490
2490
|
};
|
|
2491
2491
|
protoOf(MappedMutableProblogTheory).getByHead = function (head) {
|
|
2492
|
-
return this.
|
|
2492
|
+
return this.a3a_1.getByHead(head);
|
|
2493
2493
|
};
|
|
2494
2494
|
protoOf(MappedMutableProblogTheory).getByIndicator = function (indicator) {
|
|
2495
|
-
return this.
|
|
2495
|
+
return this.a3a_1.getByIndicator(indicator);
|
|
2496
2496
|
};
|
|
2497
2497
|
protoOf(MappedMutableProblogTheory).toStringAsProlog = function (asPrologText) {
|
|
2498
|
-
return this.
|
|
2498
|
+
return this.a3a_1.toStringAsProlog(asPrologText);
|
|
2499
2499
|
};
|
|
2500
2500
|
protoOf(MappedMutableProblogTheory).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
2501
|
-
return this.
|
|
2501
|
+
return this.a3a_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
2502
2502
|
};
|
|
2503
|
-
protoOf(MappedMutableProblogTheory).
|
|
2504
|
-
return this.
|
|
2503
|
+
protoOf(MappedMutableProblogTheory).e1l = function () {
|
|
2504
|
+
return this.a3a_1.e1l();
|
|
2505
2505
|
};
|
|
2506
|
-
protoOf(MappedMutableProblogTheory).
|
|
2507
|
-
return this.
|
|
2506
|
+
protoOf(MappedMutableProblogTheory).x1k = function () {
|
|
2507
|
+
return this.a3a_1.x1k();
|
|
2508
2508
|
};
|
|
2509
|
-
protoOf(MappedMutableProblogTheory).
|
|
2510
|
-
return this.
|
|
2509
|
+
protoOf(MappedMutableProblogTheory).z1k = function () {
|
|
2510
|
+
return this.a3a_1.z1k();
|
|
2511
2511
|
};
|
|
2512
|
-
protoOf(MappedMutableProblogTheory).
|
|
2513
|
-
return this.
|
|
2512
|
+
protoOf(MappedMutableProblogTheory).u1r = function () {
|
|
2513
|
+
return this.a3a_1.u1r();
|
|
2514
2514
|
};
|
|
2515
2515
|
protoOf(MappedMutableProblogTheory).n = function () {
|
|
2516
|
-
return this.
|
|
2516
|
+
return this.a3a_1.n();
|
|
2517
2517
|
};
|
|
2518
2518
|
protoOf(MappedMutableProblogTheory).getTag = function (name) {
|
|
2519
|
-
return this.
|
|
2519
|
+
return this.a3a_1.getTag(name);
|
|
2520
2520
|
};
|
|
2521
2521
|
protoOf(MappedMutableProblogTheory).containsTag = function (name) {
|
|
2522
|
-
return this.
|
|
2522
|
+
return this.a3a_1.containsTag(name);
|
|
2523
2523
|
};
|
|
2524
|
-
protoOf(MappedMutableProblogTheory).
|
|
2525
|
-
return this.
|
|
2524
|
+
protoOf(MappedMutableProblogTheory).pr = function () {
|
|
2525
|
+
return this.a3a_1.pr();
|
|
2526
2526
|
};
|
|
2527
|
-
protoOf(MappedMutableProblogTheory).
|
|
2528
|
-
return this.
|
|
2527
|
+
protoOf(MappedMutableProblogTheory).u1k = function () {
|
|
2528
|
+
return this.a3a_1.u1k();
|
|
2529
2529
|
};
|
|
2530
2530
|
function MappedProblogTheory(clauses, unificator, theory) {
|
|
2531
|
-
unificator = unificator === VOID ? Companion_getInstance_8().
|
|
2531
|
+
unificator = unificator === VOID ? Companion_getInstance_8().n1k() : unificator;
|
|
2532
2532
|
var tmp;
|
|
2533
2533
|
if (theory === VOID) {
|
|
2534
2534
|
var tmp_0 = Companion_instance_7;
|
|
@@ -2542,7 +2542,7 @@
|
|
|
2542
2542
|
var _iterator__ex2g4s = clauses.n();
|
|
2543
2543
|
while (_iterator__ex2g4s.q()) {
|
|
2544
2544
|
var element = _iterator__ex2g4s.r();
|
|
2545
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2545
|
+
var list = ClauseMappingUtils_getInstance().y39(element);
|
|
2546
2546
|
addAll(destination, list);
|
|
2547
2547
|
}
|
|
2548
2548
|
tmp_1 = destination;
|
|
@@ -2553,102 +2553,102 @@
|
|
|
2553
2553
|
tmp = theory;
|
|
2554
2554
|
}
|
|
2555
2555
|
theory = tmp;
|
|
2556
|
-
this.
|
|
2556
|
+
this.c3a_1 = theory;
|
|
2557
2557
|
}
|
|
2558
|
-
protoOf(MappedProblogTheory).
|
|
2558
|
+
protoOf(MappedProblogTheory).k1s = function () {
|
|
2559
2559
|
return false;
|
|
2560
2560
|
};
|
|
2561
|
-
protoOf(MappedProblogTheory).
|
|
2562
|
-
return Companion_instance_8.ofIterable(this.
|
|
2561
|
+
protoOf(MappedProblogTheory).x1s = function () {
|
|
2562
|
+
return Companion_instance_8.ofIterable(this.u1k(), this);
|
|
2563
2563
|
};
|
|
2564
2564
|
protoOf(MappedProblogTheory).toMutableTheory = function () {
|
|
2565
|
-
return this.
|
|
2565
|
+
return this.x1s();
|
|
2566
2566
|
};
|
|
2567
|
-
protoOf(MappedProblogTheory).
|
|
2567
|
+
protoOf(MappedProblogTheory).k1r = function () {
|
|
2568
2568
|
return this;
|
|
2569
2569
|
};
|
|
2570
2570
|
protoOf(MappedProblogTheory).toImmutableTheory = function () {
|
|
2571
|
-
return this.
|
|
2571
|
+
return this.k1r();
|
|
2572
2572
|
};
|
|
2573
|
-
protoOf(MappedProblogTheory).
|
|
2574
|
-
return new MappedProblogTheory(null, this.
|
|
2573
|
+
protoOf(MappedProblogTheory).b3a = function (theory) {
|
|
2574
|
+
return new MappedProblogTheory(null, this.u1k(), this.c3a_1.plusTheory(theory));
|
|
2575
2575
|
};
|
|
2576
|
-
protoOf(MappedProblogTheory).
|
|
2576
|
+
protoOf(MappedProblogTheory).x1r = function (theory) {
|
|
2577
2577
|
var tmp;
|
|
2578
2578
|
if (isInterface(theory, ProblogTheory)) {
|
|
2579
|
-
tmp = this.
|
|
2579
|
+
tmp = this.b3a(theory);
|
|
2580
2580
|
} else {
|
|
2581
|
-
tmp = this.
|
|
2581
|
+
tmp = this.b3a(new MappedProblogTheory(theory, this.u1k()));
|
|
2582
2582
|
}
|
|
2583
2583
|
return tmp;
|
|
2584
2584
|
};
|
|
2585
2585
|
protoOf(MappedProblogTheory).plusTheory = function (theory) {
|
|
2586
|
-
return this.
|
|
2586
|
+
return this.x1r(theory);
|
|
2587
2587
|
};
|
|
2588
|
-
protoOf(MappedProblogTheory).
|
|
2589
|
-
var mapped = ClauseMappingUtils_getInstance().
|
|
2590
|
-
return new MappedProblogTheory(null, this.
|
|
2588
|
+
protoOf(MappedProblogTheory).l1r = function (clause) {
|
|
2589
|
+
var mapped = ClauseMappingUtils_getInstance().y39(clause);
|
|
2590
|
+
return new MappedProblogTheory(null, this.u1k(), this.c3a_1.plusTheory(Companion_instance_7.indexedOfIterable(this.u1k(), mapped)));
|
|
2591
2591
|
};
|
|
2592
2592
|
protoOf(MappedProblogTheory).plus = function (clause) {
|
|
2593
|
-
return this.
|
|
2593
|
+
return this.l1r(clause);
|
|
2594
2594
|
};
|
|
2595
|
-
protoOf(MappedProblogTheory).
|
|
2595
|
+
protoOf(MappedProblogTheory).b1s = function (clauses) {
|
|
2596
2596
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2597
2597
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
2598
2598
|
var destination = ArrayList_init_$Create$_0();
|
|
2599
2599
|
var _iterator__ex2g4s = clauses.n();
|
|
2600
2600
|
while (_iterator__ex2g4s.q()) {
|
|
2601
2601
|
var element = _iterator__ex2g4s.r();
|
|
2602
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2602
|
+
var list = ClauseMappingUtils_getInstance().y39(element);
|
|
2603
2603
|
addAll(destination, list);
|
|
2604
2604
|
}
|
|
2605
2605
|
var mapped = destination;
|
|
2606
|
-
return new MappedProblogTheory(null, this.
|
|
2606
|
+
return new MappedProblogTheory(null, this.u1k(), this.c3a_1.assertAIterable(mapped));
|
|
2607
2607
|
};
|
|
2608
2608
|
protoOf(MappedProblogTheory).assertAIterable = function (clauses) {
|
|
2609
|
-
return this.
|
|
2609
|
+
return this.b1s(clauses);
|
|
2610
2610
|
};
|
|
2611
|
-
protoOf(MappedProblogTheory).
|
|
2611
|
+
protoOf(MappedProblogTheory).e1s = function (clauses) {
|
|
2612
2612
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2613
2613
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
2614
2614
|
var destination = ArrayList_init_$Create$_0();
|
|
2615
2615
|
var _iterator__ex2g4s = clauses.n();
|
|
2616
2616
|
while (_iterator__ex2g4s.q()) {
|
|
2617
2617
|
var element = _iterator__ex2g4s.r();
|
|
2618
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2618
|
+
var list = ClauseMappingUtils_getInstance().y39(element);
|
|
2619
2619
|
addAll(destination, list);
|
|
2620
2620
|
}
|
|
2621
2621
|
var mapped = destination;
|
|
2622
|
-
return new MappedProblogTheory(null, this.
|
|
2622
|
+
return new MappedProblogTheory(null, this.u1k(), this.c3a_1.assertZIterable(mapped));
|
|
2623
2623
|
};
|
|
2624
2624
|
protoOf(MappedProblogTheory).assertZIterable = function (clauses) {
|
|
2625
|
-
return this.
|
|
2625
|
+
return this.e1s(clauses);
|
|
2626
2626
|
};
|
|
2627
|
-
protoOf(MappedProblogTheory).
|
|
2627
|
+
protoOf(MappedProblogTheory).i1s = function (clauses) {
|
|
2628
2628
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2629
2629
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
2630
2630
|
var destination = ArrayList_init_$Create$_0();
|
|
2631
2631
|
var _iterator__ex2g4s = clauses.n();
|
|
2632
2632
|
while (_iterator__ex2g4s.q()) {
|
|
2633
2633
|
var element = _iterator__ex2g4s.r();
|
|
2634
|
-
var list = ClauseMappingUtils_getInstance().
|
|
2634
|
+
var list = ClauseMappingUtils_getInstance().y39(element);
|
|
2635
2635
|
addAll(destination, list);
|
|
2636
2636
|
}
|
|
2637
2637
|
var mapped = destination;
|
|
2638
|
-
var result = this.
|
|
2638
|
+
var result = this.c3a_1.retractIterable(mapped);
|
|
2639
2639
|
var tmp;
|
|
2640
2640
|
if (result instanceof Success) {
|
|
2641
|
-
tmp = new Success(new MappedProblogTheory(null, this.
|
|
2641
|
+
tmp = new Success(new MappedProblogTheory(null, this.u1k(), result.d1t_1), result.e1t_1);
|
|
2642
2642
|
} else {
|
|
2643
|
-
tmp = new Failure(new MappedProblogTheory(null, this.
|
|
2643
|
+
tmp = new Failure(new MappedProblogTheory(null, this.u1k(), result.r1r()));
|
|
2644
2644
|
}
|
|
2645
2645
|
return tmp;
|
|
2646
2646
|
};
|
|
2647
2647
|
protoOf(MappedProblogTheory).retractIterable = function (clauses) {
|
|
2648
|
-
return this.
|
|
2648
|
+
return this.i1s(clauses);
|
|
2649
2649
|
};
|
|
2650
|
-
protoOf(MappedProblogTheory).
|
|
2651
|
-
var mappedClauses = ClauseMappingUtils_getInstance().
|
|
2650
|
+
protoOf(MappedProblogTheory).m1l = function (clause) {
|
|
2651
|
+
var mappedClauses = ClauseMappingUtils_getInstance().y39(clause);
|
|
2652
2652
|
var result = null;
|
|
2653
2653
|
var _iterator__ex2g4s = mappedClauses.n();
|
|
2654
2654
|
while (_iterator__ex2g4s.q()) {
|
|
@@ -2660,152 +2660,152 @@
|
|
|
2660
2660
|
tmp = !(result instanceof Failure);
|
|
2661
2661
|
}
|
|
2662
2662
|
if (tmp) {
|
|
2663
|
-
result = this.
|
|
2663
|
+
result = this.c3a_1.retractAll(c);
|
|
2664
2664
|
}
|
|
2665
2665
|
}
|
|
2666
2666
|
var tmp_0;
|
|
2667
2667
|
if (result instanceof Success) {
|
|
2668
|
-
tmp_0 = new Success(new MappedProblogTheory(null, this.
|
|
2668
|
+
tmp_0 = new Success(new MappedProblogTheory(null, this.u1k(), result.d1t_1), result.e1t_1);
|
|
2669
2669
|
} else {
|
|
2670
2670
|
tmp_0 = new Failure(this);
|
|
2671
2671
|
}
|
|
2672
2672
|
return tmp_0;
|
|
2673
2673
|
};
|
|
2674
2674
|
protoOf(MappedProblogTheory).retractAll = function (clause) {
|
|
2675
|
-
return this.
|
|
2675
|
+
return this.m1l(clause);
|
|
2676
2676
|
};
|
|
2677
|
-
protoOf(MappedProblogTheory).
|
|
2678
|
-
return new MappedProblogTheory(null, this.
|
|
2677
|
+
protoOf(MappedProblogTheory).q1r = function (indicator) {
|
|
2678
|
+
return new MappedProblogTheory(null, this.u1k(), this.c3a_1.abolish(ClauseMappingUtils_getInstance().z39(indicator)));
|
|
2679
2679
|
};
|
|
2680
2680
|
protoOf(MappedProblogTheory).abolish = function (indicator) {
|
|
2681
|
-
return this.
|
|
2681
|
+
return this.q1r(indicator);
|
|
2682
2682
|
};
|
|
2683
|
-
protoOf(MappedProblogTheory).
|
|
2684
|
-
return this.
|
|
2683
|
+
protoOf(MappedProblogTheory).y1s = function (struct) {
|
|
2684
|
+
return this.z1r(Companion_instance.of(struct));
|
|
2685
2685
|
};
|
|
2686
2686
|
protoOf(MappedProblogTheory).assertAFact = function (struct) {
|
|
2687
|
-
return this.
|
|
2687
|
+
return this.y1s(struct);
|
|
2688
2688
|
};
|
|
2689
|
-
protoOf(MappedProblogTheory).
|
|
2690
|
-
return this.
|
|
2689
|
+
protoOf(MappedProblogTheory).z1s = function (struct) {
|
|
2690
|
+
return this.d1s(Companion_instance.of(struct));
|
|
2691
2691
|
};
|
|
2692
2692
|
protoOf(MappedProblogTheory).assertZFact = function (struct) {
|
|
2693
|
-
return this.
|
|
2693
|
+
return this.z1s(struct);
|
|
2694
2694
|
};
|
|
2695
|
-
protoOf(MappedProblogTheory).
|
|
2696
|
-
return this.
|
|
2695
|
+
protoOf(MappedProblogTheory).z1r = function (clause) {
|
|
2696
|
+
return this.b1s(listOf(clause));
|
|
2697
2697
|
};
|
|
2698
2698
|
protoOf(MappedProblogTheory).assertA = function (clause) {
|
|
2699
|
-
return this.
|
|
2699
|
+
return this.z1r(clause);
|
|
2700
2700
|
};
|
|
2701
|
-
protoOf(MappedProblogTheory).
|
|
2702
|
-
return this.
|
|
2701
|
+
protoOf(MappedProblogTheory).c1s = function (clauses) {
|
|
2702
|
+
return this.b1s(asIterable_0(clauses));
|
|
2703
2703
|
};
|
|
2704
2704
|
protoOf(MappedProblogTheory).assertASequence = function (clauses) {
|
|
2705
|
-
return this.
|
|
2705
|
+
return this.c1s(clauses);
|
|
2706
2706
|
};
|
|
2707
|
-
protoOf(MappedProblogTheory).
|
|
2708
|
-
return this.
|
|
2707
|
+
protoOf(MappedProblogTheory).d1s = function (clause) {
|
|
2708
|
+
return this.e1s(listOf(clause));
|
|
2709
2709
|
};
|
|
2710
2710
|
protoOf(MappedProblogTheory).assertZ = function (clause) {
|
|
2711
|
-
return this.
|
|
2711
|
+
return this.d1s(clause);
|
|
2712
2712
|
};
|
|
2713
|
-
protoOf(MappedProblogTheory).
|
|
2714
|
-
return this.
|
|
2713
|
+
protoOf(MappedProblogTheory).f1s = function (clauses) {
|
|
2714
|
+
return this.e1s(asIterable_0(clauses));
|
|
2715
2715
|
};
|
|
2716
2716
|
protoOf(MappedProblogTheory).assertZSequence = function (clauses) {
|
|
2717
|
-
return this.
|
|
2717
|
+
return this.f1s(clauses);
|
|
2718
2718
|
};
|
|
2719
|
-
protoOf(MappedProblogTheory).
|
|
2720
|
-
return this.
|
|
2719
|
+
protoOf(MappedProblogTheory).b1t = function (head) {
|
|
2720
|
+
return this.a1t(Companion_instance_3.of(head, [Companion_getInstance_0().anonymous()]));
|
|
2721
2721
|
};
|
|
2722
2722
|
protoOf(MappedProblogTheory).retractByHead = function (head) {
|
|
2723
|
-
return this.
|
|
2723
|
+
return this.b1t(head);
|
|
2724
2724
|
};
|
|
2725
|
-
protoOf(MappedProblogTheory).
|
|
2726
|
-
return this.
|
|
2725
|
+
protoOf(MappedProblogTheory).a1t = function (clause) {
|
|
2726
|
+
return this.i1s(listOf(clause));
|
|
2727
2727
|
};
|
|
2728
2728
|
protoOf(MappedProblogTheory).retract = function (clause) {
|
|
2729
|
-
return this.
|
|
2729
|
+
return this.a1t(clause);
|
|
2730
2730
|
};
|
|
2731
|
-
protoOf(MappedProblogTheory).
|
|
2732
|
-
return this.
|
|
2731
|
+
protoOf(MappedProblogTheory).h1s = function (clauses) {
|
|
2732
|
+
return this.i1s(asIterable_0(clauses));
|
|
2733
2733
|
};
|
|
2734
2734
|
protoOf(MappedProblogTheory).retractSequence = function (clauses) {
|
|
2735
|
-
return this.
|
|
2735
|
+
return this.h1s(clauses);
|
|
2736
2736
|
};
|
|
2737
|
-
protoOf(MappedProblogTheory).
|
|
2738
|
-
return this.
|
|
2737
|
+
protoOf(MappedProblogTheory).c1t = function (head) {
|
|
2738
|
+
return this.m1l(Companion_instance_3.of(head, [Companion_getInstance_0().anonymous()]));
|
|
2739
2739
|
};
|
|
2740
2740
|
protoOf(MappedProblogTheory).retractAllByHead = function (head) {
|
|
2741
|
-
return this.
|
|
2741
|
+
return this.c1t(head);
|
|
2742
2742
|
};
|
|
2743
2743
|
protoOf(MappedProblogTheory).setUnificator = function (unificator) {
|
|
2744
|
-
return this.
|
|
2744
|
+
return this.c3a_1.setUnificator(unificator);
|
|
2745
2745
|
};
|
|
2746
2746
|
protoOf(MappedProblogTheory).contains = function (clause) {
|
|
2747
|
-
return this.
|
|
2747
|
+
return this.c3a_1.contains(clause);
|
|
2748
2748
|
};
|
|
2749
2749
|
protoOf(MappedProblogTheory).containsHead = function (head) {
|
|
2750
|
-
return this.
|
|
2750
|
+
return this.c3a_1.containsHead(head);
|
|
2751
2751
|
};
|
|
2752
2752
|
protoOf(MappedProblogTheory).containsIndicator = function (indicator) {
|
|
2753
|
-
return this.
|
|
2753
|
+
return this.c3a_1.containsIndicator(indicator);
|
|
2754
2754
|
};
|
|
2755
2755
|
protoOf(MappedProblogTheory).get = function (clause) {
|
|
2756
|
-
return this.
|
|
2756
|
+
return this.c3a_1.get(clause);
|
|
2757
2757
|
};
|
|
2758
2758
|
protoOf(MappedProblogTheory).getByHead = function (head) {
|
|
2759
|
-
return this.
|
|
2759
|
+
return this.c3a_1.getByHead(head);
|
|
2760
2760
|
};
|
|
2761
2761
|
protoOf(MappedProblogTheory).getByIndicator = function (indicator) {
|
|
2762
|
-
return this.
|
|
2762
|
+
return this.c3a_1.getByIndicator(indicator);
|
|
2763
2763
|
};
|
|
2764
2764
|
protoOf(MappedProblogTheory).toStringAsProlog = function (asPrologText) {
|
|
2765
|
-
return this.
|
|
2765
|
+
return this.c3a_1.toStringAsProlog(asPrologText);
|
|
2766
2766
|
};
|
|
2767
2767
|
protoOf(MappedProblogTheory).equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
2768
|
-
return this.
|
|
2768
|
+
return this.c3a_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
2769
2769
|
};
|
|
2770
2770
|
protoOf(MappedProblogTheory).clone = function () {
|
|
2771
|
-
return this.
|
|
2771
|
+
return this.c3a_1.clone();
|
|
2772
2772
|
};
|
|
2773
|
-
protoOf(MappedProblogTheory).
|
|
2774
|
-
return this.
|
|
2773
|
+
protoOf(MappedProblogTheory).e1l = function () {
|
|
2774
|
+
return this.c3a_1.e1l();
|
|
2775
2775
|
};
|
|
2776
|
-
protoOf(MappedProblogTheory).
|
|
2777
|
-
return this.
|
|
2776
|
+
protoOf(MappedProblogTheory).x1k = function () {
|
|
2777
|
+
return this.c3a_1.x1k();
|
|
2778
2778
|
};
|
|
2779
|
-
protoOf(MappedProblogTheory).
|
|
2780
|
-
return this.
|
|
2779
|
+
protoOf(MappedProblogTheory).z1k = function () {
|
|
2780
|
+
return this.c3a_1.z1k();
|
|
2781
2781
|
};
|
|
2782
|
-
protoOf(MappedProblogTheory).
|
|
2783
|
-
return this.
|
|
2782
|
+
protoOf(MappedProblogTheory).u1r = function () {
|
|
2783
|
+
return this.c3a_1.u1r();
|
|
2784
2784
|
};
|
|
2785
2785
|
protoOf(MappedProblogTheory).n = function () {
|
|
2786
|
-
return this.
|
|
2786
|
+
return this.c3a_1.n();
|
|
2787
2787
|
};
|
|
2788
2788
|
protoOf(MappedProblogTheory).getTag = function (name) {
|
|
2789
|
-
return this.
|
|
2789
|
+
return this.c3a_1.getTag(name);
|
|
2790
2790
|
};
|
|
2791
2791
|
protoOf(MappedProblogTheory).resetTags = function (tags) {
|
|
2792
|
-
return this.
|
|
2792
|
+
return this.c3a_1.resetTags(tags);
|
|
2793
2793
|
};
|
|
2794
2794
|
protoOf(MappedProblogTheory).containsTag = function (name) {
|
|
2795
|
-
return this.
|
|
2795
|
+
return this.c3a_1.containsTag(name);
|
|
2796
2796
|
};
|
|
2797
|
-
protoOf(MappedProblogTheory).
|
|
2798
|
-
return this.
|
|
2797
|
+
protoOf(MappedProblogTheory).pr = function () {
|
|
2798
|
+
return this.c3a_1.pr();
|
|
2799
2799
|
};
|
|
2800
|
-
protoOf(MappedProblogTheory).
|
|
2801
|
-
return this.
|
|
2800
|
+
protoOf(MappedProblogTheory).u1k = function () {
|
|
2801
|
+
return this.c3a_1.u1k();
|
|
2802
2802
|
};
|
|
2803
2803
|
function NothingClauseMapper() {
|
|
2804
2804
|
}
|
|
2805
|
-
protoOf(NothingClauseMapper).
|
|
2805
|
+
protoOf(NothingClauseMapper).m39 = function (clause) {
|
|
2806
2806
|
return true;
|
|
2807
2807
|
};
|
|
2808
|
-
protoOf(NothingClauseMapper).
|
|
2808
|
+
protoOf(NothingClauseMapper).n39 = function (clause) {
|
|
2809
2809
|
return listOf(clause);
|
|
2810
2810
|
};
|
|
2811
2811
|
var NothingClauseMapper_instance;
|
|
@@ -2814,63 +2814,63 @@
|
|
|
2814
2814
|
}
|
|
2815
2815
|
function ProbabilisticClauseMapper() {
|
|
2816
2816
|
}
|
|
2817
|
-
protoOf(ProbabilisticClauseMapper).
|
|
2817
|
+
protoOf(ProbabilisticClauseMapper).m39 = function (clause) {
|
|
2818
2818
|
var tmp;
|
|
2819
2819
|
if (isInterface(clause, Rule)) {
|
|
2820
|
-
tmp = clause.
|
|
2820
|
+
tmp = clause.gw().au() === '::';
|
|
2821
2821
|
} else {
|
|
2822
2822
|
tmp = false;
|
|
2823
2823
|
}
|
|
2824
2824
|
return tmp;
|
|
2825
2825
|
};
|
|
2826
|
-
protoOf(ProbabilisticClauseMapper).
|
|
2826
|
+
protoOf(ProbabilisticClauseMapper).n39 = function (clause) {
|
|
2827
2827
|
if (!isInterface(clause, Rule)) {
|
|
2828
2828
|
throw new ClauseMappingException('Clause is not an instance of Rule: ' + clause.toString());
|
|
2829
2829
|
}
|
|
2830
|
-
var mapped = this.
|
|
2831
|
-
return listOf(this.
|
|
2830
|
+
var mapped = this.o39(clause);
|
|
2831
|
+
return listOf(this.p39(mapped.first, Companion_getInstance_11().b39(mapped.second)));
|
|
2832
2832
|
};
|
|
2833
|
-
protoOf(ProbabilisticClauseMapper).
|
|
2834
|
-
if (!(rule.
|
|
2835
|
-
throw TuPrologException_init_$Create$('Invalid probabilistic rule: ' + rule.
|
|
2833
|
+
protoOf(ProbabilisticClauseMapper).o39 = function (rule) {
|
|
2834
|
+
if (!(rule.gw().ut() === 2)) {
|
|
2835
|
+
throw TuPrologException_init_$Create$('Invalid probabilistic rule: ' + rule.gw().toString());
|
|
2836
2836
|
}
|
|
2837
|
-
var probTerm = rule.
|
|
2837
|
+
var probTerm = rule.gw().get(0);
|
|
2838
2838
|
var tmp;
|
|
2839
2839
|
if (isInterface(probTerm, Numeric)) {
|
|
2840
|
-
tmp = probTerm.
|
|
2840
|
+
tmp = probTerm.qy().toDouble();
|
|
2841
2841
|
} else {
|
|
2842
2842
|
tmp = solveArithmeticExpression(probTerm);
|
|
2843
2843
|
}
|
|
2844
2844
|
var probability = tmp;
|
|
2845
|
-
var headTerm = safeToStruct(rule.
|
|
2846
|
-
if (headTerm.
|
|
2847
|
-
throw TuPrologException_init_$Create$("Probability notation can't be expressed on evidence: " + rule.
|
|
2845
|
+
var headTerm = safeToStruct(rule.gw().get(1));
|
|
2846
|
+
if (headTerm.au() === 'evidence') {
|
|
2847
|
+
throw TuPrologException_init_$Create$("Probability notation can't be expressed on evidence: " + rule.gw().toString());
|
|
2848
2848
|
}
|
|
2849
|
-
var bodyTerm = rule.
|
|
2850
|
-
var tmp_0 = rule.
|
|
2849
|
+
var bodyTerm = rule.hw();
|
|
2850
|
+
var tmp_0 = rule.hw();
|
|
2851
2851
|
if (isInterface(tmp_0, Truth)) {
|
|
2852
|
-
if (!rule.
|
|
2852
|
+
if (!rule.hw().yt() && probability < 1.0) {
|
|
2853
2853
|
probability = 1.0 - probability;
|
|
2854
2854
|
bodyTerm = Companion_getInstance_7().of(true);
|
|
2855
2855
|
}
|
|
2856
2856
|
}
|
|
2857
2857
|
var anonVariablesFix = withoutAnonymousVars(Companion_instance_3.of(headTerm, [bodyTerm]));
|
|
2858
|
-
headTerm = anonVariablesFix.
|
|
2859
|
-
bodyTerm = anonVariablesFix.
|
|
2858
|
+
headTerm = anonVariablesFix.gw();
|
|
2859
|
+
bodyTerm = anonVariablesFix.hw();
|
|
2860
2860
|
var extraVariables = get_extraVariables(Companion_instance_3.of(headTerm, [bodyTerm]));
|
|
2861
|
-
var probTerm_0 = new ProbTerm(ClauseMappingUtils_getInstance().
|
|
2861
|
+
var probTerm_0 = new ProbTerm(ClauseMappingUtils_getInstance().x39(), probability, headTerm, extraVariables);
|
|
2862
2862
|
return new Pair(Companion_instance_3.of(headTerm, [bodyTerm]), probTerm_0);
|
|
2863
2863
|
};
|
|
2864
|
-
protoOf(ProbabilisticClauseMapper).
|
|
2865
|
-
var tmp = rule.
|
|
2864
|
+
protoOf(ProbabilisticClauseMapper).p39 = function (rule, explanation) {
|
|
2865
|
+
var tmp = rule.hw();
|
|
2866
2866
|
if (isInterface(tmp, Truth)) {
|
|
2867
|
-
return Companion_instance_3.of(withExplanation(rule.
|
|
2867
|
+
return Companion_instance_3.of(withExplanation(rule.gw(), toTerm(explanation)), [rule.hw()]);
|
|
2868
2868
|
}
|
|
2869
2869
|
var explanationVar = Companion_getInstance_0().of('EXPL_Res');
|
|
2870
2870
|
var explanationBodyVar = Companion_getInstance_0().of('EXPL_Body');
|
|
2871
|
-
var newBody = withBodyExplanation(rule.
|
|
2871
|
+
var newBody = withBodyExplanation(rule.hw(), explanationBodyVar);
|
|
2872
2872
|
var tmp_0 = Companion_instance_3;
|
|
2873
|
-
var tmp_1 = withExplanation(rule.
|
|
2873
|
+
var tmp_1 = withExplanation(rule.gw(), explanationVar);
|
|
2874
2874
|
var tmp_2 = Companion_getInstance_1();
|
|
2875
2875
|
var tmp_3 = Companion_getInstance_1();
|
|
2876
2876
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
@@ -2883,36 +2883,36 @@
|
|
|
2883
2883
|
}
|
|
2884
2884
|
function PrologClauseMapper() {
|
|
2885
2885
|
}
|
|
2886
|
-
protoOf(PrologClauseMapper).
|
|
2886
|
+
protoOf(PrologClauseMapper).m39 = function (clause) {
|
|
2887
2887
|
return isInterface(clause, Rule);
|
|
2888
2888
|
};
|
|
2889
|
-
protoOf(PrologClauseMapper).
|
|
2889
|
+
protoOf(PrologClauseMapper).n39 = function (clause) {
|
|
2890
2890
|
if (!isInterface(clause, Rule)) {
|
|
2891
2891
|
throw new ClauseMappingException('Clause is not an instance of Rule: ' + clause.toString());
|
|
2892
2892
|
}
|
|
2893
|
-
var tmp = clause.
|
|
2893
|
+
var tmp = clause.hw();
|
|
2894
2894
|
if (isInterface(tmp, Truth)) {
|
|
2895
|
-
return listOf(Companion_instance_3.of(withExplanation(clause.
|
|
2895
|
+
return listOf(Companion_instance_3.of(withExplanation(clause.gw(), toTerm(Companion_getInstance_11().x38_1)), [clause.hw()]));
|
|
2896
2896
|
}
|
|
2897
2897
|
var explanationVar = Companion_getInstance_0().of('EXPL_Res');
|
|
2898
|
-
return listOf(Companion_instance_3.of(withExplanation(clause.
|
|
2898
|
+
return listOf(Companion_instance_3.of(withExplanation(clause.gw(), explanationVar), [withBodyExplanation(clause.hw(), explanationVar)]));
|
|
2899
2899
|
};
|
|
2900
2900
|
var PrologClauseMapper_instance;
|
|
2901
2901
|
function PrologClauseMapper_getInstance() {
|
|
2902
2902
|
return PrologClauseMapper_instance;
|
|
2903
2903
|
}
|
|
2904
2904
|
function _get_prob__dc6m52($this, $receiver) {
|
|
2905
|
-
return $receiver.
|
|
2905
|
+
return $receiver.u37_1.j39();
|
|
2906
2906
|
}
|
|
2907
2907
|
function ProbExplAnd() {
|
|
2908
2908
|
ProbExplAnd_instance = this;
|
|
2909
2909
|
NonBacktrackable.call(this, 'prob_expl_and');
|
|
2910
2910
|
}
|
|
2911
|
-
protoOf(ProbExplAnd).
|
|
2912
|
-
Companion_getInstance_9().
|
|
2913
|
-
Companion_getInstance_9().
|
|
2914
|
-
if (ProbSetConfig_getInstance().
|
|
2915
|
-
return _this__u8e3s4.replyWith(Companion_getInstance_9().
|
|
2911
|
+
protoOf(ProbExplAnd).o2o = function (_this__u8e3s4, first, second, third) {
|
|
2912
|
+
Companion_getInstance_9().w2f(_this__u8e3s4, 1);
|
|
2913
|
+
Companion_getInstance_9().a2g(_this__u8e3s4, 1);
|
|
2914
|
+
if (ProbSetConfig_getInstance().e3a(_this__u8e3s4.context)) {
|
|
2915
|
+
return _this__u8e3s4.replyWith(Companion_getInstance_9().q2f(_this__u8e3s4, first, toTerm(Companion_getInstance_11().x38_1)), VOID, []);
|
|
2916
2916
|
}
|
|
2917
2917
|
var tmp;
|
|
2918
2918
|
var tmp_0;
|
|
@@ -2928,12 +2928,12 @@
|
|
|
2928
2928
|
tmp_0 = false;
|
|
2929
2929
|
}
|
|
2930
2930
|
if (tmp_0) {
|
|
2931
|
-
var explanation = _get_prob__dc6m52(this, second) === 0.0 || _get_prob__dc6m52(this, third) === 0.0 ? Companion_getInstance_11().
|
|
2931
|
+
var explanation = _get_prob__dc6m52(this, second) === 0.0 || _get_prob__dc6m52(this, third) === 0.0 ? Companion_getInstance_11().w38_1 : _get_prob__dc6m52(this, second) === 1.0 && _get_prob__dc6m52(this, third) === 1.0 ? Companion_getInstance_11().x38_1 : _get_prob__dc6m52(this, second) === 1.0 ? third.u37_1 : _get_prob__dc6m52(this, third) === 1.0 ? second.u37_1 : second.u37_1.and(third.u37_1);
|
|
2932
2932
|
var tmp_2;
|
|
2933
|
-
if (explanation.
|
|
2933
|
+
if (explanation.j39() === 0.0) {
|
|
2934
2934
|
tmp_2 = _this__u8e3s4.replyWithCondition(false, VOID, []);
|
|
2935
2935
|
} else {
|
|
2936
|
-
tmp_2 = _this__u8e3s4.replyWith(Companion_getInstance_9().
|
|
2936
|
+
tmp_2 = _this__u8e3s4.replyWith(Companion_getInstance_9().q2f(_this__u8e3s4, first, new ProbExplanationTerm(explanation)), VOID, []);
|
|
2937
2937
|
}
|
|
2938
2938
|
tmp = tmp_2;
|
|
2939
2939
|
} else {
|
|
@@ -2943,8 +2943,8 @@
|
|
|
2943
2943
|
}
|
|
2944
2944
|
return tmp;
|
|
2945
2945
|
};
|
|
2946
|
-
protoOf(ProbExplAnd).
|
|
2947
|
-
return this.
|
|
2946
|
+
protoOf(ProbExplAnd).w2h = function (_this__u8e3s4, first, second, third) {
|
|
2947
|
+
return this.o2o(_this__u8e3s4, first, second, third);
|
|
2948
2948
|
};
|
|
2949
2949
|
var ProbExplAnd_instance;
|
|
2950
2950
|
function ProbExplAnd_getInstance() {
|
|
@@ -2953,52 +2953,52 @@
|
|
|
2953
2953
|
return ProbExplAnd_instance;
|
|
2954
2954
|
}
|
|
2955
2955
|
function ProbHelper$computeAllSubstitutions$slambda($goal, $this_computeAllSubstitutions, $third, $first, $second, $goalSignature, resultContinuation) {
|
|
2956
|
-
this.
|
|
2957
|
-
this.
|
|
2958
|
-
this.
|
|
2959
|
-
this.
|
|
2960
|
-
this.
|
|
2961
|
-
this.
|
|
2956
|
+
this.n3a_1 = $goal;
|
|
2957
|
+
this.o3a_1 = $this_computeAllSubstitutions;
|
|
2958
|
+
this.p3a_1 = $third;
|
|
2959
|
+
this.q3a_1 = $first;
|
|
2960
|
+
this.r3a_1 = $second;
|
|
2961
|
+
this.s3a_1 = $goalSignature;
|
|
2962
2962
|
CoroutineImpl.call(this, resultContinuation);
|
|
2963
2963
|
}
|
|
2964
|
-
protoOf(ProbHelper$computeAllSubstitutions$slambda).
|
|
2965
|
-
var tmp = this.
|
|
2966
|
-
tmp.
|
|
2967
|
-
tmp.
|
|
2968
|
-
return tmp.
|
|
2964
|
+
protoOf(ProbHelper$computeAllSubstitutions$slambda).f2q = function ($this$sequence, $completion) {
|
|
2965
|
+
var tmp = this.g2q($this$sequence, $completion);
|
|
2966
|
+
tmp.e8_1 = Unit_instance;
|
|
2967
|
+
tmp.f8_1 = null;
|
|
2968
|
+
return tmp.k8();
|
|
2969
2969
|
};
|
|
2970
|
-
protoOf(ProbHelper$computeAllSubstitutions$slambda).
|
|
2971
|
-
return this.
|
|
2970
|
+
protoOf(ProbHelper$computeAllSubstitutions$slambda).b9 = function (p1, $completion) {
|
|
2971
|
+
return this.f2q(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
|
|
2972
2972
|
};
|
|
2973
|
-
protoOf(ProbHelper$computeAllSubstitutions$slambda).
|
|
2974
|
-
var suspendResult = this.
|
|
2973
|
+
protoOf(ProbHelper$computeAllSubstitutions$slambda).k8 = function () {
|
|
2974
|
+
var suspendResult = this.e8_1;
|
|
2975
2975
|
$sm: do
|
|
2976
2976
|
try {
|
|
2977
|
-
var tmp = this.
|
|
2977
|
+
var tmp = this.c8_1;
|
|
2978
2978
|
switch (tmp) {
|
|
2979
2979
|
case 0:
|
|
2980
|
-
this.
|
|
2981
|
-
var tmp0_subject = this.
|
|
2980
|
+
this.d8_1 = 18;
|
|
2981
|
+
var tmp0_subject = this.n3a_1.au();
|
|
2982
2982
|
switch (tmp0_subject) {
|
|
2983
2983
|
case '\\+':
|
|
2984
2984
|
case 'not':
|
|
2985
|
-
this.
|
|
2985
|
+
this.c8_1 = 16;
|
|
2986
2986
|
var tmp_0;
|
|
2987
|
-
if (ProbSetConfig_getInstance().
|
|
2987
|
+
if (ProbSetConfig_getInstance().e3a(this.o3a_1.context)) {
|
|
2988
2988
|
var tmp_1 = Companion_getInstance_9();
|
|
2989
2989
|
var tmp_2 = Companion_getInstance_1();
|
|
2990
|
-
var tmp_3 = this.
|
|
2990
|
+
var tmp_3 = this.n3a_1.au();
|
|
2991
2991
|
var tmp_4 = Companion_getInstance_1();
|
|
2992
2992
|
var this_0 = Prob_getInstance();
|
|
2993
|
-
tmp_0 = tmp_1.
|
|
2993
|
+
tmp_0 = tmp_1.q2f(this.o3a_1, this.p3a_1, tmp_2.of(tmp_3, [tmp_4.of(this_0.signature.name, [Companion_getInstance_0().anonymous(), this.n3a_1.get(0)])])).plus(Companion_getInstance_9().q2f(this.o3a_1, this.q3a_1, toTerm(Companion_getInstance_11().x38_1)));
|
|
2994
2994
|
} else {
|
|
2995
2995
|
var tmp_5 = Companion_getInstance_9();
|
|
2996
2996
|
var tmp_6 = Companion_getInstance_1();
|
|
2997
2997
|
var this_1 = ProbNegationAsFailure_getInstance();
|
|
2998
|
-
tmp_0 = tmp_5.
|
|
2998
|
+
tmp_0 = tmp_5.q2f(this.o3a_1, this.p3a_1, tmp_6.of(this_1.signature.name, [this.q3a_1, this.n3a_1.get(0)]));
|
|
2999
2999
|
}
|
|
3000
3000
|
|
|
3001
|
-
suspendResult = this.
|
|
3001
|
+
suspendResult = this.t3a_1.cd(tmp_0, this);
|
|
3002
3002
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3003
3003
|
return suspendResult;
|
|
3004
3004
|
}
|
|
@@ -3009,15 +3009,15 @@
|
|
|
3009
3009
|
case ',':
|
|
3010
3010
|
case ';':
|
|
3011
3011
|
case '->':
|
|
3012
|
-
this.
|
|
3012
|
+
this.c8_1 = 15;
|
|
3013
3013
|
var tmp_7;
|
|
3014
|
-
if (ProbSetConfig_getInstance().
|
|
3015
|
-
tmp_7 = Companion_getInstance_9().
|
|
3014
|
+
if (ProbSetConfig_getInstance().e3a(this.o3a_1.context)) {
|
|
3015
|
+
tmp_7 = Companion_getInstance_9().q2f(this.o3a_1, this.p3a_1, withBodyExplanation(this.n3a_1, Companion_getInstance_0().anonymous())).plus(Companion_getInstance_9().q2f(this.o3a_1, this.q3a_1, toTerm(Companion_getInstance_11().x38_1)));
|
|
3016
3016
|
} else {
|
|
3017
|
-
tmp_7 = Companion_getInstance_9().
|
|
3017
|
+
tmp_7 = Companion_getInstance_9().q2f(this.o3a_1, this.p3a_1, withBodyExplanation(this.n3a_1, this.q3a_1));
|
|
3018
3018
|
}
|
|
3019
3019
|
|
|
3020
|
-
suspendResult = this.
|
|
3020
|
+
suspendResult = this.t3a_1.cd(tmp_7, this);
|
|
3021
3021
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3022
3022
|
return suspendResult;
|
|
3023
3023
|
}
|
|
@@ -3025,28 +3025,28 @@
|
|
|
3025
3025
|
continue $sm;
|
|
3026
3026
|
default:
|
|
3027
3027
|
if (tmp0_subject === 'call') {
|
|
3028
|
-
var newGoal = this.
|
|
3029
|
-
this.
|
|
3030
|
-
suspendResult = this.
|
|
3028
|
+
var newGoal = this.n3a_1.get(0);
|
|
3029
|
+
this.c8_1 = 14;
|
|
3030
|
+
suspendResult = this.t3a_1.cd(Companion_getInstance_9().q2f(this.o3a_1, this.p3a_1, Companion_instance_0.of(Companion_getInstance_1().of('ensure_executable', [newGoal]), Companion_getInstance_1().of(this.n3a_1.au(), [withBodyExplanation(newGoal, this.q3a_1)]))), this);
|
|
3031
3031
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3032
3032
|
return suspendResult;
|
|
3033
3033
|
}
|
|
3034
3034
|
continue $sm;
|
|
3035
3035
|
} else {
|
|
3036
3036
|
if (tmp0_subject === 'catch') {
|
|
3037
|
-
this.
|
|
3038
|
-
suspendResult = this.
|
|
3037
|
+
this.c8_1 = 13;
|
|
3038
|
+
suspendResult = this.t3a_1.cd(Companion_getInstance_9().q2f(this.o3a_1, this.p3a_1, Companion_getInstance_1().of(this.n3a_1.au(), [withBodyExplanation(this.n3a_1.get(0), this.q3a_1), this.n3a_1.get(1), withBodyExplanation(this.n3a_1.get(2), this.q3a_1)])), this);
|
|
3039
3039
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3040
3040
|
return suspendResult;
|
|
3041
3041
|
}
|
|
3042
3042
|
continue $sm;
|
|
3043
3043
|
} else {
|
|
3044
3044
|
if (tmp0_subject === 'findall') {
|
|
3045
|
-
var this_2 = this.
|
|
3045
|
+
var this_2 = this.n3a_1.bu();
|
|
3046
3046
|
var goalArgs = copyToArray(this_2);
|
|
3047
3047
|
goalArgs[1] = withBodyExplanation(goalArgs[1], Companion_getInstance_0().anonymous());
|
|
3048
|
-
this.
|
|
3049
|
-
suspendResult = this.
|
|
3048
|
+
this.c8_1 = 12;
|
|
3049
|
+
suspendResult = this.t3a_1.cd(Companion_getInstance_9().q2f(this.o3a_1, this.p3a_1, Companion_getInstance_1().of(this.n3a_1.au(), goalArgs.slice())).plus(Companion_getInstance_9().q2f(this.o3a_1, this.q3a_1, toTerm(Companion_getInstance_11().x38_1))), this);
|
|
3050
3050
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3051
3051
|
return suspendResult;
|
|
3052
3052
|
}
|
|
@@ -3056,22 +3056,22 @@
|
|
|
3056
3056
|
case 'assert':
|
|
3057
3057
|
case 'asserta':
|
|
3058
3058
|
case 'assertz':
|
|
3059
|
-
var subGoal = this.
|
|
3059
|
+
var subGoal = this.n3a_1.get(0);
|
|
3060
3060
|
var tmp_8;
|
|
3061
3061
|
if (isInterface(subGoal, Clause)) {
|
|
3062
|
-
tmp_8 = extractSignature(ensureNotNull(subGoal.
|
|
3062
|
+
tmp_8 = extractSignature(ensureNotNull(subGoal.gw()));
|
|
3063
3063
|
} else {
|
|
3064
3064
|
tmp_8 = extractSignature(safeToStruct(subGoal));
|
|
3065
3065
|
}
|
|
3066
3066
|
|
|
3067
3067
|
var subGoalSignature = tmp_8;
|
|
3068
3068
|
var tmp_9;
|
|
3069
|
-
if (this.
|
|
3069
|
+
if (this.o3a_1.context.r1u().containsSignature(subGoalSignature)) {
|
|
3070
3070
|
tmp_9 = true;
|
|
3071
3071
|
} else {
|
|
3072
3072
|
var tmp_10;
|
|
3073
3073
|
if (isInterface(subGoal, Clause)) {
|
|
3074
|
-
tmp_10 = !subGoal.
|
|
3074
|
+
tmp_10 = !subGoal.qw();
|
|
3075
3075
|
} else {
|
|
3076
3076
|
tmp_10 = false;
|
|
3077
3077
|
}
|
|
@@ -3079,8 +3079,8 @@
|
|
|
3079
3079
|
}
|
|
3080
3080
|
|
|
3081
3081
|
if (tmp_9) {
|
|
3082
|
-
this.
|
|
3083
|
-
suspendResult = this.
|
|
3082
|
+
this.c8_1 = 10;
|
|
3083
|
+
suspendResult = this.t3a_1.cd(Companion_getInstance_9().q2f(this.o3a_1, this.p3a_1, this.n3a_1).plus(Companion_getInstance_9().q2f(this.o3a_1, this.q3a_1, toTerm(Companion_getInstance_11().x38_1))), this);
|
|
3084
3084
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3085
3085
|
return suspendResult;
|
|
3086
3086
|
}
|
|
@@ -3088,15 +3088,15 @@
|
|
|
3088
3088
|
} else {
|
|
3089
3089
|
var tmp_11;
|
|
3090
3090
|
if (isInterface(subGoal, Clause)) {
|
|
3091
|
-
tmp_11 = ClauseMappingUtils_getInstance().
|
|
3091
|
+
tmp_11 = ClauseMappingUtils_getInstance().y39(subGoal);
|
|
3092
3092
|
} else {
|
|
3093
3093
|
if (isInterface(subGoal, Struct)) {
|
|
3094
|
-
var this_3 = ClauseMappingUtils_getInstance().
|
|
3094
|
+
var this_3 = ClauseMappingUtils_getInstance().y39(Companion_instance.of(subGoal));
|
|
3095
3095
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_3, 10));
|
|
3096
3096
|
var _iterator__ex2g4s = this_3.n();
|
|
3097
3097
|
while (_iterator__ex2g4s.q()) {
|
|
3098
3098
|
var item = _iterator__ex2g4s.r();
|
|
3099
|
-
destination.l(ensureNotNull(item.
|
|
3099
|
+
destination.l(ensureNotNull(item.gw()));
|
|
3100
3100
|
}
|
|
3101
3101
|
tmp_11 = destination;
|
|
3102
3102
|
} else {
|
|
@@ -3104,14 +3104,14 @@
|
|
|
3104
3104
|
}
|
|
3105
3105
|
}
|
|
3106
3106
|
var newGoals = tmp_11;
|
|
3107
|
-
this.
|
|
3107
|
+
this.c8_1 = 9;
|
|
3108
3108
|
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(newGoals, 10));
|
|
3109
3109
|
var _iterator__ex2g4s_0 = newGoals.n();
|
|
3110
3110
|
while (_iterator__ex2g4s_0.q()) {
|
|
3111
3111
|
var item_0 = _iterator__ex2g4s_0.r();
|
|
3112
|
-
destination_0.l(Companion_getInstance_9().
|
|
3112
|
+
destination_0.l(Companion_getInstance_9().q2f(this.o3a_1, this.p3a_1, Companion_getInstance_1().of(this.n3a_1.au(), [item_0])).plus(Companion_getInstance_9().q2f(this.o3a_1, this.q3a_1, toTerm(Companion_getInstance_11().x38_1))));
|
|
3113
3113
|
}
|
|
3114
|
-
suspendResult = this.
|
|
3114
|
+
suspendResult = this.t3a_1.ed(destination_0, this);
|
|
3115
3115
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3116
3116
|
return suspendResult;
|
|
3117
3117
|
}
|
|
@@ -3122,20 +3122,20 @@
|
|
|
3122
3122
|
switch (tmp0_subject) {
|
|
3123
3123
|
case 'retract':
|
|
3124
3124
|
case 'retractall':
|
|
3125
|
-
var goalArg = this.
|
|
3126
|
-
this.
|
|
3125
|
+
var goalArg = this.n3a_1.get(0);
|
|
3126
|
+
this.c8_1 = 8;
|
|
3127
3127
|
var tmp_12 = Companion_getInstance_9();
|
|
3128
3128
|
var tmp_13 = Companion_getInstance_1();
|
|
3129
|
-
var tmp_14 = this.
|
|
3129
|
+
var tmp_14 = this.n3a_1.au();
|
|
3130
3130
|
var tmp_15;
|
|
3131
3131
|
var tmp_16;
|
|
3132
3132
|
var tmp_17;
|
|
3133
|
-
if (goalArg.
|
|
3133
|
+
if (goalArg.hu()) {
|
|
3134
3134
|
tmp_17 = true;
|
|
3135
3135
|
} else {
|
|
3136
3136
|
var tmp_18;
|
|
3137
3137
|
if (isInterface(goalArg, Struct)) {
|
|
3138
|
-
tmp_18 = goalArg.
|
|
3138
|
+
tmp_18 = goalArg.au() === ':-';
|
|
3139
3139
|
} else {
|
|
3140
3140
|
tmp_18 = false;
|
|
3141
3141
|
}
|
|
@@ -3145,16 +3145,16 @@
|
|
|
3145
3145
|
if (tmp_17) {
|
|
3146
3146
|
tmp_16 = true;
|
|
3147
3147
|
} else {
|
|
3148
|
-
tmp_16 = this.
|
|
3148
|
+
tmp_16 = this.o3a_1.context.r1u().containsSignature(extractSignature(safeToStruct(goalArg)));
|
|
3149
3149
|
}
|
|
3150
3150
|
|
|
3151
3151
|
if (tmp_16) {
|
|
3152
3152
|
tmp_15 = goalArg;
|
|
3153
3153
|
} else {
|
|
3154
|
-
tmp_15 = withExplanation(goalArg, this.
|
|
3154
|
+
tmp_15 = withExplanation(goalArg, this.q3a_1);
|
|
3155
3155
|
}
|
|
3156
3156
|
|
|
3157
|
-
suspendResult = this.
|
|
3157
|
+
suspendResult = this.t3a_1.cd(tmp_12.q2f(this.o3a_1, this.p3a_1, tmp_13.of(tmp_14, [tmp_15])), this);
|
|
3158
3158
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3159
3159
|
return suspendResult;
|
|
3160
3160
|
}
|
|
@@ -3162,23 +3162,23 @@
|
|
|
3162
3162
|
continue $sm;
|
|
3163
3163
|
default:
|
|
3164
3164
|
if (tmp0_subject === 'clause') {
|
|
3165
|
-
var subGoal_0 = this.
|
|
3165
|
+
var subGoal_0 = this.n3a_1.get(0);
|
|
3166
3166
|
var tmp_19;
|
|
3167
3167
|
if (!isInterface(subGoal_0, Struct)) {
|
|
3168
3168
|
tmp_19 = true;
|
|
3169
3169
|
} else {
|
|
3170
|
-
tmp_19 = this.
|
|
3170
|
+
tmp_19 = this.o3a_1.context.r1u().hasProtected(extractSignature(subGoal_0));
|
|
3171
3171
|
}
|
|
3172
3172
|
if (tmp_19) {
|
|
3173
|
-
this.
|
|
3174
|
-
suspendResult = this.
|
|
3173
|
+
this.c8_1 = 6;
|
|
3174
|
+
suspendResult = this.t3a_1.cd(Companion_getInstance_9().q2f(this.o3a_1, this.p3a_1, this.n3a_1).plus(Companion_getInstance_9().q2f(this.o3a_1, this.q3a_1, toTerm(Companion_getInstance_11().x38_1))), this);
|
|
3175
3175
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3176
3176
|
return suspendResult;
|
|
3177
3177
|
}
|
|
3178
3178
|
continue $sm;
|
|
3179
3179
|
} else {
|
|
3180
|
-
this.
|
|
3181
|
-
suspendResult = this.
|
|
3180
|
+
this.c8_1 = 5;
|
|
3181
|
+
suspendResult = this.t3a_1.cd(Companion_getInstance_9().q2f(this.o3a_1, this.p3a_1, Companion_getInstance_1().of(this.n3a_1.au(), [withExplanation(this.n3a_1.get(0), this.q3a_1), this.n3a_1.get(1)])), this);
|
|
3182
3182
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3183
3183
|
return suspendResult;
|
|
3184
3184
|
}
|
|
@@ -3187,22 +3187,22 @@
|
|
|
3187
3187
|
} else {
|
|
3188
3188
|
var tmp_20 = this;
|
|
3189
3189
|
var tmp_21;
|
|
3190
|
-
var tmp_22 = this.
|
|
3190
|
+
var tmp_22 = this.r3a_1;
|
|
3191
3191
|
if (isInterface(tmp_22, Truth)) {
|
|
3192
3192
|
tmp_21 = true;
|
|
3193
3193
|
} else {
|
|
3194
|
-
tmp_21 = this.
|
|
3194
|
+
tmp_21 = this.o3a_1.context.r1u().containsSignature(this.s3a_1);
|
|
3195
3195
|
}
|
|
3196
|
-
tmp_20.
|
|
3197
|
-
if (this.
|
|
3198
|
-
this.
|
|
3199
|
-
suspendResult = this.
|
|
3196
|
+
tmp_20.u3a_1 = tmp_21;
|
|
3197
|
+
if (this.u3a_1 || this.o3a_1.context.t1u().containsIndicator(this.s3a_1.toIndicator()) || this.o3a_1.context.u1u().containsIndicator(this.s3a_1.toIndicator())) {
|
|
3198
|
+
this.c8_1 = 1;
|
|
3199
|
+
suspendResult = this.t3a_1.cd(Companion_getInstance_9().q2f(this.o3a_1, this.p3a_1, this.n3a_1).plus(Companion_getInstance_9().q2f(this.o3a_1, this.q3a_1, toTerm(Companion_getInstance_11().x38_1))), this);
|
|
3200
3200
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3201
3201
|
return suspendResult;
|
|
3202
3202
|
}
|
|
3203
3203
|
continue $sm;
|
|
3204
3204
|
} else {
|
|
3205
|
-
this.
|
|
3205
|
+
this.c8_1 = 2;
|
|
3206
3206
|
continue $sm;
|
|
3207
3207
|
}
|
|
3208
3208
|
}
|
|
@@ -3223,103 +3223,103 @@
|
|
|
3223
3223
|
|
|
3224
3224
|
break;
|
|
3225
3225
|
case 1:
|
|
3226
|
-
this.
|
|
3226
|
+
this.c8_1 = 2;
|
|
3227
3227
|
continue $sm;
|
|
3228
3228
|
case 2:
|
|
3229
|
-
if (!this.
|
|
3230
|
-
this.
|
|
3231
|
-
suspendResult = this.
|
|
3229
|
+
if (!this.u3a_1) {
|
|
3230
|
+
this.c8_1 = 3;
|
|
3231
|
+
suspendResult = this.t3a_1.cd(Companion_getInstance_9().q2f(this.o3a_1, this.p3a_1, withExplanation(this.n3a_1, this.q3a_1)), this);
|
|
3232
3232
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3233
3233
|
return suspendResult;
|
|
3234
3234
|
}
|
|
3235
3235
|
continue $sm;
|
|
3236
3236
|
} else {
|
|
3237
|
-
this.
|
|
3237
|
+
this.c8_1 = 4;
|
|
3238
3238
|
continue $sm;
|
|
3239
3239
|
}
|
|
3240
3240
|
|
|
3241
3241
|
case 3:
|
|
3242
|
-
this.
|
|
3242
|
+
this.c8_1 = 4;
|
|
3243
3243
|
continue $sm;
|
|
3244
3244
|
case 4:
|
|
3245
|
-
this.
|
|
3245
|
+
this.c8_1 = 17;
|
|
3246
3246
|
continue $sm;
|
|
3247
3247
|
case 5:
|
|
3248
|
-
this.
|
|
3248
|
+
this.c8_1 = 7;
|
|
3249
3249
|
continue $sm;
|
|
3250
3250
|
case 6:
|
|
3251
|
-
this.
|
|
3251
|
+
this.c8_1 = 7;
|
|
3252
3252
|
continue $sm;
|
|
3253
3253
|
case 7:
|
|
3254
|
-
this.
|
|
3254
|
+
this.c8_1 = 17;
|
|
3255
3255
|
continue $sm;
|
|
3256
3256
|
case 8:
|
|
3257
|
-
this.
|
|
3257
|
+
this.c8_1 = 17;
|
|
3258
3258
|
continue $sm;
|
|
3259
3259
|
case 9:
|
|
3260
|
-
this.
|
|
3260
|
+
this.c8_1 = 11;
|
|
3261
3261
|
continue $sm;
|
|
3262
3262
|
case 10:
|
|
3263
|
-
this.
|
|
3263
|
+
this.c8_1 = 11;
|
|
3264
3264
|
continue $sm;
|
|
3265
3265
|
case 11:
|
|
3266
|
-
this.
|
|
3266
|
+
this.c8_1 = 17;
|
|
3267
3267
|
continue $sm;
|
|
3268
3268
|
case 12:
|
|
3269
|
-
this.
|
|
3269
|
+
this.c8_1 = 17;
|
|
3270
3270
|
continue $sm;
|
|
3271
3271
|
case 13:
|
|
3272
|
-
this.
|
|
3272
|
+
this.c8_1 = 17;
|
|
3273
3273
|
continue $sm;
|
|
3274
3274
|
case 14:
|
|
3275
|
-
this.
|
|
3275
|
+
this.c8_1 = 17;
|
|
3276
3276
|
continue $sm;
|
|
3277
3277
|
case 15:
|
|
3278
|
-
this.
|
|
3278
|
+
this.c8_1 = 17;
|
|
3279
3279
|
continue $sm;
|
|
3280
3280
|
case 16:
|
|
3281
|
-
this.
|
|
3281
|
+
this.c8_1 = 17;
|
|
3282
3282
|
continue $sm;
|
|
3283
3283
|
case 17:
|
|
3284
3284
|
return Unit_instance;
|
|
3285
3285
|
case 18:
|
|
3286
|
-
throw this.
|
|
3286
|
+
throw this.f8_1;
|
|
3287
3287
|
}
|
|
3288
3288
|
} catch ($p) {
|
|
3289
3289
|
var e = $p;
|
|
3290
|
-
if (this.
|
|
3290
|
+
if (this.d8_1 === 18) {
|
|
3291
3291
|
throw e;
|
|
3292
3292
|
} else {
|
|
3293
|
-
this.
|
|
3294
|
-
this.
|
|
3293
|
+
this.c8_1 = this.d8_1;
|
|
3294
|
+
this.f8_1 = e;
|
|
3295
3295
|
}
|
|
3296
3296
|
}
|
|
3297
3297
|
while (true);
|
|
3298
3298
|
};
|
|
3299
|
-
protoOf(ProbHelper$computeAllSubstitutions$slambda).
|
|
3300
|
-
var i = new ProbHelper$computeAllSubstitutions$slambda(this.
|
|
3301
|
-
i.
|
|
3299
|
+
protoOf(ProbHelper$computeAllSubstitutions$slambda).g2q = function ($this$sequence, completion) {
|
|
3300
|
+
var i = new ProbHelper$computeAllSubstitutions$slambda(this.n3a_1, this.o3a_1, this.p3a_1, this.q3a_1, this.r3a_1, this.s3a_1, completion);
|
|
3301
|
+
i.t3a_1 = $this$sequence;
|
|
3302
3302
|
return i;
|
|
3303
3303
|
};
|
|
3304
3304
|
function ProbHelper$computeAllSubstitutions$slambda_0($goal, $this_computeAllSubstitutions, $third, $first, $second, $goalSignature, resultContinuation) {
|
|
3305
3305
|
var i = new ProbHelper$computeAllSubstitutions$slambda($goal, $this_computeAllSubstitutions, $third, $first, $second, $goalSignature, resultContinuation);
|
|
3306
3306
|
return constructCallableReference(function ($this$sequence, $completion) {
|
|
3307
|
-
return i.
|
|
3307
|
+
return i.f2q($this$sequence, $completion);
|
|
3308
3308
|
}, 1);
|
|
3309
3309
|
}
|
|
3310
3310
|
function ProbHelper() {
|
|
3311
3311
|
ProbHelper_instance = this;
|
|
3312
3312
|
WithoutSideEffects.call(this, 'prob_helper');
|
|
3313
3313
|
}
|
|
3314
|
-
protoOf(ProbHelper).
|
|
3315
|
-
Companion_getInstance_9().
|
|
3316
|
-
Companion_getInstance_9().
|
|
3314
|
+
protoOf(ProbHelper).g2m = function (_this__u8e3s4, first, second, third) {
|
|
3315
|
+
Companion_getInstance_9().w2f(_this__u8e3s4, 1);
|
|
3316
|
+
Companion_getInstance_9().a2g(_this__u8e3s4, 1);
|
|
3317
3317
|
var goal = safeToStruct(second);
|
|
3318
3318
|
var goalSignature = extractSignature(goal);
|
|
3319
3319
|
return sequence(ProbHelper$computeAllSubstitutions$slambda_0(goal, _this__u8e3s4, third, first, second, goalSignature, null));
|
|
3320
3320
|
};
|
|
3321
|
-
protoOf(ProbHelper).
|
|
3322
|
-
return this.
|
|
3321
|
+
protoOf(ProbHelper).s2h = function (_this__u8e3s4, first, second, third) {
|
|
3322
|
+
return this.g2m(_this__u8e3s4, first, second, third);
|
|
3323
3323
|
};
|
|
3324
3324
|
var ProbHelper_instance;
|
|
3325
3325
|
function ProbHelper_getInstance() {
|
|
@@ -3331,11 +3331,11 @@
|
|
|
3331
3331
|
ProbNegationAsFailure_instance = this;
|
|
3332
3332
|
NonBacktrackable_0.call(this, 'prob_negation_as_failure');
|
|
3333
3333
|
}
|
|
3334
|
-
protoOf(ProbNegationAsFailure).
|
|
3335
|
-
Companion_getInstance_9().
|
|
3336
|
-
Companion_getInstance_9().
|
|
3334
|
+
protoOf(ProbNegationAsFailure).m2m = function (_this__u8e3s4, first, second) {
|
|
3335
|
+
Companion_getInstance_9().w2f(_this__u8e3s4, 1);
|
|
3336
|
+
Companion_getInstance_9().a2g(_this__u8e3s4, 1);
|
|
3337
3337
|
var tmp;
|
|
3338
|
-
if (!second.
|
|
3338
|
+
if (!second.ev()) {
|
|
3339
3339
|
tmp = _this__u8e3s4.replyException(ResolutionException_init_$Create$('Probabilistic negation does not support non-ground goals: ' + second.toString(), VOID, _this__u8e3s4.context, []), VOID, []);
|
|
3340
3340
|
} else {
|
|
3341
3341
|
var explanationTermVar = Companion_getInstance_0().of('Explanation');
|
|
@@ -3348,7 +3348,7 @@
|
|
|
3348
3348
|
if (solution == null) {
|
|
3349
3349
|
tmp_2 = _this__u8e3s4.replyFail(VOID, []);
|
|
3350
3350
|
} else {
|
|
3351
|
-
var explanationTerm = solution.
|
|
3351
|
+
var explanationTerm = solution.n1u().i2(explanationTermVar);
|
|
3352
3352
|
var tmp_3;
|
|
3353
3353
|
var tmp_4;
|
|
3354
3354
|
if (explanationTerm == null) {
|
|
@@ -3359,7 +3359,7 @@
|
|
|
3359
3359
|
if (tmp_4) {
|
|
3360
3360
|
tmp_3 = _this__u8e3s4.replyException(ResolutionException_init_$Create$('No valid explanation has been solved for goal: ' + second.toString(), VOID, _this__u8e3s4.context, []), VOID, []);
|
|
3361
3361
|
} else {
|
|
3362
|
-
tmp_3 = _this__u8e3s4.replyWith(Companion_getInstance_5().ofSubstitution(Companion_getInstance_9().
|
|
3362
|
+
tmp_3 = _this__u8e3s4.replyWith(Companion_getInstance_5().ofSubstitution(Companion_getInstance_9().q2f(_this__u8e3s4, first, new ProbExplanationTerm(explanationTerm.u37_1.not())), []), VOID, []);
|
|
3363
3363
|
}
|
|
3364
3364
|
tmp_2 = tmp_3;
|
|
3365
3365
|
}
|
|
@@ -3367,8 +3367,8 @@
|
|
|
3367
3367
|
}
|
|
3368
3368
|
return tmp;
|
|
3369
3369
|
};
|
|
3370
|
-
protoOf(ProbNegationAsFailure).
|
|
3371
|
-
return this.
|
|
3370
|
+
protoOf(ProbNegationAsFailure).u2e = function (_this__u8e3s4, first, second) {
|
|
3371
|
+
return this.m2m(_this__u8e3s4, first, second);
|
|
3372
3372
|
};
|
|
3373
3373
|
var ProbNegationAsFailure_instance;
|
|
3374
3374
|
function ProbNegationAsFailure_getInstance() {
|
|
@@ -3382,45 +3382,45 @@
|
|
|
3382
3382
|
};
|
|
3383
3383
|
}
|
|
3384
3384
|
function ProbQuery$computeAllSubstitutions$slambda($solutions, $queryWithEvidenceExplanation, $evidenceExplanation, $this_computeAllSubstitutions, $first, $fourth, resultContinuation) {
|
|
3385
|
-
this.
|
|
3386
|
-
this.
|
|
3387
|
-
this.
|
|
3388
|
-
this.
|
|
3389
|
-
this.
|
|
3390
|
-
this.
|
|
3385
|
+
this.f3b_1 = $solutions;
|
|
3386
|
+
this.g3b_1 = $queryWithEvidenceExplanation;
|
|
3387
|
+
this.h3b_1 = $evidenceExplanation;
|
|
3388
|
+
this.i3b_1 = $this_computeAllSubstitutions;
|
|
3389
|
+
this.j3b_1 = $first;
|
|
3390
|
+
this.k3b_1 = $fourth;
|
|
3391
3391
|
CoroutineImpl.call(this, resultContinuation);
|
|
3392
3392
|
}
|
|
3393
|
-
protoOf(ProbQuery$computeAllSubstitutions$slambda).
|
|
3394
|
-
var tmp = this.
|
|
3395
|
-
tmp.
|
|
3396
|
-
tmp.
|
|
3397
|
-
return tmp.
|
|
3393
|
+
protoOf(ProbQuery$computeAllSubstitutions$slambda).f2q = function ($this$sequence, $completion) {
|
|
3394
|
+
var tmp = this.g2q($this$sequence, $completion);
|
|
3395
|
+
tmp.e8_1 = Unit_instance;
|
|
3396
|
+
tmp.f8_1 = null;
|
|
3397
|
+
return tmp.k8();
|
|
3398
3398
|
};
|
|
3399
|
-
protoOf(ProbQuery$computeAllSubstitutions$slambda).
|
|
3400
|
-
return this.
|
|
3399
|
+
protoOf(ProbQuery$computeAllSubstitutions$slambda).b9 = function (p1, $completion) {
|
|
3400
|
+
return this.f2q(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
|
|
3401
3401
|
};
|
|
3402
|
-
protoOf(ProbQuery$computeAllSubstitutions$slambda).
|
|
3403
|
-
var suspendResult = this.
|
|
3402
|
+
protoOf(ProbQuery$computeAllSubstitutions$slambda).k8 = function () {
|
|
3403
|
+
var suspendResult = this.e8_1;
|
|
3404
3404
|
$sm: do
|
|
3405
3405
|
try {
|
|
3406
|
-
var tmp = this.
|
|
3406
|
+
var tmp = this.c8_1;
|
|
3407
3407
|
switch (tmp) {
|
|
3408
3408
|
case 0:
|
|
3409
|
-
this.
|
|
3410
|
-
this.
|
|
3411
|
-
this.
|
|
3409
|
+
this.d8_1 = 8;
|
|
3410
|
+
this.m3b_1 = this.f3b_1.n();
|
|
3411
|
+
this.c8_1 = 1;
|
|
3412
3412
|
continue $sm;
|
|
3413
3413
|
case 1:
|
|
3414
|
-
if (!this.
|
|
3415
|
-
this.
|
|
3414
|
+
if (!this.m3b_1.q()) {
|
|
3415
|
+
this.c8_1 = 7;
|
|
3416
3416
|
continue $sm;
|
|
3417
3417
|
}
|
|
3418
3418
|
|
|
3419
|
-
var solution = this.
|
|
3420
|
-
if (solution.
|
|
3421
|
-
throw ensureNotNull(solution.
|
|
3422
|
-
var queryWithEvidenceExplanationTerm = solution.
|
|
3423
|
-
var evidenceExplanationTerm = solution.
|
|
3419
|
+
var solution = this.m3b_1.r();
|
|
3420
|
+
if (solution.w1v())
|
|
3421
|
+
throw ensureNotNull(solution.t1v());
|
|
3422
|
+
var queryWithEvidenceExplanationTerm = solution.n1u().i2(this.g3b_1);
|
|
3423
|
+
var evidenceExplanationTerm = solution.n1u().i2(this.h3b_1);
|
|
3424
3424
|
var tmp_0;
|
|
3425
3425
|
var tmp_1;
|
|
3426
3426
|
var tmp_2;
|
|
@@ -3443,28 +3443,28 @@
|
|
|
3443
3443
|
}
|
|
3444
3444
|
|
|
3445
3445
|
if (tmp_0) {
|
|
3446
|
-
this.
|
|
3447
|
-
suspendResult = this.
|
|
3446
|
+
this.c8_1 = 5;
|
|
3447
|
+
suspendResult = this.l3b_1.cd(Companion_getInstance_5().failed(), this);
|
|
3448
3448
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3449
3449
|
return suspendResult;
|
|
3450
3450
|
}
|
|
3451
3451
|
continue $sm;
|
|
3452
3452
|
} else {
|
|
3453
|
-
var queryWithEvidenceProbability = queryWithEvidenceExplanationTerm.
|
|
3454
|
-
var evidenceProbability = evidenceExplanationTerm.
|
|
3453
|
+
var queryWithEvidenceProbability = queryWithEvidenceExplanationTerm.u37_1.k39();
|
|
3454
|
+
var evidenceProbability = evidenceExplanationTerm.u37_1.k39();
|
|
3455
3455
|
if (queryWithEvidenceProbability == null || evidenceProbability == null) {
|
|
3456
|
-
this.
|
|
3457
|
-
suspendResult = this.
|
|
3456
|
+
this.c8_1 = 3;
|
|
3457
|
+
suspendResult = this.l3b_1.cd(Companion_getInstance_5().failed(), this);
|
|
3458
3458
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3459
3459
|
return suspendResult;
|
|
3460
3460
|
}
|
|
3461
3461
|
continue $sm;
|
|
3462
3462
|
} else {
|
|
3463
|
-
var tmp_3 = solution.
|
|
3464
|
-
var solutionSubstitution = tmp_3.filter(ProbQuery$computeAllSubstitutions$slambda$lambda(this.
|
|
3463
|
+
var tmp_3 = solution.n1u();
|
|
3464
|
+
var solutionSubstitution = tmp_3.filter(ProbQuery$computeAllSubstitutions$slambda$lambda(this.h3b_1, this.g3b_1));
|
|
3465
3465
|
var probabilityTerm = Companion_getInstance_6().ofDouble(queryWithEvidenceProbability / evidenceProbability);
|
|
3466
|
-
this.
|
|
3467
|
-
suspendResult = this.
|
|
3466
|
+
this.c8_1 = 2;
|
|
3467
|
+
suspendResult = this.l3b_1.cd(Companion_getInstance_5().ofSubstitution(solutionSubstitution, [Companion_getInstance_9().q2f(this.i3b_1, this.j3b_1, probabilityTerm), Companion_getInstance_9().q2f(this.i3b_1, this.k3b_1, queryWithEvidenceExplanationTerm)]), this);
|
|
3468
3468
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3469
3469
|
return suspendResult;
|
|
3470
3470
|
}
|
|
@@ -3473,56 +3473,56 @@
|
|
|
3473
3473
|
}
|
|
3474
3474
|
|
|
3475
3475
|
case 2:
|
|
3476
|
-
this.
|
|
3476
|
+
this.c8_1 = 4;
|
|
3477
3477
|
continue $sm;
|
|
3478
3478
|
case 3:
|
|
3479
|
-
this.
|
|
3479
|
+
this.c8_1 = 4;
|
|
3480
3480
|
continue $sm;
|
|
3481
3481
|
case 4:
|
|
3482
|
-
this.
|
|
3482
|
+
this.c8_1 = 6;
|
|
3483
3483
|
continue $sm;
|
|
3484
3484
|
case 5:
|
|
3485
|
-
this.
|
|
3485
|
+
this.c8_1 = 6;
|
|
3486
3486
|
continue $sm;
|
|
3487
3487
|
case 6:
|
|
3488
|
-
this.
|
|
3488
|
+
this.c8_1 = 1;
|
|
3489
3489
|
continue $sm;
|
|
3490
3490
|
case 7:
|
|
3491
3491
|
return Unit_instance;
|
|
3492
3492
|
case 8:
|
|
3493
|
-
throw this.
|
|
3493
|
+
throw this.f8_1;
|
|
3494
3494
|
}
|
|
3495
3495
|
} catch ($p) {
|
|
3496
3496
|
var e = $p;
|
|
3497
|
-
if (this.
|
|
3497
|
+
if (this.d8_1 === 8) {
|
|
3498
3498
|
throw e;
|
|
3499
3499
|
} else {
|
|
3500
|
-
this.
|
|
3501
|
-
this.
|
|
3500
|
+
this.c8_1 = this.d8_1;
|
|
3501
|
+
this.f8_1 = e;
|
|
3502
3502
|
}
|
|
3503
3503
|
}
|
|
3504
3504
|
while (true);
|
|
3505
3505
|
};
|
|
3506
|
-
protoOf(ProbQuery$computeAllSubstitutions$slambda).
|
|
3507
|
-
var i = new ProbQuery$computeAllSubstitutions$slambda(this.
|
|
3508
|
-
i.
|
|
3506
|
+
protoOf(ProbQuery$computeAllSubstitutions$slambda).g2q = function ($this$sequence, completion) {
|
|
3507
|
+
var i = new ProbQuery$computeAllSubstitutions$slambda(this.f3b_1, this.g3b_1, this.h3b_1, this.i3b_1, this.j3b_1, this.k3b_1, completion);
|
|
3508
|
+
i.l3b_1 = $this$sequence;
|
|
3509
3509
|
return i;
|
|
3510
3510
|
};
|
|
3511
3511
|
function ProbQuery$computeAllSubstitutions$slambda_0($solutions, $queryWithEvidenceExplanation, $evidenceExplanation, $this_computeAllSubstitutions, $first, $fourth, resultContinuation) {
|
|
3512
3512
|
var i = new ProbQuery$computeAllSubstitutions$slambda($solutions, $queryWithEvidenceExplanation, $evidenceExplanation, $this_computeAllSubstitutions, $first, $fourth, resultContinuation);
|
|
3513
3513
|
return constructCallableReference(function ($this$sequence, $completion) {
|
|
3514
|
-
return i.
|
|
3514
|
+
return i.f2q($this$sequence, $completion);
|
|
3515
3515
|
}, 1);
|
|
3516
3516
|
}
|
|
3517
3517
|
function ProbQuery() {
|
|
3518
3518
|
ProbQuery_instance = this;
|
|
3519
3519
|
WithoutSideEffects_0.call(this, 'prob_query');
|
|
3520
3520
|
}
|
|
3521
|
-
protoOf(ProbQuery).
|
|
3522
|
-
Companion_getInstance_9().
|
|
3523
|
-
Companion_getInstance_9().
|
|
3524
|
-
Companion_getInstance_9().
|
|
3525
|
-
Companion_getInstance_9().
|
|
3521
|
+
protoOf(ProbQuery).o3b = function (_this__u8e3s4, first, second, third, fourth) {
|
|
3522
|
+
Companion_getInstance_9().w2f(_this__u8e3s4, 1);
|
|
3523
|
+
Companion_getInstance_9().a2g(_this__u8e3s4, 1);
|
|
3524
|
+
Companion_getInstance_9().y2f(_this__u8e3s4, 1);
|
|
3525
|
+
Companion_getInstance_9().w2f(_this__u8e3s4, 2);
|
|
3526
3526
|
var queryWithEvidenceExplanation = Companion_getInstance_0().of('QueryWithEvidenceExplanation');
|
|
3527
3527
|
var evidenceExplanation = Companion_getInstance_0().of('EvidenceExplanation');
|
|
3528
3528
|
var tmp = _this__u8e3s4.subSolver();
|
|
@@ -3534,11 +3534,11 @@
|
|
|
3534
3534
|
var tmp_3 = Companion_getInstance_1();
|
|
3535
3535
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3536
3536
|
var tmp$ret$1 = ProbSolveWithEvidence_getInstance().signature.name;
|
|
3537
|
-
var solutions = tmp.solveWithOptions(tmp_0.of(tmp_2, tmp_3.of(tmp$ret$1, [queryWithEvidenceExplanation, evidenceExplanation, second])), ProbSetConfig_getInstance().
|
|
3537
|
+
var solutions = tmp.solveWithOptions(tmp_0.of(tmp_2, tmp_3.of(tmp$ret$1, [queryWithEvidenceExplanation, evidenceExplanation, second])), ProbSetConfig_getInstance().p3b(third));
|
|
3538
3538
|
return sequence(ProbQuery$computeAllSubstitutions$slambda_0(solutions, queryWithEvidenceExplanation, evidenceExplanation, _this__u8e3s4, first, fourth, null));
|
|
3539
3539
|
};
|
|
3540
|
-
protoOf(ProbQuery).
|
|
3541
|
-
return this.
|
|
3540
|
+
protoOf(ProbQuery).p2g = function (_this__u8e3s4, first, second, third, fourth) {
|
|
3541
|
+
return this.o3b(_this__u8e3s4, first, second, third, fourth);
|
|
3542
3542
|
};
|
|
3543
3543
|
var ProbQuery_instance;
|
|
3544
3544
|
function ProbQuery_getInstance() {
|
|
@@ -3551,40 +3551,40 @@
|
|
|
3551
3551
|
NonBacktrackable_1.call(this, 'prob_set_config');
|
|
3552
3552
|
var tmp = this;
|
|
3553
3553
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3554
|
-
tmp.
|
|
3554
|
+
tmp.p37_1 = this.signature.name + '_flag';
|
|
3555
3555
|
var tmp_0 = this;
|
|
3556
3556
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3557
|
-
tmp_0.
|
|
3557
|
+
tmp_0.q37_1 = this.signature.name + '_term';
|
|
3558
3558
|
var tmp_1 = this;
|
|
3559
3559
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3560
|
-
tmp_1.
|
|
3560
|
+
tmp_1.r37_1 = 'it.unibo.tuprolog.solve.probability' + this.signature.name + '_tag';
|
|
3561
3561
|
}
|
|
3562
|
-
protoOf(ProbSetConfig).
|
|
3563
|
-
Companion_getInstance_9().
|
|
3564
|
-
Companion_getInstance_9().
|
|
3562
|
+
protoOf(ProbSetConfig).v2l = function (_this__u8e3s4, first) {
|
|
3563
|
+
Companion_getInstance_9().w2f(_this__u8e3s4, 0);
|
|
3564
|
+
Companion_getInstance_9().c2g(_this__u8e3s4, 0);
|
|
3565
3565
|
// Inline function 'kotlin.arrayOf' call
|
|
3566
3566
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
3567
3567
|
// Inline function 'kotlin.js.asDynamic' call
|
|
3568
|
-
var tmp$ret$0 = [SetFlags_init_$Create$([new Pair(this.
|
|
3568
|
+
var tmp$ret$0 = [SetFlags_init_$Create$([new Pair(this.p37_1, first)])];
|
|
3569
3569
|
return _this__u8e3s4.replySuccess(VOID, VOID, tmp$ret$0.slice());
|
|
3570
3570
|
};
|
|
3571
|
-
protoOf(ProbSetConfig).
|
|
3572
|
-
return this.
|
|
3571
|
+
protoOf(ProbSetConfig).d2i = function (_this__u8e3s4, first) {
|
|
3572
|
+
return this.v2l(_this__u8e3s4, first);
|
|
3573
3573
|
};
|
|
3574
|
-
protoOf(ProbSetConfig).
|
|
3575
|
-
var tmp0_elvis_lhs = _this__u8e3s4.getTag(this.
|
|
3574
|
+
protoOf(ProbSetConfig).p3b = function (_this__u8e3s4) {
|
|
3575
|
+
var tmp0_elvis_lhs = _this__u8e3s4.getTag(this.r37_1);
|
|
3576
3576
|
return tmp0_elvis_lhs == null ? Companion_getInstance_2().DEFAULT : tmp0_elvis_lhs;
|
|
3577
3577
|
};
|
|
3578
|
-
protoOf(ProbSetConfig).
|
|
3579
|
-
return setTag(Companion_getInstance_4().of(this.
|
|
3578
|
+
protoOf(ProbSetConfig).s37 = function (_this__u8e3s4) {
|
|
3579
|
+
return setTag(Companion_getInstance_4().of(this.q37_1), this.r37_1, _this__u8e3s4);
|
|
3580
3580
|
};
|
|
3581
|
-
protoOf(ProbSetConfig).
|
|
3582
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
3583
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
3581
|
+
protoOf(ProbSetConfig).q3b = function (_this__u8e3s4) {
|
|
3582
|
+
var tmp0_safe_receiver = _this__u8e3s4.s1u().db(this.p37_1);
|
|
3583
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.p3b(tmp0_safe_receiver);
|
|
3584
3584
|
return tmp1_elvis_lhs == null ? Companion_getInstance_2().DEFAULT : tmp1_elvis_lhs;
|
|
3585
3585
|
};
|
|
3586
|
-
protoOf(ProbSetConfig).
|
|
3587
|
-
return !get_isProbabilistic(this.
|
|
3586
|
+
protoOf(ProbSetConfig).e3a = function (_this__u8e3s4) {
|
|
3587
|
+
return !get_isProbabilistic(this.q3b(_this__u8e3s4));
|
|
3588
3588
|
};
|
|
3589
3589
|
var ProbSetConfig_instance;
|
|
3590
3590
|
function ProbSetConfig_getInstance() {
|
|
@@ -3593,9 +3593,9 @@
|
|
|
3593
3593
|
return ProbSetConfig_instance;
|
|
3594
3594
|
}
|
|
3595
3595
|
function ProbSolve$computeAllSubstitutions$lambda(it) {
|
|
3596
|
-
if (it.
|
|
3597
|
-
throw ensureNotNull(it.
|
|
3598
|
-
return it.
|
|
3596
|
+
if (it.w1v())
|
|
3597
|
+
throw ensureNotNull(it.t1v());
|
|
3598
|
+
return it.n1u();
|
|
3599
3599
|
}
|
|
3600
3600
|
function ProbSolve$computeAllSubstitutions$lambda_0(it) {
|
|
3601
3601
|
return !(it == null) ? isInterface(it, Halt) : false;
|
|
@@ -3606,46 +3606,46 @@
|
|
|
3606
3606
|
};
|
|
3607
3607
|
}
|
|
3608
3608
|
function ProbSolve$computeAllSubstitutions$slambda($solutionGroups, $explanationVar, $this_computeAllSubstitutions, $first, resultContinuation) {
|
|
3609
|
-
this.
|
|
3610
|
-
this.
|
|
3611
|
-
this.
|
|
3612
|
-
this.
|
|
3609
|
+
this.z3b_1 = $solutionGroups;
|
|
3610
|
+
this.a3c_1 = $explanationVar;
|
|
3611
|
+
this.b3c_1 = $this_computeAllSubstitutions;
|
|
3612
|
+
this.c3c_1 = $first;
|
|
3613
3613
|
CoroutineImpl.call(this, resultContinuation);
|
|
3614
3614
|
}
|
|
3615
|
-
protoOf(ProbSolve$computeAllSubstitutions$slambda).
|
|
3616
|
-
var tmp = this.
|
|
3617
|
-
tmp.
|
|
3618
|
-
tmp.
|
|
3619
|
-
return tmp.
|
|
3615
|
+
protoOf(ProbSolve$computeAllSubstitutions$slambda).f2q = function ($this$sequence, $completion) {
|
|
3616
|
+
var tmp = this.g2q($this$sequence, $completion);
|
|
3617
|
+
tmp.e8_1 = Unit_instance;
|
|
3618
|
+
tmp.f8_1 = null;
|
|
3619
|
+
return tmp.k8();
|
|
3620
3620
|
};
|
|
3621
|
-
protoOf(ProbSolve$computeAllSubstitutions$slambda).
|
|
3622
|
-
return this.
|
|
3621
|
+
protoOf(ProbSolve$computeAllSubstitutions$slambda).b9 = function (p1, $completion) {
|
|
3622
|
+
return this.f2q(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
|
|
3623
3623
|
};
|
|
3624
|
-
protoOf(ProbSolve$computeAllSubstitutions$slambda).
|
|
3625
|
-
var suspendResult = this.
|
|
3624
|
+
protoOf(ProbSolve$computeAllSubstitutions$slambda).k8 = function () {
|
|
3625
|
+
var suspendResult = this.e8_1;
|
|
3626
3626
|
$sm: do
|
|
3627
3627
|
try {
|
|
3628
|
-
var tmp = this.
|
|
3628
|
+
var tmp = this.c8_1;
|
|
3629
3629
|
switch (tmp) {
|
|
3630
3630
|
case 0:
|
|
3631
|
-
this.
|
|
3631
|
+
this.d8_1 = 4;
|
|
3632
3632
|
var tmp_0 = this;
|
|
3633
|
-
tmp_0.
|
|
3634
|
-
this.
|
|
3633
|
+
tmp_0.e3c_1 = this.z3b_1.d1().n();
|
|
3634
|
+
this.c8_1 = 1;
|
|
3635
3635
|
continue $sm;
|
|
3636
3636
|
case 1:
|
|
3637
|
-
if (!this.
|
|
3638
|
-
this.
|
|
3637
|
+
if (!this.e3c_1.q()) {
|
|
3638
|
+
this.c8_1 = 3;
|
|
3639
3639
|
continue $sm;
|
|
3640
3640
|
}
|
|
3641
3641
|
|
|
3642
|
-
var solutionGroup = this.
|
|
3643
|
-
var this_0 = solutionGroup.
|
|
3642
|
+
var solutionGroup = this.e3c_1.r();
|
|
3643
|
+
var this_0 = solutionGroup.f2();
|
|
3644
3644
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
3645
3645
|
var _iterator__ex2g4s = this_0.n();
|
|
3646
3646
|
while (_iterator__ex2g4s.q()) {
|
|
3647
3647
|
var item = _iterator__ex2g4s.r();
|
|
3648
|
-
destination.l(item.
|
|
3648
|
+
destination.l(item.n1u().i2(this.a3c_1));
|
|
3649
3649
|
}
|
|
3650
3650
|
|
|
3651
3651
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
@@ -3661,7 +3661,7 @@
|
|
|
3661
3661
|
var _iterator__ex2g4s_1 = destination_0.n();
|
|
3662
3662
|
while (_iterator__ex2g4s_1.q()) {
|
|
3663
3663
|
var item_0 = _iterator__ex2g4s_1.r();
|
|
3664
|
-
destination_1.l(item_0.
|
|
3664
|
+
destination_1.l(item_0.u37_1);
|
|
3665
3665
|
}
|
|
3666
3666
|
|
|
3667
3667
|
var iterator = destination_1.n();
|
|
@@ -3671,61 +3671,61 @@
|
|
|
3671
3671
|
while (iterator.q()) {
|
|
3672
3672
|
var tmp0 = accumulator;
|
|
3673
3673
|
var expl = iterator.r();
|
|
3674
|
-
accumulator = expl.
|
|
3674
|
+
accumulator = expl.j39() === 1.0 ? tmp0 : tmp0.j39() === 1.0 ? expl : tmp0.or(expl);
|
|
3675
3675
|
}
|
|
3676
3676
|
|
|
3677
3677
|
var explanation = accumulator;
|
|
3678
|
-
var substitution = Companion_getInstance_5().ofSubstitution(solutionGroup.
|
|
3679
|
-
this.
|
|
3680
|
-
suspendResult = this.
|
|
3678
|
+
var substitution = Companion_getInstance_5().ofSubstitution(solutionGroup.e2(), [Companion_getInstance_9().q2f(this.b3c_1, this.c3c_1, new ProbExplanationTerm(explanation))]);
|
|
3679
|
+
this.c8_1 = 2;
|
|
3680
|
+
suspendResult = this.d3c_1.cd(substitution, this);
|
|
3681
3681
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3682
3682
|
return suspendResult;
|
|
3683
3683
|
}
|
|
3684
3684
|
|
|
3685
3685
|
continue $sm;
|
|
3686
3686
|
case 2:
|
|
3687
|
-
this.
|
|
3687
|
+
this.c8_1 = 1;
|
|
3688
3688
|
continue $sm;
|
|
3689
3689
|
case 3:
|
|
3690
3690
|
return Unit_instance;
|
|
3691
3691
|
case 4:
|
|
3692
|
-
throw this.
|
|
3692
|
+
throw this.f8_1;
|
|
3693
3693
|
}
|
|
3694
3694
|
} catch ($p) {
|
|
3695
3695
|
var e = $p;
|
|
3696
|
-
if (this.
|
|
3696
|
+
if (this.d8_1 === 4) {
|
|
3697
3697
|
throw e;
|
|
3698
3698
|
} else {
|
|
3699
|
-
this.
|
|
3700
|
-
this.
|
|
3699
|
+
this.c8_1 = this.d8_1;
|
|
3700
|
+
this.f8_1 = e;
|
|
3701
3701
|
}
|
|
3702
3702
|
}
|
|
3703
3703
|
while (true);
|
|
3704
3704
|
};
|
|
3705
|
-
protoOf(ProbSolve$computeAllSubstitutions$slambda).
|
|
3706
|
-
var i = new ProbSolve$computeAllSubstitutions$slambda(this.
|
|
3707
|
-
i.
|
|
3705
|
+
protoOf(ProbSolve$computeAllSubstitutions$slambda).g2q = function ($this$sequence, completion) {
|
|
3706
|
+
var i = new ProbSolve$computeAllSubstitutions$slambda(this.z3b_1, this.a3c_1, this.b3c_1, this.c3c_1, completion);
|
|
3707
|
+
i.d3c_1 = $this$sequence;
|
|
3708
3708
|
return i;
|
|
3709
3709
|
};
|
|
3710
3710
|
function ProbSolve$computeAllSubstitutions$slambda_0($solutionGroups, $explanationVar, $this_computeAllSubstitutions, $first, resultContinuation) {
|
|
3711
3711
|
var i = new ProbSolve$computeAllSubstitutions$slambda($solutionGroups, $explanationVar, $this_computeAllSubstitutions, $first, resultContinuation);
|
|
3712
3712
|
return constructCallableReference(function ($this$sequence, $completion) {
|
|
3713
|
-
return i.
|
|
3713
|
+
return i.f2q($this$sequence, $completion);
|
|
3714
3714
|
}, 1);
|
|
3715
3715
|
}
|
|
3716
3716
|
function ProbSolve() {
|
|
3717
3717
|
ProbSolve_instance = this;
|
|
3718
3718
|
WithoutSideEffects_1.call(this, 'prob_solve');
|
|
3719
3719
|
}
|
|
3720
|
-
protoOf(ProbSolve).
|
|
3721
|
-
Companion_getInstance_9().
|
|
3722
|
-
Companion_getInstance_9().
|
|
3723
|
-
if (ProbSetConfig_getInstance().
|
|
3720
|
+
protoOf(ProbSolve).l2n = function (_this__u8e3s4, first, second) {
|
|
3721
|
+
Companion_getInstance_9().w2f(_this__u8e3s4, 1);
|
|
3722
|
+
Companion_getInstance_9().a2g(_this__u8e3s4, 1);
|
|
3723
|
+
if (ProbSetConfig_getInstance().e3a(_this__u8e3s4.context)) {
|
|
3724
3724
|
var tmp = _this__u8e3s4.subSolver();
|
|
3725
3725
|
var tmp_0 = Companion_getInstance_1();
|
|
3726
3726
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3727
3727
|
var tmp$ret$0 = Prob_getInstance().signature.name;
|
|
3728
|
-
var tmp_1 = tmp.solveWithOptions(tmp_0.of(tmp$ret$0, [first, second]), ProbSetConfig_getInstance().
|
|
3728
|
+
var tmp_1 = tmp.solveWithOptions(tmp_0.of(tmp$ret$0, [first, second]), ProbSetConfig_getInstance().q3b(_this__u8e3s4.context));
|
|
3729
3729
|
return map(tmp_1, ProbSolve$computeAllSubstitutions$lambda);
|
|
3730
3730
|
}
|
|
3731
3731
|
var explanationVar = Companion_getInstance_0().of('EXPL');
|
|
@@ -3733,14 +3733,14 @@
|
|
|
3733
3733
|
var tmp_3 = Companion_getInstance_1();
|
|
3734
3734
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3735
3735
|
var tmp$ret$1 = Prob_getInstance().signature.name;
|
|
3736
|
-
var solutions = toList(tmp_2.solveWithOptions(tmp_3.of(tmp$ret$1, [explanationVar, second]), ProbSetConfig_getInstance().
|
|
3736
|
+
var solutions = toList(tmp_2.solveWithOptions(tmp_3.of(tmp$ret$1, [explanationVar, second]), ProbSetConfig_getInstance().q3b(_this__u8e3s4.context)));
|
|
3737
3737
|
// Inline function 'kotlin.sequences.filterIsInstance' call
|
|
3738
3738
|
var this_0 = asSequence(solutions);
|
|
3739
3739
|
var tmp_4 = filter(this_0, ProbSolve$computeAllSubstitutions$lambda_0);
|
|
3740
3740
|
var tmp$ret$2 = isInterface(tmp_4, Sequence) ? tmp_4 : THROW_CCE();
|
|
3741
3741
|
var error = firstOrNull(tmp$ret$2);
|
|
3742
3742
|
if (!(error == null))
|
|
3743
|
-
throw error.
|
|
3743
|
+
throw error.t1v();
|
|
3744
3744
|
var tmp_5;
|
|
3745
3745
|
var tmp$ret$3;
|
|
3746
3746
|
$l$block_0: {
|
|
@@ -3766,7 +3766,7 @@
|
|
|
3766
3766
|
tmp$ret$3 = false;
|
|
3767
3767
|
}
|
|
3768
3768
|
if (!tmp$ret$3) {
|
|
3769
|
-
tmp_5 = sequenceOf(Companion_getInstance_5().ofSubstitution(Companion_getInstance_9().
|
|
3769
|
+
tmp_5 = sequenceOf(Companion_getInstance_5().ofSubstitution(Companion_getInstance_9().q2f(_this__u8e3s4, first, new ProbExplanationTerm(Companion_getInstance_11().w38_1)), []));
|
|
3770
3770
|
} else {
|
|
3771
3771
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
3772
3772
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
@@ -3784,14 +3784,14 @@
|
|
|
3784
3784
|
var _iterator__ex2g4s_1 = destination.n();
|
|
3785
3785
|
while (_iterator__ex2g4s_1.q()) {
|
|
3786
3786
|
var element_1 = _iterator__ex2g4s_1.r();
|
|
3787
|
-
var tmp_7 = element_1.
|
|
3788
|
-
var key = tmp_7.
|
|
3787
|
+
var tmp_7 = element_1.n1u();
|
|
3788
|
+
var key = tmp_7.b10(ProbSolve$computeAllSubstitutions$lambda_1(explanationVar));
|
|
3789
3789
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
3790
|
-
var value = destination_0.
|
|
3790
|
+
var value = destination_0.i2(key);
|
|
3791
3791
|
var tmp_8;
|
|
3792
3792
|
if (value == null) {
|
|
3793
3793
|
var answer = ArrayList_init_$Create$_0();
|
|
3794
|
-
destination_0.
|
|
3794
|
+
destination_0.l4(key, answer);
|
|
3795
3795
|
tmp_8 = answer;
|
|
3796
3796
|
} else {
|
|
3797
3797
|
tmp_8 = value;
|
|
@@ -3804,8 +3804,8 @@
|
|
|
3804
3804
|
}
|
|
3805
3805
|
return tmp_5;
|
|
3806
3806
|
};
|
|
3807
|
-
protoOf(ProbSolve).
|
|
3808
|
-
return this.
|
|
3807
|
+
protoOf(ProbSolve).b2f = function (_this__u8e3s4, first, second) {
|
|
3808
|
+
return this.l2n(_this__u8e3s4, first, second);
|
|
3809
3809
|
};
|
|
3810
3810
|
var ProbSolve_instance;
|
|
3811
3811
|
function ProbSolve_getInstance() {
|
|
@@ -3818,28 +3818,28 @@
|
|
|
3818
3818
|
}
|
|
3819
3819
|
function ProbSolveEvidence$computeOne$lambda_0($explanationVar) {
|
|
3820
3820
|
return function (s) {
|
|
3821
|
-
return s.
|
|
3821
|
+
return s.n1u().i2($explanationVar);
|
|
3822
3822
|
};
|
|
3823
3823
|
}
|
|
3824
3824
|
function ProbSolveEvidence$computeOne$lambda_1(it) {
|
|
3825
3825
|
return it instanceof ProbExplanationTerm;
|
|
3826
3826
|
}
|
|
3827
3827
|
function ProbSolveEvidence$computeOne$lambda_2(t) {
|
|
3828
|
-
return t.
|
|
3828
|
+
return t.u37_1;
|
|
3829
3829
|
}
|
|
3830
3830
|
function ProbSolveEvidence() {
|
|
3831
3831
|
ProbSolveEvidence_instance = this;
|
|
3832
3832
|
NonBacktrackable_1.call(this, 'prob_solve_evidence');
|
|
3833
3833
|
}
|
|
3834
|
-
protoOf(ProbSolveEvidence).
|
|
3834
|
+
protoOf(ProbSolveEvidence).v2l = function (_this__u8e3s4, first) {
|
|
3835
3835
|
var evidenceIndicator = Companion_instance_4.ofString('evidence', 2);
|
|
3836
|
-
if (!_this__u8e3s4.context.
|
|
3837
|
-
return _this__u8e3s4.replyWith(Companion_getInstance_9().
|
|
3836
|
+
if (!_this__u8e3s4.context.t1u().containsIndicator(evidenceIndicator) && !_this__u8e3s4.context.u1u().containsIndicator(evidenceIndicator)) {
|
|
3837
|
+
return _this__u8e3s4.replyWith(Companion_getInstance_9().q2f(_this__u8e3s4, first, new ProbExplanationTerm(Companion_getInstance_11().x38_1)), VOID, []);
|
|
3838
3838
|
}
|
|
3839
3839
|
var evidenceTermVar = Companion_getInstance_0().of('TermVar');
|
|
3840
3840
|
var evidenceTruthVar = Companion_getInstance_0().of('TruthVar');
|
|
3841
3841
|
var subQuery = Companion_getInstance_1().of('evidence', [evidenceTermVar, evidenceTruthVar]);
|
|
3842
|
-
var subOptions = ProbSetConfig_getInstance().
|
|
3842
|
+
var subOptions = ProbSetConfig_getInstance().q3b(_this__u8e3s4.context).setLimit(-1).setLazy(false);
|
|
3843
3843
|
// Inline function 'kotlin.sequences.filterIsInstance' call
|
|
3844
3844
|
var this_0 = _this__u8e3s4.subSolver().solveWithOptions(subQuery, subOptions);
|
|
3845
3845
|
var tmp = filter(this_0, ProbSolveEvidence$computeOne$lambda);
|
|
@@ -3851,17 +3851,17 @@
|
|
|
3851
3851
|
var _iterator__ex2g4s = this_1.n();
|
|
3852
3852
|
while (_iterator__ex2g4s.q()) {
|
|
3853
3853
|
var item = _iterator__ex2g4s.r();
|
|
3854
|
-
var truth = item.
|
|
3855
|
-
var term = item.
|
|
3854
|
+
var truth = item.n1u().i2(evidenceTruthVar);
|
|
3855
|
+
var term = item.n1u().i2(evidenceTermVar);
|
|
3856
3856
|
var tmp_0;
|
|
3857
3857
|
var tmp_1;
|
|
3858
|
-
if (term == null || term.
|
|
3858
|
+
if (term == null || term.wu() || truth == null) {
|
|
3859
3859
|
tmp_1 = true;
|
|
3860
3860
|
} else {
|
|
3861
3861
|
tmp_1 = !isInterface(truth, Truth);
|
|
3862
3862
|
}
|
|
3863
3863
|
if (tmp_1) {
|
|
3864
|
-
tmp_0 = Companion_getInstance_11().
|
|
3864
|
+
tmp_0 = Companion_getInstance_11().w38_1;
|
|
3865
3865
|
} else {
|
|
3866
3866
|
var explanationVar = Companion_getInstance_0().of('EXPL');
|
|
3867
3867
|
var tmp_2 = Companion_getInstance_1();
|
|
@@ -3880,10 +3880,10 @@
|
|
|
3880
3880
|
while (iterator.q()) {
|
|
3881
3881
|
var tmp0 = accumulator;
|
|
3882
3882
|
var t = iterator.r();
|
|
3883
|
-
accumulator = t.
|
|
3883
|
+
accumulator = t.j39() === 1.0 ? tmp0 : tmp0.j39() === 1.0 ? t : t.or(tmp0);
|
|
3884
3884
|
}
|
|
3885
3885
|
var totalExplanation = accumulator;
|
|
3886
|
-
tmp_0 = truth.
|
|
3886
|
+
tmp_0 = truth.yt() ? totalExplanation : totalExplanation.not();
|
|
3887
3887
|
}
|
|
3888
3888
|
var tmp$ret$3 = tmp_0;
|
|
3889
3889
|
destination.l(tmp$ret$3);
|
|
@@ -3894,14 +3894,14 @@
|
|
|
3894
3894
|
var _iterator__ex2g4s_0 = destination.n();
|
|
3895
3895
|
while (_iterator__ex2g4s_0.q()) {
|
|
3896
3896
|
var element = _iterator__ex2g4s_0.r();
|
|
3897
|
-
if (!equals(element, Companion_getInstance_11().
|
|
3897
|
+
if (!equals(element, Companion_getInstance_11().w38_1)) {
|
|
3898
3898
|
destination_0.l(element);
|
|
3899
3899
|
}
|
|
3900
3900
|
}
|
|
3901
3901
|
var result = destination_0;
|
|
3902
3902
|
var tmp_6;
|
|
3903
3903
|
if (result.h()) {
|
|
3904
|
-
tmp_6 = Companion_getInstance_11().
|
|
3904
|
+
tmp_6 = Companion_getInstance_11().x38_1;
|
|
3905
3905
|
} else {
|
|
3906
3906
|
// Inline function 'kotlin.collections.reduce' call
|
|
3907
3907
|
var iterator_0 = result.n();
|
|
@@ -3915,10 +3915,10 @@
|
|
|
3915
3915
|
tmp_6 = accumulator_0;
|
|
3916
3916
|
}
|
|
3917
3917
|
var resultExplanation = tmp_6;
|
|
3918
|
-
return _this__u8e3s4.replyWith(Companion_getInstance_9().
|
|
3918
|
+
return _this__u8e3s4.replyWith(Companion_getInstance_9().q2f(_this__u8e3s4, first, new ProbExplanationTerm(resultExplanation)), VOID, []);
|
|
3919
3919
|
};
|
|
3920
|
-
protoOf(ProbSolveEvidence).
|
|
3921
|
-
return this.
|
|
3920
|
+
protoOf(ProbSolveEvidence).d2i = function (_this__u8e3s4, first) {
|
|
3921
|
+
return this.v2l(_this__u8e3s4, first);
|
|
3922
3922
|
};
|
|
3923
3923
|
var ProbSolveEvidence_instance;
|
|
3924
3924
|
function ProbSolveEvidence_getInstance() {
|
|
@@ -3932,51 +3932,51 @@
|
|
|
3932
3932
|
};
|
|
3933
3933
|
}
|
|
3934
3934
|
function ProbSolveWithEvidence$computeAllSubstitutions$slambda($solutions, $goalExplanationVar, $evidenceExplanationTerm, $this_computeAllSubstitutions, $first, $second, resultContinuation) {
|
|
3935
|
-
this.
|
|
3936
|
-
this.
|
|
3937
|
-
this.
|
|
3938
|
-
this.
|
|
3939
|
-
this.
|
|
3940
|
-
this.
|
|
3935
|
+
this.p3c_1 = $solutions;
|
|
3936
|
+
this.q3c_1 = $goalExplanationVar;
|
|
3937
|
+
this.r3c_1 = $evidenceExplanationTerm;
|
|
3938
|
+
this.s3c_1 = $this_computeAllSubstitutions;
|
|
3939
|
+
this.t3c_1 = $first;
|
|
3940
|
+
this.u3c_1 = $second;
|
|
3941
3941
|
CoroutineImpl.call(this, resultContinuation);
|
|
3942
3942
|
}
|
|
3943
|
-
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).
|
|
3944
|
-
var tmp = this.
|
|
3945
|
-
tmp.
|
|
3946
|
-
tmp.
|
|
3947
|
-
return tmp.
|
|
3943
|
+
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).f2q = function ($this$sequence, $completion) {
|
|
3944
|
+
var tmp = this.g2q($this$sequence, $completion);
|
|
3945
|
+
tmp.e8_1 = Unit_instance;
|
|
3946
|
+
tmp.f8_1 = null;
|
|
3947
|
+
return tmp.k8();
|
|
3948
3948
|
};
|
|
3949
|
-
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).
|
|
3950
|
-
return this.
|
|
3949
|
+
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).b9 = function (p1, $completion) {
|
|
3950
|
+
return this.f2q(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
|
|
3951
3951
|
};
|
|
3952
|
-
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).
|
|
3953
|
-
var suspendResult = this.
|
|
3952
|
+
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).k8 = function () {
|
|
3953
|
+
var suspendResult = this.e8_1;
|
|
3954
3954
|
$sm: do
|
|
3955
3955
|
try {
|
|
3956
|
-
var tmp = this.
|
|
3956
|
+
var tmp = this.c8_1;
|
|
3957
3957
|
switch (tmp) {
|
|
3958
3958
|
case 0:
|
|
3959
|
-
this.
|
|
3960
|
-
this.
|
|
3961
|
-
this.
|
|
3959
|
+
this.d8_1 = 6;
|
|
3960
|
+
this.w3c_1 = this.p3c_1.n();
|
|
3961
|
+
this.c8_1 = 1;
|
|
3962
3962
|
continue $sm;
|
|
3963
3963
|
case 1:
|
|
3964
|
-
if (!this.
|
|
3965
|
-
this.
|
|
3964
|
+
if (!this.w3c_1.q()) {
|
|
3965
|
+
this.c8_1 = 5;
|
|
3966
3966
|
continue $sm;
|
|
3967
3967
|
}
|
|
3968
3968
|
|
|
3969
|
-
var solution = this.
|
|
3970
|
-
if (solution.
|
|
3971
|
-
throw ensureNotNull(solution.
|
|
3972
|
-
var goalExplanationTerm = solution.
|
|
3969
|
+
var solution = this.w3c_1.r();
|
|
3970
|
+
if (solution.w1v())
|
|
3971
|
+
throw ensureNotNull(solution.t1v());
|
|
3972
|
+
var goalExplanationTerm = solution.n1u().i2(this.q3c_1);
|
|
3973
3973
|
var tmp_0;
|
|
3974
3974
|
var tmp_1;
|
|
3975
3975
|
var tmp_2;
|
|
3976
|
-
if (this.
|
|
3976
|
+
if (this.r3c_1 == null) {
|
|
3977
3977
|
tmp_2 = true;
|
|
3978
3978
|
} else {
|
|
3979
|
-
var tmp_3 = this.
|
|
3979
|
+
var tmp_3 = this.r3c_1;
|
|
3980
3980
|
tmp_2 = !(tmp_3 instanceof ProbExplanationTerm);
|
|
3981
3981
|
}
|
|
3982
3982
|
|
|
@@ -3993,20 +3993,20 @@
|
|
|
3993
3993
|
}
|
|
3994
3994
|
|
|
3995
3995
|
if (tmp_0) {
|
|
3996
|
-
this.
|
|
3997
|
-
suspendResult = this.
|
|
3996
|
+
this.c8_1 = 3;
|
|
3997
|
+
suspendResult = this.v3c_1.cd(Companion_getInstance_5().failed(), this);
|
|
3998
3998
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3999
3999
|
return suspendResult;
|
|
4000
4000
|
}
|
|
4001
4001
|
continue $sm;
|
|
4002
4002
|
} else {
|
|
4003
|
-
var explanationWithEvidenceTerm = new ProbExplanationTerm(goalExplanationTerm.
|
|
4004
|
-
this.
|
|
4003
|
+
var explanationWithEvidenceTerm = new ProbExplanationTerm(goalExplanationTerm.u37_1.and(this.r3c_1.u37_1));
|
|
4004
|
+
this.c8_1 = 2;
|
|
4005
4005
|
var tmp_4 = Companion_getInstance_5();
|
|
4006
|
-
var tmp_5 = Companion_getInstance_9().
|
|
4007
|
-
var tmp_6 = Companion_getInstance_9().
|
|
4008
|
-
var tmp_7 = solution.
|
|
4009
|
-
suspendResult = this.
|
|
4006
|
+
var tmp_5 = Companion_getInstance_9().q2f(this.s3c_1, this.t3c_1, explanationWithEvidenceTerm);
|
|
4007
|
+
var tmp_6 = Companion_getInstance_9().q2f(this.s3c_1, this.u3c_1, this.r3c_1);
|
|
4008
|
+
var tmp_7 = solution.n1u();
|
|
4009
|
+
suspendResult = this.v3c_1.cd(tmp_4.ofSubstitution(tmp_5, [tmp_6, tmp_7.filter(ProbSolveWithEvidence$computeAllSubstitutions$slambda$lambda(this.q3c_1))]), this);
|
|
4010
4010
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
4011
4011
|
return suspendResult;
|
|
4012
4012
|
}
|
|
@@ -4014,59 +4014,59 @@
|
|
|
4014
4014
|
}
|
|
4015
4015
|
|
|
4016
4016
|
case 2:
|
|
4017
|
-
this.
|
|
4017
|
+
this.c8_1 = 4;
|
|
4018
4018
|
continue $sm;
|
|
4019
4019
|
case 3:
|
|
4020
|
-
this.
|
|
4020
|
+
this.c8_1 = 4;
|
|
4021
4021
|
continue $sm;
|
|
4022
4022
|
case 4:
|
|
4023
|
-
this.
|
|
4023
|
+
this.c8_1 = 1;
|
|
4024
4024
|
continue $sm;
|
|
4025
4025
|
case 5:
|
|
4026
4026
|
return Unit_instance;
|
|
4027
4027
|
case 6:
|
|
4028
|
-
throw this.
|
|
4028
|
+
throw this.f8_1;
|
|
4029
4029
|
}
|
|
4030
4030
|
} catch ($p) {
|
|
4031
4031
|
var e = $p;
|
|
4032
|
-
if (this.
|
|
4032
|
+
if (this.d8_1 === 6) {
|
|
4033
4033
|
throw e;
|
|
4034
4034
|
} else {
|
|
4035
|
-
this.
|
|
4036
|
-
this.
|
|
4035
|
+
this.c8_1 = this.d8_1;
|
|
4036
|
+
this.f8_1 = e;
|
|
4037
4037
|
}
|
|
4038
4038
|
}
|
|
4039
4039
|
while (true);
|
|
4040
4040
|
};
|
|
4041
|
-
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).
|
|
4042
|
-
var i = new ProbSolveWithEvidence$computeAllSubstitutions$slambda(this.
|
|
4043
|
-
i.
|
|
4041
|
+
protoOf(ProbSolveWithEvidence$computeAllSubstitutions$slambda).g2q = function ($this$sequence, completion) {
|
|
4042
|
+
var i = new ProbSolveWithEvidence$computeAllSubstitutions$slambda(this.p3c_1, this.q3c_1, this.r3c_1, this.s3c_1, this.t3c_1, this.u3c_1, completion);
|
|
4043
|
+
i.v3c_1 = $this$sequence;
|
|
4044
4044
|
return i;
|
|
4045
4045
|
};
|
|
4046
4046
|
function ProbSolveWithEvidence$computeAllSubstitutions$slambda_0($solutions, $goalExplanationVar, $evidenceExplanationTerm, $this_computeAllSubstitutions, $first, $second, resultContinuation) {
|
|
4047
4047
|
var i = new ProbSolveWithEvidence$computeAllSubstitutions$slambda($solutions, $goalExplanationVar, $evidenceExplanationTerm, $this_computeAllSubstitutions, $first, $second, resultContinuation);
|
|
4048
4048
|
return constructCallableReference(function ($this$sequence, $completion) {
|
|
4049
|
-
return i.
|
|
4049
|
+
return i.f2q($this$sequence, $completion);
|
|
4050
4050
|
}, 1);
|
|
4051
4051
|
}
|
|
4052
4052
|
function ProbSolveWithEvidence() {
|
|
4053
4053
|
ProbSolveWithEvidence_instance = this;
|
|
4054
4054
|
WithoutSideEffects.call(this, 'prob_solve_with_evidence');
|
|
4055
4055
|
}
|
|
4056
|
-
protoOf(ProbSolveWithEvidence).
|
|
4057
|
-
Companion_getInstance_9().
|
|
4058
|
-
Companion_getInstance_9().
|
|
4056
|
+
protoOf(ProbSolveWithEvidence).g2m = function (_this__u8e3s4, first, second, third) {
|
|
4057
|
+
Companion_getInstance_9().w2f(_this__u8e3s4, 2);
|
|
4058
|
+
Companion_getInstance_9().a2g(_this__u8e3s4, 2);
|
|
4059
4059
|
var evidenceExplanationVar = Companion_getInstance_0().of('EvidenceExplanation');
|
|
4060
4060
|
var tmp;
|
|
4061
|
-
if (ProbSetConfig_getInstance().
|
|
4062
|
-
tmp = toTerm(Companion_getInstance_11().
|
|
4061
|
+
if (ProbSetConfig_getInstance().e3a(_this__u8e3s4.context)) {
|
|
4062
|
+
tmp = toTerm(Companion_getInstance_11().x38_1);
|
|
4063
4063
|
} else {
|
|
4064
4064
|
var tmp_0 = Companion_getInstance_1();
|
|
4065
4065
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
4066
4066
|
var tmp$ret$0 = ProbSolveEvidence_getInstance().signature.name;
|
|
4067
4067
|
var subQuery = tmp_0.of(tmp$ret$0, [evidenceExplanationVar]);
|
|
4068
|
-
var solution = _this__u8e3s4.subSolver().solveOnceWithOptions(subQuery, ProbSetConfig_getInstance().
|
|
4069
|
-
tmp = solution.
|
|
4068
|
+
var solution = _this__u8e3s4.subSolver().solveOnceWithOptions(subQuery, ProbSetConfig_getInstance().q3b(_this__u8e3s4.context));
|
|
4069
|
+
tmp = solution.n1u().i2(evidenceExplanationVar);
|
|
4070
4070
|
}
|
|
4071
4071
|
var evidenceExplanationTerm = tmp;
|
|
4072
4072
|
var goalExplanationVar = Companion_getInstance_0().of('GoalExplanation');
|
|
@@ -4074,11 +4074,11 @@
|
|
|
4074
4074
|
var tmp_2 = Companion_getInstance_1();
|
|
4075
4075
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
4076
4076
|
var tmp$ret$1 = ProbSolve_getInstance().signature.name;
|
|
4077
|
-
var solutions = tmp_1.solveWithOptions(tmp_2.of(tmp$ret$1, [goalExplanationVar, third]), ProbSetConfig_getInstance().
|
|
4077
|
+
var solutions = tmp_1.solveWithOptions(tmp_2.of(tmp$ret$1, [goalExplanationVar, third]), ProbSetConfig_getInstance().q3b(_this__u8e3s4.context));
|
|
4078
4078
|
return sequence(ProbSolveWithEvidence$computeAllSubstitutions$slambda_0(solutions, goalExplanationVar, evidenceExplanationTerm, _this__u8e3s4, first, second, null));
|
|
4079
4079
|
};
|
|
4080
|
-
protoOf(ProbSolveWithEvidence).
|
|
4081
|
-
return this.
|
|
4080
|
+
protoOf(ProbSolveWithEvidence).s2h = function (_this__u8e3s4, first, second, third) {
|
|
4081
|
+
return this.g2m(_this__u8e3s4, first, second, third);
|
|
4082
4082
|
};
|
|
4083
4083
|
var ProbSolveWithEvidence_instance;
|
|
4084
4084
|
function ProbSolveWithEvidence_getInstance() {
|
|
@@ -4090,10 +4090,10 @@
|
|
|
4090
4090
|
Prob_instance = this;
|
|
4091
4091
|
RuleWrapper_init_$Init$('prob', 2, VOID, this);
|
|
4092
4092
|
}
|
|
4093
|
-
protoOf(Prob).
|
|
4093
|
+
protoOf(Prob).j2i = function (_this__u8e3s4) {
|
|
4094
4094
|
return listOf_0([_this__u8e3s4.varOf('EXPL'), _this__u8e3s4.varOf('GOAL')]);
|
|
4095
4095
|
};
|
|
4096
|
-
protoOf(Prob).
|
|
4096
|
+
protoOf(Prob).k2i = function (_this__u8e3s4) {
|
|
4097
4097
|
var expl = _this__u8e3s4.varOf('EXPL');
|
|
4098
4098
|
var goal = _this__u8e3s4.varOf('GOAL');
|
|
4099
4099
|
var newGoal = _this__u8e3s4.varOf('NEW_GOAL');
|
|
@@ -4122,22 +4122,22 @@
|
|
|
4122
4122
|
protoOf(ProblogSolverFactory).mutableSolverOf = mutableSolverOf;
|
|
4123
4123
|
protoOf(ProblogSolverFactory).rawMutableSolverOf = rawMutableSolverOf;
|
|
4124
4124
|
protoOf(ProblogSolverFactory).newBuilder = newBuilder;
|
|
4125
|
-
protoOf(ProblogSolverFactory).
|
|
4126
|
-
protoOf(ProblogSolverFactory).
|
|
4127
|
-
protoOf(ProblogSolverFactory).
|
|
4128
|
-
protoOf(ProblogSolverFactory).
|
|
4129
|
-
protoOf(ProblogSolverFactory).
|
|
4130
|
-
protoOf(ProblogSolverFactory).
|
|
4131
|
-
protoOf(ProblogSolverFactory).
|
|
4132
|
-
protoOf(ProblogSolverFactory).
|
|
4133
|
-
protoOf(ProblogSolverFactory).
|
|
4125
|
+
protoOf(ProblogSolverFactory).c1x = get_defaultRuntime;
|
|
4126
|
+
protoOf(ProblogSolverFactory).e1x = get_defaultUnificator;
|
|
4127
|
+
protoOf(ProblogSolverFactory).i1x = get_defaultStaticKb;
|
|
4128
|
+
protoOf(ProblogSolverFactory).j1x = get_defaultDynamicKb;
|
|
4129
|
+
protoOf(ProblogSolverFactory).k1x = get_defaultInputChannel;
|
|
4130
|
+
protoOf(ProblogSolverFactory).l1x = get_defaultOutputChannel;
|
|
4131
|
+
protoOf(ProblogSolverFactory).m1x = get_defaultErrorChannel;
|
|
4132
|
+
protoOf(ProblogSolverFactory).n1x = get_defaultWarningsChannel;
|
|
4133
|
+
protoOf(ProblogSolverFactory).v1x = solverWithDefaultBuiltins;
|
|
4134
4134
|
protoOf(ProblogSolverFactory).solverWithDefaultBuiltinsAnd = solverWithDefaultBuiltinsAnd;
|
|
4135
|
-
protoOf(ProblogSolverFactory).
|
|
4135
|
+
protoOf(ProblogSolverFactory).x1x = mutableSolverWithDefaultBuiltins;
|
|
4136
4136
|
protoOf(ProblogSolverFactory).mutableSolverWithDefaultBuiltinsAnd = mutableSolverWithDefaultBuiltinsAnd;
|
|
4137
4137
|
defineProp(protoOf(ClauseMappingException), 'message', function () {
|
|
4138
|
-
return this.
|
|
4138
|
+
return this.p1();
|
|
4139
4139
|
});
|
|
4140
|
-
protoOf(BinaryDecisionDiagramExplanation).
|
|
4140
|
+
protoOf(BinaryDecisionDiagramExplanation).k39 = get_probabilityOrNull;
|
|
4141
4141
|
//endregion
|
|
4142
4142
|
//region block: init
|
|
4143
4143
|
ProblogSolverFactory_instance = new ProblogSolverFactory();
|