Warning: session_start(): open(/var/lib/php/sessions/sess_8q7j91i5bo0sq55rbopi4jll2c, 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 PhilosophyBot extends DynPrintLog {
transient S program = [[
"memory"
memory can mean RAM
RAM has a size
I have RAM
input is x & x can mean y => pretend (input is y)
input is x => activate facts containing x
I have x => Ask something about (my x)
// General patterns in flight now:
// my *
// Ask something about *
// pretend *
// input is *
// (and more)
Procedures
----------
Ask something about x {
if (x exists):
ask (what is x?)
else:
ask (does x exist?)
for (y | x has a y):
assume ((the y of my x) exists)
ask something about (the y of my x)
}
the answer to x is y => the answer to x is known
ask a & the answer to x is known => don't (ask a)
Ask x {
print x
on input:
if (input is a valid answer to x):
store (the answer to x is input)
}
(x exists) is a valid answer to (does x exist)
(x doesn't exist) is a valid answer to (does x exist)
(x is y) is a valid answer to (what is x)
]];
start-thread {
// split into paragraphs and unindent
LS paragraphs = map autoUnindent(splitAtEmptyLines(program));
print("Got " + n2(paragraphs, "parapraph"));
// print the parapraphs
print(joinWithEmptyLines(map(s -> indentx("> ", s), paragraphs)));
// throw away comment-only and quoted paragraphs (assume it's a title)
LS paragraphs2 = antiFilter(paragraphs, s -> isSingleLine(trim(s)) && isQuoted(trim(s)) || countJavaTokens(s) == 0);
print("Got " + n2(paragraphs2, "filtered paragraph"));
print(joinWithEmptyLines(map(s -> indentx("> ", s), paragraphs2)));
}
}