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,x])) ==> x = a [fullSat].

lemma x:bitstring;
  event(B(x)) ==> x = b for { public_vars x }.

(* lemma x:bitstring;
  event(B(x)) ==> x = a;
  event(A(x)) ==> x = b. *)

pred Test(bitstring) [block].


query x:bitstring; event(A(x)) ==> event(B(a)) public_vars x; attacker(x) public_vars x.
noninterf d.
weaksecret d.
query secret x [real_or_random].

process
  (in(c,x:bitstring);
  if x = a
  then
    event A(a);
    out(d,k)
  else
    out(c,ko))

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

(* EXPECTPV
Error: choice can only be used in lemmas when the main query is an equivalence of (bi)processes,
xtime: error in child process (status : 2)
END *)
