• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need Eclipse/Prolog help!

huzefa1

Member
dot_product([],[],X):-
X #= 0.
dot_product([A],,X):-
X #= A*B + dot_product([],[],G).
dot_product([A|Tail],[B|Rest],X):-
X #= (A*B) + dot_product(Tail, Rest, H).

OK, I know it's stupid program, but first time using prolog. Trying to compute dotproduct of two equallength lists using fd(finite domain) library. I'm getting an error at runtiem:

type error in X #= 1 * 4 + dot_product(Tail, Rest, H)

Any idea what I'm missing?
 
Back
Top