Procedure from library spcurve.lib (see spcurve_lib).
spcurve.lib
CMtype(i); i an ideal, CM of codimension 2
Cohen-Macaulay type of i (integer) (-1, if i is not Cohen-Macaulay of codimension 2)
Example:
LIB "spcurve.lib"; ring r=32003,(x,y,z),ds; ideal i=xy,xz,yz; CMtype(i); → 2