====== Matrix add ====== {{tag>math matrix}} ===== Description ===== Adding two matrixs **Source**: PROLOG str. 201 Wydawnictwo PLJ Warszawa 1991 ISBN 83-85190-63-5 ===== Download ===== Program source code: {{matrix_add.pl}} ===== Listing ===== dodm([L1|O1], [L2|O2], [L3|O3]) :- dod1(L1, L2, L3), dodm(O1, O2, O3). dodm([], [], []). dod1([L1|O1], [L2|O2], [L3|O3]) :- L3 is L1 + L2, dod1(O1, O2, O3). dod1([], [], []). test :- dodm([[1, 3], [4, 5]], [[6, 3], [6, 8]], M). ===== Comments =====