SCHEMA course_world; (*********************************************************) (* ENTITY person *) (*********************************************************) (* Represents a living person, who must be either a man, *) (* or a woman, but not both. *) (*********************************************************) ENTITY person ABSTRACT SUPERTYPE OF (ONEOF (man, woman)); surname : STRING; first_name : STRING; middle_names : LIST [0 : ?] OF STRING; age : INTEGER; role : OPTIONAL university_role; WHERE age_must_be_sensible: ((age >= 0) AND (age < 130)); END_ENTITY; (****************************************) (* ENTITY man *) (****************************************) (* Represents a man (a kind of person). *) (****************************************) ENTITY man SUBTYPE OF (person); END_ENTITY; (******************************************) (* ENTITY woman *) (******************************************) (* Represents a woman (a kind of person). *) (******************************************) ENTITY woman SUBTYPE OF (person); END_ENTITY; (***************************************************************) (* TYPE university_role *) (***************************************************************) (* Represents the role that a person can play in a university: *) (* either a student, or a member of staff, but not both. *) (***************************************************************) TYPE university_role = SELECT (student, staff); END_TYPE; (************************************************************) (* ENTITY student *) (************************************************************) (* Represents a person's role as a student in a university. *) (************************************************************) ENTITY student; courses_taken : SET [0 : ?] OF student_course_record; DERIVE average_mark : REAL := sum_marks(courses_taken) / SIZEOF(courses_taken); INVERSE the_person : person FOR role; END_ENTITY; (*****************************************************************) (* ENTITY student_course_record *) (*****************************************************************) (* Represents the association between a particular student and a *) (* particular course that the student takes. *) (*****************************************************************) ENTITY student_course_record; course : course; exam_mark : REAL; lab_mark : REAL; DERIVE total_mark : REAL := exam_mark + lab_mark; INVERSE the_student : student FOR courses_taken; END_ENTITY; (**********************************************************) (* FUNCTION sum_marks *) (**********************************************************) (* Function to compute the sum of marks of a given set of *) (* student course records. *) (**********************************************************) FUNCTION sum_marks (records : SET OF student_course_record) : REAL; LOCAL i : INTEGER; sum : REAL := 0.0; END_LOCAL; REPEAT i:= 1 TO SIZEOF (records); sum := sum + records[i].total_mark; END_REPEAT; RETURN(sum); END_FUNCTION; (********************************************************************) (* ENTITY staff *) (********************************************************************) (* Represents a person's role as a member of staff in a university. *) (********************************************************************) ENTITY staff; courses_taught : OPTIONAL SET [1 : ?] OF course; INVERSE the_person : person FOR role; END_ENTITY; (***************************************************************) (* ENTITY course *) (***************************************************************) (* Represents a course module in a university. *) (* Course codes are of the form `DDlpn' or `DDlpns', where: *) (* - `DD' is the department; *) (* - `l' is the level (year); *) (* - `p' is the programme (stream); *) (* - `n' is used to give each module a different `lpn' number; *) (* - `s' is the semester that the module runs in. *) (***************************************************************) ENTITY course; department : STRING(2) FIXED; level : INTEGER(*1*); programme : INTEGER(*1*); id_number : INTEGER(*1*); semester : OPTIONAL INTEGER(*1*); title : STRING; INVERSE the_lecturer : staff FOR courses_taught; the_students : SET [0 : ?] OF student_course_record FOR course; UNIQUE department, level, programme, id_number; END_ENTITY; END_SCHEMA;
SCHEMA course_world_ii; (*********************************************************) (* ENTITY person *) (*********************************************************) (* Represents a living person, who must be either a man, *) (* or a woman, but not both. *) (*********************************************************) ENTITY person; family_name : STRING; given_name : STRING; middle_names : OPTIONAL LIST [1 : ?] OF STRING; gender : gender_type; age : INTEGER; role : OPTIONAL university_role; WHERE age_must_be_sensible: ((age < 65) AND (age >= 18)); END_ENTITY; (********************) (* TYPE gender_type *) (********************) (* Man or woman. *) (********************) TYPE gender_type = SELECT (man, woman); END_TYPE; (****************************************) (* ENTITY man *) (****************************************) (* Represents a man (a kind of person). *) (****************************************) ENTITY man; END_ENTITY; (******************************************) (* ENTITY woman *) (******************************************) (* Represents a woman (a kind of person). *) (******************************************) ENTITY woman; END_ENTITY; (***************************************************************) (* TYPE university_role *) (***************************************************************) (* Represents the role that a person can play in a university: *) (* either a student, or a member of staff, but not both. *) (***************************************************************) TYPE university_role = SELECT (student, staff); END_TYPE; (************************************************************) (* ENTITY student *) (************************************************************) (* Represents a person's role as a student in a university. *) (************************************************************) ENTITY student; courses_taken : SET [0 : ?] OF student_course_record; average_mark : REAL; INVERSE the_person : person FOR role; WHERE sum_marks(courses_taken) = average_mark * SIZEOF(courses_taken); END_ENTITY; (*****************************************************************) (* ENTITY student_course_record *) (*****************************************************************) (* Represents the association between a particular student and a *) (* particular course that the student takes. *) (*****************************************************************) ENTITY student_course_record; course : module; exam_mark : REAL; lab_mark : REAL; total_mark : REAL; INVERSE the_student : student FOR courses_taken; WHERE total_mark = exam_mark + lab_mark; END_ENTITY; (**********************************************************) (* FUNCTION sum_marks *) (**********************************************************) (* Function to compute the sum of marks of a given set of *) (* student course records. *) (**********************************************************) FUNCTION sum_marks (records : SET OF student_course_record) : REAL; LOCAL i : INTEGER; sum : REAL := 0.0; END_LOCAL; REPEAT i:= 1 TO SIZEOF (records); sum := sum + records[i].total_mark; END_REPEAT; RETURN(sum); END_FUNCTION; (********************************************************************) (* ENTITY staff *) (********************************************************************) (* Represents a person's role as a member of staff in a university. *) (********************************************************************) ENTITY staff; courses_taught : OPTIONAL SET [1 : ?] OF module; INVERSE the_person : person FOR role; END_ENTITY; (***************************************************************) (* ENTITY module *) (***************************************************************) (* Represents a course module in a university. *) (* Course codes are of the form `DDlpn' or `DDlpns', where: *) (* - `DD' is the department; *) (* - `l' is the level (year); *) (* - `p' is the programme (stream); *) (* - `n' is used to give each module a different `lpn' number; *) (* - `s' is the semester that the module runs in. *) (***************************************************************) ENTITY module; department : STRING(2) FIXED; level : INTEGER(*1*); programme : INTEGER(*1*); id_number : INTEGER(*1*); semester : OPTIONAL INTEGER(*1*); title : STRING; INVERSE the_lecturer : staff FOR courses_taught; the_students : SET [0 : ?] OF student_course_record FOR course; UNIQUE department, level, programme, id_number, semester; END_ENTITY; END_SCHEMA;
{surname, familyname,} {firstname, givenname,} {module, course,}
Mode | E | -T | -U | -S | -H | -R | M | X |
HLCs extracted from first model | 48 | 50 | 48 | 48 | 0 | 48 | 48 | 50 |
HLCs extracted from second model | 55 | 57 | 55 | 55 | 0 | 55 | 55 | 57 |
Comparisons | 2224 | 2255 | 2213 | 2163 | 344 | 825 | 934 | 2272 |
HLC-comparisons | 1157 | 1239 | 1157 | 1167 | 0 | 218 | 299 | 1182 |
Correspondences | 94 | 77 | 92 | 82 | 50 | 87 | 82 | 95 |
HLC-correspondences | 42 | 36 | 42 | 39 | 0 | 37 | 32 | 43 |
Differences | 614 | 638 | 614 | 621 | 28 | 172 | 209 | 632 |
Number of FC-thesaurus lookups | 2 | 0 | 2 | 2 | 2 | 2 | 2 | 2 |
Number of name-thesaurus lookups | 664 | 0 | 664 | 624 | 55 | 223 | 261 | 681 |
The frames generated by the CCUS (and output as HTML-ised FIL files) follow - a file for each frame-class: