pub struct TargetConfig {
lower_bounds: HashMap<Location, u32>,
locations_not_covered: HashSet<Location>,
variable_constr: LIAVariableConstraint,
}Expand description
Upward closed set of configurations representing a target set of configurations
This type specifies an upwards closed set of configurations. It can be seen as a minimal basis specifying a set of configurations
Fields§
§lower_bounds: HashMap<Location, u32>Map with location + number of processes at least in there Set of locations where no process should be
locations_not_covered: HashSet<Location>Location should not be covered by any processes
variable_constr: LIAVariableConstraintconjunct of variable constraints
Implementations§
Source§impl TargetConfig
impl TargetConfig
Sourcefn new_unconstrained() -> Self
fn new_unconstrained() -> Self
Create a new specification object that contains all possible configurations
Sourcefn new_loc_not_covered(loc: Location) -> Self
fn new_loc_not_covered(loc: Location) -> Self
Create a new specification that contains all configurations where loc
is not covered by any processes
Sourcepub fn new_cover<L: IntoIterator<Item = Location>>(
cover: L,
) -> Result<Self, ReachabilityTransformationError>
pub fn new_cover<L: IntoIterator<Item = Location>>( cover: L, ) -> Result<Self, ReachabilityTransformationError>
Create a new specification that requires all configurations in cover
to be covered by at least one process
Sourcepub fn new_general_cover<L: IntoIterator<Item = (Location, u32)>>(
cover: L,
) -> Result<Self, ReachabilityTransformationError>
pub fn new_general_cover<L: IntoIterator<Item = (Location, u32)>>( cover: L, ) -> Result<Self, ReachabilityTransformationError>
Create a new specification that requires all configurations in cover
to be covered by at the given amount of processes
Sourcepub fn new_reach<LI: IntoIterator<Item = Location>, LII: IntoIterator<Item = Location>>(
cover: LI,
uncover: LII,
) -> Result<Self, ReachabilityTransformationError>
pub fn new_reach<LI: IntoIterator<Item = Location>, LII: IntoIterator<Item = Location>>( cover: LI, uncover: LII, ) -> Result<Self, ReachabilityTransformationError>
Create a new specification that requires all configurations in cover
to be covered by at least one process and all locations in uncover to
be empty
Sourcepub fn new_general_reach<U: IntoIterator<Item = Location>, C: IntoIterator<Item = (Location, u32)>>(
cover: C,
uncover: U,
) -> Result<Self, ReachabilityTransformationError>
pub fn new_general_reach<U: IntoIterator<Item = Location>, C: IntoIterator<Item = (Location, u32)>>( cover: C, uncover: U, ) -> Result<Self, ReachabilityTransformationError>
Create a new specification that requires all configurations in cover
to be covered by at least the specified amount of processes and all
locations in uncover to be empty
Sourcepub fn get_locations_appearing(&self) -> HashSet<&Location>
pub fn get_locations_appearing(&self) -> HashSet<&Location>
Get all locations that appear in the target specification
Sourcepub fn get_variable_constraint(&self) -> &LIAVariableConstraint
pub fn get_variable_constraint(&self) -> &LIAVariableConstraint
Get the variable constraint appearing in the target configuration
Sourcepub fn new_reach_with_var_constr<LC: Into<HashMap<Location, u32>>, LU: Into<HashSet<Location>>>(
locs: LC,
uncover: LU,
var_constr: BooleanExpression<Variable>,
) -> Result<Self, ReachabilityTransformationError>
pub fn new_reach_with_var_constr<LC: Into<HashMap<Location, u32>>, LU: Into<HashSet<Location>>>( locs: LC, uncover: LU, var_constr: BooleanExpression<Variable>, ) -> Result<Self, ReachabilityTransformationError>
Create a new target configuration constraint
Sourcefn new_with_var_constr(
var_constr: BooleanExpression<Variable>,
) -> Result<Self, ReachabilityTransformationError>
fn new_with_var_constr( var_constr: BooleanExpression<Variable>, ) -> Result<Self, ReachabilityTransformationError>
Create a new specification contains all configurations where
var_constr holds
Sourcefn is_reachability_constraint(&self) -> bool
fn is_reachability_constraint(&self) -> bool
Check whether this constraint is a reachability constraint
A reachability constraint requires at least one location to be empty.
Sourcepub fn get_locations_to_cover(&self) -> impl Iterator<Item = (&Location, &u32)>
pub fn get_locations_to_cover(&self) -> impl Iterator<Item = (&Location, &u32)>
Get iterator over the locations that should be covered by processes with the least amount of processes
Sourcepub fn get_locations_to_uncover(&self) -> impl Iterator<Item = &Location>
pub fn get_locations_to_uncover(&self) -> impl Iterator<Item = &Location>
Locations that should not be covered
Sourcepub fn into_disjunct_with_name<S: ToString>(
self,
name: S,
) -> DisjunctionTargetConfig
pub fn into_disjunct_with_name<S: ToString>( self, name: S, ) -> DisjunctionTargetConfig
Create a DisjunctionTargetConfig with the given name from the single
target location
Sourcefn try_from_loc_constr(
constr: (IntegerExpression<Location>, ComparisonOp, IntegerExpression<Location>),
) -> Result<Self, ReachabilityTransformationError>
fn try_from_loc_constr( constr: (IntegerExpression<Location>, ComparisonOp, IntegerExpression<Location>), ) -> Result<Self, ReachabilityTransformationError>
Attempt to parse an DisjunctionTargetConfig from a location
constraint
This function can be used to attempt to extract an upwards closed set of configurations from a single boolean constraint over location variables
This function returns an error if the specification does not correspond to an upwards closed set of configurations. See
Trait Implementations§
Source§impl And for TargetConfig
impl And for TargetConfig
Source§impl Clone for TargetConfig
impl Clone for TargetConfig
Source§fn clone(&self) -> TargetConfig
fn clone(&self) -> TargetConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TargetConfig
impl Debug for TargetConfig
Source§impl Display for TargetConfig
impl Display for TargetConfig
Source§impl<C: SMTVariableContext<Location> + SMTVariableContext<Variable> + SMTVariableContext<Parameter>> EncodeToSMT<TargetConfig, C> for TargetConfig
impl<C: SMTVariableContext<Location> + SMTVariableContext<Variable> + SMTVariableContext<Parameter>> EncodeToSMT<TargetConfig, C> for TargetConfig
Source§impl PartialEq for TargetConfig
impl PartialEq for TargetConfig
impl StructuralPartialEq for TargetConfig
Auto Trait Implementations§
impl Freeze for TargetConfig
impl RefUnwindSafe for TargetConfig
impl Send for TargetConfig
impl Sync for TargetConfig
impl Unpin for TargetConfig
impl UnwindSafe for TargetConfig
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