A Logic-Based Analysis of Responsibility