Warning: session_start(): open(/var/lib/php/sessions/sess_5u7b0dsl6libuata95mblvgt3q, 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
!7
set flag DynModule.
sclass TestBot extends DynObjectTable {
InputChooser inputChooser = new(this);
S source;
S inputAs = "Input:"; // "Input:" or "Fact:"
bool unsafeEvals, showFailed;
int maxEntries = 100;
transient ReliableSingleThread rst = new(r { update(inputChooser.input()) });
start {
dm_useLocalMechListCopies();
set transpileRaw_useDiskCache;
inputChooser.delay = 1000;
itemToMap = itemToMap_ExecutedRule();
}
visualize {
ret withMargin(northAndCenter(vstackWithSpacing(
westAndCenter(dm_fieldComboBox('inputAs,
ll("Input:", "Fact:")),
wrap(inputChooser)),
withLabel("Rules mech lists (empty for default rules&facts):",
onEnter(dm_fieldTextField('source), rThread doIt)),
jrightalignedline(
main.onChange(dm_fieldCheckBox("Allow unsafe evals", 'unsafeEvals), rThread doIt),
main.onChange(dm_fieldCheckBox("Show failed rules", 'showFailed), rThread doIt),
jlabel("Show"), jminwidth(50, jLiveValueIntTextField(dm_fieldLiveValueWithNotify('maxEntries, r doIt))), jlabel("entries")
)),
super.visualize()));
}
void doIt { rst.trigger(); }
void update { if (inputChooser.update()) update(inputChooser.input()); }
void update(S input) {
temp enter();
final bool inputAsFact = cic(inputAs, 'fact);
NLLogicChecker_v2.staticVerbose = true;
NLLogic_MultiThreadedEngine engine = new(ai_rulesAndFactsFromMechLists(or2(trim(source), "")));
engine.unsafeEvals = unsafeEvals;
engine.showFailed = showFailed;
engine.seedInput(input);
engine.fullRun();
L all = engine.executedRules();
L l = takeFirst(maxEntries, all);
print("Showing " + l(l) + " out of " + l(all));
setData(l);
}
}