Created
December 22, 2018 17:07
-
-
Save DonaldKellett/c0a2c53dda0a9d7ea1c33af42aaf328e to your computer and use it in GitHub Desktop.
Learn Prolog Now! - Chapter 5 - Practical Session - Programming Exercise 3 - Dot product of 2 vectors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dot([], [], 0). | |
dot([X | V1], [Y | V2], Z) :- dot(V1, V2, Result), Z is X * Y + Result. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment