pub struct StatProperty {
name: String,
annotation: String,
variant: StatPropertyType,
}
Expand description
A typesafe representation of various kinds of static properties.
Each property has a name
and field variant
encompassing inner data.
The formula that will be internally created (usually, apart from generic variant) depends on
particular type of the property - there are multiple variants
of properties, each carrying
its own different metadata that are later used to build the formula.
Fields§
§name: String
§annotation: String
§variant: StatPropertyType
Implementations§
source§impl StatProperty
impl StatProperty
Creating static properties.
sourcefn new_raw(
name: &str,
variant: StatPropertyType,
annotation: &str,
) -> StatProperty
fn new_raw( name: &str, variant: StatPropertyType, annotation: &str, ) -> StatProperty
(internal) Shorthand to create a property given its already created internal
StatPropertyType
data, name, and annotation.
sourcepub fn try_mk_generic(
name: &str,
raw_formula: &str,
annotation: &str,
) -> Result<StatProperty, String>
pub fn try_mk_generic( name: &str, raw_formula: &str, annotation: &str, ) -> Result<StatProperty, String>
Create “generic” StatProperty
instance directly from a formula, which must be in a
correct format (which is verified).
sourcepub fn mk_regulation_essential(
name: &str,
input: Option<VarId>,
target: Option<VarId>,
value: Essentiality,
annotation: &str,
) -> StatProperty
pub fn mk_regulation_essential( name: &str, input: Option<VarId>, target: Option<VarId>, value: Essentiality, annotation: &str, ) -> StatProperty
Create StatProperty
instance describing that an input of an update function is essential.
sourcepub fn mk_regulation_essential_context(
name: &str,
input: Option<VarId>,
target: Option<VarId>,
value: Essentiality,
context: String,
annotation: &str,
) -> StatProperty
pub fn mk_regulation_essential_context( name: &str, input: Option<VarId>, target: Option<VarId>, value: Essentiality, context: String, annotation: &str, ) -> StatProperty
Create StatProperty
instance describing that an input of an update function is essential
in a certain context.
sourcepub fn mk_regulation_monotonic(
name: &str,
input: Option<VarId>,
target: Option<VarId>,
value: Monotonicity,
annotation: &str,
) -> StatProperty
pub fn mk_regulation_monotonic( name: &str, input: Option<VarId>, target: Option<VarId>, value: Monotonicity, annotation: &str, ) -> StatProperty
Create StatProperty
instance describing that an input of an update function is monotonic.
sourcepub fn mk_regulation_monotonic_context(
name: &str,
input: Option<VarId>,
target: Option<VarId>,
value: Monotonicity,
context: String,
annotation: &str,
) -> StatProperty
pub fn mk_regulation_monotonic_context( name: &str, input: Option<VarId>, target: Option<VarId>, value: Monotonicity, context: String, annotation: &str, ) -> StatProperty
Create StatProperty
instance describing that an input of an update function is monotonic
in a certain context.
sourcepub fn mk_fn_input_essential(
name: &str,
input_index: Option<usize>,
target: Option<UninterpretedFnId>,
value: Essentiality,
annotation: &str,
) -> StatProperty
pub fn mk_fn_input_essential( name: &str, input_index: Option<usize>, target: Option<UninterpretedFnId>, value: Essentiality, annotation: &str, ) -> StatProperty
Create StatProperty
instance describing that an input of an uninterpreted function
is essential.
sourcepub fn mk_fn_input_essential_context(
name: &str,
input_index: Option<usize>,
target: Option<UninterpretedFnId>,
value: Essentiality,
context: String,
annotation: &str,
) -> StatProperty
pub fn mk_fn_input_essential_context( name: &str, input_index: Option<usize>, target: Option<UninterpretedFnId>, value: Essentiality, context: String, annotation: &str, ) -> StatProperty
Create StatProperty
instance describing that an input of an uninterpreted function
is essential in a certain context.
sourcepub fn mk_fn_input_monotonic(
name: &str,
input_index: Option<usize>,
target: Option<UninterpretedFnId>,
value: Monotonicity,
annotation: &str,
) -> StatProperty
pub fn mk_fn_input_monotonic( name: &str, input_index: Option<usize>, target: Option<UninterpretedFnId>, value: Monotonicity, annotation: &str, ) -> StatProperty
Create StatProperty
instance describing that an input of an uninterpreted function
is monotonic.
sourcepub fn mk_fn_input_monotonic_context(
name: &str,
input_index: Option<usize>,
target: Option<UninterpretedFnId>,
value: Monotonicity,
context: String,
annotation: &str,
) -> StatProperty
pub fn mk_fn_input_monotonic_context( name: &str, input_index: Option<usize>, target: Option<UninterpretedFnId>, value: Monotonicity, context: String, annotation: &str, ) -> StatProperty
Create StatProperty
instance describing that an input of an uninterpreted function
is monotonic in a certain context.
sourcepub fn default(variant: SimpleStatPropertyType) -> StatProperty
pub fn default(variant: SimpleStatPropertyType) -> StatProperty
Create default StatProperty
instance of specified variant.
sourcepub fn default_generic() -> StatProperty
pub fn default_generic() -> StatProperty
Create default “generic” StatProperty
instance, representing “true” formula.
sourcepub fn default_regulation_essential() -> StatProperty
pub fn default_regulation_essential() -> StatProperty
Create default StatProperty
instance for regulation essentiality (with empty input
and
target
fields and Unknown
essentiality).
sourcepub fn default_regulation_essential_context() -> StatProperty
pub fn default_regulation_essential_context() -> StatProperty
Create default StatProperty
instance for regulation essentiality in a context
(with empty input
, target
, and context
fields and Unknown
essentiality).
sourcepub fn default_regulation_monotonic() -> StatProperty
pub fn default_regulation_monotonic() -> StatProperty
Create default StatProperty
instance for regulation monotonicity (with empty input
and
target
fields and Unknown
monotonicity).
sourcepub fn default_regulation_monotonic_context() -> StatProperty
pub fn default_regulation_monotonic_context() -> StatProperty
Create default StatProperty
instance for regulation monotonicity in a context
(with empty input
, target
, and context
fields and Unknown
monotonicity).
sourcepub fn default_fn_input_essential() -> StatProperty
pub fn default_fn_input_essential() -> StatProperty
Create default StatProperty
instance for function input essentiality (with empty input
and target
fields and Unknown
essentiality).
sourcepub fn default_fn_input_essential_context() -> StatProperty
pub fn default_fn_input_essential_context() -> StatProperty
Create default StatProperty
instance for function input essentiality in a context
(with empty input
, target
, and context
fields and Unknown
essentiality).
sourcepub fn default_fn_input_monotonic() -> StatProperty
pub fn default_fn_input_monotonic() -> StatProperty
Create default StatProperty
instance for function input monotonicity (with empty input
and target
fields and Unknown
monotonicity).
sourcepub fn default_fn_input_monotonic_context() -> StatProperty
pub fn default_fn_input_monotonic_context() -> StatProperty
Create default StatProperty
instance for function input monotonicity in a context
(with empty input
, target
, and context
fields and Unknown
monotonicity).
source§impl StatProperty
impl StatProperty
Editing static properties.
sourcepub fn set_annotation(&mut self, annotation: &str)
pub fn set_annotation(&mut self, annotation: &str)
Set property’s annotation string.
sourcepub fn set_input_var(&mut self, new_var: VarId) -> Result<(), String>
pub fn set_input_var(&mut self, new_var: VarId) -> Result<(), String>
Update property’s sub-field for input variable (of an update fn), where applicable.
If not applicable, return Err
.
sourcepub fn set_input_index(&mut self, new_idx: usize) -> Result<(), String>
pub fn set_input_index(&mut self, new_idx: usize) -> Result<(), String>
Update property’s sub-field for index of input (of an uninterpreted fn), where applicable.
If not applicable, return Err
.
sourcepub fn set_target_fn(
&mut self,
new_target: UninterpretedFnId,
) -> Result<(), String>
pub fn set_target_fn( &mut self, new_target: UninterpretedFnId, ) -> Result<(), String>
Update property’s sub-field for target uninterpreted fn, where applicable.
If not applicable, return Err
.
sourcepub fn set_target_var(&mut self, new_target: VarId) -> Result<(), String>
pub fn set_target_var(&mut self, new_target: VarId) -> Result<(), String>
Update property’s sub-field for target variable, where applicable.
If not applicable, return Err
.
sourcepub fn set_monotonicity(
&mut self,
monotonicity: Monotonicity,
) -> Result<(), String>
pub fn set_monotonicity( &mut self, monotonicity: Monotonicity, ) -> Result<(), String>
Update property’s sub-field for monotonicity, where applicable.
If not applicable, return Err
.
sourcepub fn set_essentiality(
&mut self,
essentiality: Essentiality,
) -> Result<(), String>
pub fn set_essentiality( &mut self, essentiality: Essentiality, ) -> Result<(), String>
Update property’s sub-field for essentiality, where applicable.
If not applicable, return Err
.
sourcepub fn set_context(&mut self, context: String) -> Result<(), String>
pub fn set_context(&mut self, context: String) -> Result<(), String>
Update property’s sub-field for context, where applicable.
If not applicable, return Err
.
source§impl StatProperty
impl StatProperty
Observing static properties.
sourcepub fn get_annotation(&self) -> &str
pub fn get_annotation(&self) -> &str
Get annotation string.
sourcepub fn get_prop_data(&self) -> &StatPropertyType
pub fn get_prop_data(&self) -> &StatPropertyType
Get property’s variant with all the underlying data.
sourcepub fn assert_fully_filled(&self) -> Result<(), String>
pub fn assert_fully_filled(&self) -> Result<(), String>
Check that the property has all required fields filled out. If some of the required field is set to None, return error.
source§impl StatProperty
impl StatProperty
Static methods to automatically generate IDs to encode regulation properties.
sourcepub fn get_monotonicity_prop_id(
regulator: &VarId,
target: &VarId,
) -> StatPropertyId
pub fn get_monotonicity_prop_id( regulator: &VarId, target: &VarId, ) -> StatPropertyId
Get ID of a static property that describes monotonicity of a regulation
between regulator
and target
.
sourcepub fn get_essentiality_prop_id(
regulator: &VarId,
target: &VarId,
) -> StatPropertyId
pub fn get_essentiality_prop_id( regulator: &VarId, target: &VarId, ) -> StatPropertyId
Get ID of a static property that describes essentiality of a regulation
between regulator
and target
.
Trait Implementations§
source§impl Clone for StatProperty
impl Clone for StatProperty
source§fn clone(&self) -> StatProperty
fn clone(&self) -> StatProperty
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StatProperty
impl Debug for StatProperty
source§impl<'de> Deserialize<'de> for StatProperty
impl<'de> Deserialize<'de> for StatProperty
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>,
source§impl Hash for StatProperty
impl Hash for StatProperty
source§impl PartialEq for StatProperty
impl PartialEq for StatProperty
source§impl Serialize for StatProperty
impl Serialize for StatProperty
impl Eq for StatProperty
impl StructuralPartialEq for StatProperty
Auto Trait Implementations§
impl Freeze for StatProperty
impl RefUnwindSafe for StatProperty
impl Send for StatProperty
impl Sync for StatProperty
impl Unpin for StatProperty
impl UnwindSafe for StatProperty
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.