mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the debugger tests,
specify the new line numbers in .inp files and expect them in .exp files.
50 lines
1.3 KiB
Mathematica
50 lines
1.3 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% The "remove" Benchmark.
|
|
% Part of the DPPD Library.
|
|
%
|
|
% This is a rather sophisticated deforestation example, handed over to me
|
|
% by Jesper Jorgensen.
|
|
|
|
:- module remove.
|
|
|
|
:- interface.
|
|
|
|
:- pred remove is semidet.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module list.
|
|
:- import_module remove_impl.
|
|
:- import_module run.
|
|
|
|
remove :-
|
|
rr([a, a, b, b, a, a, a, a, c, d, a, b, a, a, d, d], Y),
|
|
use(Y),
|
|
rr([a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t,
|
|
u, v, w, x, y, z], Z),
|
|
use(Z),
|
|
rr([a, b, b, b, c, d, e, f, g, g, h, i, j, k, l, m, m, m, m, m, m, m, m,
|
|
n, o, p, q, r, s, t, u, v, v, v, v, w, x, y, z, z, z], ZZ),
|
|
use(ZZ).
|
|
|
|
% The partial deduction query
|
|
%
|
|
% :- rr(X, Y).
|
|
%
|
|
% The run-time queries
|
|
%
|
|
% :- rr([a, a, b, b, a, a, a, a, c, d, a, b, a, a, d, d], Y).
|
|
% :- rr([a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r,
|
|
% s, t, u, v, w, x, y, z], Y).
|
|
% :- rr([a, b, b, b, c, d, e, f, g, g, h, i, j, k, l, m, m, m, m, m, m, m, m,
|
|
% n, o, p, q, r, s, t, u, v, v, v, v, w, x, y, z, z, z], Y).
|
|
%
|
|
% Example solution
|
|
%
|
|
% to be inserted
|
|
%
|
|
% Michael Leuschel / K.U. Leuven / michael@cs.kuleuven.ac.be
|