A Calculus of Cyber-Physical Systems