mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-05-01 17:24:34 +00:00
Estimated hours taken: 0.1 Add the DPPD (dozens of problems in partial deduction) suite to the tests directory.
23 lines
389 B
Mathematica
23 lines
389 B
Mathematica
:- module doubleapp_impl.
|
|
|
|
:- interface.
|
|
|
|
:- import_module list.
|
|
|
|
:- pred double_app(list(T), list(T), list(T), list(T)).
|
|
:- mode double_app(in, in, in, out) is det.
|
|
|
|
:- implementation.
|
|
|
|
double_app(X,Y,Z,Res) :-
|
|
app(X,Y,Int),
|
|
app(Int,Z,Res).
|
|
|
|
:- pred app(list(T), list(T), list(T)).
|
|
:- mode app(in, in, out) is det.
|
|
|
|
app([],L,L).
|
|
app([H|X],Y,[H|Z]) :-
|
|
app(X,Y,Z).
|
|
|