pub struct BddParameterEncoder {
pub bdd_variables: BddVariableSet,
regulators: Vec<Vec<VariableId>>,
explicit_function_tables: Vec<Vec<BddVariable>>,
implicit_function_tables: Vec<Vec<BddVariable>>,
}
Expand description
Handles the translation between parameters of the BooleanNetwork
and BddVariables
.
There are two types of parameters in the BooleanNetwork
- explicit and implicit.
Explicit are the named parameters that are specifically declared in the update functions. Implicit are the anonymous parameters representing the missing update functions.
Every explicit and implicit Parameter
maps to a set of BddVariables
that represent
the values in its function table. The responsibility of this struct is to create all
BddVariables
and maintain how they map to individual parameters.
Fields
bdd_variables: BddVariableSet
The actual BddVariableSet
used to represent the parameters - use this for .dot
printing etc.
regulators: Vec<Vec<VariableId>>
The actual regulators of each variable - these are used when evaluating implicit parameters.
explicit_function_tables: Vec<Vec<BddVariable>>
A vector of function tables indexed by explicit ParameterId
s of the BooleanNetwork
.
implicit_function_tables: Vec<Vec<BddVariable>>
A vector of implicit function tables indexed by VariableId
s of the BooleanNetwork
.
If the variable has an explicit update function, the table is empty.
Implementations
sourceimpl BddParameterEncoder
impl BddParameterEncoder
sourcepub fn new(bn: &BooleanNetwork) -> BddParameterEncoder
pub fn new(bn: &BooleanNetwork) -> BddParameterEncoder
Create a new BddParameterEncoder
based on information given in a BooleanNetwork
.
sourcepub fn new_with_custom_variables(
bn: &BooleanNetwork,
bdd: BddVariableSetBuilder
) -> BddParameterEncoder
pub fn new_with_custom_variables(
bn: &BooleanNetwork,
bdd: BddVariableSetBuilder
) -> BddParameterEncoder
Create a new BddParameterEncoder
based on information given in a BooleanNetwork
and with variables already provided via BddVariableSetBuilder
.
pub(crate) fn build_explicit_function_table(
network: &BooleanNetwork,
bdd: &mut BddVariableSetBuilder
) -> Vec<Vec<BddVariable>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub(crate) fn build_implicit_function_table(
network: &BooleanNetwork,
bdd: &mut BddVariableSetBuilder
) -> Vec<Vec<BddVariable>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub(crate) fn build_regulators_table(
network: &BooleanNetwork
) -> Vec<Vec<VariableId>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourcepub fn implicit_function_table(
&self,
target: VariableId
) -> Vec<FunctionTableEntry<'_>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn implicit_function_table(
&self,
target: VariableId
) -> Vec<FunctionTableEntry<'_>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
A vector of entries in the table of a specific function.
sourcepub fn get_implicit_for_table(
&self,
entry: &FunctionTableEntry<'_>
) -> BddParams
pub fn get_implicit_for_table(
&self,
entry: &FunctionTableEntry<'_>
) -> BddParams
Get teh parameters which correspond to a specific table entry being one.
pub fn get_implicit_var_for_table(
&self,
entry: &FunctionTableEntry<'_>
) -> BddVariable
sourcepub fn get_explicit(
&self,
state: IdState,
parameter: ParameterId,
arguments: &[VariableId]
) -> BddVariable
pub fn get_explicit(
&self,
state: IdState,
parameter: ParameterId,
arguments: &[VariableId]
) -> BddVariable
Find the BddVariable
corresponding to the value of the parameter
function
in the given state
assuming the specified arguments
.
sourcepub fn explicit_true_when(
&self,
state: IdState,
parameter: ParameterId,
arguments: &[VariableId]
) -> BddParams
pub fn explicit_true_when(
&self,
state: IdState,
parameter: ParameterId,
arguments: &[VariableId]
) -> BddParams
Make a BddParams
set which corresponds to the valuations for which the value of
parameter
function given arguments
is true
in the given state
.
sourcepub fn get_implicit(&self, state: IdState, variable: VariableId) -> BddVariable
pub fn get_implicit(&self, state: IdState, variable: VariableId) -> BddVariable
Find the BddVariable
corresponding to the value of the implicit update function
of the given variable
in the given state
.
sourcepub fn implicit_true_when(
&self,
state: IdState,
variable: VariableId
) -> BddParams
pub fn implicit_true_when(
&self,
state: IdState,
variable: VariableId
) -> BddParams
Make a BddParams
set which corresponds to the valuations for which the value of
an implicit update function of variable
is true in the given state
.
fn compute_table_index(state: IdState, args: &[VariableId]) -> usize
Trait Implementations
sourceimpl Clone for BddParameterEncoder
impl Clone for BddParameterEncoder
sourcefn clone(&self) -> BddParameterEncoder
fn clone(&self) -> BddParameterEncoder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for BddParameterEncoder
impl Send for BddParameterEncoder
impl Sync for BddParameterEncoder
impl Unpin for BddParameterEncoder
impl UnwindSafe for BddParameterEncoder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more