pub struct GaloisConnection<A, B> {
pub lower: Box<dyn Fn(A) -> B>,
pub upper: Box<dyn Fn(B) -> A>,
}Expand description
Representation of a Galois connection between two posets.
A Galois connection is a pair of monotone maps (l : A → B, u : B → A)
satisfying: l(a) ≤ b ↔ a ≤ u(b).
Fields§
§lower: Box<dyn Fn(A) -> B>Left adjoint (lower adjoint).
upper: Box<dyn Fn(B) -> A>Right adjoint (upper adjoint).
Implementations§
Source§impl<A: Clone, B: Clone> GaloisConnection<A, B>
impl<A: Clone, B: Clone> GaloisConnection<A, B>
Sourcepub fn new(
lower: impl Fn(A) -> B + 'static,
upper: impl Fn(B) -> A + 'static,
) -> Self
pub fn new( lower: impl Fn(A) -> B + 'static, upper: impl Fn(B) -> A + 'static, ) -> Self
Create a new Galois connection from the adjoint pair.
Sourcepub fn apply_lower(&self, a: A) -> B
pub fn apply_lower(&self, a: A) -> B
Apply the lower adjoint.
Sourcepub fn apply_upper(&self, b: B) -> A
pub fn apply_upper(&self, b: B) -> A
Apply the upper adjoint.
Auto Trait Implementations§
impl<A, B> Freeze for GaloisConnection<A, B>
impl<A, B> !RefUnwindSafe for GaloisConnection<A, B>
impl<A, B> !Send for GaloisConnection<A, B>
impl<A, B> !Sync for GaloisConnection<A, B>
impl<A, B> Unpin for GaloisConnection<A, B>
impl<A, B> UnsafeUnpin for GaloisConnection<A, B>
impl<A, B> !UnwindSafe for GaloisConnection<A, B>
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