Local computations with probabilities on graphical structures and their application to expert systems