Language Specification
 
 

INTRODUCTION:

This is specification for the language used to represent requirements in the database. Compliance to the standards below will ensure proper handling of the requirements by the Processor Class.

 
 

OPERATORS:

[ | ] - has the meanings:

  • any number of choices in the list - additive_OR
  • only one of the choices in the list - boolean_OR

additive_OR is used only for expressing relationship between terms in Expressions with a credit requirement

[ *] - has the meaning:

  • all the choices in the list - boolean_AND

[ () ] - has the meaning:

  • brackets can be used to define terms

only single nesting of brackets is allowed

[ L ] - has the meaning:

  • all liberal arts courses

[ ^ ] - has the meaning:

  • choose upper level, lower level or all courses in a discipline. This operator is followed by an integer, which specifies the choice made- 0 for all courses, 1 for upper level and 2 for lower level. It is immediately followed by another integer specifying the discipline number.
 
 

TERMINOLOGY:


A string in the database describing a particular requirement is called an Expresion.

 

Example:

1 | 2 | 3 | 4 | 5

( 7 * 8 ) | ( 9 * 10 ) | ( 11 * 12 )

There are two types of Expressions - with a credit requirement and without a credit requirement. The first one can be seen in the MAJOR_REQ table in the database.

Example:


6 .........1 | 2 | 3 | 4 | 5 That means chose 6 credits out of the following list

The second type is seen in PreReqList field in the COURSES table in the database.

Example:


( 5 | 7 ) * 6

A Term is a sequence of courses and operators, which define the relationship between the courses. It can be a single course, or a list of courses in brackets.

Example:

1

( 2 * 3 * 4 )

The Expresion must be in normal form in order to be evaluated correctly. Normal form is defined as follows:

An Expression is a sequence of terms in the same relation (the same operator delimits all terms in the expression).

Example:

( 2 * 3 ) | ( 4 * 5 ) * ( 6 * 7 ) is not a valid expression!

( 2 * 3 ) | ( 4 * 5 ) | ( 6 * 7 ) is a valid expression

This rule is imposed to prevent multiple nesting of terms within terms and to prevent ambiguity for the precedence of the operators. All courses within a term are in the same relation.

Example:

( 2 * 3 ) | ( 4 * 5 | 6 ) has an invalid term in the expression!

( 2 * 3 ) | ( 4 * 5 * 6 ) is correct

For relationships between terms in an Expression with credits | means additive_OR. Within terms and Expressions without credits | means boolean_OR.

Example:

( 1 | 2 | 3 ) take either 1,2 or 3 in order this term to count towards satisfying the requirement

18......... ( 1 * 2 * 3 ) | ( 4 * 5 * 6 ) | ( 7 * 8 * 9 ) any satisfied term will be counted towards the requirement of 6 credits.For example taking courses 1 , 2 and 3 will satisfy the first term and will give 9 credits to count towards the requirement. Taking 1,2,3 and 4,5,6 will satisfy the first and the second terms and will give 18 credits toward the requirement. This will actually satisfy the whole requirement. Yet if you take 1 and 2 but you don't have 3 this will not satisfy the first term and will give 0 credits towards the general requirement