anchor.diff:    ?SET(Id, rport, RemotePort),
     ?MATCH(Port, ?APPLY(sent_syn, [Id])),
     ?SET(Id, tcp_state, syn_sent),
  +  ?SET(Id, socket_type, connect),
     ?SET(Id, port, Port),
     ?BLOCK({syn_sent, Id}),
     ?PAR([ ?APPLY(set_socket, [Id])
          , ?APPLY(sent_ack, [Id]) ]),
  -  ?SET(Id, socket_type, connect),
     ?SET(Id, tcp_state, established).
   
   %% --- listen ---
  
positive.code:       measure(length, commands_length(Cmds),
        aggregate(TcpStates,
        aggregate(adjacent(TcpStates),
        aggregate(call_features(H),
        eqc_component:pretty_commands(?MODULE, Cmds, {H, S, Res},
          Res == ok))))))
    end))))).
  
negative.code: %% deliver_pre(S) ->
  %%   S#socket.rcvd /= S#socket.seq.
  
  deliver_sockets(S) ->
    [ Sock || Sock <- S#state.sockets,
              Sock#socket.rcvd /= Sock#socket.seq ].
  
  deliver_pre(S) ->
    [] /= deliver_sockets(S).
  
  deliver_args(S) ->
    ?LET(Sock, elements(deliver_sockets(S)),
         [Sock#socket.id]).
  
  deliver_pre(S, [Id]) ->
    lists:member(get_socket(S, Id), deliver_sockets(S)).
  
  deliver(_) -> timer:sleep(1).
  
  deliver_callouts(S, [Id]) ->
    Sock = get_socket(S, Id),
    ?SET(Id, rcvd, Sock#socket.seq).
  
  %% -- Local operations -------------------------------------------------------
  
  