implementation of Knuth–Bendix completion algorithm