Не так много вещей, которые можно изменить:
member_(In, X) :-
member(X, In).
get_calcul([], [], Out, Out).
get_calcul([N|T], [Op|Top], Temp, Out) :-
append(Temp, [Op, N], Temp1),
get_calcul(T, Top, Temp1, Out).
all_operations(In, Out) :-
length(In, Len),
LenOps is Len - 1,
length(LOps, LenOps),
length(Input, LenOps),
setof([V,Op], LOps^Ops^Input^(maplist(member_([+,-,/,*]), LOps),
maplist(member_(In), Input),
get_calcul(Input, LOps, [], Ops),
atomic_list_concat(Ops, Op),
compute(Op, V),
member(V, In)), Out).
compute(Atom, V) :-
catch((term_to_atom(Term, Atom), V is Term), V, fail).
Мы получаем:
?- all_operations([1,2,3], Out), maplist(writeln, Out).
[1,+1*1]
[1,+1/1]
[1,+2-1]
[1,+2/2]
[1,+3-2]
[1,+3/3]
[1,-1+2]
[1,-2+3]
[2,+1*2]
[2,+1+1]
[2,+2*1]
[2,+2/1]
[2,+3-1]
[2,-1+3]
[3,+1*3]
[3,+1+2]
[3,+2+1]
[3,+3*1]
[3,+3/1]
Out = [[1, '+1*1'], [1, '+1/1'], [1, '+2-1'], [1, '+2/2'], [1, '+3-2'], [1, '+3/3'], [1, '-1+2'], [1|...], [...|...]|...].