Function proto_vulcan::relation::member1 [−][src]
pub fn member1<U, E, G>(x: LTerm<U, E>, l: LTerm<U, E>) -> InferredGoal<U, E, G> where
U: User,
E: Engine<U>,
G: AnyGoal<U, E>,
Expand description
A relation that succeeds once if x
is in list l
.
Example
extern crate proto_vulcan;
use proto_vulcan::prelude::*;
use proto_vulcan::relation::member1;
fn main() {
let query = proto_vulcan_query!(|q| {
member1(q, [1, 1, 1, 1, 1])
});
let mut iter = query.run();
assert_eq!(iter.next().unwrap().q, 1);
assert!(iter.next().is_none());
}