The University Schema in ODL Language
interface Course
( extent courses
keys name, number)
{ attribute string name;
attribute unsigned short number;
attribute list<Section> has_sections;
};
interface Section
( extent sections
key (number))
{ attribute string number;
attribute Address sec_address;
};
interface STheory : Section
( extent stheory )
{ attribute integer level;
};
interface STraining : Section
( extent straining )
{ attribute string features;
};
interface Employee
( extent employees
key (name, id))
{ attribute string name;
attribute short id;
attribute unsigned short annual_salary;
attribute string domicile_city;
attribute string residence_city;
attribute set<Section> assists;
};
interface Professor: Employee
( extent professors )
{ attribute string rank;
attribute set<STheory> assists;
};
interface TA: Employee, Student
( extent ta)
{
attribute set<STraining> assists;
attribute struct TA_Address { string city;
string street;
string tel_number; }
address;
};
view Assistant: Employee, Student
( extent assistents )
{ attribute Address address;
};
interface Student
( extent students
keys (name, student_id))
{ attribute string name;
attribute integer student_id;
attribute struct Address {
string city;
string street;
} dorm_address;
attribute set<Section> takes;
};
rule rule_1 forall X in Professor: X.rank = "Full"
then X.annual_salary >= 60000 ;
rule rule_2 forall X in Employee: X.annual_salary < 30000
then X in TA ;
rule rule_3 forall X in Professor: exists S in X.assists: S.level > 7
then X.rank = "Full" ;