CVS difference for ai12s/ai12-0068-1.txt

Differences between 1.2 and version 1.3
Log of other versions for file ai12s/ai12-0068-1.txt

--- ai12s/ai12-0068-1.txt	2013/06/11 01:01:49	1.2
+++ ai12s/ai12-0068-1.txt	2014/02/09 23:00:29	1.3
@@ -1,4 +1,4 @@
-!standard 3.10.2(7/3)                              13-05-30    AI12-0068-1/00
+!standard 3.10.2(7/3)                              14-02-09    AI12-0068-1/00
 !class binding interpretation 13-05-30
 !status work item 13-05-30
 !status received 13-04-20
@@ -42,6 +42,13 @@
 object, or is this check on a value and the properties of the object aren't
 querable? (Something. :-)
 
+In a related question, is the nominal subtype of the current instance of
+a type or subtype defined? This matters in case expressions. Given this example,
+
+    subtype S is Natural with Dynamic_Predicate => (case S is ...
+
+is coverage of the negative values required or forbidden? (Forbidden.)
+
 !recommendation
 
 (See !summary.)
@@ -365,3 +372,219 @@
 
 ****************************************************************
 
+From: Steve Baird
+Sent: Friday, November 22, 2013  5:08 PM
+
+Is the nominal subtype of the current instance of a type or subtype defined
+anywhere? It certainly is not defined in 8.6(17/3).
+
+See AI05-0006 for an explanation of why anyone would care.
+
+I noticed this in the context of ignored subtype predicates.
+
+Randy - do I get Brownie points for sending this as
+  a separate message?
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Friday, November 22, 2013  6:54 PM
+
+...
+> Randy - do I get Brownie points for sending this as
+>   a separate message?
+
+Yes, you get 2 Brownie points for this. Of course, you need 1000 Brownie points
+in order to be able to redeem them for an official ARG keychain. ;-)
+
+****************************************************************
+
+From: Steve Baird
+Sent: Friday, November 22, 2013  6:11 PM
+
+> See AI05-0006 for an explanation of why anyone would care.
+The short explanation is "case expressions".
+
+Given this example,
+
+    subtype S is Natural with Dynamic_Predicate => (case S is ...
+
+is coverage of the negative values required or forbidden?
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Friday, November 22, 2013  6:22 PM
+
+> Given this example,
+>
+>      subtype S is Natural with Dynamic_Predicate => (case S is ...
+>
+> is coverage of the negative values required or forbidden?
+
+I would say required ... you certainly can't have the case statement assuming
+that S is in Natural range, that would be non-conforming (erreoneousness arising
+from bounded error)
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Friday, November 22, 2013  6:43 PM
+
+I'm not sure I agree.  The subtype constraints are evaluated *before* the
+dynamic predicate (according to the new AI), so by the time you get to the case
+expression, it would be annoying to have to worry about values that didn't
+satisfy the constraints (presuming they are static).
+
+I guess to me the "obvious" ;-) answer is that the nominal subtype is the
+subtype before applying the predicate.
+
+****************************************************************
+
+From: Steve Baird
+Sent: Friday, November 22, 2013  6:52 PM
+
+That was my thinking too.
+
+Is there agreement that the current RM wording doesn't provide an answer for
+this question (because the nominal subtype of the current instance of a subtype
+is never defined)?
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Friday, November 22, 2013  6:53 PM
+
+> > Given this example,
+> >
+> >      subtype S is Natural with Dynamic_Predicate => (case S is ...
+> >
+> > is coverage of the negative values required or forbidden?
+>
+> I would say required ... you certainly can't have the case statement
+> assuming that S is in Natural range, that would be non-conforming
+> (erreoneousness arising from bounded error)
+
+Not sure why you would say that. AI12-0071-1 requires that the constraint check
+be made first before evaluating the predicate, so no value out of the range of
+Natural should ever be presented to the predicate. Moreover, if the check is
+suppressed, then the code is erroneous for failing a suppressed check, so we
+don't need to protect against that, either. Finally, case statements and
+expressions require a test that the value is in the base type (this is not a
+check, it can't be suppressed). So I don't think there is any semantic need for
+the base range be covered.
+
+Having said that, we might still prefer such a model as it is simpler than
+basing it on the subtype_mark given in the subtype_declaration (this thing
+unfortunately does not have an official name and it is always awkward to refer
+to it in formal wording).
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Friday, November 22, 2013  6:58 PM
+
+> Is the nominal subtype of the current instance of a type or subtype
+> defined anywhere? It certainly is not defined in 8.6(17/3).
+
+BTW, I'd recommend that this get added to AI12-0068-1, which is supposed to
+define the meaning of the current instance of a subtype. We might as well get
+the nominal subtype defined at the same time (given that the entire concept
+isn't defined in the currrent RM, the subtype is just a tiny corner).
+
+Mr. Taft has that AI assigned to him and he didn't get to it for the recent
+meeting. So he should add this topic to his homework.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Friday, November 22, 2013  7:00 PM
+
+...
+> Is there agreement that the current RM wording doesn't provide an
+> answer for this question (because the nominal subtype of the current
+> instance of a subtype is never defined)?
+
+Since the current instance of a subtype is not defined by the current RM wording
+(remember AI12-0068-1?), I think it is pretty likely that the nominal subtype of
+it isn't defined, either. :-)
+
+The nominal subtype of a current instance of a type probably isn't defined,
+either; that probably ought to be the base type of the type. (Although I don't
+think that one can use that current instance in a way where it would matter.)
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Friday, November 22, 2013  7:19 PM
+
+> Is there agreement that the current RM wording doesn't provide an
+> answer for this question (because the nominal subtype of the current
+> instance of a subtype is never defined)?
+
+Well it's sort of obvious what the nominal subtype is, even if not formally
+defined, any other choice would be absurd, and we are not allowed absurd
+conclusions, so by the Sherlock Holmes rule the NS *is* defined, and indeed I
+agree, negative values need not be covered (but must in the general case be
+checked for!)
+
+****************************************************************
+
+From: Steve Baird
+Sent: Friday, November 22, 2013  7:47 PM
+
+> The nominal subtype of a current instance of a type probably isn't
+> defined, either; that probably ought to be the base type of the type.
+
+Even that isn't obvious in the case of a derived type.
+
+Or a type like
+    type T is range 1 .. 10 with Dynamic_Predicate => (case T ...
+
+(although there is a derived type hiding in there somewhere, so perhaps this
+isn't really a different case).
+
+> BTW, I'd recommend that this get added to AI12-0068-1
+
+Good point. I had forgotten about this AI and I agree that this issue should be
+addressed there.
+
+****************************************************************
+
+From: Geert Bosch
+Sent: Friday, November 22, 2013  10:36 PM
+
+> I'm not sure I agree.  The subtype constraints are evaluated *before* the
+> dynamic predicate (according to the new AI), so by the time you get to the case
+> expression, it would be annoying to have to worry about values that didn't
+> satisfy the constraints (presuming they are static).
+>
+> I guess to me the "obvious" ;-) answer is that the nominal subtype is the
+> subtype before applying the predicate.
+
+Right. We'd always be free to check the subtype first.
+
+****************************************************************
+
+From: Steve Baird
+Sent: Monday, November 25, 2013  1:20 PM
+
+I think it is important that AI12-0071 (which, to be sure, hasn't been approved
+yet) says that checking the other stuff before evaluating the  predicate is
+required, not just allowed.
+
+Without AI12-0071 (i.e., if this order was allowed but not
+required) my opinion on this nominal subtype question would be different.
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Monday, November 25, 2013  8:36 PM
+
+> I think it is important that AI12-0071 (which, to be sure, hasn't been
+> approved yet) says that checking the other stuff before evaluating the
+> predicate is required, not just allowed.
+
+That is what it says now (or at least that was my intent).
+
+****************************************************************

Questions? Ask the ACAA Technical Agent