Programming Multi-agent Systems