I wonder whether OCCAM would be usable here, or if not, then something based on the lessons learnt from it.
(https://en.wikipedia.org/wiki/Communicating_sequential_proce...)
(https://en.wikipedia.org/wiki/Communicating_sequential_proce...)