static boolean isNoMoreThanTwoElementList(Term t) { if (t.getType() != TermType.LIST) { return false; } Term tail = t.getArgument(1); return tail.getType() != TermType.LIST; }