Injecting (Micro)Intelligence in the IoT: Logic-Based Approaches for (M)MAS