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,x)) && subterm(new k'[i=i'],x) ==> i' < i.

query attacker(ok).

process
  (in(c,x:bitstring);
  in(c,i:nat);
  if x = a
  then

    new k':bitstring;
    event A(i,h(k'));
    out(d,k')
  else
    out(c,ko))

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

(* EXPECTPV
RESULT not attacker(ok) is true.
0.008s (user 0.004s + system 0.004s), max rss 7368K
END *)
