reduce function

Reduction of a word to reduced form