pub struct Goal<I: Interner> { /* private fields */ }
Expand description
A general goal; this is the full range of questions you can pose to Chalk.
Implementations
sourceimpl<I: Interner> Goal<I>
impl<I: Interner> Goal<I>
sourcepub fn interned(&self) -> &I::InternedGoal
pub fn interned(&self) -> &I::InternedGoal
Gets the interned goal.
sourcepub fn quantify(
self,
interner: I,
kind: QuantifierKind,
binders: VariableKinds<I>
) -> Goal<I>
pub fn quantify(
self,
interner: I,
kind: QuantifierKind,
binders: VariableKinds<I>
) -> Goal<I>
Create a goal using a forall
or exists
quantifier.
sourcepub fn compatible(self, interner: I) -> Self
pub fn compatible(self, interner: I) -> Self
Takes a goal G
and turns it into compatible { G }
.
sourcepub fn implied_by(self, interner: I, predicates: ProgramClauses<I>) -> Goal<I>
pub fn implied_by(self, interner: I, predicates: ProgramClauses<I>) -> Goal<I>
Create an implication goal that holds if the predicates are true.
sourcepub fn is_trivially_true(&self, interner: I) -> bool
pub fn is_trivially_true(&self, interner: I) -> bool
True if this goal is “trivially true” – i.e., no work is required to prove it.
sourceimpl<I> Goal<I> where
I: Interner,
impl<I> Goal<I> where
I: Interner,
sourcepub fn all<II>(interner: I, iter: II) -> Self where
II: IntoIterator<Item = Goal<I>>,
pub fn all<II>(interner: I, iter: II) -> Self where
II: IntoIterator<Item = Goal<I>>,
Creates a single goal that only holds if a list of goals holds.
Trait Implementations
sourceimpl<I: Interner> CastTo<Goal<I>> for SubtypeGoal<I>
impl<I: Interner> CastTo<Goal<I>> for SubtypeGoal<I>
sourceimpl<I: Interner, T: HasInterner<Interner = I> + CastTo<Goal<I>>> CastTo<Goal<I>> for Binders<T>
impl<I: Interner, T: HasInterner<Interner = I> + CastTo<Goal<I>>> CastTo<Goal<I>> for Binders<T>
sourceimpl<I: Interner> Fold<I> for Goal<I>
impl<I: Interner> Fold<I> for Goal<I>
Folding a goal invokes the fold_goal
callback (which will, by
default, invoke super-fold).
type Result = Goal<I>
type Result = Goal<I>
The type of value that will be produced once folding is done.
Typically this is Self
, unless Self
contains borrowed
values, in which case owned values are produced (for example,
one can fold over a &T
value where T: Fold
, in which case
you get back a T
, not a &T
). Read more
sourcefn fold_with<E>(
self,
folder: &mut dyn Folder<I, Error = E>,
outer_binder: DebruijnIndex
) -> Result<Self::Result, E>
fn fold_with<E>(
self,
folder: &mut dyn Folder<I, Error = E>,
outer_binder: DebruijnIndex
) -> Result<Self::Result, E>
Apply the given folder folder
to self
; binders
is the
number of binders that are in scope when beginning the
folder. Typically binders
starts as 0, but is adjusted when
we encounter Binders<T>
in the IR or other similar
constructs. Read more
sourceimpl<I: Interner> HasInterner for Goal<I>
impl<I: Interner> HasInterner for Goal<I>
type Interner = I
type Interner = I
The interner associated with the type.
sourceimpl<I: Ord + Interner> Ord for Goal<I> where
I::InternedGoal: Ord,
impl<I: Ord + Interner> Ord for Goal<I> where
I::InternedGoal: Ord,
sourceimpl<I: PartialEq + Interner> PartialEq<Goal<I>> for Goal<I> where
I::InternedGoal: PartialEq,
impl<I: PartialEq + Interner> PartialEq<Goal<I>> for Goal<I> where
I::InternedGoal: PartialEq,
sourceimpl<I: PartialOrd + Interner> PartialOrd<Goal<I>> for Goal<I> where
I::InternedGoal: PartialOrd,
impl<I: PartialOrd + Interner> PartialOrd<Goal<I>> for Goal<I> where
I::InternedGoal: PartialOrd,
sourcefn partial_cmp(&self, other: &Goal<I>) -> Option<Ordering>
fn partial_cmp(&self, other: &Goal<I>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<I: Interner> SuperFold<I> for Goal<I>
impl<I: Interner> SuperFold<I> for Goal<I>
Superfold folds recursively.
sourcefn super_fold_with<E>(
self,
folder: &mut dyn Folder<I, Error = E>,
outer_binder: DebruijnIndex
) -> Result<Self::Result, E>
fn super_fold_with<E>(
self,
folder: &mut dyn Folder<I, Error = E>,
outer_binder: DebruijnIndex
) -> Result<Self::Result, E>
Recursively folds the value.
sourceimpl<I: Interner> SuperVisit<I> for Goal<I>
impl<I: Interner> SuperVisit<I> for Goal<I>
sourcefn super_visit_with<B>(
&self,
visitor: &mut dyn Visitor<I, BreakTy = B>,
outer_binder: DebruijnIndex
) -> ControlFlow<B>
fn super_visit_with<B>(
&self,
visitor: &mut dyn Visitor<I, BreakTy = B>,
outer_binder: DebruijnIndex
) -> ControlFlow<B>
Recursively visits the type contents.
sourceimpl<I: Interner> Visit<I> for Goal<I>
impl<I: Interner> Visit<I> for Goal<I>
sourcefn visit_with<B>(
&self,
visitor: &mut dyn Visitor<I, BreakTy = B>,
outer_binder: DebruijnIndex
) -> ControlFlow<B>
fn visit_with<B>(
&self,
visitor: &mut dyn Visitor<I, BreakTy = B>,
outer_binder: DebruijnIndex
) -> ControlFlow<B>
Apply the given visitor visitor
to self
; binders
is the
number of binders that are in scope when beginning the
visitor. Typically binders
starts as 0, but is adjusted when
we encounter Binders<T>
in the IR or other similar
constructs. Read more
impl<I: Copy + Interner> Copy for Goal<I> where
I::InternedGoal: Copy,
impl<I: Eq + Interner> Eq for Goal<I> where
I::InternedGoal: Eq,
impl<I: Interner> StructuralEq for Goal<I>
impl<I: Interner> StructuralPartialEq for Goal<I>
Auto Trait Implementations
impl<I> RefUnwindSafe for Goal<I> where
<I as Interner>::InternedGoal: RefUnwindSafe,
impl<I> Send for Goal<I> where
<I as Interner>::InternedGoal: Send,
impl<I> Sync for Goal<I> where
<I as Interner>::InternedGoal: Sync,
impl<I> Unpin for Goal<I> where
<I as Interner>::InternedGoal: Unpin,
impl<I> UnwindSafe for Goal<I> where
<I as Interner>::InternedGoal: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Cast for T
impl<T> Cast for T
sourcefn cast<U>(self, interner: U::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: U::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.
sourceimpl<T, I> CouldMatch<T> for T where
T: Zip<I> + HasInterner<Interner = I> + ?Sized,
I: Interner,
impl<T, I> CouldMatch<T> for T where
T: Zip<I> + HasInterner<Interner = I> + ?Sized,
I: Interner,
sourcefn could_match(
&self,
interner: I,
db: &dyn UnificationDatabase<I>,
other: &T
) -> bool
fn could_match(
&self,
interner: I,
db: &dyn UnificationDatabase<I>,
other: &T
) -> bool
Checks whether self
and other
could possibly match.
sourceimpl<T, I> Shift<I> for T where
T: Fold<I>,
I: Interner,
impl<T, I> Shift<I> for T where
T: Fold<I>,
I: Interner,
sourcefn shifted_in(self, interner: I) -> Self::Result
fn shifted_in(self, interner: I) -> Self::Result
Shifts this term in one level of binders.
sourcefn shifted_in_from(self, interner: I, source_binder: DebruijnIndex) -> T::Result
fn shifted_in_from(self, interner: I, source_binder: DebruijnIndex) -> T::Result
Shifts a term valid at outer_binder
so that it is
valid at the innermost binder. See DebruijnIndex::shifted_in_from
for a detailed explanation. Read more
sourcefn shifted_out_to(
self,
interner: I,
target_binder: DebruijnIndex
) -> Fallible<T::Result>
fn shifted_out_to(
self,
interner: I,
target_binder: DebruijnIndex
) -> Fallible<T::Result>
Shifts a term valid at the innermost binder so that it is
valid at outer_binder
. See DebruijnIndex::shifted_out_to
for a detailed explanation. Read more
sourcefn shifted_out(self, interner: I) -> Fallible<Self::Result>
fn shifted_out(self, interner: I) -> Fallible<Self::Result>
Shifts this term out one level of binders.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more