Struct FpFunctor

Source
pub struct FpFunctor<'a, Map, Cod> { /* private fields */ }
Expand description

A functor out of a finitely presented (f.p.) category.

Like a Function, this struct borrows its data. Unlike a Mapping between sets, a codomain is needed not just for validation but to even evaluate the functor on morphisms, hence is required as extra data. The domain category is needed only for validation.

Implementations§

Source§

impl<'a, Map, Cod> FpFunctor<'a, Map, Cod>

Source

pub fn new(map: &'a Map, cod: &'a Cod) -> Self

Constructs a new functor out of an f.p. category.

Source§

impl<'a, V, E, Ob, Mor, Map, Cod> FpFunctor<'a, Map, Cod>
where V: Eq + Clone + Hash, E: Eq + Clone + Hash, Ob: Eq + Clone, Mor: Eq + Clone, Map: GraphMapping<DomV = V, DomE = E, CodV = Ob, CodE = Mor>, Cod: Category<Ob = Ob, Mor = Mor>,

Source

pub fn validate_on<S: BuildHasher>( &self, dom: &FpCategory<V, E, S>, ) -> Result<(), NonEmpty<InvalidFpFunctor<V, E>>>

Validates that the functor is well-defined on the given f.p. category.

Source

pub fn iter_invalid_on<'b, S: BuildHasher>( &'b self, dom: &'b FpCategory<V, E, S>, ) -> impl Iterator<Item = InvalidFpFunctor<V, E>> + 'b

Iterates over failures to be functorial on the given f.p. category.

Trait Implementations§

Source§

impl<'a, Ob, Mor, Map, Cod> CategoryMap for FpFunctor<'a, Map, Cod>
where Ob: Eq + Clone, Mor: Eq + Clone, Map: GraphMapping<CodV = Ob, CodE = Mor>, Cod: Category<Ob = Ob, Mor = Mor>,

Source§

type DomOb = <Map as GraphMapping>::DomV

Type of objects in domain category.
Source§

type DomMor = Path<<Map as GraphMapping>::DomV, <Map as GraphMapping>::DomE>

Type of morphisms in domain category.
Source§

type CodOb = Ob

Type of objects in codomain category.
Source§

type CodMor = Mor

Type of morphisms in codomain category.
Source§

type ObMap = <Map as GraphMapping>::VertexMap

Type of underlying mapping on objects.
Source§

type MorMap = FpFunctorMorMap<'a, Map, Cod>

Type of underlying mapping on morphisms.
Source§

fn ob_map(&self) -> &Self::ObMap

Gets the underlying mapping on objects.
Source§

fn mor_map(&self) -> &Self::MorMap

Gets the underlying mapping on morphisms.
Source§

fn apply_ob(&self, x: Self::DomOb) -> Option<Self::CodOb>

Applies the mapping to an object.
Source§

fn apply_mor(&self, m: Self::DomMor) -> Option<Self::CodMor>

Applies the mapping to a morphism.
Source§

fn is_ob_assigned(&self, x: &Self::DomOb) -> bool

Is the mapping defined at an object?
Source§

fn is_mor_assigned(&self, m: &Self::DomMor) -> bool

Is the mapping defined at a morphism?
Source§

impl<'a, Ob, Mor, Map, Cod> FgCategoryMap for FpFunctor<'a, Map, Cod>
where Ob: Eq + Clone, Mor: Eq + Clone, Map: GraphMapping<CodV = Ob, CodE = Mor>, Map::VertexMap: Column, Map::EdgeMap: Column, Cod: Category<Ob = Ob, Mor = Mor>,

Source§

type ObGen = <Map as GraphMapping>::DomV

Type of object generators in domain category.
Source§

type MorGen = <Map as GraphMapping>::DomE

Type of morphism generators in domain category.
Source§

type ObGenMap = <Map as GraphMapping>::VertexMap

Type of underlying mapping from object generators to objects.
Source§

type MorGenMap = <Map as GraphMapping>::EdgeMap

Type of underlying mapping from morphism generators to morphisms.
Source§

fn ob_generator_map(&self) -> &Self::ObGenMap

Gets the underlying mapping from object generators to objects.
Source§

fn mor_generator_map(&self) -> &Self::MorGenMap

Gets the underlying mapping from morphism generators to morphisms.
Source§

fn apply_ob_generator(&self, x: Self::ObGen) -> Option<Self::CodOb>

Applies the mapping at a generating object.
Source§

fn apply_mor_generator(&self, m: Self::MorGen) -> Option<Self::CodMor>

Applies the mapping at a generating morphism.

Auto Trait Implementations§

§

impl<'a, Map, Cod> Freeze for FpFunctor<'a, Map, Cod>

§

impl<'a, Map, Cod> RefUnwindSafe for FpFunctor<'a, Map, Cod>
where Map: RefUnwindSafe, Cod: RefUnwindSafe,

§

impl<'a, Map, Cod> Send for FpFunctor<'a, Map, Cod>
where Map: Sync, Cod: Sync,

§

impl<'a, Map, Cod> Sync for FpFunctor<'a, Map, Cod>
where Map: Sync, Cod: Sync,

§

impl<'a, Map, Cod> Unpin for FpFunctor<'a, Map, Cod>

§

impl<'a, Map, Cod> UnwindSafe for FpFunctor<'a, Map, Cod>
where Map: RefUnwindSafe, Cod: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.