[wg11] Re: EXPRESS: what is the value of a defined data type?
Ed Barkmeyer
edbark at nist.gov
Mon Sep 25 18:08:19 EDT 2006
Lothar,
[A previous email discussed, from Part 46,
TYPE box_characteristic_select = SELECT
(box_height, box_width, box_slant_angle, box_rotate_angle);
END_TYPE;
ENTITY text_style_with_box_characteristics
SUBTYPE OF (text_style);
characteristics : SET [1:4] OF box_characteristic_select;
WHERE
<rule involving: xxx IN SELF.characteristics >
END_ENTITY;
All the types in the select-list are ultimately based on REAL.
The problem is the meaning of: xxx IN SELF.characteristics,
where xxx evaluates to a valid instance of one of the types in the select-list.]
I wrote:
> So a value of box_slant_angle cannot be compared with a value of
> box_rotate_angle, as I read 12.11 and 12.2.2. They are not
> type-compatible.
I think you have uncovered a SEDS-worthy problem here nonetheless.
You pointed out that IN is defined in terms of instance comparison. IN
requires type compatibility with the base-type of the aggregation type, but
for SET OF SELECT, type compatibility with the base-type of the aggregation
type (the select-type) doesn't guarantee type-compatibility with other members
of the aggregate for instance comparison. The problem is that instance
comparison isn't defined on SELECT types per se, so being type-compatible with
the select type doesn't mean much.
In fact, instance comparison and value comparison aren't defined on any
defined data type except enumeration types! Nothing in clause 12.2.2 actually
says that values of SELECT types are compared on the basis of their "declared
types", or that values of other defined data types are compared on the basis
of their fundamental types. From 12.2.1 and 12.2.2, I have no idea how to
compare values declared to be of defined data types! I think they should be
compared on the basis of their fundamental types IF they are type-compatible
on the basis of their declared types.
Further 12.2.2 says the operands of :=: must be type-compatible per 12.11, but
it doesn't say what is returned if they aren't. I suppose it should be ?.
And I read the definition of IN to default to case (e) and return FALSE in all
such cases, but only because none of the other conditions is satisfied.
-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