Reflexive-transitive closure snippet.