A calculus of challenges and responses