As sensor networks become common and enable new applications, developing powerful paradigms for programming sensor networks becomes critical to realize their full potential as collaborative data processing engines. In this article, we propose a deductive framework for programming sensor networks, based on the observation that the sensor network can be viewed as a distributed database of facts g...