An algorithm for proving identities with Riordan transformations