pub enum LIAVariableConstraint {
ComparisonConstraint(ComparisonConstraint<Variable>),
SingleVarConstraint(SingleAtomConstraint<Variable>),
SumVarConstraint(SumAtomConstraint<Variable>),
BinaryGuard(Box<LIAVariableConstraint>, BooleanConnective, Box<LIAVariableConstraint>),
True,
False,
}Expand description
Abstract constraint type for linear arithmetic formulas over shared variables
This struct allows to represent combinations the different types of constraints over evaluations of shared variables. It allows to reference:
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.
and boolean combinations of these guards
Variants§
ComparisonConstraint(ComparisonConstraint<Variable>)
Constraint over the difference between variables / comparing variables
SingleVarConstraint(SingleAtomConstraint<Variable>)
Constraint over a single variable
SumVarConstraint(SumAtomConstraint<Variable>)
Constraint over the sum of multiple variables
BinaryGuard(Box<LIAVariableConstraint>, BooleanConnective, Box<LIAVariableConstraint>)
Boolean Combination of multiple constraints over variables
True
True / always enabled
False
False / always disabled
Implementations§
Source§impl LIAVariableConstraint
impl LIAVariableConstraint
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 LIAVariableConstraint::SumVarConstraint in a
LIAVariableConstraint by the appropriate
LIAVariableConstraint::SingleVarConstraint
Source§impl LIAVariableConstraint
impl LIAVariableConstraint
Sourcefn get_distinct_thresholds(&self) -> HashSet<Threshold>
fn get_distinct_thresholds(&self) -> HashSet<Threshold>
Get all Thresholds appearing in the constraint
Sourcepub fn count_number_of_thresholds(&self) -> u32
pub fn count_number_of_thresholds(&self) -> u32
Count the number of thresholds appearing in the constraint
Sourcepub fn has_sum_var(&self) -> bool
pub fn has_sum_var(&self) -> bool
Check if the guard contains a SumAtomConstraint in its constraint
Sourcepub fn has_comparison_guard(&self) -> bool
pub fn has_comparison_guard(&self) -> bool
Check if the guard contains a ComparisonConstraint in its
constraint
Sourcepub fn get_single_var_constraints(&self) -> Vec<SingleAtomConstraint<Variable>>
pub fn get_single_var_constraints(&self) -> Vec<SingleAtomConstraint<Variable>>
Get all SingleAtomConstraints appearing in the constraint
Sourcepub fn get_multi_variable_guards(&self) -> Vec<SumAtomConstraint<Variable>>
pub fn get_multi_variable_guards(&self) -> Vec<SumAtomConstraint<Variable>>
Get all SumAtomConstraint appearing in the constraint
Sourcepub fn get_comparison_guards(&self) -> Vec<ComparisonConstraint<Variable>>
pub fn get_comparison_guards(&self) -> Vec<ComparisonConstraint<Variable>>
Get all ComparisonConstraint appearing in the constraint
Sourcepub fn is_upper_guard(&self) -> bool
pub fn is_upper_guard(&self) -> bool
Check if the constraint is an upper guard
Sourcepub fn is_lower_guard(&self) -> bool
pub fn is_lower_guard(&self) -> bool
Check if the constraint is a lower guard
Trait Implementations§
Source§impl BitAnd for LIAVariableConstraint
impl BitAnd for LIAVariableConstraint
Source§impl BitOr for LIAVariableConstraint
impl BitOr for LIAVariableConstraint
Source§impl Clone for LIAVariableConstraint
impl Clone for LIAVariableConstraint
Source§fn clone(&self) -> LIAVariableConstraint
fn clone(&self) -> LIAVariableConstraint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LIAVariableConstraint
impl Debug for LIAVariableConstraint
Source§impl Display for LIAVariableConstraint
impl Display for LIAVariableConstraint
Source§impl Hash for LIAVariableConstraint
impl Hash for LIAVariableConstraint
Source§impl Ord for LIAVariableConstraint
impl Ord for LIAVariableConstraint
Source§fn cmp(&self, other: &LIAVariableConstraint) -> Ordering
fn cmp(&self, other: &LIAVariableConstraint) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for LIAVariableConstraint
impl PartialEq for LIAVariableConstraint
Source§impl PartialOrd for LIAVariableConstraint
impl PartialOrd for LIAVariableConstraint
Source§impl TryFrom<&BooleanExpression<Variable>> for LIAVariableConstraint
impl TryFrom<&BooleanExpression<Variable>> for LIAVariableConstraint
Source§impl TryFrom<NonNegatedBooleanExpression<Variable>> for LIAVariableConstraint
impl TryFrom<NonNegatedBooleanExpression<Variable>> for LIAVariableConstraint
Source§fn try_from(
value: NonNegatedBooleanExpression<Variable>,
) -> Result<Self, Self::Error>
fn try_from( value: NonNegatedBooleanExpression<Variable>, ) -> Result<Self, Self::Error>
Parse the NonNegatedBooleanExpression into a LIAVariableConstraint by
converting into weighted sums of parameters and variables