pub struct UpwardsClosedClause {
locs_no_procs: HashSet<Location>,
locs_lower_bounds: HashMap<Location, u32>,
variable_constr: LIAVariableConstraint,
}Expand description
Description of an upwards closed set of configurations of a threshold automaton
An upwards closed set of configurations can be seen as the conjunction of three different types of constraints:
- a set of locations which are not allowed to contain any processes
- a map of locations to integer bounds, where the bounds represent minimal the number of processes that need to be present in the respective location
- constraints on the shared variable evaluations
Any configuration of a threshold automaton that fulfills the constraints is then said to be in the set.
This type should usually not be created directly. Instead, use the UpwardsClosedSet type (with a single clause).
Fields§
§locs_no_procs: HashSet<Location>Location should not be covered by any processes
locs_lower_bounds: HashMap<Location, u32>Map with location + number of processes at least in there
variable_constr: LIAVariableConstraintconjunct of variable constraints
Implementations§
Source§impl UpwardsClosedClause
impl UpwardsClosedClause
Sourcepub fn variable_constr(&self) -> &LIAVariableConstraint
pub fn variable_constr(&self) -> &LIAVariableConstraint
Get the constraint over the shared variable valuations
Sourcepub fn locs_to_cover(&self) -> impl Iterator<Item = (&Location, &u32)>
pub fn locs_to_cover(&self) -> impl Iterator<Item = (&Location, &u32)>
Returns an iterator over locations and the respective lower bound on how many processes need to be in the location to be in the set
Sourcepub fn locs_to_uncover(&self) -> impl Iterator<Item = &Location>
pub fn locs_to_uncover(&self) -> impl Iterator<Item = &Location>
Returns the locations where no process is allowed to be in
Sourcepub fn new_top() -> Self
pub fn new_top() -> Self
Create a new upwards closed set that contains all possible configurations
Sourcepub fn is_top(&self) -> bool
pub fn is_top(&self) -> bool
Check whether this clause is a tautology, i.e., contains all possible configurations
Sourcefn new() -> Self
fn new() -> Self
Creates a new empty set of atomic propositions
Such an upwards closed set is equivalent to a constraint true or the
set of all configurations
Sourcefn with_locs_to_cover<I: Borrow<Location>, L: IntoIterator<Item = I>>(
self,
cover: L,
) -> Self
fn with_locs_to_cover<I: Borrow<Location>, L: IntoIterator<Item = I>>( self, cover: L, ) -> Self
Add a locations where at least one process must be present
If a lower bound constraint for a specific location has been previously added, this function will merge the constraints by taking the maximum of the lower bounds
Sourcefn with_lower_bounds<I: Borrow<Location>, N: Into<u32>, L: IntoIterator<Item = (I, N)>>(
self,
cover: L,
) -> Self
fn with_lower_bounds<I: Borrow<Location>, N: Into<u32>, L: IntoIterator<Item = (I, N)>>( self, cover: L, ) -> Self
Add lower bounds for a set of locations
If a lower bound constraint for a specific location has been previously added, this function will merge the constraints by taking the maximum of the lower bounds
Sourcefn with_locs_to_empty<I: Borrow<Location>, L: IntoIterator<Item = I>>(
self,
locs: L,
) -> Self
fn with_locs_to_empty<I: Borrow<Location>, L: IntoIterator<Item = I>>( self, locs: L, ) -> Self
Add locations which are not allowed to be covered
Sourcefn with_variable_constraint(self, constr: LIAVariableConstraint) -> Self
fn with_variable_constraint(self, constr: LIAVariableConstraint) -> Self
Add a constraint on the shared variable valuation
If a constraint has been previously added, the resulting variable constraint will be the conjunction of the previous and the new one
Sourcefn contains_reachability_constraint(&self) -> bool
fn contains_reachability_constraint(&self) -> bool
Check whether the upwards closed set contains a reachability constraint, i.e., a constraint where at least one location is not allowed to be covered
Trait Implementations§
Source§impl And for UpwardsClosedClause
impl And for UpwardsClosedClause
Source§impl BitAnd for UpwardsClosedClause
impl BitAnd for UpwardsClosedClause
Source§impl Clone for UpwardsClosedClause
impl Clone for UpwardsClosedClause
Source§fn clone(&self) -> UpwardsClosedClause
fn clone(&self) -> UpwardsClosedClause
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UpwardsClosedClause
impl Debug for UpwardsClosedClause
Source§impl Display for UpwardsClosedClause
impl Display for UpwardsClosedClause
Source§impl<C: SMTVariableContext<Location> + SMTVariableContext<Variable> + SMTVariableContext<Parameter>> EncodeToSMT<UpwardsClosedClause, C> for UpwardsClosedClause
impl<C: SMTVariableContext<Location> + SMTVariableContext<Variable> + SMTVariableContext<Parameter>> EncodeToSMT<UpwardsClosedClause, C> for UpwardsClosedClause
Source§impl PartialEq for UpwardsClosedClause
impl PartialEq for UpwardsClosedClause
Source§fn eq(&self, other: &UpwardsClosedClause) -> bool
fn eq(&self, other: &UpwardsClosedClause) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for UpwardsClosedClause
Source§impl TASpecification for UpwardsClosedClause
impl TASpecification for UpwardsClosedClause
Source§fn locs_appearing(&self) -> impl IntoIterator<Item = &Location>
fn locs_appearing(&self) -> impl IntoIterator<Item = &Location>
Source§fn var_constraint(&self) -> impl IntoIterator<Item = &LIAVariableConstraint>
fn var_constraint(&self) -> impl IntoIterator<Item = &LIAVariableConstraint>
Auto Trait Implementations§
impl Freeze for UpwardsClosedClause
impl RefUnwindSafe for UpwardsClosedClause
impl Send for UpwardsClosedClause
impl Sync for UpwardsClosedClause
impl Unpin for UpwardsClosedClause
impl UnsafeUnpin for UpwardsClosedClause
impl UnwindSafe for UpwardsClosedClause
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more