 ring R = 0, (w,x,y,z), dp;
module I = [x,0,z2,0,y2z], [0,x,yz,0,y3], [w,0,0,yz,z3],
[0,w,0,y2,yz2], [0,1,w,0,xz], [0,w,0,y2,yz2],
[x2,y2,wy2+xz2];
print(I);
==> x, 0, w, 0, 0, 0, x2,
==> 0, x, 0, w, 1,w, y2,
==> z2,yz,0, 0, w,0, wy2+xz2,
==> 0, 0, yz, y2, 0, y2, 0,
==> y2z,y3, z3,yz2,xz,yz2,0
// (1) Check on degrees:
// =====================
attrib(I,"isHomog"); // attribute not set => empty output
==>
homog(I);
==> 1
attrib(I,"isHomog");
==> 2,2,1,1,0
print(betti(I,0),"betti"); // read degrees from Betti diagram
==> 0 1
==> 
==> 0: 1 
==> 1: 2 1
==> 2: 2 5
==> 3:  1
==> 
==> total: 5 7
==>
// (2) Shift degrees:
// ==================
def J=I;
intvec DV = 0,0,1,1,2;
attrib(J,"isHomog",DV); // assign new weight vector
attrib(J,"isHomog");
==> 0,0,1,1,2
print(betti(J,0),"betti");
==> 0 1
==> 
==> 2: 1 
==> 1: 2 1
==> 0: 2 5
==> 1:  1
==> 
==> total: 5 7
==>
intmat bettiI=betti(I,0); // degree corresponding to first nonzero row
// of Betti diagram is accessible via
// attribute "rowShift"
attrib(bettiI);
==> attr:rowShift, type int
intmat bettiJ=betti(J,0);
attrib(bettiJ);
==> attr:rowShift, type int
// (3) Graded free resolutions:
// ============================
resolution resJ = mres(J,0);
attrib(resJ);
==> attr:isHomog, type intvec
print(betti(resJ),"betti");
==> 0 1 2
==> 
==> 2: 1  
==> 1: 2  
==> 0: 1 4 
==> 1:   1
==> 
==> total: 4 4 1
==>
attrib(betti(resJ));
==> attr:rowShift, type int
