free c:channel.

fun h(bitstring):bitstring.

const a,b:bitstring.

event A(bitstring).

const ok,ko:bitstring.

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

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

query x:bitstring;
  event(A(x));
  event(A(x)) ==> x=h(a).

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

(* EXPECTPV
RESULT event(A(x_1)) ==> x_1 = b is false.
RESULT event(A(x_1)) ==> x_1 = a is true.
RESULT event(A(x_1)) ==> x_1 = h(b) is false.
RESULT event(A(x_1)) ==> x_1 = h(a) is false.
RESULT not event(A(x_1)) is false.
RESULT event(A(x_1)) ==> x_1 = h(a) is false.
0.020s (user 0.008s + system 0.012s), max rss 8488K
END *)
