Extension versus Specialization

Ed Barkmeyer edbark at nist.gov
Mon Jun 10 12:48:52 EDT 2002


Pascal Huau wrote:

> I would liket to get your recommendation for a particular case of use of Express2
> 
> Example:
> 
> TYPE identification_item = EXTENSIBLE SELECT; END_TYPE;
> 
> TYPE alias_identification_item = EXTENSIBLE SELECT BASED ON identification_item;
> END_TYPE;
> 
> ENTITY Alias_identification
>   SUBTYPE OF (Identification_assignment) ;
>   SELF\Identification_assignment.items : SET [1:?] OF alias_identification_item;
> END_ENTITY;
> 
> ENTITY Identification_assignment;
>   identifier : STRING;
>   role : OPTIONAL STRING;
>   description : OPTIONAL STRING;
>   items : SET [1:?] OF identification_item;
> END_ENTITY;
> 
> My understanding is that the specification of alias_identification_item involves that:
> - all entity types contained in identification_item are allowed to get an alias.
> - all entity types contained in alias_identification_item are allowed to get an identification assigned

Agree.

> As it may not be suitable that the list of entities that may get an alias, 
> be a superset of the list of entities that may get an identification, 
> how to specify the entity alias_identification if alias_identification_item 
> is no more an extension of identification_item? 
> Can alias_identification stay a subtype of Identification_assignment? 
> (my opinion is No, but I would like a confirmation from the best experts)

I agree that one cannot model it this way and get what you want.
My suggestion would be:

 TYPE alias_identification_item = EXTENSIBLE SELECT;
 (* not BASED ON identification_item!  See (1) below. *)
 END_TYPE;

 ENTITY Alias_identification
   SUBTYPE OF (Identification_assignment) ;
 WHERE
   id_item_is_alias_id_item:
     SizeOf (QUERY( item <* SELF\Identification_assignment.items : 
      NOT (schema_name + 'ALIAS_IDENTIFICATION_ITEM') IN TypeOf(item) )) = 0;
 END_ENTITY;

(1) If not every entity_type that can have an identification_assignment can have an alias, then the list of
alias_identification_items has to be separately specified from the list of identification_items; otherwise the two lists will be
the same, as Pascal says above.  That is, the module must explicitly extend alias_identification_item with some entity types,
and it must explicitly extend identification_item with those entity types and possibly others.

(2) The WHERE-rule above requires that the actual identification_items associated with an alias_identification are also
alias_identification_items.  According to subclause 15.25 of Part 11, TYPEOF will return both '...IDENTIFICATION_ITEM' and
'...ALIAS_IDENTIFICATION_ITEM' for every entity that is in both SELECT lists.
(Redeclaration is just another way to write a local rule, and in this case, we simply don't have that option.  So we write a
WHERE-rule instead.)

-Ed

-- 
Edward J. Barkmeyer                       Email: edbark at nist.gov
National Institute of Standards & Technology
Manufacturing Systems Integration Division
100 Bureau Drive, Mail Stop 8260          Tel: +1 301-975-3528
Gaithersburg, MD 20899-8260               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