$ The quasiGroup existence problem (CSP lib problem 3) $ $ An m order quasigroup is an mxm multiplication table of integers 1..m, $ where each element occurrs exactly once in each row and column and certain $ multiplication axioms hold (in this case, we want axiom 7 to hold). $ $ by Ian Miguel ESSENCE' 1.0 given n : int(1..1000) letting nDomain be domain int(0..n-1) find quasiGroup : matrix indexed by [nDomain, nDomain] of nDomain $find quasiGroupColumns : matrix indexed by [nDomain, nDomain] of nDomain such that $ assign the "reflected" quasigroup to qGColumns to access its columns $ forall row,col : nDomain . $ quasiGroupColumns[col,row] = quasiGroup[row,col], $ All rows have to be different forall row : nDomain . allDifferent(quasiGroup[row,..]), $ all values in the diagonals forall i : nDomain . (quasiGroup[i,i] = i), $ All columns have to be different forall col : nDomain . allDifferent(quasiGroup[..,col]), $ this strange constraint $ corresponds to: $ quasiGroup[i, quasiGroup[j,i]] = quasiGroup[quasiGroup[j,i], j] $ forall i : nDomain . $ forall j : nDomain . $ quasiGroup[i, quasiGroup[j,i]] = quasiGroup[quasiGroup[j,i],j], $ some implied? constraints forall i : nDomain . quasiGroup[i,n-1] + 2 >= i