Andrew Broad's Website
Computer Science
PhD Project
Experimental Results
Course World


First Model

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;

Second Model

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;

Name-Thesaurus

{surname, familyname,}
{firstname, givenname,}
{module, course,}

Experimental Results

ModeE-T-U-S-H-RMX
HLCs extracted from first model485048480484850
HLCs extracted from second model555755550555557
Comparisons22242255221321633448259342272
HLC-comparisons115712391157116702182991182
Correspondences9477928250878295
HLC-correspondences423642390373243
Differences61463861462128172209632
Number of FC-thesaurus lookups20222222
Number of name-thesaurus lookups664066462455223261681

Output (Mode E)

The frames generated by the CCUS (and output as HTML-ised FIL files) follow - a file for each frame-class:

HLCs:


Email me