Merging subtype constraints (again)
Phil Spiby
Phil.Spiby at eurostep.com
Mon May 13 06:23:01 EDT 2002
Folks,
I was out on Friday and missed some of this argument, but based on what I
can see here...
If motorized_vehicle is in the same scope as the constraint you are trying
to write, then it was combined with the original constraint via ANDOR
anyway, and therefore vehicle&motorized_vehicle WAS in the evaluated set!
Remember that the evaluated set evaluation mechanism considers all members
in a subtype/supertype graph which are visible in the current schema context
when building the evaluated set, not just those with constraints written on
them!
So assuming we have a schema containing:
vehicle,
one_wheel,
two_wheel,
three_wheel,
four_wheel,
motorized_vehicle
The without constraints all the subtypes are ANDOR'd together. If a
constraint is specified, then this constraint is ANDOR'd with those subtypes
not defined in the constraint, i.e.,
ENTITY vehicle ABSTRACT SUPERTYPE OF
(one_wheel ANDOR two_wheel ANDOR three_wheel ANDOR four_wheel); ...
END_ENTITY;
means
ENTITY vehicle ABSTRACT SUPERTYPE OF
((one_wheel ANDOR two_wheel ANDOR three_wheel ANDOR four_wheel) ANDOR
motorized_vehicle); ...
END_ENTITY;
So adding the constraint
SUBTYPE_CONSTRAINT no_motorized_unicycles FOR vehicle;
ONEOF (one_wheel, motorized_vehicle);
END_SUBTYPE_CONSTRAINT;
it would be merged with the above to produce:
ENTITY vehicle ABSTRACT SUPERTYPE OF
(one_wheel ANDOR two_wheel ANDOR three_wheel ANDOR four_wheel ANDOR
ONEOF (one_wheel, motorized_vehicle)); ...
END_ENTITY;
Which is consistent.
Phil
> -----Original Message-----
> From: owner-wg11 at steptools.com [mailto:owner-wg11 at steptools.com]On
> Behalf Of Ed Barkmeyer
> Sent: Friday, May 10, 2002 8:04 PM
> To: Wilson, Peter R
> Cc: 'wg11'
> Subject: Re: Merging subtype constraints (again)
>
>
> "Wilson, Peter R" wrote:
> > Ed, in a message to the exploder on 2002/05/08, made a convincing
> > argument that subtype constraint expressions from different
> > SUBTYPE_CONSTRAINTS for a common entity could be merged by ANDing the
> > expressions.
>
> NO!!! Peter, you misunderstood. (Probably I was not too clear.)
> I said the constraints can be combined by "LOGICAL AND", like RULEs,
> *NOT* "SUPERTYPE AND". "SUPERTYPE AND" is *not* LOGICAL (Boolean) AND;
> it is much more like "SET EQUAL".
>
> > The White Paper on generating long forms stated that in an
> Ed2 to Ed1
> > conversion the constraint expressions should be ANDORed together.
> >
> > Following Ed's argument, the White Paper should be revised
> to specify
> > AND instead of ANDOR.
>
> The White Paper may need revision (I haven't read it since some early
> draft), but it was my impression that it was to be superseded by the
> forthcoming Annex to Part 11 Ed2, anyway.
>
> But AND is wrong in many cases. I think ANDOR works correctly for
> joining AND and ONEOF (and ANDOR) subtype constraints into a
> supertype-expression in a SUPERTYPE OF clause. I'm not sure that
> "joining subtype constraints" by ANDOR (or any other connector)
> is always correct in an ABSTRACT SUPERTYPE OF clause. The ABSTRACT
> SUPERTYPE OF is declaring a TOTAL_OVER constraint, and if you add
> an ANDOR, you are adding things to the list of subtypes whose
> population union covers the population of the supertype. In the
> best of cases, the addition doesn't change the TOTAL_OVER constraint,
> but it makes it less clear. In the worst of cases, it *relaxes the
> constraint*.
>
> For example:
> ENTITY vehicle ABSTRACT SUPERTYPE OF
> (one_wheel ANDOR two_wheel ANDOR three_wheel ANDOR four_wheel); ...
> END_ENTITY;
>
> If I add:
> SUBTYPE_CONSTRAINT wheeledness FOR vehicle;
> ONEOF (one_wheel, two_wheel, three_wheel, four_wheel);
> END_SUBTYPE_CONSTRAINT;
>
> These can be merged by ANDOR:
> ENTITY vehicle ABSTRACT SUPERTYPE OF
> (one_wheel ANDOR two_wheel ANDOR three_wheel ANDOR four_wheel ANDOR
> ONEOF (one_wheel, two_wheel, three_wheel, four_wheel)); ...
> END_ENTITY;
>
> But if instead I add:
> ENTITY motorized_vehicle SUBTYPE OF vehicle; ...
> SUBTYPE_CONSTRAINT no_motorized_unicycles FOR vehicle;
> ONEOF (one_wheel, motorized_vehicle);
> END_SUBTYPE_CONSTRAINT;
>
> it would be merged with the above to produce:
> ENTITY vehicle ABSTRACT SUPERTYPE OF
> (one_wheel ANDOR two_wheel ANDOR three_wheel ANDOR four_wheel ANDOR
> ONEOF (one_wheel, motorized_vehicle)); ...
> END_ENTITY;
>
> And this weakens the original constraint. The original did not accept
> vehicle&motorized_vehicle
> as an evaluated set member. And neither did the subtype constraint.
> Both would require an evaluated set member that contains vehicle to
> contain one of:
> vehicle&one_wheel, vehicle&two_wheel, vehicle&three_wheel, or
> vehicle&four_wheel
> But the proposed merge *does* accept
> vehicle&motorized_vehicle
> as an evaluated set member!
>
> (But ANDing the additional constraint is totally wrong.
> ENTITY vehicle ABSTRACT SUPERTYPE OF
> (one_wheel ANDOR two_wheel ANDOR three_wheel ANDOR four_wheel
> AND ONEOF (one_wheel, motorized_vehicle)); ...
> END_ENTITY;
> disallows bicycles. I.e.
> vehicle&two_wheel
> is not a valid evaluated set member. One of
> vehicle&two_wheel&one_wheel, vehicle&two_wheel&motorized_vehicle
> is required.)
>
> -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