Warning: session_start(): open(/var/lib/php/sessions/sess_ukd549lhimr9r3n9v1dop10htg, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
abstract sclass DynPhilosophyBotTextArea extends DynTextArea {
S output, logicRules, factsOut;
transient PhilosophyBot1 bot;
transient ReliableSingleThread rstRunProgram = dm_rst(this, r runProgram);
transient JLabel lblStatus;
transient ReliableSingleThread rstLogicRules = dm_rst(this, r showLogicRules);
transient ReliableSingleThread rstFactsOut = dm_rst(this, r showFactsDeduced);
visual jvsplit(
jCenteredSection("Program", super),
centerAndSouth(
jhsplit(
jCenteredSection("Output", dm_textArea_scrollDown_readOnly output()),
jCenteredSection("Facts deduced", dm_textArea_scrollDown_readOnly factsOut())
),
withRightMargin(lblStatus = jRightAlignedLabel())));
start {
grabInterval = 1.0;
dm_watchFieldAndNow text(rstRunProgram);
}
void runProgram {
temp tempMiniLoadingAnim();
time {
setField(output := hijackPrint(r {
pcall {
bot = new PhilosophyBot1(text);
bot.printFactsAfterThinking = false;
bot.onLogicRuleAdded.add(rule -> rstLogicRules.run());
bot.onFactAdded.add(f -> rstFactsOut.run());
bot.standardImports();
philosophyBot1_addEnableableExtension(bot, "autoJava",
_bot -> philosophyBot_autoJava(_bot));
bot.run();
bot.checkExpectations();
}
}));
}
main setText(lblStatus, lastTiming_formatted());
}
void showLogicRules {
setField(logicRules := joinWithEmptyLines(allToString(cloneList(bot.logicRules))));
}
void showFactsDeduced {
setField(factsOut := lines(bot.factsDeduced()));
}
}