LIARule

pub struct LIARule {
    id: u32,
    source: Location,
    target: Location,
    guard: LIAVariableConstraint,
    actions: Vec<Action>,
}
Expand description

Rule type of LIAThresholdAutomaton

A rule guarded by a constraint representable in linear arithmetic (see LIAVariableConstraint).

Fields§

§id: u32

Id assigned to the rule in the specification

§source: Location

Source location of the rule

§target: Location

Target location of the rule

§guard: LIAVariableConstraint

Guard of the rule

§actions: Vec<Action>

Effect of the rule

Implementations§

Source§

impl LIARule

Source

fn remove_sumvar( self, sv_to_v: &HashMap<WeightedSum<Variable>, Variable>, ) -> Self

Replace the sums of variables in a rule and add the appropriate actions

Source

fn compute_acts_to_add( existing_acts: &[Action], sc: &WeightedSum<Variable>, sv_to_v: &HashMap<WeightedSum<Variable>, Variable>, ) -> HashSet<Action>

Compute all actions that have to be added for the given set of actions and the current sums of variables

Source§

impl LIARule

Source

fn get_distinct_thresholds(&self) -> HashSet<Threshold>

Get all distinct thresholds appearing in the guard of the rule

Source

pub fn number_of_thresholds(&self) -> u32

Get the number of thresholds appearing in the guard

Source

pub fn number_of_updates(&self) -> u32

Returns the number of updates in the rule

Trait Implementations§

Source§

impl Clone for LIARule

Source§

fn clone(&self) -> LIARule

Returns a duplicate 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 LIARule

Source§

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

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

impl Display for LIARule

Source§

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

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

impl Hash for LIARule

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 LIARule

Source§

fn eq(&self, other: &LIARule) -> 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 RuleDefinition for LIARule

Source§

type Action = Action

Type of the actions of the rule
Source§

type Guard = LIAVariableConstraint

Type of the guard of the rule
Source§

fn id(&self) -> u32

Returns the id of the rule Read more
Source§

fn source(&self) -> &Location

Returns the source location of the rule Read more
Source§

fn target(&self) -> &Location

Returns the target location of the rule Read more
Source§

fn guard(&self) -> &Self::Guard

Returns the guard of the rule Read more
Source§

fn actions(&self) -> impl Iterator<Item = &Self::Action>

Returns the actions of the rule Read more
Source§

fn has_decrements(&self) -> bool

Check whether the rule has a decrement action
Source§

fn has_resets(&self) -> bool

Check whether the rule has a reset action
Source§

impl TryFrom<&Rule> for LIARule

Source§

fn try_from(rule: &Rule) -> Result<Self, Self::Error>

Try to convert a rule into a LIARule.

A rule can be converted into a LIARule if the guard is a linear arithmetic formula. This means for example that it does not contain any multiplications between variables

This function will return an LIATransformationError if the guard is no linear arithmetic formula.

Source§

type Error = LIATransformationError

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

impl TryFrom<Rule> for LIARule

Source§

type Error = LIATransformationError

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

fn try_from(value: Rule) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Eq for LIARule

Source§

impl StructuralPartialEq for LIARule

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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.

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.