ISO 10303-214:2010(E)

5.2.5 automotive_design functions

5.2.5.1 assembly_shape_is_defined

The assembly_shape_is_defined function accepts a next_assembly_usage_occurrence as input and returns a boolean result. The function will return TRUE if the shape is defined for the product_definition which is the related_product_definition and the shape is defined for the product_definition which is the relating_product_definition in the next_assembly_usage_occurrence, and the two shapes are related through a shape_representation_relationship, and the two relationships are related through context_dependent_shape_representation. The function will also return TRUE if the shape of the related_product_definition or the relating_product_definition is not defined. The only time this function will return false is when the shapes are defined for the related_product_definition and the relating_product_definition and related through shape_representation_relationship, but the next_assembly_usage_occurrence and the shape_representation_relationship are not explicitly related through context_dependent_shape_representation.

NOTE The definition of this function is identical to the definition in ISO 10303-203.

EXPRESS specification:

*)
FUNCTION assembly_shape_is_defined
  (assy: next_assembly_usage_occurrence) : BOOLEAN;
  LOCAL
        sdr_set : SET OF shape_definition_representation := [];
        srr_set : SET OF shape_representation_relationship := [];
        sdr1_set : SET OF shape_definition_representation := [];
        pd_set : SET OF property_definition := [];
        pdr_set : SET OF product_definition_relationship := [];
        pds_set : SET OF product_definition_shape := [];
	prop_set : SET OF property_definition := [];
  END_LOCAL;
  -- Gather all instances of shape_definition_representation where the
  -- component part has a representation defined for it.
  pd_set := bag_to_set( USEDIN(assy.related_product_definition,
            'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION'));
  pdr_set := QUERY( pdr <* bag_to_set(USEDIN
            (assy.related_product_definition,
            'AUTOMOTIVE_DESIGN.PRODUCT_DEFINITION_RELATIONSHIP.' +
            'RELATED_PRODUCT_DEFINITION')) |
             SIZEOF( USEDIN( pdr,
            'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION'))
             > 0);
  IF SIZEOF(pd_set) > 0 THEN
      REPEAT i:=1 TO HIINDEX(pd_set);
       sdr_set := sdr_set + QUERY( pdr <* USEDIN(pd_set[i],
      'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION_REPRESENTATION.'+
      'DEFINITION') |
      'AUTOMOTIVE_DESIGN.SHAPE_DEFINITION_REPRESENTATION' IN
       TYPEOF(pdr));
      END_REPEAT;
  END_IF;
  IF SIZEOF(pdr_set) > 0 THEN
      --mp: first, get all the property_definitions 
      --that reference the elements of pdr_set
      REPEAT i:=1 TO HIINDEX(pdr_set);
        prop_set := prop_set + bag_to_set(USEDIN(pdr_set[i],
       'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION'));
      END_REPEAT;
      --mp: now, get all the shape_definition_representations
      -- that are reps of the properties found
      IF SIZEOF (prop_set) > 0 THEN
        REPEAT i:=1 TO HIINDEX(prop_set);
         sdr_set := sdr_set + QUERY( pdr <* USEDIN(prop_set[i],
         'AUTOMOTIVE_DESIGN.' + 
         'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') |
         'AUTOMOTIVE_DESIGN.SHAPE_DEFINITION_REPRESENTATION' IN
         TYPEOF(pdr));
        END_REPEAT;
      END_IF;
  END_IF;
  -- If there is a representation defined for the component part
  IF SIZEOF (sdr_set) > 0 THEN
    -- For each representation of the shape of the component part gather
    -- all instances of shape_representation_relationship where the
    -- representation of component part is related to another
    -- representation.
    REPEAT i := 1 TO HIINDEX (sdr_set);
      srr_set := QUERY (rr <* bag_to_set (
               USEDIN (sdr_set[i]\
               property_definition_representation.used_representation,
               'AUTOMOTIVE_DESIGN.REPRESENTATION_RELATIONSHIP.REP_2')) |
               'AUTOMOTIVE_DESIGN.SHAPE_REPRESENTATION_RELATIONSHIP' IN
               TYPEOF (rr));
      -- If there is a shape_representation_relationship where the component
      -- component part's shape_representation is related to another shape_-
      -- representation.
      pd_set := bag_to_set(USEDIN(assy.relating_product_definition,
             'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION'));
      IF SIZEOF(pd_set) > 0 THEN
          REPEAT i:=1 TO HIINDEX(pd_set);
             sdr1_set := sdr1_set + QUERY( pdr <* USEDIN(pd_set[i],
             'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION_REPRESENTATION.'+
             'DEFINITION') |
             'AUTOMOTIVE_DESIGN.SHAPE_DEFINITION_REPRESENTATION' IN
             TYPEOF(pdr));
          END_REPEAT;
      END_IF;
      IF ( (SIZEOF(sdr_set) > 0) AND (SIZEOF(sdr1_set) > 0) ) THEN
        IF SIZEOF (srr_set) > 0 THEN
          -- For each shape_representation_relationship in that set
          REPEAT j := 1 TO HIINDEX (srr_set);
            -- If the other shape_representation in the shape_representa-
            -- tion_relationship is the  shape_representation of the assembly
            -- product_definition in at least one instance.
            IF SIZEOF (QUERY (pdr <* bag_to_set (USEDIN
              (srr_set[j]\representation_relationship.rep_1,
              'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION_REPRESENTATION.' +
              'USED_REPRESENTATION')) |
              'AUTOMOTIVE_DESIGN.SHAPE_DEFINITION_REPRESENTATION' IN
              TYPEOF (pdr)) * sdr1_set) >= 1 THEN
              -- If the shape_representation_relationship and the
              -- product_definition_relationship of each occurrence
              -- of the component
              -- and assembly relationship is not given via the
              -- context_dependent_shape_representation then return FALSE
              pds_set := QUERY(x <*  bag_to_set( USEDIN(assy,
                 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION')) |
                 'AUTOMOTIVE_DESIGN.PRODUCT_DEFINITION_SHAPE'  IN
                  TYPEOF(x));
              IF SIZEOF(pds_set) = 0 THEN
                RETURN (FALSE);
              END_IF;
              REPEAT k:=1 TO HIINDEX(pds_set);
                IF SIZEOF (QUERY (cdsr <*
                  USEDIN (pds_set[k], 'AUTOMOTIVE_DESIGN.' +
                  'CONTEXT_DEPENDENT_SHAPE_REPRESENTATION.' +
                  'REPRESENTED_PRODUCT_RELATION') |
                  (cdsr.representation_relation :=: srr_set[j]) )) > 0
                  THEN RETURN (FALSE);
                END_IF;
              END_REPEAT;
            END_IF;
          END_REPEAT;
        END_IF;
      END_IF;
    END_REPEAT;
  END_IF;
  -- If the shape of the component is not specified or there are no
  -- violations then return TRUE
  RETURN (TRUE);
END_FUNCTION; -- assembly_shape_is_defined
(*

Argument definitions:

assy: The assy identifies the next_assembly_usage_occurrence for which the relationships are to be checked.

5.2.5.2 default_tolerance_table_cell_wr2

The default_tolerance_table_cell_wr2 function accepts an AGGREGATE of representation_items as input and returns a boolean result. The function will return TRUE if the size of the aggregate is less or equal to five. Else it will return FALSE.

NOTE This function realizes the second local rule of default_tolerance_table_cell.

EXPRESS specification:

*)
FUNCTION default_tolerance_table_cell_wr2(
    agg: AGGREGATE OF representation_item): BOOLEAN;
   BEGIN
     IF SIZEOF(agg) <= 5 THEN
       RETURN(TRUE);
     ELSE
       RETURN(FALSE);
     END_IF;
   END;
END_FUNCTION; -- default_tolerance_table_cell_wr2
(*

Argument definitions:

agg: The agg identifies the aggregate of instances which are tested.

5.2.5.3 default_tolerance_table_cell_wr3

The default_tolerance_table_cell_wr3 function accepts an AGGREGATE of representation_items as input and returns a boolean result. The function will return TRUE if the aggregate contains either exactly one measure_representation_item with name 'significant number of digits', or exactly two measure_representation_items, one with a name of 'upper limit', and the other with a name of 'lower limit'. Else it will return FALSE.

NOTE This function realizes the third local rule of default_tolerance_table_cell.

EXPRESS specification:

*)
FUNCTION default_tolerance_table_cell_wr3(
       agg: AGGREGATE OF representation_item): BOOLEAN;
 BEGIN
   IF (SIZEOF(QUERY ( i <* agg | 
         (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' 
         IN TYPEOF(i)) AND 
          (i\representation_item.name = 
         'significant number of digits')) 
         )) = 1) OR 
     ((SIZEOF(QUERY ( i <* agg | 
         (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' 
         IN TYPEOF(i)) AND 
          (i\representation_item.name = 'lower limit')) 
        )) = 1) AND 
      (SIZEOF( QUERY ( i <* agg | 
         (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' 
         IN TYPEOF(i)) AND 
          (i\representation_item.name = 'upper limit'))
        )) = 1))
   THEN
     RETURN(TRUE);
   ELSE
     RETURN(FALSE);
   END_IF;
 END;
