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: u32Id assigned to the rule in the specification
source: LocationSource location of the rule
target: LocationTarget location of the rule
guard: LIAVariableConstraintGuard of the rule
actions: Vec<Action>Effect of the rule
Implementations§
Source§impl LIARule
impl LIARule
Sourcefn remove_sumvar(
self,
sv_to_v: &HashMap<WeightedSum<Variable>, Variable>,
) -> Self
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
Sourcefn compute_acts_to_add(
existing_acts: &[Action],
sc: &WeightedSum<Variable>,
sv_to_v: &HashMap<WeightedSum<Variable>, Variable>,
) -> HashSet<Action>
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
impl LIARule
Sourcefn get_distinct_thresholds(&self) -> HashSet<Threshold>
fn get_distinct_thresholds(&self) -> HashSet<Threshold>
Get all distinct thresholds appearing in the guard of the rule
Sourcepub fn number_of_thresholds(&self) -> u32
pub fn number_of_thresholds(&self) -> u32
Get the number of thresholds appearing in the guard
Sourcepub fn number_of_updates(&self) -> u32
pub fn number_of_updates(&self) -> u32
Returns the number of updates in the rule
Trait Implementations§
Source§impl RuleDefinition for LIARule
impl RuleDefinition for LIARule
Source§type Guard = LIAVariableConstraint
type Guard = LIAVariableConstraint
Source§fn actions(&self) -> impl Iterator<Item = &Self::Action>
fn actions(&self) -> impl Iterator<Item = &Self::Action>
Source§fn has_decrements(&self) -> bool
fn has_decrements(&self) -> bool
Source§fn has_resets(&self) -> bool
fn has_resets(&self) -> bool
Source§impl TryFrom<&Rule> for LIARule
impl TryFrom<&Rule> for LIARule
Source§fn try_from(rule: &Rule) -> Result<Self, Self::Error>
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.