Rather something like:
RXORCLOSE(c_j, v_j, VAR closed: BOOLEAN) DO Sj
as an additional guard seems necessary, otherwise these two send side sequences can not be distinguished: SEND(ch, 'a'); SEND(ch, 'a'); CLOSE(ch)
SEND(ch, 'a'); CLOSE(ch)
Or am I missing something?(and FWIW, discarding the SELECT() in favour of the WITH scheme would strike me as preferable)