This idea is taken from the paper "Towards a session logic for communication protocols" by Cracium et al.