[wg11] Is an empty extensible select a specialization of another
type?
Ed Barkmeyer
edbark at nist.gov
Mon May 15 12:12:21 EDT 2006
Lothar wrote:
> ENTITY Shape_element; ...
> containing_shape : Item_shape; ...
>
> ENTITY Non_feature_shape_element
> SUBTYPE OF (Shape_element); ...
> SELF\Shape_element.containing_shape RENAMED scope :
> ee_product_definition_with_annotation_elements; ...
>
> TYPE ee_product_definition_with_annotation_elements = EXTENSIBLE
> GENERIC_ENTITY SELECT ;
> END_TYPE; -- ee_product_definition_with_annotation_elements
>
> ee_product_definition_with_annotation_elements is not a specialization of
> Item_shape and so this express is not valid.
I disagree with Lothar's position here.
One of Lothar and Tom (I can't figure out which) wrote:
> The interpretation of this by the compiler writers is that the bullet from
> 9.2.6 that specifies the behavior of select applies.
Actually 9.2.7, and the bullet of interest is:
"- a select of a, b, c is a specialization of a supertype if a, b, c are
subtypes of the supertype;"
> I have seen this behavior where the compiler will allow the use of EXTENSIBLE
> SELECT as long as the leaf elements are subtypes of the original type
> referenced by the attribute.
The point here is that the domain of the extensible select type
ee_product_definition_with_annotation_elements *is* the set of leaf entities
ultimately defined by its extensions in the Schema.
> Another way of looking at this is the "expectation" that the modules are all
> compiled into a long form and this is something that will be resolved there.
This is the right idea, but in fact, it has nothing to do with the "long
form". Per Part 11, clause 8.4.2,
"An extensible select data type has as its domain the union of the domains of
the named data types in its own select list, plus the union of the domains of
all extending select data types."
So, if I assume that "all extending select data types" means those defined in
the schema the parser was directed at (which will include all the interfaced
bits), the select data type so defined be a "union of domains" comprising
exactly what Lothar/Tom called the "leaf types".
And as long as that set of domains satisfies the specialization bullet cited
above, the definition of ee_product_definition_with_annotation_elements makes
it a valid specialization of Item_shape.
Lothar Klein wrote:
> Do you think we have to do something on this?
At most I would add a Note to Clause 9.2.7 of Part 11 to the effect that the
list "a, b, c" refers to the set of *domains* that constitute the domain of
the select data type, and not just the type names in the syntactic select
list. And for an extensible type, that means the completed set of domains, as
specified in 8.4.2.
Note also that the following bullet in 9.2.7 is redundant:
"- an extensible GENERIC_ENTITY select is a specialization of a GENERIC_ENTITY;"
in the light of the rule below it:
"- a select data type that contains only entity data types is a specialization
of a GENERIC_ENTITY;"
which, however, should have read:
"- a select data type whose domain consists only of entity data type domains
is a specialization of a GENERIC_ENTITY;"
It is important to realize that GENERIC_ENTITY constrains what the extensions
of an extensible select data type *can be*, but the specialization rules only
depend on what the extensions *actually are*!
-Ed
--
Edward J. Barkmeyer Email: edbark at nist.gov
National Institute of Standards & Technology
Manufacturing Systems Integration Division
100 Bureau Drive, Stop 8263 Tel: +1 301-975-3528
Gaithersburg, MD 20899-8263 FAX: +1 301-975-4482
"The opinions expressed above do not reflect consensus of NIST,
and have not been reviewed by any Government authority."
More information about the wg11
mailing list