private boolean isSingleResultTailRecursive(List<ClauseModel> facts, Term[] args) { TailRecursivePredicateMetaData metaData = TailRecursivePredicateMetaData.create(kb, facts); assertNotNull(metaData); for (int i = 0; i < args.length; i++) { if (metaData.isSingleResultIfArgumentImmutable(i) && args[i].getType().isVariable() == false) { return true; } } return false; }
private void assertNotTailRecursive(String... prologClauses) { setClauses(prologClauses); TailRecursivePredicateMetaData metaData = TailRecursivePredicateMetaData.create(kb, clauses); assertNull(metaData); }