mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +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.1 KiB
Mathematica
50 lines
1.1 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% The "relative" Benchmark.
|
|
% Part of the DPPD Library.
|
|
%
|
|
% A Lam & Kusalik benchmark which can be fully unfolded. It uses neither
|
|
% negations nor builtins.
|
|
|
|
:- module relative.
|
|
|
|
:- interface.
|
|
|
|
:- pred relative is semidet.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module relative_impl.
|
|
|
|
relative :-
|
|
relative_john(peter).
|
|
|
|
% The partial deduction query
|
|
%
|
|
% :- relative(john, X).
|
|
%
|
|
% The run-time queries
|
|
%
|
|
% :- relative(john, peter).
|
|
%
|
|
% Example solution
|
|
%
|
|
% This benchmark can be fully unfolded. With the ECCE partial deduction system
|
|
% one can obtain the following program, which runs more than 300 times faster
|
|
% than the original:
|
|
%
|
|
% relative__1(anna).
|
|
% relative__1(john).
|
|
% relative__1(carol).
|
|
% relative__1(jonas).
|
|
% relative__1(paulina).
|
|
% relative__1(albertina).
|
|
% relative__1(peter).
|
|
% relative__1(maria).
|
|
% relative__1(mary).
|
|
% relative__1(jose).
|
|
%
|
|
% Michael Leuschel / K.U. Leuven / michael@cs.kuleuven.ac.be
|