@tuprolog/2p-full 0.31.5-dev0a → 0.31.5-dev0f
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 +141 -141
- package/2p-core.js +2841 -2841
- package/2p-core.js.map +1 -1
- package/2p-io-lib.js +573 -573
- package/2p-oop-lib.js +815 -815
- package/2p-parser-core.js +136 -136
- package/2p-parser-theory.js +11 -11
- package/2p-repl.js +80 -80
- package/2p-solve-classic.js +936 -936
- package/2p-solve-plp.js +1 -1
- package/2p-solve-problog.js +1250 -1250
- package/2p-solve-streams.js +851 -851
- package/2p-solve.js +3409 -3409
- package/2p-theory.js +1258 -1258
- package/2p-unify.js +208 -208
- package/2p-utils.js +324 -324
- package/clikt-clikt-js-ir.js +1143 -1180
- package/clikt-clikt-js-ir.js.map +1 -1
- package/kotlin-kotlin-stdlib-js-ir.js +760 -747
- package/kotlin-kotlin-stdlib-js-ir.js.map +1 -1
- package/kt-math.js +2184 -2184
- package/kt-math.js.map +1 -1
- package/package.json +1 -1
package/2p-solve-problog.js
CHANGED
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
function get_probabilityOrNull() {
|
|
186
186
|
var tmp;
|
|
187
187
|
try {
|
|
188
|
-
tmp = this.
|
|
188
|
+
tmp = this.x3d();
|
|
189
189
|
} catch ($p) {
|
|
190
190
|
var tmp_0;
|
|
191
191
|
if ($p instanceof Error) {
|
|
@@ -230,160 +230,160 @@
|
|
|
230
230
|
//endregion
|
|
231
231
|
function MutableProblogSolver(solver) {
|
|
232
232
|
ProblogSolver.call(this, solver);
|
|
233
|
-
this.
|
|
233
|
+
this.s3b_1 = solver;
|
|
234
234
|
}
|
|
235
|
-
MutableProblogSolver.prototype.
|
|
236
|
-
this.
|
|
235
|
+
MutableProblogSolver.prototype.f37 = function (library) {
|
|
236
|
+
this.s3b_1.loadLibrary(library);
|
|
237
237
|
};
|
|
238
238
|
MutableProblogSolver.prototype.loadLibrary = function (library) {
|
|
239
|
-
return this.
|
|
239
|
+
return this.f37(library);
|
|
240
240
|
};
|
|
241
|
-
MutableProblogSolver.prototype.
|
|
242
|
-
this.
|
|
241
|
+
MutableProblogSolver.prototype.g37 = function (library) {
|
|
242
|
+
this.s3b_1.unloadLibrary(library);
|
|
243
243
|
};
|
|
244
244
|
MutableProblogSolver.prototype.unloadLibrary = function (library) {
|
|
245
|
-
return this.
|
|
245
|
+
return this.g37(library);
|
|
246
246
|
};
|
|
247
|
-
MutableProblogSolver.prototype.
|
|
248
|
-
this.
|
|
247
|
+
MutableProblogSolver.prototype.h37 = function (libraries) {
|
|
248
|
+
this.s3b_1.setLibraries(libraries);
|
|
249
249
|
};
|
|
250
250
|
MutableProblogSolver.prototype.setLibraries = function (libraries) {
|
|
251
|
-
return this.
|
|
251
|
+
return this.h37(libraries);
|
|
252
252
|
};
|
|
253
|
-
MutableProblogSolver.prototype.
|
|
254
|
-
this.
|
|
253
|
+
MutableProblogSolver.prototype.i37 = function (theory) {
|
|
254
|
+
this.s3b_1.loadStaticKb(Companion_getInstance_22().ofIterable(this.s3b_1.h1l(), theory));
|
|
255
255
|
};
|
|
256
256
|
MutableProblogSolver.prototype.loadStaticKb = function (theory) {
|
|
257
|
-
return this.
|
|
257
|
+
return this.i37(theory);
|
|
258
258
|
};
|
|
259
|
-
MutableProblogSolver.prototype.
|
|
260
|
-
this.
|
|
259
|
+
MutableProblogSolver.prototype.j37 = function (theory) {
|
|
260
|
+
this.s3b_1.appendStaticKb(Companion_getInstance_22().ofIterable(this.s3b_1.h1l(), theory));
|
|
261
261
|
};
|
|
262
262
|
MutableProblogSolver.prototype.appendStaticKb = function (theory) {
|
|
263
|
-
return this.
|
|
263
|
+
return this.j37(theory);
|
|
264
264
|
};
|
|
265
|
-
MutableProblogSolver.prototype.
|
|
266
|
-
this.
|
|
265
|
+
MutableProblogSolver.prototype.k37 = function () {
|
|
266
|
+
this.s3b_1.resetStaticKb();
|
|
267
267
|
};
|
|
268
268
|
MutableProblogSolver.prototype.resetStaticKb = function () {
|
|
269
|
-
return this.
|
|
269
|
+
return this.k37();
|
|
270
270
|
};
|
|
271
|
-
MutableProblogSolver.prototype.
|
|
272
|
-
this.
|
|
271
|
+
MutableProblogSolver.prototype.l37 = function (theory) {
|
|
272
|
+
this.s3b_1.loadDynamicKb(Companion_getInstance_22().ofIterable(this.s3b_1.h1l(), theory));
|
|
273
273
|
};
|
|
274
274
|
MutableProblogSolver.prototype.loadDynamicKb = function (theory) {
|
|
275
|
-
return this.
|
|
275
|
+
return this.l37(theory);
|
|
276
276
|
};
|
|
277
|
-
MutableProblogSolver.prototype.
|
|
278
|
-
this.
|
|
277
|
+
MutableProblogSolver.prototype.m37 = function (theory) {
|
|
278
|
+
this.s3b_1.appendDynamicKb(Companion_getInstance_22().ofIterable(this.s3b_1.h1l(), theory));
|
|
279
279
|
};
|
|
280
280
|
MutableProblogSolver.prototype.appendDynamicKb = function (theory) {
|
|
281
|
-
return this.
|
|
281
|
+
return this.m37(theory);
|
|
282
282
|
};
|
|
283
|
-
MutableProblogSolver.prototype.
|
|
284
|
-
this.
|
|
283
|
+
MutableProblogSolver.prototype.n37 = function () {
|
|
284
|
+
this.s3b_1.resetDynamicKb();
|
|
285
285
|
};
|
|
286
286
|
MutableProblogSolver.prototype.resetDynamicKb = function () {
|
|
287
|
-
return this.
|
|
287
|
+
return this.n37();
|
|
288
288
|
};
|
|
289
|
-
MutableProblogSolver.prototype.
|
|
290
|
-
this.
|
|
289
|
+
MutableProblogSolver.prototype.t1m = function (clause) {
|
|
290
|
+
this.s3b_1.assertA(first(Companion_getInstance_22().of(this.s3b_1.h1l(), [clause]).q1l()));
|
|
291
291
|
};
|
|
292
292
|
MutableProblogSolver.prototype.assertA = function (clause) {
|
|
293
|
-
return this.
|
|
293
|
+
return this.t1m(clause);
|
|
294
294
|
};
|
|
295
|
-
MutableProblogSolver.prototype.
|
|
296
|
-
this.
|
|
295
|
+
MutableProblogSolver.prototype.o37 = function (fact) {
|
|
296
|
+
this.s3b_1.assertA(first(Companion_getInstance_22().of(this.s3b_1.h1l(), [Companion_getInstance().of(fact)]).q1l()));
|
|
297
297
|
};
|
|
298
298
|
MutableProblogSolver.prototype.assertAFact = function (fact) {
|
|
299
|
-
return this.
|
|
299
|
+
return this.o37(fact);
|
|
300
300
|
};
|
|
301
|
-
MutableProblogSolver.prototype.
|
|
302
|
-
this.
|
|
301
|
+
MutableProblogSolver.prototype.t1l = function (clause) {
|
|
302
|
+
this.s3b_1.assertZ(first(Companion_getInstance_22().of(this.s3b_1.h1l(), [clause]).q1l()));
|
|
303
303
|
};
|
|
304
304
|
MutableProblogSolver.prototype.assertZ = function (clause) {
|
|
305
|
-
return this.
|
|
305
|
+
return this.t1l(clause);
|
|
306
306
|
};
|
|
307
|
-
MutableProblogSolver.prototype.
|
|
308
|
-
this.
|
|
307
|
+
MutableProblogSolver.prototype.p37 = function (fact) {
|
|
308
|
+
this.s3b_1.assertA(first(Companion_getInstance_22().of(this.s3b_1.h1l(), [Companion_getInstance().of(fact)]).q1l()));
|
|
309
309
|
};
|
|
310
310
|
MutableProblogSolver.prototype.assertZFact = function (fact) {
|
|
311
|
-
return this.
|
|
311
|
+
return this.p37(fact);
|
|
312
312
|
};
|
|
313
|
-
MutableProblogSolver.prototype.
|
|
314
|
-
return this.
|
|
313
|
+
MutableProblogSolver.prototype.b1t = function (clause) {
|
|
314
|
+
return this.s3b_1.retract(first(Companion_getInstance_22().of(this.s3b_1.h1l(), [clause]).q1l()));
|
|
315
315
|
};
|
|
316
316
|
MutableProblogSolver.prototype.retract = function (clause) {
|
|
317
|
-
return this.
|
|
317
|
+
return this.b1t(clause);
|
|
318
318
|
};
|
|
319
|
-
MutableProblogSolver.prototype.
|
|
320
|
-
return this.
|
|
319
|
+
MutableProblogSolver.prototype.c1t = function (fact) {
|
|
320
|
+
return this.s3b_1.retract(first(Companion_getInstance_22().of(this.s3b_1.h1l(), [Companion_getInstance().of(fact)]).q1l()));
|
|
321
321
|
};
|
|
322
322
|
MutableProblogSolver.prototype.retractByHead = function (fact) {
|
|
323
|
-
return this.
|
|
323
|
+
return this.c1t(fact);
|
|
324
324
|
};
|
|
325
|
-
MutableProblogSolver.prototype.
|
|
326
|
-
return this.
|
|
325
|
+
MutableProblogSolver.prototype.z1l = function (clause) {
|
|
326
|
+
return this.s3b_1.retractAll(first(Companion_getInstance_22().of(this.s3b_1.h1l(), [clause]).q1l()));
|
|
327
327
|
};
|
|
328
328
|
MutableProblogSolver.prototype.retractAll = function (clause) {
|
|
329
|
-
return this.
|
|
329
|
+
return this.z1l(clause);
|
|
330
330
|
};
|
|
331
|
-
MutableProblogSolver.prototype.
|
|
332
|
-
return this.
|
|
331
|
+
MutableProblogSolver.prototype.q37 = function (fact) {
|
|
332
|
+
return this.s3b_1.retractAll(first(Companion_getInstance_22().of(this.s3b_1.h1l(), [Companion_getInstance().of(fact)]).q1l()));
|
|
333
333
|
};
|
|
334
334
|
MutableProblogSolver.prototype.retractAllBeHead = function (fact) {
|
|
335
|
-
return this.
|
|
335
|
+
return this.q37(fact);
|
|
336
336
|
};
|
|
337
|
-
MutableProblogSolver.prototype.
|
|
338
|
-
this.
|
|
337
|
+
MutableProblogSolver.prototype.r37 = function (name, value) {
|
|
338
|
+
this.s3b_1.setFlag(name, value);
|
|
339
339
|
};
|
|
340
340
|
MutableProblogSolver.prototype.setFlag = function (name, value) {
|
|
341
|
-
return this.
|
|
341
|
+
return this.r37(name, value);
|
|
342
342
|
};
|
|
343
|
-
MutableProblogSolver.prototype.
|
|
344
|
-
this.
|
|
343
|
+
MutableProblogSolver.prototype.s37 = function (flag) {
|
|
344
|
+
this.s3b_1.setFlagPair(flag);
|
|
345
345
|
};
|
|
346
346
|
MutableProblogSolver.prototype.setFlagPair = function (flag) {
|
|
347
|
-
return this.
|
|
347
|
+
return this.s37(flag);
|
|
348
348
|
};
|
|
349
|
-
MutableProblogSolver.prototype.
|
|
350
|
-
this.
|
|
349
|
+
MutableProblogSolver.prototype.t37 = function (flag) {
|
|
350
|
+
this.s3b_1.setFlagNotable(flag);
|
|
351
351
|
};
|
|
352
352
|
MutableProblogSolver.prototype.setFlagNotable = function (flag) {
|
|
353
|
-
return this.
|
|
353
|
+
return this.t37(flag);
|
|
354
354
|
};
|
|
355
|
-
MutableProblogSolver.prototype.
|
|
356
|
-
this.
|
|
355
|
+
MutableProblogSolver.prototype.u37 = function (stdIn) {
|
|
356
|
+
this.s3b_1.setStandardInput(stdIn);
|
|
357
357
|
};
|
|
358
358
|
MutableProblogSolver.prototype.setStandardInput = function (stdIn) {
|
|
359
|
-
return this.
|
|
359
|
+
return this.u37(stdIn);
|
|
360
360
|
};
|
|
361
|
-
MutableProblogSolver.prototype.
|
|
362
|
-
this.
|
|
361
|
+
MutableProblogSolver.prototype.v37 = function (stdErr) {
|
|
362
|
+
this.s3b_1.setStandardError(stdErr);
|
|
363
363
|
};
|
|
364
364
|
MutableProblogSolver.prototype.setStandardError = function (stdErr) {
|
|
365
|
-
return this.
|
|
365
|
+
return this.v37(stdErr);
|
|
366
366
|
};
|
|
367
|
-
MutableProblogSolver.prototype.
|
|
368
|
-
this.
|
|
367
|
+
MutableProblogSolver.prototype.w37 = function (stdOut) {
|
|
368
|
+
this.s3b_1.setStandardOutput(stdOut);
|
|
369
369
|
};
|
|
370
370
|
MutableProblogSolver.prototype.setStandardOutput = function (stdOut) {
|
|
371
|
-
return this.
|
|
371
|
+
return this.w37(stdOut);
|
|
372
372
|
};
|
|
373
|
-
MutableProblogSolver.prototype.
|
|
374
|
-
this.
|
|
373
|
+
MutableProblogSolver.prototype.x37 = function (warnings) {
|
|
374
|
+
this.s3b_1.setWarnings(warnings);
|
|
375
375
|
};
|
|
376
376
|
MutableProblogSolver.prototype.setWarnings = function (warnings) {
|
|
377
|
-
return this.
|
|
377
|
+
return this.x37(warnings);
|
|
378
378
|
};
|
|
379
|
-
MutableProblogSolver.prototype.
|
|
380
|
-
return new MutableProblogSolver(this.
|
|
379
|
+
MutableProblogSolver.prototype.m1v = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
380
|
+
return new MutableProblogSolver(this.s3b_1.m1v(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings));
|
|
381
381
|
};
|
|
382
|
-
MutableProblogSolver.prototype.
|
|
383
|
-
return new MutableProblogSolver(this.
|
|
382
|
+
MutableProblogSolver.prototype.w1s = function () {
|
|
383
|
+
return new MutableProblogSolver(this.s3b_1.w1s());
|
|
384
384
|
};
|
|
385
385
|
MutableProblogSolver.prototype.clone = function () {
|
|
386
|
-
return this.
|
|
386
|
+
return this.w1s();
|
|
387
387
|
};
|
|
388
388
|
function get_ANNOTATION_OPERATOR() {
|
|
389
389
|
init_properties_Operators_kt_f59079();
|
|
@@ -418,13 +418,13 @@
|
|
|
418
418
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
419
419
|
var tmp0__get_functor__thl4dk = ProbSetConfig_getInstance();
|
|
420
420
|
tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
|
|
421
|
-
var tmp_1 = tmp_0.of(tmp$ret$0, [ProbSetConfig_getInstance().
|
|
421
|
+
var tmp_1 = tmp_0.of(tmp$ret$0, [ProbSetConfig_getInstance().g3c(options)]);
|
|
422
422
|
var tmp_2 = Companion_getInstance_3();
|
|
423
423
|
var tmp$ret$1;
|
|
424
424
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
425
425
|
var tmp1__get_functor__4k11yf = Prob_getInstance();
|
|
426
426
|
tmp$ret$1 = tmp1__get_functor__4k11yf.signature.name;
|
|
427
|
-
var tmp_3 = $this.
|
|
427
|
+
var tmp_3 = $this.t3b_1.solveWithOptions(tmp.of(tmp_1, tmp_2.of(tmp$ret$1, [anonVar, goal])), options);
|
|
428
428
|
return map(tmp_3, ProblogSolver$solveNonProbabilistically$lambda(goal, anonVar));
|
|
429
429
|
}
|
|
430
430
|
function solveProbabilistically($this, goal, options) {
|
|
@@ -435,7 +435,7 @@
|
|
|
435
435
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
436
436
|
var tmp0__get_functor__thl4dk = ProbQuery_getInstance();
|
|
437
437
|
tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
|
|
438
|
-
var tmp_0 = $this.
|
|
438
|
+
var tmp_0 = $this.t3b_1.solveWithOptions(tmp.of(tmp$ret$0, [probabilityVar, goal, ProbSetConfig_getInstance().g3c(options), bddVar]), options);
|
|
439
439
|
return map(tmp_0, ProblogSolver$solveProbabilistically$lambda(probabilityVar, bddVar, goal, options));
|
|
440
440
|
}
|
|
441
441
|
function ProblogSolver$solveNonProbabilistically$lambda$lambda($anonVar) {
|
|
@@ -449,11 +449,11 @@
|
|
|
449
449
|
var tmp;
|
|
450
450
|
if (isInterface(tmp0_subject, Yes)) {
|
|
451
451
|
var tmp_0 = Companion_getInstance_4();
|
|
452
|
-
var tmp_1 = it.
|
|
453
|
-
tmp = tmp_0.
|
|
452
|
+
var tmp_1 = it.o1u();
|
|
453
|
+
tmp = tmp_0.j1w($goal, tmp_1.i12(ProblogSolver$solveNonProbabilistically$lambda$lambda($anonVar)));
|
|
454
454
|
} else {
|
|
455
455
|
if (isInterface(tmp0_subject, Halt)) {
|
|
456
|
-
tmp = Companion_getInstance_4().halt($goal, it.
|
|
456
|
+
tmp = Companion_getInstance_4().halt($goal, it.z1v());
|
|
457
457
|
} else {
|
|
458
458
|
tmp = Companion_getInstance_4().no($goal);
|
|
459
459
|
}
|
|
@@ -468,17 +468,17 @@
|
|
|
468
468
|
}
|
|
469
469
|
function ProblogSolver$solveProbabilistically$lambda($probabilityVar, $bddVar, $goal, $options) {
|
|
470
470
|
return function (it) {
|
|
471
|
-
var probabilityTerm = it.
|
|
472
|
-
var bddTerm = it.
|
|
471
|
+
var probabilityTerm = it.o1u().a3($probabilityVar);
|
|
472
|
+
var bddTerm = it.o1u().a3($bddVar);
|
|
473
473
|
var tmp0_subject = it;
|
|
474
474
|
var tmp;
|
|
475
475
|
if (isInterface(tmp0_subject, Yes)) {
|
|
476
476
|
var tmp_0 = Companion_getInstance_4();
|
|
477
|
-
var tmp_1 = it.
|
|
478
|
-
tmp = tmp_0.
|
|
477
|
+
var tmp_1 = it.o1u();
|
|
478
|
+
tmp = tmp_0.j1w($goal, tmp_1.i12(ProblogSolver$solveProbabilistically$lambda$lambda($probabilityVar, $bddVar)));
|
|
479
479
|
} else {
|
|
480
480
|
if (isInterface(tmp0_subject, Halt)) {
|
|
481
|
-
tmp = Companion_getInstance_4().halt($goal, it.
|
|
481
|
+
tmp = Companion_getInstance_4().halt($goal, it.z1v());
|
|
482
482
|
} else {
|
|
483
483
|
tmp = Companion_getInstance_4().no($goal);
|
|
484
484
|
}
|
|
@@ -491,7 +491,7 @@
|
|
|
491
491
|
var tmp1_subject = probabilityTerm;
|
|
492
492
|
var tmp_3;
|
|
493
493
|
if (!(tmp1_subject == null) ? isInterface(tmp1_subject, Numeric) : false) {
|
|
494
|
-
tmp_3 = setProbability(newSolution, probabilityTerm.
|
|
494
|
+
tmp_3 = setProbability(newSolution, probabilityTerm.u10().toDouble());
|
|
495
495
|
} else {
|
|
496
496
|
var tmp_4 = newSolution;
|
|
497
497
|
DoubleCompanionObject_getInstance();
|
|
@@ -505,9 +505,9 @@
|
|
|
505
505
|
tmp_5 = false;
|
|
506
506
|
}
|
|
507
507
|
if (tmp_5) {
|
|
508
|
-
var explanation = bddTerm.
|
|
508
|
+
var explanation = bddTerm.h3c_1;
|
|
509
509
|
if (explanation instanceof BinaryDecisionDiagramExplanation) {
|
|
510
|
-
newSolution = setBinaryDecisionDiagram(newSolution, explanation.
|
|
510
|
+
newSolution = setBinaryDecisionDiagram(newSolution, explanation.j3c_1);
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
513
|
tmp_2 = newSolution;
|
|
@@ -516,45 +516,45 @@
|
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
518
|
function ProblogSolver(solver) {
|
|
519
|
-
this.
|
|
519
|
+
this.t3b_1 = solver;
|
|
520
520
|
}
|
|
521
|
-
ProblogSolver.prototype.
|
|
522
|
-
return this.
|
|
521
|
+
ProblogSolver.prototype.w1u = function () {
|
|
522
|
+
return this.t3b_1.w1u();
|
|
523
523
|
};
|
|
524
|
-
ProblogSolver.prototype.
|
|
525
|
-
return this.
|
|
524
|
+
ProblogSolver.prototype.u1u = function () {
|
|
525
|
+
return this.t3b_1.u1u();
|
|
526
526
|
};
|
|
527
|
-
ProblogSolver.prototype.
|
|
528
|
-
return this.
|
|
527
|
+
ProblogSolver.prototype.x1u = function () {
|
|
528
|
+
return this.t3b_1.x1u();
|
|
529
529
|
};
|
|
530
|
-
ProblogSolver.prototype.
|
|
531
|
-
return this.
|
|
530
|
+
ProblogSolver.prototype.t1u = function () {
|
|
531
|
+
return this.t3b_1.t1u();
|
|
532
532
|
};
|
|
533
|
-
ProblogSolver.prototype.
|
|
534
|
-
return this.
|
|
533
|
+
ProblogSolver.prototype.e1v = function () {
|
|
534
|
+
return this.t3b_1.e1v();
|
|
535
535
|
};
|
|
536
|
-
ProblogSolver.prototype.
|
|
537
|
-
return this.
|
|
536
|
+
ProblogSolver.prototype.y1u = function () {
|
|
537
|
+
return this.t3b_1.y1u();
|
|
538
538
|
};
|
|
539
|
-
ProblogSolver.prototype.
|
|
540
|
-
return this.
|
|
539
|
+
ProblogSolver.prototype.j1v = function () {
|
|
540
|
+
return this.t3b_1.j1v();
|
|
541
541
|
};
|
|
542
|
-
ProblogSolver.prototype.
|
|
543
|
-
return this.
|
|
542
|
+
ProblogSolver.prototype.f1v = function () {
|
|
543
|
+
return this.t3b_1.f1v();
|
|
544
544
|
};
|
|
545
|
-
ProblogSolver.prototype.
|
|
546
|
-
return this.
|
|
545
|
+
ProblogSolver.prototype.h1v = function () {
|
|
546
|
+
return this.t3b_1.h1v();
|
|
547
547
|
};
|
|
548
|
-
ProblogSolver.prototype.
|
|
549
|
-
return this.
|
|
548
|
+
ProblogSolver.prototype.v1u = function () {
|
|
549
|
+
return this.t3b_1.v1u();
|
|
550
550
|
};
|
|
551
|
-
ProblogSolver.prototype.
|
|
552
|
-
return this.
|
|
551
|
+
ProblogSolver.prototype.h1l = function () {
|
|
552
|
+
return this.t3b_1.h1l();
|
|
553
553
|
};
|
|
554
|
-
ProblogSolver.prototype.
|
|
555
|
-
return this.
|
|
554
|
+
ProblogSolver.prototype.l1v = function () {
|
|
555
|
+
return this.t3b_1.l1v();
|
|
556
556
|
};
|
|
557
|
-
ProblogSolver.prototype.
|
|
557
|
+
ProblogSolver.prototype.z2b = function (goal, options) {
|
|
558
558
|
var tmp;
|
|
559
559
|
if (!get_isProbabilistic(options)) {
|
|
560
560
|
tmp = solveNonProbabilistically(this, goal, options);
|
|
@@ -564,64 +564,64 @@
|
|
|
564
564
|
return tmp;
|
|
565
565
|
};
|
|
566
566
|
ProblogSolver.prototype.solveWithOptions = function (goal, options) {
|
|
567
|
-
return this.
|
|
567
|
+
return this.z2b(goal, options);
|
|
568
568
|
};
|
|
569
|
-
ProblogSolver.prototype.
|
|
570
|
-
return this.
|
|
569
|
+
ProblogSolver.prototype.u3b = function (goal, timeout) {
|
|
570
|
+
return this.z2b(goal, Companion_getInstance_5().allLazilyWithTimeout(timeout));
|
|
571
571
|
};
|
|
572
572
|
ProblogSolver.prototype.solveWithTimeout = function (goal, timeout) {
|
|
573
|
-
return this.
|
|
573
|
+
return this.u3b(goal, timeout);
|
|
574
574
|
};
|
|
575
|
-
ProblogSolver.prototype.
|
|
576
|
-
return this.
|
|
575
|
+
ProblogSolver.prototype.v3b = function (goal) {
|
|
576
|
+
return this.z2b(goal, Companion_getInstance_5().DEFAULT);
|
|
577
577
|
};
|
|
578
578
|
ProblogSolver.prototype.solve = function (goal) {
|
|
579
|
-
return this.
|
|
579
|
+
return this.v3b(goal);
|
|
580
580
|
};
|
|
581
|
-
ProblogSolver.prototype.
|
|
582
|
-
return toList(this.
|
|
581
|
+
ProblogSolver.prototype.w3b = function (goal, timeout) {
|
|
582
|
+
return toList(this.u3b(goal, timeout));
|
|
583
583
|
};
|
|
584
584
|
ProblogSolver.prototype.solveListWithTimeout = function (goal, timeout) {
|
|
585
|
-
return this.
|
|
585
|
+
return this.w3b(goal, timeout);
|
|
586
586
|
};
|
|
587
|
-
ProblogSolver.prototype.
|
|
588
|
-
return toList(this.
|
|
587
|
+
ProblogSolver.prototype.x3b = function (goal) {
|
|
588
|
+
return toList(this.v3b(goal));
|
|
589
589
|
};
|
|
590
590
|
ProblogSolver.prototype.solveList = function (goal) {
|
|
591
|
-
return this.
|
|
591
|
+
return this.x3b(goal);
|
|
592
592
|
};
|
|
593
|
-
ProblogSolver.prototype.
|
|
594
|
-
return toList(this.
|
|
593
|
+
ProblogSolver.prototype.y3b = function (goal, options) {
|
|
594
|
+
return toList(this.z2b(goal, options));
|
|
595
595
|
};
|
|
596
596
|
ProblogSolver.prototype.solveListWithOptions = function (goal, options) {
|
|
597
|
-
return this.
|
|
597
|
+
return this.y3b(goal, options);
|
|
598
598
|
};
|
|
599
|
-
ProblogSolver.prototype.
|
|
600
|
-
return first_0(this.
|
|
599
|
+
ProblogSolver.prototype.z3b = function (goal, timeout) {
|
|
600
|
+
return first_0(this.z2b(goal, Companion_getInstance_5().someLazilyWithTimeout(1, timeout)));
|
|
601
601
|
};
|
|
602
602
|
ProblogSolver.prototype.solveOnceWithTimeout = function (goal, timeout) {
|
|
603
|
-
return this.
|
|
603
|
+
return this.z3b(goal, timeout);
|
|
604
604
|
};
|
|
605
|
-
ProblogSolver.prototype.
|
|
606
|
-
return first_0(this.
|
|
605
|
+
ProblogSolver.prototype.a3c = function (goal) {
|
|
606
|
+
return first_0(this.z2b(goal, Companion_getInstance_5().someLazily(1)));
|
|
607
607
|
};
|
|
608
608
|
ProblogSolver.prototype.solveOnce = function (goal) {
|
|
609
|
-
return this.
|
|
609
|
+
return this.a3c(goal);
|
|
610
610
|
};
|
|
611
|
-
ProblogSolver.prototype.
|
|
612
|
-
return first_0(this.
|
|
611
|
+
ProblogSolver.prototype.b3c = function (goal, options) {
|
|
612
|
+
return first_0(this.z2b(goal, options.setLimit(1)));
|
|
613
613
|
};
|
|
614
614
|
ProblogSolver.prototype.solveOnceWithOptions = function (goal, options) {
|
|
615
|
-
return this.
|
|
615
|
+
return this.b3c(goal, options);
|
|
616
616
|
};
|
|
617
|
-
ProblogSolver.prototype.
|
|
618
|
-
return new ProblogSolver(this.
|
|
617
|
+
ProblogSolver.prototype.m1v = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
618
|
+
return new ProblogSolver(this.t3b_1.m1v(unificator, libraries, flags, Companion_getInstance_22().ofIterable(unificator, staticKb), Companion_getInstance_22().ofIterable(unificator, dynamicKb), stdIn, stdOut, stdErr, warnings));
|
|
619
619
|
};
|
|
620
|
-
ProblogSolver.prototype.
|
|
621
|
-
return new ProblogSolver(this.
|
|
620
|
+
ProblogSolver.prototype.w1s = function () {
|
|
621
|
+
return new ProblogSolver(this.t3b_1.clone());
|
|
622
622
|
};
|
|
623
623
|
ProblogSolver.prototype.clone = function () {
|
|
624
|
-
return this.
|
|
624
|
+
return this.w1s();
|
|
625
625
|
};
|
|
626
626
|
function ensureVariablesTracking($this, flags) {
|
|
627
627
|
var tmp = TrackVariables_getInstance();
|
|
@@ -631,7 +631,7 @@
|
|
|
631
631
|
var tmp;
|
|
632
632
|
var tmp$ret$1;
|
|
633
633
|
// Inline function 'kotlin.collections.contains' call
|
|
634
|
-
var tmp0_contains = ProblogLib_getInstance().
|
|
634
|
+
var tmp0_contains = ProblogLib_getInstance().l2e();
|
|
635
635
|
var tmp$ret$0;
|
|
636
636
|
// Inline function 'kotlin.collections.containsKey' call
|
|
637
637
|
tmp$ret$0 = (isInterface(libraries, Map) ? libraries : THROW_CCE()).u2(tmp0_contains);
|
|
@@ -644,28 +644,28 @@
|
|
|
644
644
|
return tmp;
|
|
645
645
|
}
|
|
646
646
|
function ProblogSolverFactory$ensureVariablesTracking$lambda($this$invoke) {
|
|
647
|
-
return $this$invoke.
|
|
647
|
+
return $this$invoke.r29_1;
|
|
648
648
|
}
|
|
649
649
|
function ProblogSolverFactory() {
|
|
650
650
|
ProblogSolverFactory_instance = this;
|
|
651
651
|
}
|
|
652
|
-
ProblogSolverFactory.prototype.
|
|
652
|
+
ProblogSolverFactory.prototype.a1y = function () {
|
|
653
653
|
return DefaultBuiltins_getInstance_0();
|
|
654
654
|
};
|
|
655
|
-
ProblogSolverFactory.prototype.
|
|
655
|
+
ProblogSolverFactory.prototype.c1y = function () {
|
|
656
656
|
return ensureVariablesTracking(this, get_defaultFlags.call(this));
|
|
657
657
|
};
|
|
658
|
-
ProblogSolverFactory.prototype.
|
|
659
|
-
return new ProblogSolver(ClassicSolverFactory_getInstance().
|
|
658
|
+
ProblogSolverFactory.prototype.q1y = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs) {
|
|
659
|
+
return new ProblogSolver(ClassicSolverFactory_getInstance().q1y(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_getInstance_22().ofIterable(unificator, staticKb), Companion_getInstance_22().ofIterable(unificator, dynamicKb), inputs, outputs));
|
|
660
660
|
};
|
|
661
|
-
ProblogSolverFactory.prototype.
|
|
662
|
-
return new ProblogSolver(ClassicSolverFactory_getInstance().
|
|
661
|
+
ProblogSolverFactory.prototype.s1y = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
662
|
+
return new ProblogSolver(ClassicSolverFactory_getInstance().s1y(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_getInstance_22().ofIterable(unificator, staticKb), Companion_getInstance_22().ofIterable(unificator, dynamicKb), stdIn, stdOut, stdErr, warnings));
|
|
663
663
|
};
|
|
664
|
-
ProblogSolverFactory.prototype.
|
|
665
|
-
return new MutableProblogSolver(ClassicSolverFactory_getInstance().
|
|
664
|
+
ProblogSolverFactory.prototype.w1y = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
665
|
+
return new MutableProblogSolver(ClassicSolverFactory_getInstance().w1y(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_getInstance_22().ofIterable(unificator, staticKb), Companion_getInstance_22().ofIterable(unificator, dynamicKb), stdIn, stdOut, stdErr, warnings));
|
|
666
666
|
};
|
|
667
|
-
ProblogSolverFactory.prototype.
|
|
668
|
-
return new MutableProblogSolver(ClassicSolverFactory_getInstance().
|
|
667
|
+
ProblogSolverFactory.prototype.a1z = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs) {
|
|
668
|
+
return new MutableProblogSolver(ClassicSolverFactory_getInstance().a1z(unificator, fixLibraries(this, libraries), ensureVariablesTracking(this, flags), Companion_getInstance_22().ofIterable(unificator, staticKb), Companion_getInstance_22().ofIterable(unificator, dynamicKb), inputs, outputs));
|
|
669
669
|
};
|
|
670
670
|
var ProblogSolverFactory_instance;
|
|
671
671
|
function ProblogSolverFactory_getInstance() {
|
|
@@ -677,17 +677,17 @@
|
|
|
677
677
|
DefaultBuiltins_instance = this;
|
|
678
678
|
ExtensionLibrary.call(this, DefaultBuiltins_getInstance());
|
|
679
679
|
}
|
|
680
|
-
DefaultBuiltins.prototype.
|
|
681
|
-
return ProblogLib_getInstance().
|
|
680
|
+
DefaultBuiltins.prototype.l2e = function () {
|
|
681
|
+
return ProblogLib_getInstance().l2e();
|
|
682
682
|
};
|
|
683
|
-
DefaultBuiltins.prototype.
|
|
684
|
-
return ProblogLib_getInstance().
|
|
683
|
+
DefaultBuiltins.prototype.w2e = function () {
|
|
684
|
+
return ProblogLib_getInstance().w2e();
|
|
685
685
|
};
|
|
686
|
-
DefaultBuiltins.prototype.
|
|
687
|
-
return ProblogLib_getInstance().
|
|
686
|
+
DefaultBuiltins.prototype.y2e = function () {
|
|
687
|
+
return ProblogLib_getInstance().y2e();
|
|
688
688
|
};
|
|
689
|
-
DefaultBuiltins.prototype.
|
|
690
|
-
return ProblogLib_getInstance().
|
|
689
|
+
DefaultBuiltins.prototype.x2e = function () {
|
|
690
|
+
return ProblogLib_getInstance().x2e();
|
|
691
691
|
};
|
|
692
692
|
var DefaultBuiltins_instance;
|
|
693
693
|
function DefaultBuiltins_getInstance_0() {
|
|
@@ -699,10 +699,10 @@
|
|
|
699
699
|
MinimalBuiltins_instance = this;
|
|
700
700
|
ExtensionLibrary.call(this, ProblogLib_getInstance());
|
|
701
701
|
}
|
|
702
|
-
MinimalBuiltins.prototype.
|
|
702
|
+
MinimalBuiltins.prototype.y2e = function () {
|
|
703
703
|
return listOf(EnsureExecutable_getInstance());
|
|
704
704
|
};
|
|
705
|
-
MinimalBuiltins.prototype.
|
|
705
|
+
MinimalBuiltins.prototype.x2e = function () {
|
|
706
706
|
return listOf(Call_getInstance());
|
|
707
707
|
};
|
|
708
708
|
var MinimalBuiltins_instance;
|
|
@@ -714,18 +714,18 @@
|
|
|
714
714
|
function ProblogLib() {
|
|
715
715
|
ProblogLib_instance = this;
|
|
716
716
|
var tmp = Companion_getInstance_6();
|
|
717
|
-
ExtensionLibrary.call(this, tmp.
|
|
718
|
-
this.
|
|
719
|
-
this.
|
|
720
|
-
this.
|
|
717
|
+
ExtensionLibrary.call(this, tmp.j2e('problog.lang', null, null, null, null, 30, null));
|
|
718
|
+
this.a3d_1 = 'EXPL';
|
|
719
|
+
this.b3d_1 = 'evidence';
|
|
720
|
+
this.c3d_1 = 'prob';
|
|
721
721
|
}
|
|
722
|
-
ProblogLib.prototype.
|
|
722
|
+
ProblogLib.prototype.w2e = function () {
|
|
723
723
|
return get_PROBLOG_SPECIFIC_OPERATORS();
|
|
724
724
|
};
|
|
725
|
-
ProblogLib.prototype.
|
|
725
|
+
ProblogLib.prototype.x2e = function () {
|
|
726
726
|
return listOf(Prob_getInstance());
|
|
727
727
|
};
|
|
728
|
-
ProblogLib.prototype.
|
|
728
|
+
ProblogLib.prototype.y2e = function () {
|
|
729
729
|
return listOf_0([ProbHelper_getInstance(), ProbSolve_getInstance(), ProbExplAnd_getInstance(), ProbQuery_getInstance(), ProbSolveEvidence_getInstance(), ProbSolveWithEvidence_getInstance(), ProbNegationAsFailure_getInstance(), ProbSetConfig_getInstance()]);
|
|
730
730
|
};
|
|
731
731
|
var ProblogLib_instance;
|
|
@@ -747,11 +747,11 @@
|
|
|
747
747
|
}
|
|
748
748
|
function ClauseMappingException(message, cause) {
|
|
749
749
|
TuPrologException_init_$Init$(cause, this);
|
|
750
|
-
this.
|
|
750
|
+
this.j3d_1 = message;
|
|
751
751
|
captureStack(this, ClauseMappingException);
|
|
752
752
|
}
|
|
753
753
|
ClauseMappingException.prototype.k1 = function () {
|
|
754
|
-
return this.
|
|
754
|
+
return this.j3d_1;
|
|
755
755
|
};
|
|
756
756
|
Object.defineProperty(ClauseMappingException.prototype, 'message', {
|
|
757
757
|
configurable: true,
|
|
@@ -803,11 +803,11 @@
|
|
|
803
803
|
}
|
|
804
804
|
function Companion_0() {
|
|
805
805
|
Companion_instance_0 = this;
|
|
806
|
-
this.
|
|
807
|
-
this.
|
|
806
|
+
this.k3d_1 = new BinaryDecisionDiagramExplanation(bddTerminalOf(false), Companion_getInstance_23().n3d_1);
|
|
807
|
+
this.l3d_1 = new BinaryDecisionDiagramExplanation(bddTerminalOf(true), Companion_getInstance_23().o3d_1);
|
|
808
808
|
}
|
|
809
|
-
Companion_0.prototype.
|
|
810
|
-
return new BinaryDecisionDiagramExplanation(bddOf(term), new ComputedValue(term.
|
|
809
|
+
Companion_0.prototype.p3d = function (term) {
|
|
810
|
+
return new BinaryDecisionDiagramExplanation(bddOf(term), new ComputedValue(term.r3d_1));
|
|
811
811
|
};
|
|
812
812
|
var Companion_instance_0;
|
|
813
813
|
function Companion_getInstance_21() {
|
|
@@ -818,373 +818,373 @@
|
|
|
818
818
|
function ProbExplanation() {
|
|
819
819
|
}
|
|
820
820
|
function ProbExplanationTerm$freshCopy$lambda(it) {
|
|
821
|
-
return it.
|
|
821
|
+
return it.fw();
|
|
822
822
|
}
|
|
823
823
|
function ProbExplanationTerm$freshCopy$lambda_0($scope) {
|
|
824
824
|
return function (it) {
|
|
825
|
-
return it.
|
|
825
|
+
return it.gw($scope);
|
|
826
826
|
};
|
|
827
827
|
}
|
|
828
828
|
function ProbExplanationTerm$apply$lambda($substitution) {
|
|
829
829
|
return function (it) {
|
|
830
|
-
return it.
|
|
830
|
+
return it.p16($substitution);
|
|
831
831
|
};
|
|
832
832
|
}
|
|
833
833
|
function ProbExplanationTerm(explanation) {
|
|
834
|
-
this.
|
|
835
|
-
this.
|
|
834
|
+
this.h3c_1 = explanation;
|
|
835
|
+
this.i3c_1 = Companion_getInstance_8().of('<expl:' + explanation + '>');
|
|
836
836
|
}
|
|
837
|
-
ProbExplanationTerm.prototype.
|
|
838
|
-
return this.
|
|
837
|
+
ProbExplanationTerm.prototype.dw = function () {
|
|
838
|
+
return this.i3c_1.dw();
|
|
839
839
|
};
|
|
840
|
-
ProbExplanationTerm.prototype.
|
|
841
|
-
return this.
|
|
840
|
+
ProbExplanationTerm.prototype.vw = function () {
|
|
841
|
+
return this.i3c_1.vw();
|
|
842
842
|
};
|
|
843
|
-
ProbExplanationTerm.prototype.
|
|
844
|
-
return this.
|
|
843
|
+
ProbExplanationTerm.prototype.wv = function () {
|
|
844
|
+
return this.i3c_1.wv();
|
|
845
845
|
};
|
|
846
|
-
ProbExplanationTerm.prototype.
|
|
847
|
-
return this.
|
|
846
|
+
ProbExplanationTerm.prototype.cw = function () {
|
|
847
|
+
return this.i3c_1.cw();
|
|
848
848
|
};
|
|
849
|
-
ProbExplanationTerm.prototype.
|
|
850
|
-
return this.
|
|
849
|
+
ProbExplanationTerm.prototype.uw = function () {
|
|
850
|
+
return this.i3c_1.uw();
|
|
851
851
|
};
|
|
852
|
-
ProbExplanationTerm.prototype.
|
|
853
|
-
return this.
|
|
852
|
+
ProbExplanationTerm.prototype.xv = function () {
|
|
853
|
+
return this.i3c_1.xv();
|
|
854
854
|
};
|
|
855
|
-
ProbExplanationTerm.prototype.
|
|
856
|
-
return this.
|
|
855
|
+
ProbExplanationTerm.prototype.qw = function () {
|
|
856
|
+
return this.i3c_1.qw();
|
|
857
857
|
};
|
|
858
|
-
ProbExplanationTerm.prototype.
|
|
859
|
-
return this.
|
|
858
|
+
ProbExplanationTerm.prototype.jw = function () {
|
|
859
|
+
return this.i3c_1.jw();
|
|
860
860
|
};
|
|
861
|
-
ProbExplanationTerm.prototype.
|
|
862
|
-
return this.
|
|
861
|
+
ProbExplanationTerm.prototype.pw = function () {
|
|
862
|
+
return this.i3c_1.pw();
|
|
863
863
|
};
|
|
864
|
-
ProbExplanationTerm.prototype.
|
|
865
|
-
return this.
|
|
864
|
+
ProbExplanationTerm.prototype.lw = function () {
|
|
865
|
+
return this.i3c_1.lw();
|
|
866
866
|
};
|
|
867
|
-
ProbExplanationTerm.prototype.
|
|
868
|
-
return this.
|
|
867
|
+
ProbExplanationTerm.prototype.yv = function () {
|
|
868
|
+
return this.i3c_1.yv();
|
|
869
869
|
};
|
|
870
|
-
ProbExplanationTerm.prototype.
|
|
871
|
-
return this.
|
|
870
|
+
ProbExplanationTerm.prototype.zv = function () {
|
|
871
|
+
return this.i3c_1.zv();
|
|
872
872
|
};
|
|
873
|
-
ProbExplanationTerm.prototype.
|
|
874
|
-
return this.
|
|
873
|
+
ProbExplanationTerm.prototype.mw = function () {
|
|
874
|
+
return this.i3c_1.mw();
|
|
875
875
|
};
|
|
876
|
-
ProbExplanationTerm.prototype.
|
|
877
|
-
return this.
|
|
876
|
+
ProbExplanationTerm.prototype.bw = function () {
|
|
877
|
+
return this.i3c_1.bw();
|
|
878
878
|
};
|
|
879
|
-
ProbExplanationTerm.prototype.
|
|
880
|
-
return this.
|
|
879
|
+
ProbExplanationTerm.prototype.tw = function () {
|
|
880
|
+
return this.i3c_1.tw();
|
|
881
881
|
};
|
|
882
|
-
ProbExplanationTerm.prototype.
|
|
883
|
-
return this.
|
|
882
|
+
ProbExplanationTerm.prototype.rw = function () {
|
|
883
|
+
return this.i3c_1.rw();
|
|
884
884
|
};
|
|
885
|
-
ProbExplanationTerm.prototype.
|
|
886
|
-
return this.
|
|
885
|
+
ProbExplanationTerm.prototype.dx = function () {
|
|
886
|
+
return this.i3c_1.dx();
|
|
887
887
|
};
|
|
888
|
-
ProbExplanationTerm.prototype.
|
|
889
|
-
return this.
|
|
888
|
+
ProbExplanationTerm.prototype.ow = function () {
|
|
889
|
+
return this.i3c_1.ow();
|
|
890
890
|
};
|
|
891
|
-
ProbExplanationTerm.prototype.
|
|
892
|
-
return this.
|
|
891
|
+
ProbExplanationTerm.prototype.cx = function () {
|
|
892
|
+
return this.i3c_1.cx();
|
|
893
893
|
};
|
|
894
|
-
ProbExplanationTerm.prototype.
|
|
895
|
-
return this.
|
|
894
|
+
ProbExplanationTerm.prototype.ex = function () {
|
|
895
|
+
return this.i3c_1.ex();
|
|
896
896
|
};
|
|
897
|
-
ProbExplanationTerm.prototype.
|
|
898
|
-
return this.
|
|
897
|
+
ProbExplanationTerm.prototype.ax = function () {
|
|
898
|
+
return this.i3c_1.ax();
|
|
899
899
|
};
|
|
900
|
-
ProbExplanationTerm.prototype.
|
|
901
|
-
return this.
|
|
900
|
+
ProbExplanationTerm.prototype.kw = function () {
|
|
901
|
+
return this.i3c_1.kw();
|
|
902
902
|
};
|
|
903
|
-
ProbExplanationTerm.prototype.
|
|
904
|
-
return this.
|
|
903
|
+
ProbExplanationTerm.prototype.iw = function () {
|
|
904
|
+
return this.i3c_1.iw();
|
|
905
905
|
};
|
|
906
|
-
ProbExplanationTerm.prototype.
|
|
907
|
-
return this.
|
|
906
|
+
ProbExplanationTerm.prototype.aw = function () {
|
|
907
|
+
return this.i3c_1.aw();
|
|
908
908
|
};
|
|
909
|
-
ProbExplanationTerm.prototype.
|
|
910
|
-
return this.
|
|
909
|
+
ProbExplanationTerm.prototype.zw = function () {
|
|
910
|
+
return this.i3c_1.zw();
|
|
911
911
|
};
|
|
912
|
-
ProbExplanationTerm.prototype.
|
|
913
|
-
return this.
|
|
912
|
+
ProbExplanationTerm.prototype.nw = function () {
|
|
913
|
+
return this.i3c_1.nw();
|
|
914
914
|
};
|
|
915
|
-
ProbExplanationTerm.prototype.
|
|
916
|
-
return this.
|
|
915
|
+
ProbExplanationTerm.prototype.yw = function () {
|
|
916
|
+
return this.i3c_1.yw();
|
|
917
917
|
};
|
|
918
|
-
ProbExplanationTerm.prototype.
|
|
919
|
-
return this.
|
|
918
|
+
ProbExplanationTerm.prototype.ht = function () {
|
|
919
|
+
return this.i3c_1.ht();
|
|
920
920
|
};
|
|
921
921
|
ProbExplanationTerm.prototype.b1 = function () {
|
|
922
|
-
return this.
|
|
922
|
+
return this.i3c_1.b1();
|
|
923
923
|
};
|
|
924
|
-
ProbExplanationTerm.prototype.
|
|
925
|
-
return this.
|
|
924
|
+
ProbExplanationTerm.prototype.ew = function () {
|
|
925
|
+
return this.i3c_1.ew();
|
|
926
926
|
};
|
|
927
927
|
ProbExplanationTerm.prototype.accept = function (visitor) {
|
|
928
|
-
return this.
|
|
928
|
+
return this.i3c_1.accept(visitor);
|
|
929
929
|
};
|
|
930
930
|
ProbExplanationTerm.prototype.addFirst = function (argument) {
|
|
931
|
-
return this.
|
|
931
|
+
return this.i3c_1.addFirst(argument);
|
|
932
932
|
};
|
|
933
933
|
ProbExplanationTerm.prototype.addLast = function (argument) {
|
|
934
|
-
return this.
|
|
934
|
+
return this.i3c_1.addLast(argument);
|
|
935
935
|
};
|
|
936
936
|
ProbExplanationTerm.prototype.append = function (argument) {
|
|
937
|
-
return this.
|
|
937
|
+
return this.i3c_1.append(argument);
|
|
938
938
|
};
|
|
939
|
-
ProbExplanationTerm.prototype.
|
|
940
|
-
return this.
|
|
939
|
+
ProbExplanationTerm.prototype.hw = function () {
|
|
940
|
+
return this.i3c_1.hw();
|
|
941
941
|
};
|
|
942
942
|
ProbExplanationTerm.prototype.asAtom = function () {
|
|
943
|
-
return this.
|
|
943
|
+
return this.hw();
|
|
944
944
|
};
|
|
945
945
|
ProbExplanationTerm.prototype.asBlock = function () {
|
|
946
|
-
return this.
|
|
946
|
+
return this.i3c_1.asBlock();
|
|
947
947
|
};
|
|
948
948
|
ProbExplanationTerm.prototype.asClause = function () {
|
|
949
|
-
return this.
|
|
949
|
+
return this.i3c_1.asClause();
|
|
950
950
|
};
|
|
951
951
|
ProbExplanationTerm.prototype.asCons = function () {
|
|
952
|
-
return this.
|
|
952
|
+
return this.i3c_1.asCons();
|
|
953
953
|
};
|
|
954
954
|
ProbExplanationTerm.prototype.asDirective = function () {
|
|
955
|
-
return this.
|
|
955
|
+
return this.i3c_1.asDirective();
|
|
956
956
|
};
|
|
957
957
|
ProbExplanationTerm.prototype.asEmptyBlock = function () {
|
|
958
|
-
return this.
|
|
958
|
+
return this.i3c_1.asEmptyBlock();
|
|
959
959
|
};
|
|
960
960
|
ProbExplanationTerm.prototype.asEmptyList = function () {
|
|
961
|
-
return this.
|
|
961
|
+
return this.i3c_1.asEmptyList();
|
|
962
962
|
};
|
|
963
963
|
ProbExplanationTerm.prototype.asFact = function () {
|
|
964
|
-
return this.
|
|
964
|
+
return this.i3c_1.asFact();
|
|
965
965
|
};
|
|
966
966
|
ProbExplanationTerm.prototype.asIndicator = function () {
|
|
967
|
-
return this.
|
|
967
|
+
return this.i3c_1.asIndicator();
|
|
968
968
|
};
|
|
969
969
|
ProbExplanationTerm.prototype.asInteger = function () {
|
|
970
|
-
return this.
|
|
970
|
+
return this.i3c_1.asInteger();
|
|
971
971
|
};
|
|
972
972
|
ProbExplanationTerm.prototype.asList = function () {
|
|
973
|
-
return this.
|
|
973
|
+
return this.i3c_1.asList();
|
|
974
974
|
};
|
|
975
975
|
ProbExplanationTerm.prototype.asNumeric = function () {
|
|
976
|
-
return this.
|
|
976
|
+
return this.i3c_1.asNumeric();
|
|
977
977
|
};
|
|
978
978
|
ProbExplanationTerm.prototype.asReal = function () {
|
|
979
|
-
return this.
|
|
979
|
+
return this.i3c_1.asReal();
|
|
980
980
|
};
|
|
981
981
|
ProbExplanationTerm.prototype.asRecursive = function () {
|
|
982
|
-
return this.
|
|
982
|
+
return this.i3c_1.asRecursive();
|
|
983
983
|
};
|
|
984
984
|
ProbExplanationTerm.prototype.asRule = function () {
|
|
985
|
-
return this.
|
|
985
|
+
return this.i3c_1.asRule();
|
|
986
986
|
};
|
|
987
|
-
ProbExplanationTerm.prototype.
|
|
988
|
-
return this.
|
|
987
|
+
ProbExplanationTerm.prototype.sw = function () {
|
|
988
|
+
return this.i3c_1.sw();
|
|
989
989
|
};
|
|
990
990
|
ProbExplanationTerm.prototype.asStruct = function () {
|
|
991
|
-
return this.
|
|
991
|
+
return this.sw();
|
|
992
992
|
};
|
|
993
993
|
ProbExplanationTerm.prototype.asTerm = function () {
|
|
994
|
-
return this.
|
|
994
|
+
return this.i3c_1.asTerm();
|
|
995
995
|
};
|
|
996
996
|
ProbExplanationTerm.prototype.asTruth = function () {
|
|
997
|
-
return this.
|
|
997
|
+
return this.i3c_1.asTruth();
|
|
998
998
|
};
|
|
999
999
|
ProbExplanationTerm.prototype.asTuple = function () {
|
|
1000
|
-
return this.
|
|
1000
|
+
return this.i3c_1.asTuple();
|
|
1001
1001
|
};
|
|
1002
1002
|
ProbExplanationTerm.prototype.asVar = function () {
|
|
1003
|
-
return this.
|
|
1003
|
+
return this.i3c_1.asVar();
|
|
1004
1004
|
};
|
|
1005
|
-
ProbExplanationTerm.prototype.
|
|
1006
|
-
return this.
|
|
1005
|
+
ProbExplanationTerm.prototype.ww = function () {
|
|
1006
|
+
return this.i3c_1.ww();
|
|
1007
1007
|
};
|
|
1008
|
-
ProbExplanationTerm.prototype.
|
|
1009
|
-
return this.
|
|
1008
|
+
ProbExplanationTerm.prototype.nq = function () {
|
|
1009
|
+
return this.ww();
|
|
1010
1010
|
};
|
|
1011
1011
|
ProbExplanationTerm.prototype.castToAtom = function () {
|
|
1012
|
-
return this.
|
|
1012
|
+
return this.i3c_1.castToAtom();
|
|
1013
1013
|
};
|
|
1014
1014
|
ProbExplanationTerm.prototype.castToBlock = function () {
|
|
1015
|
-
return this.
|
|
1015
|
+
return this.i3c_1.castToBlock();
|
|
1016
1016
|
};
|
|
1017
1017
|
ProbExplanationTerm.prototype.castToClause = function () {
|
|
1018
|
-
return this.
|
|
1018
|
+
return this.i3c_1.castToClause();
|
|
1019
1019
|
};
|
|
1020
1020
|
ProbExplanationTerm.prototype.castToCons = function () {
|
|
1021
|
-
return this.
|
|
1021
|
+
return this.i3c_1.castToCons();
|
|
1022
1022
|
};
|
|
1023
1023
|
ProbExplanationTerm.prototype.castToConstant = function () {
|
|
1024
|
-
return this.
|
|
1024
|
+
return this.i3c_1.castToConstant();
|
|
1025
1025
|
};
|
|
1026
1026
|
ProbExplanationTerm.prototype.castToDirective = function () {
|
|
1027
|
-
return this.
|
|
1027
|
+
return this.i3c_1.castToDirective();
|
|
1028
1028
|
};
|
|
1029
1029
|
ProbExplanationTerm.prototype.castToEmptyBlock = function () {
|
|
1030
|
-
return this.
|
|
1030
|
+
return this.i3c_1.castToEmptyBlock();
|
|
1031
1031
|
};
|
|
1032
1032
|
ProbExplanationTerm.prototype.castToEmptyList = function () {
|
|
1033
|
-
return this.
|
|
1033
|
+
return this.i3c_1.castToEmptyList();
|
|
1034
1034
|
};
|
|
1035
1035
|
ProbExplanationTerm.prototype.castToFact = function () {
|
|
1036
|
-
return this.
|
|
1036
|
+
return this.i3c_1.castToFact();
|
|
1037
1037
|
};
|
|
1038
1038
|
ProbExplanationTerm.prototype.castToIndicator = function () {
|
|
1039
|
-
return this.
|
|
1039
|
+
return this.i3c_1.castToIndicator();
|
|
1040
1040
|
};
|
|
1041
1041
|
ProbExplanationTerm.prototype.castToInteger = function () {
|
|
1042
|
-
return this.
|
|
1042
|
+
return this.i3c_1.castToInteger();
|
|
1043
1043
|
};
|
|
1044
1044
|
ProbExplanationTerm.prototype.castToList = function () {
|
|
1045
|
-
return this.
|
|
1045
|
+
return this.i3c_1.castToList();
|
|
1046
1046
|
};
|
|
1047
1047
|
ProbExplanationTerm.prototype.castToNumeric = function () {
|
|
1048
|
-
return this.
|
|
1048
|
+
return this.i3c_1.castToNumeric();
|
|
1049
1049
|
};
|
|
1050
1050
|
ProbExplanationTerm.prototype.castToReal = function () {
|
|
1051
|
-
return this.
|
|
1051
|
+
return this.i3c_1.castToReal();
|
|
1052
1052
|
};
|
|
1053
1053
|
ProbExplanationTerm.prototype.castToRecursive = function () {
|
|
1054
|
-
return this.
|
|
1054
|
+
return this.i3c_1.castToRecursive();
|
|
1055
1055
|
};
|
|
1056
1056
|
ProbExplanationTerm.prototype.castToRule = function () {
|
|
1057
|
-
return this.
|
|
1057
|
+
return this.i3c_1.castToRule();
|
|
1058
1058
|
};
|
|
1059
1059
|
ProbExplanationTerm.prototype.castToStruct = function () {
|
|
1060
|
-
return this.
|
|
1060
|
+
return this.i3c_1.castToStruct();
|
|
1061
1061
|
};
|
|
1062
1062
|
ProbExplanationTerm.prototype.castToTerm = function () {
|
|
1063
|
-
return this.
|
|
1063
|
+
return this.i3c_1.castToTerm();
|
|
1064
1064
|
};
|
|
1065
1065
|
ProbExplanationTerm.prototype.castToTruth = function () {
|
|
1066
|
-
return this.
|
|
1066
|
+
return this.i3c_1.castToTruth();
|
|
1067
1067
|
};
|
|
1068
1068
|
ProbExplanationTerm.prototype.castToTuple = function () {
|
|
1069
|
-
return this.
|
|
1069
|
+
return this.i3c_1.castToTuple();
|
|
1070
1070
|
};
|
|
1071
1071
|
ProbExplanationTerm.prototype.castToVar = function () {
|
|
1072
|
-
return this.
|
|
1072
|
+
return this.i3c_1.castToVar();
|
|
1073
1073
|
};
|
|
1074
|
-
ProbExplanationTerm.prototype.
|
|
1075
|
-
return this.
|
|
1074
|
+
ProbExplanationTerm.prototype.xw = function (other) {
|
|
1075
|
+
return this.i3c_1.xw(other);
|
|
1076
1076
|
};
|
|
1077
1077
|
ProbExplanationTerm.prototype.aa = function (other) {
|
|
1078
|
-
return this.
|
|
1078
|
+
return this.xw((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
|
|
1079
1079
|
};
|
|
1080
1080
|
ProbExplanationTerm.prototype.containsTag = function (name) {
|
|
1081
|
-
return this.
|
|
1081
|
+
return this.i3c_1.containsTag(name);
|
|
1082
1082
|
};
|
|
1083
1083
|
ProbExplanationTerm.prototype.equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
1084
|
-
return this.
|
|
1084
|
+
return this.i3c_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
1085
1085
|
};
|
|
1086
1086
|
ProbExplanationTerm.prototype.equals = function (other) {
|
|
1087
|
-
return this.
|
|
1087
|
+
return this.i3c_1.equals(other);
|
|
1088
1088
|
};
|
|
1089
1089
|
ProbExplanationTerm.prototype.get = function (index) {
|
|
1090
|
-
return this.
|
|
1090
|
+
return this.i3c_1.get(index);
|
|
1091
1091
|
};
|
|
1092
1092
|
ProbExplanationTerm.prototype.getArgAt = function (index) {
|
|
1093
|
-
return this.
|
|
1093
|
+
return this.i3c_1.getArgAt(index);
|
|
1094
1094
|
};
|
|
1095
1095
|
ProbExplanationTerm.prototype.getTag = function (name) {
|
|
1096
|
-
return this.
|
|
1096
|
+
return this.i3c_1.getTag(name);
|
|
1097
1097
|
};
|
|
1098
1098
|
ProbExplanationTerm.prototype.hashCode = function () {
|
|
1099
|
-
return this.
|
|
1099
|
+
return this.i3c_1.hashCode();
|
|
1100
1100
|
};
|
|
1101
1101
|
ProbExplanationTerm.prototype.insertAt = function (index, argument) {
|
|
1102
|
-
return this.
|
|
1102
|
+
return this.i3c_1.insertAt(index, argument);
|
|
1103
1103
|
};
|
|
1104
1104
|
ProbExplanationTerm.prototype.resetTags = function (tags) {
|
|
1105
|
-
return this.
|
|
1105
|
+
return this.i3c_1.resetTags(tags);
|
|
1106
1106
|
};
|
|
1107
1107
|
ProbExplanationTerm.prototype.setArgs = function (args) {
|
|
1108
|
-
return this.
|
|
1108
|
+
return this.i3c_1.setArgs(args);
|
|
1109
1109
|
};
|
|
1110
1110
|
ProbExplanationTerm.prototype.setArgsIterable = function (args) {
|
|
1111
|
-
return this.
|
|
1111
|
+
return this.i3c_1.setArgsIterable(args);
|
|
1112
1112
|
};
|
|
1113
1113
|
ProbExplanationTerm.prototype.setArgsSequence = function (args) {
|
|
1114
|
-
return this.
|
|
1114
|
+
return this.i3c_1.setArgsSequence(args);
|
|
1115
1115
|
};
|
|
1116
1116
|
ProbExplanationTerm.prototype.setFunctor = function (functor) {
|
|
1117
|
-
return this.
|
|
1117
|
+
return this.i3c_1.setFunctor(functor);
|
|
1118
1118
|
};
|
|
1119
1119
|
ProbExplanationTerm.prototype.structurallyEquals = function (other) {
|
|
1120
|
-
return this.
|
|
1120
|
+
return this.i3c_1.structurallyEquals(other);
|
|
1121
1121
|
};
|
|
1122
1122
|
ProbExplanationTerm.prototype.toString = function () {
|
|
1123
|
-
return this.
|
|
1123
|
+
return this.i3c_1.toString();
|
|
1124
1124
|
};
|
|
1125
|
-
ProbExplanationTerm.prototype.
|
|
1125
|
+
ProbExplanationTerm.prototype.bx = function () {
|
|
1126
1126
|
return false;
|
|
1127
1127
|
};
|
|
1128
|
-
ProbExplanationTerm.prototype.
|
|
1128
|
+
ProbExplanationTerm.prototype.fx = function () {
|
|
1129
1129
|
return this;
|
|
1130
1130
|
};
|
|
1131
1131
|
ProbExplanationTerm.prototype.asConstant = function () {
|
|
1132
|
-
return this.
|
|
1132
|
+
return this.fx();
|
|
1133
1133
|
};
|
|
1134
|
-
ProbExplanationTerm.prototype.
|
|
1135
|
-
return new ProbExplanationTerm(this.
|
|
1134
|
+
ProbExplanationTerm.prototype.fw = function () {
|
|
1135
|
+
return new ProbExplanationTerm(this.h3c_1.applyTransformation(ProbExplanationTerm$freshCopy$lambda));
|
|
1136
1136
|
};
|
|
1137
1137
|
ProbExplanationTerm.prototype.freshCopy = function () {
|
|
1138
|
-
return this.
|
|
1138
|
+
return this.fw();
|
|
1139
1139
|
};
|
|
1140
|
-
ProbExplanationTerm.prototype.
|
|
1141
|
-
return new ProbExplanationTerm(this.
|
|
1140
|
+
ProbExplanationTerm.prototype.gw = function (scope) {
|
|
1141
|
+
return new ProbExplanationTerm(this.h3c_1.applyTransformation(ProbExplanationTerm$freshCopy$lambda_0(scope)));
|
|
1142
1142
|
};
|
|
1143
1143
|
ProbExplanationTerm.prototype.freshCopyFromScope = function (scope) {
|
|
1144
|
-
return this.
|
|
1144
|
+
return this.gw(scope);
|
|
1145
1145
|
};
|
|
1146
|
-
ProbExplanationTerm.prototype.
|
|
1147
|
-
return this.
|
|
1146
|
+
ProbExplanationTerm.prototype.b2p = function (substitution, substitutions) {
|
|
1147
|
+
return this.c2p(substitution, substitutions.slice());
|
|
1148
1148
|
};
|
|
1149
1149
|
ProbExplanationTerm.prototype.getSubstituted = function (substitution, substitutions) {
|
|
1150
|
-
return this.
|
|
1150
|
+
return this.b2p(substitution, substitutions);
|
|
1151
1151
|
};
|
|
1152
|
-
ProbExplanationTerm.prototype.
|
|
1153
|
-
return this.
|
|
1152
|
+
ProbExplanationTerm.prototype.c2p = function (substitution, substitutions) {
|
|
1153
|
+
return this.p16(Companion_getInstance_9().ofSubstitution(substitution, substitutions.slice()));
|
|
1154
1154
|
};
|
|
1155
1155
|
ProbExplanationTerm.prototype.apply = function (substitution, substitutions) {
|
|
1156
|
-
return this.
|
|
1156
|
+
return this.c2p(substitution, substitutions);
|
|
1157
1157
|
};
|
|
1158
|
-
ProbExplanationTerm.prototype.
|
|
1158
|
+
ProbExplanationTerm.prototype.p16 = function (substitution) {
|
|
1159
1159
|
var tmp;
|
|
1160
|
-
if (substitution.d() ? true : this.
|
|
1160
|
+
if (substitution.d() ? true : this.gx()) {
|
|
1161
1161
|
tmp = this;
|
|
1162
1162
|
} else {
|
|
1163
|
-
tmp = new ProbExplanationTerm(this.
|
|
1163
|
+
tmp = new ProbExplanationTerm(this.h3c_1.applyTransformation(ProbExplanationTerm$apply$lambda(substitution)));
|
|
1164
1164
|
}
|
|
1165
1165
|
return tmp;
|
|
1166
1166
|
};
|
|
1167
1167
|
ProbExplanationTerm.prototype.applySubstitution = function (substitution) {
|
|
1168
|
-
return this.
|
|
1168
|
+
return this.p16(substitution);
|
|
1169
1169
|
};
|
|
1170
|
-
ProbExplanationTerm.prototype.
|
|
1171
|
-
return !this.
|
|
1170
|
+
ProbExplanationTerm.prototype.gx = function () {
|
|
1171
|
+
return !this.h3c_1.z3d();
|
|
1172
1172
|
};
|
|
1173
1173
|
function _get_cachedHashCode__d7x0zy($this) {
|
|
1174
1174
|
var tmp$ret$0;
|
|
1175
1175
|
// Inline function 'kotlin.getValue' call
|
|
1176
1176
|
var tmp0_getValue = cachedHashCode$factory();
|
|
1177
|
-
tmp$ret$0 = $this.
|
|
1177
|
+
tmp$ret$0 = $this.w3d_1.b1();
|
|
1178
1178
|
return tmp$ret$0;
|
|
1179
1179
|
}
|
|
1180
1180
|
function ProbTerm$isGround$delegate$lambda(this$0) {
|
|
1181
1181
|
return function () {
|
|
1182
1182
|
var tmp;
|
|
1183
|
-
if (this$0.
|
|
1183
|
+
if (this$0.s3d_1.gx()) {
|
|
1184
1184
|
var tmp$ret$0;
|
|
1185
1185
|
$l$block_0: {
|
|
1186
1186
|
// Inline function 'kotlin.collections.any' call
|
|
1187
|
-
var tmp0_any = this$0.
|
|
1187
|
+
var tmp0_any = this$0.t3d_1;
|
|
1188
1188
|
var tmp_0;
|
|
1189
1189
|
if (isInterface(tmp0_any, Collection)) {
|
|
1190
1190
|
tmp_0 = tmp0_any.d();
|
|
@@ -1197,10 +1197,10 @@
|
|
|
1197
1197
|
}
|
|
1198
1198
|
var tmp0_iterator = tmp0_any.j();
|
|
1199
1199
|
while (tmp0_iterator.m()) {
|
|
1200
|
-
var element = tmp0_iterator.
|
|
1200
|
+
var element = tmp0_iterator.n();
|
|
1201
1201
|
var tmp$ret$1;
|
|
1202
1202
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.ProbTerm.isGround$delegate.<anonymous>.<anonymous>' call
|
|
1203
|
-
tmp$ret$1 = element.
|
|
1203
|
+
tmp$ret$1 = element.yw();
|
|
1204
1204
|
if (tmp$ret$1) {
|
|
1205
1205
|
tmp$ret$0 = true;
|
|
1206
1206
|
break $l$block_0;
|
|
@@ -1217,236 +1217,236 @@
|
|
|
1217
1217
|
}
|
|
1218
1218
|
function ProbTerm$cachedHashCode$delegate$lambda(this$0) {
|
|
1219
1219
|
return function () {
|
|
1220
|
-
var result = this$0.
|
|
1221
|
-
result = imul(31, result) + getNumberHashCode(this$0.
|
|
1222
|
-
result = imul(31, result) + this$0.
|
|
1223
|
-
result = imul(31, result) + hashCode(this$0.
|
|
1220
|
+
var result = this$0.q3d_1.hashCode();
|
|
1221
|
+
result = imul(31, result) + getNumberHashCode(this$0.r3d_1) | 0;
|
|
1222
|
+
result = imul(31, result) + this$0.s3d_1.hashCode() | 0;
|
|
1223
|
+
result = imul(31, result) + hashCode(this$0.t3d_1) | 0;
|
|
1224
1224
|
return result;
|
|
1225
1225
|
};
|
|
1226
1226
|
}
|
|
1227
1227
|
function ProbTerm(id, probability, term, extraVariables) {
|
|
1228
|
-
this.
|
|
1229
|
-
this.
|
|
1230
|
-
this.
|
|
1231
|
-
this.
|
|
1232
|
-
this.
|
|
1228
|
+
this.q3d_1 = id;
|
|
1229
|
+
this.r3d_1 = probability;
|
|
1230
|
+
this.s3d_1 = term;
|
|
1231
|
+
this.t3d_1 = extraVariables;
|
|
1232
|
+
this.u3d_1 = Companion_getInstance_3().of(get_ANNOTATION_FUNCTOR(), [Companion_getInstance_10().ofDouble(probability), term]);
|
|
1233
1233
|
var tmp = this;
|
|
1234
|
-
tmp.
|
|
1234
|
+
tmp.v3d_1 = lazy(ProbTerm$isGround$delegate$lambda(this));
|
|
1235
1235
|
var tmp_0 = this;
|
|
1236
|
-
tmp_0.
|
|
1236
|
+
tmp_0.w3d_1 = lazy(ProbTerm$cachedHashCode$delegate$lambda(this));
|
|
1237
1237
|
}
|
|
1238
|
-
ProbTerm.prototype.
|
|
1239
|
-
return this.
|
|
1238
|
+
ProbTerm.prototype.xv = function () {
|
|
1239
|
+
return this.u3d_1.xv();
|
|
1240
1240
|
};
|
|
1241
|
-
ProbTerm.prototype.
|
|
1242
|
-
return this.
|
|
1241
|
+
ProbTerm.prototype.jw = function () {
|
|
1242
|
+
return this.u3d_1.jw();
|
|
1243
1243
|
};
|
|
1244
|
-
ProbTerm.prototype.
|
|
1245
|
-
return this.
|
|
1244
|
+
ProbTerm.prototype.pw = function () {
|
|
1245
|
+
return this.u3d_1.pw();
|
|
1246
1246
|
};
|
|
1247
|
-
ProbTerm.prototype.
|
|
1248
|
-
return this.
|
|
1247
|
+
ProbTerm.prototype.bx = function () {
|
|
1248
|
+
return this.u3d_1.bx();
|
|
1249
1249
|
};
|
|
1250
|
-
ProbTerm.prototype.
|
|
1251
|
-
return this.
|
|
1250
|
+
ProbTerm.prototype.yv = function () {
|
|
1251
|
+
return this.u3d_1.yv();
|
|
1252
1252
|
};
|
|
1253
|
-
ProbTerm.prototype.
|
|
1254
|
-
return this.
|
|
1253
|
+
ProbTerm.prototype.zv = function () {
|
|
1254
|
+
return this.u3d_1.zv();
|
|
1255
1255
|
};
|
|
1256
|
-
ProbTerm.prototype.
|
|
1257
|
-
return this.
|
|
1256
|
+
ProbTerm.prototype.rw = function () {
|
|
1257
|
+
return this.u3d_1.rw();
|
|
1258
1258
|
};
|
|
1259
|
-
ProbTerm.prototype.
|
|
1260
|
-
return this.
|
|
1259
|
+
ProbTerm.prototype.dx = function () {
|
|
1260
|
+
return this.u3d_1.dx();
|
|
1261
1261
|
};
|
|
1262
|
-
ProbTerm.prototype.
|
|
1263
|
-
return this.
|
|
1262
|
+
ProbTerm.prototype.ow = function () {
|
|
1263
|
+
return this.u3d_1.ow();
|
|
1264
1264
|
};
|
|
1265
|
-
ProbTerm.prototype.
|
|
1266
|
-
return this.
|
|
1265
|
+
ProbTerm.prototype.cx = function () {
|
|
1266
|
+
return this.u3d_1.cx();
|
|
1267
1267
|
};
|
|
1268
|
-
ProbTerm.prototype.
|
|
1269
|
-
return this.
|
|
1268
|
+
ProbTerm.prototype.ex = function () {
|
|
1269
|
+
return this.u3d_1.ex();
|
|
1270
1270
|
};
|
|
1271
|
-
ProbTerm.prototype.
|
|
1272
|
-
return this.
|
|
1271
|
+
ProbTerm.prototype.iw = function () {
|
|
1272
|
+
return this.u3d_1.iw();
|
|
1273
1273
|
};
|
|
1274
|
-
ProbTerm.prototype.
|
|
1275
|
-
return this.
|
|
1274
|
+
ProbTerm.prototype.aw = function () {
|
|
1275
|
+
return this.u3d_1.aw();
|
|
1276
1276
|
};
|
|
1277
|
-
ProbTerm.prototype.
|
|
1278
|
-
return this.
|
|
1277
|
+
ProbTerm.prototype.nw = function () {
|
|
1278
|
+
return this.u3d_1.nw();
|
|
1279
1279
|
};
|
|
1280
|
-
ProbTerm.prototype.
|
|
1281
|
-
return this.
|
|
1280
|
+
ProbTerm.prototype.yw = function () {
|
|
1281
|
+
return this.u3d_1.yw();
|
|
1282
1282
|
};
|
|
1283
|
-
ProbTerm.prototype.
|
|
1284
|
-
return this.
|
|
1283
|
+
ProbTerm.prototype.ht = function () {
|
|
1284
|
+
return this.u3d_1.ht();
|
|
1285
1285
|
};
|
|
1286
|
-
ProbTerm.prototype.
|
|
1287
|
-
return this.
|
|
1286
|
+
ProbTerm.prototype.ew = function () {
|
|
1287
|
+
return this.u3d_1.ew();
|
|
1288
1288
|
};
|
|
1289
1289
|
ProbTerm.prototype.accept = function (visitor) {
|
|
1290
|
-
return this.
|
|
1290
|
+
return this.u3d_1.accept(visitor);
|
|
1291
1291
|
};
|
|
1292
1292
|
ProbTerm.prototype.asAtom = function () {
|
|
1293
|
-
return this.
|
|
1293
|
+
return this.u3d_1.asAtom();
|
|
1294
1294
|
};
|
|
1295
1295
|
ProbTerm.prototype.asBlock = function () {
|
|
1296
|
-
return this.
|
|
1296
|
+
return this.u3d_1.asBlock();
|
|
1297
1297
|
};
|
|
1298
1298
|
ProbTerm.prototype.asClause = function () {
|
|
1299
|
-
return this.
|
|
1299
|
+
return this.u3d_1.asClause();
|
|
1300
1300
|
};
|
|
1301
1301
|
ProbTerm.prototype.asCons = function () {
|
|
1302
|
-
return this.
|
|
1302
|
+
return this.u3d_1.asCons();
|
|
1303
1303
|
};
|
|
1304
1304
|
ProbTerm.prototype.asConstant = function () {
|
|
1305
|
-
return this.
|
|
1305
|
+
return this.u3d_1.asConstant();
|
|
1306
1306
|
};
|
|
1307
1307
|
ProbTerm.prototype.asDirective = function () {
|
|
1308
|
-
return this.
|
|
1308
|
+
return this.u3d_1.asDirective();
|
|
1309
1309
|
};
|
|
1310
1310
|
ProbTerm.prototype.asEmptyBlock = function () {
|
|
1311
|
-
return this.
|
|
1311
|
+
return this.u3d_1.asEmptyBlock();
|
|
1312
1312
|
};
|
|
1313
1313
|
ProbTerm.prototype.asEmptyList = function () {
|
|
1314
|
-
return this.
|
|
1314
|
+
return this.u3d_1.asEmptyList();
|
|
1315
1315
|
};
|
|
1316
1316
|
ProbTerm.prototype.asFact = function () {
|
|
1317
|
-
return this.
|
|
1317
|
+
return this.u3d_1.asFact();
|
|
1318
1318
|
};
|
|
1319
1319
|
ProbTerm.prototype.asIndicator = function () {
|
|
1320
|
-
return this.
|
|
1320
|
+
return this.u3d_1.asIndicator();
|
|
1321
1321
|
};
|
|
1322
1322
|
ProbTerm.prototype.asInteger = function () {
|
|
1323
|
-
return this.
|
|
1323
|
+
return this.u3d_1.asInteger();
|
|
1324
1324
|
};
|
|
1325
1325
|
ProbTerm.prototype.asList = function () {
|
|
1326
|
-
return this.
|
|
1326
|
+
return this.u3d_1.asList();
|
|
1327
1327
|
};
|
|
1328
1328
|
ProbTerm.prototype.asNumeric = function () {
|
|
1329
|
-
return this.
|
|
1329
|
+
return this.u3d_1.asNumeric();
|
|
1330
1330
|
};
|
|
1331
1331
|
ProbTerm.prototype.asReal = function () {
|
|
1332
|
-
return this.
|
|
1332
|
+
return this.u3d_1.asReal();
|
|
1333
1333
|
};
|
|
1334
1334
|
ProbTerm.prototype.asRecursive = function () {
|
|
1335
|
-
return this.
|
|
1335
|
+
return this.u3d_1.asRecursive();
|
|
1336
1336
|
};
|
|
1337
1337
|
ProbTerm.prototype.asRule = function () {
|
|
1338
|
-
return this.
|
|
1338
|
+
return this.u3d_1.asRule();
|
|
1339
1339
|
};
|
|
1340
1340
|
ProbTerm.prototype.asStruct = function () {
|
|
1341
|
-
return this.
|
|
1341
|
+
return this.u3d_1.sw();
|
|
1342
1342
|
};
|
|
1343
1343
|
ProbTerm.prototype.asTerm = function () {
|
|
1344
|
-
return this.
|
|
1344
|
+
return this.u3d_1.asTerm();
|
|
1345
1345
|
};
|
|
1346
1346
|
ProbTerm.prototype.asTruth = function () {
|
|
1347
|
-
return this.
|
|
1347
|
+
return this.u3d_1.asTruth();
|
|
1348
1348
|
};
|
|
1349
1349
|
ProbTerm.prototype.asTuple = function () {
|
|
1350
|
-
return this.
|
|
1350
|
+
return this.u3d_1.asTuple();
|
|
1351
1351
|
};
|
|
1352
1352
|
ProbTerm.prototype.asVar = function () {
|
|
1353
|
-
return this.
|
|
1353
|
+
return this.u3d_1.asVar();
|
|
1354
1354
|
};
|
|
1355
|
-
ProbTerm.prototype.
|
|
1356
|
-
return this.
|
|
1355
|
+
ProbTerm.prototype.ww = function () {
|
|
1356
|
+
return this.u3d_1.ww();
|
|
1357
1357
|
};
|
|
1358
|
-
ProbTerm.prototype.
|
|
1359
|
-
return this.
|
|
1358
|
+
ProbTerm.prototype.nq = function () {
|
|
1359
|
+
return this.ww();
|
|
1360
1360
|
};
|
|
1361
1361
|
ProbTerm.prototype.castToAtom = function () {
|
|
1362
|
-
return this.
|
|
1362
|
+
return this.u3d_1.castToAtom();
|
|
1363
1363
|
};
|
|
1364
1364
|
ProbTerm.prototype.castToBlock = function () {
|
|
1365
|
-
return this.
|
|
1365
|
+
return this.u3d_1.castToBlock();
|
|
1366
1366
|
};
|
|
1367
1367
|
ProbTerm.prototype.castToClause = function () {
|
|
1368
|
-
return this.
|
|
1368
|
+
return this.u3d_1.castToClause();
|
|
1369
1369
|
};
|
|
1370
1370
|
ProbTerm.prototype.castToCons = function () {
|
|
1371
|
-
return this.
|
|
1371
|
+
return this.u3d_1.castToCons();
|
|
1372
1372
|
};
|
|
1373
1373
|
ProbTerm.prototype.castToConstant = function () {
|
|
1374
|
-
return this.
|
|
1374
|
+
return this.u3d_1.castToConstant();
|
|
1375
1375
|
};
|
|
1376
1376
|
ProbTerm.prototype.castToDirective = function () {
|
|
1377
|
-
return this.
|
|
1377
|
+
return this.u3d_1.castToDirective();
|
|
1378
1378
|
};
|
|
1379
1379
|
ProbTerm.prototype.castToEmptyBlock = function () {
|
|
1380
|
-
return this.
|
|
1380
|
+
return this.u3d_1.castToEmptyBlock();
|
|
1381
1381
|
};
|
|
1382
1382
|
ProbTerm.prototype.castToEmptyList = function () {
|
|
1383
|
-
return this.
|
|
1383
|
+
return this.u3d_1.castToEmptyList();
|
|
1384
1384
|
};
|
|
1385
1385
|
ProbTerm.prototype.castToFact = function () {
|
|
1386
|
-
return this.
|
|
1386
|
+
return this.u3d_1.castToFact();
|
|
1387
1387
|
};
|
|
1388
1388
|
ProbTerm.prototype.castToIndicator = function () {
|
|
1389
|
-
return this.
|
|
1389
|
+
return this.u3d_1.castToIndicator();
|
|
1390
1390
|
};
|
|
1391
1391
|
ProbTerm.prototype.castToInteger = function () {
|
|
1392
|
-
return this.
|
|
1392
|
+
return this.u3d_1.castToInteger();
|
|
1393
1393
|
};
|
|
1394
1394
|
ProbTerm.prototype.castToList = function () {
|
|
1395
|
-
return this.
|
|
1395
|
+
return this.u3d_1.castToList();
|
|
1396
1396
|
};
|
|
1397
1397
|
ProbTerm.prototype.castToNumeric = function () {
|
|
1398
|
-
return this.
|
|
1398
|
+
return this.u3d_1.castToNumeric();
|
|
1399
1399
|
};
|
|
1400
1400
|
ProbTerm.prototype.castToReal = function () {
|
|
1401
|
-
return this.
|
|
1401
|
+
return this.u3d_1.castToReal();
|
|
1402
1402
|
};
|
|
1403
1403
|
ProbTerm.prototype.castToRecursive = function () {
|
|
1404
|
-
return this.
|
|
1404
|
+
return this.u3d_1.castToRecursive();
|
|
1405
1405
|
};
|
|
1406
1406
|
ProbTerm.prototype.castToRule = function () {
|
|
1407
|
-
return this.
|
|
1407
|
+
return this.u3d_1.castToRule();
|
|
1408
1408
|
};
|
|
1409
1409
|
ProbTerm.prototype.castToStruct = function () {
|
|
1410
|
-
return this.
|
|
1410
|
+
return this.u3d_1.castToStruct();
|
|
1411
1411
|
};
|
|
1412
1412
|
ProbTerm.prototype.castToTerm = function () {
|
|
1413
|
-
return this.
|
|
1413
|
+
return this.u3d_1.castToTerm();
|
|
1414
1414
|
};
|
|
1415
1415
|
ProbTerm.prototype.castToTruth = function () {
|
|
1416
|
-
return this.
|
|
1416
|
+
return this.u3d_1.castToTruth();
|
|
1417
1417
|
};
|
|
1418
1418
|
ProbTerm.prototype.castToTuple = function () {
|
|
1419
|
-
return this.
|
|
1419
|
+
return this.u3d_1.castToTuple();
|
|
1420
1420
|
};
|
|
1421
1421
|
ProbTerm.prototype.castToVar = function () {
|
|
1422
|
-
return this.
|
|
1422
|
+
return this.u3d_1.castToVar();
|
|
1423
1423
|
};
|
|
1424
1424
|
ProbTerm.prototype.containsTag = function (name) {
|
|
1425
|
-
return this.
|
|
1425
|
+
return this.u3d_1.containsTag(name);
|
|
1426
1426
|
};
|
|
1427
1427
|
ProbTerm.prototype.equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
1428
|
-
return this.
|
|
1428
|
+
return this.u3d_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
1429
1429
|
};
|
|
1430
1430
|
ProbTerm.prototype.getTag = function (name) {
|
|
1431
|
-
return this.
|
|
1431
|
+
return this.u3d_1.getTag(name);
|
|
1432
1432
|
};
|
|
1433
1433
|
ProbTerm.prototype.resetTags = function (tags) {
|
|
1434
|
-
return this.
|
|
1434
|
+
return this.u3d_1.resetTags(tags);
|
|
1435
1435
|
};
|
|
1436
1436
|
ProbTerm.prototype.structurallyEquals = function (other) {
|
|
1437
|
-
return this.
|
|
1437
|
+
return this.u3d_1.structurallyEquals(other);
|
|
1438
1438
|
};
|
|
1439
|
-
ProbTerm.prototype.
|
|
1440
|
-
var termCopy = this.
|
|
1439
|
+
ProbTerm.prototype.fw = function () {
|
|
1440
|
+
var termCopy = this.s3d_1.freshCopy();
|
|
1441
1441
|
var tmp$ret$2;
|
|
1442
1442
|
// Inline function 'kotlin.collections.map' call
|
|
1443
|
-
var tmp0_map = this.
|
|
1443
|
+
var tmp0_map = this.t3d_1;
|
|
1444
1444
|
var tmp$ret$1;
|
|
1445
1445
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1446
1446
|
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_map, 10));
|
|
1447
1447
|
var tmp0_iterator = tmp0_map.j();
|
|
1448
1448
|
while (tmp0_iterator.m()) {
|
|
1449
|
-
var item = tmp0_iterator.
|
|
1449
|
+
var item = tmp0_iterator.n();
|
|
1450
1450
|
var tmp$ret$0;
|
|
1451
1451
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.ProbTerm.freshCopy.<anonymous>' call
|
|
1452
1452
|
tmp$ret$0 = item.freshCopy();
|
|
@@ -1454,22 +1454,22 @@
|
|
|
1454
1454
|
}
|
|
1455
1455
|
tmp$ret$1 = tmp0_mapTo;
|
|
1456
1456
|
tmp$ret$2 = tmp$ret$1;
|
|
1457
|
-
return new ProbTerm(this.
|
|
1457
|
+
return new ProbTerm(this.q3d_1, this.r3d_1, termCopy, toSet(tmp$ret$2));
|
|
1458
1458
|
};
|
|
1459
1459
|
ProbTerm.prototype.freshCopy = function () {
|
|
1460
|
-
return this.
|
|
1460
|
+
return this.fw();
|
|
1461
1461
|
};
|
|
1462
|
-
ProbTerm.prototype.
|
|
1463
|
-
var termCopy = this.
|
|
1462
|
+
ProbTerm.prototype.gw = function (scope) {
|
|
1463
|
+
var termCopy = this.s3d_1.freshCopyFromScope(scope);
|
|
1464
1464
|
var tmp$ret$2;
|
|
1465
1465
|
// Inline function 'kotlin.collections.map' call
|
|
1466
|
-
var tmp0_map = this.
|
|
1466
|
+
var tmp0_map = this.t3d_1;
|
|
1467
1467
|
var tmp$ret$1;
|
|
1468
1468
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1469
1469
|
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_map, 10));
|
|
1470
1470
|
var tmp0_iterator = tmp0_map.j();
|
|
1471
1471
|
while (tmp0_iterator.m()) {
|
|
1472
|
-
var item = tmp0_iterator.
|
|
1472
|
+
var item = tmp0_iterator.n();
|
|
1473
1473
|
var tmp$ret$0;
|
|
1474
1474
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.ProbTerm.freshCopy.<anonymous>' call
|
|
1475
1475
|
tmp$ret$0 = item.freshCopyFromScope(scope);
|
|
@@ -1477,33 +1477,33 @@
|
|
|
1477
1477
|
}
|
|
1478
1478
|
tmp$ret$1 = tmp0_mapTo;
|
|
1479
1479
|
tmp$ret$2 = tmp$ret$1;
|
|
1480
|
-
return new ProbTerm(this.
|
|
1480
|
+
return new ProbTerm(this.q3d_1, this.r3d_1, termCopy, toSet(tmp$ret$2));
|
|
1481
1481
|
};
|
|
1482
1482
|
ProbTerm.prototype.freshCopyFromScope = function (scope) {
|
|
1483
|
-
return this.
|
|
1483
|
+
return this.gw(scope);
|
|
1484
1484
|
};
|
|
1485
|
-
ProbTerm.prototype.
|
|
1486
|
-
return this.
|
|
1485
|
+
ProbTerm.prototype.b2p = function (substitution, substitutions) {
|
|
1486
|
+
return this.c2p(substitution, substitutions.slice());
|
|
1487
1487
|
};
|
|
1488
1488
|
ProbTerm.prototype.getSubstituted = function (substitution, substitutions) {
|
|
1489
|
-
return this.
|
|
1489
|
+
return this.b2p(substitution, substitutions);
|
|
1490
1490
|
};
|
|
1491
|
-
ProbTerm.prototype.
|
|
1492
|
-
return this.
|
|
1491
|
+
ProbTerm.prototype.c2p = function (substitution, substitutions) {
|
|
1492
|
+
return this.p16(Companion_getInstance_9().ofSubstitution(substitution, substitutions.slice()));
|
|
1493
1493
|
};
|
|
1494
1494
|
ProbTerm.prototype.apply = function (substitution, substitutions) {
|
|
1495
|
-
return this.
|
|
1495
|
+
return this.c2p(substitution, substitutions);
|
|
1496
1496
|
};
|
|
1497
|
-
ProbTerm.prototype.
|
|
1497
|
+
ProbTerm.prototype.p16 = function (substitution) {
|
|
1498
1498
|
var tmp;
|
|
1499
|
-
if (substitution.d() ? true : this.
|
|
1499
|
+
if (substitution.d() ? true : this.gx()) {
|
|
1500
1500
|
tmp = this;
|
|
1501
1501
|
} else {
|
|
1502
1502
|
var tmp_0;
|
|
1503
1503
|
var tmp$ret$0;
|
|
1504
1504
|
$l$block_0: {
|
|
1505
1505
|
// Inline function 'kotlin.collections.any' call
|
|
1506
|
-
var tmp0_any = this.
|
|
1506
|
+
var tmp0_any = this.t3d_1;
|
|
1507
1507
|
var tmp_1;
|
|
1508
1508
|
if (isInterface(tmp0_any, Collection)) {
|
|
1509
1509
|
tmp_1 = tmp0_any.d();
|
|
@@ -1516,10 +1516,10 @@
|
|
|
1516
1516
|
}
|
|
1517
1517
|
var tmp0_iterator = tmp0_any.j();
|
|
1518
1518
|
while (tmp0_iterator.m()) {
|
|
1519
|
-
var element = tmp0_iterator.
|
|
1519
|
+
var element = tmp0_iterator.n();
|
|
1520
1520
|
var tmp$ret$1;
|
|
1521
1521
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.ProbTerm.apply.<anonymous>' call
|
|
1522
|
-
tmp$ret$1 = element.
|
|
1522
|
+
tmp$ret$1 = element.yw();
|
|
1523
1523
|
if (tmp$ret$1) {
|
|
1524
1524
|
tmp$ret$0 = true;
|
|
1525
1525
|
break $l$block_0;
|
|
@@ -1528,18 +1528,18 @@
|
|
|
1528
1528
|
tmp$ret$0 = false;
|
|
1529
1529
|
}
|
|
1530
1530
|
if (!tmp$ret$0) {
|
|
1531
|
-
tmp_0 = this.
|
|
1531
|
+
tmp_0 = this.t3d_1;
|
|
1532
1532
|
} else {
|
|
1533
1533
|
var tmp$ret$5;
|
|
1534
1534
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
1535
|
-
var tmp1_mapNotNull = this.
|
|
1535
|
+
var tmp1_mapNotNull = this.t3d_1;
|
|
1536
1536
|
var tmp$ret$4;
|
|
1537
1537
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
1538
1538
|
var tmp0_mapNotNullTo = ArrayList_init_$Create$_0();
|
|
1539
1539
|
// Inline function 'kotlin.collections.forEach' call
|
|
1540
1540
|
var tmp0_iterator_0 = tmp1_mapNotNull.j();
|
|
1541
1541
|
while (tmp0_iterator_0.m()) {
|
|
1542
|
-
var element_0 = tmp0_iterator_0.
|
|
1542
|
+
var element_0 = tmp0_iterator_0.n();
|
|
1543
1543
|
// Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
|
|
1544
1544
|
var tmp$ret$2;
|
|
1545
1545
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.ProbTerm.apply.<anonymous>' call
|
|
@@ -1560,43 +1560,43 @@
|
|
|
1560
1560
|
tmp_0 = toSet(tmp$ret$5);
|
|
1561
1561
|
}
|
|
1562
1562
|
var newExtraVars = tmp_0;
|
|
1563
|
-
tmp = new ProbTerm(this.
|
|
1563
|
+
tmp = new ProbTerm(this.q3d_1, this.r3d_1, this.s3d_1.applySubstitution(substitution), newExtraVars);
|
|
1564
1564
|
}
|
|
1565
1565
|
return tmp;
|
|
1566
1566
|
};
|
|
1567
1567
|
ProbTerm.prototype.applySubstitution = function (substitution) {
|
|
1568
|
-
return this.
|
|
1568
|
+
return this.p16(substitution);
|
|
1569
1569
|
};
|
|
1570
|
-
ProbTerm.prototype.
|
|
1570
|
+
ProbTerm.prototype.gx = function () {
|
|
1571
1571
|
var tmp$ret$0;
|
|
1572
1572
|
// Inline function 'kotlin.getValue' call
|
|
1573
1573
|
var tmp0_getValue = isGround$factory();
|
|
1574
|
-
tmp$ret$0 = this.
|
|
1574
|
+
tmp$ret$0 = this.v3d_1.b1();
|
|
1575
1575
|
return tmp$ret$0;
|
|
1576
1576
|
};
|
|
1577
|
-
ProbTerm.prototype.
|
|
1577
|
+
ProbTerm.prototype.xw = function (other) {
|
|
1578
1578
|
if (!(other instanceof ProbTerm)) {
|
|
1579
1579
|
return compareTo.call(this, other);
|
|
1580
1580
|
}
|
|
1581
|
-
var res = this.
|
|
1581
|
+
var res = this.q3d_1.jd(other.q3d_1);
|
|
1582
1582
|
if (!(res === 0))
|
|
1583
1583
|
return res;
|
|
1584
|
-
res = this.
|
|
1584
|
+
res = this.s3d_1.xw(other.s3d_1);
|
|
1585
1585
|
if (!(res === 0))
|
|
1586
1586
|
return res;
|
|
1587
|
-
res = equals(this.
|
|
1587
|
+
res = equals(this.t3d_1, other.t3d_1) ? 0 : -1;
|
|
1588
1588
|
if (!(res === 0))
|
|
1589
1589
|
return res;
|
|
1590
|
-
res = compareTo_0(this.
|
|
1590
|
+
res = compareTo_0(this.r3d_1, other.r3d_1);
|
|
1591
1591
|
return res;
|
|
1592
1592
|
};
|
|
1593
1593
|
ProbTerm.prototype.aa = function (other) {
|
|
1594
|
-
return this.
|
|
1594
|
+
return this.xw((!(other == null) ? isInterface(other, Term) : false) ? other : THROW_CCE());
|
|
1595
1595
|
};
|
|
1596
1596
|
ProbTerm.prototype.equals = function (other) {
|
|
1597
1597
|
var tmp;
|
|
1598
1598
|
if (other instanceof ProbTerm) {
|
|
1599
|
-
tmp = this.
|
|
1599
|
+
tmp = this.xw(other) === 0;
|
|
1600
1600
|
} else {
|
|
1601
1601
|
tmp = false;
|
|
1602
1602
|
}
|
|
@@ -1606,11 +1606,11 @@
|
|
|
1606
1606
|
return _get_cachedHashCode__d7x0zy(this);
|
|
1607
1607
|
};
|
|
1608
1608
|
ProbTerm.prototype.toString = function () {
|
|
1609
|
-
return '' + round(this.
|
|
1609
|
+
return '' + round(this.r3d_1 * 100) / 100.0 + '::' + this.s3d_1;
|
|
1610
1610
|
};
|
|
1611
1611
|
function isGround$factory() {
|
|
1612
1612
|
return getPropertyCallableRef('isGround', 1, KProperty1, function (receiver) {
|
|
1613
|
-
return receiver.
|
|
1613
|
+
return receiver.gx();
|
|
1614
1614
|
}, null);
|
|
1615
1615
|
}
|
|
1616
1616
|
function cachedHashCode$factory() {
|
|
@@ -1671,23 +1671,23 @@
|
|
|
1671
1671
|
function collectAllHeads($this, head, accumulator) {
|
|
1672
1672
|
var tmp;
|
|
1673
1673
|
if (isInterface(head, Struct)) {
|
|
1674
|
-
tmp = head.
|
|
1674
|
+
tmp = head.wv() === 2;
|
|
1675
1675
|
} else {
|
|
1676
1676
|
tmp = false;
|
|
1677
1677
|
}
|
|
1678
1678
|
if (tmp) {
|
|
1679
1679
|
var tmp_0;
|
|
1680
|
-
var tmp_1 = head.
|
|
1680
|
+
var tmp_1 = head.cw();
|
|
1681
1681
|
Companion_getInstance_11();
|
|
1682
1682
|
if (!(tmp_1 === ';')) {
|
|
1683
|
-
tmp_0 = !(head.
|
|
1683
|
+
tmp_0 = !(head.cw() === get_ANNOTATION_FUNCTOR());
|
|
1684
1684
|
} else {
|
|
1685
1685
|
tmp_0 = false;
|
|
1686
1686
|
}
|
|
1687
1687
|
if (tmp_0) {
|
|
1688
1688
|
throw TuPrologException_init_$Create$('Badly formatted disjoint annotation: ' + head);
|
|
1689
1689
|
}
|
|
1690
|
-
var tmp_2 = head.
|
|
1690
|
+
var tmp_2 = head.cw();
|
|
1691
1691
|
Companion_getInstance_11();
|
|
1692
1692
|
if (tmp_2 === ';') {
|
|
1693
1693
|
collectAllHeads($this, head.get(1), accumulator);
|
|
@@ -1697,7 +1697,7 @@
|
|
|
1697
1697
|
var curHead = head;
|
|
1698
1698
|
if (isInterface(head, Struct)) {
|
|
1699
1699
|
var tmp_3;
|
|
1700
|
-
var tmp_4 = head.
|
|
1700
|
+
var tmp_4 = head.cw();
|
|
1701
1701
|
Companion_getInstance_11();
|
|
1702
1702
|
if (tmp_4 === ';') {
|
|
1703
1703
|
tmp_3 = head.get(0);
|
|
@@ -1707,7 +1707,7 @@
|
|
|
1707
1707
|
curHead = tmp_3;
|
|
1708
1708
|
var tmp_5;
|
|
1709
1709
|
if (isInterface(curHead, Struct)) {
|
|
1710
|
-
tmp_5 = curHead.
|
|
1710
|
+
tmp_5 = curHead.cw() === get_ANNOTATION_FUNCTOR();
|
|
1711
1711
|
} else {
|
|
1712
1712
|
tmp_5 = false;
|
|
1713
1713
|
}
|
|
@@ -1716,7 +1716,7 @@
|
|
|
1716
1716
|
var tmp0_subject = curHeadProbTerm;
|
|
1717
1717
|
var tmp_6;
|
|
1718
1718
|
if (isInterface(tmp0_subject, Numeric)) {
|
|
1719
|
-
tmp_6 = curHeadProbTerm.
|
|
1719
|
+
tmp_6 = curHeadProbTerm.u10().toDouble();
|
|
1720
1720
|
} else {
|
|
1721
1721
|
tmp_6 = solveArithmeticExpression(curHeadProbTerm);
|
|
1722
1722
|
}
|
|
@@ -1729,10 +1729,10 @@
|
|
|
1729
1729
|
function AnnotatedDisjunctionClauseMapper() {
|
|
1730
1730
|
AnnotatedDisjunctionClauseMapper_instance = this;
|
|
1731
1731
|
}
|
|
1732
|
-
AnnotatedDisjunctionClauseMapper.prototype.
|
|
1732
|
+
AnnotatedDisjunctionClauseMapper.prototype.a3e = function (clause) {
|
|
1733
1733
|
var tmp;
|
|
1734
1734
|
if (isInterface(clause, Rule)) {
|
|
1735
|
-
var tmp_0 = clause.
|
|
1735
|
+
var tmp_0 = clause.iy().cw();
|
|
1736
1736
|
Companion_getInstance_11();
|
|
1737
1737
|
tmp = tmp_0 === ';';
|
|
1738
1738
|
} else {
|
|
@@ -1740,17 +1740,17 @@
|
|
|
1740
1740
|
}
|
|
1741
1741
|
return tmp;
|
|
1742
1742
|
};
|
|
1743
|
-
AnnotatedDisjunctionClauseMapper.prototype.
|
|
1743
|
+
AnnotatedDisjunctionClauseMapper.prototype.b3e = function (clause) {
|
|
1744
1744
|
if (!isInterface(clause, Rule)) {
|
|
1745
1745
|
var tmp = 'Clause is not an instance of Rule: ' + clause;
|
|
1746
1746
|
throw ClauseMappingException_init_$Create$(tmp, null, 2, null);
|
|
1747
1747
|
}
|
|
1748
|
-
var body = clause.
|
|
1748
|
+
var body = clause.jy();
|
|
1749
1749
|
var tmp$ret$0;
|
|
1750
1750
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
1751
1751
|
tmp$ret$0 = ArrayList_init_$Create$_0();
|
|
1752
1752
|
var disjointHeads = tmp$ret$0;
|
|
1753
|
-
collectAllHeads(this, clause.
|
|
1753
|
+
collectAllHeads(this, clause.iy(), disjointHeads);
|
|
1754
1754
|
var probSum = 0.0;
|
|
1755
1755
|
var tmp$ret$3;
|
|
1756
1756
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1759,11 +1759,11 @@
|
|
|
1759
1759
|
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(disjointHeads, 10));
|
|
1760
1760
|
var tmp0_iterator = disjointHeads.j();
|
|
1761
1761
|
while (tmp0_iterator.m()) {
|
|
1762
|
-
var item = tmp0_iterator.
|
|
1762
|
+
var item = tmp0_iterator.n();
|
|
1763
1763
|
var tmp$ret$1;
|
|
1764
1764
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.AnnotatedDisjunctionClauseMapper.apply.<anonymous>' call
|
|
1765
1765
|
var tmp_0 = item.get(0);
|
|
1766
|
-
var curProb = (isInterface(tmp_0, Numeric) ? tmp_0 : THROW_CCE()).
|
|
1766
|
+
var curProb = (isInterface(tmp_0, Numeric) ? tmp_0 : THROW_CCE()).u10().toDouble();
|
|
1767
1767
|
var tmp_1;
|
|
1768
1768
|
var tmp_2 = item.get(1);
|
|
1769
1769
|
if (isInterface(tmp_2, Struct)) {
|
|
@@ -1774,13 +1774,13 @@
|
|
|
1774
1774
|
}
|
|
1775
1775
|
var curRuleHead = tmp_1;
|
|
1776
1776
|
probSum = probSum + curProb;
|
|
1777
|
-
tmp$ret$1 = ProbabilisticClauseMapper_getInstance().
|
|
1777
|
+
tmp$ret$1 = ProbabilisticClauseMapper_getInstance().c3e(Companion_getInstance_12().of(Companion_getInstance_3().of(get_ANNOTATION_FUNCTOR(), [Companion_getInstance_10().ofDouble(curProb / (1.0 - (probSum - curProb))), curRuleHead]), [body]));
|
|
1778
1778
|
tmp0_mapTo.g(tmp$ret$1);
|
|
1779
1779
|
}
|
|
1780
1780
|
tmp$ret$2 = tmp0_mapTo;
|
|
1781
1781
|
tmp$ret$3 = tmp$ret$2;
|
|
1782
1782
|
var mappedRules = toList_0(tmp$ret$3);
|
|
1783
|
-
var explanation = Companion_getInstance_21().
|
|
1783
|
+
var explanation = Companion_getInstance_21().l3d_1;
|
|
1784
1784
|
var tmp$ret$6;
|
|
1785
1785
|
// Inline function 'kotlin.collections.map' call
|
|
1786
1786
|
var tmp$ret$5;
|
|
@@ -1788,13 +1788,13 @@
|
|
|
1788
1788
|
var tmp0_mapTo_0 = ArrayList_init_$Create$(collectionSizeOrDefault(mappedRules, 10));
|
|
1789
1789
|
var tmp0_iterator_0 = mappedRules.j();
|
|
1790
1790
|
while (tmp0_iterator_0.m()) {
|
|
1791
|
-
var item_0 = tmp0_iterator_0.
|
|
1791
|
+
var item_0 = tmp0_iterator_0.n();
|
|
1792
1792
|
var tmp$ret$4;
|
|
1793
1793
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.AnnotatedDisjunctionClauseMapper.apply.<anonymous>' call
|
|
1794
|
-
var thisExplanation = Companion_getInstance_21().
|
|
1794
|
+
var thisExplanation = Companion_getInstance_21().p3d(item_0.h4_1);
|
|
1795
1795
|
var resultExplanation = thisExplanation.and(explanation);
|
|
1796
1796
|
explanation = explanation.and(thisExplanation.not());
|
|
1797
|
-
tmp$ret$4 = ProbabilisticClauseMapper_getInstance().
|
|
1797
|
+
tmp$ret$4 = ProbabilisticClauseMapper_getInstance().d3e(item_0.g4_1, resultExplanation);
|
|
1798
1798
|
tmp0_mapTo_0.g(tmp$ret$4);
|
|
1799
1799
|
}
|
|
1800
1800
|
tmp$ret$5 = tmp0_mapTo_0;
|
|
@@ -1809,7 +1809,7 @@
|
|
|
1809
1809
|
}
|
|
1810
1810
|
function BinaryDecisionDiagramExplanation_init_$Init$(diagram, computedValue, $mask0, $marker, $this) {
|
|
1811
1811
|
if (!(($mask0 & 2) === 0))
|
|
1812
|
-
computedValue = Companion_getInstance_23().
|
|
1812
|
+
computedValue = Companion_getInstance_23().m3d_1;
|
|
1813
1813
|
BinaryDecisionDiagramExplanation.call($this, diagram, computedValue);
|
|
1814
1814
|
return $this;
|
|
1815
1815
|
}
|
|
@@ -1817,13 +1817,13 @@
|
|
|
1817
1817
|
return BinaryDecisionDiagramExplanation_init_$Init$(diagram, computedValue, $mask0, $marker, Object.create(BinaryDecisionDiagramExplanation.prototype));
|
|
1818
1818
|
}
|
|
1819
1819
|
function ComputedValue(probability) {
|
|
1820
|
-
this.
|
|
1820
|
+
this.e3e_1 = probability;
|
|
1821
1821
|
}
|
|
1822
1822
|
ComputedValue.prototype.toString = function () {
|
|
1823
|
-
return 'ComputedValue(probability=' + this.
|
|
1823
|
+
return 'ComputedValue(probability=' + this.e3e_1 + ')';
|
|
1824
1824
|
};
|
|
1825
1825
|
ComputedValue.prototype.hashCode = function () {
|
|
1826
|
-
return this.
|
|
1826
|
+
return this.e3e_1 == null ? 0 : getNumberHashCode(this.e3e_1);
|
|
1827
1827
|
};
|
|
1828
1828
|
ComputedValue.prototype.equals = function (other) {
|
|
1829
1829
|
if (this === other)
|
|
@@ -1831,15 +1831,15 @@
|
|
|
1831
1831
|
if (!(other instanceof ComputedValue))
|
|
1832
1832
|
return false;
|
|
1833
1833
|
var tmp0_other_with_cast = other instanceof ComputedValue ? other : THROW_CCE();
|
|
1834
|
-
if (!equals(this.
|
|
1834
|
+
if (!equals(this.e3e_1, tmp0_other_with_cast.e3e_1))
|
|
1835
1835
|
return false;
|
|
1836
1836
|
return true;
|
|
1837
1837
|
};
|
|
1838
1838
|
function Companion_2() {
|
|
1839
1839
|
Companion_instance_2 = this;
|
|
1840
|
-
this.
|
|
1841
|
-
this.
|
|
1842
|
-
this.
|
|
1840
|
+
this.m3d_1 = new ComputedValue(null);
|
|
1841
|
+
this.n3d_1 = new ComputedValue(0.0);
|
|
1842
|
+
this.o3d_1 = new ComputedValue(1.0);
|
|
1843
1843
|
}
|
|
1844
1844
|
var Companion_instance_2;
|
|
1845
1845
|
function Companion_getInstance_23() {
|
|
@@ -1855,8 +1855,8 @@
|
|
|
1855
1855
|
}
|
|
1856
1856
|
function computeExpansion($this, value, low, high) {
|
|
1857
1857
|
var tmp;
|
|
1858
|
-
if (!(low.
|
|
1859
|
-
tmp = value.
|
|
1858
|
+
if (!(low.e3e_1 == null) ? !(high.e3e_1 == null) : false) {
|
|
1859
|
+
tmp = value.r3d_1 * high.e3e_1 + (1.0 - value.r3d_1) * low.e3e_1;
|
|
1860
1860
|
} else {
|
|
1861
1861
|
tmp = null;
|
|
1862
1862
|
}
|
|
@@ -1866,7 +1866,7 @@
|
|
|
1866
1866
|
var tmp$ret$0;
|
|
1867
1867
|
// Inline function 'kotlin.getValue' call
|
|
1868
1868
|
var tmp0_getValue = cachedNot$factory();
|
|
1869
|
-
tmp$ret$0 = $this.
|
|
1869
|
+
tmp$ret$0 = $this.l3c_1.b1();
|
|
1870
1870
|
return tmp$ret$0;
|
|
1871
1871
|
}
|
|
1872
1872
|
function BinaryDecisionDiagramExplanation$cachedNot$delegate$lambda$lambda(this$0) {
|
|
@@ -1876,9 +1876,9 @@
|
|
|
1876
1876
|
}
|
|
1877
1877
|
function BinaryDecisionDiagramExplanation$cachedNot$delegate$lambda(this$0) {
|
|
1878
1878
|
return function () {
|
|
1879
|
-
var tmp = Companion_getInstance_23().
|
|
1880
|
-
var tmp_0 = Companion_getInstance_23().
|
|
1881
|
-
var result = notThenExpansion(this$0.
|
|
1879
|
+
var tmp = Companion_getInstance_23().n3d_1;
|
|
1880
|
+
var tmp_0 = Companion_getInstance_23().o3d_1;
|
|
1881
|
+
var result = notThenExpansion(this$0.j3c_1, tmp, tmp_0, BinaryDecisionDiagramExplanation$cachedNot$delegate$lambda$lambda(this$0));
|
|
1882
1882
|
return new BinaryDecisionDiagramExplanation(result.g4_1, result.h4_1);
|
|
1883
1883
|
};
|
|
1884
1884
|
}
|
|
@@ -1893,14 +1893,14 @@
|
|
|
1893
1893
|
};
|
|
1894
1894
|
}
|
|
1895
1895
|
function BinaryDecisionDiagramExplanation$probability$delegate$lambda$lambda(node, low, high) {
|
|
1896
|
-
return node.
|
|
1896
|
+
return node.r3d_1 * high + (1.0 - node.r3d_1) * low;
|
|
1897
1897
|
}
|
|
1898
1898
|
function BinaryDecisionDiagramExplanation$probability$delegate$lambda(this$0) {
|
|
1899
1899
|
return function () {
|
|
1900
|
-
var tmp0_elvis_lhs = this$0.
|
|
1900
|
+
var tmp0_elvis_lhs = this$0.k3c_1.e3e_1;
|
|
1901
1901
|
var tmp;
|
|
1902
1902
|
if (tmp0_elvis_lhs == null) {
|
|
1903
|
-
tmp = expansion(this$0.
|
|
1903
|
+
tmp = expansion(this$0.j3c_1, 0.0, 1.0, BinaryDecisionDiagramExplanation$probability$delegate$lambda$lambda);
|
|
1904
1904
|
} else {
|
|
1905
1905
|
tmp = tmp0_elvis_lhs;
|
|
1906
1906
|
}
|
|
@@ -1908,11 +1908,11 @@
|
|
|
1908
1908
|
};
|
|
1909
1909
|
}
|
|
1910
1910
|
function BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda$lambda(it) {
|
|
1911
|
-
return !it.
|
|
1911
|
+
return !it.gx();
|
|
1912
1912
|
}
|
|
1913
1913
|
function BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda(this$0) {
|
|
1914
1914
|
return function () {
|
|
1915
|
-
return anyWhere(this$0.
|
|
1915
|
+
return anyWhere(this$0.j3c_1, BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda$lambda);
|
|
1916
1916
|
};
|
|
1917
1917
|
}
|
|
1918
1918
|
function BinaryDecisionDiagramExplanation$apply$lambda($transformation) {
|
|
@@ -1922,64 +1922,64 @@
|
|
|
1922
1922
|
}
|
|
1923
1923
|
function BinaryDecisionDiagramExplanation(diagram, computedValue) {
|
|
1924
1924
|
Companion_getInstance_23();
|
|
1925
|
-
this.
|
|
1926
|
-
this.
|
|
1925
|
+
this.j3c_1 = diagram;
|
|
1926
|
+
this.k3c_1 = computedValue;
|
|
1927
1927
|
var tmp = this;
|
|
1928
|
-
tmp.
|
|
1928
|
+
tmp.l3c_1 = lazy(BinaryDecisionDiagramExplanation$cachedNot$delegate$lambda(this));
|
|
1929
1929
|
var tmp_0 = this;
|
|
1930
|
-
tmp_0.
|
|
1930
|
+
tmp_0.m3c_1 = lazy(BinaryDecisionDiagramExplanation$probability$delegate$lambda(this));
|
|
1931
1931
|
var tmp_1 = this;
|
|
1932
|
-
tmp_1.
|
|
1932
|
+
tmp_1.n3c_1 = lazy(BinaryDecisionDiagramExplanation$containsAnyNotGroundTerm$delegate$lambda(this));
|
|
1933
1933
|
}
|
|
1934
|
-
BinaryDecisionDiagramExplanation.prototype.
|
|
1934
|
+
BinaryDecisionDiagramExplanation.prototype.f3e = function () {
|
|
1935
1935
|
return _get_cachedNot__l38068(this);
|
|
1936
1936
|
};
|
|
1937
1937
|
BinaryDecisionDiagramExplanation.prototype.not = function () {
|
|
1938
|
-
return this.
|
|
1938
|
+
return this.f3e();
|
|
1939
1939
|
};
|
|
1940
|
-
BinaryDecisionDiagramExplanation.prototype.
|
|
1941
|
-
var tmp = getAsInternal(this, that).
|
|
1942
|
-
var tmp_0 = Companion_getInstance_23().
|
|
1943
|
-
var tmp_1 = Companion_getInstance_23().
|
|
1944
|
-
var result = andThenExpansion(this.
|
|
1940
|
+
BinaryDecisionDiagramExplanation.prototype.g3e = function (that) {
|
|
1941
|
+
var tmp = getAsInternal(this, that).j3c_1;
|
|
1942
|
+
var tmp_0 = Companion_getInstance_23().n3d_1;
|
|
1943
|
+
var tmp_1 = Companion_getInstance_23().o3d_1;
|
|
1944
|
+
var result = andThenExpansion(this.j3c_1, tmp, tmp_0, tmp_1, BinaryDecisionDiagramExplanation$and$lambda(this));
|
|
1945
1945
|
return new BinaryDecisionDiagramExplanation(result.g4_1, result.h4_1);
|
|
1946
1946
|
};
|
|
1947
1947
|
BinaryDecisionDiagramExplanation.prototype.and = function (that) {
|
|
1948
|
-
return this.
|
|
1948
|
+
return this.g3e(that);
|
|
1949
1949
|
};
|
|
1950
|
-
BinaryDecisionDiagramExplanation.prototype.
|
|
1951
|
-
var tmp = getAsInternal(this, that).
|
|
1952
|
-
var tmp_0 = Companion_getInstance_23().
|
|
1953
|
-
var tmp_1 = Companion_getInstance_23().
|
|
1954
|
-
var result = orThenExpansion(this.
|
|
1950
|
+
BinaryDecisionDiagramExplanation.prototype.h3e = function (that) {
|
|
1951
|
+
var tmp = getAsInternal(this, that).j3c_1;
|
|
1952
|
+
var tmp_0 = Companion_getInstance_23().n3d_1;
|
|
1953
|
+
var tmp_1 = Companion_getInstance_23().o3d_1;
|
|
1954
|
+
var result = orThenExpansion(this.j3c_1, tmp, tmp_0, tmp_1, BinaryDecisionDiagramExplanation$or$lambda(this));
|
|
1955
1955
|
return new BinaryDecisionDiagramExplanation(result.g4_1, result.h4_1);
|
|
1956
1956
|
};
|
|
1957
1957
|
BinaryDecisionDiagramExplanation.prototype.or = function (that) {
|
|
1958
|
-
return this.
|
|
1958
|
+
return this.h3e(that);
|
|
1959
1959
|
};
|
|
1960
|
-
BinaryDecisionDiagramExplanation.prototype.
|
|
1960
|
+
BinaryDecisionDiagramExplanation.prototype.x3d = function () {
|
|
1961
1961
|
var tmp$ret$0;
|
|
1962
1962
|
// Inline function 'kotlin.getValue' call
|
|
1963
1963
|
var tmp0_getValue = probability$factory();
|
|
1964
|
-
tmp$ret$0 = this.
|
|
1964
|
+
tmp$ret$0 = this.m3c_1.b1();
|
|
1965
1965
|
return tmp$ret$0;
|
|
1966
1966
|
};
|
|
1967
|
-
BinaryDecisionDiagramExplanation.prototype.
|
|
1967
|
+
BinaryDecisionDiagramExplanation.prototype.z3d = function () {
|
|
1968
1968
|
var tmp$ret$0;
|
|
1969
1969
|
// Inline function 'kotlin.getValue' call
|
|
1970
1970
|
var tmp0_getValue = containsAnyNotGroundTerm$factory();
|
|
1971
|
-
tmp$ret$0 = this.
|
|
1971
|
+
tmp$ret$0 = this.n3c_1.b1();
|
|
1972
1972
|
return tmp$ret$0;
|
|
1973
1973
|
};
|
|
1974
1974
|
BinaryDecisionDiagramExplanation.prototype.toString = function () {
|
|
1975
|
-
return 'bdd:' + hashCode(this.
|
|
1975
|
+
return 'bdd:' + hashCode(this.j3c_1);
|
|
1976
1976
|
};
|
|
1977
|
-
BinaryDecisionDiagramExplanation.prototype.
|
|
1978
|
-
var tmp = map_0(this.
|
|
1977
|
+
BinaryDecisionDiagramExplanation.prototype.i3e = function (transformation) {
|
|
1978
|
+
var tmp = map_0(this.j3c_1, BinaryDecisionDiagramExplanation$apply$lambda(transformation));
|
|
1979
1979
|
return BinaryDecisionDiagramExplanation_init_$Create$(tmp, null, 2, null);
|
|
1980
1980
|
};
|
|
1981
1981
|
BinaryDecisionDiagramExplanation.prototype.applyTransformation = function (transformation) {
|
|
1982
|
-
return this.
|
|
1982
|
+
return this.i3e(transformation);
|
|
1983
1983
|
};
|
|
1984
1984
|
function cachedNot$factory() {
|
|
1985
1985
|
return getPropertyCallableRef('cachedNot', 1, KProperty1, function (receiver) {
|
|
@@ -1988,12 +1988,12 @@
|
|
|
1988
1988
|
}
|
|
1989
1989
|
function probability$factory() {
|
|
1990
1990
|
return getPropertyCallableRef('probability', 1, KProperty1, function (receiver) {
|
|
1991
|
-
return receiver.
|
|
1991
|
+
return receiver.x3d();
|
|
1992
1992
|
}, null);
|
|
1993
1993
|
}
|
|
1994
1994
|
function containsAnyNotGroundTerm$factory() {
|
|
1995
1995
|
return getPropertyCallableRef('containsAnyNotGroundTerm', 1, KProperty1, function (receiver) {
|
|
1996
|
-
return receiver.
|
|
1996
|
+
return receiver.z3d();
|
|
1997
1997
|
}, null);
|
|
1998
1998
|
}
|
|
1999
1999
|
function get_nonWrappableFunctors() {
|
|
@@ -2003,16 +2003,16 @@
|
|
|
2003
2003
|
var nonWrappableFunctors;
|
|
2004
2004
|
function ClauseMappingUtils() {
|
|
2005
2005
|
ClauseMappingUtils_instance = this;
|
|
2006
|
-
this.
|
|
2007
|
-
this.
|
|
2006
|
+
this.j3e_1 = new Long(1, 0);
|
|
2007
|
+
this.k3e_1 = listOf_0([DirectiveClauseMapper_getInstance(), AnnotatedDisjunctionClauseMapper_getInstance(), ProbabilisticClauseMapper_getInstance(), EvidenceClauseMapper_getInstance(), PrologClauseMapper_getInstance(), NothingClauseMapper_getInstance()]);
|
|
2008
2008
|
}
|
|
2009
|
-
ClauseMappingUtils.prototype.
|
|
2009
|
+
ClauseMappingUtils.prototype.l3e = function () {
|
|
2010
2010
|
var tmp0_this = this;
|
|
2011
|
-
var tmp1 = tmp0_this.
|
|
2012
|
-
tmp0_this.
|
|
2011
|
+
var tmp1 = tmp0_this.j3e_1;
|
|
2012
|
+
tmp0_this.j3e_1 = tmp1.eh();
|
|
2013
2013
|
return tmp1;
|
|
2014
2014
|
};
|
|
2015
|
-
ClauseMappingUtils.prototype.
|
|
2015
|
+
ClauseMappingUtils.prototype.m3e = function (clause) {
|
|
2016
2016
|
var tmp;
|
|
2017
2017
|
if (get_isMappedAsProblog(clause)) {
|
|
2018
2018
|
tmp = listOf(clause);
|
|
@@ -2022,13 +2022,13 @@
|
|
|
2022
2022
|
var tmp$ret$1;
|
|
2023
2023
|
$l$block: {
|
|
2024
2024
|
// Inline function 'kotlin.collections.first' call
|
|
2025
|
-
var tmp0_first = this.
|
|
2025
|
+
var tmp0_first = this.k3e_1;
|
|
2026
2026
|
var tmp0_iterator = tmp0_first.j();
|
|
2027
2027
|
while (tmp0_iterator.m()) {
|
|
2028
|
-
var element = tmp0_iterator.
|
|
2028
|
+
var element = tmp0_iterator.n();
|
|
2029
2029
|
var tmp$ret$0;
|
|
2030
2030
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.ClauseMappingUtils.map.<anonymous>' call
|
|
2031
|
-
tmp$ret$0 = element.
|
|
2031
|
+
tmp$ret$0 = element.a3e(clause);
|
|
2032
2032
|
if (tmp$ret$0) {
|
|
2033
2033
|
tmp$ret$1 = element;
|
|
2034
2034
|
break $l$block;
|
|
@@ -2036,13 +2036,13 @@
|
|
|
2036
2036
|
}
|
|
2037
2037
|
throw NoSuchElementException_init_$Create$('Collection contains no element matching the predicate.');
|
|
2038
2038
|
}
|
|
2039
|
-
var tmp1_map = tmp$ret$1.
|
|
2039
|
+
var tmp1_map = tmp$ret$1.b3e(clause);
|
|
2040
2040
|
var tmp$ret$3;
|
|
2041
2041
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2042
2042
|
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp1_map, 10));
|
|
2043
2043
|
var tmp0_iterator_0 = tmp1_map.j();
|
|
2044
2044
|
while (tmp0_iterator_0.m()) {
|
|
2045
|
-
var item = tmp0_iterator_0.
|
|
2045
|
+
var item = tmp0_iterator_0.n();
|
|
2046
2046
|
var tmp$ret$2;
|
|
2047
2047
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.ClauseMappingUtils.map.<anonymous>' call
|
|
2048
2048
|
tmp$ret$2 = setMappedAsProblog(item, true);
|
|
@@ -2054,14 +2054,14 @@
|
|
|
2054
2054
|
}
|
|
2055
2055
|
return tmp;
|
|
2056
2056
|
};
|
|
2057
|
-
ClauseMappingUtils.prototype.
|
|
2058
|
-
var arityTerm = indicator.
|
|
2057
|
+
ClauseMappingUtils.prototype.n3e = function (indicator) {
|
|
2058
|
+
var arityTerm = indicator.l10();
|
|
2059
2059
|
var tmp = Companion_getInstance_13();
|
|
2060
|
-
var tmp_0 = indicator.
|
|
2060
|
+
var tmp_0 = indicator.k10();
|
|
2061
2061
|
var tmp0_subject = arityTerm;
|
|
2062
2062
|
var tmp_1;
|
|
2063
2063
|
if (isInterface(tmp0_subject, Numeric)) {
|
|
2064
|
-
tmp_1 = Companion_getInstance_10().ofInteger(arityTerm.
|
|
2064
|
+
tmp_1 = Companion_getInstance_10().ofInteger(arityTerm.m10().toInt() + 1 | 0);
|
|
2065
2065
|
} else {
|
|
2066
2066
|
tmp_1 = arityTerm;
|
|
2067
2067
|
}
|
|
@@ -2105,7 +2105,7 @@
|
|
|
2105
2105
|
var tmp0_subject = _this__u8e3s4;
|
|
2106
2106
|
var tmp_0;
|
|
2107
2107
|
if (isInterface(tmp0_subject, Struct)) {
|
|
2108
|
-
tmp_0 = Companion_getInstance_3().ofList(_this__u8e3s4.
|
|
2108
|
+
tmp_0 = Companion_getInstance_3().ofList(_this__u8e3s4.cw(), plus(_this__u8e3s4.dw(), explanation));
|
|
2109
2109
|
} else {
|
|
2110
2110
|
tmp_0 = Companion_getInstance_3().of(_this__u8e3s4.toString(), [explanation]);
|
|
2111
2111
|
}
|
|
@@ -2127,7 +2127,7 @@
|
|
|
2127
2127
|
var tmp0_subject = _this__u8e3s4;
|
|
2128
2128
|
var tmp;
|
|
2129
2129
|
if (isInterface(tmp0_subject, Struct)) {
|
|
2130
|
-
var tmp1_subject = _this__u8e3s4.
|
|
2130
|
+
var tmp1_subject = _this__u8e3s4.cw();
|
|
2131
2131
|
var tmp_0;
|
|
2132
2132
|
switch (tmp1_subject) {
|
|
2133
2133
|
case ',':
|
|
@@ -2171,11 +2171,11 @@
|
|
|
2171
2171
|
}
|
|
2172
2172
|
function get_isWrappableWithExplanation(_this__u8e3s4) {
|
|
2173
2173
|
init_properties_ClauseMappingUtils_kt_i29ma0();
|
|
2174
|
-
return !get_nonWrappableFunctors().v(safeToStruct(_this__u8e3s4).
|
|
2174
|
+
return !get_nonWrappableFunctors().v(safeToStruct(_this__u8e3s4).cw());
|
|
2175
2175
|
}
|
|
2176
2176
|
function withExplanationNonWrappable(_this__u8e3s4, explanation) {
|
|
2177
2177
|
init_properties_ClauseMappingUtils_kt_i29ma0();
|
|
2178
|
-
return Companion_getInstance_2().of(_this__u8e3s4, Companion_getInstance_3().of('=', [explanation, toTerm(Companion_getInstance_21().
|
|
2178
|
+
return Companion_getInstance_2().of(_this__u8e3s4, Companion_getInstance_3().of('=', [explanation, toTerm(Companion_getInstance_21().l3d_1)]));
|
|
2179
2179
|
}
|
|
2180
2180
|
function wrapInPredicate(_this__u8e3s4, functor, explanation) {
|
|
2181
2181
|
init_properties_ClauseMappingUtils_kt_i29ma0();
|
|
@@ -2210,11 +2210,11 @@
|
|
|
2210
2210
|
var tmp1_container = regexMatch.n9();
|
|
2211
2211
|
var tmp$ret$2;
|
|
2212
2212
|
// Inline function 'kotlin.text.Destructured.component1' call
|
|
2213
|
-
tmp$ret$2 = tmp1_container.j9_1.m9().
|
|
2213
|
+
tmp$ret$2 = tmp1_container.j9_1.m9().o(1);
|
|
2214
2214
|
var dividendStr = tmp$ret$2;
|
|
2215
2215
|
var tmp$ret$3;
|
|
2216
2216
|
// Inline function 'kotlin.text.Destructured.component3' call
|
|
2217
|
-
tmp$ret$3 = tmp1_container.j9_1.m9().
|
|
2217
|
+
tmp$ret$3 = tmp1_container.j9_1.m9().o(3);
|
|
2218
2218
|
var divisorStr = tmp$ret$3;
|
|
2219
2219
|
var dividend = toDoubleOrNull(dividendStr);
|
|
2220
2220
|
var divisor = toDoubleOrNull(divisorStr);
|
|
@@ -2230,16 +2230,16 @@
|
|
|
2230
2230
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
2231
2231
|
var tmp$ret$2;
|
|
2232
2232
|
// Inline function 'kotlin.collections.filter' call
|
|
2233
|
-
var tmp0_filter = plus_0(toSet_0(_this__u8e3s4.
|
|
2233
|
+
var tmp0_filter = plus_0(toSet_0(_this__u8e3s4.iy().ew()), toSet_0(_this__u8e3s4.jy().ew()));
|
|
2234
2234
|
var tmp$ret$1;
|
|
2235
2235
|
// Inline function 'kotlin.collections.filterTo' call
|
|
2236
2236
|
var tmp0_filterTo = ArrayList_init_$Create$_0();
|
|
2237
2237
|
var tmp0_iterator = tmp0_filter.j();
|
|
2238
2238
|
while (tmp0_iterator.m()) {
|
|
2239
|
-
var element = tmp0_iterator.
|
|
2239
|
+
var element = tmp0_iterator.n();
|
|
2240
2240
|
var tmp$ret$0;
|
|
2241
2241
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.withoutAnonymousVars.<anonymous>' call
|
|
2242
|
-
tmp$ret$0 = element.
|
|
2242
|
+
tmp$ret$0 = element.u14();
|
|
2243
2243
|
if (tmp$ret$0) {
|
|
2244
2244
|
tmp0_filterTo.g(element);
|
|
2245
2245
|
}
|
|
@@ -2253,7 +2253,7 @@
|
|
|
2253
2253
|
var index = 0;
|
|
2254
2254
|
var tmp0_iterator_0 = tmp1_mapIndexed.j();
|
|
2255
2255
|
while (tmp0_iterator_0.m()) {
|
|
2256
|
-
var item = tmp0_iterator_0.
|
|
2256
|
+
var item = tmp0_iterator_0.n();
|
|
2257
2257
|
var tmp$ret$3;
|
|
2258
2258
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.withoutAnonymousVars.<anonymous>' call
|
|
2259
2259
|
var tmp1 = index;
|
|
@@ -2268,18 +2268,18 @@
|
|
|
2268
2268
|
var tmp0_subject = _this__u8e3s4;
|
|
2269
2269
|
var tmp_0;
|
|
2270
2270
|
if (isInterface(tmp0_subject, Fact)) {
|
|
2271
|
-
tmp_0 = Companion_getInstance().of(safeToStruct(_this__u8e3s4.
|
|
2271
|
+
tmp_0 = Companion_getInstance().of(safeToStruct(_this__u8e3s4.iy().applySubstitution(anonVarSubstitution)));
|
|
2272
2272
|
} else {
|
|
2273
|
-
tmp_0 = Companion_getInstance_12().of(safeToStruct(_this__u8e3s4.
|
|
2273
|
+
tmp_0 = Companion_getInstance_12().of(safeToStruct(_this__u8e3s4.iy().applySubstitution(anonVarSubstitution)), [safeToStruct(_this__u8e3s4.jy().applySubstitution(anonVarSubstitution))]);
|
|
2274
2274
|
}
|
|
2275
2275
|
return tmp_0;
|
|
2276
2276
|
}
|
|
2277
2277
|
function get_extraVariables(_this__u8e3s4) {
|
|
2278
2278
|
init_properties_ClauseMappingUtils_kt_i29ma0();
|
|
2279
2279
|
var tmp;
|
|
2280
|
-
if (!_this__u8e3s4.
|
|
2281
|
-
var headVars = toSet_0(_this__u8e3s4.
|
|
2282
|
-
var bodyVars = toSet_0(_this__u8e3s4.
|
|
2280
|
+
if (!_this__u8e3s4.gx()) {
|
|
2281
|
+
var headVars = toSet_0(_this__u8e3s4.iy().ew());
|
|
2282
|
+
var bodyVars = toSet_0(_this__u8e3s4.jy().ew());
|
|
2283
2283
|
tmp = subtract(bodyVars, headVars);
|
|
2284
2284
|
} else {
|
|
2285
2285
|
tmp = emptySet();
|
|
@@ -2297,18 +2297,18 @@
|
|
|
2297
2297
|
function DirectiveClauseMapper() {
|
|
2298
2298
|
DirectiveClauseMapper_instance = this;
|
|
2299
2299
|
}
|
|
2300
|
-
DirectiveClauseMapper.prototype.
|
|
2301
|
-
return clause.
|
|
2300
|
+
DirectiveClauseMapper.prototype.a3e = function (clause) {
|
|
2301
|
+
return clause.lw();
|
|
2302
2302
|
};
|
|
2303
|
-
DirectiveClauseMapper.prototype.
|
|
2304
|
-
var body = clause.
|
|
2303
|
+
DirectiveClauseMapper.prototype.b3e = function (clause) {
|
|
2304
|
+
var body = clause.jy();
|
|
2305
2305
|
if (!isInterface(clause, Directive)) {
|
|
2306
2306
|
var tmp = 'Clause is not an instance of Directive: ' + clause;
|
|
2307
2307
|
throw ClauseMappingException_init_$Create$(tmp, null, 2, null);
|
|
2308
2308
|
}
|
|
2309
2309
|
var tmp_0;
|
|
2310
2310
|
if (isInterface(body, Struct)) {
|
|
2311
|
-
tmp_0 = body.
|
|
2311
|
+
tmp_0 = body.cw() === 'static' ? true : body.cw() === 'dynamic';
|
|
2312
2312
|
} else {
|
|
2313
2313
|
tmp_0 = false;
|
|
2314
2314
|
}
|
|
@@ -2318,22 +2318,22 @@
|
|
|
2318
2318
|
var tmp_1 = 'Malformed directive: ' + clause;
|
|
2319
2319
|
throw ClauseMappingException_init_$Create$(tmp_1, null, 2, null);
|
|
2320
2320
|
}
|
|
2321
|
-
var name = indicatorTerm.
|
|
2322
|
-
var arity = indicatorTerm.
|
|
2321
|
+
var name = indicatorTerm.k10();
|
|
2322
|
+
var arity = indicatorTerm.l10();
|
|
2323
2323
|
if (!isInterface(arity, Numeric)) {
|
|
2324
2324
|
var tmp_2 = 'Malformed directive: ' + clause;
|
|
2325
2325
|
throw ClauseMappingException_init_$Create$(tmp_2, null, 2, null);
|
|
2326
2326
|
}
|
|
2327
|
-
return listOf(Companion_getInstance_14().of(Companion_getInstance_3().of(body.
|
|
2327
|
+
return listOf(Companion_getInstance_14().of(Companion_getInstance_3().of(body.cw(), [Companion_getInstance_13().of(name, Companion_getInstance_10().ofInteger(arity.u10().toInt() + 1 | 0))]), []));
|
|
2328
2328
|
}
|
|
2329
2329
|
var tmp_3;
|
|
2330
2330
|
if (isInterface(body, Struct)) {
|
|
2331
|
-
tmp_3 = body.
|
|
2331
|
+
tmp_3 = body.cw() === 'initialization' ? true : body.cw() === 'solve';
|
|
2332
2332
|
} else {
|
|
2333
2333
|
tmp_3 = false;
|
|
2334
2334
|
}
|
|
2335
2335
|
if (tmp_3) {
|
|
2336
|
-
return listOf(Companion_getInstance_14().of(Companion_getInstance_3().of(body.
|
|
2336
|
+
return listOf(Companion_getInstance_14().of(Companion_getInstance_3().of(body.cw(), [withBodyExplanation(body.get(0), Companion_getInstance_1().anonymous())]), []));
|
|
2337
2337
|
}
|
|
2338
2338
|
return listOf(clause);
|
|
2339
2339
|
};
|
|
@@ -2346,10 +2346,10 @@
|
|
|
2346
2346
|
function EvidenceClauseMapper() {
|
|
2347
2347
|
EvidenceClauseMapper_instance = this;
|
|
2348
2348
|
}
|
|
2349
|
-
EvidenceClauseMapper.prototype.
|
|
2349
|
+
EvidenceClauseMapper.prototype.a3e = function (clause) {
|
|
2350
2350
|
var tmp;
|
|
2351
2351
|
if (isInterface(clause, Rule)) {
|
|
2352
|
-
var tmp_0 = clause.
|
|
2352
|
+
var tmp_0 = clause.iy().cw();
|
|
2353
2353
|
ProblogLib_getInstance();
|
|
2354
2354
|
tmp = tmp_0 === 'evidence';
|
|
2355
2355
|
} else {
|
|
@@ -2357,34 +2357,34 @@
|
|
|
2357
2357
|
}
|
|
2358
2358
|
return tmp;
|
|
2359
2359
|
};
|
|
2360
|
-
EvidenceClauseMapper.prototype.
|
|
2360
|
+
EvidenceClauseMapper.prototype.b3e = function (clause) {
|
|
2361
2361
|
if (!isInterface(clause, Rule)) {
|
|
2362
2362
|
var tmp = 'Clause is not an instance of Rule: ' + clause;
|
|
2363
2363
|
throw ClauseMappingException_init_$Create$(tmp, null, 2, null);
|
|
2364
2364
|
}
|
|
2365
|
-
if (clause.
|
|
2366
|
-
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.
|
|
2365
|
+
if (clause.iy().wv() > 2) {
|
|
2366
|
+
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.iy());
|
|
2367
2367
|
} else {
|
|
2368
2368
|
var tmp_0;
|
|
2369
|
-
if (clause.
|
|
2370
|
-
var tmp_1 = clause.
|
|
2369
|
+
if (clause.iy().wv() === 2) {
|
|
2370
|
+
var tmp_1 = clause.iy().get(1);
|
|
2371
2371
|
tmp_0 = !isInterface(tmp_1, Truth);
|
|
2372
2372
|
} else {
|
|
2373
2373
|
tmp_0 = false;
|
|
2374
2374
|
}
|
|
2375
2375
|
if (tmp_0) {
|
|
2376
|
-
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.
|
|
2376
|
+
throw TuPrologException_init_$Create$('Invalid evidence predicate: ' + clause.iy());
|
|
2377
2377
|
}
|
|
2378
2378
|
}
|
|
2379
|
-
var headTerm = clause.
|
|
2380
|
-
if (headTerm.
|
|
2381
|
-
headTerm = Companion_getInstance_3().of(headTerm.
|
|
2379
|
+
var headTerm = clause.iy();
|
|
2380
|
+
if (headTerm.wv() === 1) {
|
|
2381
|
+
headTerm = Companion_getInstance_3().of(headTerm.cw(), [headTerm.get(0), Companion_getInstance_15().tv_1]);
|
|
2382
2382
|
}
|
|
2383
2383
|
var tmp_2;
|
|
2384
2384
|
if (isInterface(clause, Fact)) {
|
|
2385
2385
|
tmp_2 = Companion_getInstance().of(headTerm);
|
|
2386
2386
|
} else {
|
|
2387
|
-
tmp_2 = Companion_getInstance_12().of(headTerm, [withBodyExplanation(clause.
|
|
2387
|
+
tmp_2 = Companion_getInstance_12().of(headTerm, [withBodyExplanation(clause.jy(), Companion_getInstance_1().anonymous())]);
|
|
2388
2388
|
}
|
|
2389
2389
|
return listOf(tmp_2);
|
|
2390
2390
|
};
|
|
@@ -2396,7 +2396,7 @@
|
|
|
2396
2396
|
}
|
|
2397
2397
|
function MappedMutableProblogTheory_init_$Init$(clauses, unificator, theory, $mask0, $marker, $this) {
|
|
2398
2398
|
if (!(($mask0 & 2) === 0))
|
|
2399
|
-
unificator = Companion_getInstance_16().
|
|
2399
|
+
unificator = Companion_getInstance_16().e1l();
|
|
2400
2400
|
if (!(($mask0 & 4) === 0)) {
|
|
2401
2401
|
var tmp = Companion_getInstance_17();
|
|
2402
2402
|
var tmp0_safe_receiver = clauses;
|
|
@@ -2413,11 +2413,11 @@
|
|
|
2413
2413
|
var tmp0_flatMapTo = ArrayList_init_$Create$_0();
|
|
2414
2414
|
var tmp0_iterator = tmp0_safe_receiver.j();
|
|
2415
2415
|
while (tmp0_iterator.m()) {
|
|
2416
|
-
var element = tmp0_iterator.
|
|
2416
|
+
var element = tmp0_iterator.n();
|
|
2417
2417
|
var tmp$ret$0;
|
|
2418
2418
|
var tmp$ret$0_0;
|
|
2419
2419
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.MappedMutableProblogTheory.<init>.<anonymous>' call
|
|
2420
|
-
tmp$ret$0 = ClauseMappingUtils_getInstance().
|
|
2420
|
+
tmp$ret$0 = ClauseMappingUtils_getInstance().m3e(element);
|
|
2421
2421
|
tmp$ret$0_0 = Unit_getInstance();
|
|
2422
2422
|
var list = tmp$ret$0;
|
|
2423
2423
|
addAll(tmp0_flatMapTo, list);
|
|
@@ -2438,120 +2438,120 @@
|
|
|
2438
2438
|
return MappedMutableProblogTheory_init_$Init$(clauses, unificator, theory, $mask0, $marker, Object.create(MappedMutableProblogTheory.prototype));
|
|
2439
2439
|
}
|
|
2440
2440
|
function MappedMutableProblogTheory(clauses, unificator, theory) {
|
|
2441
|
-
this.
|
|
2441
|
+
this.o3e_1 = theory;
|
|
2442
2442
|
}
|
|
2443
|
-
MappedMutableProblogTheory.prototype.
|
|
2444
|
-
return this.
|
|
2443
|
+
MappedMutableProblogTheory.prototype.q1l = function () {
|
|
2444
|
+
return this.o3e_1.q1l();
|
|
2445
2445
|
};
|
|
2446
|
-
MappedMutableProblogTheory.prototype.
|
|
2447
|
-
return this.
|
|
2446
|
+
MappedMutableProblogTheory.prototype.j1l = function () {
|
|
2447
|
+
return this.o3e_1.j1l();
|
|
2448
2448
|
};
|
|
2449
|
-
MappedMutableProblogTheory.prototype.
|
|
2450
|
-
return this.
|
|
2449
|
+
MappedMutableProblogTheory.prototype.l1l = function () {
|
|
2450
|
+
return this.o3e_1.l1l();
|
|
2451
2451
|
};
|
|
2452
|
-
MappedMutableProblogTheory.prototype.
|
|
2453
|
-
return this.
|
|
2452
|
+
MappedMutableProblogTheory.prototype.h1s = function () {
|
|
2453
|
+
return this.o3e_1.h1s();
|
|
2454
2454
|
};
|
|
2455
|
-
MappedMutableProblogTheory.prototype.
|
|
2456
|
-
return this.
|
|
2455
|
+
MappedMutableProblogTheory.prototype.p = function () {
|
|
2456
|
+
return this.o3e_1.p();
|
|
2457
2457
|
};
|
|
2458
|
-
MappedMutableProblogTheory.prototype.
|
|
2459
|
-
return this.
|
|
2458
|
+
MappedMutableProblogTheory.prototype.ht = function () {
|
|
2459
|
+
return this.o3e_1.ht();
|
|
2460
2460
|
};
|
|
2461
|
-
MappedMutableProblogTheory.prototype.
|
|
2462
|
-
return this.
|
|
2461
|
+
MappedMutableProblogTheory.prototype.h1l = function () {
|
|
2462
|
+
return this.o3e_1.h1l();
|
|
2463
2463
|
};
|
|
2464
|
-
MappedMutableProblogTheory.prototype.
|
|
2465
|
-
return this.
|
|
2464
|
+
MappedMutableProblogTheory.prototype.w1s = function () {
|
|
2465
|
+
return this.o3e_1.w1s();
|
|
2466
2466
|
};
|
|
2467
2467
|
MappedMutableProblogTheory.prototype.clone = function () {
|
|
2468
|
-
return this.
|
|
2468
|
+
return this.w1s();
|
|
2469
2469
|
};
|
|
2470
2470
|
MappedMutableProblogTheory.prototype.contains = function (clause) {
|
|
2471
|
-
return this.
|
|
2471
|
+
return this.o3e_1.contains(clause);
|
|
2472
2472
|
};
|
|
2473
2473
|
MappedMutableProblogTheory.prototype.containsIndicator = function (indicator) {
|
|
2474
|
-
return this.
|
|
2474
|
+
return this.o3e_1.containsIndicator(indicator);
|
|
2475
2475
|
};
|
|
2476
2476
|
MappedMutableProblogTheory.prototype.containsHead = function (head) {
|
|
2477
|
-
return this.
|
|
2477
|
+
return this.o3e_1.containsHead(head);
|
|
2478
2478
|
};
|
|
2479
2479
|
MappedMutableProblogTheory.prototype.containsTag = function (name) {
|
|
2480
|
-
return this.
|
|
2480
|
+
return this.o3e_1.containsTag(name);
|
|
2481
2481
|
};
|
|
2482
2482
|
MappedMutableProblogTheory.prototype.equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
2483
|
-
return this.
|
|
2483
|
+
return this.o3e_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
2484
2484
|
};
|
|
2485
2485
|
MappedMutableProblogTheory.prototype.get = function (clause) {
|
|
2486
|
-
return this.
|
|
2486
|
+
return this.o3e_1.get(clause);
|
|
2487
2487
|
};
|
|
2488
2488
|
MappedMutableProblogTheory.prototype.getByIndicator = function (indicator) {
|
|
2489
|
-
return this.
|
|
2489
|
+
return this.o3e_1.getByIndicator(indicator);
|
|
2490
2490
|
};
|
|
2491
2491
|
MappedMutableProblogTheory.prototype.getByHead = function (head) {
|
|
2492
|
-
return this.
|
|
2492
|
+
return this.o3e_1.getByHead(head);
|
|
2493
2493
|
};
|
|
2494
2494
|
MappedMutableProblogTheory.prototype.getTag = function (name) {
|
|
2495
|
-
return this.
|
|
2495
|
+
return this.o3e_1.getTag(name);
|
|
2496
2496
|
};
|
|
2497
2497
|
MappedMutableProblogTheory.prototype.j = function () {
|
|
2498
|
-
return this.
|
|
2498
|
+
return this.o3e_1.j();
|
|
2499
2499
|
};
|
|
2500
|
-
MappedMutableProblogTheory.prototype.
|
|
2501
|
-
return this.
|
|
2500
|
+
MappedMutableProblogTheory.prototype.l12 = function (tags) {
|
|
2501
|
+
return this.o3e_1.l12(tags);
|
|
2502
2502
|
};
|
|
2503
2503
|
MappedMutableProblogTheory.prototype.resetTags = function (tags) {
|
|
2504
|
-
return this.
|
|
2504
|
+
return this.l12(tags);
|
|
2505
2505
|
};
|
|
2506
|
-
MappedMutableProblogTheory.prototype.
|
|
2507
|
-
return this.
|
|
2506
|
+
MappedMutableProblogTheory.prototype.i1s = function (unificator) {
|
|
2507
|
+
return this.o3e_1.i1s(unificator);
|
|
2508
2508
|
};
|
|
2509
2509
|
MappedMutableProblogTheory.prototype.setUnificator = function (unificator) {
|
|
2510
|
-
return this.
|
|
2510
|
+
return this.i1s(unificator);
|
|
2511
2511
|
};
|
|
2512
2512
|
MappedMutableProblogTheory.prototype.toStringAsProlog = function (asPrologText) {
|
|
2513
|
-
return this.
|
|
2513
|
+
return this.o3e_1.toStringAsProlog(asPrologText);
|
|
2514
2514
|
};
|
|
2515
|
-
MappedMutableProblogTheory.prototype.
|
|
2515
|
+
MappedMutableProblogTheory.prototype.x1s = function () {
|
|
2516
2516
|
return false;
|
|
2517
2517
|
};
|
|
2518
|
-
MappedMutableProblogTheory.prototype.
|
|
2519
|
-
return Companion_getInstance_20().ofIterable(this.
|
|
2518
|
+
MappedMutableProblogTheory.prototype.y1s = function () {
|
|
2519
|
+
return Companion_getInstance_20().ofIterable(this.h1l(), this);
|
|
2520
2520
|
};
|
|
2521
2521
|
MappedMutableProblogTheory.prototype.toMutableTheory = function () {
|
|
2522
|
-
return this.
|
|
2522
|
+
return this.y1s();
|
|
2523
2523
|
};
|
|
2524
|
-
MappedMutableProblogTheory.prototype.
|
|
2524
|
+
MappedMutableProblogTheory.prototype.x1r = function () {
|
|
2525
2525
|
return this;
|
|
2526
2526
|
};
|
|
2527
2527
|
MappedMutableProblogTheory.prototype.toImmutableTheory = function () {
|
|
2528
|
-
return this.
|
|
2528
|
+
return this.x1r();
|
|
2529
2529
|
};
|
|
2530
|
-
MappedMutableProblogTheory.prototype.
|
|
2531
|
-
return new MappedMutableProblogTheory(null, this.
|
|
2530
|
+
MappedMutableProblogTheory.prototype.p3e = function (theory) {
|
|
2531
|
+
return new MappedMutableProblogTheory(null, this.h1l(), this.o3e_1.k1s(theory));
|
|
2532
2532
|
};
|
|
2533
|
-
MappedMutableProblogTheory.prototype.
|
|
2533
|
+
MappedMutableProblogTheory.prototype.k1s = function (theory) {
|
|
2534
2534
|
var tmp0_subject = theory;
|
|
2535
2535
|
var tmp;
|
|
2536
2536
|
if (isInterface(tmp0_subject, ProblogTheory)) {
|
|
2537
|
-
tmp = this.
|
|
2537
|
+
tmp = this.p3e(theory);
|
|
2538
2538
|
} else {
|
|
2539
|
-
var tmp_0 = this.
|
|
2540
|
-
tmp = this.
|
|
2539
|
+
var tmp_0 = this.h1l();
|
|
2540
|
+
tmp = this.p3e(MappedMutableProblogTheory_init_$Create$(theory, tmp_0, null, 4, null));
|
|
2541
2541
|
}
|
|
2542
2542
|
return tmp;
|
|
2543
2543
|
};
|
|
2544
2544
|
MappedMutableProblogTheory.prototype.plusTheory = function (theory) {
|
|
2545
|
-
return this.
|
|
2545
|
+
return this.k1s(theory);
|
|
2546
2546
|
};
|
|
2547
|
-
MappedMutableProblogTheory.prototype.
|
|
2548
|
-
var mapped = ClauseMappingUtils_getInstance().
|
|
2549
|
-
return new MappedMutableProblogTheory(null, this.
|
|
2547
|
+
MappedMutableProblogTheory.prototype.y1r = function (clause) {
|
|
2548
|
+
var mapped = ClauseMappingUtils_getInstance().m3e(clause);
|
|
2549
|
+
return new MappedMutableProblogTheory(null, this.h1l(), this.o3e_1.k1s(Companion_getInstance_18().indexedOfIterable(this.h1l(), mapped)));
|
|
2550
2550
|
};
|
|
2551
2551
|
MappedMutableProblogTheory.prototype.plus = function (clause) {
|
|
2552
|
-
return this.
|
|
2552
|
+
return this.y1r(clause);
|
|
2553
2553
|
};
|
|
2554
|
-
MappedMutableProblogTheory.prototype.
|
|
2554
|
+
MappedMutableProblogTheory.prototype.o1s = function (clauses) {
|
|
2555
2555
|
var tmp$ret$2;
|
|
2556
2556
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2557
2557
|
var tmp$ret$1;
|
|
@@ -2559,22 +2559,22 @@
|
|
|
2559
2559
|
var tmp0_flatMapTo = ArrayList_init_$Create$_0();
|
|
2560
2560
|
var tmp0_iterator = clauses.j();
|
|
2561
2561
|
while (tmp0_iterator.m()) {
|
|
2562
|
-
var element = tmp0_iterator.
|
|
2562
|
+
var element = tmp0_iterator.n();
|
|
2563
2563
|
var tmp$ret$0;
|
|
2564
2564
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.MappedMutableProblogTheory.assertA.<anonymous>' call
|
|
2565
|
-
tmp$ret$0 = ClauseMappingUtils_getInstance().
|
|
2565
|
+
tmp$ret$0 = ClauseMappingUtils_getInstance().m3e(element);
|
|
2566
2566
|
var list = tmp$ret$0;
|
|
2567
2567
|
addAll(tmp0_flatMapTo, list);
|
|
2568
2568
|
}
|
|
2569
2569
|
tmp$ret$1 = tmp0_flatMapTo;
|
|
2570
2570
|
tmp$ret$2 = tmp$ret$1;
|
|
2571
2571
|
var mapped = tmp$ret$2;
|
|
2572
|
-
return new MappedMutableProblogTheory(null, this.
|
|
2572
|
+
return new MappedMutableProblogTheory(null, this.h1l(), this.o3e_1.o1s(mapped));
|
|
2573
2573
|
};
|
|
2574
2574
|
MappedMutableProblogTheory.prototype.assertAIterable = function (clauses) {
|
|
2575
|
-
return this.
|
|
2575
|
+
return this.o1s(clauses);
|
|
2576
2576
|
};
|
|
2577
|
-
MappedMutableProblogTheory.prototype.
|
|
2577
|
+
MappedMutableProblogTheory.prototype.r1s = function (clauses) {
|
|
2578
2578
|
var tmp$ret$2;
|
|
2579
2579
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2580
2580
|
var tmp$ret$1;
|
|
@@ -2582,22 +2582,22 @@
|
|
|
2582
2582
|
var tmp0_flatMapTo = ArrayList_init_$Create$_0();
|
|
2583
2583
|
var tmp0_iterator = clauses.j();
|
|
2584
2584
|
while (tmp0_iterator.m()) {
|
|
2585
|
-
var element = tmp0_iterator.
|
|
2585
|
+
var element = tmp0_iterator.n();
|
|
2586
2586
|
var tmp$ret$0;
|
|
2587
2587
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.MappedMutableProblogTheory.assertZ.<anonymous>' call
|
|
2588
|
-
tmp$ret$0 = ClauseMappingUtils_getInstance().
|
|
2588
|
+
tmp$ret$0 = ClauseMappingUtils_getInstance().m3e(element);
|
|
2589
2589
|
var list = tmp$ret$0;
|
|
2590
2590
|
addAll(tmp0_flatMapTo, list);
|
|
2591
2591
|
}
|
|
2592
2592
|
tmp$ret$1 = tmp0_flatMapTo;
|
|
2593
2593
|
tmp$ret$2 = tmp$ret$1;
|
|
2594
2594
|
var mapped = tmp$ret$2;
|
|
2595
|
-
return new MappedMutableProblogTheory(null, this.
|
|
2595
|
+
return new MappedMutableProblogTheory(null, this.h1l(), this.o3e_1.r1s(mapped));
|
|
2596
2596
|
};
|
|
2597
2597
|
MappedMutableProblogTheory.prototype.assertZIterable = function (clauses) {
|
|
2598
|
-
return this.
|
|
2598
|
+
return this.r1s(clauses);
|
|
2599
2599
|
};
|
|
2600
|
-
MappedMutableProblogTheory.prototype.
|
|
2600
|
+
MappedMutableProblogTheory.prototype.v1s = function (clauses) {
|
|
2601
2601
|
var tmp$ret$2;
|
|
2602
2602
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2603
2603
|
var tmp$ret$1;
|
|
@@ -2605,34 +2605,34 @@
|
|
|
2605
2605
|
var tmp0_flatMapTo = ArrayList_init_$Create$_0();
|
|
2606
2606
|
var tmp0_iterator = clauses.j();
|
|
2607
2607
|
while (tmp0_iterator.m()) {
|
|
2608
|
-
var element = tmp0_iterator.
|
|
2608
|
+
var element = tmp0_iterator.n();
|
|
2609
2609
|
var tmp$ret$0;
|
|
2610
2610
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.MappedMutableProblogTheory.retract.<anonymous>' call
|
|
2611
|
-
tmp$ret$0 = ClauseMappingUtils_getInstance().
|
|
2611
|
+
tmp$ret$0 = ClauseMappingUtils_getInstance().m3e(element);
|
|
2612
2612
|
var list = tmp$ret$0;
|
|
2613
2613
|
addAll(tmp0_flatMapTo, list);
|
|
2614
2614
|
}
|
|
2615
2615
|
tmp$ret$1 = tmp0_flatMapTo;
|
|
2616
2616
|
tmp$ret$2 = tmp$ret$1;
|
|
2617
2617
|
var mapped = tmp$ret$2;
|
|
2618
|
-
var result = this.
|
|
2618
|
+
var result = this.o3e_1.v1s(mapped);
|
|
2619
2619
|
var tmp;
|
|
2620
2620
|
if (result instanceof Success) {
|
|
2621
|
-
tmp = new Success(new MappedMutableProblogTheory(null, this.
|
|
2621
|
+
tmp = new Success(new MappedMutableProblogTheory(null, this.h1l(), result.e1s()), result.f1t_1);
|
|
2622
2622
|
} else {
|
|
2623
|
-
tmp = new Failure(new MappedMutableProblogTheory(null, this.
|
|
2623
|
+
tmp = new Failure(new MappedMutableProblogTheory(null, this.h1l(), result.e1s()));
|
|
2624
2624
|
}
|
|
2625
2625
|
return tmp;
|
|
2626
2626
|
};
|
|
2627
2627
|
MappedMutableProblogTheory.prototype.retractIterable = function (clauses) {
|
|
2628
|
-
return this.
|
|
2628
|
+
return this.v1s(clauses);
|
|
2629
2629
|
};
|
|
2630
|
-
MappedMutableProblogTheory.prototype.
|
|
2631
|
-
var mappedClauses = ClauseMappingUtils_getInstance().
|
|
2630
|
+
MappedMutableProblogTheory.prototype.z1l = function (clause) {
|
|
2631
|
+
var mappedClauses = ClauseMappingUtils_getInstance().m3e(clause);
|
|
2632
2632
|
var result = null;
|
|
2633
2633
|
var tmp0_iterator = mappedClauses.j();
|
|
2634
2634
|
while (tmp0_iterator.m()) {
|
|
2635
|
-
var c = tmp0_iterator.
|
|
2635
|
+
var c = tmp0_iterator.n();
|
|
2636
2636
|
var tmp;
|
|
2637
2637
|
if (result == null) {
|
|
2638
2638
|
tmp = true;
|
|
@@ -2640,16 +2640,16 @@
|
|
|
2640
2640
|
tmp = !(result instanceof Failure);
|
|
2641
2641
|
}
|
|
2642
2642
|
if (tmp) {
|
|
2643
|
-
result = this.
|
|
2643
|
+
result = this.o3e_1.z1l(c);
|
|
2644
2644
|
}
|
|
2645
2645
|
}
|
|
2646
2646
|
var tmp1_subject = result;
|
|
2647
2647
|
var tmp_0;
|
|
2648
2648
|
if (tmp1_subject instanceof Success) {
|
|
2649
|
-
tmp_0 = new Success(new MappedMutableProblogTheory(null, this.
|
|
2649
|
+
tmp_0 = new Success(new MappedMutableProblogTheory(null, this.h1l(), result.e1s()), result.f1t_1);
|
|
2650
2650
|
} else {
|
|
2651
2651
|
if (tmp1_subject instanceof Failure) {
|
|
2652
|
-
tmp_0 = new Failure(new MappedMutableProblogTheory(null, this.
|
|
2652
|
+
tmp_0 = new Failure(new MappedMutableProblogTheory(null, this.h1l(), result.e1s()));
|
|
2653
2653
|
} else {
|
|
2654
2654
|
tmp_0 = new Failure(this);
|
|
2655
2655
|
}
|
|
@@ -2657,77 +2657,77 @@
|
|
|
2657
2657
|
return tmp_0;
|
|
2658
2658
|
};
|
|
2659
2659
|
MappedMutableProblogTheory.prototype.retractAll = function (clause) {
|
|
2660
|
-
return this.
|
|
2660
|
+
return this.z1l(clause);
|
|
2661
2661
|
};
|
|
2662
|
-
MappedMutableProblogTheory.prototype.
|
|
2663
|
-
return new MappedMutableProblogTheory(null, this.
|
|
2662
|
+
MappedMutableProblogTheory.prototype.d1s = function (indicator) {
|
|
2663
|
+
return new MappedMutableProblogTheory(null, this.h1l(), this.o3e_1.d1s(ClauseMappingUtils_getInstance().n3e(indicator)));
|
|
2664
2664
|
};
|
|
2665
2665
|
MappedMutableProblogTheory.prototype.abolish = function (indicator) {
|
|
2666
|
-
return this.
|
|
2666
|
+
return this.d1s(indicator);
|
|
2667
2667
|
};
|
|
2668
|
-
MappedMutableProblogTheory.prototype.
|
|
2669
|
-
return this.
|
|
2668
|
+
MappedMutableProblogTheory.prototype.z1s = function (struct) {
|
|
2669
|
+
return this.m1s(Companion_getInstance().of(struct));
|
|
2670
2670
|
};
|
|
2671
2671
|
MappedMutableProblogTheory.prototype.assertAFact = function (struct) {
|
|
2672
|
-
return this.
|
|
2672
|
+
return this.z1s(struct);
|
|
2673
2673
|
};
|
|
2674
|
-
MappedMutableProblogTheory.prototype.
|
|
2675
|
-
return this.
|
|
2674
|
+
MappedMutableProblogTheory.prototype.a1t = function (struct) {
|
|
2675
|
+
return this.q1s(Companion_getInstance().of(struct));
|
|
2676
2676
|
};
|
|
2677
2677
|
MappedMutableProblogTheory.prototype.assertZFact = function (struct) {
|
|
2678
|
-
return this.
|
|
2678
|
+
return this.a1t(struct);
|
|
2679
2679
|
};
|
|
2680
|
-
MappedMutableProblogTheory.prototype.
|
|
2681
|
-
return this.
|
|
2680
|
+
MappedMutableProblogTheory.prototype.m1s = function (clause) {
|
|
2681
|
+
return this.o1s(listOf(clause));
|
|
2682
2682
|
};
|
|
2683
2683
|
MappedMutableProblogTheory.prototype.assertA = function (clause) {
|
|
2684
|
-
return this.
|
|
2684
|
+
return this.m1s(clause);
|
|
2685
2685
|
};
|
|
2686
|
-
MappedMutableProblogTheory.prototype.
|
|
2687
|
-
return this.
|
|
2686
|
+
MappedMutableProblogTheory.prototype.p1s = function (clauses) {
|
|
2687
|
+
return this.o1s(asIterable_0(clauses));
|
|
2688
2688
|
};
|
|
2689
2689
|
MappedMutableProblogTheory.prototype.assertASequence = function (clauses) {
|
|
2690
|
-
return this.
|
|
2690
|
+
return this.p1s(clauses);
|
|
2691
2691
|
};
|
|
2692
|
-
MappedMutableProblogTheory.prototype.
|
|
2693
|
-
return this.
|
|
2692
|
+
MappedMutableProblogTheory.prototype.q1s = function (clause) {
|
|
2693
|
+
return this.r1s(listOf(clause));
|
|
2694
2694
|
};
|
|
2695
2695
|
MappedMutableProblogTheory.prototype.assertZ = function (clause) {
|
|
2696
|
-
return this.
|
|
2696
|
+
return this.q1s(clause);
|
|
2697
2697
|
};
|
|
2698
|
-
MappedMutableProblogTheory.prototype.
|
|
2699
|
-
return this.
|
|
2698
|
+
MappedMutableProblogTheory.prototype.s1s = function (clauses) {
|
|
2699
|
+
return this.r1s(asIterable_0(clauses));
|
|
2700
2700
|
};
|
|
2701
2701
|
MappedMutableProblogTheory.prototype.assertZSequence = function (clauses) {
|
|
2702
|
-
return this.
|
|
2702
|
+
return this.s1s(clauses);
|
|
2703
2703
|
};
|
|
2704
|
-
MappedMutableProblogTheory.prototype.
|
|
2705
|
-
return this.
|
|
2704
|
+
MappedMutableProblogTheory.prototype.c1t = function (head) {
|
|
2705
|
+
return this.b1t(Companion_getInstance_12().of(head, [Companion_getInstance_1().anonymous()]));
|
|
2706
2706
|
};
|
|
2707
2707
|
MappedMutableProblogTheory.prototype.retractByHead = function (head) {
|
|
2708
|
-
return this.
|
|
2708
|
+
return this.c1t(head);
|
|
2709
2709
|
};
|
|
2710
|
-
MappedMutableProblogTheory.prototype.
|
|
2711
|
-
return this.
|
|
2710
|
+
MappedMutableProblogTheory.prototype.b1t = function (clause) {
|
|
2711
|
+
return this.v1s(listOf(clause));
|
|
2712
2712
|
};
|
|
2713
2713
|
MappedMutableProblogTheory.prototype.retract = function (clause) {
|
|
2714
|
-
return this.
|
|
2714
|
+
return this.b1t(clause);
|
|
2715
2715
|
};
|
|
2716
|
-
MappedMutableProblogTheory.prototype.
|
|
2717
|
-
return this.
|
|
2716
|
+
MappedMutableProblogTheory.prototype.u1s = function (clauses) {
|
|
2717
|
+
return this.v1s(asIterable_0(clauses));
|
|
2718
2718
|
};
|
|
2719
2719
|
MappedMutableProblogTheory.prototype.retractSequence = function (clauses) {
|
|
2720
|
-
return this.
|
|
2720
|
+
return this.u1s(clauses);
|
|
2721
2721
|
};
|
|
2722
|
-
MappedMutableProblogTheory.prototype.
|
|
2723
|
-
return this.
|
|
2722
|
+
MappedMutableProblogTheory.prototype.d1t = function (head) {
|
|
2723
|
+
return this.z1l(Companion_getInstance_12().of(head, [Companion_getInstance_1().anonymous()]));
|
|
2724
2724
|
};
|
|
2725
2725
|
MappedMutableProblogTheory.prototype.retractAllByHead = function (head) {
|
|
2726
|
-
return this.
|
|
2726
|
+
return this.d1t(head);
|
|
2727
2727
|
};
|
|
2728
2728
|
function MappedProblogTheory_init_$Init$(clauses, unificator, theory, $mask0, $marker, $this) {
|
|
2729
2729
|
if (!(($mask0 & 2) === 0))
|
|
2730
|
-
unificator = Companion_getInstance_16().
|
|
2730
|
+
unificator = Companion_getInstance_16().e1l();
|
|
2731
2731
|
if (!(($mask0 & 4) === 0)) {
|
|
2732
2732
|
var tmp = Companion_getInstance_18();
|
|
2733
2733
|
var tmp0_safe_receiver = clauses;
|
|
@@ -2744,11 +2744,11 @@
|
|
|
2744
2744
|
var tmp0_flatMapTo = ArrayList_init_$Create$_0();
|
|
2745
2745
|
var tmp0_iterator = tmp0_safe_receiver.j();
|
|
2746
2746
|
while (tmp0_iterator.m()) {
|
|
2747
|
-
var element = tmp0_iterator.
|
|
2747
|
+
var element = tmp0_iterator.n();
|
|
2748
2748
|
var tmp$ret$0;
|
|
2749
2749
|
var tmp$ret$0_0;
|
|
2750
2750
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.MappedProblogTheory.<init>.<anonymous>' call
|
|
2751
|
-
tmp$ret$0 = ClauseMappingUtils_getInstance().
|
|
2751
|
+
tmp$ret$0 = ClauseMappingUtils_getInstance().m3e(element);
|
|
2752
2752
|
tmp$ret$0_0 = Unit_getInstance();
|
|
2753
2753
|
var list = tmp$ret$0;
|
|
2754
2754
|
addAll(tmp0_flatMapTo, list);
|
|
@@ -2769,111 +2769,111 @@
|
|
|
2769
2769
|
return MappedProblogTheory_init_$Init$(clauses, unificator, theory, $mask0, $marker, Object.create(MappedProblogTheory.prototype));
|
|
2770
2770
|
}
|
|
2771
2771
|
function MappedProblogTheory(clauses, unificator, theory) {
|
|
2772
|
-
this.
|
|
2772
|
+
this.q3e_1 = theory;
|
|
2773
2773
|
}
|
|
2774
|
-
MappedProblogTheory.prototype.
|
|
2775
|
-
return this.
|
|
2774
|
+
MappedProblogTheory.prototype.q1l = function () {
|
|
2775
|
+
return this.q3e_1.q1l();
|
|
2776
2776
|
};
|
|
2777
|
-
MappedProblogTheory.prototype.
|
|
2778
|
-
return this.
|
|
2777
|
+
MappedProblogTheory.prototype.j1l = function () {
|
|
2778
|
+
return this.q3e_1.j1l();
|
|
2779
2779
|
};
|
|
2780
|
-
MappedProblogTheory.prototype.
|
|
2781
|
-
return this.
|
|
2780
|
+
MappedProblogTheory.prototype.l1l = function () {
|
|
2781
|
+
return this.q3e_1.l1l();
|
|
2782
2782
|
};
|
|
2783
|
-
MappedProblogTheory.prototype.
|
|
2784
|
-
return this.
|
|
2783
|
+
MappedProblogTheory.prototype.h1s = function () {
|
|
2784
|
+
return this.q3e_1.h1s();
|
|
2785
2785
|
};
|
|
2786
|
-
MappedProblogTheory.prototype.
|
|
2787
|
-
return this.
|
|
2786
|
+
MappedProblogTheory.prototype.p = function () {
|
|
2787
|
+
return this.q3e_1.p();
|
|
2788
2788
|
};
|
|
2789
|
-
MappedProblogTheory.prototype.
|
|
2790
|
-
return this.
|
|
2789
|
+
MappedProblogTheory.prototype.ht = function () {
|
|
2790
|
+
return this.q3e_1.ht();
|
|
2791
2791
|
};
|
|
2792
|
-
MappedProblogTheory.prototype.
|
|
2793
|
-
return this.
|
|
2792
|
+
MappedProblogTheory.prototype.h1l = function () {
|
|
2793
|
+
return this.q3e_1.h1l();
|
|
2794
2794
|
};
|
|
2795
2795
|
MappedProblogTheory.prototype.clone = function () {
|
|
2796
|
-
return this.
|
|
2796
|
+
return this.q3e_1.clone();
|
|
2797
2797
|
};
|
|
2798
2798
|
MappedProblogTheory.prototype.contains = function (clause) {
|
|
2799
|
-
return this.
|
|
2799
|
+
return this.q3e_1.contains(clause);
|
|
2800
2800
|
};
|
|
2801
2801
|
MappedProblogTheory.prototype.containsIndicator = function (indicator) {
|
|
2802
|
-
return this.
|
|
2802
|
+
return this.q3e_1.containsIndicator(indicator);
|
|
2803
2803
|
};
|
|
2804
2804
|
MappedProblogTheory.prototype.containsHead = function (head) {
|
|
2805
|
-
return this.
|
|
2805
|
+
return this.q3e_1.containsHead(head);
|
|
2806
2806
|
};
|
|
2807
2807
|
MappedProblogTheory.prototype.containsTag = function (name) {
|
|
2808
|
-
return this.
|
|
2808
|
+
return this.q3e_1.containsTag(name);
|
|
2809
2809
|
};
|
|
2810
2810
|
MappedProblogTheory.prototype.equalsUsingVarCompleteNames = function (other, useVarCompleteName) {
|
|
2811
|
-
return this.
|
|
2811
|
+
return this.q3e_1.equalsUsingVarCompleteNames(other, useVarCompleteName);
|
|
2812
2812
|
};
|
|
2813
2813
|
MappedProblogTheory.prototype.get = function (clause) {
|
|
2814
|
-
return this.
|
|
2814
|
+
return this.q3e_1.get(clause);
|
|
2815
2815
|
};
|
|
2816
2816
|
MappedProblogTheory.prototype.getByIndicator = function (indicator) {
|
|
2817
|
-
return this.
|
|
2817
|
+
return this.q3e_1.getByIndicator(indicator);
|
|
2818
2818
|
};
|
|
2819
2819
|
MappedProblogTheory.prototype.getByHead = function (head) {
|
|
2820
|
-
return this.
|
|
2820
|
+
return this.q3e_1.getByHead(head);
|
|
2821
2821
|
};
|
|
2822
2822
|
MappedProblogTheory.prototype.getTag = function (name) {
|
|
2823
|
-
return this.
|
|
2823
|
+
return this.q3e_1.getTag(name);
|
|
2824
2824
|
};
|
|
2825
2825
|
MappedProblogTheory.prototype.j = function () {
|
|
2826
|
-
return this.
|
|
2826
|
+
return this.q3e_1.j();
|
|
2827
2827
|
};
|
|
2828
2828
|
MappedProblogTheory.prototype.resetTags = function (tags) {
|
|
2829
|
-
return this.
|
|
2829
|
+
return this.q3e_1.resetTags(tags);
|
|
2830
2830
|
};
|
|
2831
2831
|
MappedProblogTheory.prototype.setUnificator = function (unificator) {
|
|
2832
|
-
return this.
|
|
2832
|
+
return this.q3e_1.setUnificator(unificator);
|
|
2833
2833
|
};
|
|
2834
2834
|
MappedProblogTheory.prototype.toStringAsProlog = function (asPrologText) {
|
|
2835
|
-
return this.
|
|
2835
|
+
return this.q3e_1.toStringAsProlog(asPrologText);
|
|
2836
2836
|
};
|
|
2837
|
-
MappedProblogTheory.prototype.
|
|
2837
|
+
MappedProblogTheory.prototype.x1s = function () {
|
|
2838
2838
|
return false;
|
|
2839
2839
|
};
|
|
2840
|
-
MappedProblogTheory.prototype.
|
|
2841
|
-
return Companion_getInstance_20().ofIterable(this.
|
|
2840
|
+
MappedProblogTheory.prototype.y1s = function () {
|
|
2841
|
+
return Companion_getInstance_20().ofIterable(this.h1l(), this);
|
|
2842
2842
|
};
|
|
2843
2843
|
MappedProblogTheory.prototype.toMutableTheory = function () {
|
|
2844
|
-
return this.
|
|
2844
|
+
return this.y1s();
|
|
2845
2845
|
};
|
|
2846
|
-
MappedProblogTheory.prototype.
|
|
2846
|
+
MappedProblogTheory.prototype.x1r = function () {
|
|
2847
2847
|
return this;
|
|
2848
2848
|
};
|
|
2849
2849
|
MappedProblogTheory.prototype.toImmutableTheory = function () {
|
|
2850
|
-
return this.
|
|
2850
|
+
return this.x1r();
|
|
2851
2851
|
};
|
|
2852
|
-
MappedProblogTheory.prototype.
|
|
2853
|
-
return new MappedProblogTheory(null, this.
|
|
2852
|
+
MappedProblogTheory.prototype.p3e = function (theory) {
|
|
2853
|
+
return new MappedProblogTheory(null, this.h1l(), this.q3e_1.plusTheory(theory));
|
|
2854
2854
|
};
|
|
2855
|
-
MappedProblogTheory.prototype.
|
|
2855
|
+
MappedProblogTheory.prototype.k1s = function (theory) {
|
|
2856
2856
|
var tmp0_subject = theory;
|
|
2857
2857
|
var tmp;
|
|
2858
2858
|
if (isInterface(tmp0_subject, ProblogTheory)) {
|
|
2859
|
-
tmp = this.
|
|
2859
|
+
tmp = this.p3e(theory);
|
|
2860
2860
|
} else {
|
|
2861
|
-
var tmp_0 = this.
|
|
2862
|
-
tmp = this.
|
|
2861
|
+
var tmp_0 = this.h1l();
|
|
2862
|
+
tmp = this.p3e(MappedProblogTheory_init_$Create$(theory, tmp_0, null, 4, null));
|
|
2863
2863
|
}
|
|
2864
2864
|
return tmp;
|
|
2865
2865
|
};
|
|
2866
2866
|
MappedProblogTheory.prototype.plusTheory = function (theory) {
|
|
2867
|
-
return this.
|
|
2867
|
+
return this.k1s(theory);
|
|
2868
2868
|
};
|
|
2869
|
-
MappedProblogTheory.prototype.
|
|
2870
|
-
var mapped = ClauseMappingUtils_getInstance().
|
|
2871
|
-
return new MappedProblogTheory(null, this.
|
|
2869
|
+
MappedProblogTheory.prototype.y1r = function (clause) {
|
|
2870
|
+
var mapped = ClauseMappingUtils_getInstance().m3e(clause);
|
|
2871
|
+
return new MappedProblogTheory(null, this.h1l(), this.q3e_1.plusTheory(Companion_getInstance_18().indexedOfIterable(this.h1l(), mapped)));
|
|
2872
2872
|
};
|
|
2873
2873
|
MappedProblogTheory.prototype.plus = function (clause) {
|
|
2874
|
-
return this.
|
|
2874
|
+
return this.y1r(clause);
|
|
2875
2875
|
};
|
|
2876
|
-
MappedProblogTheory.prototype.
|
|
2876
|
+
MappedProblogTheory.prototype.o1s = function (clauses) {
|
|
2877
2877
|
var tmp$ret$2;
|
|
2878
2878
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2879
2879
|
var tmp$ret$1;
|
|
@@ -2881,22 +2881,22 @@
|
|
|
2881
2881
|
var tmp0_flatMapTo = ArrayList_init_$Create$_0();
|
|
2882
2882
|
var tmp0_iterator = clauses.j();
|
|
2883
2883
|
while (tmp0_iterator.m()) {
|
|
2884
|
-
var element = tmp0_iterator.
|
|
2884
|
+
var element = tmp0_iterator.n();
|
|
2885
2885
|
var tmp$ret$0;
|
|
2886
2886
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.MappedProblogTheory.assertA.<anonymous>' call
|
|
2887
|
-
tmp$ret$0 = ClauseMappingUtils_getInstance().
|
|
2887
|
+
tmp$ret$0 = ClauseMappingUtils_getInstance().m3e(element);
|
|
2888
2888
|
var list = tmp$ret$0;
|
|
2889
2889
|
addAll(tmp0_flatMapTo, list);
|
|
2890
2890
|
}
|
|
2891
2891
|
tmp$ret$1 = tmp0_flatMapTo;
|
|
2892
2892
|
tmp$ret$2 = tmp$ret$1;
|
|
2893
2893
|
var mapped = tmp$ret$2;
|
|
2894
|
-
return new MappedProblogTheory(null, this.
|
|
2894
|
+
return new MappedProblogTheory(null, this.h1l(), this.q3e_1.assertAIterable(mapped));
|
|
2895
2895
|
};
|
|
2896
2896
|
MappedProblogTheory.prototype.assertAIterable = function (clauses) {
|
|
2897
|
-
return this.
|
|
2897
|
+
return this.o1s(clauses);
|
|
2898
2898
|
};
|
|
2899
|
-
MappedProblogTheory.prototype.
|
|
2899
|
+
MappedProblogTheory.prototype.r1s = function (clauses) {
|
|
2900
2900
|
var tmp$ret$2;
|
|
2901
2901
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2902
2902
|
var tmp$ret$1;
|
|
@@ -2904,22 +2904,22 @@
|
|
|
2904
2904
|
var tmp0_flatMapTo = ArrayList_init_$Create$_0();
|
|
2905
2905
|
var tmp0_iterator = clauses.j();
|
|
2906
2906
|
while (tmp0_iterator.m()) {
|
|
2907
|
-
var element = tmp0_iterator.
|
|
2907
|
+
var element = tmp0_iterator.n();
|
|
2908
2908
|
var tmp$ret$0;
|
|
2909
2909
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.MappedProblogTheory.assertZ.<anonymous>' call
|
|
2910
|
-
tmp$ret$0 = ClauseMappingUtils_getInstance().
|
|
2910
|
+
tmp$ret$0 = ClauseMappingUtils_getInstance().m3e(element);
|
|
2911
2911
|
var list = tmp$ret$0;
|
|
2912
2912
|
addAll(tmp0_flatMapTo, list);
|
|
2913
2913
|
}
|
|
2914
2914
|
tmp$ret$1 = tmp0_flatMapTo;
|
|
2915
2915
|
tmp$ret$2 = tmp$ret$1;
|
|
2916
2916
|
var mapped = tmp$ret$2;
|
|
2917
|
-
return new MappedProblogTheory(null, this.
|
|
2917
|
+
return new MappedProblogTheory(null, this.h1l(), this.q3e_1.assertZIterable(mapped));
|
|
2918
2918
|
};
|
|
2919
2919
|
MappedProblogTheory.prototype.assertZIterable = function (clauses) {
|
|
2920
|
-
return this.
|
|
2920
|
+
return this.r1s(clauses);
|
|
2921
2921
|
};
|
|
2922
|
-
MappedProblogTheory.prototype.
|
|
2922
|
+
MappedProblogTheory.prototype.v1s = function (clauses) {
|
|
2923
2923
|
var tmp$ret$2;
|
|
2924
2924
|
// Inline function 'kotlin.collections.flatMap' call
|
|
2925
2925
|
var tmp$ret$1;
|
|
@@ -2927,34 +2927,34 @@
|
|
|
2927
2927
|
var tmp0_flatMapTo = ArrayList_init_$Create$_0();
|
|
2928
2928
|
var tmp0_iterator = clauses.j();
|
|
2929
2929
|
while (tmp0_iterator.m()) {
|
|
2930
|
-
var element = tmp0_iterator.
|
|
2930
|
+
var element = tmp0_iterator.n();
|
|
2931
2931
|
var tmp$ret$0;
|
|
2932
2932
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.knowledge.impl.MappedProblogTheory.retract.<anonymous>' call
|
|
2933
|
-
tmp$ret$0 = ClauseMappingUtils_getInstance().
|
|
2933
|
+
tmp$ret$0 = ClauseMappingUtils_getInstance().m3e(element);
|
|
2934
2934
|
var list = tmp$ret$0;
|
|
2935
2935
|
addAll(tmp0_flatMapTo, list);
|
|
2936
2936
|
}
|
|
2937
2937
|
tmp$ret$1 = tmp0_flatMapTo;
|
|
2938
2938
|
tmp$ret$2 = tmp$ret$1;
|
|
2939
2939
|
var mapped = tmp$ret$2;
|
|
2940
|
-
var result = this.
|
|
2940
|
+
var result = this.q3e_1.retractIterable(mapped);
|
|
2941
2941
|
var tmp;
|
|
2942
2942
|
if (result instanceof Success) {
|
|
2943
|
-
tmp = new Success(new MappedProblogTheory(null, this.
|
|
2943
|
+
tmp = new Success(new MappedProblogTheory(null, this.h1l(), result.e1s()), result.f1t_1);
|
|
2944
2944
|
} else {
|
|
2945
|
-
tmp = new Failure(new MappedProblogTheory(null, this.
|
|
2945
|
+
tmp = new Failure(new MappedProblogTheory(null, this.h1l(), result.e1s()));
|
|
2946
2946
|
}
|
|
2947
2947
|
return tmp;
|
|
2948
2948
|
};
|
|
2949
2949
|
MappedProblogTheory.prototype.retractIterable = function (clauses) {
|
|
2950
|
-
return this.
|
|
2950
|
+
return this.v1s(clauses);
|
|
2951
2951
|
};
|
|
2952
|
-
MappedProblogTheory.prototype.
|
|
2953
|
-
var mappedClauses = ClauseMappingUtils_getInstance().
|
|
2952
|
+
MappedProblogTheory.prototype.z1l = function (clause) {
|
|
2953
|
+
var mappedClauses = ClauseMappingUtils_getInstance().m3e(clause);
|
|
2954
2954
|
var result = null;
|
|
2955
2955
|
var tmp0_iterator = mappedClauses.j();
|
|
2956
2956
|
while (tmp0_iterator.m()) {
|
|
2957
|
-
var c = tmp0_iterator.
|
|
2957
|
+
var c = tmp0_iterator.n();
|
|
2958
2958
|
var tmp;
|
|
2959
2959
|
if (result == null) {
|
|
2960
2960
|
tmp = true;
|
|
@@ -2962,94 +2962,94 @@
|
|
|
2962
2962
|
tmp = !(result instanceof Failure);
|
|
2963
2963
|
}
|
|
2964
2964
|
if (tmp) {
|
|
2965
|
-
result = this.
|
|
2965
|
+
result = this.q3e_1.retractAll(c);
|
|
2966
2966
|
}
|
|
2967
2967
|
}
|
|
2968
2968
|
var tmp1_subject = result;
|
|
2969
2969
|
var tmp_0;
|
|
2970
2970
|
if (tmp1_subject instanceof Success) {
|
|
2971
|
-
tmp_0 = new Success(new MappedProblogTheory(null, this.
|
|
2971
|
+
tmp_0 = new Success(new MappedProblogTheory(null, this.h1l(), result.e1s()), result.f1t_1);
|
|
2972
2972
|
} else {
|
|
2973
2973
|
tmp_0 = new Failure(this);
|
|
2974
2974
|
}
|
|
2975
2975
|
return tmp_0;
|
|
2976
2976
|
};
|
|
2977
2977
|
MappedProblogTheory.prototype.retractAll = function (clause) {
|
|
2978
|
-
return this.
|
|
2978
|
+
return this.z1l(clause);
|
|
2979
2979
|
};
|
|
2980
|
-
MappedProblogTheory.prototype.
|
|
2981
|
-
return new MappedProblogTheory(null, this.
|
|
2980
|
+
MappedProblogTheory.prototype.d1s = function (indicator) {
|
|
2981
|
+
return new MappedProblogTheory(null, this.h1l(), this.q3e_1.abolish(ClauseMappingUtils_getInstance().n3e(indicator)));
|
|
2982
2982
|
};
|
|
2983
2983
|
MappedProblogTheory.prototype.abolish = function (indicator) {
|
|
2984
|
-
return this.
|
|
2984
|
+
return this.d1s(indicator);
|
|
2985
2985
|
};
|
|
2986
|
-
MappedProblogTheory.prototype.
|
|
2987
|
-
return this.
|
|
2986
|
+
MappedProblogTheory.prototype.z1s = function (struct) {
|
|
2987
|
+
return this.m1s(Companion_getInstance().of(struct));
|
|
2988
2988
|
};
|
|
2989
2989
|
MappedProblogTheory.prototype.assertAFact = function (struct) {
|
|
2990
|
-
return this.
|
|
2990
|
+
return this.z1s(struct);
|
|
2991
2991
|
};
|
|
2992
|
-
MappedProblogTheory.prototype.
|
|
2993
|
-
return this.
|
|
2992
|
+
MappedProblogTheory.prototype.a1t = function (struct) {
|
|
2993
|
+
return this.q1s(Companion_getInstance().of(struct));
|
|
2994
2994
|
};
|
|
2995
2995
|
MappedProblogTheory.prototype.assertZFact = function (struct) {
|
|
2996
|
-
return this.
|
|
2996
|
+
return this.a1t(struct);
|
|
2997
2997
|
};
|
|
2998
|
-
MappedProblogTheory.prototype.
|
|
2999
|
-
return this.
|
|
2998
|
+
MappedProblogTheory.prototype.m1s = function (clause) {
|
|
2999
|
+
return this.o1s(listOf(clause));
|
|
3000
3000
|
};
|
|
3001
3001
|
MappedProblogTheory.prototype.assertA = function (clause) {
|
|
3002
|
-
return this.
|
|
3002
|
+
return this.m1s(clause);
|
|
3003
3003
|
};
|
|
3004
|
-
MappedProblogTheory.prototype.
|
|
3005
|
-
return this.
|
|
3004
|
+
MappedProblogTheory.prototype.p1s = function (clauses) {
|
|
3005
|
+
return this.o1s(asIterable_0(clauses));
|
|
3006
3006
|
};
|
|
3007
3007
|
MappedProblogTheory.prototype.assertASequence = function (clauses) {
|
|
3008
|
-
return this.
|
|
3008
|
+
return this.p1s(clauses);
|
|
3009
3009
|
};
|
|
3010
|
-
MappedProblogTheory.prototype.
|
|
3011
|
-
return this.
|
|
3010
|
+
MappedProblogTheory.prototype.q1s = function (clause) {
|
|
3011
|
+
return this.r1s(listOf(clause));
|
|
3012
3012
|
};
|
|
3013
3013
|
MappedProblogTheory.prototype.assertZ = function (clause) {
|
|
3014
|
-
return this.
|
|
3014
|
+
return this.q1s(clause);
|
|
3015
3015
|
};
|
|
3016
|
-
MappedProblogTheory.prototype.
|
|
3017
|
-
return this.
|
|
3016
|
+
MappedProblogTheory.prototype.s1s = function (clauses) {
|
|
3017
|
+
return this.r1s(asIterable_0(clauses));
|
|
3018
3018
|
};
|
|
3019
3019
|
MappedProblogTheory.prototype.assertZSequence = function (clauses) {
|
|
3020
|
-
return this.
|
|
3020
|
+
return this.s1s(clauses);
|
|
3021
3021
|
};
|
|
3022
|
-
MappedProblogTheory.prototype.
|
|
3023
|
-
return this.
|
|
3022
|
+
MappedProblogTheory.prototype.c1t = function (head) {
|
|
3023
|
+
return this.b1t(Companion_getInstance_12().of(head, [Companion_getInstance_1().anonymous()]));
|
|
3024
3024
|
};
|
|
3025
3025
|
MappedProblogTheory.prototype.retractByHead = function (head) {
|
|
3026
|
-
return this.
|
|
3026
|
+
return this.c1t(head);
|
|
3027
3027
|
};
|
|
3028
|
-
MappedProblogTheory.prototype.
|
|
3029
|
-
return this.
|
|
3028
|
+
MappedProblogTheory.prototype.b1t = function (clause) {
|
|
3029
|
+
return this.v1s(listOf(clause));
|
|
3030
3030
|
};
|
|
3031
3031
|
MappedProblogTheory.prototype.retract = function (clause) {
|
|
3032
|
-
return this.
|
|
3032
|
+
return this.b1t(clause);
|
|
3033
3033
|
};
|
|
3034
|
-
MappedProblogTheory.prototype.
|
|
3035
|
-
return this.
|
|
3034
|
+
MappedProblogTheory.prototype.u1s = function (clauses) {
|
|
3035
|
+
return this.v1s(asIterable_0(clauses));
|
|
3036
3036
|
};
|
|
3037
3037
|
MappedProblogTheory.prototype.retractSequence = function (clauses) {
|
|
3038
|
-
return this.
|
|
3038
|
+
return this.u1s(clauses);
|
|
3039
3039
|
};
|
|
3040
|
-
MappedProblogTheory.prototype.
|
|
3041
|
-
return this.
|
|
3040
|
+
MappedProblogTheory.prototype.d1t = function (head) {
|
|
3041
|
+
return this.z1l(Companion_getInstance_12().of(head, [Companion_getInstance_1().anonymous()]));
|
|
3042
3042
|
};
|
|
3043
3043
|
MappedProblogTheory.prototype.retractAllByHead = function (head) {
|
|
3044
|
-
return this.
|
|
3044
|
+
return this.d1t(head);
|
|
3045
3045
|
};
|
|
3046
3046
|
function NothingClauseMapper() {
|
|
3047
3047
|
NothingClauseMapper_instance = this;
|
|
3048
3048
|
}
|
|
3049
|
-
NothingClauseMapper.prototype.
|
|
3049
|
+
NothingClauseMapper.prototype.a3e = function (clause) {
|
|
3050
3050
|
return true;
|
|
3051
3051
|
};
|
|
3052
|
-
NothingClauseMapper.prototype.
|
|
3052
|
+
NothingClauseMapper.prototype.b3e = function (clause) {
|
|
3053
3053
|
return listOf(clause);
|
|
3054
3054
|
};
|
|
3055
3055
|
var NothingClauseMapper_instance;
|
|
@@ -3061,60 +3061,60 @@
|
|
|
3061
3061
|
function ProbabilisticClauseMapper() {
|
|
3062
3062
|
ProbabilisticClauseMapper_instance = this;
|
|
3063
3063
|
}
|
|
3064
|
-
ProbabilisticClauseMapper.prototype.
|
|
3064
|
+
ProbabilisticClauseMapper.prototype.a3e = function (clause) {
|
|
3065
3065
|
var tmp;
|
|
3066
3066
|
if (isInterface(clause, Rule)) {
|
|
3067
|
-
tmp = clause.
|
|
3067
|
+
tmp = clause.iy().cw() === get_ANNOTATION_FUNCTOR();
|
|
3068
3068
|
} else {
|
|
3069
3069
|
tmp = false;
|
|
3070
3070
|
}
|
|
3071
3071
|
return tmp;
|
|
3072
3072
|
};
|
|
3073
|
-
ProbabilisticClauseMapper.prototype.
|
|
3073
|
+
ProbabilisticClauseMapper.prototype.b3e = function (clause) {
|
|
3074
3074
|
if (!isInterface(clause, Rule)) {
|
|
3075
3075
|
var tmp = 'Clause is not an instance of Rule: ' + clause;
|
|
3076
3076
|
throw ClauseMappingException_init_$Create$(tmp, null, 2, null);
|
|
3077
3077
|
}
|
|
3078
|
-
var mapped = this.
|
|
3079
|
-
return listOf(this.
|
|
3078
|
+
var mapped = this.c3e(clause);
|
|
3079
|
+
return listOf(this.d3e(mapped.g4_1, Companion_getInstance_21().p3d(mapped.h4_1)));
|
|
3080
3080
|
};
|
|
3081
|
-
ProbabilisticClauseMapper.prototype.
|
|
3082
|
-
if (!(rule.
|
|
3083
|
-
throw TuPrologException_init_$Create$('Invalid probabilistic rule: ' + rule.
|
|
3081
|
+
ProbabilisticClauseMapper.prototype.c3e = function (rule) {
|
|
3082
|
+
if (!(rule.iy().wv() === 2)) {
|
|
3083
|
+
throw TuPrologException_init_$Create$('Invalid probabilistic rule: ' + rule.iy());
|
|
3084
3084
|
}
|
|
3085
|
-
var probTerm = rule.
|
|
3085
|
+
var probTerm = rule.iy().get(0);
|
|
3086
3086
|
var tmp;
|
|
3087
3087
|
if (isInterface(probTerm, Numeric)) {
|
|
3088
|
-
tmp = probTerm.
|
|
3088
|
+
tmp = probTerm.u10().toDouble();
|
|
3089
3089
|
} else {
|
|
3090
3090
|
tmp = solveArithmeticExpression(probTerm);
|
|
3091
3091
|
}
|
|
3092
3092
|
var probability = tmp;
|
|
3093
|
-
var headTerm = safeToStruct(rule.
|
|
3094
|
-
var tmp_0 = headTerm.
|
|
3093
|
+
var headTerm = safeToStruct(rule.iy().get(1));
|
|
3094
|
+
var tmp_0 = headTerm.cw();
|
|
3095
3095
|
ProblogLib_getInstance();
|
|
3096
3096
|
if (tmp_0 === 'evidence') {
|
|
3097
|
-
throw TuPrologException_init_$Create$("Probability notation can't be expressed on evidence: " + rule.
|
|
3097
|
+
throw TuPrologException_init_$Create$("Probability notation can't be expressed on evidence: " + rule.iy());
|
|
3098
3098
|
}
|
|
3099
|
-
var bodyTerm = rule.
|
|
3100
|
-
var tmp_1 = rule.
|
|
3099
|
+
var bodyTerm = rule.jy();
|
|
3100
|
+
var tmp_1 = rule.jy();
|
|
3101
3101
|
if (isInterface(tmp_1, Truth)) {
|
|
3102
|
-
if (!rule.
|
|
3102
|
+
if (!rule.jy().aw() ? probability < 1.0 : false) {
|
|
3103
3103
|
probability = 1.0 - probability;
|
|
3104
3104
|
bodyTerm = Companion_getInstance_15().of(true);
|
|
3105
3105
|
}
|
|
3106
3106
|
}
|
|
3107
3107
|
var anonVariablesFix = withoutAnonymousVars(Companion_getInstance_12().of(headTerm, [bodyTerm]));
|
|
3108
|
-
headTerm = anonVariablesFix.
|
|
3109
|
-
bodyTerm = anonVariablesFix.
|
|
3108
|
+
headTerm = anonVariablesFix.iy();
|
|
3109
|
+
bodyTerm = anonVariablesFix.jy();
|
|
3110
3110
|
var extraVariables = get_extraVariables(Companion_getInstance_12().of(headTerm, [bodyTerm]));
|
|
3111
|
-
var probTerm_0 = new ProbTerm(ClauseMappingUtils_getInstance().
|
|
3111
|
+
var probTerm_0 = new ProbTerm(ClauseMappingUtils_getInstance().l3e(), probability, headTerm, extraVariables);
|
|
3112
3112
|
return new Pair(Companion_getInstance_12().of(headTerm, [bodyTerm]), probTerm_0);
|
|
3113
3113
|
};
|
|
3114
|
-
ProbabilisticClauseMapper.prototype.
|
|
3115
|
-
var tmp = rule.
|
|
3114
|
+
ProbabilisticClauseMapper.prototype.d3e = function (rule, explanation) {
|
|
3115
|
+
var tmp = rule.jy();
|
|
3116
3116
|
if (isInterface(tmp, Truth)) {
|
|
3117
|
-
return Companion_getInstance_12().of(withExplanation(rule.
|
|
3117
|
+
return Companion_getInstance_12().of(withExplanation(rule.iy(), toTerm(explanation)), [rule.jy()]);
|
|
3118
3118
|
}
|
|
3119
3119
|
var tmp_0 = Companion_getInstance_1();
|
|
3120
3120
|
ProblogLib_getInstance();
|
|
@@ -3122,9 +3122,9 @@
|
|
|
3122
3122
|
var tmp_1 = Companion_getInstance_1();
|
|
3123
3123
|
ProblogLib_getInstance();
|
|
3124
3124
|
var explanationBodyVar = tmp_1.of('EXPL' + '_Body');
|
|
3125
|
-
var newBody = withBodyExplanation(rule.
|
|
3125
|
+
var newBody = withBodyExplanation(rule.jy(), explanationBodyVar);
|
|
3126
3126
|
var tmp_2 = Companion_getInstance_12();
|
|
3127
|
-
var tmp_3 = withExplanation(rule.
|
|
3127
|
+
var tmp_3 = withExplanation(rule.iy(), explanationVar);
|
|
3128
3128
|
var tmp_4 = Companion_getInstance_3();
|
|
3129
3129
|
var tmp_5 = Companion_getInstance_3();
|
|
3130
3130
|
var tmp$ret$0;
|
|
@@ -3142,22 +3142,22 @@
|
|
|
3142
3142
|
function PrologClauseMapper() {
|
|
3143
3143
|
PrologClauseMapper_instance = this;
|
|
3144
3144
|
}
|
|
3145
|
-
PrologClauseMapper.prototype.
|
|
3145
|
+
PrologClauseMapper.prototype.a3e = function (clause) {
|
|
3146
3146
|
return isInterface(clause, Rule);
|
|
3147
3147
|
};
|
|
3148
|
-
PrologClauseMapper.prototype.
|
|
3148
|
+
PrologClauseMapper.prototype.b3e = function (clause) {
|
|
3149
3149
|
if (!isInterface(clause, Rule)) {
|
|
3150
3150
|
var tmp = 'Clause is not an instance of Rule: ' + clause;
|
|
3151
3151
|
throw ClauseMappingException_init_$Create$(tmp, null, 2, null);
|
|
3152
3152
|
}
|
|
3153
|
-
var tmp_0 = clause.
|
|
3153
|
+
var tmp_0 = clause.jy();
|
|
3154
3154
|
if (isInterface(tmp_0, Truth)) {
|
|
3155
|
-
return listOf(Companion_getInstance_12().of(withExplanation(clause.
|
|
3155
|
+
return listOf(Companion_getInstance_12().of(withExplanation(clause.iy(), toTerm(Companion_getInstance_21().l3d_1)), [clause.jy()]));
|
|
3156
3156
|
}
|
|
3157
3157
|
var tmp_1 = Companion_getInstance_1();
|
|
3158
3158
|
ProblogLib_getInstance();
|
|
3159
3159
|
var explanationVar = tmp_1.of('EXPL' + '_Res');
|
|
3160
|
-
return listOf(Companion_getInstance_12().of(withExplanation(clause.
|
|
3160
|
+
return listOf(Companion_getInstance_12().of(withExplanation(clause.iy(), explanationVar), [withBodyExplanation(clause.jy(), explanationVar)]));
|
|
3161
3161
|
};
|
|
3162
3162
|
var PrologClauseMapper_instance;
|
|
3163
3163
|
function PrologClauseMapper_getInstance() {
|
|
@@ -3170,12 +3170,12 @@
|
|
|
3170
3170
|
ProblogLib_getInstance();
|
|
3171
3171
|
NonBacktrackable.call(this, 'prob' + '_expl_and');
|
|
3172
3172
|
}
|
|
3173
|
-
ProbExplAnd.prototype.
|
|
3174
|
-
Companion_getInstance_19().
|
|
3175
|
-
Companion_getInstance_19().
|
|
3176
|
-
if (ProbSetConfig_getInstance().
|
|
3177
|
-
var tmp = Companion_getInstance_19().
|
|
3178
|
-
return _this__u8e3s4.
|
|
3173
|
+
ProbExplAnd.prototype.z2r = function (_this__u8e3s4, first, second, third) {
|
|
3174
|
+
Companion_getInstance_19().h2h(_this__u8e3s4, 1);
|
|
3175
|
+
Companion_getInstance_19().n2h(_this__u8e3s4, 1);
|
|
3176
|
+
if (ProbSetConfig_getInstance().s3e(_this__u8e3s4.context)) {
|
|
3177
|
+
var tmp = Companion_getInstance_19().b2h(_this__u8e3s4, first, toTerm(Companion_getInstance_21().l3d_1));
|
|
3178
|
+
return _this__u8e3s4.g2g(tmp, null, [], 6, null);
|
|
3179
3179
|
}
|
|
3180
3180
|
var tmp_0;
|
|
3181
3181
|
var tmp_1;
|
|
@@ -3191,13 +3191,13 @@
|
|
|
3191
3191
|
tmp_1 = false;
|
|
3192
3192
|
}
|
|
3193
3193
|
if (tmp_1) {
|
|
3194
|
-
var explanation = (second.
|
|
3194
|
+
var explanation = (second.h3c_1.x3d() === 0.0 ? true : third.h3c_1.x3d() === 0.0) ? Companion_getInstance_21().k3d_1 : (second.h3c_1.x3d() === 1.0 ? third.h3c_1.x3d() === 1.0 : false) ? Companion_getInstance_21().l3d_1 : second.h3c_1.x3d() === 1.0 ? third.h3c_1 : third.h3c_1.x3d() === 1.0 ? second.h3c_1 : second.h3c_1.and(third.h3c_1);
|
|
3195
3195
|
var tmp_3;
|
|
3196
|
-
if (explanation.
|
|
3197
|
-
tmp_3 = _this__u8e3s4.
|
|
3196
|
+
if (explanation.x3d() === 0.0) {
|
|
3197
|
+
tmp_3 = _this__u8e3s4.y2i(false, null, [], 6, null);
|
|
3198
3198
|
} else {
|
|
3199
|
-
var tmp_4 = Companion_getInstance_19().
|
|
3200
|
-
tmp_3 = _this__u8e3s4.
|
|
3199
|
+
var tmp_4 = Companion_getInstance_19().b2h(_this__u8e3s4, first, new ProbExplanationTerm(explanation));
|
|
3200
|
+
tmp_3 = _this__u8e3s4.g2g(tmp_4, null, [], 6, null);
|
|
3201
3201
|
}
|
|
3202
3202
|
tmp_0 = tmp_3;
|
|
3203
3203
|
} else {
|
|
@@ -3206,12 +3206,12 @@
|
|
|
3206
3206
|
tmp$ret$0 = this.signature.name;
|
|
3207
3207
|
var tmp_5 = "Can't compute " + tmp$ret$0;
|
|
3208
3208
|
var tmp_6 = ResolutionException_init_$Create$(tmp_5, null, _this__u8e3s4.context, [], 10, null);
|
|
3209
|
-
tmp_0 = _this__u8e3s4.
|
|
3209
|
+
tmp_0 = _this__u8e3s4.c2j(tmp_6, null, [], 6, null);
|
|
3210
3210
|
}
|
|
3211
3211
|
return tmp_0;
|
|
3212
3212
|
};
|
|
3213
|
-
ProbExplAnd.prototype.
|
|
3214
|
-
return this.
|
|
3213
|
+
ProbExplAnd.prototype.r2j = function (_this__u8e3s4, first, second, third) {
|
|
3214
|
+
return this.z2r(_this__u8e3s4, first, second, third);
|
|
3215
3215
|
};
|
|
3216
3216
|
var ProbExplAnd_instance;
|
|
3217
3217
|
function ProbExplAnd_getInstance() {
|
|
@@ -3220,179 +3220,179 @@
|
|
|
3220
3220
|
return ProbExplAnd_instance;
|
|
3221
3221
|
}
|
|
3222
3222
|
function ProbHelper$computeAllSubstitutions$slambda($goal, $this_computeAllSubstitutions, $third, $first, $second, $goalSignature, resultContinuation) {
|
|
3223
|
-
this.
|
|
3224
|
-
this.
|
|
3225
|
-
this.
|
|
3226
|
-
this.
|
|
3227
|
-
this.
|
|
3228
|
-
this.
|
|
3223
|
+
this.b3f_1 = $goal;
|
|
3224
|
+
this.c3f_1 = $this_computeAllSubstitutions;
|
|
3225
|
+
this.d3f_1 = $third;
|
|
3226
|
+
this.e3f_1 = $first;
|
|
3227
|
+
this.f3f_1 = $second;
|
|
3228
|
+
this.g3f_1 = $goalSignature;
|
|
3229
3229
|
CoroutineImpl.call(this, resultContinuation);
|
|
3230
3230
|
}
|
|
3231
|
-
ProbHelper$computeAllSubstitutions$slambda.prototype.
|
|
3232
|
-
var tmp = this.
|
|
3233
|
-
tmp.
|
|
3234
|
-
tmp.
|
|
3235
|
-
return tmp.
|
|
3231
|
+
ProbHelper$computeAllSubstitutions$slambda.prototype.t2t = function ($this$sequence, $cont) {
|
|
3232
|
+
var tmp = this.u2t($this$sequence, $cont);
|
|
3233
|
+
tmp.bi_1 = Unit_getInstance();
|
|
3234
|
+
tmp.ci_1 = null;
|
|
3235
|
+
return tmp.hi();
|
|
3236
3236
|
};
|
|
3237
|
-
ProbHelper$computeAllSubstitutions$slambda.prototype.
|
|
3238
|
-
return this.
|
|
3237
|
+
ProbHelper$computeAllSubstitutions$slambda.prototype.ti = function (p1, $cont) {
|
|
3238
|
+
return this.t2t(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
3239
3239
|
};
|
|
3240
|
-
ProbHelper$computeAllSubstitutions$slambda.prototype.
|
|
3241
|
-
var suspendResult = this.
|
|
3240
|
+
ProbHelper$computeAllSubstitutions$slambda.prototype.hi = function () {
|
|
3241
|
+
var suspendResult = this.bi_1;
|
|
3242
3242
|
$sm: do
|
|
3243
3243
|
try {
|
|
3244
|
-
var tmp = this.
|
|
3244
|
+
var tmp = this.zh_1;
|
|
3245
3245
|
switch (tmp) {
|
|
3246
3246
|
case 0:
|
|
3247
|
-
this.
|
|
3248
|
-
this.
|
|
3249
|
-
if (this.
|
|
3250
|
-
this.
|
|
3247
|
+
this.ai_1 = 18;
|
|
3248
|
+
this.i3f_1 = this.b3f_1.cw();
|
|
3249
|
+
if (this.i3f_1 === '\\+' ? true : this.i3f_1 === 'not') {
|
|
3250
|
+
this.zh_1 = 16;
|
|
3251
3251
|
var tmp_0;
|
|
3252
|
-
if (ProbSetConfig_getInstance().
|
|
3252
|
+
if (ProbSetConfig_getInstance().s3e(this.c3f_1.context)) {
|
|
3253
3253
|
var tmp_1 = Companion_getInstance_19();
|
|
3254
3254
|
var tmp_2 = Companion_getInstance_3();
|
|
3255
|
-
var tmp_3 = this.
|
|
3255
|
+
var tmp_3 = this.b3f_1.cw();
|
|
3256
3256
|
var tmp_4 = Companion_getInstance_3();
|
|
3257
3257
|
var tmp0__get_functor__thl4dk = Prob_getInstance();
|
|
3258
|
-
tmp_0 = tmp_1.
|
|
3258
|
+
tmp_0 = tmp_1.b2h(this.c3f_1, this.d3f_1, tmp_2.of(tmp_3, [tmp_4.of(tmp0__get_functor__thl4dk.signature.name, [Companion_getInstance_1().anonymous(), this.b3f_1.get(0)])])).plus(Companion_getInstance_19().b2h(this.c3f_1, this.e3f_1, toTerm(Companion_getInstance_21().l3d_1)));
|
|
3259
3259
|
} else {
|
|
3260
3260
|
var tmp_5 = Companion_getInstance_19();
|
|
3261
3261
|
var tmp_6 = Companion_getInstance_3();
|
|
3262
3262
|
var tmp1__get_functor__4k11yf = ProbNegationAsFailure_getInstance();
|
|
3263
|
-
tmp_0 = tmp_5.
|
|
3263
|
+
tmp_0 = tmp_5.b2h(this.c3f_1, this.d3f_1, tmp_6.of(tmp1__get_functor__4k11yf.signature.name, [this.e3f_1, this.b3f_1.get(0)]));
|
|
3264
3264
|
}
|
|
3265
|
-
suspendResult = this.
|
|
3265
|
+
suspendResult = this.h3f_1.z4(tmp_0, this);
|
|
3266
3266
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3267
3267
|
return suspendResult;
|
|
3268
3268
|
}
|
|
3269
3269
|
continue $sm;
|
|
3270
3270
|
} else {
|
|
3271
|
-
if ((this.
|
|
3272
|
-
this.
|
|
3271
|
+
if ((this.i3f_1 === ',' ? true : this.i3f_1 === ';') ? true : this.i3f_1 === '->') {
|
|
3272
|
+
this.zh_1 = 15;
|
|
3273
3273
|
var tmp_7;
|
|
3274
|
-
if (ProbSetConfig_getInstance().
|
|
3275
|
-
tmp_7 = Companion_getInstance_19().
|
|
3274
|
+
if (ProbSetConfig_getInstance().s3e(this.c3f_1.context)) {
|
|
3275
|
+
tmp_7 = Companion_getInstance_19().b2h(this.c3f_1, this.d3f_1, withBodyExplanation(this.b3f_1, Companion_getInstance_1().anonymous())).plus(Companion_getInstance_19().b2h(this.c3f_1, this.e3f_1, toTerm(Companion_getInstance_21().l3d_1)));
|
|
3276
3276
|
} else {
|
|
3277
|
-
tmp_7 = Companion_getInstance_19().
|
|
3277
|
+
tmp_7 = Companion_getInstance_19().b2h(this.c3f_1, this.d3f_1, withBodyExplanation(this.b3f_1, this.e3f_1));
|
|
3278
3278
|
}
|
|
3279
|
-
suspendResult = this.
|
|
3279
|
+
suspendResult = this.h3f_1.z4(tmp_7, this);
|
|
3280
3280
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3281
3281
|
return suspendResult;
|
|
3282
3282
|
}
|
|
3283
3283
|
continue $sm;
|
|
3284
3284
|
} else {
|
|
3285
|
-
if (this.
|
|
3286
|
-
this.
|
|
3287
|
-
this.
|
|
3288
|
-
suspendResult = this.
|
|
3285
|
+
if (this.i3f_1 === 'call') {
|
|
3286
|
+
this.j3f_1 = this.b3f_1.get(0);
|
|
3287
|
+
this.zh_1 = 14;
|
|
3288
|
+
suspendResult = this.h3f_1.z4(Companion_getInstance_19().b2h(this.c3f_1, this.d3f_1, Companion_getInstance_2().of(Companion_getInstance_3().of('ensure_executable', [this.j3f_1]), Companion_getInstance_3().of(this.b3f_1.cw(), [withBodyExplanation(this.j3f_1, this.e3f_1)]))), this);
|
|
3289
3289
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3290
3290
|
return suspendResult;
|
|
3291
3291
|
}
|
|
3292
3292
|
continue $sm;
|
|
3293
3293
|
} else {
|
|
3294
|
-
if (this.
|
|
3295
|
-
this.
|
|
3296
|
-
suspendResult = this.
|
|
3294
|
+
if (this.i3f_1 === 'catch') {
|
|
3295
|
+
this.zh_1 = 13;
|
|
3296
|
+
suspendResult = this.h3f_1.z4(Companion_getInstance_19().b2h(this.c3f_1, this.d3f_1, Companion_getInstance_3().of(this.b3f_1.cw(), [withBodyExplanation(this.b3f_1.get(0), this.e3f_1), this.b3f_1.get(1), withBodyExplanation(this.b3f_1.get(2), this.e3f_1)])), this);
|
|
3297
3297
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3298
3298
|
return suspendResult;
|
|
3299
3299
|
}
|
|
3300
3300
|
continue $sm;
|
|
3301
3301
|
} else {
|
|
3302
|
-
if (this.
|
|
3302
|
+
if (this.i3f_1 === 'findall') {
|
|
3303
3303
|
var tmp_8 = this;
|
|
3304
|
-
var tmp2_toTypedArray = this.
|
|
3305
|
-
tmp_8.
|
|
3306
|
-
this.
|
|
3307
|
-
this.
|
|
3308
|
-
suspendResult = this.
|
|
3304
|
+
var tmp2_toTypedArray = this.b3f_1.dw();
|
|
3305
|
+
tmp_8.k3f_1 = copyToArray(tmp2_toTypedArray);
|
|
3306
|
+
this.k3f_1[1] = withBodyExplanation(this.k3f_1[1], Companion_getInstance_1().anonymous());
|
|
3307
|
+
this.zh_1 = 12;
|
|
3308
|
+
suspendResult = this.h3f_1.z4(Companion_getInstance_19().b2h(this.c3f_1, this.d3f_1, Companion_getInstance_3().of(this.b3f_1.cw(), this.k3f_1.slice())).plus(Companion_getInstance_19().b2h(this.c3f_1, this.e3f_1, toTerm(Companion_getInstance_21().l3d_1))), this);
|
|
3309
3309
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3310
3310
|
return suspendResult;
|
|
3311
3311
|
}
|
|
3312
3312
|
continue $sm;
|
|
3313
3313
|
} else {
|
|
3314
|
-
if ((this.
|
|
3315
|
-
this.
|
|
3314
|
+
if ((this.i3f_1 === 'assert' ? true : this.i3f_1 === 'asserta') ? true : this.i3f_1 === 'assertz') {
|
|
3315
|
+
this.l3f_1 = this.b3f_1.get(0);
|
|
3316
3316
|
var tmp_9 = this;
|
|
3317
|
-
var tmp1_subject = this.
|
|
3317
|
+
var tmp1_subject = this.l3f_1;
|
|
3318
3318
|
var tmp_10;
|
|
3319
3319
|
if (isInterface(tmp1_subject, Clause)) {
|
|
3320
|
-
tmp_10 = extractSignature(ensureNotNull(this.
|
|
3320
|
+
tmp_10 = extractSignature(ensureNotNull(this.l3f_1.iy()));
|
|
3321
3321
|
} else {
|
|
3322
|
-
tmp_10 = extractSignature(safeToStruct(this.
|
|
3322
|
+
tmp_10 = extractSignature(safeToStruct(this.l3f_1));
|
|
3323
3323
|
}
|
|
3324
|
-
tmp_9.
|
|
3324
|
+
tmp_9.m3f_1 = tmp_10;
|
|
3325
3325
|
var tmp_11;
|
|
3326
|
-
if (this.
|
|
3326
|
+
if (this.c3f_1.context.t1u().containsSignature(this.m3f_1)) {
|
|
3327
3327
|
tmp_11 = true;
|
|
3328
3328
|
} else {
|
|
3329
3329
|
var tmp_12;
|
|
3330
|
-
var tmp_13 = this.
|
|
3330
|
+
var tmp_13 = this.l3f_1;
|
|
3331
3331
|
if (isInterface(tmp_13, Clause)) {
|
|
3332
|
-
tmp_12 = !this.
|
|
3332
|
+
tmp_12 = !this.l3f_1.sy();
|
|
3333
3333
|
} else {
|
|
3334
3334
|
tmp_12 = false;
|
|
3335
3335
|
}
|
|
3336
3336
|
tmp_11 = tmp_12;
|
|
3337
3337
|
}
|
|
3338
3338
|
if (tmp_11) {
|
|
3339
|
-
this.
|
|
3340
|
-
suspendResult = this.
|
|
3339
|
+
this.zh_1 = 10;
|
|
3340
|
+
suspendResult = this.h3f_1.z4(Companion_getInstance_19().b2h(this.c3f_1, this.d3f_1, this.b3f_1).plus(Companion_getInstance_19().b2h(this.c3f_1, this.e3f_1, toTerm(Companion_getInstance_21().l3d_1))), this);
|
|
3341
3341
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3342
3342
|
return suspendResult;
|
|
3343
3343
|
}
|
|
3344
3344
|
continue $sm;
|
|
3345
3345
|
} else {
|
|
3346
3346
|
var tmp_14 = this;
|
|
3347
|
-
var tmp2_subject = this.
|
|
3347
|
+
var tmp2_subject = this.l3f_1;
|
|
3348
3348
|
var tmp_15;
|
|
3349
3349
|
if (isInterface(tmp2_subject, Clause)) {
|
|
3350
|
-
tmp_15 = ClauseMappingUtils_getInstance().
|
|
3350
|
+
tmp_15 = ClauseMappingUtils_getInstance().m3e(this.l3f_1);
|
|
3351
3351
|
} else {
|
|
3352
3352
|
if (isInterface(tmp2_subject, Struct)) {
|
|
3353
|
-
var tmp3_map = ClauseMappingUtils_getInstance().
|
|
3353
|
+
var tmp3_map = ClauseMappingUtils_getInstance().m3e(Companion_getInstance().of(this.l3f_1));
|
|
3354
3354
|
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp3_map, 10));
|
|
3355
3355
|
var tmp0_iterator = tmp3_map.j();
|
|
3356
3356
|
while (tmp0_iterator.m()) {
|
|
3357
|
-
var item = tmp0_iterator.
|
|
3358
|
-
tmp0_mapTo.g(ensureNotNull(item.
|
|
3357
|
+
var item = tmp0_iterator.n();
|
|
3358
|
+
tmp0_mapTo.g(ensureNotNull(item.iy()));
|
|
3359
3359
|
}
|
|
3360
3360
|
tmp_15 = tmp0_mapTo;
|
|
3361
3361
|
} else {
|
|
3362
|
-
tmp_15 = listOf(this.
|
|
3362
|
+
tmp_15 = listOf(this.l3f_1);
|
|
3363
3363
|
}
|
|
3364
3364
|
}
|
|
3365
|
-
tmp_14.
|
|
3366
|
-
this.
|
|
3367
|
-
var tmp0_mapTo_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this.
|
|
3368
|
-
var tmp0_iterator_0 = this.
|
|
3365
|
+
tmp_14.n3f_1 = tmp_15;
|
|
3366
|
+
this.zh_1 = 9;
|
|
3367
|
+
var tmp0_mapTo_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this.n3f_1, 10));
|
|
3368
|
+
var tmp0_iterator_0 = this.n3f_1.j();
|
|
3369
3369
|
while (tmp0_iterator_0.m()) {
|
|
3370
|
-
var item_0 = tmp0_iterator_0.
|
|
3371
|
-
tmp0_mapTo_0.g(Companion_getInstance_19().
|
|
3370
|
+
var item_0 = tmp0_iterator_0.n();
|
|
3371
|
+
tmp0_mapTo_0.g(Companion_getInstance_19().b2h(this.c3f_1, this.d3f_1, Companion_getInstance_3().of(this.b3f_1.cw(), [item_0])).plus(Companion_getInstance_19().b2h(this.c3f_1, this.e3f_1, toTerm(Companion_getInstance_21().l3d_1))));
|
|
3372
3372
|
}
|
|
3373
|
-
suspendResult = this.
|
|
3373
|
+
suspendResult = this.h3f_1.b5(tmp0_mapTo_0, this);
|
|
3374
3374
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3375
3375
|
return suspendResult;
|
|
3376
3376
|
}
|
|
3377
3377
|
continue $sm;
|
|
3378
3378
|
}
|
|
3379
3379
|
} else {
|
|
3380
|
-
if (this.
|
|
3381
|
-
this.
|
|
3382
|
-
this.
|
|
3380
|
+
if (this.i3f_1 === 'retract' ? true : this.i3f_1 === 'retractall') {
|
|
3381
|
+
this.o3f_1 = this.b3f_1.get(0);
|
|
3382
|
+
this.zh_1 = 8;
|
|
3383
3383
|
var tmp_16 = Companion_getInstance_19();
|
|
3384
3384
|
var tmp_17 = Companion_getInstance_3();
|
|
3385
|
-
var tmp_18 = this.
|
|
3385
|
+
var tmp_18 = this.b3f_1.cw();
|
|
3386
3386
|
var tmp_19;
|
|
3387
3387
|
var tmp_20;
|
|
3388
3388
|
var tmp_21;
|
|
3389
|
-
if (this.
|
|
3389
|
+
if (this.o3f_1.jw()) {
|
|
3390
3390
|
tmp_21 = true;
|
|
3391
3391
|
} else {
|
|
3392
3392
|
var tmp_22;
|
|
3393
|
-
var tmp_23 = this.
|
|
3393
|
+
var tmp_23 = this.o3f_1;
|
|
3394
3394
|
if (isInterface(tmp_23, Struct)) {
|
|
3395
|
-
tmp_22 = this.
|
|
3395
|
+
tmp_22 = this.o3f_1.cw() === ':-';
|
|
3396
3396
|
} else {
|
|
3397
3397
|
tmp_22 = false;
|
|
3398
3398
|
}
|
|
@@ -3401,38 +3401,38 @@
|
|
|
3401
3401
|
if (tmp_21) {
|
|
3402
3402
|
tmp_20 = true;
|
|
3403
3403
|
} else {
|
|
3404
|
-
tmp_20 = this.
|
|
3404
|
+
tmp_20 = this.c3f_1.context.t1u().containsSignature(extractSignature(safeToStruct(this.o3f_1)));
|
|
3405
3405
|
}
|
|
3406
3406
|
if (tmp_20) {
|
|
3407
|
-
tmp_19 = this.
|
|
3407
|
+
tmp_19 = this.o3f_1;
|
|
3408
3408
|
} else {
|
|
3409
|
-
tmp_19 = withExplanation(this.
|
|
3409
|
+
tmp_19 = withExplanation(this.o3f_1, this.e3f_1);
|
|
3410
3410
|
}
|
|
3411
|
-
suspendResult = this.
|
|
3411
|
+
suspendResult = this.h3f_1.z4(tmp_16.b2h(this.c3f_1, this.d3f_1, tmp_17.of(tmp_18, [tmp_19])), this);
|
|
3412
3412
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3413
3413
|
return suspendResult;
|
|
3414
3414
|
}
|
|
3415
3415
|
continue $sm;
|
|
3416
3416
|
} else {
|
|
3417
|
-
if (this.
|
|
3418
|
-
this.
|
|
3417
|
+
if (this.i3f_1 === 'clause') {
|
|
3418
|
+
this.p3f_1 = this.b3f_1.get(0);
|
|
3419
3419
|
var tmp_24;
|
|
3420
|
-
var tmp_25 = this.
|
|
3420
|
+
var tmp_25 = this.p3f_1;
|
|
3421
3421
|
if (!isInterface(tmp_25, Struct)) {
|
|
3422
3422
|
tmp_24 = true;
|
|
3423
3423
|
} else {
|
|
3424
|
-
tmp_24 = this.
|
|
3424
|
+
tmp_24 = this.c3f_1.context.t1u().hasProtected(extractSignature(this.p3f_1));
|
|
3425
3425
|
}
|
|
3426
3426
|
if (tmp_24) {
|
|
3427
|
-
this.
|
|
3428
|
-
suspendResult = this.
|
|
3427
|
+
this.zh_1 = 6;
|
|
3428
|
+
suspendResult = this.h3f_1.z4(Companion_getInstance_19().b2h(this.c3f_1, this.d3f_1, this.b3f_1).plus(Companion_getInstance_19().b2h(this.c3f_1, this.e3f_1, toTerm(Companion_getInstance_21().l3d_1))), this);
|
|
3429
3429
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3430
3430
|
return suspendResult;
|
|
3431
3431
|
}
|
|
3432
3432
|
continue $sm;
|
|
3433
3433
|
} else {
|
|
3434
|
-
this.
|
|
3435
|
-
suspendResult = this.
|
|
3434
|
+
this.zh_1 = 5;
|
|
3435
|
+
suspendResult = this.h3f_1.z4(Companion_getInstance_19().b2h(this.c3f_1, this.d3f_1, Companion_getInstance_3().of(this.b3f_1.cw(), [withExplanation(this.b3f_1.get(0), this.e3f_1), this.b3f_1.get(1)])), this);
|
|
3436
3436
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3437
3437
|
return suspendResult;
|
|
3438
3438
|
}
|
|
@@ -3441,22 +3441,22 @@
|
|
|
3441
3441
|
} else {
|
|
3442
3442
|
var tmp_26 = this;
|
|
3443
3443
|
var tmp_27;
|
|
3444
|
-
var tmp_28 = this.
|
|
3444
|
+
var tmp_28 = this.f3f_1;
|
|
3445
3445
|
if (isInterface(tmp_28, Truth)) {
|
|
3446
3446
|
tmp_27 = true;
|
|
3447
3447
|
} else {
|
|
3448
|
-
tmp_27 = this.
|
|
3448
|
+
tmp_27 = this.c3f_1.context.t1u().containsSignature(this.g3f_1);
|
|
3449
3449
|
}
|
|
3450
|
-
tmp_26.
|
|
3451
|
-
if ((this.
|
|
3452
|
-
this.
|
|
3453
|
-
suspendResult = this.
|
|
3450
|
+
tmp_26.q3f_1 = tmp_27;
|
|
3451
|
+
if ((this.q3f_1 ? true : this.c3f_1.context.v1u().containsIndicator(this.g3f_1.toIndicator())) ? true : this.c3f_1.context.w1u().containsIndicator(this.g3f_1.toIndicator())) {
|
|
3452
|
+
this.zh_1 = 1;
|
|
3453
|
+
suspendResult = this.h3f_1.z4(Companion_getInstance_19().b2h(this.c3f_1, this.d3f_1, this.b3f_1).plus(Companion_getInstance_19().b2h(this.c3f_1, this.e3f_1, toTerm(Companion_getInstance_21().l3d_1))), this);
|
|
3454
3454
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3455
3455
|
return suspendResult;
|
|
3456
3456
|
}
|
|
3457
3457
|
continue $sm;
|
|
3458
3458
|
} else {
|
|
3459
|
-
this.
|
|
3459
|
+
this.zh_1 = 2;
|
|
3460
3460
|
continue $sm;
|
|
3461
3461
|
}
|
|
3462
3462
|
}
|
|
@@ -3470,88 +3470,88 @@
|
|
|
3470
3470
|
|
|
3471
3471
|
break;
|
|
3472
3472
|
case 1:
|
|
3473
|
-
this.
|
|
3473
|
+
this.zh_1 = 2;
|
|
3474
3474
|
continue $sm;
|
|
3475
3475
|
case 2:
|
|
3476
|
-
if (!this.
|
|
3477
|
-
this.
|
|
3478
|
-
suspendResult = this.
|
|
3476
|
+
if (!this.q3f_1) {
|
|
3477
|
+
this.zh_1 = 3;
|
|
3478
|
+
suspendResult = this.h3f_1.z4(Companion_getInstance_19().b2h(this.c3f_1, this.d3f_1, withExplanation(this.b3f_1, this.e3f_1)), this);
|
|
3479
3479
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3480
3480
|
return suspendResult;
|
|
3481
3481
|
}
|
|
3482
3482
|
continue $sm;
|
|
3483
3483
|
} else {
|
|
3484
|
-
this.
|
|
3484
|
+
this.zh_1 = 4;
|
|
3485
3485
|
continue $sm;
|
|
3486
3486
|
}
|
|
3487
3487
|
|
|
3488
3488
|
break;
|
|
3489
3489
|
case 3:
|
|
3490
|
-
this.
|
|
3490
|
+
this.zh_1 = 4;
|
|
3491
3491
|
continue $sm;
|
|
3492
3492
|
case 4:
|
|
3493
|
-
this.
|
|
3493
|
+
this.zh_1 = 17;
|
|
3494
3494
|
continue $sm;
|
|
3495
3495
|
case 5:
|
|
3496
|
-
this.
|
|
3496
|
+
this.zh_1 = 7;
|
|
3497
3497
|
continue $sm;
|
|
3498
3498
|
case 6:
|
|
3499
|
-
this.
|
|
3499
|
+
this.zh_1 = 7;
|
|
3500
3500
|
continue $sm;
|
|
3501
3501
|
case 7:
|
|
3502
|
-
this.
|
|
3502
|
+
this.zh_1 = 17;
|
|
3503
3503
|
continue $sm;
|
|
3504
3504
|
case 8:
|
|
3505
|
-
this.
|
|
3505
|
+
this.zh_1 = 17;
|
|
3506
3506
|
continue $sm;
|
|
3507
3507
|
case 9:
|
|
3508
|
-
this.
|
|
3508
|
+
this.zh_1 = 11;
|
|
3509
3509
|
continue $sm;
|
|
3510
3510
|
case 10:
|
|
3511
|
-
this.
|
|
3511
|
+
this.zh_1 = 11;
|
|
3512
3512
|
continue $sm;
|
|
3513
3513
|
case 11:
|
|
3514
|
-
this.
|
|
3514
|
+
this.zh_1 = 17;
|
|
3515
3515
|
continue $sm;
|
|
3516
3516
|
case 12:
|
|
3517
|
-
this.
|
|
3517
|
+
this.zh_1 = 17;
|
|
3518
3518
|
continue $sm;
|
|
3519
3519
|
case 13:
|
|
3520
|
-
this.
|
|
3520
|
+
this.zh_1 = 17;
|
|
3521
3521
|
continue $sm;
|
|
3522
3522
|
case 14:
|
|
3523
|
-
this.
|
|
3523
|
+
this.zh_1 = 17;
|
|
3524
3524
|
continue $sm;
|
|
3525
3525
|
case 15:
|
|
3526
|
-
this.
|
|
3526
|
+
this.zh_1 = 17;
|
|
3527
3527
|
continue $sm;
|
|
3528
3528
|
case 16:
|
|
3529
|
-
this.
|
|
3529
|
+
this.zh_1 = 17;
|
|
3530
3530
|
continue $sm;
|
|
3531
3531
|
case 17:
|
|
3532
3532
|
return Unit_getInstance();
|
|
3533
3533
|
case 18:
|
|
3534
|
-
throw this.
|
|
3534
|
+
throw this.ci_1;
|
|
3535
3535
|
}
|
|
3536
3536
|
} catch ($p) {
|
|
3537
|
-
if (this.
|
|
3537
|
+
if (this.ai_1 === 18) {
|
|
3538
3538
|
throw $p;
|
|
3539
3539
|
} else {
|
|
3540
|
-
this.
|
|
3541
|
-
this.
|
|
3540
|
+
this.zh_1 = this.ai_1;
|
|
3541
|
+
this.ci_1 = $p;
|
|
3542
3542
|
}
|
|
3543
3543
|
}
|
|
3544
3544
|
while (true);
|
|
3545
3545
|
};
|
|
3546
|
-
ProbHelper$computeAllSubstitutions$slambda.prototype.
|
|
3547
|
-
var i = new ProbHelper$computeAllSubstitutions$slambda(this.
|
|
3548
|
-
i.
|
|
3546
|
+
ProbHelper$computeAllSubstitutions$slambda.prototype.u2t = function ($this$sequence, completion) {
|
|
3547
|
+
var i = new ProbHelper$computeAllSubstitutions$slambda(this.b3f_1, this.c3f_1, this.d3f_1, this.e3f_1, this.f3f_1, this.g3f_1, completion);
|
|
3548
|
+
i.h3f_1 = $this$sequence;
|
|
3549
3549
|
return i;
|
|
3550
3550
|
};
|
|
3551
3551
|
function ProbHelper$computeAllSubstitutions$slambda_0($goal, $this_computeAllSubstitutions, $third, $first, $second, $goalSignature, resultContinuation) {
|
|
3552
3552
|
var i = new ProbHelper$computeAllSubstitutions$slambda($goal, $this_computeAllSubstitutions, $third, $first, $second, $goalSignature, resultContinuation);
|
|
3553
3553
|
var l = function ($this$sequence, $cont) {
|
|
3554
|
-
return i.
|
|
3554
|
+
return i.t2t($this$sequence, $cont);
|
|
3555
3555
|
};
|
|
3556
3556
|
l.$arity = 1;
|
|
3557
3557
|
return l;
|
|
@@ -3561,15 +3561,15 @@
|
|
|
3561
3561
|
ProblogLib_getInstance();
|
|
3562
3562
|
WithoutSideEffects.call(this, 'prob' + '_helper');
|
|
3563
3563
|
}
|
|
3564
|
-
ProbHelper.prototype.
|
|
3565
|
-
Companion_getInstance_19().
|
|
3566
|
-
Companion_getInstance_19().
|
|
3564
|
+
ProbHelper.prototype.r2p = function (_this__u8e3s4, first, second, third) {
|
|
3565
|
+
Companion_getInstance_19().h2h(_this__u8e3s4, 1);
|
|
3566
|
+
Companion_getInstance_19().n2h(_this__u8e3s4, 1);
|
|
3567
3567
|
var goal = safeToStruct(second);
|
|
3568
3568
|
var goalSignature = extractSignature(goal);
|
|
3569
3569
|
return sequence(ProbHelper$computeAllSubstitutions$slambda_0(goal, _this__u8e3s4, third, first, second, goalSignature, null));
|
|
3570
3570
|
};
|
|
3571
|
-
ProbHelper.prototype.
|
|
3572
|
-
return this.
|
|
3571
|
+
ProbHelper.prototype.n2j = function (_this__u8e3s4, first, second, third) {
|
|
3572
|
+
return this.r2p(_this__u8e3s4, first, second, third);
|
|
3573
3573
|
};
|
|
3574
3574
|
var ProbHelper_instance;
|
|
3575
3575
|
function ProbHelper_getInstance() {
|
|
@@ -3582,14 +3582,14 @@
|
|
|
3582
3582
|
ProblogLib_getInstance();
|
|
3583
3583
|
NonBacktrackable_0.call(this, 'prob' + '_negation_as_failure');
|
|
3584
3584
|
}
|
|
3585
|
-
ProbNegationAsFailure.prototype.
|
|
3586
|
-
Companion_getInstance_19().
|
|
3587
|
-
Companion_getInstance_19().
|
|
3585
|
+
ProbNegationAsFailure.prototype.x2p = function (_this__u8e3s4, first, second) {
|
|
3586
|
+
Companion_getInstance_19().h2h(_this__u8e3s4, 1);
|
|
3587
|
+
Companion_getInstance_19().n2h(_this__u8e3s4, 1);
|
|
3588
3588
|
var tmp;
|
|
3589
|
-
if (!second.
|
|
3589
|
+
if (!second.gx()) {
|
|
3590
3590
|
var tmp_0 = 'Probabilistic negation does not support non-ground goals: ' + second;
|
|
3591
3591
|
var tmp_1 = ResolutionException_init_$Create$(tmp_0, null, _this__u8e3s4.context, [], 10, null);
|
|
3592
|
-
tmp = _this__u8e3s4.
|
|
3592
|
+
tmp = _this__u8e3s4.c2j(tmp_1, null, [], 6, null);
|
|
3593
3593
|
} else {
|
|
3594
3594
|
var explanationTermVar = Companion_getInstance_1().of('Explanation');
|
|
3595
3595
|
var tmp_2 = _this__u8e3s4.subSolver();
|
|
@@ -3601,9 +3601,9 @@
|
|
|
3601
3601
|
var solution = firstOrNull(tmp_2.solveWithOptions(tmp_3.of(tmp$ret$0, [explanationTermVar, second]), setProbabilistic(Companion_getInstance_5().DEFAULT, false)));
|
|
3602
3602
|
var tmp_4;
|
|
3603
3603
|
if (solution == null) {
|
|
3604
|
-
tmp_4 = _this__u8e3s4.
|
|
3604
|
+
tmp_4 = _this__u8e3s4.l2g(null, [], 3, null);
|
|
3605
3605
|
} else {
|
|
3606
|
-
var explanationTerm = solution.
|
|
3606
|
+
var explanationTerm = solution.o1u().a3(explanationTermVar);
|
|
3607
3607
|
var tmp_5;
|
|
3608
3608
|
var tmp_6;
|
|
3609
3609
|
if (explanationTerm == null) {
|
|
@@ -3614,10 +3614,10 @@
|
|
|
3614
3614
|
if (tmp_6) {
|
|
3615
3615
|
var tmp_7 = 'No valid explanation has been solved for goal: ' + second;
|
|
3616
3616
|
var tmp_8 = ResolutionException_init_$Create$(tmp_7, null, _this__u8e3s4.context, [], 10, null);
|
|
3617
|
-
tmp_5 = _this__u8e3s4.
|
|
3617
|
+
tmp_5 = _this__u8e3s4.c2j(tmp_8, null, [], 6, null);
|
|
3618
3618
|
} else {
|
|
3619
|
-
var tmp_9 = Companion_getInstance_9().ofSubstitution(Companion_getInstance_19().
|
|
3620
|
-
tmp_5 = _this__u8e3s4.
|
|
3619
|
+
var tmp_9 = Companion_getInstance_9().ofSubstitution(Companion_getInstance_19().b2h(_this__u8e3s4, first, new ProbExplanationTerm(explanationTerm.h3c_1.not())), []);
|
|
3620
|
+
tmp_5 = _this__u8e3s4.g2g(tmp_9, null, [], 6, null);
|
|
3621
3621
|
}
|
|
3622
3622
|
tmp_4 = tmp_5;
|
|
3623
3623
|
}
|
|
@@ -3625,8 +3625,8 @@
|
|
|
3625
3625
|
}
|
|
3626
3626
|
return tmp;
|
|
3627
3627
|
};
|
|
3628
|
-
ProbNegationAsFailure.prototype.
|
|
3629
|
-
return this.
|
|
3628
|
+
ProbNegationAsFailure.prototype.a2g = function (_this__u8e3s4, first, second) {
|
|
3629
|
+
return this.x2p(_this__u8e3s4, first, second);
|
|
3630
3630
|
};
|
|
3631
3631
|
var ProbNegationAsFailure_instance;
|
|
3632
3632
|
function ProbNegationAsFailure_getInstance() {
|
|
@@ -3640,92 +3640,92 @@
|
|
|
3640
3640
|
};
|
|
3641
3641
|
}
|
|
3642
3642
|
function ProbQuery$computeAllSubstitutions$slambda($solutions, $queryWithEvidenceExplanation, $evidenceExplanation, $this_computeAllSubstitutions, $first, $fourth, resultContinuation) {
|
|
3643
|
-
this.
|
|
3644
|
-
this.
|
|
3645
|
-
this.
|
|
3646
|
-
this.
|
|
3647
|
-
this.
|
|
3648
|
-
this.
|
|
3643
|
+
this.b3g_1 = $solutions;
|
|
3644
|
+
this.c3g_1 = $queryWithEvidenceExplanation;
|
|
3645
|
+
this.d3g_1 = $evidenceExplanation;
|
|
3646
|
+
this.e3g_1 = $this_computeAllSubstitutions;
|
|
3647
|
+
this.f3g_1 = $first;
|
|
3648
|
+
this.g3g_1 = $fourth;
|
|
3649
3649
|
CoroutineImpl.call(this, resultContinuation);
|
|
3650
3650
|
}
|
|
3651
|
-
ProbQuery$computeAllSubstitutions$slambda.prototype.
|
|
3652
|
-
var tmp = this.
|
|
3653
|
-
tmp.
|
|
3654
|
-
tmp.
|
|
3655
|
-
return tmp.
|
|
3651
|
+
ProbQuery$computeAllSubstitutions$slambda.prototype.t2t = function ($this$sequence, $cont) {
|
|
3652
|
+
var tmp = this.u2t($this$sequence, $cont);
|
|
3653
|
+
tmp.bi_1 = Unit_getInstance();
|
|
3654
|
+
tmp.ci_1 = null;
|
|
3655
|
+
return tmp.hi();
|
|
3656
3656
|
};
|
|
3657
|
-
ProbQuery$computeAllSubstitutions$slambda.prototype.
|
|
3658
|
-
return this.
|
|
3657
|
+
ProbQuery$computeAllSubstitutions$slambda.prototype.ti = function (p1, $cont) {
|
|
3658
|
+
return this.t2t(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
3659
3659
|
};
|
|
3660
|
-
ProbQuery$computeAllSubstitutions$slambda.prototype.
|
|
3661
|
-
var suspendResult = this.
|
|
3660
|
+
ProbQuery$computeAllSubstitutions$slambda.prototype.hi = function () {
|
|
3661
|
+
var suspendResult = this.bi_1;
|
|
3662
3662
|
$sm: do
|
|
3663
3663
|
try {
|
|
3664
|
-
var tmp = this.
|
|
3664
|
+
var tmp = this.zh_1;
|
|
3665
3665
|
switch (tmp) {
|
|
3666
3666
|
case 0:
|
|
3667
|
-
this.
|
|
3668
|
-
this.
|
|
3669
|
-
this.
|
|
3667
|
+
this.ai_1 = 8;
|
|
3668
|
+
this.i3g_1 = this.b3g_1.j();
|
|
3669
|
+
this.zh_1 = 1;
|
|
3670
3670
|
continue $sm;
|
|
3671
3671
|
case 1:
|
|
3672
|
-
if (!this.
|
|
3673
|
-
this.
|
|
3672
|
+
if (!this.i3g_1.m()) {
|
|
3673
|
+
this.zh_1 = 7;
|
|
3674
3674
|
continue $sm;
|
|
3675
3675
|
}
|
|
3676
3676
|
|
|
3677
|
-
this.
|
|
3678
|
-
if (this.
|
|
3679
|
-
throw ensureNotNull(this.
|
|
3680
|
-
this.
|
|
3681
|
-
this.
|
|
3677
|
+
this.j3g_1 = this.i3g_1.n();
|
|
3678
|
+
if (this.j3g_1.c1w())
|
|
3679
|
+
throw ensureNotNull(this.j3g_1.z1v());
|
|
3680
|
+
this.k3g_1 = this.j3g_1.o1u().a3(this.c3g_1);
|
|
3681
|
+
this.l3g_1 = this.j3g_1.o1u().a3(this.d3g_1);
|
|
3682
3682
|
var tmp_0;
|
|
3683
3683
|
var tmp_1;
|
|
3684
3684
|
var tmp_2;
|
|
3685
|
-
if (this.
|
|
3685
|
+
if (this.k3g_1 == null) {
|
|
3686
3686
|
tmp_2 = true;
|
|
3687
3687
|
} else {
|
|
3688
|
-
var tmp_3 = this.
|
|
3688
|
+
var tmp_3 = this.k3g_1;
|
|
3689
3689
|
tmp_2 = !(tmp_3 instanceof ProbExplanationTerm);
|
|
3690
3690
|
}
|
|
3691
3691
|
|
|
3692
3692
|
if (tmp_2) {
|
|
3693
3693
|
tmp_1 = true;
|
|
3694
3694
|
} else {
|
|
3695
|
-
tmp_1 = this.
|
|
3695
|
+
tmp_1 = this.l3g_1 == null;
|
|
3696
3696
|
}
|
|
3697
3697
|
|
|
3698
3698
|
if (tmp_1) {
|
|
3699
3699
|
tmp_0 = true;
|
|
3700
3700
|
} else {
|
|
3701
|
-
var tmp_4 = this.
|
|
3701
|
+
var tmp_4 = this.l3g_1;
|
|
3702
3702
|
tmp_0 = !(tmp_4 instanceof ProbExplanationTerm);
|
|
3703
3703
|
}
|
|
3704
3704
|
|
|
3705
3705
|
if (tmp_0) {
|
|
3706
|
-
this.
|
|
3707
|
-
suspendResult = this.
|
|
3706
|
+
this.zh_1 = 5;
|
|
3707
|
+
suspendResult = this.h3g_1.z4(Companion_getInstance_9().failed(), this);
|
|
3708
3708
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3709
3709
|
return suspendResult;
|
|
3710
3710
|
}
|
|
3711
3711
|
continue $sm;
|
|
3712
3712
|
} else {
|
|
3713
|
-
this.
|
|
3714
|
-
this.
|
|
3715
|
-
if (this.
|
|
3716
|
-
this.
|
|
3717
|
-
suspendResult = this.
|
|
3713
|
+
this.m3g_1 = this.k3g_1.h3c_1.y3d();
|
|
3714
|
+
this.n3g_1 = this.l3g_1.h3c_1.y3d();
|
|
3715
|
+
if (this.m3g_1 == null ? true : this.n3g_1 == null) {
|
|
3716
|
+
this.zh_1 = 3;
|
|
3717
|
+
suspendResult = this.h3g_1.z4(Companion_getInstance_9().failed(), this);
|
|
3718
3718
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3719
3719
|
return suspendResult;
|
|
3720
3720
|
}
|
|
3721
3721
|
continue $sm;
|
|
3722
3722
|
} else {
|
|
3723
3723
|
var tmp_5 = this;
|
|
3724
|
-
var tmp_6 = this.
|
|
3725
|
-
tmp_5.
|
|
3726
|
-
this.
|
|
3727
|
-
this.
|
|
3728
|
-
suspendResult = this.
|
|
3724
|
+
var tmp_6 = this.j3g_1.o1u();
|
|
3725
|
+
tmp_5.o3g_1 = tmp_6.filter(ProbQuery$computeAllSubstitutions$slambda$lambda(this.d3g_1, this.c3g_1));
|
|
3726
|
+
this.p3g_1 = Companion_getInstance_10().ofDouble(this.m3g_1 / this.n3g_1);
|
|
3727
|
+
this.zh_1 = 2;
|
|
3728
|
+
suspendResult = this.h3g_1.z4(Companion_getInstance_9().ofSubstitution(this.o3g_1, [Companion_getInstance_19().b2h(this.e3g_1, this.f3g_1, this.p3g_1), Companion_getInstance_19().b2h(this.e3g_1, this.g3g_1, this.k3g_1)]), this);
|
|
3729
3729
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3730
3730
|
return suspendResult;
|
|
3731
3731
|
}
|
|
@@ -3735,44 +3735,44 @@
|
|
|
3735
3735
|
|
|
3736
3736
|
break;
|
|
3737
3737
|
case 2:
|
|
3738
|
-
this.
|
|
3738
|
+
this.zh_1 = 4;
|
|
3739
3739
|
continue $sm;
|
|
3740
3740
|
case 3:
|
|
3741
|
-
this.
|
|
3741
|
+
this.zh_1 = 4;
|
|
3742
3742
|
continue $sm;
|
|
3743
3743
|
case 4:
|
|
3744
|
-
this.
|
|
3744
|
+
this.zh_1 = 6;
|
|
3745
3745
|
continue $sm;
|
|
3746
3746
|
case 5:
|
|
3747
|
-
this.
|
|
3747
|
+
this.zh_1 = 6;
|
|
3748
3748
|
continue $sm;
|
|
3749
3749
|
case 6:
|
|
3750
|
-
this.
|
|
3750
|
+
this.zh_1 = 1;
|
|
3751
3751
|
continue $sm;
|
|
3752
3752
|
case 7:
|
|
3753
3753
|
return Unit_getInstance();
|
|
3754
3754
|
case 8:
|
|
3755
|
-
throw this.
|
|
3755
|
+
throw this.ci_1;
|
|
3756
3756
|
}
|
|
3757
3757
|
} catch ($p) {
|
|
3758
|
-
if (this.
|
|
3758
|
+
if (this.ai_1 === 8) {
|
|
3759
3759
|
throw $p;
|
|
3760
3760
|
} else {
|
|
3761
|
-
this.
|
|
3762
|
-
this.
|
|
3761
|
+
this.zh_1 = this.ai_1;
|
|
3762
|
+
this.ci_1 = $p;
|
|
3763
3763
|
}
|
|
3764
3764
|
}
|
|
3765
3765
|
while (true);
|
|
3766
3766
|
};
|
|
3767
|
-
ProbQuery$computeAllSubstitutions$slambda.prototype.
|
|
3768
|
-
var i = new ProbQuery$computeAllSubstitutions$slambda(this.
|
|
3769
|
-
i.
|
|
3767
|
+
ProbQuery$computeAllSubstitutions$slambda.prototype.u2t = function ($this$sequence, completion) {
|
|
3768
|
+
var i = new ProbQuery$computeAllSubstitutions$slambda(this.b3g_1, this.c3g_1, this.d3g_1, this.e3g_1, this.f3g_1, this.g3g_1, completion);
|
|
3769
|
+
i.h3g_1 = $this$sequence;
|
|
3770
3770
|
return i;
|
|
3771
3771
|
};
|
|
3772
3772
|
function ProbQuery$computeAllSubstitutions$slambda_0($solutions, $queryWithEvidenceExplanation, $evidenceExplanation, $this_computeAllSubstitutions, $first, $fourth, resultContinuation) {
|
|
3773
3773
|
var i = new ProbQuery$computeAllSubstitutions$slambda($solutions, $queryWithEvidenceExplanation, $evidenceExplanation, $this_computeAllSubstitutions, $first, $fourth, resultContinuation);
|
|
3774
3774
|
var l = function ($this$sequence, $cont) {
|
|
3775
|
-
return i.
|
|
3775
|
+
return i.t2t($this$sequence, $cont);
|
|
3776
3776
|
};
|
|
3777
3777
|
l.$arity = 1;
|
|
3778
3778
|
return l;
|
|
@@ -3782,11 +3782,11 @@
|
|
|
3782
3782
|
ProblogLib_getInstance();
|
|
3783
3783
|
WithoutSideEffects_0.call(this, 'prob' + '_query');
|
|
3784
3784
|
}
|
|
3785
|
-
ProbQuery.prototype.
|
|
3786
|
-
Companion_getInstance_19().
|
|
3787
|
-
Companion_getInstance_19().
|
|
3788
|
-
Companion_getInstance_19().
|
|
3789
|
-
Companion_getInstance_19().
|
|
3785
|
+
ProbQuery.prototype.r3g = function (_this__u8e3s4, first, second, third, fourth) {
|
|
3786
|
+
Companion_getInstance_19().h2h(_this__u8e3s4, 1);
|
|
3787
|
+
Companion_getInstance_19().n2h(_this__u8e3s4, 1);
|
|
3788
|
+
Companion_getInstance_19().l2h(_this__u8e3s4, 1);
|
|
3789
|
+
Companion_getInstance_19().h2h(_this__u8e3s4, 2);
|
|
3790
3790
|
var queryWithEvidenceExplanation = Companion_getInstance_1().of('QueryWithEvidenceExplanation');
|
|
3791
3791
|
var evidenceExplanation = Companion_getInstance_1().of('EvidenceExplanation');
|
|
3792
3792
|
var tmp = _this__u8e3s4.subSolver();
|
|
@@ -3802,11 +3802,11 @@
|
|
|
3802
3802
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3803
3803
|
var tmp1__get_functor__4k11yf = ProbSolveWithEvidence_getInstance();
|
|
3804
3804
|
tmp$ret$1 = tmp1__get_functor__4k11yf.signature.name;
|
|
3805
|
-
var solutions = tmp.solveWithOptions(tmp_0.of(tmp_2, tmp_3.of(tmp$ret$1, [queryWithEvidenceExplanation, evidenceExplanation, second])), ProbSetConfig_getInstance().
|
|
3805
|
+
var solutions = tmp.solveWithOptions(tmp_0.of(tmp_2, tmp_3.of(tmp$ret$1, [queryWithEvidenceExplanation, evidenceExplanation, second])), ProbSetConfig_getInstance().s3g(third));
|
|
3806
3806
|
return sequence(ProbQuery$computeAllSubstitutions$slambda_0(solutions, queryWithEvidenceExplanation, evidenceExplanation, _this__u8e3s4, first, fourth, null));
|
|
3807
3807
|
};
|
|
3808
|
-
ProbQuery.prototype.
|
|
3809
|
-
return this.
|
|
3808
|
+
ProbQuery.prototype.d2i = function (_this__u8e3s4, first, second, third, fourth) {
|
|
3809
|
+
return this.r3g(_this__u8e3s4, first, second, third, fourth);
|
|
3810
3810
|
};
|
|
3811
3811
|
var ProbQuery_instance;
|
|
3812
3812
|
function ProbQuery_getInstance() {
|
|
@@ -3822,24 +3822,24 @@
|
|
|
3822
3822
|
var tmp$ret$0;
|
|
3823
3823
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3824
3824
|
tmp$ret$0 = this.signature.name;
|
|
3825
|
-
tmp.
|
|
3825
|
+
tmp.d3c_1 = tmp$ret$0 + '_flag';
|
|
3826
3826
|
var tmp_0 = this;
|
|
3827
3827
|
var tmp$ret$1;
|
|
3828
3828
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3829
3829
|
tmp$ret$1 = this.signature.name;
|
|
3830
|
-
tmp_0.
|
|
3830
|
+
tmp_0.e3c_1 = tmp$ret$1 + '_term';
|
|
3831
3831
|
var tmp_1 = this;
|
|
3832
3832
|
var tmp$ret$2;
|
|
3833
3833
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
3834
3834
|
tmp$ret$2 = this.signature.name;
|
|
3835
|
-
tmp_1.
|
|
3835
|
+
tmp_1.f3c_1 = 'it.unibo.tuprolog.solve.probability' + tmp$ret$2 + '_tag';
|
|
3836
3836
|
}
|
|
3837
|
-
ProbSetConfig.prototype.
|
|
3838
|
-
Companion_getInstance_19().
|
|
3839
|
-
Companion_getInstance_19().
|
|
3837
|
+
ProbSetConfig.prototype.g2p = function (_this__u8e3s4, first) {
|
|
3838
|
+
Companion_getInstance_19().h2h(_this__u8e3s4, 0);
|
|
3839
|
+
Companion_getInstance_19().q2h(_this__u8e3s4, 0);
|
|
3840
3840
|
var tmp$ret$2;
|
|
3841
3841
|
// Inline function 'kotlin.arrayOf' call
|
|
3842
|
-
var tmp0_arrayOf = [SetFlags_init_$Create$([new Pair(this.
|
|
3842
|
+
var tmp0_arrayOf = [SetFlags_init_$Create$([new Pair(this.d3c_1, first)])];
|
|
3843
3843
|
var tmp$ret$1;
|
|
3844
3844
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
3845
3845
|
var tmp$ret$0;
|
|
@@ -3847,25 +3847,25 @@
|
|
|
3847
3847
|
tmp$ret$0 = tmp0_arrayOf;
|
|
3848
3848
|
tmp$ret$1 = tmp$ret$0;
|
|
3849
3849
|
tmp$ret$2 = tmp$ret$1;
|
|
3850
|
-
return _this__u8e3s4.
|
|
3850
|
+
return _this__u8e3s4.m2g(null, null, tmp$ret$2.slice(), 3, null);
|
|
3851
3851
|
};
|
|
3852
|
-
ProbSetConfig.prototype.
|
|
3853
|
-
return this.
|
|
3852
|
+
ProbSetConfig.prototype.a2k = function (_this__u8e3s4, first) {
|
|
3853
|
+
return this.g2p(_this__u8e3s4, first);
|
|
3854
3854
|
};
|
|
3855
|
-
ProbSetConfig.prototype.
|
|
3856
|
-
var tmp0_elvis_lhs = _this__u8e3s4.getTag(this.
|
|
3855
|
+
ProbSetConfig.prototype.s3g = function (_this__u8e3s4) {
|
|
3856
|
+
var tmp0_elvis_lhs = _this__u8e3s4.getTag(this.f3c_1);
|
|
3857
3857
|
return tmp0_elvis_lhs == null ? Companion_getInstance_5().DEFAULT : tmp0_elvis_lhs;
|
|
3858
3858
|
};
|
|
3859
|
-
ProbSetConfig.prototype.
|
|
3860
|
-
return setTag(Companion_getInstance_8().of(this.
|
|
3859
|
+
ProbSetConfig.prototype.g3c = function (_this__u8e3s4) {
|
|
3860
|
+
return setTag(Companion_getInstance_8().of(this.e3c_1), this.f3c_1, _this__u8e3s4);
|
|
3861
3861
|
};
|
|
3862
|
-
ProbSetConfig.prototype.
|
|
3863
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
3864
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
3862
|
+
ProbSetConfig.prototype.t3g = function (_this__u8e3s4) {
|
|
3863
|
+
var tmp0_safe_receiver = _this__u8e3s4.u1u().o9(this.d3c_1);
|
|
3864
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.s3g(tmp0_safe_receiver);
|
|
3865
3865
|
return tmp1_elvis_lhs == null ? Companion_getInstance_5().DEFAULT : tmp1_elvis_lhs;
|
|
3866
3866
|
};
|
|
3867
|
-
ProbSetConfig.prototype.
|
|
3868
|
-
return !get_isProbabilistic(this.
|
|
3867
|
+
ProbSetConfig.prototype.s3e = function (_this__u8e3s4) {
|
|
3868
|
+
return !get_isProbabilistic(this.t3g(_this__u8e3s4));
|
|
3869
3869
|
};
|
|
3870
3870
|
var ProbSetConfig_instance;
|
|
3871
3871
|
function ProbSetConfig_getInstance() {
|
|
@@ -3874,9 +3874,9 @@
|
|
|
3874
3874
|
return ProbSetConfig_instance;
|
|
3875
3875
|
}
|
|
3876
3876
|
function ProbSolve$computeAllSubstitutions$lambda(it) {
|
|
3877
|
-
if (it.
|
|
3878
|
-
throw ensureNotNull(it.
|
|
3879
|
-
return it.
|
|
3877
|
+
if (it.c1w())
|
|
3878
|
+
throw ensureNotNull(it.z1v());
|
|
3879
|
+
return it.o1u();
|
|
3880
3880
|
}
|
|
3881
3881
|
function ProbSolve$computeAllSubstitutions$lambda_0(it) {
|
|
3882
3882
|
return !(it == null) ? isInterface(it, Halt) : false;
|
|
@@ -3887,54 +3887,54 @@
|
|
|
3887
3887
|
};
|
|
3888
3888
|
}
|
|
3889
3889
|
function ProbSolve$computeAllSubstitutions$slambda($solutionGroups, $explanationVar, $this_computeAllSubstitutions, $first, resultContinuation) {
|
|
3890
|
-
this.
|
|
3891
|
-
this.
|
|
3892
|
-
this.
|
|
3893
|
-
this.
|
|
3890
|
+
this.c3h_1 = $solutionGroups;
|
|
3891
|
+
this.d3h_1 = $explanationVar;
|
|
3892
|
+
this.e3h_1 = $this_computeAllSubstitutions;
|
|
3893
|
+
this.f3h_1 = $first;
|
|
3894
3894
|
CoroutineImpl.call(this, resultContinuation);
|
|
3895
3895
|
}
|
|
3896
|
-
ProbSolve$computeAllSubstitutions$slambda.prototype.
|
|
3897
|
-
var tmp = this.
|
|
3898
|
-
tmp.
|
|
3899
|
-
tmp.
|
|
3900
|
-
return tmp.
|
|
3896
|
+
ProbSolve$computeAllSubstitutions$slambda.prototype.t2t = function ($this$sequence, $cont) {
|
|
3897
|
+
var tmp = this.u2t($this$sequence, $cont);
|
|
3898
|
+
tmp.bi_1 = Unit_getInstance();
|
|
3899
|
+
tmp.ci_1 = null;
|
|
3900
|
+
return tmp.hi();
|
|
3901
3901
|
};
|
|
3902
|
-
ProbSolve$computeAllSubstitutions$slambda.prototype.
|
|
3903
|
-
return this.
|
|
3902
|
+
ProbSolve$computeAllSubstitutions$slambda.prototype.ti = function (p1, $cont) {
|
|
3903
|
+
return this.t2t(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
3904
3904
|
};
|
|
3905
|
-
ProbSolve$computeAllSubstitutions$slambda.prototype.
|
|
3906
|
-
var suspendResult = this.
|
|
3905
|
+
ProbSolve$computeAllSubstitutions$slambda.prototype.hi = function () {
|
|
3906
|
+
var suspendResult = this.bi_1;
|
|
3907
3907
|
$sm: do
|
|
3908
3908
|
try {
|
|
3909
|
-
var tmp = this.
|
|
3909
|
+
var tmp = this.zh_1;
|
|
3910
3910
|
switch (tmp) {
|
|
3911
3911
|
case 0:
|
|
3912
|
-
this.
|
|
3912
|
+
this.ai_1 = 4;
|
|
3913
3913
|
var tmp_0 = this;
|
|
3914
|
-
tmp_0.
|
|
3915
|
-
this.
|
|
3914
|
+
tmp_0.h3h_1 = this.c3h_1.z().j();
|
|
3915
|
+
this.zh_1 = 1;
|
|
3916
3916
|
continue $sm;
|
|
3917
3917
|
case 1:
|
|
3918
|
-
if (!this.
|
|
3919
|
-
this.
|
|
3918
|
+
if (!this.h3h_1.m()) {
|
|
3919
|
+
this.zh_1 = 3;
|
|
3920
3920
|
continue $sm;
|
|
3921
3921
|
}
|
|
3922
3922
|
|
|
3923
|
-
this.
|
|
3923
|
+
this.i3h_1 = this.h3h_1.n();
|
|
3924
3924
|
var tmp_1 = this;
|
|
3925
|
-
var tmp0_map = this.
|
|
3925
|
+
var tmp0_map = this.i3h_1.b1();
|
|
3926
3926
|
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_map, 10));
|
|
3927
3927
|
var tmp0_iterator = tmp0_map.j();
|
|
3928
3928
|
while (tmp0_iterator.m()) {
|
|
3929
|
-
var item = tmp0_iterator.
|
|
3930
|
-
tmp0_mapTo.g(item.
|
|
3929
|
+
var item = tmp0_iterator.n();
|
|
3930
|
+
tmp0_mapTo.g(item.o1u().a3(this.d3h_1));
|
|
3931
3931
|
}
|
|
3932
3932
|
|
|
3933
3933
|
var tmp1_filterIsInstance = tmp0_mapTo;
|
|
3934
3934
|
var tmp0_filterIsInstanceTo = ArrayList_init_$Create$_0();
|
|
3935
3935
|
var tmp0_iterator_0 = tmp1_filterIsInstance.j();
|
|
3936
3936
|
while (tmp0_iterator_0.m()) {
|
|
3937
|
-
var element = tmp0_iterator_0.
|
|
3937
|
+
var element = tmp0_iterator_0.n();
|
|
3938
3938
|
if (element instanceof ProbExplanationTerm) {
|
|
3939
3939
|
tmp0_filterIsInstanceTo.g(element);
|
|
3940
3940
|
}
|
|
@@ -3944,57 +3944,57 @@
|
|
|
3944
3944
|
var tmp0_mapTo_0 = ArrayList_init_$Create$(collectionSizeOrDefault(tmp2_map, 10));
|
|
3945
3945
|
var tmp0_iterator_1 = tmp2_map.j();
|
|
3946
3946
|
while (tmp0_iterator_1.m()) {
|
|
3947
|
-
var item_0 = tmp0_iterator_1.
|
|
3948
|
-
tmp0_mapTo_0.g(item_0.
|
|
3947
|
+
var item_0 = tmp0_iterator_1.n();
|
|
3948
|
+
tmp0_mapTo_0.g(item_0.h3c_1);
|
|
3949
3949
|
}
|
|
3950
3950
|
|
|
3951
3951
|
var tmp3_reduce = tmp0_mapTo_0;
|
|
3952
3952
|
var iterator = tmp3_reduce.j();
|
|
3953
3953
|
if (!iterator.m())
|
|
3954
3954
|
throw UnsupportedOperationException_init_$Create$("Empty collection can't be reduced.");
|
|
3955
|
-
var accumulator = iterator.
|
|
3955
|
+
var accumulator = iterator.n();
|
|
3956
3956
|
while (iterator.m()) {
|
|
3957
3957
|
var tmp4__anonymous__pkmkx7 = accumulator;
|
|
3958
|
-
var tmp5__anonymous__kpxxpo = iterator.
|
|
3959
|
-
accumulator = tmp5__anonymous__kpxxpo.
|
|
3958
|
+
var tmp5__anonymous__kpxxpo = iterator.n();
|
|
3959
|
+
accumulator = tmp5__anonymous__kpxxpo.x3d() === 1.0 ? tmp4__anonymous__pkmkx7 : tmp4__anonymous__pkmkx7.x3d() === 1.0 ? tmp5__anonymous__kpxxpo : tmp4__anonymous__pkmkx7.or(tmp5__anonymous__kpxxpo);
|
|
3960
3960
|
}
|
|
3961
3961
|
|
|
3962
|
-
tmp_1.
|
|
3963
|
-
this.
|
|
3964
|
-
this.
|
|
3965
|
-
suspendResult = this.
|
|
3962
|
+
tmp_1.j3h_1 = accumulator;
|
|
3963
|
+
this.k3h_1 = Companion_getInstance_9().ofSubstitution(this.i3h_1.a1(), [Companion_getInstance_19().b2h(this.e3h_1, this.f3h_1, new ProbExplanationTerm(this.j3h_1))]);
|
|
3964
|
+
this.zh_1 = 2;
|
|
3965
|
+
suspendResult = this.g3h_1.z4(this.k3h_1, this);
|
|
3966
3966
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3967
3967
|
return suspendResult;
|
|
3968
3968
|
}
|
|
3969
3969
|
|
|
3970
3970
|
continue $sm;
|
|
3971
3971
|
case 2:
|
|
3972
|
-
this.
|
|
3972
|
+
this.zh_1 = 1;
|
|
3973
3973
|
continue $sm;
|
|
3974
3974
|
case 3:
|
|
3975
3975
|
return Unit_getInstance();
|
|
3976
3976
|
case 4:
|
|
3977
|
-
throw this.
|
|
3977
|
+
throw this.ci_1;
|
|
3978
3978
|
}
|
|
3979
3979
|
} catch ($p) {
|
|
3980
|
-
if (this.
|
|
3980
|
+
if (this.ai_1 === 4) {
|
|
3981
3981
|
throw $p;
|
|
3982
3982
|
} else {
|
|
3983
|
-
this.
|
|
3984
|
-
this.
|
|
3983
|
+
this.zh_1 = this.ai_1;
|
|
3984
|
+
this.ci_1 = $p;
|
|
3985
3985
|
}
|
|
3986
3986
|
}
|
|
3987
3987
|
while (true);
|
|
3988
3988
|
};
|
|
3989
|
-
ProbSolve$computeAllSubstitutions$slambda.prototype.
|
|
3990
|
-
var i = new ProbSolve$computeAllSubstitutions$slambda(this.
|
|
3991
|
-
i.
|
|
3989
|
+
ProbSolve$computeAllSubstitutions$slambda.prototype.u2t = function ($this$sequence, completion) {
|
|
3990
|
+
var i = new ProbSolve$computeAllSubstitutions$slambda(this.c3h_1, this.d3h_1, this.e3h_1, this.f3h_1, completion);
|
|
3991
|
+
i.g3h_1 = $this$sequence;
|
|
3992
3992
|
return i;
|
|
3993
3993
|
};
|
|
3994
3994
|
function ProbSolve$computeAllSubstitutions$slambda_0($solutionGroups, $explanationVar, $this_computeAllSubstitutions, $first, resultContinuation) {
|
|
3995
3995
|
var i = new ProbSolve$computeAllSubstitutions$slambda($solutionGroups, $explanationVar, $this_computeAllSubstitutions, $first, resultContinuation);
|
|
3996
3996
|
var l = function ($this$sequence, $cont) {
|
|
3997
|
-
return i.
|
|
3997
|
+
return i.t2t($this$sequence, $cont);
|
|
3998
3998
|
};
|
|
3999
3999
|
l.$arity = 1;
|
|
4000
4000
|
return l;
|
|
@@ -4004,17 +4004,17 @@
|
|
|
4004
4004
|
ProblogLib_getInstance();
|
|
4005
4005
|
WithoutSideEffects_1.call(this, 'prob' + '_solve');
|
|
4006
4006
|
}
|
|
4007
|
-
ProbSolve.prototype.
|
|
4008
|
-
Companion_getInstance_19().
|
|
4009
|
-
Companion_getInstance_19().
|
|
4010
|
-
if (ProbSetConfig_getInstance().
|
|
4007
|
+
ProbSolve.prototype.w2q = function (_this__u8e3s4, first, second) {
|
|
4008
|
+
Companion_getInstance_19().h2h(_this__u8e3s4, 1);
|
|
4009
|
+
Companion_getInstance_19().n2h(_this__u8e3s4, 1);
|
|
4010
|
+
if (ProbSetConfig_getInstance().s3e(_this__u8e3s4.context)) {
|
|
4011
4011
|
var tmp = _this__u8e3s4.subSolver();
|
|
4012
4012
|
var tmp_0 = Companion_getInstance_3();
|
|
4013
4013
|
var tmp$ret$0;
|
|
4014
4014
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
4015
4015
|
var tmp0__get_functor__thl4dk = Prob_getInstance();
|
|
4016
4016
|
tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
|
|
4017
|
-
var tmp_1 = tmp.solveWithOptions(tmp_0.of(tmp$ret$0, [first, second]), ProbSetConfig_getInstance().
|
|
4017
|
+
var tmp_1 = tmp.solveWithOptions(tmp_0.of(tmp$ret$0, [first, second]), ProbSetConfig_getInstance().t3g(_this__u8e3s4.context));
|
|
4018
4018
|
return map(tmp_1, ProbSolve$computeAllSubstitutions$lambda);
|
|
4019
4019
|
}
|
|
4020
4020
|
var tmp_2 = Companion_getInstance_1();
|
|
@@ -4026,7 +4026,7 @@
|
|
|
4026
4026
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
4027
4027
|
var tmp1__get_functor__4k11yf = Prob_getInstance();
|
|
4028
4028
|
tmp$ret$1 = tmp1__get_functor__4k11yf.signature.name;
|
|
4029
|
-
var solutions = toList(tmp_3.solveWithOptions(tmp_4.of(tmp$ret$1, [explanationVar, second]), ProbSetConfig_getInstance().
|
|
4029
|
+
var solutions = toList(tmp_3.solveWithOptions(tmp_4.of(tmp$ret$1, [explanationVar, second]), ProbSetConfig_getInstance().t3g(_this__u8e3s4.context)));
|
|
4030
4030
|
var tmp$ret$2;
|
|
4031
4031
|
// Inline function 'kotlin.sequences.filterIsInstance' call
|
|
4032
4032
|
var tmp2_filterIsInstance = asSequence(solutions);
|
|
@@ -4034,7 +4034,7 @@
|
|
|
4034
4034
|
tmp$ret$2 = isInterface(tmp_5, Sequence) ? tmp_5 : THROW_CCE();
|
|
4035
4035
|
var error = firstOrNull(tmp$ret$2);
|
|
4036
4036
|
if (!(error == null))
|
|
4037
|
-
throw error.
|
|
4037
|
+
throw error.z1v();
|
|
4038
4038
|
var tmp_6;
|
|
4039
4039
|
var tmp$ret$3;
|
|
4040
4040
|
$l$block_0: {
|
|
@@ -4051,7 +4051,7 @@
|
|
|
4051
4051
|
}
|
|
4052
4052
|
var tmp0_iterator = solutions.j();
|
|
4053
4053
|
while (tmp0_iterator.m()) {
|
|
4054
|
-
var element = tmp0_iterator.
|
|
4054
|
+
var element = tmp0_iterator.n();
|
|
4055
4055
|
var tmp$ret$4;
|
|
4056
4056
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.primitive.ProbSolve.computeAllSubstitutions.<anonymous>' call
|
|
4057
4057
|
tmp$ret$4 = isInterface(element, Yes);
|
|
@@ -4063,7 +4063,7 @@
|
|
|
4063
4063
|
tmp$ret$3 = false;
|
|
4064
4064
|
}
|
|
4065
4065
|
if (!tmp$ret$3) {
|
|
4066
|
-
tmp_6 = sequenceOf([Companion_getInstance_9().ofSubstitution(Companion_getInstance_19().
|
|
4066
|
+
tmp_6 = sequenceOf([Companion_getInstance_9().ofSubstitution(Companion_getInstance_19().b2h(_this__u8e3s4, first, new ProbExplanationTerm(Companion_getInstance_21().k3d_1)), [])]);
|
|
4067
4067
|
} else {
|
|
4068
4068
|
var tmp$ret$11;
|
|
4069
4069
|
// Inline function 'kotlin.collections.groupBy' call
|
|
@@ -4074,7 +4074,7 @@
|
|
|
4074
4074
|
var tmp0_filterIsInstanceTo = ArrayList_init_$Create$_0();
|
|
4075
4075
|
var tmp0_iterator_0 = solutions.j();
|
|
4076
4076
|
while (tmp0_iterator_0.m()) {
|
|
4077
|
-
var element_0 = tmp0_iterator_0.
|
|
4077
|
+
var element_0 = tmp0_iterator_0.n();
|
|
4078
4078
|
if (!(element_0 == null) ? isInterface(element_0, Yes) : false) {
|
|
4079
4079
|
tmp0_filterIsInstanceTo.g(element_0);
|
|
4080
4080
|
}
|
|
@@ -4087,11 +4087,11 @@
|
|
|
4087
4087
|
var tmp0_groupByTo = LinkedHashMap_init_$Create$();
|
|
4088
4088
|
var tmp0_iterator_1 = tmp3_groupBy.j();
|
|
4089
4089
|
while (tmp0_iterator_1.m()) {
|
|
4090
|
-
var element_1 = tmp0_iterator_1.
|
|
4090
|
+
var element_1 = tmp0_iterator_1.n();
|
|
4091
4091
|
var tmp$ret$7;
|
|
4092
4092
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.primitive.ProbSolve.computeAllSubstitutions.<anonymous>' call
|
|
4093
|
-
var tmp_8 = element_1.
|
|
4094
|
-
tmp$ret$7 = tmp_8.
|
|
4093
|
+
var tmp_8 = element_1.o1u();
|
|
4094
|
+
tmp$ret$7 = tmp_8.i12(ProbSolve$computeAllSubstitutions$lambda_1(explanationVar));
|
|
4095
4095
|
var key = tmp$ret$7;
|
|
4096
4096
|
var tmp$ret$9;
|
|
4097
4097
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
@@ -4118,8 +4118,8 @@
|
|
|
4118
4118
|
}
|
|
4119
4119
|
return tmp_6;
|
|
4120
4120
|
};
|
|
4121
|
-
ProbSolve.prototype.
|
|
4122
|
-
return this.
|
|
4121
|
+
ProbSolve.prototype.i2g = function (_this__u8e3s4, first, second) {
|
|
4122
|
+
return this.w2q(_this__u8e3s4, first, second);
|
|
4123
4123
|
};
|
|
4124
4124
|
var ProbSolve_instance;
|
|
4125
4125
|
function ProbSolve_getInstance() {
|
|
@@ -4132,34 +4132,34 @@
|
|
|
4132
4132
|
}
|
|
4133
4133
|
function ProbSolveEvidence$computeOne$lambda_0($explanationVar) {
|
|
4134
4134
|
return function (s) {
|
|
4135
|
-
return s.
|
|
4135
|
+
return s.o1u().a3($explanationVar);
|
|
4136
4136
|
};
|
|
4137
4137
|
}
|
|
4138
4138
|
function ProbSolveEvidence$computeOne$lambda_1(it) {
|
|
4139
4139
|
return it instanceof ProbExplanationTerm;
|
|
4140
4140
|
}
|
|
4141
4141
|
function ProbSolveEvidence$computeOne$lambda_2(t) {
|
|
4142
|
-
return t.
|
|
4142
|
+
return t.h3c_1;
|
|
4143
4143
|
}
|
|
4144
4144
|
function ProbSolveEvidence() {
|
|
4145
4145
|
ProbSolveEvidence_instance = this;
|
|
4146
4146
|
ProblogLib_getInstance();
|
|
4147
4147
|
NonBacktrackable_1.call(this, 'prob' + '_solve_evidence');
|
|
4148
4148
|
}
|
|
4149
|
-
ProbSolveEvidence.prototype.
|
|
4149
|
+
ProbSolveEvidence.prototype.g2p = function (_this__u8e3s4, first) {
|
|
4150
4150
|
var tmp = Companion_getInstance_13();
|
|
4151
4151
|
ProblogLib_getInstance();
|
|
4152
4152
|
var evidenceIndicator = tmp.ofString('evidence', 2);
|
|
4153
|
-
if (!_this__u8e3s4.context.
|
|
4154
|
-
var tmp_0 = Companion_getInstance_19().
|
|
4155
|
-
return _this__u8e3s4.
|
|
4153
|
+
if (!_this__u8e3s4.context.v1u().containsIndicator(evidenceIndicator) ? !_this__u8e3s4.context.w1u().containsIndicator(evidenceIndicator) : false) {
|
|
4154
|
+
var tmp_0 = Companion_getInstance_19().b2h(_this__u8e3s4, first, new ProbExplanationTerm(Companion_getInstance_21().l3d_1));
|
|
4155
|
+
return _this__u8e3s4.g2g(tmp_0, null, [], 6, null);
|
|
4156
4156
|
}
|
|
4157
4157
|
var evidenceTermVar = Companion_getInstance_1().of('TermVar');
|
|
4158
4158
|
var evidenceTruthVar = Companion_getInstance_1().of('TruthVar');
|
|
4159
4159
|
var tmp_1 = Companion_getInstance_3();
|
|
4160
4160
|
ProblogLib_getInstance();
|
|
4161
4161
|
var subQuery = tmp_1.of('evidence', [evidenceTermVar, evidenceTruthVar]);
|
|
4162
|
-
var tmp_2 = ProbSetConfig_getInstance().
|
|
4162
|
+
var tmp_2 = ProbSetConfig_getInstance().t3g(_this__u8e3s4.context);
|
|
4163
4163
|
Companion_getInstance_5();
|
|
4164
4164
|
var subOptions = tmp_2.setLimit(-1).setLazy(false);
|
|
4165
4165
|
var tmp$ret$10;
|
|
@@ -4177,20 +4177,20 @@
|
|
|
4177
4177
|
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp1_map, 10));
|
|
4178
4178
|
var tmp0_iterator = tmp1_map.j();
|
|
4179
4179
|
while (tmp0_iterator.m()) {
|
|
4180
|
-
var item = tmp0_iterator.
|
|
4180
|
+
var item = tmp0_iterator.n();
|
|
4181
4181
|
var tmp$ret$5;
|
|
4182
4182
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.primitive.ProbSolveEvidence.computeOne.<anonymous>' call
|
|
4183
|
-
var truth = item.
|
|
4184
|
-
var term = item.
|
|
4183
|
+
var truth = item.o1u().a3(evidenceTruthVar);
|
|
4184
|
+
var term = item.o1u().a3(evidenceTermVar);
|
|
4185
4185
|
var tmp_4;
|
|
4186
4186
|
var tmp_5;
|
|
4187
|
-
if ((term == null ? true : term.
|
|
4187
|
+
if ((term == null ? true : term.yw()) ? true : truth == null) {
|
|
4188
4188
|
tmp_5 = true;
|
|
4189
4189
|
} else {
|
|
4190
4190
|
tmp_5 = !(!(truth == null) ? isInterface(truth, Truth) : false);
|
|
4191
4191
|
}
|
|
4192
4192
|
if (tmp_5) {
|
|
4193
|
-
tmp_4 = Companion_getInstance_21().
|
|
4193
|
+
tmp_4 = Companion_getInstance_21().k3d_1;
|
|
4194
4194
|
} else {
|
|
4195
4195
|
var tmp_6 = Companion_getInstance_1();
|
|
4196
4196
|
ProblogLib_getInstance();
|
|
@@ -4205,7 +4205,7 @@
|
|
|
4205
4205
|
var tmp0__get_functor__thl4dk = ProbSolve_getInstance();
|
|
4206
4206
|
tmp$ret$1 = tmp0__get_functor__thl4dk.signature.name;
|
|
4207
4207
|
var tmp_8 = tmp_7.of(tmp$ret$1, [explanationVar, term]);
|
|
4208
|
-
var tmp_9 = _this__u8e3s4.
|
|
4208
|
+
var tmp_9 = _this__u8e3s4.e2j(tmp_8, new Long(0, 0), 2, null);
|
|
4209
4209
|
var tmp1_filterIsInstance = map(tmp_9, ProbSolveEvidence$computeOne$lambda_0(explanationVar));
|
|
4210
4210
|
var tmp_10 = filter(tmp1_filterIsInstance, ProbSolveEvidence$computeOne$lambda_1);
|
|
4211
4211
|
tmp$ret$2 = isInterface(tmp_10, Sequence) ? tmp_10 : THROW_CCE();
|
|
@@ -4214,18 +4214,18 @@
|
|
|
4214
4214
|
var iterator = tmp2_reduce.j();
|
|
4215
4215
|
if (!iterator.m())
|
|
4216
4216
|
throw UnsupportedOperationException_init_$Create$("Empty sequence can't be reduced.");
|
|
4217
|
-
var accumulator = iterator.
|
|
4217
|
+
var accumulator = iterator.n();
|
|
4218
4218
|
while (iterator.m()) {
|
|
4219
4219
|
var tmp$ret$3;
|
|
4220
4220
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.primitive.ProbSolveEvidence.computeOne.<anonymous>.<anonymous>' call
|
|
4221
4221
|
var tmp3__anonymous__ufb84q = accumulator;
|
|
4222
|
-
var tmp4__anonymous__pkmkx7 = iterator.
|
|
4223
|
-
tmp$ret$3 = tmp4__anonymous__pkmkx7.
|
|
4222
|
+
var tmp4__anonymous__pkmkx7 = iterator.n();
|
|
4223
|
+
tmp$ret$3 = tmp4__anonymous__pkmkx7.x3d() === 1.0 ? tmp3__anonymous__ufb84q : tmp3__anonymous__ufb84q.x3d() === 1.0 ? tmp4__anonymous__pkmkx7 : tmp4__anonymous__pkmkx7.or(tmp3__anonymous__ufb84q);
|
|
4224
4224
|
accumulator = tmp$ret$3;
|
|
4225
4225
|
}
|
|
4226
4226
|
tmp$ret$4 = accumulator;
|
|
4227
4227
|
var totalExplanation = tmp$ret$4;
|
|
4228
|
-
tmp_4 = truth.
|
|
4228
|
+
tmp_4 = truth.aw() ? totalExplanation : totalExplanation.not();
|
|
4229
4229
|
}
|
|
4230
4230
|
tmp$ret$5 = tmp_4;
|
|
4231
4231
|
tmp0_mapTo.g(tmp$ret$5);
|
|
@@ -4238,10 +4238,10 @@
|
|
|
4238
4238
|
var tmp0_filterTo = ArrayList_init_$Create$_0();
|
|
4239
4239
|
var tmp0_iterator_0 = tmp2_filter.j();
|
|
4240
4240
|
while (tmp0_iterator_0.m()) {
|
|
4241
|
-
var element = tmp0_iterator_0.
|
|
4241
|
+
var element = tmp0_iterator_0.n();
|
|
4242
4242
|
var tmp$ret$8;
|
|
4243
4243
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.primitive.ProbSolveEvidence.computeOne.<anonymous>' call
|
|
4244
|
-
tmp$ret$8 = !equals(element, Companion_getInstance_21().
|
|
4244
|
+
tmp$ret$8 = !equals(element, Companion_getInstance_21().k3d_1);
|
|
4245
4245
|
if (tmp$ret$8) {
|
|
4246
4246
|
tmp0_filterTo.g(element);
|
|
4247
4247
|
}
|
|
@@ -4251,19 +4251,19 @@
|
|
|
4251
4251
|
var result = tmp$ret$10;
|
|
4252
4252
|
var tmp_12;
|
|
4253
4253
|
if (result.d()) {
|
|
4254
|
-
tmp_12 = Companion_getInstance_21().
|
|
4254
|
+
tmp_12 = Companion_getInstance_21().l3d_1;
|
|
4255
4255
|
} else {
|
|
4256
4256
|
var tmp$ret$12;
|
|
4257
4257
|
// Inline function 'kotlin.collections.reduce' call
|
|
4258
4258
|
var iterator_0 = result.j();
|
|
4259
4259
|
if (!iterator_0.m())
|
|
4260
4260
|
throw UnsupportedOperationException_init_$Create$("Empty collection can't be reduced.");
|
|
4261
|
-
var accumulator_0 = iterator_0.
|
|
4261
|
+
var accumulator_0 = iterator_0.n();
|
|
4262
4262
|
while (iterator_0.m()) {
|
|
4263
4263
|
var tmp$ret$11;
|
|
4264
4264
|
// Inline function 'it.unibo.tuprolog.solve.problog.lib.primitive.ProbSolveEvidence.computeOne.<anonymous>' call
|
|
4265
4265
|
var tmp3__anonymous__ufb84q_0 = accumulator_0;
|
|
4266
|
-
var tmp4__anonymous__pkmkx7_0 = iterator_0.
|
|
4266
|
+
var tmp4__anonymous__pkmkx7_0 = iterator_0.n();
|
|
4267
4267
|
tmp$ret$11 = tmp4__anonymous__pkmkx7_0.and(tmp3__anonymous__ufb84q_0);
|
|
4268
4268
|
accumulator_0 = tmp$ret$11;
|
|
4269
4269
|
}
|
|
@@ -4271,11 +4271,11 @@
|
|
|
4271
4271
|
tmp_12 = tmp$ret$12;
|
|
4272
4272
|
}
|
|
4273
4273
|
var resultExplanation = tmp_12;
|
|
4274
|
-
var tmp_13 = Companion_getInstance_19().
|
|
4275
|
-
return _this__u8e3s4.
|
|
4274
|
+
var tmp_13 = Companion_getInstance_19().b2h(_this__u8e3s4, first, new ProbExplanationTerm(resultExplanation));
|
|
4275
|
+
return _this__u8e3s4.g2g(tmp_13, null, [], 6, null);
|
|
4276
4276
|
};
|
|
4277
|
-
ProbSolveEvidence.prototype.
|
|
4278
|
-
return this.
|
|
4277
|
+
ProbSolveEvidence.prototype.a2k = function (_this__u8e3s4, first) {
|
|
4278
|
+
return this.g2p(_this__u8e3s4, first);
|
|
4279
4279
|
};
|
|
4280
4280
|
var ProbSolveEvidence_instance;
|
|
4281
4281
|
function ProbSolveEvidence_getInstance() {
|
|
@@ -4289,82 +4289,82 @@
|
|
|
4289
4289
|
};
|
|
4290
4290
|
}
|
|
4291
4291
|
function ProbSolveWithEvidence$computeAllSubstitutions$slambda($solutions, $goalExplanationVar, $evidenceExplanationTerm, $this_computeAllSubstitutions, $first, $second, resultContinuation) {
|
|
4292
|
-
this.
|
|
4293
|
-
this.
|
|
4294
|
-
this.
|
|
4295
|
-
this.
|
|
4296
|
-
this.
|
|
4297
|
-
this.
|
|
4292
|
+
this.v3h_1 = $solutions;
|
|
4293
|
+
this.w3h_1 = $goalExplanationVar;
|
|
4294
|
+
this.x3h_1 = $evidenceExplanationTerm;
|
|
4295
|
+
this.y3h_1 = $this_computeAllSubstitutions;
|
|
4296
|
+
this.z3h_1 = $first;
|
|
4297
|
+
this.a3i_1 = $second;
|
|
4298
4298
|
CoroutineImpl.call(this, resultContinuation);
|
|
4299
4299
|
}
|
|
4300
|
-
ProbSolveWithEvidence$computeAllSubstitutions$slambda.prototype.
|
|
4301
|
-
var tmp = this.
|
|
4302
|
-
tmp.
|
|
4303
|
-
tmp.
|
|
4304
|
-
return tmp.
|
|
4300
|
+
ProbSolveWithEvidence$computeAllSubstitutions$slambda.prototype.t2t = function ($this$sequence, $cont) {
|
|
4301
|
+
var tmp = this.u2t($this$sequence, $cont);
|
|
4302
|
+
tmp.bi_1 = Unit_getInstance();
|
|
4303
|
+
tmp.ci_1 = null;
|
|
4304
|
+
return tmp.hi();
|
|
4305
4305
|
};
|
|
4306
|
-
ProbSolveWithEvidence$computeAllSubstitutions$slambda.prototype.
|
|
4307
|
-
return this.
|
|
4306
|
+
ProbSolveWithEvidence$computeAllSubstitutions$slambda.prototype.ti = function (p1, $cont) {
|
|
4307
|
+
return this.t2t(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
4308
4308
|
};
|
|
4309
|
-
ProbSolveWithEvidence$computeAllSubstitutions$slambda.prototype.
|
|
4310
|
-
var suspendResult = this.
|
|
4309
|
+
ProbSolveWithEvidence$computeAllSubstitutions$slambda.prototype.hi = function () {
|
|
4310
|
+
var suspendResult = this.bi_1;
|
|
4311
4311
|
$sm: do
|
|
4312
4312
|
try {
|
|
4313
|
-
var tmp = this.
|
|
4313
|
+
var tmp = this.zh_1;
|
|
4314
4314
|
switch (tmp) {
|
|
4315
4315
|
case 0:
|
|
4316
|
-
this.
|
|
4317
|
-
this.
|
|
4318
|
-
this.
|
|
4316
|
+
this.ai_1 = 6;
|
|
4317
|
+
this.c3i_1 = this.v3h_1.j();
|
|
4318
|
+
this.zh_1 = 1;
|
|
4319
4319
|
continue $sm;
|
|
4320
4320
|
case 1:
|
|
4321
|
-
if (!this.
|
|
4322
|
-
this.
|
|
4321
|
+
if (!this.c3i_1.m()) {
|
|
4322
|
+
this.zh_1 = 5;
|
|
4323
4323
|
continue $sm;
|
|
4324
4324
|
}
|
|
4325
4325
|
|
|
4326
|
-
this.
|
|
4327
|
-
if (this.
|
|
4328
|
-
throw ensureNotNull(this.
|
|
4329
|
-
this.
|
|
4326
|
+
this.d3i_1 = this.c3i_1.n();
|
|
4327
|
+
if (this.d3i_1.c1w())
|
|
4328
|
+
throw ensureNotNull(this.d3i_1.z1v());
|
|
4329
|
+
this.e3i_1 = this.d3i_1.o1u().a3(this.w3h_1);
|
|
4330
4330
|
var tmp_0;
|
|
4331
4331
|
var tmp_1;
|
|
4332
4332
|
var tmp_2;
|
|
4333
|
-
if (this.
|
|
4333
|
+
if (this.x3h_1 == null) {
|
|
4334
4334
|
tmp_2 = true;
|
|
4335
4335
|
} else {
|
|
4336
|
-
var tmp_3 = this.
|
|
4336
|
+
var tmp_3 = this.x3h_1;
|
|
4337
4337
|
tmp_2 = !(tmp_3 instanceof ProbExplanationTerm);
|
|
4338
4338
|
}
|
|
4339
4339
|
|
|
4340
4340
|
if (tmp_2) {
|
|
4341
4341
|
tmp_1 = true;
|
|
4342
4342
|
} else {
|
|
4343
|
-
tmp_1 = this.
|
|
4343
|
+
tmp_1 = this.e3i_1 == null;
|
|
4344
4344
|
}
|
|
4345
4345
|
|
|
4346
4346
|
if (tmp_1) {
|
|
4347
4347
|
tmp_0 = true;
|
|
4348
4348
|
} else {
|
|
4349
|
-
var tmp_4 = this.
|
|
4349
|
+
var tmp_4 = this.e3i_1;
|
|
4350
4350
|
tmp_0 = !(tmp_4 instanceof ProbExplanationTerm);
|
|
4351
4351
|
}
|
|
4352
4352
|
|
|
4353
4353
|
if (tmp_0) {
|
|
4354
|
-
this.
|
|
4355
|
-
suspendResult = this.
|
|
4354
|
+
this.zh_1 = 3;
|
|
4355
|
+
suspendResult = this.b3i_1.z4(Companion_getInstance_9().failed(), this);
|
|
4356
4356
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
4357
4357
|
return suspendResult;
|
|
4358
4358
|
}
|
|
4359
4359
|
continue $sm;
|
|
4360
4360
|
} else {
|
|
4361
|
-
this.
|
|
4362
|
-
this.
|
|
4361
|
+
this.f3i_1 = new ProbExplanationTerm(this.e3i_1.h3c_1.and(this.x3h_1.h3c_1));
|
|
4362
|
+
this.zh_1 = 2;
|
|
4363
4363
|
var tmp_5 = Companion_getInstance_9();
|
|
4364
|
-
var tmp_6 = Companion_getInstance_19().
|
|
4365
|
-
var tmp_7 = Companion_getInstance_19().
|
|
4366
|
-
var tmp_8 = this.
|
|
4367
|
-
suspendResult = this.
|
|
4364
|
+
var tmp_6 = Companion_getInstance_19().b2h(this.y3h_1, this.z3h_1, this.f3i_1);
|
|
4365
|
+
var tmp_7 = Companion_getInstance_19().b2h(this.y3h_1, this.a3i_1, this.x3h_1);
|
|
4366
|
+
var tmp_8 = this.d3i_1.o1u();
|
|
4367
|
+
suspendResult = this.b3i_1.z4(tmp_5.ofSubstitution(tmp_6, [tmp_7, tmp_8.filter(ProbSolveWithEvidence$computeAllSubstitutions$slambda$lambda(this.w3h_1))]), this);
|
|
4368
4368
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
4369
4369
|
return suspendResult;
|
|
4370
4370
|
}
|
|
@@ -4373,38 +4373,38 @@
|
|
|
4373
4373
|
|
|
4374
4374
|
break;
|
|
4375
4375
|
case 2:
|
|
4376
|
-
this.
|
|
4376
|
+
this.zh_1 = 4;
|
|
4377
4377
|
continue $sm;
|
|
4378
4378
|
case 3:
|
|
4379
|
-
this.
|
|
4379
|
+
this.zh_1 = 4;
|
|
4380
4380
|
continue $sm;
|
|
4381
4381
|
case 4:
|
|
4382
|
-
this.
|
|
4382
|
+
this.zh_1 = 1;
|
|
4383
4383
|
continue $sm;
|
|
4384
4384
|
case 5:
|
|
4385
4385
|
return Unit_getInstance();
|
|
4386
4386
|
case 6:
|
|
4387
|
-
throw this.
|
|
4387
|
+
throw this.ci_1;
|
|
4388
4388
|
}
|
|
4389
4389
|
} catch ($p) {
|
|
4390
|
-
if (this.
|
|
4390
|
+
if (this.ai_1 === 6) {
|
|
4391
4391
|
throw $p;
|
|
4392
4392
|
} else {
|
|
4393
|
-
this.
|
|
4394
|
-
this.
|
|
4393
|
+
this.zh_1 = this.ai_1;
|
|
4394
|
+
this.ci_1 = $p;
|
|
4395
4395
|
}
|
|
4396
4396
|
}
|
|
4397
4397
|
while (true);
|
|
4398
4398
|
};
|
|
4399
|
-
ProbSolveWithEvidence$computeAllSubstitutions$slambda.prototype.
|
|
4400
|
-
var i = new ProbSolveWithEvidence$computeAllSubstitutions$slambda(this.
|
|
4401
|
-
i.
|
|
4399
|
+
ProbSolveWithEvidence$computeAllSubstitutions$slambda.prototype.u2t = function ($this$sequence, completion) {
|
|
4400
|
+
var i = new ProbSolveWithEvidence$computeAllSubstitutions$slambda(this.v3h_1, this.w3h_1, this.x3h_1, this.y3h_1, this.z3h_1, this.a3i_1, completion);
|
|
4401
|
+
i.b3i_1 = $this$sequence;
|
|
4402
4402
|
return i;
|
|
4403
4403
|
};
|
|
4404
4404
|
function ProbSolveWithEvidence$computeAllSubstitutions$slambda_0($solutions, $goalExplanationVar, $evidenceExplanationTerm, $this_computeAllSubstitutions, $first, $second, resultContinuation) {
|
|
4405
4405
|
var i = new ProbSolveWithEvidence$computeAllSubstitutions$slambda($solutions, $goalExplanationVar, $evidenceExplanationTerm, $this_computeAllSubstitutions, $first, $second, resultContinuation);
|
|
4406
4406
|
var l = function ($this$sequence, $cont) {
|
|
4407
|
-
return i.
|
|
4407
|
+
return i.t2t($this$sequence, $cont);
|
|
4408
4408
|
};
|
|
4409
4409
|
l.$arity = 1;
|
|
4410
4410
|
return l;
|
|
@@ -4414,13 +4414,13 @@
|
|
|
4414
4414
|
ProblogLib_getInstance();
|
|
4415
4415
|
WithoutSideEffects.call(this, 'prob' + '_solve_with_evidence');
|
|
4416
4416
|
}
|
|
4417
|
-
ProbSolveWithEvidence.prototype.
|
|
4418
|
-
Companion_getInstance_19().
|
|
4419
|
-
Companion_getInstance_19().
|
|
4417
|
+
ProbSolveWithEvidence.prototype.r2p = function (_this__u8e3s4, first, second, third) {
|
|
4418
|
+
Companion_getInstance_19().h2h(_this__u8e3s4, 2);
|
|
4419
|
+
Companion_getInstance_19().n2h(_this__u8e3s4, 2);
|
|
4420
4420
|
var evidenceExplanationVar = Companion_getInstance_1().of('EvidenceExplanation');
|
|
4421
4421
|
var tmp;
|
|
4422
|
-
if (ProbSetConfig_getInstance().
|
|
4423
|
-
tmp = toTerm(Companion_getInstance_21().
|
|
4422
|
+
if (ProbSetConfig_getInstance().s3e(_this__u8e3s4.context)) {
|
|
4423
|
+
tmp = toTerm(Companion_getInstance_21().l3d_1);
|
|
4424
4424
|
} else {
|
|
4425
4425
|
var tmp_0 = Companion_getInstance_3();
|
|
4426
4426
|
var tmp$ret$0;
|
|
@@ -4428,8 +4428,8 @@
|
|
|
4428
4428
|
var tmp0__get_functor__thl4dk = ProbSolveEvidence_getInstance();
|
|
4429
4429
|
tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
|
|
4430
4430
|
var subQuery = tmp_0.of(tmp$ret$0, [evidenceExplanationVar]);
|
|
4431
|
-
var solution = _this__u8e3s4.subSolver().solveOnceWithOptions(subQuery, ProbSetConfig_getInstance().
|
|
4432
|
-
tmp = solution.
|
|
4431
|
+
var solution = _this__u8e3s4.subSolver().solveOnceWithOptions(subQuery, ProbSetConfig_getInstance().t3g(_this__u8e3s4.context));
|
|
4432
|
+
tmp = solution.o1u().a3(evidenceExplanationVar);
|
|
4433
4433
|
}
|
|
4434
4434
|
var evidenceExplanationTerm = tmp;
|
|
4435
4435
|
var goalExplanationVar = Companion_getInstance_1().of('GoalExplanation');
|
|
@@ -4439,11 +4439,11 @@
|
|
|
4439
4439
|
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
4440
4440
|
var tmp1__get_functor__4k11yf = ProbSolve_getInstance();
|
|
4441
4441
|
tmp$ret$1 = tmp1__get_functor__4k11yf.signature.name;
|
|
4442
|
-
var solutions = tmp_1.solveWithOptions(tmp_2.of(tmp$ret$1, [goalExplanationVar, third]), ProbSetConfig_getInstance().
|
|
4442
|
+
var solutions = tmp_1.solveWithOptions(tmp_2.of(tmp$ret$1, [goalExplanationVar, third]), ProbSetConfig_getInstance().t3g(_this__u8e3s4.context));
|
|
4443
4443
|
return sequence(ProbSolveWithEvidence$computeAllSubstitutions$slambda_0(solutions, goalExplanationVar, evidenceExplanationTerm, _this__u8e3s4, first, second, null));
|
|
4444
4444
|
};
|
|
4445
|
-
ProbSolveWithEvidence.prototype.
|
|
4446
|
-
return this.
|
|
4445
|
+
ProbSolveWithEvidence.prototype.n2j = function (_this__u8e3s4, first, second, third) {
|
|
4446
|
+
return this.r2p(_this__u8e3s4, first, second, third);
|
|
4447
4447
|
};
|
|
4448
4448
|
var ProbSolveWithEvidence_instance;
|
|
4449
4449
|
function ProbSolveWithEvidence_getInstance() {
|
|
@@ -4456,10 +4456,10 @@
|
|
|
4456
4456
|
ProblogLib_getInstance();
|
|
4457
4457
|
RuleWrapper_init_$Init$('prob', 2, false, 4, null, this);
|
|
4458
4458
|
}
|
|
4459
|
-
Prob.prototype.
|
|
4459
|
+
Prob.prototype.g2k = function (_this__u8e3s4) {
|
|
4460
4460
|
return _this__u8e3s4.ktListOf([_this__u8e3s4.varOf('EXPL'), _this__u8e3s4.varOf('GOAL')]);
|
|
4461
4461
|
};
|
|
4462
|
-
Prob.prototype.
|
|
4462
|
+
Prob.prototype.h2k = function (_this__u8e3s4) {
|
|
4463
4463
|
var expl = _this__u8e3s4.varOf('EXPL');
|
|
4464
4464
|
var goal = _this__u8e3s4.varOf('GOAL');
|
|
4465
4465
|
var newGoal = _this__u8e3s4.varOf('NEW_GOAL');
|
|
@@ -4478,50 +4478,50 @@
|
|
|
4478
4478
|
return Prob_instance;
|
|
4479
4479
|
}
|
|
4480
4480
|
//region block: post-declaration
|
|
4481
|
-
ProblogSolver.prototype.
|
|
4482
|
-
MutableProblogSolver.prototype.
|
|
4481
|
+
ProblogSolver.prototype.u1x = copy$default;
|
|
4482
|
+
MutableProblogSolver.prototype.u1x = copy$default;
|
|
4483
4483
|
MutableProblogSolver.prototype.loadStaticClauses = loadStaticClauses;
|
|
4484
4484
|
MutableProblogSolver.prototype.loadStaticClausesIterable = loadStaticClausesIterable;
|
|
4485
4485
|
MutableProblogSolver.prototype.loadStaticClausesSequence = loadStaticClausesSequence;
|
|
4486
4486
|
MutableProblogSolver.prototype.loadDynamicClauses = loadDynamicClauses;
|
|
4487
4487
|
MutableProblogSolver.prototype.loadDynamicClausesIterable = loadDynamicClausesIterable;
|
|
4488
4488
|
MutableProblogSolver.prototype.loadDynamicClausesSequence = loadDynamicClausesSequence;
|
|
4489
|
-
ProblogSolverFactory.prototype.
|
|
4490
|
-
ProblogSolverFactory.prototype.
|
|
4491
|
-
ProblogSolverFactory.prototype.
|
|
4492
|
-
ProblogSolverFactory.prototype.
|
|
4489
|
+
ProblogSolverFactory.prototype.r1y = solverOf$default;
|
|
4490
|
+
ProblogSolverFactory.prototype.t1y = solverOf$default_0;
|
|
4491
|
+
ProblogSolverFactory.prototype.x1y = mutableSolverOf$default;
|
|
4492
|
+
ProblogSolverFactory.prototype.b1z = mutableSolverOf$default_0;
|
|
4493
4493
|
ProblogSolverFactory.prototype.newBuilder = newBuilder;
|
|
4494
|
-
ProblogSolverFactory.prototype.
|
|
4495
|
-
ProblogSolverFactory.prototype.
|
|
4496
|
-
ProblogSolverFactory.prototype.
|
|
4497
|
-
ProblogSolverFactory.prototype.
|
|
4498
|
-
ProblogSolverFactory.prototype.
|
|
4499
|
-
ProblogSolverFactory.prototype.
|
|
4500
|
-
ProblogSolverFactory.prototype.
|
|
4501
|
-
ProblogSolverFactory.prototype.
|
|
4502
|
-
ProblogSolverFactory.prototype.
|
|
4503
|
-
ProblogSolverFactory.prototype.
|
|
4504
|
-
ProblogSolverFactory.prototype.
|
|
4505
|
-
ProblogSolverFactory.prototype.
|
|
4494
|
+
ProblogSolverFactory.prototype.z1x = get_defaultRuntime;
|
|
4495
|
+
ProblogSolverFactory.prototype.b1y = get_defaultUnificator;
|
|
4496
|
+
ProblogSolverFactory.prototype.f1y = get_defaultStaticKb;
|
|
4497
|
+
ProblogSolverFactory.prototype.g1y = get_defaultDynamicKb;
|
|
4498
|
+
ProblogSolverFactory.prototype.h1y = get_defaultInputChannel;
|
|
4499
|
+
ProblogSolverFactory.prototype.i1y = get_defaultOutputChannel;
|
|
4500
|
+
ProblogSolverFactory.prototype.j1y = get_defaultErrorChannel;
|
|
4501
|
+
ProblogSolverFactory.prototype.k1y = get_defaultWarningsChannel;
|
|
4502
|
+
ProblogSolverFactory.prototype.u1y = solverWithDefaultBuiltins;
|
|
4503
|
+
ProblogSolverFactory.prototype.v1y = solverWithDefaultBuiltins$default;
|
|
4504
|
+
ProblogSolverFactory.prototype.y1y = mutableSolverWithDefaultBuiltins;
|
|
4505
|
+
ProblogSolverFactory.prototype.z1y = mutableSolverWithDefaultBuiltins$default;
|
|
4506
4506
|
DefaultBuiltins.prototype.containsSignature = containsSignature;
|
|
4507
4507
|
DefaultBuiltins.prototype.containsOperator = containsOperator;
|
|
4508
4508
|
DefaultBuiltins.prototype.hasPrimitive = hasPrimitive;
|
|
4509
4509
|
DefaultBuiltins.prototype.hasFunction = hasFunction;
|
|
4510
|
-
DefaultBuiltins.prototype.
|
|
4510
|
+
DefaultBuiltins.prototype.m2e = get_ruleSignatures;
|
|
4511
4511
|
DefaultBuiltins.prototype.hasProtected = hasProtected;
|
|
4512
4512
|
MinimalBuiltins.prototype.containsSignature = containsSignature;
|
|
4513
4513
|
MinimalBuiltins.prototype.containsOperator = containsOperator;
|
|
4514
4514
|
MinimalBuiltins.prototype.hasPrimitive = hasPrimitive;
|
|
4515
4515
|
MinimalBuiltins.prototype.hasFunction = hasFunction;
|
|
4516
|
-
MinimalBuiltins.prototype.
|
|
4516
|
+
MinimalBuiltins.prototype.m2e = get_ruleSignatures;
|
|
4517
4517
|
MinimalBuiltins.prototype.hasProtected = hasProtected;
|
|
4518
4518
|
ProblogLib.prototype.containsSignature = containsSignature;
|
|
4519
4519
|
ProblogLib.prototype.containsOperator = containsOperator;
|
|
4520
4520
|
ProblogLib.prototype.hasPrimitive = hasPrimitive;
|
|
4521
4521
|
ProblogLib.prototype.hasFunction = hasFunction;
|
|
4522
|
-
ProblogLib.prototype.
|
|
4522
|
+
ProblogLib.prototype.m2e = get_ruleSignatures;
|
|
4523
4523
|
ProblogLib.prototype.hasProtected = hasProtected;
|
|
4524
|
-
BinaryDecisionDiagramExplanation.prototype.
|
|
4524
|
+
BinaryDecisionDiagramExplanation.prototype.y3d = get_probabilityOrNull;
|
|
4525
4525
|
//endregion
|
|
4526
4526
|
//region block: init
|
|
4527
4527
|
ANNOTATION_FUNCTOR = '::';
|