We consider the problem of minimizing a polynomial over a semi-algebraic set defined by polynomial equalities and inequalities. When the polynomial equalities have a finite number of complex solutions and define a radical ideal we can reformulate this problem as a semidefinite programming problem. This semidefinite program involves combinatorial moment matrices, which are matrices indexed by a basis of the quotient vector space R[x 1 , . . . , x n ]/I. Our arguments are elementary and extend known facts for the grid case including 0/1 and polynomial programming. They also relate to known algebraic tools for solving polynomial systems of equations with finitely many complex solutions. Semidefinite approximations can be constructed by considering truncated combinatorial moment matrices; rank conditions are given (in a grid case) that ensure that the approximation solves the original problem at optimality.