Rule Compilation in Multi-Tenant Networks