A Formalisation of Adaptable Pervasive Flows