pub struct SymbolicContext {
bdd: BddVariableSet,
state_variables: Vec<BddVariable>,
parameter_variables: Vec<BddVariable>,
explicit_function_tables: Vec<FunctionTable>,
implicit_function_tables: Vec<Option<FunctionTable>>,
}
Expand description
Symbolic context manages the mapping between entities of the Boolean network
(variables, parameters, uninterpreted functions) and BddVariables
used in bdd-lib
.
It also provides utility methods for creating Bdd
objects that match different conditions
imposed on the parameter space of the network.
Note that while this is technically public, it should not be used unless absolutely necessary.
Playing with raw BDDs
is dangerous.
Fields
bdd: BddVariableSet
state_variables: Vec<BddVariable>
parameter_variables: Vec<BddVariable>
explicit_function_tables: Vec<FunctionTable>
implicit_function_tables: Vec<Option<FunctionTable>>
Implementations
sourceimpl SymbolicContext
impl SymbolicContext
sourcepub fn new(network: &BooleanNetwork) -> Result<SymbolicContext, String>
pub fn new(network: &BooleanNetwork) -> Result<SymbolicContext, String>
Create a new SymbolicContext
that is based on the given BooleanNetwork
.
sourcepub fn bdd_variable_set(&self) -> &BddVariableSet
pub fn bdd_variable_set(&self) -> &BddVariableSet
Provides access to the raw Bdd
context.
sourcepub fn state_variables(&self) -> &Vec<BddVariable>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn state_variables(&self) -> &Vec<BddVariable>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Getter for variables encoding the state variables of the network.
sourcepub fn get_implicit_function_table(
&self,
variable: VariableId
) -> &FunctionTable
pub fn get_implicit_function_table(
&self,
variable: VariableId
) -> &FunctionTable
Getter for the entire function table of an implicit update function.
sourcepub fn get_explicit_function_table(
&self,
parameter: ParameterId
) -> &FunctionTable
pub fn get_explicit_function_table(
&self,
parameter: ParameterId
) -> &FunctionTable
Getter for the entire function table of an explicit parameter.
sourcepub fn parameter_variables(&self) -> &Vec<BddVariable>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn parameter_variables(&self) -> &Vec<BddVariable>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Getter for variables encoding the parameter variables of the network.
sourcepub fn mk_constant(&self, value: bool) -> Bdd
pub fn mk_constant(&self, value: bool) -> Bdd
Create a constant true/false Bdd
.
sourcepub fn mk_state_variable_is_true(&self, variable: VariableId) -> Bdd
pub fn mk_state_variable_is_true(&self, variable: VariableId) -> Bdd
Create a Bdd
that is true when given network variable is true.
sourcepub fn mk_uninterpreted_function_is_true(
&self,
parameter: ParameterId,
args: &[VariableId]
) -> Bdd
pub fn mk_uninterpreted_function_is_true(
&self,
parameter: ParameterId,
args: &[VariableId]
) -> Bdd
Create a Bdd
that is true when given explicit uninterpreted function (aka parameter)
is true for given arguments.
sourcepub fn mk_implicit_function_is_true(
&self,
variable: VariableId,
args: &[VariableId]
) -> Bdd
pub fn mk_implicit_function_is_true(
&self,
variable: VariableId,
args: &[VariableId]
) -> Bdd
Create a Bdd
that is true when given implicit uninterpreted function is true for
given arguments.
Panic: Variable must have an implicit uninterpreted function.
sourcepub fn mk_fn_update_true(&self, function: &FnUpdate) -> Bdd
pub fn mk_fn_update_true(&self, function: &FnUpdate) -> Bdd
Create a Bdd
that is true when given FnUpdate
evaluates to true.
sourcefn mk_function_table_true(
&self,
function_table: &FunctionTable,
args: &[Bdd]
) -> Bdd
fn mk_function_table_true(
&self,
function_table: &FunctionTable,
args: &[Bdd]
) -> Bdd
(internal) Create a Bdd
that is true when given FunctionTable
evaluates to true,
assuming each argument is true when the corresponding Bdd
in the args
array is true.
Note that this actually allows functions which do not have just variables as arguments.
sourcefn instantiate_function_table(
&self,
valuation: &BddValuation,
function_table: &FunctionTable,
args: &[Bdd]
) -> Bdd
fn instantiate_function_table(
&self,
valuation: &BddValuation,
function_table: &FunctionTable,
args: &[Bdd]
) -> Bdd
Create a Bdd
which represents an instantiated function table.
This means the Bdd
only depends on variables which appear in args
and the
actual semantics to each row of the FunctionTable
is assigned based on
the given valuation
.
sourcepub fn instantiate_implicit_function(
&self,
valuation: &BddValuation,
variable: VariableId,
args: &[VariableId]
) -> Bdd
pub fn instantiate_implicit_function(
&self,
valuation: &BddValuation,
variable: VariableId,
args: &[VariableId]
) -> Bdd
Create a Bdd
which represents the instantiated implicit uninterpreted function.
sourcepub fn instantiate_uninterpreted_function(
&self,
valuation: &BddValuation,
parameter: ParameterId,
args: &[VariableId]
) -> Bdd
pub fn instantiate_uninterpreted_function(
&self,
valuation: &BddValuation,
parameter: ParameterId,
args: &[VariableId]
) -> Bdd
Create a Bdd
which represents the instantiated explicit uninterpreted function.
sourcepub fn instantiate_fn_update(
&self,
valuation: &BddValuation,
function: &FnUpdate
) -> Bdd
pub fn instantiate_fn_update(
&self,
valuation: &BddValuation,
function: &FnUpdate
) -> Bdd
Create a Bdd
which represents the instantiated FnUpdate
.
Trait Implementations
sourceimpl Clone for SymbolicContext
impl Clone for SymbolicContext
sourcefn clone(&self) -> SymbolicContext
fn clone(&self) -> SymbolicContext
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 SymbolicContext
impl Send for SymbolicContext
impl Sync for SymbolicContext
impl Unpin for SymbolicContext
impl UnwindSafe for SymbolicContext
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