setarg/3

"setarg(+ I,+ S,? T" )

Set the value of the I_th argument of term _S to term T.