Types and function for bayesian network