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