I'm new to prolog and I'm using swi-prolog on ubuntu to learn. I'm using the clpfd module to solve a worker/product allocation problem.
The problem is stated in this paper on page 7.
Here is what I have so far from that paper.
solver(Sol) :-
Sol = [A,B,C,D],
[A,B,C,D] ins 1..4,
all_distinct(Sol),
element(A,[7,1,3,4],A1),
element(B,[8,2,5,1],B1),
element(C,[4,3,7,2],C1),
element(D,[3,1,6,3],D1),
A1 + B1 + C1 + D1 #= E,
maximize(E,Sol),
label(Sol).
I'm unable to get maximize to work. It throws an error
ERROR: solver/1: Undefined procedure: maximize/2
ERROR: However, there are definitions for:
ERROR: maximize/3
Could someone point out why the maximize function isn't working as expected or how I should be framing it? Thanks in advance.