!7 cmodule IWantYouToBePrelude > DynPrintLog { transient LS inputs = tlft([[ I want you to be my mother I want you to be my assistant ]]); // the facts transient Set facts = tlft_ciSet([[ Computery is usery's assistant It is impossible that {Computery is usery's mother} ]]); // the rules transient WordTokRule rule_iWantYouToBe = wordTokReplacerRule( "I want you to be my assistant", "assistant", "I want that {you are my assistant}"); transient WordTokRule rule_useryWants = new WordTokRule("Usery wants that X", "X") { run { S x_simplified = simpleSpaces_nTok(getVar("X")); if (contains(facts, x_simplified)) emit(extMarkAs answer("But " + x_simplified + " already")); else if (contains(facts, "It is impossible that " + curly(x_simplified))) emit(extMarkAs answer("No way brother")); else if (debug) print("Can't decide on: " + x_simplified); } }; // rules by space transient MultiMap rulesForSpace = litmultimap( MultiSpaceReasoning1.userSpace, ll(rule_iWantYouToBe), MultiSpaceReasoning1.objectiveSpace, ll(rule_useryWants) ); start-thread-printDone { new MultiSpaceReasoning1 mr; mr.addRules(rulesForSpace); for (S input : printIterate_nl(inputs)) { Collection outputs = mr.reason_inputToAnswer(input); printLinesIndent("[Bot] ", extFilterByFlag answer(outputs)); } } }