Rational agents: prioritized goals, goal dynamics, and agent programming languages with declarative goals