Version 1.2 of ai12s/ai12-0122-1.txt

Unformatted version of ai12s/ai12-0122-1.txt version 1.2
Other versions for file ai12s/ai12-0122-1.txt

!standard 3.5(15)          14-08-11 AI12-0122-1/01
!class Amendment 14-08-11
!status No Action (7-0-1) 15-06-27
!status work item 14-08-11
!status received 14-06-29
!priority Low
!difficulty Easy
!subject Add 'Base for all types
Add the Base attribute for all types. (??)
Currently, there is no general way to specify a subtype (for use in memeberships, parameters, etc.) without including any subtype predicates. 'Base has the correct effect for scalar subtypes, but of course it is not defined for composite types.
Idea 1: Extend 'Base to all types. This would give a name to the italicized T of lore (and AARM 4.5.1(3.b-i/2)). In particular, T'Base would additionally represent the first subtype of T for tagged types (without any predicate) and a subtype of T without any constraint or null exclusion for other composite types.
Idea 2: Add a new attribute Predicate_Free that represents the prefix subtype without any subtype predicates (but with all constraints and null exclusions).
** TBD.
Note: 'Base is currently defined under "Scalar Types"; it would have to move if extended.
For Idea 1, it appears that detailed effect T'Base would depend on visibility in the case of private types, as a private type can "hide" a constraint. Thus, T'Base of the private type would effectively contain the constraint, while T'Base of the full type (as in the package body) would not contain the constraint. This would pose a possible problem when code is moved to or from the package body.
Whether a similar problem would occur for Idea 2 depends on how it is defined (certainly, predicates can be hidden on the full type).
No ASIS impact.
!ACATS test
An ACATS C-Test is needed to verify that the attribute is implemented as specified.

!topic Use of 'Base to eliminate any subtype predicates on non-scalar types
!reference Ada202x 2012 RM3.2.4(6/4,36/4)
!from Tucker Taft 14-06-29
!keywords subtype predicate, base subtype, non-scalar types

It might make sense to generalize the notion of 'Base to eliminate subtype predicates on 
non-scalar types as well.  Currently 'Base strips off constraints and predicates of scalar 
types (see AI12-0071), but there is no corresponding capability for non-scalar types. 
Perhaps we could invent a new attribute name, such as "'Predicate_Free," if we are worried 
about the removal of constraints associated with 'Base not being well defined on all 
non-scalar types.


Questions? Ask the ACAA Technical Agent