Function gt

Source
pub fn gt<'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>,
Expand description

Ensure that one value is greater than another.

ยงExample:

use canrun::{unify, util, var, all, Goal};
use canrun::domains::example::I32;
use canrun_basic::gt;

let (x, y) = (var(), var());
let goal: Goal<I32> = all![
    unify(x, 2),
    unify(y, 1),
    gt(x, y)
];
let results: Vec<_> = goal.query((x, y)).collect();
assert_eq!(results, vec![(2, 1)]);