Warning: session_start(): open(/var/lib/php/sessions/sess_lu2e07b1i11biikivmcvfohtfm, 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
svoid applyRule_random(S ruleID) {
// process the rule
Lisp rule = getLispTruth(ruleID);
if (rule == null) { print("Rule not found: " + ruleID); ret; }
//print("Applying rule " + ruleID);
print_setPrefixForThread(ruleID + "> ");
try {
L conditions = dropLast(rule.args);
Lisp out = last(rule.args);
//for (Lisp cond : conditions) print("Condition: " + cond);
new Map matches;
int n = matchConditions_random(conditions, matches);
if (n == -1) {
print("Yo! " + struct(matches));
out = lispReplaceVars(out, matches);
if (lispTrue(out))
print("Already had: " + out);
else {
print("Defining: " + lispToEnglish_prettier(out));
emit(out, ruleID);
}
} else
print("Only " + n + " of " + n(conditions, "condition") + " met");
} finally {
print_setPrefixForThread("");
}
}