!7 cmodule TestPhilosophyEngine > DynPrintLog { sS program = [[ program ( count count => proc { while (i < 100): inc i } ) with declarations (transient int i;) and init code ( bot.addNativePredicate("i < 100", () -> i < 100); bot.addNativePredicate("inc i", () -> { ++i; print("Incremented i to " + i); true; }); ) should end with (i == 100) ]]; start-thread { new PhilosophyBot1 main; main.program = program; main.run(); pnl(main.facts); for (SS map : main.listFactsMatching("program x should end with y")) { S program = map.get("x"), endCondition = map.get("y"); printVars(+program, +endCondition); } } }