##############################################################################
##  Author:   C. Rhodes
##  Date:     12/1/93
##  Version:  revision! (not release)
##  Content:  a shell script to set up the appropriate raw data for GAP
##            to create library routines.
##############################################################################
# set up the compression routine for CAYLEY

echo 'padicCompress := function (d,n,p,cc,s)'
echo 'local value, I;'
echo 'value :=0;'

echo 'for I in [1..Length(s)] do'
echo 'value := value + s[I]*p^(I-1);'
echo 'od;'

# and now set up it's data
# this is a library file so...

# now for the actual sequences!

echo 'AppendTo ("gap_temp","["',d,'" , "',n,'" , "',cc,'" , "',value,'"]\n"' ");"
echo "end;"

# this part of the code performs the stream editing necessary to dig out the 
# values and call GAP
# the first four fields separated by tabs are d,n,p,cc the last is the 
# padic expansion of the integer.
 
    awk ' {
   	 printf "padicCompress(%d,%d,%d,%d,[", $1, $2, $3, $4
	 printf "%s]);\n",$5
    }'

# and we should have got the output lines


