Function canrun::goals::cmp::lt

source ·
pub fn lt<A, AV, B, BV>(a: AV, b: BV) -> impl Goalwhere
    A: Unify + PartialOrd<B>,
    B: Unify,
    AV: Into<Value<A>>,
    BV: Into<Value<B>>,
Expand description

Ensure that one value is less than another.

Example:

use canrun::{unify, LVar, all, Query};
use canrun::cmp::lt;

let (x, y) = (LVar::new(), LVar::new());
let goal = all![
    unify(x, 1),
    unify(y, 2),
    lt(x, y)
];
let results: Vec<_> = goal.query((x, y)).collect();
assert_eq!(results, vec![(1, 2)]);