SINGULAR example: a complete version can be found in the SINGULAR library homog.lib.
proc qmod (module M, module N)
//USAGE: qmod(<module_M>,<module_N>);
// N a submodule of M, a submodule of a free one
//COMPUTE: presentation S of M/N, i.e. M/N<<--F<--[S],
// F free of rank = size(M),
//RETURNS: module(S)
{
return(lift(M,N)+syz(M));
}
proc ext (int n, ideal i)
// COMPUTES: Ext^n(R/i,R); i ideal in the basering R
// USAGE: ext(<int>,<ideal>);
// SHOWS: degree of Ext^n
// RETURN: Ext as quotient of a free module
{
//----------------- compute resulution of R/i ----------
// 0<--R/i<--L(0)<--[i]--L(1)<--[RE[2]]--- ...
list RE=mres(i,n+1);
//----------------- apply Hom(_,R) at n-th place -------
module g = module(transpose(matrix(RE[n+1])));
module f = module(transpose(matrix(RE[n])));
//----------------- ker(g)/im(f) -----------------------
module ext = qmod(syz(g),f);
//---- return Ext as quotient of a free module (std) ----
return(std(ext));
}