ordered semigroup reduce functions