END_FUNCTION; -- default_tolerance_table_cell_wr3
(*

Argument definitions:

agg: The agg identifies the aggregate of instances which are tested.

5.2.5.4 default_tolerance_table_cell_wr4

The default_tolerance_table_cell_wr4 function accepts an AGGREGATE of representation_items as input and returns a boolean result. The function will return TRUE if the aggregate contains either exactly one measure_representation_item a with names of 'plus minus tolerance value', or exactly two measure_representation_items, one with a name of 'lower tolerance value', and the other with a name of 'upper tolerance value'. Else it will return FALSE.

NOTE This function realizes the forth local rule of default_tolerance_table_cell.

EXPRESS specification:

*)
FUNCTION default_tolerance_table_cell_wr4(
    agg: AGGREGATE OF representation_item): BOOLEAN;
  BEGIN
   IF (SIZEOF(QUERY ( i <* agg | 
         (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' 
         IN TYPEOF(i)) AND 
          (i\representation_item.name = 
         'plus minus tolerance value')) 
        )) = 1) OR 
     ((SIZEOF(QUERY ( i <* agg | 
         (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' 
         IN TYPEOF(i)) AND 
          (i\representation_item.name = 'lower tolerance value')) 
        )) = 1) AND 
       (SIZEOF( QUERY ( i <* agg | 
         (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' 
         IN TYPEOF(i)) AND 
          (i\representation_item.name = 'upper tolerance value'))
        )) = 1))
   THEN
     RETURN(TRUE);
   ELSE
     RETURN(FALSE);
   END_IF;
  END;
