A theory of interaction semantics