The set of specialized array element types must be closed under intersection 
Author Message
 The set of specialized array element types must be closed under intersection

Thinking some more about UPGRADED-ARRAY-ELEMENT-TYPE, I've realized
that the axiom (section 15.1.2.1 of the CLHS, paragraph 3):

    T1 is a subtype of T2 ==> UAET(T1) is a subtype of UAET(T2)

implies that if two types T3 and T4 are specialized array element
types (that is, T3 is type-equivalent to UAET(T3) and the same for
T4), then UAET( (AND T3 T4) ) must be type-equivalent to (AND T3 T4).
That is, (AND T3 T4) is also (equivalent to) a specialized array
element type.

For example, if (signed-byte 32) and (unsigned-byte 32) are specialized
array element types, then so must be (unsigned-byte 31).

AFAICT, no CL implementation satisfies this part of the specification.

        Paul



Wed, 05 Oct 2005 00:13:05 GMT  
 The set of specialized array element types must be closed under intersection

Quote:
> Thinking some more about UPGRADED-ARRAY-ELEMENT-TYPE, I've
> realized that the axiom (section 15.1.2.1 of the CLHS,
> paragraph 3):

>     T1 is a subtype of T2 ==> UAET(T1) is a subtype of UAET(T2)

> implies that if two types T3 and T4 are specialized array
> element types (that is, T3 is type-equivalent to UAET(T3) and
> the same for T4), then UAET( (AND T3 T4) ) must be
> type-equivalent to (AND T3 T4).  That is, (AND T3 T4) is also
> (equivalent to) a specialized array element type.

Darn, that's an excellent one: Congratulations!

Quote:
> For example, if (signed-byte 32) and (unsigned-byte 32) are
> specialized array element types, then so must be (unsigned-byte
> 31).

> AFAICT, no CL implementation satisfies this part of the
> specification.

Thank god, it seems fixable even without adding a million of new
specialized array types (I think).

Regards,
--
Nils G?sche
Ask not for whom the <CONTROL-G> tolls.

PGP key ID #xD26EF2A0



Wed, 05 Oct 2005 01:36:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. specialize method based on array element type

2. member types and array-element-type?

3. (typep (make-array 10 :element-type 'bit) '(array bit (10)))

4. Shifting array element & regex on array element

5. setting property of each element in an array

6. FFI question: Setting array elements

7. Cannot set env array element via upvar #0

8. BUG: array traces and setting elements via upvar

9. access type referencing nested array element

10. UPGRADED-ARRAY-ELEMENT-TYPE

11. (upgraded-array-element-type nil)

12. upgraded-array-element-type

 

 
Powered by phpBB® Forum Software