modify semiring definition