pub struct DblModelInstance<M: HasInstanceTerm> { /* private fields */ }Expand description
An instance of a model: a fibered set of generators plus equations between terms in the model’s instance-term language.
Owns the generator-to-fiber assignment and the equations, but does
not own the model itself (held behind an Rc, matching how models
reference their theories).
Implementations§
Source§impl<M: HasInstanceTerm> DblModelInstance<M>
impl<M: HasInstanceTerm> DblModelInstance<M>
Sourcepub fn add_generator(&mut self, name: QualifiedName, fiber: M::Ob)
pub fn add_generator(&mut self, name: QualifiedName, fiber: M::Ob)
Adds a generator living over the given object of the model.
Sourcepub fn fiber_of(&self, name: &QualifiedName) -> Option<&M::Ob>
pub fn fiber_of(&self, name: &QualifiedName) -> Option<&M::Ob>
The model object that name lives over, if name is a generator
of this instance.
Sourcepub fn generators(&self) -> impl Iterator<Item = (QualifiedName, &M::Ob)>
pub fn generators(&self) -> impl Iterator<Item = (QualifiedName, &M::Ob)>
Iterates over the instance generators and their fibers.
Sourcepub fn add_equation(&mut self, lhs: M::Term, rhs: M::Term)
pub fn add_equation(&mut self, lhs: M::Term, rhs: M::Term)
Adds an equation between two terms.
Auto Trait Implementations§
impl<M> Freeze for DblModelInstance<M>
impl<M> RefUnwindSafe for DblModelInstance<M>where
M: RefUnwindSafe,
<M as HasInstanceTerm>::Term: RefUnwindSafe,
<M as Category>::Ob: RefUnwindSafe,
impl<M> !Send for DblModelInstance<M>
impl<M> !Sync for DblModelInstance<M>
impl<M> Unpin for DblModelInstance<M>
impl<M> UnwindSafe for DblModelInstance<M>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.