pub struct DumpHeader { /* private fields */ }Expand description
Information from the header of a DDDMP file
Implementations§
Source§impl DumpHeader
impl DumpHeader
Sourcepub fn load(input: impl BufRead) -> Result<Self>
pub fn load(input: impl BufRead) -> Result<Self>
Load the DDDMP header of the given input
This always needs to be called before import() to retrieve some
necessary information and to position the input’s cursor.
Sourcepub fn diagram_name(&self) -> Option<&str>
pub fn diagram_name(&self) -> Option<&str>
Name of the decision diagram
Corresponds to the DDDMP .dd field.
Sourcepub fn num_nodes(&self) -> usize
pub fn num_nodes(&self) -> usize
Number of nodes in the dumped decision diagram
Corresponds to the DDDMP .nnodes field.
Sourcepub fn num_vars(&self) -> u32
pub fn num_vars(&self) -> u32
Number of all variables in the exported decision diagram
Corresponds to the DDDMP .nvars field.
Sourcepub fn num_support_vars(&self) -> u32
pub fn num_support_vars(&self) -> u32
Number of variables in the true support of the decision diagram
Corresponds to the DDDMP .nsuppvars field.
Sourcepub fn support_vars(&self) -> &[VarNo] ⓘ
pub fn support_vars(&self) -> &[VarNo] ⓘ
Variables in the true support of the decision diagram. Concretely, these
are indices of the original variable numbering. Hence, the returned
slice contains DumpHeader::num_support_vars() integers in strictly
ascending order.
Example: Consider a decision diagram that was created with the variables
x, y, and z, in this order (x is the top-most variable). Suppose
that only y and z are used by the dumped functions. Then, the
returned slice is [1, 2], regardless of any subsequent reordering.
Corresponds to the DDDMP .ids field.
Sourcepub fn support_var_order(&self) -> &[VarNo] ⓘ
pub fn support_var_order(&self) -> &[VarNo] ⓘ
Order of the support variables
The returned slice is always DumpHeader::num_support_vars() elements
long and represents a mapping from positions to variable numbers.
Example: Consider a decision diagram that was created with the variables
x, y, and z (x is the top-most variable). The variables were
re-ordered to z, x, y. Suppose that only y and z are used by
the dumped functions. Then, the returned slice is [2, 1].
Sourcepub fn support_var_to_level(&self) -> &[LevelNo] ⓘ
pub fn support_var_to_level(&self) -> &[LevelNo] ⓘ
Mapping from the variables in the true support of the decision diagram to their levels.
The returned slice is always DumpHeader::num_support_vars()
elements long. If the value at the ith index is l, then the ith
support variable is at level l in the dumped decision diagram. By the
ith support variable, we mean the variable header.support_vars()[i]
in the original numbering.
Example: Consider a decision diagram that was created with the variables
x, y, and z (x is the top-most variable). The variables were
re-ordered to z, x, y. Suppose that only y and z are used by
the dumped functions. Then, the returned slice is [2, 0].
Corresponds to the DDDMP .permids field.
Sourcepub fn support_var_permutation(&self) -> &[LevelNo] ⓘ
👎Deprecated since 0.11.0: use support_var_to_level instead
pub fn support_var_permutation(&self) -> &[LevelNo] ⓘ
use support_var_to_level instead
Deprecated alias for Self::support_var_to_level()
Sourcepub fn auxiliary_var_ids(&self) -> &[u32]
pub fn auxiliary_var_ids(&self) -> &[u32]
Auxiliary variable IDs. The returned slice contains
DumpHeader::num_support_vars() elements.
Corresponds to the DDDMP .auxids field.
Sourcepub fn var_names(&self) -> Option<&[String]>
pub fn var_names(&self) -> Option<&[String]>
Names of all variables in the decision diagram. If
present, the returned slice contains DumpHeader::num_vars()
many elements. The order is the “original” variable order.
Corresponds to the DDDMP .varnames field, but .orderedvarnames and
.suppvarnames are also considered if one of the fields is missing. All
variable names are non-empty unless only .suppvarnames is given in the
input (in which case only the names of support variables are non-empty).
The return value is only None if neither of .varnames,
.orderedvarnames, and .suppvarnames is present in the input.
Sourcepub fn num_roots(&self) -> usize
pub fn num_roots(&self) -> usize
Number of roots
import() returns this number of roots on success.
Corresponds to the DDDMP .nroots field.
Sourcepub fn root_names(&self) -> Option<&[String]>
pub fn root_names(&self) -> Option<&[String]>
Names of roots, if present, in the same order as returned by
import()
Corresponds to the DDDMP .rootnames field.