HAMILTON-JACOBI THEORY FOR CONSTRAINED SYSTEMS