The Logic of Counterfactuals and the Epistemology of Causal Inference