!7 cmodule Spike > DynPrintLog { transient S program = [[ import bool import or open theory rules { on $x say $out & input matches $x => say $out on $x or $y say $out & ((input matches $x) | (input matches $y)) => say $out } theory test1 { on hello say yo input hello expect (say yo) } ]]; start-thread { PhilosophyBot1 bot = makeBot(input); bot.addFact("on hello say yo"); bot.run(); assertTrue(bot.hasFact("say yo")); } PhilosophyBot1 makeBot() { PhilosophyBot1 bot = new(program); new Var input; //bot.autoOpenTheories(); bot.onFactDo("input $x", map -> { input.set($x(map)); true; }); bot.addNativePredicate("input matches $x", map -> match($x(map), input!)); ret bot; } }