Enum biodivine_lib_param_bn::FnUpdate
source · [−]pub enum FnUpdate {
Const(bool),
Var(VariableId),
Param(ParameterId, Vec<VariableId>),
Not(Box<FnUpdate>),
Binary(BinaryOp, Box<FnUpdate>, Box<FnUpdate>),
}
Expand description
A Boolean update function formula which references
Variables
and Parameters
of a BooleanNetwork
.
An update function specifies the evolution rules for one specific Variable
of a
BooleanNetwork
. The arguments used in the function must be the same as specified
by the RegulatoryGraph
of the network.
Variants
Const(bool)
A true/false constant.
Var(VariableId)
References a network variable.
Param(ParameterId, Vec<VariableId>)
References a network parameter (uninterpreted function).
The variable list are the arguments of the function invocation.
Not(Box<FnUpdate>)
Negation.
Binary(BinaryOp, Box<FnUpdate>, Box<FnUpdate>)
Binary boolean operation.
Implementations
sourceimpl FnUpdate
impl FnUpdate
sourcepub fn try_from_expression(
expression: BooleanExpression,
graph: &RegulatoryGraph
) -> Option<FnUpdate>
pub fn try_from_expression(
expression: BooleanExpression,
graph: &RegulatoryGraph
) -> Option<FnUpdate>
Convert a BooleanExpression
to a FnUpdate
, using RegulatoryGraph
to resolve variable
names.
sourceimpl FnUpdate
impl FnUpdate
Constructor and destructor utility methods. These mainly avoid unnecessary boxing and exhaustive pattern matching when not necessary.
sourcepub fn mk_var(id: VariableId) -> FnUpdate
pub fn mk_var(id: VariableId) -> FnUpdate
Create an x
formula where x
is a Boolean variable.
sourcepub fn mk_param(id: ParameterId, args: &[VariableId]) -> FnUpdate
pub fn mk_param(id: ParameterId, args: &[VariableId]) -> FnUpdate
Create a p(x_1, ..., x_k)
formula where p
is a parameter function and x_1
through
x_k
are its arguments.
sourcepub fn mk_not(inner: FnUpdate) -> FnUpdate
pub fn mk_not(inner: FnUpdate) -> FnUpdate
Create a !phi
formula, where phi
is an inner FnUpdate
.
sourcepub fn mk_binary(op: BinaryOp, left: FnUpdate, right: FnUpdate) -> FnUpdate
pub fn mk_binary(op: BinaryOp, left: FnUpdate, right: FnUpdate) -> FnUpdate
Create a phi 'op' psi
where phi
and psi
are arguments of op
operator.
sourcepub fn as_var(&self) -> Option<VariableId>
pub fn as_var(&self) -> Option<VariableId>
If Var
, return the id, otherwise return None
.
sourcepub fn as_param(&self) -> Option<(ParameterId, &[VariableId])>
pub fn as_param(&self) -> Option<(ParameterId, &[VariableId])>
If Param
, return the id and args, otherwise return None
.
sourceimpl FnUpdate
impl FnUpdate
Other utility methods.
sourcepub fn collect_arguments(&self) -> Vec<VariableId>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn collect_arguments(&self) -> Vec<VariableId>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Return a sorted vector of all variables that are actually used as inputs in this function.
sourcepub fn collect_parameters(&self) -> Vec<ParameterId>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn collect_parameters(&self) -> Vec<ParameterId>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Return a sorted vector of all parameters (i.e. uninterpreted functions) that are used in this update function.
sourcepub fn to_string(&self, context: &BooleanNetwork) -> String
pub fn to_string(&self, context: &BooleanNetwork) -> String
Convert this update function to a string, taking names from the provided BooleanNetwork
.
Trait Implementations
impl Eq for FnUpdate
impl StructuralEq for FnUpdate
impl StructuralPartialEq for FnUpdate
Auto Trait Implementations
impl RefUnwindSafe for FnUpdate
impl Send for FnUpdate
impl Sync for FnUpdate
impl Unpin for FnUpdate
impl UnwindSafe for FnUpdate
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