(VAR x xs ys) (RULES @([], xs) -> xs @(::(x, xs), ys) -> ::(x, @(xs, ys)) rev([]) -> [] rev(::(x, xs)) -> @(rev(xs),::(x, [])) )