POSITIVE SEMIDEFINITENESS OF DISCRETE QUADRATIC FUNCTIONALS