return visitChildren(term, expectedSort, actualSort); } else if (expectedSort.equals(Sorts.K())) { if (actualSort.equals(Sorts.KItem())) { return KSequence(visitChildren(term, Sorts.KItem(), actualSort)); } else { return KSequence(KApply(KLabel("inj", actualSort, Sorts.KItem()), KList(visitChildren(term, Sorts.KItem(), actualSort)), Att.empty().add(Sort.class, Sorts.KItem()))); if (collectionIsMap(collectionLabel)) { return KApply(elementLabel, KList(k.klist().items().get(0), visitChildren(k, expectedSort, actualSort)), Att.empty().add(Sort.class, expectedSort)); } else { return KApply(elementLabel, KList(visitChildren(k, expectedSort, actualSort)), Att.empty().add(Sort.class, expectedSort)); return KApply(KLabel("inj", actualSort, expectedSort), KList(visitChildren(term, expectedSort, actualSort)), Att.empty().add(Sort.class, expectedSort));