%------------------------------------------------------------------------------%
% Copyright (C) 1999-2001 INRIA/INSA.
% 
% Author : Erwan Jahier <jahier@irisa.fr>
%
% define a monitor that collect solutions

:- import_module list.

:- type accumulator_type == list(solutions).
:- type solutions ---> sol(procedure, arguments).

initialize([]).

filter(Event, AccIn, AccOut) :-
	( 
		port(Event) = exit,
		not(member(sol(proc(Event), arguments(Event)), AccIn))
	->
		AccOut = [sol(proc(Event), arguments(Event))|AccIn]
	;
		AccOut = AccIn
	).

