Nesting analysis of mobile ambients