All non-BIF material in the file, for example human-readable text, must
be enclosed in comment markers.
The (unique) network block must appear at the very beginning of the file.
Following the network block, variable and probability blocks may appear
interspersed. However, each probability block, relating a child variable
to zero or more parent variables, must appear after the variable block(s)
defining these variables.
Non-negative reals (i.e., probabilities) are allowed to not contain a
decimal point.
By BNT format we mean
MATLAB
code that can be executed to create a Bayes net under
Kevin Murphy's Bayes Net Toolbox (BNT).
More specifically, this converter returns a MATLAB script that, when run with
BNT in the MATLAB path, creates 4 variables in the current workspace:
bnet
The Bayes net represented by the input BIF file. The number of
possible values for each (discrete) variable is stored in the row vector
bnet.node_sizes.
adjacency
The adjacency matrix of the network, equal to bnet.dag.
node
A structure array whose field names are the names of each variable
(wherein hyphens are replaced with underscores), and whose field values are
the (topologically sorted and 1-based) indices of each variable.
value
A row cell array of cells, each of which is a column cell array of strings
corresponding to a network node, listing the names of each possible value of
the node.