free c:channel.
free d:channel [private].

fun h(bitstring):bitstring.

const a,b:bitstring.

event A(nat,bitstring).
event B(bitstring).

const ok,ko,k:bitstring[private].

set verboseLemmas = true.

axiom i:nat, i':nat, x:bitstring,y:bitstring; event(A(i,new k''[x=y])) ==> y=a || event(B(y)).

query attacker(ok).

process
  (in(c,x:bitstring);
  in(c,i:nat);
  if x = a
  then
    new k':bitstring;
    event A(i,k');
    out(d,k')
  else
    new k'':bitstring;
    event A(i,k'');
    out(c,ok))

  | in(d,x:bitstring); out(c,ko)

(* EXPECTPV
RESULT not attacker(ok) is false.
0.004s (user 0.004s + system 0.000s), max rss 7612K
END *)
