Probabilistic Counterfactuals: Semantics, Computation, and Applications