Correctness of Local Probability Propagation in Graphical Models with Loops