Skip to main content

DumpHeader

Struct DumpHeader 

Source
pub struct DumpHeader { /* private fields */ }
Expand description

Information from the header of a DDDMP file

Implementations§

Source§

impl DumpHeader

Source

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.

Source

pub fn diagram_name(&self) -> Option<&str>

Name of the decision diagram

Corresponds to the DDDMP .dd field.

Source

pub fn num_nodes(&self) -> usize

Number of nodes in the dumped decision diagram

Corresponds to the DDDMP .nnodes field.

Source

pub fn num_vars(&self) -> u32

Number of all variables in the exported decision diagram

Corresponds to the DDDMP .nvars field.

Source

pub fn num_support_vars(&self) -> u32

Number of variables in the true support of the decision diagram

Corresponds to the DDDMP .nsuppvars field.

Source

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.

Source

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].

Source

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.

Source

pub fn support_var_permutation(&self) -> &[LevelNo]

👎Deprecated since 0.11.0:

use support_var_to_level instead

Deprecated alias for Self::support_var_to_level()

Source

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.

Source

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.

Source

pub fn num_roots(&self) -> usize

Number of roots

import() returns this number of roots on success. Corresponds to the DDDMP .nroots field.

Source

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.

Trait Implementations§

Source§

impl Debug for DumpHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.