Trait ukanren::Goal[][src]

pub trait Goal {
    type Iter: Iterator<Item = State>;
    fn apply(&self, s: &State) -> Self::Iter;

    fn and<G, I>(self, other: G) -> And<Self, G>
    where
        Self: Sized,
        G: Goal<Iter = I>,
        I: Iterator<Item = State>
, { ... }
fn or<G, I>(self, other: G) -> Or<Self, G>
    where
        Self: Sized,
        G: Goal<Iter = I>,
        I: Iterator<Item = State>
, { ... }
fn boxed(self) -> BoxedGoal<Self::Iter>
    where
        Self: Sized + 'static
, { ... }
fn run(&self, k: usize) -> RunStream<Self::Iter>
Notable traits for RunStream<I>
impl<I> Iterator for RunStream<I> where
    I: Iterator<Item = State>, 
type Item = State;
{ ... } }
Expand description

A goal that can be executed by the relational system.

Associated Types

The state iterator returned by the goal.

Required methods

Apply this goal to an initial state, returning a stream of satisfying states.

Provided methods

Take the conjunction of this goal with another.

Take the disjunction of this goal with another.

Box this goal, which simplifies types at the expense of performance.

Evaluate this goal on an empty state, returning a stream of results.

These results contain normalized forms of the first k variables, to avoid including auxiliary data that is not relevant to us.

Implementors