Source: https://www.cs.nott.ac.uk/~pszgmh/popl.pdf