!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.addFormattedFact("* was understood correctly", msg); engine.addFormattedFact("* is a wrong recognition", get(msgs2, 5)); 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(); } }