implementation of valuations for rings