Foundations of Distributed Artificial Intelligence