Closing the sensing-reasoning-actuating loop in resource-constrained WSANs through distributed symbolic processing