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

Creating static properties.

source

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.

source

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).

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn default(variant: SimpleStatPropertyType) -> StatProperty

Create default StatProperty instance of specified variant.

source

pub fn default_generic() -> StatProperty

Create default “generic” StatProperty instance, representing “true” formula.

source

pub fn default_regulation_essential() -> StatProperty

Create default StatProperty instance for regulation essentiality (with empty input and target fields and Unknown essentiality).

source

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).

source

pub fn default_regulation_monotonic() -> StatProperty

Create default StatProperty instance for regulation monotonicity (with empty input and target fields and Unknown monotonicity).

source

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).

source

pub fn default_fn_input_essential() -> StatProperty

Create default StatProperty instance for function input essentiality (with empty input and target fields and Unknown essentiality).

source

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).

source

pub fn default_fn_input_monotonic() -> StatProperty

Create default StatProperty instance for function input monotonicity (with empty input and target fields and Unknown monotonicity).

source

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

Editing static properties.

source

pub fn set_name(&mut self, new_name: &str) -> Result<(), String>

Set property’s name.

source

pub fn set_annotation(&mut self, annotation: &str)

Set property’s annotation string.

source

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.

source

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.

source

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.

source

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.

source

pub fn set_monotonicity( &mut self, monotonicity: Monotonicity, ) -> Result<(), String>

Update property’s sub-field for monotonicity, where applicable. If not applicable, return Err.

source

pub fn set_essentiality( &mut self, essentiality: Essentiality, ) -> Result<(), String>

Update property’s sub-field for essentiality, where applicable. If not applicable, return Err.

source

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

pub fn set_formula(&mut self, new_formula: &str) -> Result<(), String>

Update generic property’s formula. If not applicable (different variant), return Err.

source

pub fn set_var_id_if_present( &mut self, old_id: VarId, new_id: VarId, ) -> Result<(), String>

If the property is referencing the given variable (as either regulator or target), set that variable to the new value.

If not applicable, return Err.

source§

impl StatProperty

Observing static properties.

source

pub fn get_name(&self) -> &str

Get property’s name.

source

pub fn get_annotation(&self) -> &str

Get annotation string.

source

pub fn get_prop_data(&self) -> &StatPropertyType

Get property’s variant with all the underlying data.

source

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

pub fn get_regulator_and_target( &mut self, ) -> Result<(Option<VarId>, Option<VarId>), String>

Get property’s sub-fields for regulator variable and target variable, where applicable. If not applicable, return Err.

source§

impl StatProperty

Static methods to automatically generate IDs to encode regulation properties.

source

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.

source

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

source§

fn clone(&self) -> StatProperty

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StatProperty

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for StatProperty

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Hash for StatProperty

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for StatProperty

source§

fn eq(&self, other: &StatProperty) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for StatProperty

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for StatProperty

source§

impl StructuralPartialEq for StatProperty

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<'de, D, R> CommandArg<'de, R> for D
where D: Deserialize<'de>, R: Runtime,

§

fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>

Derives an instance of Self from the [CommandItem]. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T

§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,