mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-21 20:33:55 +00:00
tests/declarative_debugger/*.m:
tests/exceptions/*.m:
tests/general/*.m:
tests/grade_subdirs/*.m:
tests/purity/*.m:
tests/submodules/*.m:
tests/typeclasses/*.m:
Update programming style.
tests/declarative_debugger/*.inp:
Update line numbers in breakpoint commands.
tests/declarative_debugger/*.exp:
Update expected line numbers.
tests/exceptions/Mercury.options:
tests/general/Mercury.options:
Disable some warnings that are irrelevant to the test.
41 lines
968 B
Mathematica
41 lines
968 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% This tests whether the program as transformed by dnf still works.
|
|
% It does not (cannot) test whether dnf is applied, of course.
|
|
|
|
:- module dnf.
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module list.
|
|
:- import_module std_util.
|
|
|
|
main(!IO) :-
|
|
solutions(
|
|
( pred(Pair::out) is multi :-
|
|
Pair = X - Y,
|
|
q(X, Y)
|
|
), List),
|
|
print_list(List, !IO).
|
|
|
|
:- pred print_list(list(pair(int))::in, io::di, io::uo) is det.
|
|
|
|
print_list([], !IO) :-
|
|
print_list([X - Y | XYs], !IO) :-
|
|
io.format("X = %d, Y = %d\n", [i(X), i(Y)], !IO),
|
|
print_list(XYs, !IO).
|
|
|
|
:- pred q(int::out, int::out) is multidet.
|
|
|
|
:- pragma(memo, q/2).
|
|
|
|
q(X, Y) :-
|
|
( X = 1 ; X = 2 ),
|
|
( Y = 41 ; Y = 42 ).
|