Relational cost analysis in a functional-imperative setting. (2nd November 2021)