Encoding Class PuttingNumbers

Class Tree
Description In this problem the input is a set of m-digit numbers and you have to
construct a n x n square where all of the numbers occur. The numbers
may be there
horizontally or vertically and in both directions.

For example, the numbers:

613, 212, and 730

may be placed into a 3x3 square as follows:

0 2 5
3 1 6
7 2 5

where:

613 starts at square (3, 2) and goes to left
212 starts at (2, 3) to down.
730 starts at (1, 1) to up.

Some of the instances do not impose constraints on all positions of
the square and in those cases it is not necessary to assign any value
to those positions. So, the above square could also have been
expressed as:

0 2 .
3 1 6
7 2 .

Since some of the benchmarks have very many valid solutions, it is
best to compute only one.

The input instances are given as the set of facts:

number(n, i, d). -- the ith digit of the nth number is d.
square(x, y). -- there is a square (x, y) in the grid.
symbol(d). -- d is a digit that may occur in the table.
Encodings
1 - 2 of 2