Analogs of Gröbner Bases in Polynomial Rings over a Ring