Function canrun::goals::ops::sub

source ·
pub fn sub<T, A, B, C>(a: A, b: B, c: C) -> impl Goalwhere
    T: Unify + Add<Output = T> + Sub<Output = T> + Copy,
    A: Into<Value<T>>,
    B: Into<Value<T>>,
    C: Into<Value<T>>,
Expand description

Subtract one value from another.

Example:

use canrun::{LVar, Query};
use canrun::ops::sub;

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