END_FUNCTION; -- default_tolerance_table_cell_wr4
(*

Argument definitions:

agg: The agg identifies the aggregate of instances which are tested.

5.2.5.5 default_tolerance_table_cell_wr5

The default_tolerance_table_cell_wr5 function accepts an AGGREGATE of representation_items as input and returns a boolean result. The function will return TRUE if the aggregate contains at most one descriptive_representation_item. If it is present, its name shall be 'cell description'. Else it will return FALSE.

NOTE This function realizes the fifth local rule of default_tolerance_table_cell.

EXPRESS specification:

*)
FUNCTION default_tolerance_table_cell_wr5(
     agg: AGGREGATE OF representation_item): BOOLEAN;
  BEGIN
    IF (SIZEOF(QUERY ( i <* agg | 
          ('AUTOMOTIVE_DESIGN.DESCRIPTIVE_REPRESENTATION_ITEM' 
          IN TYPEOF(i)) 
         )) <= 1) AND 
       (SIZEOF(QUERY ( i <* agg | 
          ('AUTOMOTIVE_DESIGN.DESCRIPTIVE_REPRESENTATION_ITEM' 
          IN TYPEOF(i)) 
         )) = 
        SIZEOF(QUERY ( i <* agg | 
          (('AUTOMOTIVE_DESIGN.DESCRIPTIVE_REPRESENTATION_ITEM' 
          IN TYPEOF(i)) AND 
           (i\representation_item.name = 'cell description'))) )) 
    THEN
      RETURN(TRUE);
    ELSE
      RETURN(FALSE);
    END_IF;
  END;
