dot([], [], 0).

dot([H1|T1], [H2|T2], X) :-
    dot(T1, T2, Y),
    X is (H1*H2)+Y.
