arguments: n:int degrees:intarray weights:intarray
Create a monoid having n variables, which has the gradings from 'degrees' and the ordering from 'weights'