sbool ai_deriveFacts_debug; static Set ai_deriveFacts(L rules, LS facts) { final new NLLogicChecker_v3 c; final new NLLogicChecker_v2.Matching m; final new LinkedHashSet outFacts; for (final IfThen rule : nlLogic_filterByRHSConstructs(rules, 'fact)) { if (ai_deriveFacts_debug) print("ai_deriveFacts: Checking " + rule); c.iterate(rule.in, m, r { //print("Got matches: " + sfu(m.matches)); Exp out = c.apply(rule.out, m); if (out cast Func) if (eq(out.name, "fact")) outFacts.add(nlLogic_text(out.arg)); }); } ret outFacts; }