Trait depile::analysis::lattice::JoinSemiLattice [−][src]
pub trait JoinSemiLattice {
fn bottom<K: InstrExt>(env: &dyn ControlFlowExt<BlockKind = K>) -> Self;
fn join_assign(&mut self, other: Self) -> bool;
fn join_assign_many(&mut self, others: impl Iterator<Item = Self>) -> bool
where
Self: Sized,
{ ... }
}
Expand description
Semi-lattice with a ⊓
operation.
Note
This trait does not require a PartialOrd
, because the partial order implied by the
semi-lattice structure is usually different from the #[derive(PartialOrd)]
order:
- The order implied by semi-lattice structure is somewhat “conservative”, in that it is more reluctant to specify an order for pairs of seemingly-unrelated elements; e.g. for sets, such partial order is usually based on set inclusion.
- In contrast, the latter is in some sense more permissive, because it tends to make a
best-effort comparison for any pair of elements; e.g.
PartialOrd
forBTreeSet
is in fact a total order (a lexicographical order).
Fortunately, we make no use of the partial order itself in data flow analysis, so this fact does not make a real obstacle.
Required methods
fn bottom<K: InstrExt>(env: &dyn ControlFlowExt<BlockKind = K>) -> Self
fn bottom<K: InstrExt>(env: &dyn ControlFlowExt<BlockKind = K>) -> Self
The ⊥
element for this semi-lattice: ⊥ ⊓ x = x
.
fn join_assign(&mut self, other: Self) -> bool
fn join_assign(&mut self, other: Self) -> bool
Update self
to self ⊓ other
, returning whether or not the value becomes different.
Provided methods
fn join_assign_many(&mut self, others: impl Iterator<Item = Self>) -> bool where
Self: Sized,
fn join_assign_many(&mut self, others: impl Iterator<Item = Self>) -> bool where
Self: Sized,
Join all of others
into self
, returning whether or not the value becomes different.