The idealsaturate command computes a basis for the saturation of A by B. An optional argument P is the modulus, which should be a machine size prime.
A = [(x+1)*y^2]; B = [y]; idealsaturate(A,B); [1+x]