Generating Cellular Puzzles With Logic P
Generating Cellular Puzzles With Logic P
removableClues := solution
Solution preservedClues := Ø
A B C D E F G H I
while removableClues 6= Ø do
a 5 7 4 8 1 9 6 2 3 victimClue :=
b 8 9 1 3 2 6 5 7 4 choose(removableClues)
c 6 2 3 4 7 5 9 8 1 removableClues -:= {victimClue}
d 3 8 5 1 6 2 7 4 9 if puzzleBad(removableClues
+ preservedClues) then
e 2 1 6 9 4 7 8 3 5
preservedClues +:= {victimClue}
f 9 4 7 5 3 8 2 1 6 end if
g 7 3 8 6 5 4 1 9 2 end while
h 4 6 2 7 9 1 3 5 8 clues := preservedClues
i 1 5 9 2 8 3 4 6 7
Fig. 3. Algorithm to reduce the clue set
7. References
Fig. 5. A 9 × 9 diagonal Sudoku puzzle
[EFLP00] Thomas Eiter, Wolfgang Faber, Nicola
Leone, and Gerald Pfeifer. Declarative
problem-solving in DLV. In Jack Minker,
editor, Logic-Based Artificial Intelligence,
pages 79–103. Kluwer Academic Pub-
lishers, Dordrecht, 2000.
[ET01] D. East and M. Truszczyński. aspps —
an implementation of answer-set pro-
gramming with propositional schemata.
Puzzle In Proceedings of Logic Programming and
A B C D E F G H I J K L Nonmonotonic Reasoning Conference, LP-
a 3 1 3 1 4 4 NMR 2001, volume 2173, pages 402–405.
b 1 2 4 3 4 2 3
c 1 1 4 4 3 1
Lecture Notes in Artificial Intelligence,
d 1 1 2 2 2 Springer Verlag, 2001.
e 2 1 1 1 2 4 4 4
f 2 2 1 4 1 4 [NS97] I. Niemelä and P. Simons. Smodels —
g 3 4 3 2 an implementation of the stable model
h 4 4 2 2 1 2 1 and well-foundd semantics for normal
i 4 3 2 3 1 logic programs. In Logic Programming
j 3 3 2 4 2 2 3
and Nonmonotonic Reasoning (the 4th
k 2 1 3 2 2
l 4 3 3 2 2 4 1
International Conference, Dagstuhl, Ger-
many, 1997), volume 1265 of Lecture
Notes in Computer Science, pages 420–
Solution 429. Springer-Verlag, 1997.
A B C D E F G H I J K L
a 3 2 2 3 2 1 3 1 1 4 4 4 [TFE05] Wikipedia: The Free Encyclopedia. Su-
b 2 1 3 2 1 1 4 3 4 2 3 4 doku, 2005. http://en.wikipedia.
c 1 1 4 4 4 2 2 3 3 1 2 3 org/wiki/Sudoku.
d 3 1 1 2 1 3 4 2 4 3 4 2
e 2 2 1 1 3 1 3 2 4 4 3 4 [WS90] L. Wall and R. L. Schwartz. Programming
f 2 2 2 1 3 4 4 1 1 4 3 3
Perl. O’Reilly and Associates, 1990.
g 1 3 2 1 4 4 3 4 2 3 1 2
h 4 4 4 3 2 3 1 2 3 1 2 1
i 1 4 4 4 3 2 1 3 2 3 2 1
j 3 3 1 2 4 4 2 4 1 2 1 3
k 4 4 3 4 1 3 2 1 3 2 1 2
l 4 3 3 3 2 2 1 4 2 1 4 1
Puzzle
A B C D E F G
a 4 3 ♣ ♣
b ♣7 ♣
c 3 ♣6 ♣1 ♣4 ♣
d ♣5 ♣ ♣ ♣3
e ♣ ♣
f 7 ♣ ♣ 1
g
Solution
A B C D E F G
a 2 5 4 3 ♣7 ♣6 1
b 1 ♣7 6 ♣5 2 3 4
c 3 ♣6 ♣1 7 ♣4 ♣2 5
d 4 2 ♣5 ♣1 6 ♣7 ♣3
e 6 3 7 4 ♣1 5 ♣2
f 7 4 ♣3 ♣2 5 1 6
g 5 1 2 6 3 4 7