Inference and attack in Bayesian networks