A Formal Model for Programming Wireless Sensor