Categorical Bayesian Network Inference