free c:channel.

fun h(bitstring):bitstring.

const a,b:bitstring.

event A(bitstring).
event B(bitstring).
event C(bitstring).
free k:bitstring [private].
const ok,ko:bitstring.

lemma x:bitstring,y:bitstring; event(A(choice[x,y])) ==> x=b [maxSubset].

lemma x:bitstring,y:bitstring; attacker(choice[k,x]) [maxSubset].

lemma x:bitstring,y:bitstring; event(A(x)) && event(C(x)) ==> x=b.

lemma x:bitstring,y:bitstring; event(C(x)) ==> x=b && event(A(x)).

lemma x:bitstring,y:bitstring; event(C(x)) ==> x=b || event(A(x)).

process
  ! in(c,x:bitstring);
  if x = diff[a,a]
  then

    out(c,diff[k,h(k)]);
    event A(choice[a,b]);
    out(c,ok)
  else
    out(c,ko)

(* EXPECTPV
RESULT event(A(choice[x_1,y])) ==> x_1 = b is false.
RESULT not attacker(choice[k[],x_1]) is false.
RESULT event(A(x_1)) && event(C(x_1)) ==> x_1 = b is true.
RESULT event(C(x_1)) ==> x_1 = b && event(A(x_1)) is true.
RESULT event(C(x_1)) ==> x_1 = b || event(A(x_1)) is true.
RESULT Observational equivalence is true.
0.124s (user 0.084s + system 0.040s), max rss 9412K
END *)
