Интересно, это
:- use_module(library(clpfd)).
mutiply(X,Y,Z) :-
Z #= X*Y.
multiply_lists(L1, L2, Out) :-
maplist(mutiply, L1,L2,Out).
С результатами:
?- multiply_lists([1,2,3], [4,5,6], X).
X = [4, 10, 18].
?- multiply_lists(X, [4,5,6], [4,8,10]).
false.
?- multiply_lists(X, [4,5,6], [4,10,18]).
X = [1, 2, 3].
?- multiply_lists(X, Y, [4,10,18]).
X = [_17366, _17372, _17378],
Y = [_17396, _17402, _17408],
_17366 in -4.. -1\/1..4,
_17366*_17396#=4,
_17396 in -4.. -1\/1..4,
_17372 in -10.. -1\/1..10,
_17372*_17402#=10,
_17402 in -10.. -1\/1..10,
_17378 in -18.. -1\/1..18,
_17378*_17408#=18,
_17408 in -18.. -1\/1..18.