Use CLINGO to pack a given set of squares into a given rectangular area without overlaps. For example, we want to pack the squares:
A of size 4, B of size 3, C & D of size 2, E of size 1
into an area 5 x 8.
#const x = 8.
#const y = 5.
square(a,4; b,3; c,2; d,2; e,1).
%generate a grid:
1 { pos(X,Y) } 1 :- x(X), y(Y).
%generate placement of the squares
1 { placement(P, SQ) } 1 :- square(SQ), pos(P).
%throw out overlaps
I'm not sure what the constraint to throwing out overlapping squares would be, or if I'm doing this right.