— Wireless sensor network (WSN) architectures often feature a (single) base station in charge of coordinating the application functionality. Although this assumption simplified the path to adoption of WSN technology, researchers are now being attracted by more decentralized architectures with multiple sinks and heterogeneous nodes. These scenarios are brought to an extreme in Wireless Sensor and Actor Networks (WSANs), where sensing and acting nodes collaborate in a decentralized fashion to implement complex control loops. In these settings, new ing abstractions are required to manage complexity and heterogeneity without sacrificing efficiency. In this paper we propose and define a logical neighborgramming abstraction. A logical neighborhood includes nearby nodes that satisfy predicates over their static (e.g., type) or dynamic (e.g., sensed values) characteristics. The span of the neighborhood and the definition of its predicates are specified declaratively, along with require...