mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-25 06:14:18 +00:00
Estimated hours taken: 0.1 Add the DPPD (dozens of problems in partial deduction) suite to the tests directory.
25 lines
295 B
Mathematica
25 lines
295 B
Mathematica
|
|
:- module remove_impl.
|
|
|
|
:- interface.
|
|
|
|
:- import_module list.
|
|
|
|
:- pred rr(list(T)::in, list(T)::out) is det.
|
|
|
|
:- implementation.
|
|
|
|
rr(X,Y) :- r(X,T), r(T,Y).
|
|
|
|
:- pred r(list(T)::in, list(T)::out) is det.
|
|
|
|
r([],[]).
|
|
r([X],[X]).
|
|
r([X,Y|T],[X|T1]) :-
|
|
( X = Y ->
|
|
r(T,T1)
|
|
;
|
|
r([Y | T], T1)
|
|
).
|
|
|