The Role of Counterfactual Thinking in Reasoning