algorithm blocks with generalized transactions

I made one last attempt to present the algorithm blocks in the simplest form I could construct.  If people object (especially @pxinghao) we can simplify algorithm 5 to just evaluate $j = P$ and then return Fail as the predicate.