scope nlLogic_unresolvedFactsToQuestions. sbool #debug; static Collection nlLogic_unresolvedFactsToQuestions(RuleFailInfo ruleFail) { if (ruleFail == null) ret emptyList(); Exp e = nlLogic_applyMatches(nlLogic_firstCondition(ruleFail.remainingConditions), ruleFail.matches); // Now have: fact(bla) in e if (e cast Func) if (eq(e.name, 'fact)) { S fact = "Unresolved fact: " + e.arg.text(); if (debug) print(fact); Pair, LS> p = ai_activeRulesAndFacts(ll(fact)); ret ai_deriveOutput(p.a, p.b); } ret emptyList(); } static Collection nlLogic_unresolvedFactsToQuestions(Collection ruleFails) { new LinkedHashSet out; for (RuleFailInfo fail : ruleFails) addAll(out, nlLogic_unresolvedFactsToQuestions(fail)); ret out; } end scope