Influence and Responsibility: A Logical Analysis