END_FUNCTION; -- default_tolerance_table_cell_wr5
(*

Argument definitions:

agg: The agg identifies the aggregate of instances which are tested.

5.2.5.6 get_diameter_for_round_hole

The get_diameter_for_round_hole function accepts an instance of round_hole as input and returns a REAL value representing the diameter of the round_hole.

NOTE This is used in the fourth local rule of composite_hole.

EXPRESS specification:

*)
FUNCTION get_diameter_for_round_hole
      ( rh : round_hole ) : REAL;
      LOCAL
      sa_set : SET OF shape_aspect;
      sar_set : SET OF shape_aspect_relationship;
      pdr_set : SET OF property_definition_representation;
      ri_set : SET OF representation_item;
      END_LOCAL;
 sa_set := get_shape_aspects(rh);
 REPEAT i:=1 to HIINDEX(sa_set);
  IF (sa_set[i].description = 'diameter occurrence')
   THEN
     sar_set := bag_to_set(USEDIN(sa_set[i],'AUTOMOTIVE_DESIGN.'+
                'SHAPE_ASPECT_RELATIONSHIP.RELATED_SHAPE_ASPECT'));
     REPEAT j:=1 to HIINDEX(sar_set);
      IF ((sar_set[j].name = 'diameter') AND
          (sar_set[j].description = 'profile usage') AND
          ('AUTOMOTIVE_DESIGN.SHAPE_DEFINING_RELATIONSHIP' IN TYPEOF
          (sar_set[j])) AND
          ('AUTOMOTIVE_DESIGN.CIRCULAR_CLOSED_PROFILE' IN TYPEOF
          (sar_set[j].relating_shape_aspect)))
       THEN
         pdr_set := get_shape_aspect_property_definition_representations
                    (sar_set[j].relating_shape_aspect);
         REPEAT k:=1 to HIINDEX(pdr_set);
          IF ('AUTOMOTIVE_DESIGN.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
             IN TYPEOF(pdr_set[k].used_representation))
           THEN
            ri_set := pdr_set[k].used_representation.items;
            REPEAT l:=1 to HIINDEX(ri_set);
             IF (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' 
                IN TYPEOF(ri_set[l])) AND
                 ('AUTOMOTIVE_DESIGN.LENGTH_MEASURE_WITH_UNIT' 
                 IN TYPEOF(ri_set[l])))
              THEN
               RETURN (ri_set[l]\measure_with_unit.value_component);
             END_IF;
            END_REPEAT;
          END_IF;
         END_REPEAT;
      END_IF;
     END_REPEAT;
  END_IF;
 END_REPEAT;
 RETURN(?);
END_FUNCTION;
(*

Argument definitions:

rh: The rh identifies the instance of round_hole whose diameter is to be determined.

5.2.5.7 get_multi_language

The get_multi_language function accepts an instance of multi_language_attribute_assignment as input and returns a label representing the language.

NOTE This function is used to determine the value of the derived attribute language of multi_language_attribute_assignment.

EXPRESS specification:

*)
FUNCTION get_multi_language 
(x : attribute_value_assignment) : label;
LOCAL
alas : BAG OF attribute_language_assignment := 
         USEDIN(x, 'AUTOMOTIVE_DESIGN.'+
               'ATTRIBUTE_LANGUAGE_ASSIGNMENT.ITEMS');
