Generalised distributivity and the logic of metric spaces