A Qualitative Theory of Cognitive Attitudes and their Change