check monoid laws