free c:channel.

fun enc(bitstring, bitstring): bitstring.
fun dec(bitstring, bitstring): bitstring
reduc forall k,p:bitstring;
  dec(k, enc(k, p)) = p.

letfun decipher(x:bitstring,y:bitstring) =
  if x = y then
    x
  else dec(y,x)
.

set verboseClauses = short.

event A.
query event(A).

process
  in(c,(x:bitstring,y:bitstring));

  let z:bitstring =
    let (t1:bitstring,t2:bitstring) = decipher(x,y) in (
      let z':bitstring =
          let (t1':bitstring,t2':bitstring) = decipher(t1,t2) in
            t1'
          else t2
      in
      t2
    ) else
      y
  in
  event A;
  out(c,z)

(* EXPECTPV
RESULT not event(A) is false.
0.008s (user 0.004s + system 0.004s), max rss 8564K
END *)
