%-----------------The matrix entries we need compute----- matrix(1,2). matrix(1,3). matrix(1,4). matrix(1,5). matrix(1,6). matrix(1,7). matrix(1,8). matrix(1,9). matrix(1,10). matrix(2,3). matrix(2,4). matrix(2,5). matrix(2,6). matrix(2,7). matrix(2,8). matrix(2,9). matrix(2,10). matrix(3,4). matrix(3,5). matrix(3,6). matrix(3,7). matrix(3,8). matrix(3,9). matrix(3,10). matrix(4,5). matrix(4,6). matrix(4,7). matrix(4,8). matrix(4,9). matrix(4,10). matrix(5,6). matrix(5,7). matrix(5,8). matrix(5,9). matrix(5,10). matrix(6,7). matrix(6,8). matrix(6,9). matrix(6,10). matrix(7,8). matrix(7,9). matrix(7,10). matrix(8,9). matrix(8,10). matrix(9,10). %----Uniqueness constraints: each entry of the matrix has exactly one value----- 1{result(1,2,2), result(1,2,3), result(1,2,4), result(1,2,5)}1. 1{result(1,3,3), result(1,3,4),result(1,3,5)}1. 1{result(1,4,2), result(1,4,3), result(1,4,4), result(1,4,5)}1. 1{result(1,5,3), result(1,5,4), result(1,5,5)}1. 1{result(1,6,3), result(1,6,4), result(1,6,5)}1. 1{result(1,7,3), result(1,7,4),result(1,7,5)}1. 1{result(1,8,3), result(1,8,4),result(1,8,5)}1. 1{result(1,9,3), result(1,9,4), result(1,9,5)}1. 1{result(1,10,3), result(1,10,4), result(1,10,5)}1. 1{result(2,3,3), result(2,3,4), result(2,3,5)}1. 1{result(2,4,3), result(2,4,4), result(2,4,5)}1. 1{result(2,5,3), result(2,5,4),result(2,5,5)}1. 1{result(2,6,3), result(2,6,4),result(2,6,5)}1. 1{result(2,7,3), result(2,7,4), result(2,7,5)}1. 1{result(2,8,2), result(2,8,3), result(2,8,4), result(2,8,5)}1. 1{result(2,9,3), result(2,9,4),result(2,9,5)}1. 1{result(2,10,1), result(2,10,2), result(2,10,3), result(2,10,4), result(2,10,5)}1. 1{result(3,4,3),result(3,4,5)}1. result(3,5,5). result(3,6,5). result(3,7,1). 1{result(3,8,2), result(3,8,3),result(3,8,5)}1. result(3,9,5). 1{result(3,10,2), result(3,10,3), result(3,10,4)}1. 1{result(4,5,2), result(4,5,3), result(4,5,4)}1. 1{result(4,6,2), result(4,6,3), result(4,6,4)}1. 1{result(4,7,3),result(4,7,5)}1. 1{result(4,8,3), result(4,8,4),result(4,8,5)}1. 1{result(4,9,2), result(4,9,3), result(4,9,4)}1. 1{result(4,10,3), result(4,10,4),result(4,10,5)}1. result(5,6,1). result(5,7,5). result(5,8,5). 1{result(5,9,2), result(5,9,3),result(5,9,5)}1. 1{result(5,10,3),result(5,10,5)}1. result(6,7,5). result(6,8,5). 1{result(6,9,2), result(6,9,3),result(6,9,5)}1. 1{result(6,10,3),result(6,10,5)}1. 1{result(7,8,2), result(7,8,3),result(7,8,5)}1. result(7,9,5). 1{result(7,10,2), result(7,10,3), result(7,10,4)}1. 1{result(8,9,3),result(8,9,5)}1. 1{result(8,10,2), result(8,10,3), result(8,10,4)}1. 1{result(9,10,3), result(9,10,4),result(9,10,5)}1. %-------------equal conditions--------------------------------------- equal(X,Y,Y,Z) :- matrix(X,Y),result(X,Y,1),matrix(Y,Z),result(Y,Z,1),X