A Logic based Approach to Interaction Design in Open Multi-Agent Systems