pub struct DiscreteDblModel { /* private fields */ }
Expand description
A finitely presented model of a discrete double theory.
Since discrete double theory has only identity operations, such a model is a finite presentation of a category sliced over the object and morphism types comprising the theory. A type theorist would call it a “displayed category”.
Implementations§
Source§impl DiscreteDblModel
impl DiscreteDblModel
Sourcepub fn new(theory: Rc<DiscreteDblTheory>) -> Self
pub fn new(theory: Rc<DiscreteDblTheory>) -> Self
Creates an empty model of the given theory.
Sourcepub fn theory_rc(&self) -> Rc<DiscreteDblTheory>
pub fn theory_rc(&self) -> Rc<DiscreteDblTheory>
Gets reference-counting pointer to the theory that this model is of.
Sourcepub fn generating_graph(
&self,
) -> &impl FinGraph<V = QualifiedName, E = QualifiedName>
pub fn generating_graph( &self, ) -> &impl FinGraph<V = QualifiedName, E = QualifiedName>
Returns the underlying graph of the model.
Sourcepub fn add_equation(&mut self, eq: PathEq<QualifiedName, QualifiedName>)
pub fn add_equation(&mut self, eq: PathEq<QualifiedName, QualifiedName>)
Adds a path equation to the model.
Sourcepub fn iter_invalid(&self) -> impl Iterator<Item = InvalidDblModel> + '_
pub fn iter_invalid(&self) -> impl Iterator<Item = InvalidDblModel> + '_
Iterates over failures of model to be well defined.
Sourcepub fn infer_missing(&mut self)
pub fn infer_missing(&mut self)
Infer missing data in the model, where possible.
Objects used in the domain or codomain of morphisms, but not contained as
objects of the model, are added and their types are inferred. It is not
always possible to do this consistently, so it is important to validate
the model even after calling this method.
Sourcepub fn push_forward<F>(&mut self, f: &F, new_theory: Rc<DiscreteDblTheory>)where
F: CategoryMap<DomOb = QualifiedName, DomMor = QualifiedPath, CodOb = QualifiedName, CodMor = QualifiedPath>,
pub fn push_forward<F>(&mut self, f: &F, new_theory: Rc<DiscreteDblTheory>)where
F: CategoryMap<DomOb = QualifiedName, DomMor = QualifiedPath, CodOb = QualifiedName, CodMor = QualifiedPath>,
Migrate model forward along a map between discrete double theories.
Trait Implementations§
Source§impl Category for DiscreteDblModel
impl Category for DiscreteDblModel
Source§type Ob = QualifiedName
type Ob = QualifiedName
Source§type Mor = Path<QualifiedName, QualifiedName>
type Mor = Path<QualifiedName, QualifiedName>
Source§fn compose(&self, path: Path<Self::Ob, Self::Mor>) -> Self::Mor
fn compose(&self, path: Path<Self::Ob, Self::Mor>) -> Self::Mor
Source§impl Clone for DiscreteDblModel
impl Clone for DiscreteDblModel
Source§fn clone(&self) -> DiscreteDblModel
fn clone(&self) -> DiscreteDblModel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl DblModel for DiscreteDblModel
impl DblModel for DiscreteDblModel
Source§type ObType = QualifiedName
type ObType = QualifiedName
Source§type MorType = Path<QualifiedName, QualifiedName>
type MorType = Path<QualifiedName, QualifiedName>
Source§type ObOp = QualifiedName
type ObOp = QualifiedName
Source§type MorOp = Path<QualifiedName, Path<QualifiedName, QualifiedName>>
type MorOp = Path<QualifiedName, Path<QualifiedName, QualifiedName>>
Source§type Theory = DiscreteDblTheory
type Theory = DiscreteDblTheory
Source§fn ob_act(&self, x: Self::Ob, _: &Self::ObOp) -> Self::Ob
fn ob_act(&self, x: Self::Ob, _: &Self::ObOp) -> Self::Ob
Source§impl Debug for DiscreteDblModel
impl Debug for DiscreteDblModel
Source§impl FgCategory for DiscreteDblModel
impl FgCategory for DiscreteDblModel
Source§type ObGen = QualifiedName
type ObGen = QualifiedName
Source§type MorGen = QualifiedName
type MorGen = QualifiedName
Source§fn ob_generators(&self) -> impl Iterator<Item = Self::ObGen>
fn ob_generators(&self) -> impl Iterator<Item = Self::ObGen>
Source§fn mor_generators(&self) -> impl Iterator<Item = Self::MorGen>
fn mor_generators(&self) -> impl Iterator<Item = Self::MorGen>
Source§fn mor_generator_dom(&self, f: &Self::MorGen) -> Self::Ob
fn mor_generator_dom(&self, f: &Self::MorGen) -> Self::Ob
Source§fn mor_generator_cod(&self, f: &Self::MorGen) -> Self::Ob
fn mor_generator_cod(&self, f: &Self::MorGen) -> Self::Ob
Source§impl FgDblModel for DiscreteDblModel
impl FgDblModel for DiscreteDblModel
Source§fn ob_generator_type(&self, ob: &Self::ObGen) -> Self::ObType
fn ob_generator_type(&self, ob: &Self::ObGen) -> Self::ObType
Source§fn mor_generator_type(&self, mor: &Self::MorGen) -> Self::MorType
fn mor_generator_type(&self, mor: &Self::MorGen) -> Self::MorType
Source§fn ob_generators_with_type(
&self,
typ: &Self::ObType,
) -> impl Iterator<Item = Self::ObGen>
fn ob_generators_with_type( &self, typ: &Self::ObType, ) -> impl Iterator<Item = Self::ObGen>
Source§fn mor_generators_with_type(
&self,
typ: &Self::MorType,
) -> impl Iterator<Item = Self::MorGen>
fn mor_generators_with_type( &self, typ: &Self::MorType, ) -> impl Iterator<Item = Self::MorGen>
Source§impl MutDblModel for DiscreteDblModel
impl MutDblModel for DiscreteDblModel
Source§fn add_ob(&mut self, x: Self::ObGen, ob_type: Self::ObType)
fn add_ob(&mut self, x: Self::ObGen, ob_type: Self::ObType)
Source§fn add_mor(
&mut self,
f: Self::MorGen,
dom: Self::Ob,
cod: Self::Ob,
mor_type: Self::MorType,
)
fn add_mor( &mut self, f: Self::MorGen, dom: Self::Ob, cod: Self::Ob, mor_type: Self::MorType, )
Source§fn make_mor(&mut self, f: Self::MorGen, mor_type: Self::MorType)
fn make_mor(&mut self, f: Self::MorGen, mor_type: Self::MorType)
Source§fn get_dom(&self, f: &Self::MorGen) -> Option<&Self::Ob>
fn get_dom(&self, f: &Self::MorGen) -> Option<&Self::Ob>
Source§impl PartialEq for DiscreteDblModel
impl PartialEq for DiscreteDblModel
Source§impl Validate for DiscreteDblModel
impl Validate for DiscreteDblModel
Source§type ValidationError = InvalidDblModel
type ValidationError = InvalidDblModel
impl Eq for DiscreteDblModel
Auto Trait Implementations§
impl !Freeze for DiscreteDblModel
impl !RefUnwindSafe for DiscreteDblModel
impl !Send for DiscreteDblModel
impl !Sync for DiscreteDblModel
impl Unpin for DiscreteDblModel
impl !UnwindSafe for DiscreteDblModel
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.