free c:channel.

fun h(bitstring):bitstring.

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

(*query i:time, j:time, x:bitstring;
  event(A(x))@i && event(B(x))@j ==> event(A(x)).

query i:time, j:time, x:bitstring;
  event(A(x))@i && event(B(x))@j ==> i < j.

query i:time, j:time, x:bitstring;
  event(A(x))@i && event(B(x))@j ==> i = j.

query i:time, j:time, k:time, z:time, x:bitstring, y:bitstring;
  event(A(x))@i && event(B(x))@j ==> (event(A(y))@k ==> event(B(y))@z && z >= k).

query i:time, j:time, k:time, z:time, x:bitstring, y:bitstring;
  event(A(x))@i && event(B(x))@j ==> (event(A(y))@k ==> event(B(y))@z && z >= j).

query i:time, j:time, k:time, z:time, x:bitstring, y:bitstring;
  event(A(x))@i && event(B(x))@j ==> (event(A(y))@k ==> event(B(y))@z && z > j).
*)
query i:time, j:time, k:time, z:time, x:bitstring, y:bitstring;
  event(A(x))@i && event(B(x))@j ==> (event(A(y))@k ==> (event(B(y)) ==> event(A(x)))).

(*)
query i:time, j:time, x:bitstring;
  inj-event(A(x))@i && event(B(x))@j ==> i = j.

query i:time, j:time, k:time, z:time, x:bitstring, y:bitstring;
  event(A(x))@i && inj-event(B(x))@j ==> (inj-event(A(y))@k ==> inj-event(B(y))@z && z >= k).

query i:time, j:time, k:time, z:time, x:bitstring, y:bitstring;
  inj-event(A(x))@i && inj-event(B(x))@j ==> (event(A(y))@k ==> inj-event(B(y))@z && z >= j).

query i:time, j:time, k:time, z:time, x:bitstring, y:bitstring;
  event(A(x))@i && inj-event(B(x))@j ==> (inj-event(A(y))@k ==> inj-event(B(y))@z && z > j).

query i:time, j:time, k:time, z:time, x:bitstring, y:bitstring;
  event(A(x))@i && inj-event(B(x))@j ==> (event(A(y))@k ==> (inj-event(B(y)) ==> event(A(x)))).

query i:time, j:time, k:time, z:time, x:bitstring, y:bitstring;
  event(A(x))@i && inj-event(B(x))@j ==> (event(A(y))@k ==> (inj-event(B(y)) ==> event(A(x))) || k < j).
*)
process
  in(c,x:bitstring);
  event A(x);
  event B(x)

(* EXPECTPV
RESULT event(A(x_1))@i && event(B(x_1))@j ==> (event(A(y))@k ==> (event(B(y)) ==> event(A(x_1)))) is false.
RESULT (query encoded as event(A(x_1)) && event(B(x_1)) ==> (event(v,B(y)) ==> event(A(x_1))) && (event(A(y)) ==> event(v,B(y))))
RESULT (but event(A(x_1)) && event(B(x_1)) ==> event(v,B(y)) && event(A(x_1)) && event(A(y)) && event(v,B(y)) is true.)
0.012s (user 0.012s + system 0.000s), max rss 7472K
END *)
