% Works since Prova 1.90
% Empty lists can be used anywhere in sendMsg and reaction rules content parts

mytr() :-
	tr(A),
	println([start, mytr(A)]),
	sendMsg(XID, self, 0, a, A),
	println([sent, mytr(A)]).	

rcvMsg(XID, P, Ag, a, a()) :-
	println([rcv0, a()]).
rcvMsg(XID, P, Ag, a, a(X)) :-
		println([rcv1, a(X)]).
rcvMsg(XID, P, Ag, a, a(X, Y)) :-
	println([rcv2, a(X, Y)]).
rcvMsg(XID, P, Ag, a, a(X, Y, Z)) :-
	println([rcv3, a(X, Y, Z)]).

tr(A) :- tr([], A).
tr(X, a(X)).
tr(X, a(a, X)).
tr(X, a(X, a)).
tr(X, a(a, X, a)).

:- eval(mytr()).
