Anchoring institutions in agents' attitudes: towards a logical framework for autonomous multi-agent systems