Download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
language Essence 1.3
$ prob025.essence: Lam's Problem
$ Problem details available at http://www.csplib.org/Problems/prob025/
 
given indexSize: int
 
letting Index be new type of size indexSize
 
find m: matrix indexed by [Index,Index] of bool
 
such that
    forAll r : Index
        . (sum c : Index . toInt(!m[r,c])) = 11,
    forAll c : Index
        . (sum r : Index . toInt(!m[r,c])) = 11,
    forAll r1,r2 : Index
        , r1 != r2
        . (sum c : Index . toInt(!(m[r1,c] \/ m[r2,c]))) = 1