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

fun h(bitstring):bitstring.

const a,b:bitstring.

event A(bitstring).
event B(bitstring).

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

axiom x:bitstring,y:bitstring; event(A(choice[x,y])) ==> x = a for { secret x [real_or_random] } [fullSat].
axiom x:bitstring,y:bitstring; event(B(choice[x,y])) ==> x = a [fullSat].

(*nounif x:bitstring, y:bitstring;
  mess(d,choice[x,*y]).
*)

nounif x:bitstring; mess(c,(new k[x = choice[a,b]],x)).
nounif x:bitstring,y:bitstring; mess(c,(new k[x = a;y=b],choice[x,y])).

not x:bitstring; attacker((new k[x = choice[a,b]],x)).
not x:bitstring, y:bitstring; attacker((new k[x = a;y=b],choice[x,y])).

process
  !(in(c,x:bitstring);
  in(c,y:bitstring);
  if x = a
  then
    new k:bitstring;
    event A(choice[a,a]);
    out(d,k)
  else
    out(c,ko))

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

(* EXPECTPV
Error: Lemma not used because there is no matching query.
xtime: error in child process (status : 2)
END *)
