5050#14.2 Indeterminate
5151#The indeterminate symbol (?) stands for an ambiguous value. It is compatible with all data
5252#types.
53- #NOTE - The most common use of indeterminate (?) is as the upper bound specication of a bag,
54- #list or set. This usage represents the notion that the size of the aggregate value dened by the
53+ #NOTE - The most common use of indeterminate (?) is as the upper bound specification of a bag,
54+ #list or set. This usage represents the notion that the size of the aggregate value defined by the
5555#aggregation data type is unbounded.
5656# python note: indeterminate value is mapped to None in aggregate bounds
5757
6565# EXPRESS definition:
6666# ===================
6767#14.4 Pi
68- #PI is a REAL constant representing the mathematical value , the ratio of a circle's circumference
68+ #PI is a REAL constant representing the mathematical value π , the ratio of a circle's circumference
6969#to its diameter.
7070PI = REAL (math .pi )
7171
7474#14.5 Self
7575#SELF refers to the current entity instance or type value. self may appear within an entity
7676#declaration, a type declaration or an entity constructor.
77- #NOTE - sSELF is not a constant, but behaves as one in every context in which it can appear.
77+ #NOTE - SELF is not a constant, but behaves as one in every context in which it can appear.
7878# python note: SELF is not mapped to any constant, but is mapper to self
7979
8080# EXPRESS definition:
8787# EXPRESS definition:
8888# ===================
8989#14.7 Unknown
90- #unknown is a logical constant representing that there is insucient information available to
90+ #unknown is a logical constant representing that there is insufficient information available to
9191#be able to evaluate a logical condition. It is compatible with the logical data type, but not
9292#with the boolean data type.
9393# @TODO: define UNKNOWN in python
@@ -122,7 +122,7 @@ def ABS(V):
122122#FUNCTION ACOS ( V:NUMBER ) : REAL;
123123#The acos function returns the angle given a cosine value.
124124#Parameters : V is a number which is the cosine of an angle.
125- #Result : The angle in radians (0 result ) whose cosine is V.
125+ #Result : The angle in radians (0 <= result <= pi ) whose cosine is V.
126126#Conditions : -1.0=<V<=1.0
127127#EXAMPLE 126 { ACOS ( 0.3 ) --> 1.266103...
128128# Python definition:
@@ -149,7 +149,7 @@ def ASIN(V):
149149#a) V1 is a number.
150150#b) V2 is a number.
151151#Result : The angle in radians (-pi/2<=result<=pi/2) whose tangent is V. If V2 is zero, the result
152- #is pi/2 or -pi/2 depending on the sign of V1.
152+ #is pi/2 or -pi/2 depending on the sign of V1.
153153#Conditions : Both V1 and V2 shall not be zero.
154154#EXAMPLE 128 { ATAN ( -5.5, 3.0 ) --> -1.071449...
155155def ATAN (V1 ,V2 ):
@@ -197,7 +197,7 @@ def BLENGTH(V):
197197#FUNCTION SIN ( V:NUMBER ) : REAL;
198198#The sin function returns the sine of an angle.
199199#Parameters : V is a number representing an angle expressed in radians.
200- #Result : The sine of V (-1.0 result 1.0).
200+ #Result : The sine of V (-1.0 <= result <= 1.0).
201201#EXAMPLE 144 { SIN ( PI ) --> 0.0
202202#
203203def COS (V ):
@@ -487,14 +487,14 @@ def ODD(V):
487487# ===================
488488#15.20 RolesOf - general function
489489#FUNCTION ROLESOF ( V:GENERIC ) : SET OF STRING;
490- #The rolesof function returns a set of strings containing the fully qualied names of the roles
491- #played by the specied entity instance. A fully qualied name is dened to be the name of the
492- #attribute qualied by the name of the schema and entity in which this attribute is declared (i.e.
490+ #The rolesof function returns a set of strings containing the fully qualified names of the roles
491+ #played by the specified entity instance. A fully qualified name is defined to be the name of the
492+ #attribute qualified by the name of the schema and entity in which this attribute is declared (i.e.
493493#'SCHEMA.ENTITY.ATTRIBUTE').
494494#Parameters : V is any instance of an entity data type.
495- #Result : A set of string values (in upper case) containing the fully qualied names of the
495+ #Result : A set of string values (in upper case) containing the fully qualified names of the
496496#attributes of the entity instances which use the instance V.
497- #When a named data type is use'd or reference'd , the schema and the name in that schema,
497+ #When a named data type is used or referenced , the schema and the name in that schema,
498498#if renamed, are also returned. Since use statements may be chained, all the chained schema
499499#names and the name in each schema are returned.
500500#EXAMPLE 143 { This example shows that a point might be used as the centre of a circle. The
@@ -567,7 +567,7 @@ def SIZEOF(V):
567567#The sqrt function returns the non-negative square root of a number.
568568#Parameters : V is any non-negative number.
569569#Result : The non-negative square root of V.
570- #Conditions : V 0:0
570+ #Conditions : V >= 0:0
571571#EXAMPLE 146 - SQRT ( 121 ) --> 11.0
572572def SQRT (V ):
573573 if not isinstance (V ,NUMBER ):
@@ -602,16 +602,16 @@ def TAN(V):
602602#The typeof function returns a set of strings that contains the names of all the data types
603603#of which the parameter is a member. Except for the simple data types (binary, boolean,
604604#integer, logical, number, real, and string) and the aggregation data types (array, bag,
605- #list, set) these names are qualied by the name of the schema which contains the denition of
605+ #list, set) these names are qualified by the name of the schema which contains the definition of
606606#the type.
607607#NOTE 1 { The primary purpose of this function is to check whether a given value (variable, at-
608608#tribute value) can be used for a certain purpose, e.g. to ensure assignment compatibility between
609- #two values. It may also be used if dierent subtypes or specializations of a given type have to be
610- #treated dierently in some context.
609+ #two values. It may also be used if different subtypes or specializations of a given type have to be
610+ #treated differently in some context.
611611#Parameters : V is a value of any type.
612612#Result : The contents of the returned set of string values are the names (in upper case) of all
613- #types the value V is a member of. Such names are qualied by the name of the schema which
614- #contains the denition of the type ('SCHEMA.TYPE') if it is neither a simple data type nor an
613+ #types the value V is a member of. Such names are qualified by the name of the schema which
614+ #contains the definition of the type ('SCHEMA.TYPE') if it is neither a simple data type nor an
615615#aggregation data type. It may be derived by the following algorithm (which is given here for
616616#specification purposes rather than to prescribe any particular type of implementation)
617617def TYPEOF (V ):
@@ -636,8 +636,8 @@ def TYPEOF(V):
636636# ===================
637637#15.26 UsedIn - general function
638638#FUNCTION USEDIN ( T:GENERIC; R:STRING) : BAG OF GENERIC;
639- #The usedin function returns each entity instance that uses a specied entity instance in a
640- #specied role.
639+ #The usedin function returns each entity instance that uses a specified entity instance in a
640+ #specified role.
641641def USEDIN (T ,R ):
642642 raise NotImplemented ("USEDIN function not yet implemented." )
643643
@@ -654,8 +654,8 @@ def USEDIN(T,R):
654654#VALUE ( 'abc' ) --> ? null
655655def VALUE (V ):
656656 if not isinstance (V ,STRING ):
657- raise TypeError ("VALULE function takes a NUMBER parameter" )
658- # first try to instanciate an INTEGER from the string:
657+ raise TypeError ("VALUE function takes a NUMBER parameter" )
658+ # first try to instantiate an INTEGER from the string:
659659 try :
660660 return INTEGER (V )
661661 except :
@@ -691,7 +691,7 @@ def VALUE(V):
691691def VALUE_IN (C ,V ):
692692 if not isinstance (C ,Aggregate ):
693693 raise TypeError ("VALUE_IN method takes an aggregate as first parameter" )
694- raise NotImplemented ("VALUE_IN function not et implemented" )
694+ raise NotImplemented ("VALUE_IN function not yet implemented" )
695695
696696# EXPRESS definition:
697697# ===================
@@ -705,8 +705,8 @@ def VALUE_IN(C,V):
705705#b) If any any two elements of V are value equal, false is returned.
706706#c) If any element of V is indeterminate (?), unknown is returned.
707707#d) Otherwise true is returned.
708- #EXAMPLE 153 { The following test ensures tht each point is a set is at a dierent position, (by
709- #denition they are distinct, i.e., instance unique).
708+ #EXAMPLE 153 { The following test ensures that each point is placed at a different position, (by
709+ #definition they are distinct, i.e., instance unique).
710710#IF VALUE_UNIQUE(points) THEN ...
711711def VALUE_UNIQUE (V ):
712712 if not isinstance (V ,Aggregate ):
0 commit comments