Relationship Between Company Network Server and Department Network Server
This constraint is based on the same principle as the previous constraint. However, this constraint is to be used for assigning values across 2 levels. It shows that the operating system of the department server is dependent on the operating system of the company server.
The server of the department network must run on OS1 if the server of the company network runs on OS1.
Dependency net: c_company_network
Dependency: OS1_server
Source code:
OBJECTS:
Server1 is_a (300) c_server
WHERE server1_os = c_operating_system,
Server2 is_a (300) c_server
WHERE server2_os = c_operating_system,
company is_a (300) c_company_network,
department is_a (300) c_department_network.
CONDITION:
part_of (server1, company) and
part_of (department, company) and
part_of (server2, department) and
server1_os = ‘OS1’.
RESTRICTIONS:
Server2_os = server1_os.
First, variables are defined for the relevant objects. Since we are talking about 2 servers here, two variables for servers must be defined. However, the two servers are the same material. Variables are also defined for a company network and a department network. The networks are referred to by entering the class to which they are assigned.
You define that Server1 belongs to the company network and a department network belongs to the company network. Server2 belongs to the department network. The operating system of the company server is OS1.
In the RESTRICTIONS section, you define that the operating system of the company server must be the same as the operating system of the department server. Since this condition infers that the operating system of the company server is OS1, the operating system of the department server must also be OS1.
In this example, you do not need to make any entries in the INFERENCES section because the equation in the RESTRICTIONS section automatically infers the values for the variable on the left-hand side (see
Constraints: Restrictions).