:- nodbgcomp.

:- lib(ria).

:- [proptest_common].


setup_and_solve(inc, AB, N, Vars, OrderedPairs) :-
	setup_bounds(Vars, N),
	setup_ordered(OrderedPairs, AB).
setup_and_solve(batch, AB, N, Vars, OrderedPairs) :-
	setup_bounds(Vars, N),
	call_priority(setup_ordered(OrderedPairs, AB), 1).


setup_bounds([], _N).
setup_bounds([X|Xs], N) :-
	X :: 0..N,
	setup_bounds(Xs, N).

setup_ordered([], _AB).
setup_ordered([Y1-Y2|Is], AB) :-
	Y2 *>= Y1+AB,
	setup_ordered(Is, AB).


