pub fn max<'a, T, A, B, C, D>(a: A, b: B, c: C) -> Goal<'a, D>where
T: PartialOrd + UnifyIn<'a, D> + 'a,
A: IntoVal<T>,
B: IntoVal<T>,
C: IntoVal<T>,
D: DomainType<'a, T>,Expand description
Get the greater of two values according to std::cmp::max.
ยงExample:
use canrun::{unify, util, var, all, Goal};
use canrun::domains::example::I32;
use canrun_basic::max;
let (x, y, z) = (var(), var(), var());
let goal: Goal<I32> = all![
unify(x, 1),
unify(y, 2),
unify(z, 2),
max(x, y, z),
];
let results: Vec<_> = goal.query((x, y, z)).collect();
assert_eq!(results, vec![(1, 2, 2)]);