This correspondence contains a straightforward generalization of decod
ing of BCH codes to the decoding of algebraic-geometric codes, couched
in terms of varieties, ideals, and Grobner bases. This consists of 1)
a Berlekamp-Massey-type lattice-shifting row-reduction algorithm with
majority voting similar to algorithms in the current literature, 2) a
realization that it produces a minimal Grobner basis B for the error-
locator ideal I(V) relative to a particular weighted total degree mono
mial ordering, 3) a factoring of that basis into several minimal PLEX
bases, that facilitates finding the variety V of error positions, and
4) a direct generalization of Forney's formula to calculate error magn
itudes using functions sigma p, which are by-products of this factorin
g.