Struct biodivine_sketchbook::sketchbook::model::UpdateFn
source · pub struct UpdateFn {
expression: String,
tree: Option<FnTree>,
}
Expand description
Update function of a BooleanNetwork
.
Fields§
§expression: String
§tree: Option<FnTree>
Implementations§
source§impl UpdateFn
impl UpdateFn
sourcepub fn try_from_str(
expression: &str,
context: &ModelState,
) -> Result<UpdateFn, String>
pub fn try_from_str( expression: &str, context: &ModelState, ) -> Result<UpdateFn, String>
Create new UpdateFn
from a provided expression.
The expression is either a valid update fn expression or an empty (possible whitespace) string.
sourcepub fn new_empty() -> UpdateFn
pub fn new_empty() -> UpdateFn
Make an “empty” update function (same as Self::default).
sourcepub fn get_fn_expression(&self) -> &str
pub fn get_fn_expression(&self) -> &str
Get function’s expression.
sourcepub fn is_unspecified(&self) -> bool
pub fn is_unspecified(&self) -> bool
Check if the update function is empty (fully unspecified).
sourcepub fn set_fn_expression(
&mut self,
new_expression: &str,
context: &ModelState,
) -> Result<(), String>
pub fn set_fn_expression( &mut self, new_expression: &str, context: &ModelState, ) -> Result<(), String>
Set the update function’s expression to a given string.
sourcepub fn to_fn_update(&self, context: &BooleanNetwork) -> Option<FnUpdate>
pub fn to_fn_update(&self, context: &BooleanNetwork) -> Option<FnUpdate>
Return a set of all variables that are actually used as inputs in this function.
sourcepub fn collect_variables(&self) -> HashSet<VarId>
pub fn collect_variables(&self) -> HashSet<VarId>
Return a set of all variables that are actually used as inputs in this function.
sourcepub fn collect_fn_symbols(&self) -> HashSet<UninterpretedFnId>
pub fn collect_fn_symbols(&self) -> HashSet<UninterpretedFnId>
Return a set of all uninterpreted fns that are actually used in this function.
sourcepub fn substitute_var(
&mut self,
old_id: &VarId,
new_id: &VarId,
context: &ModelState,
)
pub fn substitute_var( &mut self, old_id: &VarId, new_id: &VarId, context: &ModelState, )
Substitute all occurrences of a given function symbol in the syntactic tree.
sourcepub fn substitute_fn_symbol(
&mut self,
old_id: &UninterpretedFnId,
new_id: &UninterpretedFnId,
context: &ModelState,
)
pub fn substitute_fn_symbol( &mut self, old_id: &UninterpretedFnId, new_id: &UninterpretedFnId, context: &ModelState, )
Substitute all occurrences of a given function symbol in the syntactic tree.
sourcepub fn with_substituted_fn_symbol(
original_fn: UpdateFn,
old_id: &UninterpretedFnId,
new_id: &UninterpretedFnId,
context: &ModelState,
) -> UpdateFn
pub fn with_substituted_fn_symbol( original_fn: UpdateFn, old_id: &UninterpretedFnId, new_id: &UninterpretedFnId, context: &ModelState, ) -> UpdateFn
Create update function from another one, substituting all occurrences of a given function symbol in the syntactic tree. The provided original function object is consumed.
sourcepub fn with_substituted_var(
original_fn: UpdateFn,
old_id: &VarId,
new_id: &VarId,
context: &ModelState,
) -> UpdateFn
pub fn with_substituted_var( original_fn: UpdateFn, old_id: &VarId, new_id: &VarId, context: &ModelState, ) -> UpdateFn
Create update function from another one, substituting all occurrences of a given variable in the syntactic tree. The provided original function object is consumed.
Trait Implementations§
source§impl<'de> Deserialize<'de> for UpdateFn
impl<'de> Deserialize<'de> for UpdateFn
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for UpdateFn
impl StructuralPartialEq for UpdateFn
Auto Trait Implementations§
impl Freeze for UpdateFn
impl RefUnwindSafe for UpdateFn
impl Send for UpdateFn
impl Sync for UpdateFn
impl Unpin for UpdateFn
impl UnwindSafe for UpdateFn
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.