Information Technology Reference
In-Depth Information
Where,condition 1 ,…,conditionn
are
Boolean
expression.
Constraint 1 ,···
,constraint n is a constraint or a constraint table having{}.
The rule is used for defining new function, method, predicate, or adding
constraint to object. The form of rule is
RULE [class: : ]Predicate (variable or constant) (Boolean expression)
{
constraint 1 ;
···
constraint n ;
CASE
Boolean expression 1 : constraint 1 ;
···
Boolean expression m : constraint m ;
}
For example:
RULE multiple(INTEGER: *
x
, INTEGER:
y
, INTEGER:
z
) (neq(
y
, 0) )
{
equal(
x
, divide(
z
,
y
) );
}
which defines constraint relation among three variables
x
,
y
and
z
:
x
=
z ÷ y
.
2. Class Definition
In COPS system, entity of problem field is defined as class, and entity's
internal attributes and relations are encapsulated in class. Multiple entities with
certain relation can be encapsulated in high-level class. The definition of class in
COPS is similar to class definition in C++:
CLASS [ class name ] [: super class name ]
{
//Attribute definition
Data type: Attribute name;
···
//Rule definition
Rule name;
···
//Function definition
Function name;
···
//Method definition
Method name;
···
}
Search WWH ::




Custom Search