-- note: sizeof(alas) has to be 1 due to
-- multi_language_attribute_assignment.wr2
END_LOCAL;
IF SIZEOF(alas) > 0 THEN RETURN(alas[1].language);
END_IF;
RETURN (?);
END_FUNCTION;
(*

Argument definitions:

x: The x identifies the instance of attribute_value_assignment for which a language is returned.

5.2.5.8 get_round_holes_for_composite_hole

The get_round_holes_for_composite_hole function accepts a set of shape_aspect_relationship as input and returns a set of round_holes as output.

NOTE This function is used within the local rules of composite_hole.

EXPRESS specification:

*)
FUNCTION get_round_holes_for_composite_hole
      ( sar_instance_set : SET OF shape_aspect_relationship )
       : SET OF round_hole;
      LOCAL
      rh_set : SET OF round_hole := [];
      pdr_set : SET OF property_definition_representation;
      pdr_set1 : SET OF property_definition_representation;
      ri_set : SET OF representation_item;
      END_LOCAL;
 REPEAT i:=1 to HIINDEX (sar_instance_set);
  IF ('AUTOMOTIVE_DESIGN.INSTANCED_FEATURE' IN TYPEOF
     (sar_instance_set[i].related_shape_aspect))
   THEN
    rh_set := rh_set + sar_instance_set[i].related_shape_aspect;
  END_IF;
  IF ('AUTOMOTIVE_DESIGN.PLACED_FEATURE' IN TYPEOF
     (sar_instance_set[i]))
   THEN
     pdr_set := get_shape_aspect_property_definition_representations
                (sar_instance_set[i].related_shape_aspect);
     REPEAT j:=1 to HIINDEX(pdr_set);
      IF ((pdr_set[j].used_representation.name = 
         'feature definition placement') AND
          ('AUTOMOTIVE_DESIGN.SHAPE_REPRESENTATION' IN TYPEOF
          (pdr_set[j].used_representation)))
       THEN
         ri_set := pdr_set[j].used_representation.items;
         REPEAT k:=1 to HIINDEX(ri_set);
          IF (('AUTOMOTIVE_DESIGN.MAPPED_ITEM' IN TYPEOF
             (ri_set[k])) AND
              ('AUTOMOTIVE_DESIGN.'+
              'SHAPE_REPRESENTATION_WITH_PARAMETERS' IN
               TYPEOF(ri_set[k]\mapped_item.mapping_source.
                     mapped_representation)))
           THEN
             pdr_set1 := bag_to_set (USEDIN(ri_set[k]\mapped_item.mapping_source.mapped_representation ,
              'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION_REPRESENTATION.'+
              'USED_REPRESENTATION'));
             REPEAT l:=1 to HIINDEX(pdr_set1);
              IF ('AUTOMOTIVE_DESIGN.ROUND_HOLE' IN TYPEOF
                 (pdr_set1[l].definition.definition))
               THEN
                rh_set := rh_set + pdr_set1[l].definition.definition;
              END_IF;
             END_REPEAT;
          END_IF;
         END_REPEAT;
      END_IF;
     END_REPEAT;
  END_IF;
 END_REPEAT;
 RETURN (rh_set);
END_FUNCTION;
(*

Argument definitions:

sar_instance_set: The sar_instance_set identifies the set of shape_aspect_relationship instances which are tested.

5.2.5.9 get_shape_aspect_property_definition_representation

The get_shape_aspect_property_definition_representation function accepts an instance of shape_aspect as input and returns a set of property_definition_representations, which are of type shape_definition_representation and refering by the attribute definition to instances of property_definition which are refering to the shape_aspect by the attribute definition themselves. If the shape_aspect is not refered by such an object, the return value is an empty set.

NOTE This function is used in local rules uf different types of shape_aspect.

EXPRESS specification:

*)
FUNCTION get_shape_aspect_property_definition_representations
      ( s_a_instance : shape_aspect )
       : SET OF property_definition_representation;
      LOCAL
      pd_set : SET OF property_definition := [];
      pdr_set : SET OF property_definition_representation := [];
      END_LOCAL;
 pd_set := bag_to_set (USEDIN (s_a_instance,
      'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION'));
 IF (SIZEOF (pd_set) < 1 ) THEN RETURN (pdr_set);
 END_IF;
 REPEAT i:= 1 to HIINDEX (pd_set);
    pdr_set := pdr_set + (QUERY( pdr <* USEDIN (pd_set[i],
    'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION_REPRESENTATION.'+
    'DEFINITION') |
    'AUTOMOTIVE_DESIGN.SHAPE_DEFINITION_REPRESENTATION' 
    IN TYPEOF(pdr)));
 END_REPEAT;
 RETURN (pdr_set);
