Skip to main content

Lattice

Trait Lattice 

Source
pub trait Lattice {
    const IDEMPOTENT: bool = true;

    // Required methods
    fn pjoin(&self, other: &Self) -> AlgebraicResult<Self>
       where Self: Sized;
    fn pmeet(&self, other: &Self) -> AlgebraicResult<Self>
       where Self: Sized;

    // Provided methods
    fn join_into(&mut self, other: Self) -> AlgebraicStatus
       where Self: Sized { ... }
    fn join_all<S: AsRef<Self>, Args: AsRef<[S]>>(
        xs: Args,
    ) -> AlgebraicResult<Self>
       where Self: Sized + Clone { ... }
}
Expand description

Implements basic algebraic behavior (union & intersection) for a type

Provided Associated Constants§

Source

const IDEMPOTENT: bool = true

Indicates whether the lattice operations are idempotent for the purpose of evaluating algebraic operations on shared subtries.

If IDEMPOTENT = true the implementor is asserting that: pjoin(self) -> AlgebraicResult::Identity(SELF_IDENT | COUNTER_IDENT), join_into(self) -> AlgebraicStatus::Identity, pmeet(self) -> AlgebraicResult::Identity(SELF_IDENT | COUNTER_IDENT),

WARNING! This constant is currently informational only. The node-level and zipper algebra implementations do not yet consult it, so changing it has no effect on their behavior. It is planned for gating implementation shortcuts in the future

Required Methods§

Source

fn pjoin(&self, other: &Self) -> AlgebraicResult<Self>
where Self: Sized,

Implements the union operation between two instances of a type in a partial lattice, resulting in the creation of a new result instance

Source

fn pmeet(&self, other: &Self) -> AlgebraicResult<Self>
where Self: Sized,

Implements the intersection operation between two instances of a type in a partial lattice

Provided Methods§

Source

fn join_into(&mut self, other: Self) -> AlgebraicStatus
where Self: Sized,

Implements the union operation between two instances of a type, consuming the other input operand, and modifying self to become the joined type

Source

fn join_all<S: AsRef<Self>, Args: AsRef<[S]>>(xs: Args) -> AlgebraicResult<Self>
where Self: Sized + Clone,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Lattice for ()

Source§

fn pjoin(&self, _other: &Self) -> AlgebraicResult<Self>

Source§

fn pmeet(&self, _other: &Self) -> AlgebraicResult<Self>

Source§

impl Lattice for [u64; 4]

Source§

fn pjoin(&self, other: &Self) -> AlgebraicResult<Self>

Source§

fn pmeet(&self, other: &Self) -> AlgebraicResult<Self>

Source§

impl Lattice for bool

Source§

fn pjoin(&self, other: &bool) -> AlgebraicResult<bool>

Source§

fn pmeet(&self, other: &bool) -> AlgebraicResult<bool>

Source§

impl Lattice for u8

Source§

fn pjoin(&self, _other: &u8) -> AlgebraicResult<u8>

Source§

fn pmeet(&self, _other: &u8) -> AlgebraicResult<u8>

Source§

impl Lattice for u16

Source§

fn pjoin(&self, _other: &u16) -> AlgebraicResult<u16>

Source§

fn pmeet(&self, _other: &u16) -> AlgebraicResult<u16>

Source§

impl Lattice for u32

Source§

fn pjoin(&self, _other: &u32) -> AlgebraicResult<u32>

Source§

fn pmeet(&self, _other: &u32) -> AlgebraicResult<u32>

Source§

impl Lattice for u64

Source§

fn pjoin(&self, _other: &u64) -> AlgebraicResult<u64>

Source§

fn pmeet(&self, _other: &u64) -> AlgebraicResult<u64>

Source§

impl Lattice for usize

Source§

fn pjoin(&self, _other: &usize) -> AlgebraicResult<usize>

Source§

fn pmeet(&self, _other: &usize) -> AlgebraicResult<usize>

Source§

impl<K, V> Lattice for HashMap<K, V>
where Self: SetLattice, <Self as SetLattice>::V: Lattice,

Source§

fn pjoin(&self, other: &Self) -> AlgebraicResult<Self>

Source§

fn pmeet(&self, other: &Self) -> AlgebraicResult<Self>

Source§

impl<K> Lattice for HashSet<K>
where Self: SetLattice, <Self as SetLattice>::V: Lattice,

Source§

fn pjoin(&self, other: &Self) -> AlgebraicResult<Self>

Source§

fn pmeet(&self, other: &Self) -> AlgebraicResult<Self>

Source§

impl<V: Lattice + Clone + Send + Sync, A: Allocator> Lattice for Option<TrieNodeODRc<V, A>>

Source§

fn pjoin(&self, other: &Self) -> AlgebraicResult<Self>

Source§

fn pmeet( &self, other: &Option<TrieNodeODRc<V, A>>, ) -> AlgebraicResult<Option<TrieNodeODRc<V, A>>>

Source§

impl<V: Lattice + Clone> Lattice for Option<V>

Source§

fn pjoin(&self, other: &Option<V>) -> AlgebraicResult<Self>

Source§

fn join_into(&mut self, other: Self) -> AlgebraicStatus

Source§

fn pmeet(&self, other: &Option<V>) -> AlgebraicResult<Option<V>>

Source§

impl<V: Lattice> Lattice for Box<V>

Source§

fn pjoin(&self, other: &Self) -> AlgebraicResult<Self>

Source§

fn pmeet(&self, other: &Self) -> AlgebraicResult<Self>

Implementors§