mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 13:23:47 +00:00
necessary. -- Estimated hours taken: .1 branches: main. extras/morphine/non-regression-tests/solutions: Remove the fourth argument of filter.Index: non-regression-tests/solutions
25 lines
544 B
Plaintext
25 lines
544 B
Plaintext
%------------------------------------------------------------------------------%
|
|
% 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
|
|
).
|
|
|