A software engineering approach for law-governed open multi-agent systems