Warning: session_start(): open(/var/lib/php/sessions/sess_ajqqel56uq8ncr0rimcf75iknb, 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
cmodule WTC > DynPrintLog {
transient S program = [[
theory (discord token) {
synonym token = (discord token)
synonym bot = (discord bot)
a token is something a bot needs in order to connect to discord
}
a $a is something a $b needs in order to $c
& $d is a $b
& $d wants to $c
=> $d needs a $a
pattern (x wants to y)
gazelle is a bot
gazelle wants to (connect to discord)
expect (gazelle needs a token)
]];
start-thread {
PhilosophyBot1 bot = new(program);
bot.run();
new Matches m;
assertEquals(ll(litmap("$x" := "gazelle needs a token")),
bot.matchFacts("expect $x"));
assertEquals("logic rules", 1, l(bot.logicRules));
// open the theory
for (SS map : bot.matchFacts_keepBrackets("theory $x $y")) {
S s = map.get("$y");
print("Raw theory: " + quote(s));
bot.loadProgram(withoutLeadingLinesEmptyAfterTrim_autoUnindent(s));
print("Opened theory " + tok_deRoundOrCurlyBracket(map.get("$x")));
}
// assert that fact from theory was loaded
assertContainsIC(bot.facts, "a token is something a bot needs in order to connect to discord");
print("Theory opened OK.");
pnl("RULE", bot.logicRules);
bot.run();
}
}