[−][src]Function canrun_basic::cmp::lt
pub fn lt<'a, A, AV, B, BV, D>(a: AV, b: BV) -> Goal<'a, D> where
A: PartialOrd<B> + Debug + 'a,
B: Debug + 'a,
AV: IntoVal<A>,
BV: IntoVal<B>,
D: DomainType<'a, A> + DomainType<'a, B>,
Ensure that one value is less than another.
Example:
use canrun::{unify, util, var, all, Goal}; use canrun::domains::example::I32; use canrun_basic::lt; let (x, y) = (var(), var()); let goal: Goal<I32> = all![ unify(x, 1), unify(y, 2), lt(x, y) ]; let results: Vec<_> = goal.query((x, y)).collect(); assert_eq!(results, vec![(1, 2)]);