Code in Prolog. Do not use in built libraries. Implement the following relation to get a scalar product from two list of numbers. prodScalar It should work like the following: ?- prodScalar([], [],...


Code in Prolog. Do not use in built libraries.



  1. Implement the following relation to get a scalar product from two list of numbers.

    • prodScalar

    • It should work like the following:




?- prodScalar([], [], P).


P = 0.



?- prodScalar([3], [4], P).


P = 12.



?- prodScalar([3, 2], [4, 2], P).


P = 16 .



?- prodScalar([3, 2, 4], [4, 2, 2], P).


P = 24 .



?- prodScalar([3, 2, 4], [4, 2, 0], P).


P = 16 .



Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here