function pi = compute_pi_bnode(bnode, bnet)

switch bnode.type
  case 'adder',
    pi = compute_pi_adder(bnode, bnet);
  case 'mux',
    pi = compute_pi_mux(bnode, bnet);
  case 'mux2',
    pi = compute_pi_mux2(bnode, bnet);
  case 'noisyor',
    pi = compute_pi_nor(bnode, bnet);
  case 'tabular',
    pi = compute_pi_tabular(bnode, bnet);
  otherwise,
    error('bad type');
end
