Modeling Social Emotions in Intelligent Agents Based on the Mental State Formalism