Generalizations of Kochen and Specker's theorem and the effectiveness of Gleason's theorem