anchor.diff:  
   prop_tcp() ->
     eqc_statem:show_states(
  -  %eqc:dont_print_counterexample(
  +  eqc:dont_print_counterexample(
     with_parameter(default_process, worker,
     with_parameter(color, true,
     ?FORALL(Cmds, commands(?MODULE),
  
positive.code: 
  %% --- syn ---
  
  syn_pre(S) ->
    in_tcp_state(S, listen).
  
  syn_args(S) ->
    [S#state.ip, S#state.port, ip(), port(), uint32()].
  
  syn(Ip, Port, RemoteIp, RemotePort, RemoteSeq) ->
    Packet =
      #pkt{sport = RemotePort,
           dport = Port,
  
negative.code:   inject(RemoteIp, Ip, Data),
    ok.
  
  fin_callouts(Ss, [_Ip, _Port, _RemoteIp, _RemotePort, _Seq, _, Id]) ->
    [ S ] = [ S || S<-Ss, S#state.id == Id ],
    ?INC(Id, rseq),
    ?APPLY(sent_ack, [Id]),
    case S#state.tcp_state of
      established ->
        ?SET(Id, tcp_state, close_wait);
      fin_wait_1 ->
        case S#state.seq == S#state.rcvd of %% FIN+ACK ?
          true ->
            ?UNBLOCK({close, Id}, ok),
            ?SET(Id, tcp_state, time_wait);
          false ->
            ?SET(Id, tcp_state, closing)
        end;
      fin_wait_2  ->
        ?UNBLOCK({close, Id}, ok),
        ?SET(Id, tcp_state, time_wait)
    end.
  
  %% --- deliver ---
  
  %% deliver_pre(S) ->
  %%   S#state.rcvd /= S#state.seq.
  
  deliver_args(Ss) -> 
    [choose(1, length(Ss))].
  
  deliver_pre(Ss, [Id]) ->
    [ S ] = [ S || S<-Ss, S#state.id == Id ],
    S#state.rcvd /= S#state.seq.
  
  deliver(_) -> timer:sleep(1).
  
  deliver_callouts(Ss, [Id]) ->
    [ S ] = [ S || S<-Ss, S#state.id == Id ],
    ?SET(Id, rcvd, S#state.seq).
  
  %% -- Local operations -------------------------------------------------------
  
  reset_callouts(_, [Id]) ->
    ?SET(Id, port,  undefined),
    ?SET(Id, rport, undefined),
    ?SET(Id, seq,   undefined),
    ?SET(Id, rseq,  undefined).
  
  sent_syn_callouts(_, [Id]) ->
    ?MATCH(Packet, ?APPLY(sent, [Id])),
    Port = {call, erlang, element, [#pkt.sport, Packet]},
    ?ASSERT(?MODULE, check_packet, [Packet, '_', '_', [syn]]),
    ?SET(Id, seq, {{call, erlang, element, [#pkt.seq, Packet]}, 1}),
    ?RET(Port).
  
  sent_ack_callouts(Ss, [Id]) ->
    [S] = [ S || S<-Ss, S#state.id == Id],
    ?MATCH(Packet, ?APPLY(sent, [Id])),
    ?ASSERT(?MODULE, check_packet, [Packet, S#state.seq, S#state.rseq, [ack]]),
    ?RET(ok).
  
  sent_fin_callouts(Ss, [Id]) ->
    [S] = [ S || S<-Ss, S#state.id == Id],
    ?MATCH(Packet, ?APPLY(sent, [Id])),
    ?ASSERT(?MODULE, check_packet, [Packet, S#state.seq, S#state.rseq, [ack, fin]]),
    ?INC(Id, seq),
    ?RET(ok).
  
  sent_syn_ack_callouts(Ss, [Id]) ->
    [S] = [ S || S<-Ss, S#state.id == Id],
    ?MATCH(Packet, ?APPLY(sent, [Id])),
    ?ASSERT(?MODULE, check_packet, [Packet, '_', S#state.rseq, [ack, syn]]),
    ?SET(Id, seq, {{call, erlang, element, [#pkt.seq, Packet]}, 1}),
    ?RET(ok).
  
  sent_callouts(Ss, [Id]) ->
    [S] = [ S || S<-Ss, S#state.id == Id],
    ?MATCH({Packet, ok}, ?CALLOUT(ip, send_pkt, [?VAR, S#state.rip], ok)),
    ?ASSERT(?MODULE, verify_checksum, [S#state.ip, S#state.rip, Packet]),
    ?ASSERT(?MODULE, check_ports,     [S#state.port, S#state.rport, Packet]),
    ?RET(Packet).
  
  set_socket_callouts(_, [Id]) ->
    ?MATCH({Socket, ok}, ?CALLOUT(mock, set_socket, [?VAR], ok)),
    ?SET(Id, socket, Socket).
  
  set_next(Ss, _, [Id, Key, Value]) ->
    [ S ] = [ S || S<-Ss, S#state.id == Id],
    (Ss -- [ S ]) ++ [ setelement(Key, S, Value) ].
  
  inc_next(Ss, _, [Id, Key]) ->
    [ S ] = [ S || S<-Ss, S#state.id == Id],
    N = case element(Key, S) of
          {Init, Offs}         -> {Init, Offs + 1};
          M when is_integer(M) -> M + 1;
          undefined -> undefined
        end,
    (Ss -- [ S ]) ++ [ setelement(Key, S, N) ].
  
  check_ports(SPort, DPort, Packet) ->
    conj([tag(source_port,      match(Packet#pkt.sport, SPort)),
  