Foundations of distributed interaction systems