fix-semantics-size: Make size and size_pred tail recursive