pub enum GoalData<I: Interner> {
Quantified(QuantifierKind, Binders<Goal<I>>),
Implies(ProgramClauses<I>, Goal<I>),
All(Goals<I>),
Not(Goal<I>),
EqGoal(EqGoal<I>),
SubtypeGoal(SubtypeGoal<I>),
DomainGoal(DomainGoal<I>),
CannotProve,
}
Expand description
A general goal; this is the full range of questions you can pose to Chalk.
Variants§
Quantified(QuantifierKind, Binders<Goal<I>>)
Introduces a binding at depth 0, shifting other bindings up (deBruijn index).
Implies(ProgramClauses<I>, Goal<I>)
A goal that holds given some clauses (like an if-statement).
All(Goals<I>)
List of goals that all should hold.
Not(Goal<I>)
Negation: the inner goal should not hold.
EqGoal(EqGoal<I>)
Make two things equal; the rules for doing so are well known to the logic
SubtypeGoal(SubtypeGoal<I>)
Make one thing a subtype of another; the rules for doing so are well known to the logic
DomainGoal(DomainGoal<I>)
A “domain goal” indicates some base sort of goal that can be proven via program clauses
CannotProve
Indicates something that cannot be proven to be true or false
definitively. This can occur with overflow but also with
unifications of skolemized variables like forall<X,Y> { X = Y }
. Of course, that statement is false, as there exist types
X, Y where X = Y
is not true. But we treat it as “cannot
prove” so that forall<X,Y> { not { X = Y } }
also winds up
as cannot prove.
Implementations§
Trait Implementations§
source§impl<I: Interner> HasInterner for GoalData<I>
impl<I: Interner> HasInterner for GoalData<I>
source§impl<I: PartialEq + Interner> PartialEq for GoalData<I>
impl<I: PartialEq + Interner> PartialEq for GoalData<I>
source§impl<I: Interner> TypeFoldable<I> for GoalData<I>
impl<I: Interner> TypeFoldable<I> for GoalData<I>
source§fn try_fold_with<E>(
self,
folder: &mut dyn FallibleTypeFolder<I, Error = E>,
outer_binder: DebruijnIndex,
) -> Result<Self, E>
fn try_fold_with<E>( self, folder: &mut dyn FallibleTypeFolder<I, Error = E>, outer_binder: DebruijnIndex, ) -> Result<Self, E>
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.source§fn fold_with(
self,
folder: &mut dyn TypeFolder<I>,
outer_binder: DebruijnIndex,
) -> Self
fn fold_with( self, folder: &mut dyn TypeFolder<I>, outer_binder: DebruijnIndex, ) -> Self
try_fold_with
for use with infallible
folders. Do not override this method, to ensure coherence with
try_fold_with
.source§impl<I: Interner> TypeVisitable<I> for GoalData<I>
impl<I: Interner> TypeVisitable<I> for GoalData<I>
source§fn visit_with<B>(
&self,
visitor: &mut dyn TypeVisitor<I, BreakTy = B>,
outer_binder: DebruijnIndex,
) -> ControlFlow<B>
fn visit_with<B>( &self, visitor: &mut dyn TypeVisitor<I, BreakTy = B>, outer_binder: DebruijnIndex, ) -> ControlFlow<B>
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.impl<I: Interner> Copy for GoalData<I>where
I::InternedType: Copy,
I::InternedLifetime: Copy,
I::InternedGenericArg: Copy,
I::InternedSubstitution: Copy,
I::InternedGoal: Copy,
I::InternedGoals: Copy,
I::InternedProgramClauses: Copy,
I::InternedVariableKinds: Copy,
impl<I: Eq + Interner> Eq for GoalData<I>
impl<I: Interner> StructuralPartialEq for GoalData<I>
Auto Trait Implementations§
impl<I> Freeze for GoalData<I>where
<I as Interner>::InternedProgramClauses: Freeze,
<I as Interner>::InternedGoal: Freeze,
<I as Interner>::InternedGoals: Freeze,
<I as Interner>::InternedVariableKinds: Freeze,
<I as Interner>::InternedGenericArg: Freeze,
<I as Interner>::InternedType: Freeze,
<I as Interner>::DefId: Freeze,
<I as Interner>::InternedSubstitution: Freeze,
<I as Interner>::InternedLifetime: Freeze,
impl<I> RefUnwindSafe for GoalData<I>where
<I as Interner>::InternedProgramClauses: RefUnwindSafe,
<I as Interner>::InternedGoal: RefUnwindSafe,
<I as Interner>::InternedGoals: RefUnwindSafe,
<I as Interner>::InternedVariableKinds: RefUnwindSafe,
<I as Interner>::InternedGenericArg: RefUnwindSafe,
<I as Interner>::InternedType: RefUnwindSafe,
<I as Interner>::DefId: RefUnwindSafe,
<I as Interner>::InternedSubstitution: RefUnwindSafe,
<I as Interner>::InternedLifetime: RefUnwindSafe,
impl<I> Send for GoalData<I>where
<I as Interner>::InternedProgramClauses: Send,
<I as Interner>::InternedGoal: Send,
<I as Interner>::InternedGoals: Send,
<I as Interner>::InternedVariableKinds: Send,
<I as Interner>::InternedGenericArg: Send,
<I as Interner>::InternedType: Send,
<I as Interner>::DefId: Send,
<I as Interner>::InternedSubstitution: Send,
<I as Interner>::InternedLifetime: Send,
impl<I> Sync for GoalData<I>where
<I as Interner>::InternedProgramClauses: Sync,
<I as Interner>::InternedGoal: Sync,
<I as Interner>::InternedGoals: Sync,
<I as Interner>::InternedVariableKinds: Sync,
<I as Interner>::InternedGenericArg: Sync,
<I as Interner>::InternedType: Sync,
<I as Interner>::DefId: Sync,
<I as Interner>::InternedSubstitution: Sync,
<I as Interner>::InternedLifetime: Sync,
impl<I> Unpin for GoalData<I>where
<I as Interner>::InternedProgramClauses: Unpin,
<I as Interner>::InternedGoal: Unpin,
<I as Interner>::InternedGoals: Unpin,
<I as Interner>::InternedVariableKinds: Unpin,
<I as Interner>::InternedGenericArg: Unpin,
<I as Interner>::InternedType: Unpin,
<I as Interner>::DefId: Unpin,
<I as Interner>::InternedSubstitution: Unpin,
<I as Interner>::InternedLifetime: Unpin,
impl<I> UnwindSafe for GoalData<I>where
<I as Interner>::InternedProgramClauses: UnwindSafe,
<I as Interner>::InternedGoal: UnwindSafe,
<I as Interner>::InternedGoals: UnwindSafe,
<I as Interner>::InternedVariableKinds: UnwindSafe,
<I as Interner>::InternedGenericArg: UnwindSafe,
<I as Interner>::InternedType: UnwindSafe,
<I as Interner>::DefId: UnwindSafe,
<I as Interner>::InternedSubstitution: UnwindSafe,
<I as Interner>::InternedLifetime: UnwindSafe,
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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T, I> CouldMatch<T> for T
impl<T, I> CouldMatch<T> for T
source§fn 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
self
and other
could possibly match.source§impl<T, I> Shift<I> for Twhere
T: TypeFoldable<I>,
I: Interner,
impl<T, I> Shift<I> for Twhere
T: TypeFoldable<I>,
I: Interner,
source§fn shifted_in(self, interner: I) -> T
fn shifted_in(self, interner: I) -> T
source§fn shifted_in_from(self, interner: I, source_binder: DebruijnIndex) -> T
fn shifted_in_from(self, interner: I, source_binder: DebruijnIndex) -> T
outer_binder
so that it is
valid at the innermost binder. See DebruijnIndex::shifted_in_from
for a detailed explanation.source§fn shifted_out_to(
self,
interner: I,
target_binder: DebruijnIndex,
) -> Result<T, NoSolution>
fn shifted_out_to( self, interner: I, target_binder: DebruijnIndex, ) -> Result<T, NoSolution>
outer_binder
. See DebruijnIndex::shifted_out_to
for a detailed explanation.