pub(crate) struct ThresholdConstraintOver<T> {
t: 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§
§t: T§thr_constr: ThresholdConstraintImplementations§
Source§impl<T> ThresholdConstraintOver<T>
impl<T> ThresholdConstraintOver<T>
Sourcepub fn new(t: T, thr_constr: ThresholdConstraint) -> Self
pub fn new(t: 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_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>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for ThresholdConstraintOver<T>
impl<T: Debug> Debug for ThresholdConstraintOver<T>
Source§impl<T> Display for ThresholdConstraintOver<T>where
T: Display,
impl<T> Display for ThresholdConstraintOver<T>where
T: Display,
impl<T: Eq> Eq for ThresholdConstraintOver<T>
Source§impl<S, T> From<ThresholdConstraintOver<T>> for BooleanExpression<S>
impl<S, T> From<ThresholdConstraintOver<T>> for BooleanExpression<S>
Source§fn from(val: ThresholdConstraintOver<T>) -> Self
fn from(val: ThresholdConstraintOver<T>) -> Self
Converts to this type from the input type.
Source§impl<T: Hash> Hash for ThresholdConstraintOver<T>
impl<T: Hash> Hash for ThresholdConstraintOver<T>
Source§impl<T: Ord> Ord for ThresholdConstraintOver<T>
impl<T: Ord> Ord for ThresholdConstraintOver<T>
Source§fn cmp(&self, other: &ThresholdConstraintOver<T>) -> Ordering
fn cmp(&self, other: &ThresholdConstraintOver<T>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for ThresholdConstraintOver<T>
impl<T: PartialEq> PartialEq for ThresholdConstraintOver<T>
Source§fn eq(&self, other: &ThresholdConstraintOver<T>) -> bool
fn eq(&self, other: &ThresholdConstraintOver<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<T: PartialOrd> PartialOrd for ThresholdConstraintOver<T>
impl<T: PartialOrd> PartialOrd for ThresholdConstraintOver<T>
impl<T: PartialEq> StructuralPartialEq for ThresholdConstraintOver<T>
Auto Trait Implementations§
impl<T> Freeze for ThresholdConstraintOver<T>where
T: Freeze,
impl<T> RefUnwindSafe for ThresholdConstraintOver<T>where
T: RefUnwindSafe,
impl<T> Send for ThresholdConstraintOver<T>where
T: Send,
impl<T> Sync for ThresholdConstraintOver<T>where
T: Sync,
impl<T> Unpin for ThresholdConstraintOver<T>where
T: Unpin,
impl<T> UnsafeUnpin for ThresholdConstraintOver<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ThresholdConstraintOver<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more