Struct chalk_solve::goal_builder::GoalBuilder [−][src]
pub struct GoalBuilder<'i, I: Interner> { /* fields omitted */ }
Implementations
Returns the database within the goal builder.
Creates a goal that ensures all of the goals from the goals
iterator are met (e.g., goals[0] && ... && goals[N]
).
pub fn implies<CS, C, G>(
&mut self,
clauses: CS,
goal: impl FnOnce(&mut Self) -> G
) -> Goal<I> where
CS: IntoIterator<Item = C>,
C: CastTo<ProgramClause<I>>,
G: CastTo<Goal<I>>,
pub fn implies<CS, C, G>(
&mut self,
clauses: CS,
goal: impl FnOnce(&mut Self) -> G
) -> Goal<I> where
CS: IntoIterator<Item = C>,
C: CastTo<ProgramClause<I>>,
G: CastTo<Goal<I>>,
Creates a goal clauses => goal
. The clauses are given as an iterator
and the goal is returned via the contained closure.
Given a bound value binders
like <P0..Pn> V
,
creates a goal forall<Q0..Qn> { G }
where
the goal G
is created by invoking a helper
function body
.
Parameters to body
body
will be invoked with:
- the goal builder
self
- the substitution
Q0..Qn
- the bound value
[P0..Pn => Q0..Qn] V
instantiated with the substitution - the value
passthru
, appropriately shifted so that any debruijn indices within account for the new binder
Why is body
a function and not a closure?
This is to ensure that body
doesn’t accidentally reference
values from the environment whose debruijn indices do not
account for the new binder being created.
Like GoalBuilder::forall
, but for a exists<Q0..Qn> { G }
goal.
Auto Trait Implementations
impl<'i, I> !RefUnwindSafe for GoalBuilder<'i, I>
impl<'i, I> !Send for GoalBuilder<'i, I>
impl<'i, I> !Sync for GoalBuilder<'i, I>
impl<'i, I> Unpin for GoalBuilder<'i, I>
impl<'i, I> !UnwindSafe for GoalBuilder<'i, I>
Blanket Implementations
Mutably borrows from an owned value. Read more
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more