let reverse_pr (z:var a) (x:var a) = let n = lendim #x in for i