A way of computing the Hilbert series