5.8. Edit.rsl


module ProjectModule;

from InstructorModule import InstructorDB;
from InstructorModule import Instructor;

from CourseModule import CourseDB;
from CourseModule import Course;

from RoomModule import RoomDB;
from RoomModule import Room;

from ScheduleModule import Schedule;
from ScheduleModule import Section;

from StudentDB import StudentDB;

export ProjectDB;



object ProjectDB is
   component: GeneralInfo and InstructorDB and CourseDB and RoomDB and Schedule and StudentDB;
   operations: ImportPreviousSchedule;
   
   description:  (*
       ProjectDB contains all attachements of a schedule. GeneralInfo component is 
       the general information of a project. InstructorDB is the local instructor data base. All
	 instructors in this local data base are available to teach when creating the schedule. All instructors 
	 in the local data base are in the permanent instructor database as well. CourseDB is the local 
	 course data base to this project. It contains the courses that are offered when creating the schedule.
	 These courses are in the permanent course data base as well. RoomDB is the local room data base of 
	 this project. These rooms are available to use in the creation of the schedule. These rooms are also in the
       permanent room data base. The object Schedule contains sections of classes. Object SrudentDB is a data base   
	 that stores the information of students and their surveys. The operation ImportPreviousSchedule is an 
	 operation that imports local data bases from a finished project. *);

   end ProjectDB;


object GeneralInfo is
  component: ProjectName and Year and Quarter* and SaveAt and Phase and ProjectDescription;
  description:  (*
       General tab contains the general information of a project. The ProjectName component
       is the name of the project. The Year component is the year of the schedule to be created.
 	 Quarter specifics the quarter of the schedule. The SaveAt component is the location where
 	 the project is stored. The Phase is divided into three levels. The end user has total control
       on the phases of a project and definition of each phase is definted by the end user.
	 The ProjectDescription component contains comments or descriptions on this project. 
   *);
end GeneralInfo;


object ProjectName is string;


object Year is integer
description:(*Year should be greater than 2001 and smaller than 3000 *);
end Year;


object Quarter is 
  components: winter and spring and summer and fall;
  description: (*
      Quarter indicates the quarter of the schedule.
   *);
end Quarter;


object winter;
object spring;
object summer;
object fall;


object SaveAt is string
description: (* SaveAt is a string that contains the saving location of the project.
		  *);
end SaveAt;


object Phase is 
  components: I and II and III;
  description:  (*
       Phase is devided into three levels.
       Definition of each phase is defined by the end user.
	 ClassScheduler has no control of which phase the project belongs.
   *);
end Phase;


object I is boolean;
object II is boolean;
object III is boolean;


object ProjectDescription is string
  description:  (*
       ProjectDescription is string that simply describes the project.
  *);
end ProjectDescription; 



operation ImportPreviousSchedule is 
  inputs: idb:InstructorDB, rdb:RoomDB, cdb:CourseDB, sch:Schedule; 
  outputs: insDB:InstructorDB, rmDB:RoomDB, csDB:CourseDB, sch':Schedule;
  
  precondition:(*
			The number of instructors in the data base to be imported must contain at least 
			one instructor before it can be imported.
		    *) 
			(#idb >= 1) 
			 and
		   (*
			The number of rooms in the data base to be imported must contain at least 
			one room before it can be imported.

		    *)
			(#rdb >= 1) 
			and
         	   (*
			The number of courses in the data base to be imported must contain at least 
			one course before it can be imported.
		    *)
			(#cdb >= 1)
			and
         	   (*
			The number of sections in the schedule to be imported must contain at least 
			one section before it can be imported.
		    *)
			(#sch >= 1);

  postcondition: 
		 (*
			All instructors in current local data base are also in the imported instructor 
			data base.
		  *)
		 	(forall(Instructor in insDB) (Instructor in idb)) 
		 and
		 (*
			All courses in current local data base are also in the imported course 
			data base.
		  *)
		 	(forall(Course in csDB) (Course in cdb)) 
		 and
		 (*
			All rooms in current local data base are also in the imported room 
			data base.
		  *)
			(forall(Room in rmDB) (Room in rdb))
		 and
		 (*
			All sections in current schedule are also in the imported schedule.
		  *)
			(forall(Section in sch') (Section in sch));



  description: (* This operation is operated when importing local data bases and schedule from a completely finished
			project to the current project. These local data bases imported are instructor data base,
			course data base, and room data base. Input 
data bases are to be importes. Output data bases are data bases local 
the project.*);

end ImportPreviousSchedule;

end ProjectModule;

Prev: [none] | Next: Schedule | Up: Specification | Top: index