32 F. Buccafurri and G. Caminiti

r1 : name(**cupboard**) ←
r2 : type(**furniture**) ←
r3 : color(**yellow**) ←
 $latex(ctopoart)\gets\\ type(furniture)\gets\\ color(yellow)\gets\\ \gets\\ at(R1),at(R2),R1<>R2\\ at(R)\gets[,2]\{at(R),type(aplance),color(yellow),\\ [1,1]\{name(fridge)\}\},room(R)\\ at(R)\gets[,c-3]\{at(R),type(furniture)\},room(R)\\ \gets\\ at(R),[1,]\{at(R),color(green)\}$  After of the present calculation we can also use a dictionary. 
where the properties of the current object are encoded as predicates representing the name **(fridge, cupboard, table, . . . ), the** type **(furniture or appliance), the** color and so on (see rules r1-r3). In particular, the rule r4 **states that an object may not**
be in more than one room, while by means of the rule r5**, we allow no more than two**
yellow appliances to share the room with the cupboard, provided that one of them is a fridge. The rule r6 **means that we want the cupboard to be in the same room**
with any other pieces of furniture, but no more than c − 3, where c **(representing**
the maximum number of objects per room) is given. Finally, the rule r7 **states that**
the cupboard cannot share the room with any green object.

## Example 16 (Fpga Design)

In this example, we represent an extended version of a well-known problem belonging to the setting of FPGA (Field Programmable Gate Arrays) design, namely placement**. FPGAs are generic, programmable digital devices providing, in a single** system, a way for digital designers to access thousands or millions of logic gates arranged in multilevel structures, referred to as modules**, and to program them as**
desired by the end user. Placement consists in determining the module positions within the design area according to given constraints.

Consider a team of n **electronic engineers, jointly working on a common FPGA**
design. Each of them is responsible for placing a given number of modules inside the chip design area, which is represented by a square grid of cells. In particular, each designer must meet a number of constraints concerning either (resp. both) his own modules or (resp. and) the modules of other designers. Moreover, the total chip area which is occupied by the modules must either match a given value or be less than a given value.

This setting can be encoded by a collection of SOLP programs8 C = {Q1, **· · ·** , Qn, P}, where for each i (1 ≤ i ≤ n), Qi describes designer i**'s requirements, and** P
represents an agent aimed to find admissible solutions to the placement problem.

Such solutions are included into the social models of the SOLP collection C**. In the**
following paragraphs we describe such programs in detail.

We assume that each module is rectangular-shaped and it is described by a predicate mod(M , X , Y ), where M is an identifier and X (resp. Y **) is the horizontal** (resp. vertical) module size measured in grid cells. First, we describe **the program**
Qi (corresponding to rules r1-r28), encoding designer i**'s placement constraints.**