svoid test_FactStore() { PhilosophyBot1 bot = new([[ $x weighs $y => proc { delete all (last time $x weighed $z) store (last time $x weighed $y) } ]]); //bot.printNonMatches = true; bot.parseProgram(); new SimpleFactStore fs; fs.verbose = true; philosophyBot1_factStore(bot, fs, debug := true); bot.addFact("a weighs (50 pounds)"); bot.addFact("b weighs (55 pounds)"); bot.think(); assertEqualsVerbose(ll( "last time a weighed (50 pounds)", "last time b weighed (55 pounds)"), sorted(fs.facts())); bot.addFact("a weighs (52 pounds)"); bot.think(); assertEqualsVerbose(ll( "last time a weighed (52 pounds)", "last time b weighed (55 pounds)"), sorted(fs.facts())); }