function lambda = compute_lambda_msg(bnode, bnet, p)

switch bnode.type
  case 'adder',
    lambda = compute_lambda_msg_adder(bnode, bnet, p);
  case 'mux',
    lambda = compute_lambda_msg_mux(bnode, bnet, p);
  case 'mux2',
    lambda = compute_lambda_msg_mux2(bnode, bnet, p);
  case 'noisyor',
    lambda = compute_lambda_msg_nor(bnode, bnet, p);
  case 'tabular',
    lambda = compute_lambda_msg_tabular(bnode, bnet, p);
  otherwise,
    error('bad type');
end
