use super::*;
pub fn not<'a, T>(fact: LambdaUnit<'a, T>) -> LambdaUnit<'a, T>
where
T: Target<'a>,
{
lambda_unit("not", move |g, t| {
let label = format!("not({:?})", fact);
let fact = fact.clone();
brute(label, move |o| fact.clone().check(o).is_err()).mutate(g, t)
})
}
#[test]
fn test_not() {
observability::test_run().ok();
let mut g = utils::random_generator();
let eq1 = eq(1);
let not1 = vec(not(eq1));
let nums = not1.clone().build(&mut g);
not1.clone().check(&nums).unwrap();
assert!(nums.iter().all(|x| *x != 1));
}