END_FUNCTION;
(*

Argument definitions:

s_a_instance: The s_a_instance identifies the shape_aspect which is tested.

5.2.5.10 item_correlation

The item_correlation function accepts a set of GENERIC and a set of STRING as input and returns a boolean result. The function will return TRUE if all elements of the first set are in the set of types that is generated from the second set. Else it will return FALSE.

EXPRESS specification:

*)
FUNCTION item_correlation 
         (items :   SET OF GENERIC;
          c_items:  SET OF STRING):LOGICAL;
 LOCAL
  c_types   : SET OF STRING := [];
  c_hit     : INTEGER := 0;
 END_LOCAL;
 
 REPEAT i:=1 TO HIINDEX(c_items);
  c_types := c_types + ['AUTOMOTIVE_DESIGN.' + c_items[i]];
 END_REPEAT;
 REPEAT i:=1 TO HIINDEX(items);
  IF (SIZEOF(c_types * TYPEOF(items[i])) = 1)
   THEN
    c_hit := c_hit + 1;
  END_IF;
 END_REPEAT;
 IF (SIZEOF(items) = c_hit)
  THEN
   RETURN(TRUE);
  ELSE
   RETURN(FALSE);
 END_IF;
 END_FUNCTION;
(*

Argument definitions:

items: The items identifies the set of instances which are tested, if they are in the set of types constructed from the second argument c_items.

c_items: The c_items identifies a set of STRING, from which a set of types is generated.

5.2.5.11 surface_condition_correlation

The surface_condition_correlation returns function FALSE if, in the case where the name attribute of an instance of property_definition is one of the names associated with the representation of surface conditions, the instance of representation have a different name. If the names are the same, the function returns TRUE. If the name of the property_definition is not in the list of names of surface conditions, the function returns UNKNOWN.

NOTE This function is used in the restrict_representation_for_surface_condition rule.

EXPRESS specification:

*)
FUNCTION surface_condition_correlation (pd: 
   property_definition; rep: representation): LOGICAL;
   CASE pd.name OF
      'visual appearance', 'tactile appearance', 'contact ratio', 'hardness', 'treatment result',
      'surface texture' : RETURN(pd.name = rep.name);
   OTHERWISE : RETURN(UNKNOWN);
   END_CASE;
END_FUNCTION;
(*

Argument definitions:

pd: The pd identifies the instances of property_definition which are tested.

rep: The rep identifies the instances of representation the pd is compared with.

5.2.5.12 value_range_aggregate_rep_item

The value_range_aggregate_rep_item function accepts an AGGREGATE of type representation_item as input and returns a boolean result. The function will return TRUE if the elements of the AGGREGATE represent a 3x3 matrix of measure_representation_items. Else it will return FALSE.

NOTE This function is used in the second local rule of moments_of_inertia_representation.

EXPRESS specification:

*)
 FUNCTION value_range_aggregate_rep_item
          (agg : AGGREGATE OF representation_item) : BOOLEAN;
  FUNCTION cri (agg : AGGREGATE OF representation_item) : BOOLEAN;
   BEGIN
    IF (SIZEOF(agg) = 3) AND
       (SIZEOF(QUERY(i1 <* agg |
                       ('AUTOMOTIVE_DESIGN.'+
                       'MEASURE_REPRESENTATION_ITEM' IN 
                         TYPEOF(i1)) 
                    )) = 3)
    THEN
     RETURN (TRUE);
    ELSE
     RETURN (FALSE);
    END_IF;
   END;
  END_FUNCTION;
  BEGIN
   IF ((SIZEOF(agg) = 3) AND
       (SIZEOF(QUERY(i <* agg | 
               ('AUTOMOTIVE_DESIGN.COMPOUND_REPRESENTATION_ITEM' IN
                 TYPEOF(i)) AND
               cri(i\compound_representation_item.item_element)
             )) = 1))
    THEN
     RETURN (TRUE);
    ELSE
     RETURN (FALSE);
   END_IF;
  END;
 END_FUNCTION;
