pub struct SingleAtomConstraint<T: Atomic>(ThresholdConstraintOver<T>);Expand description
Threshold guard over a single atom
This struct represents a guard over a single atom, i.e., it represents a
constraint formula of the form v COMPOP cp_1 * p_1 + ... + cp_n * p_m + c
where cp_1, ..., cp_m are rational factors, COMPOP is a comparison
operator (i.e.,<, >, <=, >=, ==, !=), v is a atom, p_1, ..., p_m
are parameters, and c is a rational constant.
Tuple Fields§
§0: ThresholdConstraintOver<T>Implementations§
Source§impl<T: Atomic> SingleAtomConstraint<T>
impl<T: Atomic> SingleAtomConstraint<T>
Sourcepub fn new(atom: T, thr: ThresholdConstraint) -> Self
pub fn new(atom: T, thr: ThresholdConstraint) -> Self
Create a new single variable 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 guard is a lower guard
Sourcepub fn to_boolean_expr<S>(&self) -> BooleanExpression<S>
pub fn to_boolean_expr<S>(&self) -> BooleanExpression<S>
Transform the constraint into a BooleanExpression
Sourcepub fn get_threshold(&self) -> &Threshold
pub fn get_threshold(&self) -> &Threshold
Get the threshold of the guard
Sourcepub fn get_threshold_constraint(&self) -> &ThresholdConstraint
pub fn get_threshold_constraint(&self) -> &ThresholdConstraint
Get the threshold constraint of the guard
Trait Implementations§
Source§impl<T: Clone + Atomic> Clone for SingleAtomConstraint<T>
impl<T: Clone + Atomic> Clone for SingleAtomConstraint<T>
Source§fn clone(&self) -> SingleAtomConstraint<T>
fn clone(&self) -> SingleAtomConstraint<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Atomic> Display for SingleAtomConstraint<T>
impl<T: Atomic> Display for SingleAtomConstraint<T>
Source§impl<T: Ord + Atomic> Ord for SingleAtomConstraint<T>
impl<T: Ord + Atomic> Ord for SingleAtomConstraint<T>
Source§fn cmp(&self, other: &SingleAtomConstraint<T>) -> Ordering
fn cmp(&self, other: &SingleAtomConstraint<T>) -> Ordering
1.21.0 · 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: PartialOrd + Atomic> PartialOrd for SingleAtomConstraint<T>
impl<T: PartialOrd + Atomic> PartialOrd for SingleAtomConstraint<T>
impl<T: Eq + Atomic> Eq for SingleAtomConstraint<T>
impl<T: Atomic> StructuralPartialEq for SingleAtomConstraint<T>
Auto Trait Implementations§
impl<T> Freeze for SingleAtomConstraint<T>where
T: Freeze,
impl<T> RefUnwindSafe for SingleAtomConstraint<T>where
T: RefUnwindSafe,
impl<T> Send for SingleAtomConstraint<T>where
T: Send,
impl<T> Sync for SingleAtomConstraint<T>where
T: Sync,
impl<T> Unpin for SingleAtomConstraint<T>where
T: Unpin,
impl<T> UnwindSafe for SingleAtomConstraint<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