pub(crate) struct ThresholdConstraintOver<T> {
variable: T,
thr_constr: ThresholdConstraint,
}Expand description
This struct represents a Threshold constraint over an object of type T
It is used to, for example, represent a threshold guard over a variable
Fields§
§variable: T§thr_constr: ThresholdConstraintImplementations§
Source§impl<T> ThresholdConstraintOver<T>
impl<T> ThresholdConstraintOver<T>
Sourcepub fn new(variable: T, thr_constr: ThresholdConstraint) -> Self
pub fn new(variable: T, thr_constr: ThresholdConstraint) -> Self
Create a new symbolic constraint over an object of type T
Sourcepub fn is_upper_guard(&self) -> bool
pub fn is_upper_guard(&self) -> bool
Check whether the constraint is an upper guard
An upper guard is a guard of the form < t or <= t or != t or
== t, as it can become disabled when the threshold is reached.
Sourcepub fn is_lower_guard(&self) -> bool
pub fn is_lower_guard(&self) -> bool
Check whether the constraint is a lower guard
A lower guard is a guard of the form > t or >= t or != t or
== t, as it can become enabled when the threshold is reached.
Sourcepub fn get_variable(&self) -> &T
pub fn get_variable(&self) -> &T
Get the subject of the constraint
Sourcepub fn get_threshold(&self) -> &Threshold
pub fn get_threshold(&self) -> &Threshold
Get the threshold of the constraint
Sourcepub fn get_threshold_constraint(&self) -> &ThresholdConstraint
pub fn get_threshold_constraint(&self) -> &ThresholdConstraint
Get the threshold constraint of this constraint
Sourcepub fn encode_to_boolean_expr<S>(&self) -> BooleanExpression<S>
pub fn encode_to_boolean_expr<S>(&self) -> BooleanExpression<S>
Encode the constraint into a BooleanExpression
This encoding will be guaranteed to not include rational constants
Trait Implementations§
Source§impl<T: Clone> Clone for ThresholdConstraintOver<T>
impl<T: Clone> Clone for ThresholdConstraintOver<T>
Source§fn clone(&self) -> ThresholdConstraintOver<T>
fn clone(&self) -> ThresholdConstraintOver<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more