Prolog recursivly build list based on dot product -
hi have prolog function/predicate? takes dot product of 2 list. , use write function builds list of dot products list , list of list. basically, dot product called on each list in list of list function dot below , works. dot([], [], 0). dot([head|tail], [head2|tail2], result) :- prod = head * head2, dot(tail, tail2, remaining), result prod + remaining. this attempt @ function fails every-time try run it. can 1 help? dotall([], [[]], [0]). dotall(x, [[head]|[tail]], result) :- dotunit(x, head, prod), result = [prod|result], dotall(x, tail, result). to sum of goal, if passed in dotall([1,2,3],[[1,2,3],[4,5,6],[1,2,3]], what). back, what [15,32,15] . i know mouth full hope 1 can give me pointers on im going wrong. im new prolog. the dotall predicate believe (from example) defined be: dotall(vector, listofvectors, results) and says results list of dot product results obtained taking dot product of vector each vector in listofvectors ...