[comp.lang.fortran] IDENTIFY statement in Fortran 8x

whit@pitt.UUCP (Debbie Whitfield) (01/17/89)

    As I was reading the ACM TOPLAS, Oct. 1987, article written by
Randy Allen and Ken Kennedy (Automatic Translation of FORTRAN Programs
to Vector Form), I ran across the IDENTIFY construct.  Their example
is:

       IDENTIFY /1:M/ D(I) = C(I,I+1)

which is a pseudonym for the diagonal of an array. I am curious about
what is considered as a valid expression for describing elements of C.  
Can any expression be used?  What about function calls?

How would this be implemented?  Does the expression have to be
computable at compile time or run time?

     This is the only example of the IDENTIFY statement I've seen.
I'd appreciate other examples and any answers to the questions I've
posed above.

Debbie Whitfield

--------------------------------------------------------------------------
Debbie Whitfield	UUCP:      psuvax1!pitt!whit or {allegra,cadre}!...
Univ. of Pittsburgh		   whit@pitt.uucp
Computer Science Dept.	Internet:  whit@vax.cs.pittsburgh.edu
313 M.I.B.		CSNET:     whit@pitt.csnet
Pittsburgh, PA 15260	

jlg@lanl.gov (Jim Giles) (01/18/89)

From article <4462@pitt.UUCP>, by whit@pitt.UUCP (Debbie Whitfield):
>        IDENTIFY /1:M/ D(I) = C(I,I+1)
> 
> which is a pseudonym for the diagonal of an array. I am curious about
> what is considered as a valid expression for describing elements of C.  
> Can any expression be used?  What about function calls?

The actual syntax of IDENTIFY was as follows:

      IDENTIFY (DIAG(I)=ARRAY(I,I), I=1:N)  !8X standard 6.2.6.2

The allowed subscript expressions for ARRAY must be linear in I.  A
multi-dimensional IDENTIFY is also possible:

      IDENTIFY (X(I,J) = A(3*I+5,J+I,4,2*J), I=1:N, J=1:M)

Each subscript expression must be linear and the subscript names must
appear, at most, once in each subscript expression.  Note that the subscript
expressions need not contain the subscript names from the 'parent' array
at all (like the constant '4' in the example).  Note also that the prohi-
bition against non-linear expressions also prohibits function calls.

The question is moot however, since the latest standard has eliminated
IDENTIFY.

J. Giles

david@june.cs.washington.edu (David Callahan) (01/18/89)

In article <4462@pitt.UUCP> whit@pitt.UUCP (Debbie Whitfield) writes:
>    As I was reading the ACM TOPLAS, Oct. 1987, article written by
>Randy Allen and Ken Kennedy (Automatic Translation of FORTRAN Programs
>to Vector Form), I ran across the IDENTIFY construct.  Their example
>is:

>       IDENTIFY /1:M/ D(I) = C(I,I+1)

>which is a pseudonym for the diagonal of an array. I am curious about
>what is considered as a valid expression for describing elements of C.  
>Can any expression be used?  What about function calls?

J. Giles has pointed out that this syntax is not current. The first
draft of the Allen-Kennedy paper was in 1982 and neither the paper
nor the tool they discuess has kept up with Fortran 8X sincey then,

>How would this be implemented?  Does the expression have to be
>computable at compile time or run time?

The restrictions are that, at the time the statement is 
executed, that each subscript in the base array (C in this 
example) is a linear combination of the subscripts of the
virtual array plus constants. Each subscript expression in 
the identify statement defines an affine map into the integers.
Collectively these maps define an affine map from Z^n into Z^m
where Z is the set of integers and n is the dimensionality of the
virtual array (D) and m is the dimensionality of the base 
array (C). 

Assuming that each array has a "dope vector" which defines 
an affine function from subscript values into "memory", the
dope vector for the virtual array is computed by composing
the dope vector for the base array with the affine map
defined by the IDENTIFY statement. This amounts to (in the 
general case) multiplication of a vector by a matrix to 
get a new vector. 


David Callan, Tera Computer,  Seattle WA.