Yesterday I implemented a predicate to compute the min and max of a list. Today I'm doing the same, but now with constraints.
The code looks pretty much the same thanks to the handy
:- use_module(library(clpfd)). min_and_max([V], A, B) :- V #= A, V #= B. min_and_max …