As you're note, you can't "just" get the row (1,0,1,1) to occur twice in a datalog relation. The issue is, of course, that datalog relations store sets as opposed to lists or multisets of elements. The best way to deal with this is to add extra data to track either how often a row occurs to treat the matrix as map from indices to values. You might try one for the following:
myUnorderedMultiset[x,y,z,w]=count -> int(x), int(y), int(z), int(w), int(count).
or
myMatrix[rowIndex, columnIndex] = value -> int(rowIndex), int(columnIndex), int(value).