= Solution
Let brick $i$ have positive <integer> width $w_i$. Regard its horizontal occupied region as $[x_i,x_i+w_i)$ and its vertical occupied region as $[y_i,y_i+1)$. These <half-open interval> conventions allow adjoining bricks to touch without overlapping. Since the vertical coordinates are <integers>, two bricks can overlap only when they are on the same row. A suitable <predicate> is
$$
\boxed{\operatorname{valid}(W)\iff
\forall i\ne j,\quad
y_i\ne y_j\ \lor\ x_i+w_i\le x_j\ \lor\ x_j+w_j\le x_i.}
$$
Positive widths and nonnegative <integer> heights are the underlying domain conditions for a wall built on the baseplate. Distinct members of the <set> are compared even if their `Brick` references happen to be identical: one brick specification can describe several placements. Testing <object identity> alone would miss two overlapping placements of the same specification.
For example, width-two bricks beginning at 0 and 2 on the same row satisfy the <predicate>; beginnings at 0 and 1 do not. The non-strict separation inequalities are essential because touching edges are permitted.
Back to article page