!include once #1027630 // Msg cmodule NewEngineSpike > DynPrintLog { L msgs; transient new NewEngine engine; start-thread { if (empty(msgs)) setField(msgs := mainCruddieLog()); print("Have " + nMessages(msgs)); pnlStruct(takeFirst(2, msgs)); L msgs2 = whereFieldIsTrue fromUser(msgs); for (Msg msg : takeFirst(5, msgs2)) engine.addFact(ll(msg, Fragment("was understood correctly"))); engine.addFact(ll(get(msgs2, 5), Fragment("is a wrong recognition"))); engine.addLogicRule(new BasicLogicRule( ll("$x", Fragment("is a wrong recognition")), ll("$x", Fragment("should be corrected")))); engine.addLogicRule(new BasicLogicRule( ll("$x", Fragment("should be corrected")), ll("$x", Fragment("is a wrong recognition")))); engine.think(); } }