pub struct CoreSubstitution<L: Language> { /* private fields */ }
Implementations§
Source§impl<L: Language> CoreSubstitution<L>
impl<L: Language> CoreSubstitution<L>
Sourcepub fn domain(&self) -> Set<CoreVariable<L>>
pub fn domain(&self) -> Set<CoreVariable<L>>
Returns the variables that will be substituted for a new value.
Sourcepub fn range(&self) -> Set<CoreParameter<L>>
pub fn range(&self) -> Set<CoreParameter<L>>
Returns the parameters that that will be substituted for a new value.
Sourcepub fn maps(&self, v: CoreVariable<L>) -> bool
pub fn maps(&self, v: CoreVariable<L>) -> bool
True if v
is in this substitution’s domain
pub fn iter( &self, ) -> impl Iterator<Item = (CoreVariable<L>, CoreParameter<L>)> + '_
Source§impl<L: Language> CoreSubstitution<L>
impl<L: Language> CoreSubstitution<L>
pub fn apply<T: CoreFold<L>>(&self, t: &T) -> T
pub fn get(&self, v: CoreVariable<L>) -> Option<CoreParameter<L>>
Trait Implementations§
Source§impl<L: Clone + Language> Clone for CoreSubstitution<L>
impl<L: Clone + Language> Clone for CoreSubstitution<L>
Source§fn clone(&self) -> CoreSubstitution<L>
fn clone(&self) -> CoreSubstitution<L>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<L: Language> CoreFold<L> for CoreSubstitution<L>
impl<L: Language> CoreFold<L> for CoreSubstitution<L>
Source§fn substitute(&self, substitution_fn: SubstitutionFn<'_, L>) -> Self
fn substitute(&self, substitution_fn: SubstitutionFn<'_, L>) -> Self
Replace uses of variables with values from the substitution.
Source§fn shift_in(&self) -> Self
fn shift_in(&self) -> Self
Produce a version of this term where any debruijn indices which appear free are incremented by one.
Source§fn replace_free_var(
&self,
v: impl Upcast<CoreVariable<L>>,
p: impl Upcast<CoreParameter<L>>,
) -> Self
fn replace_free_var( &self, v: impl Upcast<CoreVariable<L>>, p: impl Upcast<CoreParameter<L>>, ) -> Self
Replace all appearances of free variable
v
with p
.Source§impl<L: Language> CoreVisit<L> for CoreSubstitution<L>
impl<L: Language> CoreVisit<L> for CoreSubstitution<L>
Source§fn free_variables(&self) -> Vec<CoreVariable<L>>
fn free_variables(&self) -> Vec<CoreVariable<L>>
Extract the list of free variables (for the purposes of this function, defined by
Variable::is_free
).
The list may contain duplicates and must be in a determinstic order (though the order itself isn’t important).Source§fn size(&self) -> usize
fn size(&self) -> usize
Measures the overall size of the term by counting constructors etc.
Used to determine overflow.
Source§fn assert_valid(&self)
fn assert_valid(&self)
Asserts various validity constraints and panics if they are not held.
These validition constraints should never fail unless there is a bug in our logic.
This is to aid with fuzzing and bug detection.
Source§fn references_only_universal_variables(&self) -> bool
fn references_only_universal_variables(&self) -> bool
True if this term references only universal variables.
This means that it contains no existential variables.
If this is a goal, then when we prove it true, we don’t expect any substitution.
This is similar, but not identical, to the commonly used term “ground term”,
which in Prolog refers to a term that contains no variables. The difference here
is that the term may contain variables, but only those instantiated universally (∀).
Source§impl<L: Language> Debug for CoreSubstitution<L>
impl<L: Language> Debug for CoreSubstitution<L>
Source§impl<L: Default + Language> Default for CoreSubstitution<L>
impl<L: Default + Language> Default for CoreSubstitution<L>
Source§fn default() -> CoreSubstitution<L>
fn default() -> CoreSubstitution<L>
Returns the “default value” for a type. Read more
Source§impl<L: Language, A, B> Extend<(A, B)> for CoreSubstitution<L>
impl<L: Language, A, B> Extend<(A, B)> for CoreSubstitution<L>
Source§fn extend<T: IntoIterator<Item = (A, B)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (A, B)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<L: Language, A, B> FromIterator<(A, B)> for CoreSubstitution<L>
impl<L: Language, A, B> FromIterator<(A, B)> for CoreSubstitution<L>
Source§impl<L: Language> Index<CoreVariable<L>> for CoreSubstitution<L>
impl<L: Language> Index<CoreVariable<L>> for CoreSubstitution<L>
Source§impl<L: Language> IntoIterator for CoreSubstitution<L>
impl<L: Language> IntoIterator for CoreSubstitution<L>
Source§impl<L: Ord + Language> Ord for CoreSubstitution<L>
impl<L: Ord + Language> Ord for CoreSubstitution<L>
Source§fn cmp(&self, other: &CoreSubstitution<L>) -> Ordering
fn cmp(&self, other: &CoreSubstitution<L>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<L: PartialOrd + Language> PartialOrd for CoreSubstitution<L>
impl<L: PartialOrd + Language> PartialOrd for CoreSubstitution<L>
Source§impl<L: Language, Vs> SubAssign<Vs> for CoreSubstitution<L>
impl<L: Language, Vs> SubAssign<Vs> for CoreSubstitution<L>
Source§fn sub_assign(&mut self, rhs: Vs)
fn sub_assign(&mut self, rhs: Vs)
Performs the
-=
operation. Read moreSource§impl<L: Language, A, B> UpcastFrom<(A, B)> for CoreSubstitution<L>
impl<L: Language, A, B> UpcastFrom<(A, B)> for CoreSubstitution<L>
fn upcast_from(term: (A, B)) -> Self
impl<L: Eq + Language> Eq for CoreSubstitution<L>
impl<L: Language> StructuralPartialEq for CoreSubstitution<L>
Auto Trait Implementations§
impl<L> Freeze for CoreSubstitution<L>
impl<L> RefUnwindSafe for CoreSubstitution<L>
impl<L> Send for CoreSubstitution<L>
impl<L> Sync for CoreSubstitution<L>
impl<L> Unpin for CoreSubstitution<L>
impl<L> UnwindSafe for CoreSubstitution<L>
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