pub struct LIAThresholdAutomaton {
ta: GeneralThresholdAutomaton,
init_variable_constr: Vec<LIAVariableConstraint>,
rules: HashMap<Location, Vec<LIARule>>,
additional_vars_for_sums: HashMap<Variable, WeightedSum<Variable>>,
}Expand description
A linear arithmetic threshold automaton or LIAThresholdAutomaton
is a threshold automaton containing linear arithmetic guards. The
goal of the LIAThresholdAutomaton is to stay as close to the formal
definition of a threshold automaton as possible.
To convert a GeneralThresholdAutomaton to a LIAThresholdAutomaton
all guards are translated into one of these forms:
SingleAtomConstraint: Which represents a threshold in the formx <COMPARISON_OP> c_1 * p_1 + ... c_n * p_n + cwherec_1, ..., c_n, care rational constants,p_1, ..., p_nare Parameters and x is a single shared variable.SumAtomConstraint: Represents a threshold of the formcx_1 * x_1 + ... + cx_m * x_m <COMPARISON_OP> c_1 * p_1 + ... c_n * p_n + cwherec_1, ..., c_n, cx_1, ..., cx_m, care rational constants,p_1, ..., p_nare Parameters and x_1, …, x_m are shared variables. Additionally, all coefficientscx_1, ..., cx_mmust be all positive.ComparisonConstraint: Comparison constraints are structured analog to aSumAtomConstraint, but allow mixing positive and negative constants in the constantscx_1, ..., cx_m.
Note that not all algorithms support all types of guards. Especially the
ComparisonConstraint makes the verification problem undecidable (even without
decrements and or resets). For more information see:
All Flavors of Threshold Automata - Jure Kukovec, Igor Konnov, Josef Widder - https://doi.org/10.4230/LIPIcs.CONCUR.2018.19
Fields§
§ta: GeneralThresholdAutomatonGeneralThresholdAutomaton the canonical automaton has been constructed from
init_variable_constr: Vec<LIAVariableConstraint>Initial conditions on variables in linear arithmetic
rules: HashMap<Location, Vec<LIARule>>Transition rules of the threshold automaton indexed by source location
additional_vars_for_sums: HashMap<Variable, WeightedSum<Variable>>Additional variables that are used to replace sums TODO: remove when a proper ordering for sums of variables is implemented
Implementations§
Source§impl LIAThresholdAutomaton
impl LIAThresholdAutomaton
Sourcepub fn into_ta_without_sum_vars(self) -> Self
pub fn into_ta_without_sum_vars(self) -> Self
This function will remove any LIAVariableConstraint::SumVarConstraint
and replace them with a new variable that is incremented/reset/decremented
when any of its components is incremented, reset, or decremented.
This is not the most efficient solution for error graphs, but it is the simplest.
TODO: replace when more capable interval ordering is ready (see note in
module no_sum_var docs)
Sourcepub fn get_replacement_vars_for_sumvars(
&self,
) -> &HashMap<Variable, WeightedSum<Variable>>
pub fn get_replacement_vars_for_sumvars( &self, ) -> &HashMap<Variable, WeightedSum<Variable>>
Get the helper variables that have been added to replace sums of variables
Sourcefn create_new_variable_for_sumvar(
s: &WeightedSum<Variable>,
lta: &LIAThresholdAutomaton,
) -> Variable
fn create_new_variable_for_sumvar( s: &WeightedSum<Variable>, lta: &LIAThresholdAutomaton, ) -> Variable
Creates a new unique name for a sum of variables
Source§impl LIAThresholdAutomaton
impl LIAThresholdAutomaton
Sourcepub fn get_max_number_of_thresholds_per_rule(&self) -> u32
pub fn get_max_number_of_thresholds_per_rule(&self) -> u32
Get the maximum number of thresholds in a single rule of the threshold automaton
Sourcepub fn get_ta(&self) -> &GeneralThresholdAutomaton
pub fn get_ta(&self) -> &GeneralThresholdAutomaton
Get a reference to the GeneralThresholdAutomaton this automaton has
been derived from
Sourcepub fn has_sum_var_threshold_guard(&self) -> bool
pub fn has_sum_var_threshold_guard(&self) -> bool
Check if the canonical threshold automaton contains a guard over as sum
of variables, i.e., some guard contains a SumAtomConstraint
Sourcepub fn has_comparison_guard(&self) -> bool
pub fn has_comparison_guard(&self) -> bool
Check if the canonical threshold automaton has a comparison guard,i.e.,
some guard contains a ComparisonConstraint
Sourcepub fn get_single_var_constraints_rules(
&self,
) -> HashSet<SingleAtomConstraint<Variable>>
pub fn get_single_var_constraints_rules( &self, ) -> HashSet<SingleAtomConstraint<Variable>>
Get all appearing SingleAtomConstraints
This function returns all appearing SingleAtomConstraints in the
rules of a threshold automaton. The constraints are deduplicated.
Sourcepub fn get_sum_var_constraints(&self) -> HashSet<SumAtomConstraint<Variable>>
pub fn get_sum_var_constraints(&self) -> HashSet<SumAtomConstraint<Variable>>
Get all appearing SumAtomConstraints
This function returns all appearing SumAtomConstraints in the
rules of a threshold automaton. The constraints are deduplicated.
Sourcepub fn get_comparison_guards(&self) -> HashSet<ComparisonConstraint<Variable>>
pub fn get_comparison_guards(&self) -> HashSet<ComparisonConstraint<Variable>>
Get all appearing ComparisonConstraints
This function returns all appearing ComparisonConstraints in the
rules of a threshold automaton. The constraints are deduplicated.
Sourcepub fn get_thresholds(&self) -> HashSet<Threshold>
pub fn get_thresholds(&self) -> HashSet<Threshold>
Get the number of distinct thresholds appearing in the definition of the threshold automaton
Sourcepub fn get_derived_rule(&self, r: &LIARule) -> Rule
pub fn get_derived_rule(&self, r: &LIARule) -> Rule
Get the Rule this rule has been derived from
Trait Implementations§
Source§impl Clone for LIAThresholdAutomaton
impl Clone for LIAThresholdAutomaton
Source§fn clone(&self) -> LIAThresholdAutomaton
fn clone(&self) -> LIAThresholdAutomaton
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more