Question: Error, invalid subscript selector

Error, invalid subscript selector
WeilP:
   7       PS1 := temp[1];
============================================

WeilP:=proc(m, P1, P2, Q1, Q2, f, p) 
local S1, S2, gP, gQ, temp, PS1, PS2, QS1, QS2;
    if [P1,P2] = [Q1, Q2] mod p then
        return 1 ;
        else  
            # [S1, S2] := EAdd( f, x, P1, P2, Q1, Q2); 
            temp := EAdd( f, x, p, P1, P2, Q1, Q2);
            S1:= temp[1];
            S2:=temp[2];
        temp := EAdd( f, x, p, P1, P2, S1, -S2);   #represents P-S  
            PS1:= temp[1];
            PS2:=temp[2];
        temp := EAdd( f, x, p, Q1, Q2, S1, S2);    #Q+S
        QS1:=temp[1];
        QS2:=temp[2];
    #        gP:=Weil( m, P1,P2, f, p ); 
    #        gQ:=Weil( m, Q1,Q2, f, p );
    return 0
#    return Normal(  ( Eval(gP, { x=QS1, y=QS2 } ) * Eval(gQ, {x=S1, y= -S2} ) )  / ( Eval(gP, { x=PS1, y=PS2 } ) * Eval(gQ, {x=S1, y= -S2} ) )   )  mod p;    # ( f_P(Q+S) f_Q(-S)  ) / ( f_Q(P-S) f_P(S)  )
    end if ;

Here EAdd is elliptic curve addition   

I tried evaluating the code outside the code edit region and it seemed to work okay  temp ends up being the vector 

p.s. how do I get maple to save the values of a procedure rather than deleting them? 

how do I view variable values during debugging? 

 

Please Wait...