(*

Argument definitions:

agg: The agg identifies the AGGREGATE of representation_items.

5.2.5.13 value_range_wr1

The value_range_wr1 function accepts an AGGREGATE of representation_item and returns a boolean result. The function will return TRUE if the AGGREGATE contains either exactly two measure_representation_items or two value_representation_items. Else it will return FALSE.

NOTE This function realizes the first local rule of value_range.

EXPRESS specification:

*)
FUNCTION value_range_wr1(
     agg: AGGREGATE OF representation_item): BOOLEAN;
  BEGIN
    IF (SIZEOF(agg) = 2) AND ((SIZEOF(QUERY ( i1 <* agg | (
    'AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' IN TYPEOF
    (i1)) ))
    = 2) OR (SIZEOF(QUERY ( i2 <* agg | (
    'AUTOMOTIVE_DESIGN.VALUE_REPRESENTATION_ITEM' IN TYPEOF
    (i2)) ))
    = 2)) THEN
      RETURN(TRUE);
    ELSE
      RETURN(FALSE);
    END_IF;
  END;
END_FUNCTION; -- value_range_wr1
(*

Argument definitions:

agg: The agg identifies the AGGREGATE of representation_items which are tested.

5.2.5.14 value_range_wr2

The value_range_wr2 function accepts an AGGREGATE of representation_item and returns a boolean result. The function will return TRUE if the AGGREGATE contains two representation_items that have a name of 'upper limit' and 'lower limit'. Else it will return FALSE.

NOTE This function realizes the second local rule of value_range.

EXPRESS specification:

*)
FUNCTION value_range_wr2(
      agg: AGGREGATE OF representation_item): BOOLEAN;
  BEGIN
    IF (SIZEOF(QUERY ( i <* agg | (i.name = 'upper limit')
        )) = 1)
    AND (SIZEOF(QUERY ( i <* agg | (i.name = 'lower limit')
         )) = 1)
     THEN
      RETURN(TRUE);
    ELSE
      RETURN(FALSE);
    END_IF;
  END;
END_FUNCTION; -- value_range_wr2
(*

Argument definitions:

agg: The agg identifies the AGGREGATE of representation_items which are tested.

5.2.5.15 value_range_wr3

The value_range_wr3 function accepts an AGGREGATE of representation_item and returns a boolean result. The function will return TRUE if the AGGREGATE contains two measure_representation_items that reference the same unit_component. Else it will return FALSE.

NOTE This function realizes the third local rule of value_range.

EXPRESS specification:

*)
FUNCTION value_range_wr3(
    agg: AGGREGATE OF representation_item): BOOLEAN;
   BEGIN
   IF SIZEOF(QUERY( i1 <* agg |
      ('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM'
       IN TYPEOF (i1)) AND (SIZEOF ( QUERY (i2 <* agg |
       ('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM'
        IN TYPEOF (i2)) AND (i1 :<>: i2) AND 
        (i1\measure_with_unit.unit_component :=: i2\
         measure_with_unit.unit_component) ) ) = 1 ))) = 2 
   THEN
     RETURN (TRUE);
    ELSE
     RETURN (FALSE);
   END_IF;
  END;
 END_FUNCTION;  -- value_range_wr3 
(*

Argument definitions:

agg: The agg identifies the AGGREGATE of representation_items which are tested.

© ISO 2010 — All rights reserved