Multi-Agent Plan Recognition: Formalization and Algorithms