1 % -------------------------------------------------------------------------
2 % Copyright (c) 2018 AT&T Intellectual Property
4 % Licensed under the Apache License, Version 2.0 (the "License");
5 % you may not use this file except in compliance with the License.
6 % You may obtain a copy of the License at
8 % http://www.apache.org/licenses/LICENSE-2.0
10 % Unless required by applicable law or agreed to in writing, software
11 % distributed under the License is distributed on an "AS IS" BASIS,
12 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 % See the License for the specific language governing permissions and
14 % limitations under the License.
16 % -------------------------------------------------------------------------
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20 % Parameters and its assertions
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23 % Number of cells/radios.
26 % Maximum number of Physical Cell Identifiers to be assigned to the nodes.
29 % Number of edges between neighbor nodes. There is a edge (i,j) if and only
30 % if nodes i and j are neighbors, i.e., an user equipment (UE) can make
31 % handoff between i and j. Such edges are used to avoid **COLLISIONS**, i.e.,
32 % to guarantee that nodes i and j have different PCIs.
35 % Each line represents an edge between direct neighbors as defined before.
36 array[1..NUM_NEIGHBORS, 1..2] of int: NEIGHBORS;
38 % Number of undirect neighbor pairs (j, k) such that both j and k are direct
39 % neighbors of node i, i.e., (j, k) exits if and only if exists (i, j) and
40 % (i, k). Nodes (i, k) can generate "confunsions" in the network if they have
41 % the same PCI. Such edges are used to avoid/minimize **CONFUSIONS**.
42 int: NUM_SECOND_LEVEL_NEIGHBORS;
44 % Each line represents an edge between undirect neighbors as defined before.
45 array[1..NUM_SECOND_LEVEL_NEIGHBORS, 1..2] of int: SECOND_LEVEL_NEIGHBORS;
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 % Defines the PCI for each node.
52 array[0..NUM_NODES-1] of var 0..NUM_PCIS-1: pci;
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58 % Direct neighbors must have different PCIs for avoid **COLLISION**.
60 forall(i in 1..NUM_NEIGHBORS)(
61 pci[NEIGHBORS[i, 1]] != pci[NEIGHBORS[i, 2]]
64 % Undirect neighbors must have different PCIs for avoid **CONFUSIONS**.
66 forall(i in 1..NUM_SECOND_LEVEL_NEIGHBORS)(
67 pci[SECOND_LEVEL_NEIGHBORS[i, 1]] != pci[SECOND_LEVEL_NEIGHBORS[i, 2]]
70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74 % Just satisfy the problem.
75 solve :: int_search(pci, smallest, indomain_min, complete) satisfy;
77 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
84 show(node) ++ "," ++ show(pci[node]) ++ "\n"
85 | node in 0..NUM_NODES-1