Integrated generic resource: Fundamentals of product description and support | ISO 10303-41:2021(E) © ISO |
Each implementation of an AP that uses this schema and that encodes entity names shall use the encoding specified in Annex A. Each reference to this schema in an open system shall use the identifier encoding specified in Annex B. This schema is illustrated in Annex D using the EXPRESS-G notation.
EXPRESS specification:
*)
SCHEMA date_time_schema;
REFERENCE FROM
basic_attribute_schema
--
ISO 10303-41
(description_attribute,
description_attribute_select,
get_description_value);
REFERENCE FROM
measure_schema
--
ISO 10303-41
(measure_with_unit,
time_measure_with_unit);
REFERENCE FROM
support_resource_schema
--
ISO 10303-41
(bag_to_set,
identifier,
label,
text);
(*
NOTE 1 The schemas referenced above are specified in the following parts:
basic_attribute_schema ISO 10303-41 measure_schema ISO 10303-41 support_resource_schema ISO 10303-41
NOTE 2 See Annex D for a graphical representation of this schema.
NOTE Coordinated Universal Time (UTC) is the international time standard. It is the current term for what was commonly referred to as Greenwich Meridian Time (GMT). Zero (0) hours UTC is midnight in Greenwich England, which lies on the zero longitudinal meridian. Coordinated universal time is based on a 24 hour clock; therefore, afternoon hours such as 4 pm are expressed as 16:00 UTC (sixteen hours, zero minutes).
EXPRESS specification:
*)
TYPE
ahead_or_behind
=
ENUMERATION
OF
(ahead,
exact,
behind);
END_TYPE;
(*
Enumerated item definitions:
ahead: a given time is ahead of coordinated universal time;
exact: a given time is coordinated universal time;
behind: a given time is behind coordinated universal time.
EXPRESS specification:
*)
TYPE
date_time_or_event_occurrence
=
SELECT
(date_time_select,
event_occurrence);
END_TYPE;
(*
EXPRESS specification:
*)
TYPE
date_time_select
=
SELECT
(date,
date_and_time,
local_time);
END_TYPE;
(*
EXPRESS specification:
*)
TYPE
day_in_month_number
=
INTEGER;
WHERE
WR1: {1 <= SELF <= 31};
END_TYPE;
(*
Formal propositions:
WR1: The value of the integer shall be between 1 and 31 inclusive.
NOTE Monday is day number 1, Tuesday is day number 2, Wednesday is day number 3, Thursday is day number 4, Friday is day number 5, Saturday is day number 6, and Sunday is day number 7.
EXPRESS specification:
*)
TYPE
day_in_week_number
=
INTEGER;
WHERE
WR1: { 1 <= SELF <= 7 };
END_TYPE;
(*
Formal propositions:
WR1: The value of the integer shall be between 1 and 7 inclusive.
EXAMPLE The 27th day of March is day 86 in years that are not leap years and day 87 in leap years.
EXPRESS specification:
*)
TYPE
day_in_year_number
=
INTEGER;
WHERE
WR1: {1 <= SELF <= 366};
END_TYPE;
(*
Formal propositions:
WR1: The value of the integer shall be between 1 and 366 inclusive.
EXPRESS specification:
*)
TYPE
dts_description_attribute_select
=
SELECT
BASED_ON
description_attribute_select
WITH
(date_role,
date_time_role,
time_role);
END_TYPE;
(*
EXAMPLE The hour_in_day corresponding to 3 o'clock in the afternoon is 15.
NOTE Although ISO 8601 allows two representations for midnight, 0000 and 2400, this part of ISO 10303 restricts the representation to the first value.
EXPRESS specification:
*)
TYPE
hour_in_day
=
INTEGER;
WHERE
WR1: { 0 <= SELF < 24 };
END_TYPE;
(*
Formal propositions:
WR1: The value of the integer shall be between 0 and 23 inclusive.
EXPRESS specification:
*)
TYPE
minute_in_hour
=
INTEGER;
WHERE
WR1: { 0 <= SELF <= 59 };
END_TYPE;
(*
Formal propositions:
WR1: The value of the integer shall be between 0 and 59 inclusive.
NOTE January is month number 1, February is month number 2, March is month number 3, April is month number 4, May is month number 5, June is month number 6, July is month number 7, August is month number 8, September is month number 9, October is month number 10, November is month number 11, and December is month number 12.
EXPRESS specification:
*)
TYPE
month_in_year_number
=
INTEGER;
WHERE
WR1: { 1 <= SELF <= 12 };
END_TYPE;
(*
Formal propositions:
WR1: The value of the integer shall be between 1 and 12 inclusive.
EXPRESS specification:
*)
TYPE
second_in_minute
=
REAL;
WHERE
WR1: { 0 <= SELF < 60.0 };
END_TYPE;
(*
Formal propositions:
WR1: The value of the real number shall be between 0 to 60.0 inclusive.
NOTE 1 A value of 60 allows for leap seconds.
NOTE 2 The mean solar time is determined by the rotation of the earth. Leap seconds are added as required, usually in the middle or at the end of a year, and ensure that the legal time does not differ from the non-uniform mean solar time by more than one second, in spite of the variations of the earth rotation.
NOTE Week number 1 is the week containing the first Thursday of the year. This is equivalent to saying that week number 1 contains the date 4th January.
EXPRESS specification:
*)
TYPE
week_in_year_number
=
INTEGER;
WHERE
WR1: { 1 <= SELF <= 53 };
END_TYPE;
(*
Formal propositions:
WR1: The value of the integer shall be between 1 and 53.
NOTE ISO 8601:1988 defines the Gregorian calendar.
EXAMPLE The year_number corresponding to the first manned landing on the moon is 1969 (not 69).
EXPRESS specification:
*)
TYPE
year_number
=
INTEGER;
WHERE
WR1: (SELF > 1581);
END_TYPE;
(*
Formal propositions:
WR1: The value of the integer shall be greater than 1581.
EXPRESS specification:
*)
ENTITY calendar_date
SUBTYPE OF (date);
day_component : day_in_month_number;
month_component : month_in_year_number;
WHERE
WR1: valid_calendar_date (SELF);
END_ENTITY;
(*
Attribute definitions:
day_component: the day element of the date.
month_component: the month element of the date.
Formal propositions:
WR1: The entity shall define a valid calendar date.
NOTE If the month_component is 'April', 'June', 'August', or 'November' the day_component will be between 1 and 30; when the month_component is 'February' and the year_component is a leap year the day_component will be between 1 and 29; if the month_component is 'February' and the year_component is not a leap year the day_component will be between 1 and 28. Otherwise, the day_component will be between 1 and 31.
NOTE 1 Coordinated Universal Time (UTC) is the international time standard. It is the current term for what was commonly referred to as Greenwich Meridian Time (GMT). Zero (0) hours UTC is midnight in Greenwich England, which lies on the zero longitudinal meridian. Coordinated universal time is based on a 24 hour clock; therefore, afternoon hours such as 4 pm are expressed as 16:00 UTC (sixteen hours, zero minutes).
NOTE 2 A coordinated_universal_time_offset is used to relate a time to coordinated universal time by an offset (specified in hours and minutes) and a direction.
EXPRESS specification:
*)
ENTITY coordinated_universal_time_offset;
hour_offset : INTEGER;
minute_offset :
OPTIONAL
INTEGER;
sense : ahead_or_behind;
DERIVE
actual_minute_offset : INTEGER := NVL(minute_offset,0);
WHERE
WR1: { 0 <= hour_offset < 24 };
WR2: { 0 <= actual_minute_offset <= 59 };
WR3: NOT (((hour_offset <> 0) OR (actual_minute_offset <>0)) AND (sense = exact));
END_ENTITY;
(*
Attribute definitions:
hour_offset: the number of hours by which a time is offset from coordinated universal time.
minute_offset: the number of minutes by which a time is offset from coordinated universal time.
sense: the direction of the offset.
actual_minute_offset: the value of the number of minutes offset used to compute the coordinated_universal_time_offset, either the value of minute_offset or 0.
Formal propositions:
WR1: The hour_offset shall be a positive number, less than 24.
WR2: The minute_offset shall be a positive number, less than or equal to 59.
WR3: If the value of sense specifies that there is no offset from the Coordinated Universal time, hour_offset and actual_minute_offset shall both be equal to zero. If either hour_offset or actual_minute_offset is different from zero, the value of sense shall specify that there is an offset, either ahead or behind, from the Coordinated Universal time.
EXPRESS specification:
*)
ENTITY date
SUPERTYPE OF (ONEOF (calendar_date,
ordinal_date,
week_of_year_and_day_date,
year_month));
year_component : year_number;
END_ENTITY;
(*
Attribute definitions:
year_component: the year in which the date occurs.
EXPRESS specification:
*)
ENTITY date_and_time;
date_component : date;
time_component : local_time;
END_ENTITY;
(*
Attribute definitions:
date_component: the date element of the date time combination.
time_component: the time element of the date time combination.
NOTE A date_role is a role for a date_assignment and a description of that role.
EXPRESS specification:
*)
ENTITY date_role;
name : label;
DERIVE
description : text := get_description_value (SELF);
WHERE
WR1: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
END_ENTITY;
(*
Attribute definitions:
name: the label by which the date_role is known.
NOTE 1 The meaning of this attribute can be defined in the annotated EXPRESS schemas that use or specialize this entity, or in an agreement of common understanding between the partners sharing this information.
description: the text that characterizes the date_role. The value of the attribute need not be specified.
NOTE 2 This attribute is an upwardly compatible addition to date_role as specified in ISO 10303-41:1994.
Formal propositions:
WR1: Each date_role shall be the described_item in at most one description_attribute.
NOTE 3 The description_attribute data type is defined in basic_attribute_schema of this part of ISO 10303.
NOTE 4 A template for constraining the population of the entity data types defined in the basic_attribute_schema is described in annex E.
NOTE A date_time_role is a role for a date_and_time_assignment and a description of that role.
EXPRESS specification:
*)
ENTITY date_time_role;
name : label;
DERIVE
description : text := get_description_value (SELF);
WHERE
WR1: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
END_ENTITY;
(*
Attribute definitions:
name: the label by which the date_time_role is known.
NOTE 1 The meaning of this attribute can be defined in the annotated EXPRESS schemas that use or specialize this entity, or in an agreement of common understanding between the partners sharing this information.
description: the text that characterizes the date_time_role.
NOTE 2 This attribute is an upwardly compatible addition to date_time_role as specified in ISO 10303-41:1994.
Formal propositions:
WR1: Each date_time_role shall be the described_item in at most one description_attribute.
NOTE 3 The description_attribute data type is defined in basic_attribute_schema of this part of ISO 10303.
NOTE 4 A template for constraining the population of the entity data types defined in the basic_attribute_schema is described in annex E.
NOTE 1 The point in time of the existence may not be known in terms of a calendar date before the event_occurrence actually happens. One reason, why the event_occurrence cannot always be expressed as a calendar date, is that the event_occurrence is not possible to plan, for example a break down of a machine.
EXAMPLE The event_occurrence 'start of production' implicitly declares that the before the event_occurrence a product was not in production.
EXPRESS specification:
*)
ENTITY event_occurrence;
id : identifier;
name : label;
description :
OPTIONAL
text;
END_ENTITY;
(*
Attribute definitions:
id: the identifier that distinguishes the event_occurrence.
NOTE 2 The context in which id is used as a discriminating characteristic can be identified in an annotated Express schema that uses or specializes this entity, or by default, in an agreement of common understanding between partners sharing this information.
name: the label by which the event_occurrence is known.
description: the text that characterizes the event_occurrence. The value of the attribute need not be specified.
EXAMPLE For the event_occurrence 'start of production' the product, for which production starts, is the context for that event_occurrence.
EXPRESS specification:
*)
ENTITY event_occurrence_context_role;
name : label;
description :
OPTIONAL
text;
END_ENTITY;
(*
Attribute definitions:
name: the label by which the event_occurrence_context_role is known.
description: the text that characterizes the event_occurrence_context_role. The value of the attribute need not be specified.
NOTE 1 The role of event_occurrence_relationship can be defined in the annotated EXPRESS schemas that use or specialize this entity, or by default, in an agreement of common understanding between the partners sharing this information.
NOTE 2 This entity, together with the event_occurrence entity, is based on the relationship template that is described in annex E.3.
EXPRESS specification:
*)
ENTITY event_occurrence_relationship;
name : label;
description :
OPTIONAL
text;
relating_event : event_occurrence;
related_event : event_occurrence;
END_ENTITY;
(*
Attribute definitions:
name: the label by which the event_occurrence_relationship is known.
description: the text that characterizes the event_occurrence_relationship. The value of the attribute need not be specified.
relating_event: one of the instances of event_occurrences that is a part of the relationship.
NOTE 3 The meaning of this attribute can be defined in the annotated EXPRESS schemas that use or specialize this entity, or in an agreement of common understanding between the partners sharing this information.
related_event: the other instance of event_occurrence. If one element of the relationship is dependent upon the other, this attribute shall be the dependent one.
NOTE 4 The meaning of this attribute can be defined in the annotated EXPRESS schemas that use or specialize this entity, or in an agreement of common understanding between the partners sharing this information.
EXPRESS specification:
*)
ENTITY event_occurrence_role;
name : label;
description :
OPTIONAL
text;
END_ENTITY;
(*
Attribute definitions:
name: the label by which the event_occurrence_role is known.
description: the text that characterizes the event_occurrence_role. The value of the attribute need not be specified.
NOTE This construct is used to represent a moment of time whereas time_measure represents amounts of time.
EXPRESS specification:
*)
ENTITY local_time;
hour_component : hour_in_day;
minute_component :
OPTIONAL
minute_in_hour;
second_component :
OPTIONAL
second_in_minute;
zone : coordinated_universal_time_offset;
WHERE
WR1: valid_time (SELF);
END_ENTITY;
(*
Attribute definitions:
hour_component: the number of hours.
minute_component: the number of minutes. The value of the attribute need not be specified.
second_component: the number of seconds. The value of the attribute need not be specified.
zone: the offset of the local time zone to the coordinated universal time.
Formal propositions:
WR1: The entity shall define a valid time. The second_component attribute shall only exist if the minute_component attribute exists.
EXPRESS specification:
*)
ENTITY ordinal_date
SUBTYPE OF (date);
day_component : day_in_year_number;
WHERE
WR1: (NOT leap_year(SELF.year_component) AND { 1 <= day_component <= 365 }) OR (leap_year(SELF.year_component) AND { 1 <=
day_component <= 366 });
END_ENTITY;
(*
Attribute definitions:
day_component: the day element of the date.
Formal propositions:
WR1: The day_component shall be between 1 and 365 if the year_component is not a leap year. Otherwise the day_component shall be between 1 and 366.
EXAMPLE 'Five days after start of production' is an example for a relative_event_occurrence, where 'five days' is an offset relative to an event_occurrence 'start of production'.
EXPRESS specification:
*)
ENTITY relative_event_occurrence
SUBTYPE OF (event_occurrence);
base_event : event_occurrence;
offset : time_measure_with_unit;
END_ENTITY;
(*
Attribute definitions:
base_event: the relative_event_occurrence is defined with respect to the base_event.
offset: the amount of time that passes between the occurrence of the base_event and the relative_event_occurrence. A negative offset specifies that the relative_event_occurrence occurs before the base_event.
EXAMPLE 'Strike duration', 'delay of production', and 'Christmas holidays' are examples for time_intervals.
EXPRESS specification:
*)
ENTITY time_interval;
id : identifier;
name : label;
description :
OPTIONAL
text;
END_ENTITY;
(*
Attribute definitions:
id: the identifier that distinguishes the time_interval.
NOTE The context in which id is used as a discriminating characteristic can be identified in an annotated Express schema that uses or specializes this entity, or by default, in an agreement of common understanding between partners sharing this information.
name: the label by which the time_interval is known.
description: the text that characterizes the time_interval. The value of the attribute need not be specified.
NOTE 1 The role of time_interval_relationship can be defined in the annotated EXPRESS schemas that use or specialize this entity, or by default, in an agreement of common understanding between the partners sharing this information.
NOTE 2 This entity, together with the time_interval entity, is based on the relationship template that is described in annex E.3.
EXPRESS specification:
*)
ENTITY time_interval_relationship;
name : label;
description :
OPTIONAL
text;
relating_time_interval : time_interval;
related_time_interval : time_interval;
END_ENTITY;
(*
Attribute definitions:
name: the label by which the time_interval_relationship is known.
description: the text that characterizes the time_interval_relationship. The value of the attribute need not be specified.
relating_time_interval: one of the instances of time_interval that is a part of the relationship.
NOTE 3 The meaning of this attribute can be defined in the annotated EXPRESS schemas that use or specialize this entity, or in an agreement of common understanding between the partners sharing this information.
related_time_interval: the other instance of time_interval. If one element of the relationship is dependent upon the other, this attribute shall be the dependent one.
NOTE 4 The meaning of this attribute can be defined in the annotated EXPRESS schemas that use or specialize this entity, or in an agreement of common understanding between the partners sharing this information.
NOTE The assignment of a role to a time_interval is accomplished by the time_interval_assignment entity data type.
EXPRESS specification:
*)
ENTITY time_interval_role;
name : label;
description :
OPTIONAL
text;
END_ENTITY;
(*
Attribute definitions:
name: the label by which the time_interval_role is known.
description: the text that characterizes the time_interval_role. The value of the attribute need not be specified.
NOTE The meaning of this attribute can be defined in the annotated EXPRESS schemas that use or specialize this entity, or in an agreement of common understanding between the partners sharing this information.
EXAMPLE 'From 01-01-1999 to 31-12-1999' is an example for a both side bounded time_interval_with_bounds, 'from 01-01-2000 on', and 'until start of production' are examples for a one side bounded time_interval_with_bounds.
EXPRESS specification:
*)
ENTITY time_interval_with_bounds
SUBTYPE OF (time_interval);
primary_bound :
OPTIONAL
date_time_or_event_occurrence;
secondary_bound :
OPTIONAL
date_time_or_event_occurrence;
duration :
OPTIONAL
time_measure_with_unit;
WHERE
WR1: EXISTS(primary_bound) OR EXISTS(secondary_bound);
WR2: NOT (EXISTS(primary_bound) AND EXISTS(secondary_bound) AND EXISTS(duration));
WR3: EXISTS(primary_bound) AND NOT EXISTS(secondary_bound) AND (NOT EXISTS(duration) OR duration_is_positive(duration));
WR4: EXISTS(secondary_bound) AND NOT EXISTS(primary_bound) AND EXISTS(duration) AND duration_is_negative(duration);
END_ENTITY;
(*
Attribute definitions:
primary_bound: one of the bounds of the time_interval_with_bounds. The value of this attribute need not be specified.
secondary_bound: the other bound of the time_interval_with_bounds. The value of this attribute need not be specified.
duration: the time_measure_with_unit that specifies the length of a time_interval_with_bounds. If positive, the time_interval_with_bounds is a lower bounded time_interval_with_bounds, else an upper bounded time_interval_with_bounds. The value of this attribute need not be specified.
Formal propositions:
WR1: Either the primary_bound or the secondary_bound or both shall be specified.
WR2: The combination of primary_bound, secondary_bound and duration shall not be specified.
WR3: If primary_bound is specified and secondary_bound is not specified and if duration is specified, the duration shall be positive.
WR4: If primary_bound is not specified and secondary_bound is specified, duration shall be specified and the duration shall be negative.
NOTE The assignment of the role to a local_time is accomplished by the time_assignment entity data type.
EXPRESS specification:
*)
ENTITY time_role;
name : label;
DERIVE
description : text := get_description_value (SELF);
WHERE
WR1: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
END_ENTITY;
(*
Attribute definitions:
name: the label by which the time_role is known.
NOTE 1 The meaning of this attribute can be defined in the annotated EXPRESS schemas that use or specialize this entity, or in an agreement of common understanding between the partners sharing this information.
description: the text that characterizes the time_role.
NOTE 2 This attribute is an upwardly compatible addition to time_role as specified in ISO 10303-41:1994
Formal propositions:
WR1: Each time_role shall be the described_item in at most one description_attribute.
NOTE 3 The description_attribute data type is defined in basic_attribute_schema of this part of ISO 10303.
NOTE 4 A template for constraining the population of the entity data types defined in the basic_attribute_schema is described in annex E.
EXPRESS specification:
*)
ENTITY week_of_year_and_day_date
SUBTYPE OF (date);
week_component : week_in_year_number;
day_component :
OPTIONAL
day_in_week_number;
WHERE
WR1: NOT(leap_year(SELF\date.year_component)) OR { 1<= (day_component + (7 * (week_component - 1))) <= 366 };
WR2: leap_year(SELF\date.year_component) OR { 1<= (day_component + (7 * (week_component - 1))) <= 365 };
END_ENTITY;
(*
Attribute definitions:
week_component: the week element of the date.
day_component: the day element of the date.
Formal propositions:
WR1: The result of the expression day_component + (7 * week_component) shall be between 1 and 366 if the year_component is a leap year.
WR2: The result of the expression day_component + (7 * week_component) shall be between 1 and 365 if the year_component is not a leap year.
EXPRESS specification:
*)
ENTITY year_month
SUBTYPE OF (date);
month_component : month_in_year_number;
END_ENTITY;
(*
Attribute definitions:
month_component: the month element of the date.
The function returns TRUE if no cycle has been detected. Otherwise it returns FALSE.
NOTE 1 The algorithm of the function is explained in annex E.2.
NOTE 2 This function is not used in this schema. It is defined here because other ISO 10303 integrated resources and application protocols that use the event_occurrence_relationship entity include rules that use this function.
EXPRESS specification:
*)
FUNCTION acyclic_event_occurrence_relationship (relation : event_occurrence_relationship; relatives : SET[1:?] OF event_occurrence; specific_relation : STRING) : BOOLEAN;
LOCAL x : SET OF event_occurrence_relationship; END_LOCAL; IF relation.relating_event IN relatives THEN RETURN (FALSE); END_IF; x := QUERY(evnt <* bag_to_set(USEDIN(relation.relating_event, 'DATE_TIME_SCHEMA.' + 'EVENT_OCCURRENCE_RELATIONSHIP.' + 'RELATED_EVENT')) | specific_relation IN TYPEOF(evnt)); REPEAT i := 1 TO HIINDEX(x); IF NOT acyclic_event_occurrence_relationship(x[i], relatives + relation.relating_event, specific_relation) THEN RETURN (FALSE); END_IF; END_REPEAT; RETURN (TRUE);
END_FUNCTION;
(*
Argument definitions:
relation: (input) the candidate event_occurrence_relationship to be checked.
relatives: (input) the set of instances of the entity data type event_occurrence for which the function is searching in the relating_event parameter of the relation argument.
specific_relation: (input) the fully qualified entity name of a type of event_occurrence_relationship entity.
The function returns TRUE if no cycle has been detected. Otherwise it returns FALSE.
NOTE 1 The algorithm of the function is explained in annex E.2.
NOTE 2 This function is not used in this schema. It is defined here because other ISO 10303 integrated resources and application protocols that use the time_interval_relationship entity include rules that use this function.
EXPRESS specification:
*)
FUNCTION acyclic_time_interval_relationship (relation : time_interval_relationship; relatives : SET[1:?] OF time_interval; specific_relation : STRING) : BOOLEAN;
LOCAL x : SET OF time_interval_relationship; END_LOCAL; IF relation.relating_time_interval IN relatives THEN RETURN (FALSE); END_IF; x := QUERY(ti <* bag_to_set(USEDIN(relation.relating_time_interval, 'DATE_TIME_SCHEMA.' + 'TIME_INTERVAL_RELATIONSHIP.' + 'RELATED_TIME_INTERVAL')) | specific_relation IN TYPEOF(ti)); REPEAT i := 1 TO HIINDEX(x); IF NOT acyclic_time_interval_relationship(x[i], relatives + relation.relating_time_interval, specific_relation) THEN RETURN (FALSE); END_IF; END_REPEAT; RETURN (TRUE);
END_FUNCTION;
(*
Argument definitions:
relation: (input) the candidate time_interval_relationship to be checked.
relatives: (input) the set of instances of the entity data type time_interval for which the function is searching in the relating_time_interval parameter of the relation argument.
specific_relation: (input) the fully qualified entity name of a type of time_interval_relationship entity.
EXPRESS specification:
*)
FUNCTION duration_is_negative (duration : time_measure_with_unit) : BOOLEAN;
IF (duration\measure_with_unit.value_component < 0.0) THEN RETURN (TRUE); ELSE RETURN (FALSE); END_IF;
END_FUNCTION;
(*
Argument definitions:
duration: (input) the candidate duration that is being checked.
EXPRESS specification:
*)
FUNCTION duration_is_positive (duration : time_measure_with_unit) : BOOLEAN;
IF (duration\measure_with_unit.value_component > 0.0) THEN RETURN (TRUE); ELSE RETURN (FALSE); END_IF;
END_FUNCTION;
(*
Argument definitions:
duration: (input) the candidate duration that is being checked.
NOTE Leap years occur every for years.
EXPRESS specification:
*)
FUNCTION leap_year (year : year_number) : BOOLEAN;
IF ((((year MOD 4) = 0) AND ((year MOD 100) <> 0)) OR ((year MOD 400) = 0)) THEN RETURN (TRUE); ELSE RETURN (FALSE); END_IF;
END_FUNCTION;
(*
Argument definitions:
year: an integer representing a particular year in the Gregorian calendar.
EXPRESS specification:
*)
FUNCTION valid_calendar_date (date : calendar_date) : LOGICAL;
CASE date.month_component OF 1 : RETURN({ 1 <= date.day_component <= 31 }); 2 : BEGIN IF (leap_year(date.year_component)) THEN RETURN({ 1 <= date.day_component <= 29 }); ELSE RETURN({ 1 <= date.day_component <= 28 }); END_IF; END; 3 : RETURN({ 1 <= date.day_component <= 31 }); 4 : RETURN({ 1 <= date.day_component <= 30 }); 5 : RETURN({ 1 <= date.day_component <= 31 }); 6 : RETURN({ 1 <= date.day_component <= 30 }); 7 : RETURN({ 1 <= date.day_component <= 31 }); 8 : RETURN({ 1 <= date.day_component <= 31 }); 9 : RETURN({ 1 <= date.day_component <= 30 }); 10 : RETURN({ 1 <= date.day_component <= 31 }); 11 : RETURN({ 1 <= date.day_component <= 30 }); 12 : RETURN({ 1 <= date.day_component <= 31 }); END_CASE; RETURN (FALSE);
END_FUNCTION;
(*
Argument definitions:
date: (input) the candidate calendar_date that is to be checked.
EXPRESS specification:
*)
FUNCTION valid_time (time : local_time) : BOOLEAN;
IF EXISTS(time.second_component) THEN RETURN (EXISTS(time.minute_component)); ELSE RETURN (TRUE); END_IF;
END_FUNCTION;
(*
Argument definitions:
time: (input) the candidate local_time that is to be checked.
*)
END_SCHEMA; -- date_time_schema
(*
© ISO 2021 — All rights reserved