pumpkin_solver

Macro conjunction

source
macro_rules! conjunction {
    (@to_conjunction $($body:tt)*) => { ... };
    (@munch {$($body:tt)*} -> & [$($pred:tt)+] $($rest:tt)*) => { ... };
    (@munch {$($body:tt)*} -> ) => { ... };
    (@munch {$($body:tt)*} -> $($rest:tt)+) => { ... };
    ($($input:tt)+) => { ... };
    () => { ... };
}
Expand description

A macro which allows for the creation of a PropositionalConjunction.

ยงExample

let mut solver = Solver::default();
let x = solver.new_bounded_integer(0, 10);
let y = solver.new_bounded_integer(5, 15);

let conjunction = conjunction!([x >= 5] & [y <= 10]);
assert_eq!(
    conjunction,
    PropositionalConjunction::new(vec![predicate!(x >= 5), predicate!(y <= 10)].into())
);