local
proc {Squares X}
A B C D E F G H I K
in
X = numbers(a:A b:B c:C d:D e:E f:F g:G h:H i:I k:K)
X.a = 16
X.b = 2
X.f = 8
X.g = 14
{FD.distinct X}
X ::: 1#99
S = {Record.map X fun {$ X} S={FD.decl}
in X * X =: S S
end}
S.a + S.b =: S.f + S.g
S.b + S.c =: S.g + S.h
S.c + S.d =: S.h + S.i
S.d + S.e =: S.i + S.k
S.e + S.f =: S.k + S.a
{FD.distribute split X}
end
in
{ExploreAll Squares}
end
The six possible solutions (solution permutations), read counterclockwise, are
1#numbers(a: 16 b: 2 c: 19 d: 22 e: 49 f: 8 g: 14 h: 13 i:26 k:47) 2#numbers(a: 16 b: 2 c: 19 d: 47e: 47 f: 8 g: 14 h: 13 i:26 k:47) 3#numbers(a: 16 b: 2 c: 26 e: 49 f: 8 g: 14 h: 13 i:26 k:47) 4#numbers(a: 16 b: 2 c: 26 e: 49 f: 8 g: 14 h: 13 i:26 k:47) 5#numbers(a: 16 b: 2 c: 49 e: 49 f: 8 g: 14 h: 13 i:26 k:47) 6#numbers(a: 16 b: 2 c: 49 e: 49 f: 8 g: 14 h: 13 i:26 k:47)